# split pd-maths into pd-core and pd-image (0.2.3)
This commit is contained in:
		| @@ -42,7 +42,7 @@ execute_process( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| # Set Project | # Set Project | ||||||
| project(palladium LANGUAGES C CXX VERSION 0.2.2) | project(palladium LANGUAGES C CXX VERSION 0.2.3) | ||||||
|  |  | ||||||
| option(PD_BUILD_TESTS "Sets if TestApp and TestBench get build" OFF) | option(PD_BUILD_TESTS "Sets if TestApp and TestBench get build" OFF) | ||||||
|  |  | ||||||
| @@ -57,32 +57,31 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE) | |||||||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-psabi -O2") | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-psabi -O2") | ||||||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions") | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions") | ||||||
|  |  | ||||||
|  | ## Core Source Code | ||||||
| set(CORE_SRC | set(CORE_SRC | ||||||
| source/core/common.cpp | source/core/common.cpp | ||||||
|  | source/core/bit_util.cpp | ||||||
|  | source/core/color.cpp | ||||||
| source/core/io.cpp | source/core/io.cpp | ||||||
| source/core/strings.cpp | source/core/strings.cpp | ||||||
| source/core/sys.cpp | source/core/sys.cpp | ||||||
| source/core/timer.cpp | source/core/timer.cpp | ||||||
| source/core/timetrace.cpp) | source/core/timetrace.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-core SRC_FILES ${CORE_SRC}) | ## Image Source Code | ||||||
|  | set(IMAGE_SRC | ||||||
| set(MATHS_SRC | source/image/img_blur.cpp | ||||||
| source/maths/bit_util.cpp | source/image/img_convert.cpp) | ||||||
| source/maths/color.cpp |  | ||||||
| source/maths/img_blur.cpp |  | ||||||
| source/maths/img_convert.cpp) |  | ||||||
| add_pd_lib(pd-maths SRC_FILES ${MATHS_SRC} DEPENDS pd-core) |  | ||||||
|  |  | ||||||
|  | ## External Source Code | ||||||
| set(EXTERNAL_SRC | set(EXTERNAL_SRC | ||||||
| source/external/stb.cpp) | source/external/stb.cpp) | ||||||
| add_pd_lib(pd-external SRC_FILES ${EXTERNAL_SRC}) |  | ||||||
|  |  | ||||||
|  | ## Drivers Source Code | ||||||
| set(DRVS_SRC | set(DRVS_SRC | ||||||
| source/drivers/hid.cpp) | source/drivers/hid.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-drivers SRC_FILES ${DRVS_SRC} DEPENDS pd-maths) | ## Lib3ds Source Code | ||||||
|  |  | ||||||
| set(L3DS_SRC | set(L3DS_SRC | ||||||
| source/lib3ds/gamepad_icons.cpp | source/lib3ds/gamepad_icons.cpp | ||||||
| source/lib3ds/result_decoder.cpp | source/lib3ds/result_decoder.cpp | ||||||
| @@ -90,8 +89,7 @@ source/lib3ds/drv_hid.cpp | |||||||
| source/lib3ds/hwinfo.cpp | source/lib3ds/hwinfo.cpp | ||||||
| source/lib3ds/os.cpp) | source/lib3ds/os.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-lib3ds SRC_FILES ${L3DS_SRC} DEPENDS pd-drivers) | ## Lithium Source Code | ||||||
|  |  | ||||||
| set(LI_SRC | set(LI_SRC | ||||||
| source/lithium/li7_shader.cpp | source/lithium/li7_shader.cpp | ||||||
| source/lithium/spritesheet.cpp | source/lithium/spritesheet.cpp | ||||||
| @@ -100,13 +98,11 @@ source/lithium/font.cpp | |||||||
| source/lithium/objects.cpp | source/lithium/objects.cpp | ||||||
| source/lithium/renderer.cpp) | source/lithium/renderer.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-lithium SRC_FILES ${LI_SRC} DEPENDS pd-maths pd-external citro3d) | ## Sounbd Source Code | ||||||
|  |  | ||||||
| set(SOUND_SRC | set(SOUND_SRC | ||||||
| source/sound/mp3.cpp) | source/sound/mp3.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-sound SRC_FILES ${SOUND_SRC} DEPENDS pd-core mpg123) | ## Overlay source Code | ||||||
|  |  | ||||||
| set(OVL_SRC | set(OVL_SRC | ||||||
| source/overlays/keyboard.cpp | source/overlays/keyboard.cpp | ||||||
| source/overlays/message_mgr.cpp | source/overlays/message_mgr.cpp | ||||||
| @@ -114,15 +110,13 @@ source/overlays/overlay_mgr.cpp | |||||||
| source/overlays/performance.cpp | source/overlays/performance.cpp | ||||||
| source/overlays/settings.cpp) | source/overlays/settings.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-overlays SRC_FILES ${OVL_SRC} DEPENDS pd-lithium) | ## App Source Code | ||||||
|  |  | ||||||
| set(APP_SRC | set(APP_SRC | ||||||
| source/app/app.cpp | source/app/app.cpp | ||||||
| source/app/lang.cpp | source/app/lang.cpp | ||||||
| source/app/error.cpp) | source/app/error.cpp) | ||||||
|  |  | ||||||
| add_pd_lib(pd-app SRC_FILES ${APP_SRC} DEPENDS pd-overlays pd-drivers pd-lib3ds) | ## UI7 Source Code | ||||||
|  |  | ||||||
| set(UI7_SRC | set(UI7_SRC | ||||||
| source/ui7/drawlist.cpp | source/ui7/drawlist.cpp | ||||||
| source/ui7/menu.cpp | source/ui7/menu.cpp | ||||||
| @@ -134,27 +128,37 @@ source/ui7/container/checkbox.cpp | |||||||
| source/ui7/container/image.cpp | source/ui7/container/image.cpp | ||||||
| source/ui7/container/label.cpp) | source/ui7/container/label.cpp) | ||||||
|  |  | ||||||
|  | #### Creating the Libraries (if activated) #### | ||||||
|  | add_pd_lib(pd-core SRC_FILES ${CORE_SRC}) | ||||||
|  | add_pd_lib(pd-image SRC_FILES ${IMAGE_SRC} DEPENDS pd-core) | ||||||
|  | add_pd_lib(pd-external SRC_FILES ${EXTERNAL_SRC}) | ||||||
|  | add_pd_lib(pd-drivers SRC_FILES ${DRVS_SRC} DEPENDS pd-core) | ||||||
|  | add_pd_lib(pd-lib3ds SRC_FILES ${L3DS_SRC} DEPENDS pd-drivers) | ||||||
|  | add_pd_lib(pd-lithium SRC_FILES ${LI_SRC} DEPENDS pd-core pd-image pd-external citro3d) | ||||||
|  | add_pd_lib(pd-sound SRC_FILES ${SOUND_SRC} DEPENDS pd-core mpg123) | ||||||
|  | add_pd_lib(pd-overlays SRC_FILES ${OVL_SRC} DEPENDS pd-lithium) | ||||||
|  | add_pd_lib(pd-app SRC_FILES ${APP_SRC} DEPENDS pd-overlays pd-drivers pd-lib3ds) | ||||||
| add_pd_lib(pd-ui7 SRC_FILES ${UI7_SRC} DEPENDS pd-drivers pd-lithium) | add_pd_lib(pd-ui7 SRC_FILES ${UI7_SRC} DEPENDS pd-drivers pd-lithium) | ||||||
|  |  | ||||||
| add_library(palladium INTERFACE) | add_library(palladium INTERFACE) | ||||||
| target_link_libraries(palladium INTERFACE | target_link_libraries(palladium INTERFACE | ||||||
| pd-core pd-maths pd-external pd-drivers pd-lib3ds | pd-core pd-image pd-external pd-drivers pd-lib3ds | ||||||
| pd-lithium pd-overlays pd-app pd-ui7 | pd-lithium pd-overlays pd-app pd-ui7 | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_dependencies(palladium | add_dependencies(palladium | ||||||
| pd-core pd-maths pd-external pd-drivers | pd-core pd-image pd-external pd-drivers | ||||||
| pd-lib3ds pd-lithium pd-overlays pd-app pd-ui7 | pd-lib3ds pd-lithium pd-overlays pd-app pd-ui7 | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(palladium-lite INTERFACE) | add_library(palladium-lite INTERFACE) | ||||||
| target_link_libraries(palladium-lite INTERFACE | target_link_libraries(palladium-lite INTERFACE | ||||||
| pd-core pd-maths pd-external pd-drivers pd-lib3ds | pd-core pd-image pd-external pd-drivers pd-lib3ds | ||||||
| pd-lithium | pd-lithium | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_dependencies(palladium-lite | add_dependencies(palladium-lite | ||||||
| pd-core pd-maths pd-external pd-drivers | pd-core pd-image pd-external pd-drivers | ||||||
| pd-lib3ds pd-lithium | pd-lib3ds pd-lithium | ||||||
| ) | ) | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @@ -27,17 +27,17 @@ make install | |||||||
|  |  | ||||||
| | Name | Last Updated | Platform | Depends | | | Name | Last Updated | Platform | Depends | | ||||||
| |---|---|---|---| | |---|---|---|---| | ||||||
| | pd-core | 0.2.2 | multi | none | | | pd-core | 0.2.3 | multi | none | | ||||||
| | pd-maths | 0.2.0 | multi | pd-core | |  | ||||||
| | pd-external | 0.1.0 | multi | none | | | pd-external | 0.1.0 | multi | none | | ||||||
| | pd-drivers | 0.2.1 | multi | pd-core, pd-maths | | | pd-image | 0.2.3 | multi | pd-core | | ||||||
| | pd-lib3ds | 0.2.2 | 3ds | pd-core, pd-maths, pd-drivers | | | pd-drivers | 0.2.1 | multi | pd-core | | ||||||
|  | | pd-lib3ds | 0.2.2 | 3ds | pd-core, pd-drivers | | ||||||
| | pd-net | 0.2.2 | 3ds | pd-core, pd-lib3ds | | | pd-net | 0.2.2 | 3ds | pd-core, pd-lib3ds | | ||||||
| | pd-lithium | 0.2.1 | 3ds | pd-core, pd-maths pd-lib3ds, citro3d | | | pd-lithium | 0.2.1 | 3ds | pd-core, pd-image pd-lib3ds, citro3d | | ||||||
| | pd-sound | 0.2.2 | 3ds | pd-core, mpg123 | | | pd-sound | 0.2.2 | 3ds | pd-core, mpg123 | | ||||||
| | pd-overlays | 0.2.1 | 3ds | pd-core, pd-maths, pd-lib3ds, pd-lithium, pd-ui7 | | | pd-overlays | 0.2.1 | 3ds | pd-core, pd-image, pd-lib3ds, pd-lithium, pd-ui7 | | ||||||
| | pd-ui7 | 0.2.2 | 3ds | pd-core, pd-maths, pd-lib3ds, pd-lithium | | | pd-ui7 | 0.2.2 | 3ds | pd-core, pd-image, pd-lib3ds, pd-lithium | | ||||||
| | pd-app | 0.2.2 | 3ds | pd-core, pd-maths, pd-lib3ds, pd-lithium | | | pd-app | 0.2.2 | 3ds | pd-core, pd-image, pd-lib3ds, pd-lithium | | ||||||
|  |  | ||||||
| ## Credits | ## Credits | ||||||
| | Icon | Username | Description | | | Icon | Username | Description | | ||||||
|   | |||||||
| @@ -25,21 +25,21 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| // Core | // Core | ||||||
|  | #include <pd/core/bit_util.hpp> | ||||||
|  | #include <pd/core/color.hpp> | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/core/io.hpp> | #include <pd/core/io.hpp> | ||||||
| #include <pd/core/strings.hpp> | #include <pd/core/strings.hpp> | ||||||
| #include <pd/core/sys.hpp> | #include <pd/core/sys.hpp> | ||||||
| #include <pd/core/timer.hpp> | #include <pd/core/timer.hpp> | ||||||
| #include <pd/core/timetrace.hpp> | #include <pd/core/timetrace.hpp> | ||||||
|  | #include <pd/core/vec.hpp> | ||||||
| // Graphics | // Graphics | ||||||
| #include <pd/lithium/renderer.hpp> | #include <pd/lithium/renderer.hpp> | ||||||
| #include <pd/lithium/spritesheet.hpp> | #include <pd/lithium/spritesheet.hpp> | ||||||
| // Maths | // Image | ||||||
| #include <pd/maths/bit_util.hpp> | #include <pd/image/img_blur.hpp> | ||||||
| #include <pd/maths/color.hpp> | #include <pd/image/img_convert.hpp> | ||||||
| #include <pd/maths/img_blur.hpp> |  | ||||||
| #include <pd/maths/img_convert.hpp> |  | ||||||
| #include <pd/maths/vec.hpp> |  | ||||||
| // Drivers | // Drivers | ||||||
| #include <pd/drivers/hid.hpp> | #include <pd/drivers/hid.hpp> | ||||||
| // Overlays | // Overlays | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||||
| SOFTWARE. | SOFTWARE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
| 
 | 
 | ||||||
| namespace PD { | namespace PD { | ||||||
| template <typename T> | template <typename T> | ||||||
| @@ -24,7 +24,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| class Hid : public SmartCtor<Hid> { | class Hid : public SmartCtor<Hid> { | ||||||
|   | |||||||
| @@ -25,8 +25,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/maths/img.hpp> | #include <pd/core/vec.hpp> | ||||||
| #include <pd/maths/vec.hpp> |  | ||||||
| 
 | 
 | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace ImgBlur { | namespace ImgBlur { | ||||||
| @@ -38,8 +37,11 @@ std::vector<float> GaussianKernel(int radius, float si); | |||||||
| /// @param radius // Blur radius
 | /// @param radius // Blur radius
 | ||||||
| /// @param si // Blur sigma
 | /// @param si // Blur sigma
 | ||||||
| /// @param idxfn // Indexing function (if buffer is 3ds tiled)
 | /// @param idxfn // Indexing function (if buffer is 3ds tiled)
 | ||||||
| void GaussianBlur(std::vector<u8> &buf, int w, int h, float radius, float si, | void GaussianBlur( | ||||||
|                   std::function<int(int, int, int)> idxfn = Img::IndexDefault); |     std::vector<u8> &buf, int w, int h, float radius, float si, | ||||||
|  |     std::function<int(int, int, int)> idxfn = [](int x, int y, int w) -> int { | ||||||
|  |       return y * w + x; | ||||||
|  |     }); | ||||||
| /// @brief Advanced func to access memory directly
 | /// @brief Advanced func to access memory directly
 | ||||||
| /// @param buf Referenvce to the buffer
 | /// @param buf Referenvce to the buffer
 | ||||||
| /// @param w // width of the image
 | /// @param w // width of the image
 | ||||||
| @@ -48,7 +50,10 @@ void GaussianBlur(std::vector<u8> &buf, int w, int h, float radius, float si, | |||||||
| /// @param radius // Blur radius
 | /// @param radius // Blur radius
 | ||||||
| /// @param si // Blur sigma
 | /// @param si // Blur sigma
 | ||||||
| /// @param idxfn // Indexing function (if buffer is 3ds tiled)
 | /// @param idxfn // Indexing function (if buffer is 3ds tiled)
 | ||||||
| void GaussianBlur(void *buf, int w, int h, int bpp, float radius, float si, | void GaussianBlur( | ||||||
|                   std::function<int(int, int, int)> idxfn = Img::IndexDefault); |     void *buf, int w, int h, int bpp, float radius, float si, | ||||||
|  |     std::function<int(int, int, int)> idxfn = [](int x, int y, int w) -> int { | ||||||
|  |       return y * w + x; | ||||||
|  |     }); | ||||||
| }  // namespace ImgBlur
 | }  // namespace ImgBlur
 | ||||||
| }  // namespace PD
 | }  // namespace PD
 | ||||||
| @@ -28,7 +28,7 @@ SOFTWARE. | |||||||
| #include <pd/lithium/flags.hpp> | #include <pd/lithium/flags.hpp> | ||||||
| #include <pd/lithium/texture.hpp> | #include <pd/lithium/texture.hpp> | ||||||
| #include <pd/lithium/vertex.hpp> | #include <pd/lithium/vertex.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ SOFTWARE. | |||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/lithium/rect.hpp> | #include <pd/lithium/rect.hpp> | ||||||
| #include <pd/lithium/texture.hpp> | #include <pd/lithium/texture.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -30,7 +30,7 @@ SOFTWARE. | |||||||
| #include <pd/lithium/font.hpp> | #include <pd/lithium/font.hpp> | ||||||
| #include <pd/lithium/texture.hpp> | #include <pd/lithium/texture.hpp> | ||||||
| #include <pd/lithium/vertex.hpp> | #include <pd/lithium/vertex.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ SOFTWARE. | |||||||
| #include <pd/lithium/screen.hpp> | #include <pd/lithium/screen.hpp> | ||||||
| #include <pd/lithium/texture.hpp> | #include <pd/lithium/texture.hpp> | ||||||
| #include <pd/lithium/vertex.hpp> | #include <pd/lithium/vertex.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ SOFTWARE. | |||||||
| #include <citro3d.h> | #include <citro3d.h> | ||||||
|  |  | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| class Screen : public SmartCtor<Screen> { | class Screen : public SmartCtor<Screen> { | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ SOFTWARE. | |||||||
|  |  | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/lithium/rect.hpp> | #include <pd/lithium/rect.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| class Texture : public SmartCtor<Texture> { | class Texture : public SmartCtor<Texture> { | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace LI { | namespace LI { | ||||||
|   | |||||||
| @@ -1,39 +0,0 @@ | |||||||
| #pragma once |  | ||||||
|  |  | ||||||
| /* |  | ||||||
| MIT License |  | ||||||
|  |  | ||||||
| Copyright (c) 2024 - 2025 tobid7 |  | ||||||
|  |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||||
| of this software and associated documentation files (the "Software"), to deal |  | ||||||
| in the Software without restriction, including without limitation the rights |  | ||||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||||
| copies of the Software, and to permit persons to whom the Software is |  | ||||||
| furnished to do so, subject to the following conditions: |  | ||||||
|  |  | ||||||
| The above copyright notice and this permission notice shall be included in all |  | ||||||
| copies or substantial portions of the Software. |  | ||||||
|  |  | ||||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||||
| SOFTWARE. |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| #include <pd/core/common.hpp> |  | ||||||
| #include <pd/maths/vec.hpp> |  | ||||||
|  |  | ||||||
| namespace PD { |  | ||||||
| namespace Img { |  | ||||||
| inline int Index3dsTex(int x, int y, int width) { |  | ||||||
|   return ((((y >> 3) * (width >> 3) + (x >> 3)) << 6) + |  | ||||||
|           ((x & 1) | ((y & 1) << 1) | ((x & 2) << 1) | ((y & 2) << 2) | |  | ||||||
|            ((x & 4) << 2) | ((y & 4) << 3))); |  | ||||||
| } |  | ||||||
| inline int IndexDefault(int x, int y, int width) { return y * width + x; } |  | ||||||
| }  // namespace Img |  | ||||||
| }  // namespace PD |  | ||||||
| @@ -24,7 +24,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/drivers/hid.hpp> | #include <pd/drivers/hid.hpp> | ||||||
| #include <pd/maths/tween.hpp> | #include <pd/core/tween.hpp> | ||||||
| #include <pd/overlays/overlay.hpp> | #include <pd/overlays/overlay.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
|   | |||||||
| @@ -24,8 +24,8 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/lithium/renderer.hpp> | #include <pd/lithium/renderer.hpp> | ||||||
| #include <pd/maths/color.hpp> | #include <pd/core/color.hpp> | ||||||
| #include <pd/maths/tween.hpp> | #include <pd/core/tween.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| class MessageMgr : public PD::SmartCtor<MessageMgr> { | class MessageMgr : public PD::SmartCtor<MessageMgr> { | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/drivers/hid.hpp> | #include <pd/drivers/hid.hpp> | ||||||
| #include <pd/maths/tween.hpp> | #include <pd/core/tween.hpp> | ||||||
| #include <pd/overlays/overlay.hpp> | #include <pd/overlays/overlay.hpp> | ||||||
| #include <pd/ui7/ui7.hpp> | #include <pd/ui7/ui7.hpp> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ SOFTWARE. | |||||||
| #include <pd/core/common.hpp> | #include <pd/core/common.hpp> | ||||||
| #include <pd/core/strings.hpp> | #include <pd/core/strings.hpp> | ||||||
| #include <pd/drivers/hid.hpp> | #include <pd/drivers/hid.hpp> | ||||||
| #include <pd/maths/vec.hpp> | #include <pd/core/vec.hpp> | ||||||
| #include <pd/ui7/drawlist.hpp> | #include <pd/ui7/drawlist.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/drivers/hid.hpp> | #include <pd/drivers/hid.hpp> | ||||||
| #include <pd/maths/tween.hpp> | #include <pd/core/tween.hpp> | ||||||
| #include <pd/ui7/containers.hpp> | #include <pd/ui7/containers.hpp> | ||||||
| #include <pd/ui7/drawlist.hpp> | #include <pd/ui7/drawlist.hpp> | ||||||
| #include <pd/ui7/flags.hpp> | #include <pd/ui7/flags.hpp> | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||||
| SOFTWARE. | SOFTWARE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <pd/maths/bit_util.hpp> | #include <pd/core/bit_util.hpp> | ||||||
| 
 | 
 | ||||||
| namespace PD::BitUtil { | namespace PD::BitUtil { | ||||||
| bool IsSingleBit(u32 v) { return v && !(v & (v - 1)); } | bool IsSingleBit(u32 v) { return v && !(v & (v - 1)); } | ||||||
| @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||||
| SOFTWARE. | SOFTWARE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <pd/maths/color.hpp> | #include <pd/core/color.hpp> | ||||||
| 
 | 
 | ||||||
| namespace PD { | namespace PD { | ||||||
| // The Solution of the biggest performance issue
 | // The Solution of the biggest performance issue
 | ||||||
| @@ -24,8 +24,8 @@ SOFTWARE. | |||||||
| 
 | 
 | ||||||
| #include <cstring> | #include <cstring> | ||||||
| #include <memory> | #include <memory> | ||||||
| #include <pd/maths/img_blur.hpp> | #include <pd/image/img_blur.hpp> | ||||||
| #include <pd/maths/img_convert.hpp> | #include <pd/image/img_convert.hpp> | ||||||
| 
 | 
 | ||||||
| namespace PD { | namespace PD { | ||||||
| namespace ImgBlur { | namespace ImgBlur { | ||||||
| @@ -21,8 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||||
| SOFTWARE. | SOFTWARE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <pd/maths/img.hpp> | #include <pd/image/img_convert.hpp> | ||||||
| #include <pd/maths/img_convert.hpp> |  | ||||||
| 
 | 
 | ||||||
| namespace PD::ImgConvert { | namespace PD::ImgConvert { | ||||||
| void RGB24toRGBA32(std::vector<u8> &out, const std::vector<u8> &in, | void RGB24toRGBA32(std::vector<u8> &out, const std::vector<u8> &in, | ||||||
| @@ -42,7 +41,7 @@ void RGB24toRGBA32(std::vector<u8> &out, const std::vector<u8> &in, | |||||||
| void Reverse32(std::vector<u8> &buf, const int &w, const int &h) { | void Reverse32(std::vector<u8> &buf, const int &w, const int &h) { | ||||||
|   for (int x = 0; x < w; x++) { |   for (int x = 0; x < w; x++) { | ||||||
|     for (int y = 0; y < h; y++) { |     for (int y = 0; y < h; y++) { | ||||||
|       int i = Img::IndexDefault(x, y, w); |       int i = y * w + x; | ||||||
|       u8 t0 = buf[i + 0]; |       u8 t0 = buf[i + 0]; | ||||||
|       u8 t1 = buf[i + 1]; |       u8 t1 = buf[i + 1]; | ||||||
|       buf[i + 0] = buf[i + 3]; |       buf[i + 0] = buf[i + 3]; | ||||||
| @@ -30,8 +30,8 @@ SOFTWARE. | |||||||
| #include <pd/core/io.hpp> | #include <pd/core/io.hpp> | ||||||
| #include <pd/core/timetrace.hpp> | #include <pd/core/timetrace.hpp> | ||||||
| #include <pd/lithium/texture.hpp> | #include <pd/lithium/texture.hpp> | ||||||
| #include <pd/maths/bit_util.hpp> | #include <pd/core/bit_util.hpp> | ||||||
| #include <pd/maths/img_convert.hpp> | #include <pd/image/img_convert.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
| GPU_TEXCOLOR GetTexFmt(Texture::Type type) { | GPU_TEXCOLOR GetTexFmt(Texture::Type type) { | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ SOFTWARE. | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/external/json.hpp> | #include <pd/external/json.hpp> | ||||||
| #include <pd/maths/color.hpp> | #include <pd/core/color.hpp> | ||||||
| #include <pd/overlays/keyboard.hpp> | #include <pd/overlays/keyboard.hpp> | ||||||
| #include <pd/lib3ds/gamepad_icons.hpp> | #include <pd/lib3ds/gamepad_icons.hpp> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||||
| SOFTWARE. | SOFTWARE. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include <pd/maths/color.hpp> | #include <pd/core/color.hpp> | ||||||
| #include <pd/ui7/theme.hpp> | #include <pd/ui7/theme.hpp> | ||||||
|  |  | ||||||
| namespace PD { | namespace PD { | ||||||
|   | |||||||
| @@ -25,7 +25,6 @@ SOFTWARE. | |||||||
|  |  | ||||||
| #include <ctime> | #include <ctime> | ||||||
| #include <pd.hpp> | #include <pd.hpp> | ||||||
| #include <pd/maths/tween.hpp> |  | ||||||
|  |  | ||||||
| class Test : public PD::App { | class Test : public PD::App { | ||||||
|  public: |  public: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user