diff --git a/backends/3ds/CMakeLists.txt b/backends/3ds/CMakeLists.txt index 186e136..0af58ea 100755 --- a/backends/3ds/CMakeLists.txt +++ b/backends/3ds/CMakeLists.txt @@ -9,11 +9,11 @@ set(SRC ) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libpicasso) add_library(pd-3ds STATIC ${SRC}) -target_include_directories(pd-3ds PUBLIC - PUBLIC +target_include_directories(pd-3ds PUBLIC + PUBLIC $ $ - ) +) target_link_libraries(pd-3ds PUBLIC m palladium ctru citro3d pica::pica) add_library(palladium::pd-3ds ALIAS pd-3ds) install(TARGETS pd-3ds @@ -34,4 +34,4 @@ install(TARGETS pica LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) \ No newline at end of file +) diff --git a/backends/3ds/libpicasso b/backends/3ds/libpicasso index 5d47f32..a6b1e8d 160000 --- a/backends/3ds/libpicasso +++ b/backends/3ds/libpicasso @@ -1 +1 @@ -Subproject commit 5d47f32928a62795255e3dcecf8edba5274ae758 +Subproject commit a6b1e8ddbda00335e5e5aac646a6bcc224a084b3 diff --git a/backends/3ds/source/bknd-gfx.cpp b/backends/3ds/source/bknd-gfx.cpp index 633fb21..b109608 100755 --- a/backends/3ds/source/bknd-gfx.cpp +++ b/backends/3ds/source/bknd-gfx.cpp @@ -180,8 +180,10 @@ void GfxC3D::RenderDrawData(const PD::Li::CmdPool& Commands) { if (ScissorEnabled) { // Figure out this setup was pain C3D_SetScissor(GPU_SCISSOR_NORMAL, - ViewPort.y - (ScissorRect.y + ScissorRect.w), - ViewPort.x - (ScissorRect.x + ScissorRect.z), + std::clamp(ViewPort.y - (ScissorRect.y + ScissorRect.w), 0, + ViewPort.y), + std::clamp(ViewPort.x - (ScissorRect.x + ScissorRect.z), 0, + ViewPort.x), ViewPort.y - ScissorRect.y, ViewPort.x - ScissorRect.x); } else { C3D_SetScissor(GPU_SCISSOR_DISABLE, 0, 0, 0, 0); diff --git a/include/pd/core/strings.hpp b/include/pd/core/strings.hpp index 1a90941..9c53eba 100644 --- a/include/pd/core/strings.hpp +++ b/include/pd/core/strings.hpp @@ -153,7 +153,7 @@ class U8Iterator { } bool PeekNext32(u32& ret) { - if (ptr + 1 == nullptr || *ptr + 1 == 0) return false; + // if ((ptr + 1) == 0 || *(ptr + 1) == 0) return false; u8 c = *ptr; if (c < 0x80) { ret = c; diff --git a/include/pd/ui7/container/image.hpp b/include/pd/ui7/container/image.hpp index 3550ffd..d124c3c 100755 --- a/include/pd/ui7/container/image.hpp +++ b/include/pd/ui7/container/image.hpp @@ -38,6 +38,7 @@ class PD_API Image : public Container { * @param size Custom Size of the Image */ Image(Li::Texture::Ref img, fvec2 size = 0.f, Li::Rect uv = fvec4(0.f)) { + if (!img) return; this->img = img; if (size == fvec2(0.f)) { size = img->GetSize(); @@ -60,9 +61,9 @@ class PD_API Image : public Container { void Draw() override; private: - Li::Texture::Ref img; ///< Texture reference to the Image - fvec2 newsize = 0.f; ///< New Size - Li::Rect cuv; ///< Custom UV + Li::Texture::Ref img = nullptr; ///< Texture reference to the Image + fvec2 newsize = 0.f; ///< New Size + Li::Rect cuv; ///< Custom UV }; } // namespace UI7 } // namespace PD \ No newline at end of file diff --git a/source/ui7/container/image.cpp b/source/ui7/container/image.cpp index 662401c..469dd74 100755 --- a/source/ui7/container/image.cpp +++ b/source/ui7/container/image.cpp @@ -26,6 +26,7 @@ SOFTWARE. namespace PD { namespace UI7 { PD_API void Image::Draw() { + if (!img) return; // Assert(io.get() && list.get(), "Did you run Container::Init correctly?"); // Assert(img.get(), "Image is nullptr!"); // io->Ren->OnScreen(screen);