413 Commits

Author SHA1 Message Date
c6804dfc03 Codebase of 0.9.5 26.06.2024 found on my OneDrive 2025-02-18 10:26:51 +01:00
a671631dde Replace Toasts
Replace Toasts with ToastsV2
(MessageHandler)
2023-08-28 18:43:59 +02:00
566485ccd6 More Cleanup
Remove unused code as well as useless debug printf's
2023-08-28 17:11:07 +02:00
267f9ce5c3 FILE to fstream
Lets move away from  the c standart FILE and use c++ fstream as well as c++17 filesystem!!!
2023-08-28 17:03:00 +02:00
5cca34ede4 The beginning of 0.9.5
- Remove unused stuff
- Start Moving from c stuff to c++ stuff Like mkdir to filesystem
- Remove usless stuff from config
- Begin with Project Li7
2023-08-28 16:33:16 +02:00
5695110739 Simplify lang System 2023-05-28 22:30:39 +02:00
476bd93aa7 Update link 2023-03-24 19:55:24 +01:00
9a7078b067 Release 0.9.4 2023-03-24 19:53:01 +01:00
44ef9f2aad Clean Env 2023-03-24 19:50:37 +01:00
1ef946570d __MISSTAKE__ 2023-03-24 19:47:58 +01:00
ae8181a6e5 RenderD7 0.9.4 (New Stuff, Lot Fixes, Envtools) 2023-03-24 19:46:41 +01:00
7c190e3cfa Fix LLVM 2023-03-13 21:36:37 +01:00
805512fbea Fix Makefile and Better Document Setup in README 2023-03-13 21:34:18 +01:00
780025bb74 Add Some Tools and Assets to create cpp's for 0.9+ 2023-03-13 21:19:07 +01:00
f6e3c50814 Fix Crash and Fade Stuff 2023-03-12 21:37:22 +01:00
0399808eb2 Document_Fix_And0.9.3 2023-03-12 21:06:13 +01:00
cd677cf3e8 0.9.2 (NVID, SPLASH_IMG_VID, CHANGELOG_IMPL) 2023-03-11 15:56:40 +01:00
67edfa4245 Remove nsmbp and fix a critical bug 2023-03-09 21:19:17 +01:00
66a35f28e6 FastColor/RemoveFPSCheat/LLVM-Style 2023-03-07 18:09:48 +01:00
2f7a266dc5 - 2022-12-13 20:58:21 +01:00
8a0fd07275 Alpha 0.9.0 2022-12-09 14:55:19 +01:00
89299bf91e Minimalistic for hax 2.x 2022-12-07 15:29:19 +01:00
af88277680 __FixDeltatime 2022-11-30 18:28:03 +01:00
dd17a70551 Prepere 2022-11-28 20:01:56 +01:00
ec0411373b 0.8.4 2022-11-25 01:07:11 +01:00
222a13387d 0.8.4 2022-11-25 01:05:50 +01:00
c1e471f23a The ResultDecoder Update 2022-11-22 23:00:01 +01:00
6b48ba070c RenderD7 0.8.2 2022-11-18 20:57:05 +01:00
bbbfd60bb7 Fix To Prevent from Crash 2022-11-14 18:25:24 +01:00
62fa5ede9d Standarts of LLVM 2022-11-14 16:27:04 +01:00
20c3a525c8 Version 0.8.1 (StealConsole) 2022-11-14 15:25:26 +01:00
8b70d0e9b7 Format to LLVL 2022-11-12 23:19:41 +01:00
36e5676d9f Ehh 2022-08-22 17:18:26 +01:00
f706193945 Offset 2022-08-22 17:14:19 +01:00
e24b704809 __ 2022-08-22 17:03:51 +01:00
91bbcdb7a7 Some DBG Stuff 2022-08-04 02:50:37 +02:00
2cb54dd570 __ 2022-08-04 01:47:07 +02:00
90dde05b79 __ 2022-08-04 01:13:26 +02:00
1ae4ff72d3 __ 2022-07-31 10:02:29 +02:00
9213a1d5dd Implement Experiment of NFontApi 2022-07-31 01:23:39 +02:00
ca52e6dae6 __ 2022-07-30 15:49:44 +02:00
83946b1e66 Fix A Lot of Stuff 2022-07-30 14:42:02 +02:00
61cb41ae29 Big CleanUp 2022-07-29 13:19:31 +02:00
bca1c36f75 A Lot of Bugfixes 2022-07-28 14:30:09 +02:00
3270842a1b __ 2022-07-27 11:00:57 +02:00
bd7d21d489 __ 2022-07-27 10:55:52 +02:00
cc5d669ab4 Add Logo to Readme 2022-07-25 16:53:29 +02:00
2c38997b4c Add Logo 2022-07-25 16:50:41 +02:00
a49bcd8712 awd 2022-07-25 14:42:58 +02:00
dbaa4d912a D 2022-07-25 12:12:12 +02:00
8f2c877197 Implement Benchm,arking System for BitmapPrinter 2022-07-25 11:31:41 +02:00
1ee4f6849e Update to use releases 2022-07-25 09:06:40 +02:00
3d89e94823 Litle Fix 2022-07-24 01:17:22 +02:00
228d0088fb sef 2022-07-24 01:04:11 +02:00
86465b5f76 we 2022-07-24 01:03:51 +02:00
6af08275e9 RenderD7 is now LibRenderD7 2022-07-24 00:55:18 +02:00
3c7c12ef39 Add gitignore 2022-07-24 00:15:13 +02:00
404761d712 Add New Info Section to RSettings 2022-07-22 18:05:39 +02:00
83d948ef24 Calculate MT CPU/GPU Persentage by Framerate 2022-07-22 14:55:16 +02:00
946deb210d Implement libnsbmp for bmp decoding 2022-07-22 13:11:39 +02:00
c2cdf256ba Upda 2022-07-21 20:59:51 +02:00
f0f4a64dfc Update 2022-07-20 15:08:04 +02:00
25ced38cba Implement BitmapEngine to RenderD7 2022-07-19 19:07:23 +02:00
86166f87eb Add Tex unloader 2022-07-19 14:22:52 +02:00
54cce27a34 Merge branch 'main' of https://github.com/NPI-D7/RenderD7 2022-05-17 01:26:30 +02:00
4d6a24f51f _ 2022-05-17 01:26:27 +02:00
2e6d2c3cd5 __ 2022-05-15 00:09:14 +02:00
7f62666017 __ 2022-05-14 23:59:56 +02:00
8b3173811a __ 2022-05-14 00:28:27 +02:00
b40f6d738e Implement OverLayHandler 2022-05-13 21:36:03 +02:00
d4f12cb9b0 Fix for Touch 2022-05-08 05:00:11 +02:00
690dd1d6ca ReImplement Fade System 2022-05-06 19:32:18 +02:00
c21e8192d4 __ 2022-04-30 14:23:55 +02:00
d4878d4e3d Update renderd7.hpp 2022-04-26 13:35:27 +02:00
0503fe7e5b Update renderd7.hpp 2022-04-26 13:21:33 +02:00
cd20f32acb LOL 2022-04-25 19:29:57 +02:00
c0fe7eaab5 __ 2022-04-25 19:24:24 +02:00
f1b712af4a _ 2022-04-25 18:30:33 +02:00
3231bc8240 Big Settings Update 2022-04-25 17:29:40 +02:00
8f80a99fc6 Big Settings Update 2022-04-25 17:14:47 +02:00
2cc908b043 RenderD7 Settings Fix 2022-04-25 17:06:35 +02:00
d07d2a246a Fix the logging Sys 2022-04-25 16:43:52 +02:00
bf51ecda77 __ 2022-04-23 14:56:48 +02:00
d87235c4b5 __ 2022-04-23 14:56:32 +02:00
6c22b58487 __ 2022-04-23 14:54:10 +02:00
05835a5c07 __ 2022-04-23 14:49:49 +02:00
fa948a7beb __ 2022-04-23 14:46:07 +02:00
04741198e2 __ 2022-04-23 13:58:48 +02:00
5fb7ca78a9 __ 2022-04-23 13:55:01 +02:00
ce0d83912e __ 2022-04-23 01:47:51 +02:00
26eb9b4970 I HATE :. 2022-04-23 01:14:49 +02:00
02ea4c6b4b __ 2022-04-23 01:00:19 +02:00
0d35167c90 __ 2022-04-22 21:03:58 +02:00
51ab42a9b0 __ 2022-04-22 20:54:06 +02:00
4ca9e96276 __ 2022-04-22 20:37:59 +02:00
b71b359502 ->;->:( 2022-04-22 20:27:27 +02:00
a75f37c2d4 :( 2022-04-22 20:24:36 +02:00
a7a44b39dc __ 2022-04-22 20:20:11 +02:00
f6eb34ed78 __ 2022-04-22 19:26:33 +02:00
099f21345f __ 2022-04-22 19:03:44 +02:00
c1876482f7 ___ 2022-04-22 17:41:48 +02:00
a70f243421 ___ 2022-04-22 17:27:35 +02:00
b100891c34 __ 2022-04-22 17:21:37 +02:00
2f4e78b138 __ 2022-04-22 17:11:30 +02:00
5163f19796 __ 2022-04-22 17:04:37 +02:00
c3f737de14 Update log.cpp 2022-04-22 15:07:21 +02:00
809b0cfad6 __ 2022-04-22 14:51:29 +02:00
cacf83d434 __ 2022-04-22 14:48:20 +02:00
ca1e242997 __ 2022-04-22 14:27:10 +02:00
165b3b347f __ 2022-04-22 10:43:34 +02:00
2965c3945a __ 2022-04-22 10:24:41 +02:00
8d28ae3754 __ 2022-04-18 14:41:51 +02:00
7d327f22aa __ 2022-04-17 23:00:37 +02:00
d0c2123996 Update RenderD7 2022-04-17 22:49:54 +02:00
6081c4d310 Update the Overlay 2022-04-17 22:23:47 +02:00
0dfb37cc1c Test 2022-04-17 17:34:48 +02:00
f15e457947 Update OvlHandler 2022-04-16 23:11:12 +02:00
5d3db56ee4 Add Citra CHeck 2022-04-16 22:15:15 +02:00
8bec3356e5 __ 2022-04-16 17:45:20 +02:00
3b4e541d0e Remove and forget this idea 2022-04-16 17:40:58 +02:00
b03633e010 ___IMPLEMENT_FS2__INSPIERED_BY_3DSHELL__ 2022-04-16 16:02:44 +02:00
651a43574f TestUpdate 2022-04-16 11:24:15 +02:00
8e7bee4ea2 __ 2022-04-16 01:35:15 +02:00
db66485432 ___ 2022-04-15 22:05:21 +02:00
12d47e5482 __ 2022-04-15 22:02:00 +02:00
39c1a0f991 __ 2022-04-15 13:19:24 +02:00
3f548f2d09 __ 2022-04-15 13:16:54 +02:00
6587d22d2c Update 2022-04-15 13:13:38 +02:00
76da1a033f Add Bmp writer 2022-04-14 17:41:18 +02:00
6c530c44bd Fix 2022-04-14 10:37:12 +02:00
85fa45201e Fixed 2022-04-14 10:34:32 +02:00
10d4ad6fd5 Update Theme 2022-04-13 20:06:50 +02:00
d5a3da2c35 Fix the Text Error after 1 1/2 years 2022-04-13 12:50:22 +02:00
a8b0540ecc Update renderd7.hpp 2022-04-13 02:43:17 +02:00
cc5579971d RD7SR Gets Interesting 2022-04-13 01:38:39 +02:00
6123bd3307 Update Some files 2022-04-12 11:19:37 +02:00
ed0d9998ff _______ 2022-04-12 11:12:12 +02:00
483efd280a CLEAN PAGE 2022-04-12 11:11:12 +02:00
1e2b4c0476 ___ 2022-04-12 11:07:32 +02:00
3992096df3 Fix 2022-04-12 11:05:53 +02:00
7165d1edc4 FIX 2022-04-12 11:03:30 +02:00
27653c2350 Fix 2022-04-12 11:01:10 +02:00
67ecd0ceff Fix DOCS 2022-04-12 11:00:32 +02:00
de74aac8af ___ 2022-04-12 10:57:59 +02:00
e1e0d1cbd5 Simple Update 2022-04-12 10:53:23 +02:00
b6051242a2 Not Required 2022-04-12 10:48:48 +02:00
ea778c004b Add Footer 2022-04-12 10:41:22 +02:00
b5dbe5ce78 Remove module 2022-04-12 10:35:22 +02:00
7645b45992 Remove module 2022-04-12 10:34:55 +02:00
c0bf1c7bf1 Remove 2022-04-12 10:32:39 +02:00
49805784b0 Some Changes 2022-04-12 10:28:42 +02:00
8b7b12007b LOL 2022-04-12 10:22:36 +02:00
88b329f1d0 NextGen 2022-04-12 10:21:42 +02:00
5fbbae9f99 Update 2022-04-12 10:15:58 +02:00
520eec7c9c Document the Sprite Class 2022-04-12 10:00:49 +02:00
f75078b42b Update README.md 2022-04-12 09:54:29 +02:00
16ef0ff65a Fix? 2022-04-12 09:52:59 +02:00
fed723aa48 Push 2022-04-12 09:47:41 +02:00
6813c50c12 Update 2022-04-12 09:46:32 +02:00
3c18129f94 Update README.md 2022-04-12 09:42:55 +02:00
409161efe7 __ 2022-04-12 09:39:00 +02:00
8e7958be76 Fix 2022-04-12 09:31:31 +02:00
9e5ce455ca Update README.md 2022-04-12 09:28:33 +02:00
94e90a3cd8 Generate DOCS 2022-04-12 09:27:49 +02:00
58b4667ec7 Generate DOCS 2022-04-12 09:27:42 +02:00
97aff8615a Test 2022-04-11 17:58:37 +02:00
e57c15bddb ___ 2022-04-11 17:48:16 +02:00
82d8005529 __ 2022-04-11 17:08:50 +02:00
acc0bdfd87 RenderD7 Add SuperReselutiion 2022-04-11 17:00:10 +02:00
a7accb0bf5 ...? 2022-04-11 09:59:25 +02:00
c5c83a9c17 __ 2022-04-11 09:53:36 +02:00
aed653f0c8 Fix the Exit Crash?? 2022-04-11 09:50:47 +02:00
b5995e2f93 RLY 2022-04-10 15:27:43 +02:00
0977e0a80f RN STuff 2022-04-10 15:24:08 +02:00
54a9b80523 Uhh 2022-04-10 15:12:04 +02:00
72adb90757 ;;;;;;;;;;;;;; 2022-04-10 15:03:10 +02:00
f2549997ba Why Not 2022-04-10 15:00:06 +02:00
063a342ad5 Fix Error Message 2022-04-10 13:13:45 +02:00
20f7730448 ???? 2022-04-10 13:06:49 +02:00
aa5ca1a3f0 __ 2022-04-10 10:19:58 +02:00
0dab5c6599 Loader 2022-04-10 10:13:22 +02:00
3f0f8f351c Add a loader 2022-04-10 10:09:43 +02:00
e150265bc4 _ 2022-04-10 10:08:06 +02:00
6fd37ffd3d Implement the new Settings Screen 2022-04-10 09:55:05 +02:00
f7bd625610 ADD % 2022-04-10 01:34:47 +02:00
20cec2442c Add CMDBUF 2022-04-10 01:28:27 +02:00
dcf6d77979 Render D7 Update 2022-04-10 01:17:34 +02:00
0cfd1a0e42 OK 2022-04-10 01:13:16 +02:00
303e4105cb Too much problems 2022-04-10 01:09:46 +02:00
8c8613aca6 FIX 2022-04-10 01:05:26 +02:00
ead304d698 Fix 2022-04-10 01:02:06 +02:00
edb634b79d Add Overlays Engine 2022-04-10 00:59:30 +02:00
d0e4d2296c Add FrameEnd() for overlays 2022-04-10 00:41:16 +02:00
078e0d0d8b Remove The Flyppy Bird String From Setup Log 2022-04-09 19:15:29 +02:00
855e312ad4 MAIN 2022-04-08 13:45:10 +02:00
ffb313971d Update renderd7.cpp 2021-12-29 11:12:07 +01:00
ef8e4a379c Update renderd7.hpp 2021-12-26 13:16:45 +01:00
945038042a Update renderd7.cpp 2021-12-26 13:15:33 +01:00
d59cf0f9e0 Update renderd7.cpp 2021-12-26 10:51:04 +01:00
12d5b48632 Update renderd7.hpp 2021-12-26 10:49:17 +01:00
489d4f54a1 Update renderd7.hpp 2021-12-25 13:34:28 +01:00
80f53cb013 Update renderd7.hpp 2021-12-24 15:40:47 +01:00
ab71f5c84f Update renderd7.cpp 2021-12-24 03:42:13 +01:00
f3c8482c6d Update renderd7.hpp 2021-12-24 03:33:51 +01:00
4bdc38b7d9 Update renderd7.hpp 2021-12-09 20:06:22 +01:00
1f8c0fa06e Update thread.cpp 2021-12-08 16:02:10 +01:00
4ec44b0f89 Update thread.hpp 2021-12-08 16:01:47 +01:00
d82ec589bd Update renderd7.cpp 2021-12-08 16:01:09 +01:00
51276fd171 Update renderd7.cpp 2021-12-06 13:20:40 +01:00
1c5cd37a4f Update renderd7.cpp 2021-12-06 13:15:24 +01:00
f3111623c1 Update renderd7.cpp 2021-12-05 23:46:00 +01:00
4bacf86367 Update renderd7.cpp 2021-12-04 12:33:04 +01:00
f1e6109fa5 Update renderd7.cpp 2021-12-04 02:23:45 +01:00
fe2e9f0dcf Update renderd7.cpp 2021-12-04 01:05:41 +01:00
9a2525e9e5 Update renderd7.hpp 2021-12-04 00:56:49 +01:00
abef666256 Update renderd7.hpp 2021-12-03 22:52:49 +01:00
d31f63a47e d 2021-12-02 16:49:30 +01:00
d4e4dbc565 Update renderd7.hpp 2021-12-02 15:33:27 +01:00
b8cefcc12d Update renderd7.hpp 2021-12-01 21:00:41 +01:00
ca4de52619 Create tween.hpp 2021-12-01 20:52:35 +01:00
22b6f477ba Create Clock.cpp 2021-12-01 20:39:59 +01:00
fe13f3d6b4 Create Time.cpp 2021-12-01 20:38:44 +01:00
c697ae9bd1 Create Clock.hpp 2021-12-01 20:33:46 +01:00
d22b7b718c Create Time.hpp 2021-12-01 20:29:22 +01:00
61285be23e Update main.cpp 2021-11-29 12:10:36 +01:00
eb0ccc8b25 Update main.cpp 2021-11-29 12:06:23 +01:00
ca8db2564d Create main.cpp 2021-11-29 11:59:17 +01:00
c4a8c54da2 Update renderd7.cpp 2021-11-28 17:42:37 +01:00
9d4f94dba2 Update renderd7.cpp 2021-11-28 15:03:00 +01:00
4adf59193c Update renderd7.cpp 2021-11-28 12:09:07 +01:00
7766b4071c Update renderd7.cpp 2021-11-28 08:53:44 +01:00
3d0f3a3ab6 Update renderd7.cpp 2021-11-28 05:45:33 +01:00
0e7ac54ef7 Update renderd7.hpp 2021-11-28 05:44:46 +01:00
6c03dde215 Update renderd7.cpp 2021-11-28 05:37:58 +01:00
aa6c96c9a3 Update renderd7.cpp 2021-11-28 05:19:20 +01:00
28abaa62ff Update renderd7.cpp 2021-11-27 12:11:05 +01:00
c8e65e39c3 Update renderd7.cpp 2021-11-27 12:05:43 +01:00
4fe4232796 Update renderd7.cpp 2021-11-27 12:05:03 +01:00
81fa120cb7 Update renderd7.cpp 2021-11-27 11:57:40 +01:00
92fdc24a49 Update renderd7.hpp 2021-11-27 11:51:56 +01:00
237c9108bf Update renderd7.hpp 2021-11-27 11:50:44 +01:00
069cfba51b Update renderd7.cpp 2021-11-27 11:50:25 +01:00
e4ef5b55fe Update renderd7.cpp 2021-11-27 11:34:32 +01:00
a10e2aaab9 Update renderd7.hpp 2021-11-27 11:26:53 +01:00
b35ed87573 Update renderd7.cpp 2021-11-27 11:23:44 +01:00
ab867588d3 Update renderd7.hpp 2021-11-27 11:22:47 +01:00
087b2a2bb0 Update renderd7.cpp 2021-11-23 16:50:52 +01:00
c8fcce1de3 Update sound.cpp 2021-11-23 16:39:20 +01:00
a5f3e60e3a Update renderd7.cpp 2021-11-23 16:34:26 +01:00
fbc54e0065 Update renderd7.hpp 2021-11-23 16:33:36 +01:00
1bbefb259a Update renderd7.cpp 2021-11-21 21:40:08 +01:00
569e82f476 Update renderd7.hpp 2021-11-21 21:37:24 +01:00
51822aef23 Create renderd7.hpp 2021-11-21 21:25:22 +01:00
f0ae9c238c Update renderd7.hpp 2021-11-19 07:02:30 +01:00
b9578e151d Update renderd7.hpp 2021-11-18 20:51:28 +01:00
ad655021a4 Update renderd7.hpp 2021-11-15 07:02:19 +01:00
9c66052878 Update renderd7.hpp 2021-09-21 16:31:45 +02:00
d98707aa8f Update engine.hpp 2021-08-16 23:00:02 +02:00
95dc698349 Update engine.hpp 2021-08-15 22:51:56 +02:00
13916e3dff Update engine.hpp 2021-08-15 22:47:48 +02:00
44f618e9d8 Create engine.hpp 2021-08-15 22:46:41 +02:00
235c2c2d7e Update renderd7.cpp 2021-08-14 10:51:20 +02:00
dfce1b2adb Update renderd7.cpp 2021-08-14 10:08:54 +02:00
b68c7d29ae Update renderd7.hpp 2021-08-14 10:01:53 +02:00
7737cba060 Update renderd7.hpp 2021-08-14 08:15:22 +02:00
4cd82f2e25 Update renderd7.hpp 2021-08-12 22:19:15 +02:00
a15b0bdb2d Create stringtool.hpp 2021-08-12 22:17:46 +02:00
f7f0d26896 Update renderd7.hpp 2021-08-08 11:28:11 +02:00
e73ee7c6db Update renderd7.hpp 2021-08-08 11:22:42 +02:00
0d4cc6f30f Update renderd7.hpp 2021-08-07 17:07:57 +02:00
d7c02bab33 Update renderd7.cpp 2021-08-01 12:58:56 +02:00
4750ba5a6c Update renderd7.hpp 2021-08-01 12:55:26 +02:00
8dabfd58ab Update Update extlibs.yml 2021-07-30 15:09:52 +02:00
16510f5261 Update Docs.yml 2021-07-30 13:15:02 +02:00
60d85b2a5e Delete main/doc/html directory 2021-07-30 13:13:22 +02:00
69fe7d4cb4 Update Docs.yml 2021-07-30 13:11:14 +02:00
0e772b1394 Update Update extlibs.yml 2021-07-25 23:32:29 +02:00
596d2a8611 Create external.md 2021-07-25 23:27:35 +02:00
f1f71b93e2 Create Update extlibs.yml 2021-07-25 23:22:52 +02:00
b0a74a0bf6 Documentation1 2021-07-25 16:36:05 +00:00
00ec77e6a3 Delete external/tween-engine directory 2021-07-25 18:35:41 +02:00
d2145977c5 Documentation1 2021-07-25 16:35:20 +00:00
c733394277 Update log.hpp 2021-07-25 18:34:47 +02:00
43ea66236c Documentation1 2021-07-25 14:44:45 +00:00
0cd8eaa423 Update renderd7.hpp 2021-07-25 16:44:12 +02:00
af296546ff Documentation1 2021-07-25 14:36:11 +00:00
26db113a09 Update renderd7.hpp 2021-07-25 16:35:50 +02:00
e2ca5f27b6 Documentation1 2021-07-25 14:30:56 +00:00
ed2b2c4ed8 Update renderd7.hpp 2021-07-25 16:30:35 +02:00
7c3e17e820 Delete header.html 2021-07-25 16:26:02 +02:00
64045ebddf Delete d.html 2021-07-25 16:25:52 +02:00
14800862be Documentation1 2021-07-25 10:55:12 +00:00
c640a2ec38 Update log.hpp 2021-07-25 12:54:49 +02:00
1a87a2519f Update doxygen.css 2021-07-25 12:53:21 +02:00
52d7433385 Documentation1 2021-07-25 10:41:21 +00:00
03247039d3 Update Doxyfile 2021-07-25 12:40:59 +02:00
9dc3feb1f3 Documentation1 2021-07-25 10:38:19 +00:00
a64f16e371 Update renderd7.hpp 2021-07-25 12:37:58 +02:00
2327fcb284 Update doxygen.css 2021-07-25 12:36:01 +02:00
0e56aa0905 Documentation1 2021-07-25 10:33:20 +00:00
d568126176 Update Doxyfile 2021-07-25 12:32:56 +02:00
f11b74ba85 Update Docs.yml 2021-07-25 12:31:00 +02:00
a4eac5221d Update Doxyfile 2021-07-25 12:30:21 +02:00
31360d90f3 Update Docs.yml 2021-07-25 12:25:01 +02:00
d3c1a8aaa6 Update Docs.yml 2021-07-25 12:22:13 +02:00
e944cd8f55 Create d.html 2021-07-25 12:21:29 +02:00
5af0535d74 Create header.html 2021-07-25 11:53:13 +02:00
6548670e59 Update Docs.yml 2021-07-25 11:44:40 +02:00
69f8a7fd51 Rename docs/doxygen.css to doxygen.css 2021-07-25 11:39:25 +02:00
8ba4bcdc1b Update Docs.yml 2021-07-25 11:38:41 +02:00
0d104edab3 Update Docs.yml 2021-07-25 11:32:39 +02:00
2c17269f84 Create doxygen.css 2021-07-25 11:31:37 +02:00
8cf2c798e6 Documentation1 2021-07-25 09:20:48 +00:00
48cb6d4034 Update sound.hpp 2021-07-25 11:20:23 +02:00
78b3ff7f68 Documentation1 2021-07-25 09:05:33 +00:00
e304bdf00f Update renderd7.hpp 2021-07-25 11:05:06 +02:00
ad169b01cb Documentation1 2021-07-25 08:29:59 +00:00
dc7034db91 Update renderd7.hpp 2021-07-25 10:29:36 +02:00
b01393cd33 Update sound.hpp 2021-07-25 10:28:01 +02:00
54579d1f18 Documentation1 2021-07-24 22:47:54 +00:00
96dbdf3309 Update renderd7.hpp 2021-07-25 00:47:28 +02:00
b690ea5822 Documentation1 2021-07-24 22:28:17 +00:00
fbe59355ce Update renderd7.hpp 2021-07-25 00:27:55 +02:00
809ddbad47 Documentation1 2021-07-24 22:23:41 +00:00
9be2bb672a Update lang.hpp 2021-07-25 00:23:20 +02:00
469896be32 Documentation1 2021-07-24 22:13:43 +00:00
6f8ec89373 Update log.hpp 2021-07-25 00:13:11 +02:00
4368d6d7ee Update sound.hpp 2021-07-25 00:07:17 +02:00
3af5da9d3e Documentation1 2021-07-24 22:02:52 +00:00
560ee65932 Update sound.hpp 2021-07-25 00:02:30 +02:00
e42d1ec20a Documentation1 2021-07-24 21:59:50 +00:00
bfa3b0a1c6 Update sound.hpp 2021-07-24 23:59:29 +02:00
c2484c1892 Documentation1 2021-07-24 21:48:15 +00:00
fe15309b77 Update Doxyfile 2021-07-24 23:47:54 +02:00
cadb23f9e2 Documentation1 2021-07-24 21:37:33 +00:00
c401c3f2e3 Create Doxyfile 2021-07-24 23:37:10 +02:00
b2eccd5ebb Update renderd7.hpp 2021-07-24 23:32:04 +02:00
48de80fe13 Update renderd7.hpp 2021-07-24 23:31:05 +02:00
ba97c9ed70 Update Docs.yml 2021-07-24 19:21:05 +02:00
e717a52491 Delete doc/doc/html directory 2021-07-24 19:19:33 +02:00
006f16f32f Delete doc/main/doc/html directory 2021-07-24 19:19:23 +02:00
184a97b2d7 Delete Doxyfile 2021-07-24 19:19:13 +02:00
b72caa1ba0 Update renderd7.hpp 2021-07-24 19:17:20 +02:00
b81160bbd3 Update Docs.yml 2021-07-24 19:14:57 +02:00
ae4212e5a6 Update README.md 2021-07-24 19:13:40 +02:00
6821dd2bca Documentation1 2021-07-24 17:12:30 +00:00
c5a3910ccf Update Docs.yml 2021-07-24 19:12:10 +02:00
12ea3dc60f Update Docs.yml 2021-07-24 19:09:55 +02:00
3d3f26bf57 Update Docs.yml 2021-07-24 19:08:17 +02:00
66b8f6b921 Update Docs.yml 2021-07-24 19:03:41 +02:00
cc5a011a89 Update Docs.yml 2021-07-24 18:52:38 +02:00
83e0b11f8f Update Docs.yml 2021-07-24 18:51:34 +02:00
165552b439 Update Docs.yml 2021-07-24 18:49:48 +02:00
5eefebee43 Update Docs.yml 2021-07-24 18:49:23 +02:00
762b08eb08 Update Docs.yml 2021-07-24 18:46:57 +02:00
0032d26010 Update Docs.yml 2021-07-24 18:45:10 +02:00
ee4fe4f131 Update Docs.yml 2021-07-24 18:42:59 +02:00
5b926a7317 Update Docs.yml 2021-07-24 18:39:13 +02:00
f0b02d64ef Update renderd7.hpp 2021-07-24 18:16:51 +02:00
3e2af92e7e Update Docs.yml 2021-07-24 18:04:18 +02:00
7384ba6f4f Update Docs.yml 2021-07-24 17:58:12 +02:00
a1d9b4344a Update Docs.yml 2021-07-24 17:48:52 +02:00
3fc36d5b14 Update README.md 2021-07-24 17:42:49 +02:00
87f9b915e2 Update README.md 2021-07-24 17:42:29 +02:00
fa1980d47c Update README.md 2021-07-24 17:36:59 +02:00
d80017fcb5 Update Docs.yml 2021-07-24 17:22:38 +02:00
db27c91ec9 Documentation 2021-07-24 15:18:51 +00:00
9036726e92 Update Docs.yml 2021-07-24 17:18:20 +02:00
a0350b7814 Update Docs.yml 2021-07-24 17:16:53 +02:00
0cd2f330ad Update Docs.yml 2021-07-24 17:14:31 +02:00
9a5479d68b Update Docs.yml 2021-07-24 17:00:45 +02:00
595828fe84 Update Docs.yml 2021-07-24 16:52:25 +02:00
788d8f81a5 Documentation 2021-07-24 14:31:15 +00:00
d8a6a9e45c Update Docs.yml 2021-07-24 16:30:49 +02:00
113af5fabb Update Docs.yml 2021-07-24 13:19:20 +02:00
c6b7099df2 Update Docs.yml 2021-07-24 13:14:47 +02:00
db778f462a Update Docs.yml 2021-07-24 13:12:07 +02:00
5d02c2c6f2 Update Docs.yml 2021-07-24 13:07:59 +02:00
83eeee453e Update Docs.yml 2021-07-24 11:00:39 +02:00
2d05d1e7a9 Update Docs.yml 2021-07-24 10:58:57 +02:00
4d11cb9e91 Update Docs.yml 2021-07-24 10:57:25 +02:00
cbbc4d54d9 Update Docs.yml 2021-07-24 10:15:39 +02:00
22ae99f915 Update Docs.yml 2021-07-24 10:09:48 +02:00
b7a544eadd Update Docs.yml 2021-07-24 09:36:48 +02:00
328ff9d23b Update Docs.yml 2021-07-23 19:30:37 +02:00
624b59db9d Update Docs.yml 2021-07-23 19:15:31 +02:00
adf783c2a1 Update Docs.yml 2021-07-23 16:37:00 +02:00
db89d5c60f Update Docs.yml 2021-07-23 16:26:50 +02:00
9623606229 Update Docs.yml 2021-07-23 16:21:33 +02:00
5200f27182 Update Docs.yml 2021-07-23 16:17:18 +02:00
36f545855d Update Docs.yml 2021-07-23 16:14:39 +02:00
c2b35fdf83 Update Docs.yml 2021-07-23 16:12:56 +02:00
59fcc8c159 Update Docs.yml 2021-07-23 16:08:55 +02:00
8431119ff5 Create Doxyfile 2021-07-23 16:07:38 +02:00
c537fc095a BCSTM-Player | 2021-07-23 13:58:16 +00:00
f51ddecf3d Update Docs.yml 2021-07-23 15:58:01 +02:00
fd167cd675 Update Docs.yml 2021-07-23 15:55:50 +02:00
53dcfd0940 Update Docs.yml 2021-07-23 15:52:32 +02:00
dd50e2c399 Update Docs.yml 2021-07-23 15:47:12 +02:00
ccffe19a1e Update Docs.yml 2021-07-23 15:41:57 +02:00
319582b680 Update Docs.yml 2021-07-23 15:39:39 +02:00
fb0b1110d6 Update Docs.yml 2021-07-23 15:38:57 +02:00
a6aac5f5cd Update Docs.yml 2021-07-23 15:37:14 +02:00
3d1a50d2a7 Update Docs.yml 2021-07-23 15:35:58 +02:00
51800b1960 Update Docs.yml 2021-07-23 12:48:32 +02:00
4018047409 Update Docs.yml 2021-07-23 12:42:52 +02:00
3c5adeef54 Delete main.yml 2021-07-23 12:40:34 +02:00
cf5fca1ea4 Create main.yml 2021-07-23 12:40:24 +02:00
73c4485153 Update Docs.yml 2021-07-23 12:38:08 +02:00
3a6fdc9441 Update Docs.yml 2021-07-23 12:33:00 +02:00
a7295073f8 Update Docs.yml 2021-07-23 12:30:39 +02:00
f6402a095b Update Docs.yml 2021-07-23 12:26:50 +02:00
d5b66ad125 Create Docs.yml 2021-07-23 11:36:59 +02:00
134 changed files with 85879 additions and 676 deletions

259
.clang-format Normal file
View File

@ -0,0 +1,259 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...

50
.github/workflows/Docs.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: 📄
on:
push:
branches: [ "!*" ]
pull_request:
branches: [ "*" ]
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: branch
- name: Display branch name
shell: bash
run: echo ${{ steps.branch.outputs.branch }}
# Runs a single command using the runners shell
- name: Run a one-line script
run: |
git config --global user.email "tobid7@outlook.de"
git config --global user.name "Tobi-D7"
sudo apt-get install doxygen cmake -y
doxygen
echo done
ls -r
cd ..
git clone --depth 1 https://${{ secrets.TOKEN }}@github.com/NPI-D7/RenderD7.git RD7 -b gh-pages
mv -v RenderD7/doc/html/* RD7/
#rm -r doc
cd RD7
echo tobid7
git stage *
echo staged
git commit -m "Documentation1"
git tag doc
echo commited
git push origin gh-pages
echo pushed

50
.github/workflows/Update extlibs.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Extlibs
on:
push:
branches: [ '!*' ]
pull_request:
branches: [ '!*' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: update
run: |
#gl
cd ..
git clone https://github.com/lua/lua.git
cd RenderD7
mkdir -p extlibs/
mkdir -p extlibs/lua/
cp -r ../lua/*.c extlibs/lua/
cp -r ../lua/*.h extlibs/lua/
cp -r ../lua/*.md extlibs/lua/
#RenderD7
cd ..
git clone https://github.com/NPI-D7/RenderD7.git
cd lp-next-ctr
mkdir -p extlibs/
rm -r extlibs/RenderD7
mkdir -p extlibs/RenderD7/
cp -r ../RenderD7/*.c* extlibs/RenderD7/
cp -r ../RenderD7/*.h* extlibs/RenderD7/
cp -r ../RenderD7/*.md extlibs/RenderD7/
#config
git config --global user.email "tobid7@outlook.de"
git config --global user.name "Tobi-D7"
#commit
git stage *
git commit -m "update extlibs"
git push origin main

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
release/
debug/
lib/
*.bz2
rd7le/
*.DS_Store*

18
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "3DS | Windows",
"includePath": [
"${workspaceFolder}/**",
"C:/devkitpro/libctru/include/**",
"C:/devkitpro/devkitARM/include/**",
"C:/devkitpro/devkitARM/arm-none-eabi/include/**",
"C:/devkitpro/portlibs/3ds/include/**",
"/opt/devkitpro/libctru/include/**",
"/opt/devkitpro/portlibs/**"
]
}
],
"version": 4
}

115
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,115 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/rd7tf/rd7tf.elf",
"targetArchitecture": "arm",
"serverLaunchTimeout": 10000,
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "/opt/devkitPro/devkitARM/bin/arm-none-eabi-gdb",
"miDebuggerServerAddress": "192.168.2.220:4003",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "file ${workspaceFolder}/rd7tf/rd7tf.elf -enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb-emu) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/rd7tf/rd7tf.elf",
"targetArchitecture": "arm",
"serverLaunchTimeout": 10000,
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "/opt/devkitPro/devkitARM/bin/arm-none-eabi-gdb",
"miDebuggerServerAddress": "localhost:4003",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "file ${workspaceFolder}/rd7tf/rd7tf.elf -enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb-emu) lua",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/rd7le/rd7le.elf",
"targetArchitecture": "arm",
"serverLaunchTimeout": 10000,
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\devkitPro\\devkitARM\\bin\\arm-none-eabi-gdb.exe",
"miDebuggerServerAddress": "localhost:4003",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "file ${workspaceFolder}/rd7le/rd7le.elf -enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) lua",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/rd7le/rd7le.elf",
"targetArchitecture": "arm",
"serverLaunchTimeout": 10000,
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\devkitPro\\devkitARM\\bin\\arm-none-eabi-gdb.exe",
"miDebuggerServerAddress": "192.168.2.220:4003",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "file ${workspaceFolder}/rd7le/rd7le.elf -enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) testgame",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/testgame/testgame.elf",
"targetArchitecture": "arm",
"serverLaunchTimeout": 10000,
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\devkitPro\\devkitARM\\bin\\arm-none-eabi-gdb.exe",
"miDebuggerServerAddress": "localhost:4003",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "file ${workspaceFolder}/testgame/testgame.elf -enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

118
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,118 @@
{
"files.associations": {
"array": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"numeric": "cpp",
"type_traits": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"map": "cpp",
"iomanip": "cpp",
"memory_resource": "cpp",
"ratio": "cpp",
"regex": "cpp",
"shared_mutex": "cpp",
"valarray": "cpp",
"random": "cpp",
"cuchar": "cpp",
"compare": "cpp",
"concepts": "cpp",
"numbers": "cpp",
"filesystem": "cpp",
"xstring": "cpp",
"charconv": "cpp",
"format": "cpp",
"ios": "cpp",
"list": "cpp",
"locale": "cpp",
"mutex": "cpp",
"stack": "cpp",
"stop_token": "cpp",
"thread": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"queue": "cpp",
"semaphore": "cpp",
"hash_map": "cpp",
"set": "cpp",
"unordered_set": "cpp",
"source_location": "cpp",
"future": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"variant": "cpp",
"ranges": "cpp",
"span": "cpp",
"coroutine": "cpp",
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__verbose_abort": "cpp",
"complex": "cpp"
}
}

98
CHANGELOG.md Normal file
View File

@ -0,0 +1,98 @@
# RenderD7 Changelog
## 0.9.5
- Remove Npi Intro and NVID Api
- Replace Toasts System with Message
- Lots of Optimisations
- Added GetTime
- Implement Draw2 Api
- Implement RD7Color and R7Vec2
- Add new Features to Color::RGBA
- Cleanup Code
- Added RenderD7 Keyboard (Overlay)
- Added Ftrace Overlay
- Moved MetrikOVL into an Overlay
- Removed Old Font/Text Handlers
- Added UI7 (New UI Api)
- Remove Old UI Api
- Added Music Player (MP3, Vorbis)
- Rewrite of RenderD7::Image
- Internal Debugger/Database (IDB)
- Removed BitmapPrinter
- Added nimg and nimg_engine
- Removed Old Error/Message Handler
- GetTextSize (extra buffer) + New TextShorter
## 0.9.4
- Implement new Security System To prevent from crashes
- Implement Functiontrace for better Timing Tests
- Implement MemAlloc Tracker (only size)
- Add some new Overlays (not functional yet)
- Complete Rewrite of Overlay System
- Fixed the FrameEnd Crash
- New System to get Hardware Info
- Removed RenderD7 Super Reselution (800px mode)
## 0.9.3
- Completly Documented Everything
- Fix typo in Sprite::getHeight
- Remove Deprecated/Useless Stuff
## 0.9.2
- Add Nvid Support(v0.0.1)
- Add Basic RenderD7 Splash
- Faster Graphics Init
- Fade Effects
- Fix Changelog Screen
## 0.9.1
- Fix Critical bug in Spritesheet animations
- Fix RenderD7::Color::Hex (Major performance tweak)
## 0.9.0
- Remove Stupid try of Console
- Add Services list
- Clean up Code
- Added Minimal Init for hax2.x
## 0.8.5
- Fix Deltatime
## 0.8.4
- A lot of Fixes
- New Features for BitmapPrinter
## 0.8.3
- Added Overlaycount to Info
- Addet ResultDecoder for errors
## 0.8.2
- Fix a lot of Stuff
- Use c++17 std::filesystem for RenderD7::Filesystem
## 0.8.1
- Add abillity to Get Stdout as string to render it to the screen.
## 0.8.0
- Implement BitmapPrinter
## 0.7.3
- Implement Over Render Overlay Framework
## 0.7.2
- Implement MT to csv file saving
- Add RGB2HEX
## 0.7.1
- Add the New Overlay Handler. Its Just in code and does nothing yet
## 0.7.0
- Made Big Progress In the MT Ovl but it still crashes On a 2nd C3D_FrameEnd \
- Implement 800px but doesn't work that good
## 0.6.2
- Fix Crash when exiting through Home Menu.
## 0.6.10
- Rewrite Threadsystem
- Improve framerate
## 0.6.02
- Fix Code in lang.hpp
- Add Draw Text Left Function (Right since 0.7.0)
- Add changelog
## 0.6.01
- Add Threading system
## 0.6.0
- Better Scene Management
## 0.5.0
- Fixed some Bugs!
## 0.4.0
- Trying to fix Filesystem and Bugs
## 0.3.0
- Recreate D7-Core into RenderD7
## 0.2.0
- Trying to create Animations of Images instead of Sheets
## 0.1.0
- Inital Release of D7-Core sprite animation plugin

2566
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

1348
LICENSE

File diff suppressed because it is too large Load Diff

201
Makefile Normal file
View File

@ -0,0 +1,201 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
include $(DEVKITARM)/3ds_rules
export renderd7_MAJOR := 0
export renderd7_MINOR := 9
export renderd7_PATCH := 4
VERSION := $(renderd7_MAJOR).$(renderd7_MINOR).$(renderd7_PATCH)
# If on a tagged commit, use the tag instead of the commit
ifneq ($(shell echo $(shell git tag -l --points-at HEAD) | head -c 1),)
GIT_VER := $(shell git tag -l --points-at HEAD)
else
GIT_VER := $(shell git rev-parse --short HEAD)
endif
TIME_TIME := $(shell date --iso=seconds)
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
#---------------------------------------------------------------------------------
TARGET := renderd7
SOURCES := source source/external source/music
DATA := data
INCLUDES := include
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
CFLAGS := -g -Wall -mword-relocations -save-temps\
-DV_RD7CSTRING=\"$(GIT_VER)\" \
-DV_RD7BTIME=\"$(TIME_TIME)\" \
-ffunction-sections -fdata-sections \
$(ARCH) $(BUILD_CFLAGS)
CFLAGS += $(INCLUDE) -D__3DS__ -D_GNU_SOURCE=1
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++20
ASFLAGS := -g $(ARCH) $(DEFINES)
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(CTRULIB)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica)))
SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES_BIN := $(addsuffix .o,$(BINFILES)) \
$(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o)
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(PICAFILES:.v.pica=_shbin.h) $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
.PHONY: clean all doc
#---------------------------------------------------------------------------------
all: lib/librenderd7.a lib/librenderd7d.a
doc:
@doxygen Doxyfile
dist-bin: all
@tar --exclude=*~ -cjf $(TARGET).tar.bz2 include lib
dist-src:
@tar --exclude=*~ -cjf $(TARGET)-src.tar.bz2 include $(SOURCES) Makefile
dist: dist-src dist-bin
lib:
@[ -d $@ ] || mkdir -p $@
release:
@[ -d $@ ] || mkdir -p $@
debug:
@[ -d $@ ] || mkdir -p $@
lib/librenderd7.a : lib release $(SOURCES) $(INCLUDES)
@$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
BUILD_CFLAGS="-DNDEBUG=1 -O2 -fomit-frame-pointer" \
DEPSDIR=$(CURDIR)/release \
--no-print-directory -C release \
-f $(CURDIR)/Makefile
lib/librenderd7d.a : lib debug $(SOURCES) $(INCLUDES)
@$(MAKE) BUILD=debug OUTPUT=$(CURDIR)/$@ \
BUILD_CFLAGS="-DDEBUG=1 -Og" \
DEPSDIR=$(CURDIR)/debug \
--no-print-directory -C debug \
-f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr release debug lib includes
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT) : $(OFILES)
$(OFILES_SOURCES) : $(HFILES)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
#---------------------------------------------------------------------------------
# rules for assembling GPU shaders
#---------------------------------------------------------------------------------
define shader-as
$(eval CURBIN := $*.shbin)
$(eval DEPSFILE := $(DEPSDIR)/$*.shbin.d)
echo "$(CURBIN).o: $< $1" > $(DEPSFILE)
echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h
echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h
echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h
picasso -o $(CURBIN) $1
bin2s $(CURBIN) | $(AS) -o $*.shbin.o
endef
%.shbin.o %_shbin.h : %.v.pica %.g.pica
@echo $(notdir $^)
@$(call shader-as,$^)
%.shbin.o %_shbin.h : %.v.pica
@echo $(notdir $<)
@$(call shader-as,$<)
%.shbin.o %_shbin.h : %.shlist
@echo $(notdir $<)
@$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)$(file)))
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

View File

@ -1,2 +1,58 @@
# RenderD7
Simple and Easey to use UI and Graphics helper.
# <img alt="LOGO" src="https://github.com/NPI-D7/RenderD7/raw/main/logo.png" height="90">
RenderD7 is now LibRenderD7.
### Installation
Download a Package From Releses Page
`https://github.com/NPI-D7/RenderD7/releases/download/v0.9.4/renderd7.tar.bz2 -o renderd7.tar.bz2`
Then Extract it to your Libraries Path
`bzip2 -cd renderd7.tar.bz2 | tar -xf - -C path_to_your_libs`
Finally put `-lrenderd7` to the First Place and add the path_to_your_libs
```
LIBS := -lrenderd7 -lcurl -lstdc++ -lm -lcitro2d -lcitro3d -lctru
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(CTRULIB) ../path_to_your_libs
```
Make sure that `-lrenderd7` is before `-lcitro2d`, `-lcitro3d`, `-lctru`.
Here an example tree
```
Example-App
├── gfx
├── libs
│ ├── include
│ │ ├── rd7.hpp
│ │ └── renderd7
│ └── lib
│ ├── librenderd7.a
│ └── librenderd7d.a
├── Makefile
├── romfs
│ └── gfx
└── src
└── main.cpp
```
# Back to Old Usage aka Submodule (0.9.5+)
If you want to use RenderD7 as Submodule run
`git submodule add https://github.com/NPI-D7/RenderD7`
And to Use Add this to make file
```
# Make Sure to Change this paths if your Submodule
# is located somewhere else
RENDERD7_SRC := RenderD7/source RenderD7/external
RENDERD7_INC := RenderD7/include
```
Now you need to add it to your sources and includes
```
SOURCES := source $(RENDERD7_SRC)
INCLUDES := source $(RENDERD7_INC)
```
Example from rd7tf
# Credits
- NPI-D7
- Tobi-D7 Main Dev
Some Icons are From
https://icons8.de/
See Subfolder Readmes

31
assets/build_assets.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
echo "Create Directorys"
mkdir -p build
mkdir -p code
echo "Generating Spritesheets"
cd resources
for file in *.t3s
do
filename=$(basename "$file" .t3s).t3x
tex3ds -o "../build/$filename" -i "${file}"
done
echo "Converting Spritesheets into C++ Code"
cd ../code
for file in ../build/*.t3x
do
name="${file##*/}"
name="${name%.*}"
../../tools/bin/file2array "${file}" "${name}"
done
echo "Fix The Output of file2array"
for file in ./*.cpp
do
../../tools/bin/rd7f2afix "${file}" "renderd7"
done
echo "Finished!"

7
assets/clear_assets.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
echo "Deleting Directorys"
rm -rf build
rm -rf code
echo "Finished!"

View File

@ -0,0 +1,3 @@
--atlas -f rgba -z auto
renderd7_logo/renderd7_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

8
cformat.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
find . -type f \( -name '*.h' -o -name '*.hpp' -o -name '*.hh' -o -name '*.ino' -o -name '*.cpp' -o -name '*.c' -o -name '*.cxx' -o -name '*.inl' \) -and -not -path './build/*' -not -path './base/external/*' -not -path './DPP/*' | while read file; do
if [[ "$file" != *"json.hpp" ]]; then
echo "Formatting $file..."
clang-format -i --style=LLVM $file
fi
done

638
docsn.css Normal file
View File

@ -0,0 +1,638 @@
/* This doxygen theme is free to use. If you like this, please Star https://github.com/kcwongjoe/doxygen_theme_flat_design */
/* Color Pattern. You can change this pattern to design your theme. */
:root {
/* Content */
--bgcolor: #ffffff;
--bgfont: #303030;
--bgfont2: #f3c60a;
--bgfont-hover: #f3c60a;
--bgfont-hover-text-decoration: none;
--bgborder: #7d7d7d;
--bgborder2: #f6f6f6;
/* Main Header */
--bg1color: #303030;
--bg1font: #ffffff;
--bg1font2: #f3c60a;
/* Second header */
--bg2color: #E2E2E2;
--bg2font: #7D7D7D;
--bg2-hover-bg: #ffffff;
--bg2-hover-font: #303030;
--bg2-hover-topborder: #f3c60a;
/* Third header */
--bg3color: #f6f6f6;
--bg3font: #303030;
--bg3font2: #7D7D7D;
/* Code */
--code-bg: #f6f6f6;
--code-comment: #7D7D7D;
--code-keyword: #d73a49;
--code-preprocessor: #d73a49;
--code-keywordtype: #d73a49;
--code-text: #303030;
--code-code: #6f42c1;
--code-line: #7D7D7D;
--code-line-bg: #D8D8D8;
/* Namespace List, Class List icon */
--icon-bg: #303030;
--icon-font: #f3c60a;
/* Class Index */
--qindex-menu-bg: #303030;
--qindex-menu-font: #ffffff;
--qindex-menu-font-hover: #f3c60a;
--qindex-icon-bg: #f3c60a;
--qindex-icon-font: #303030;
/* Member table */
--mem-title-bg: #303030;
--mem-title-font: #ffffff;
--mem-subtitle-bg: #f3c60a;
--mem-subtitle-font: #303030;
--mem-subtitle-font-hover: #303030;
--mem-content-bg: #ffffff;
--mem-content-font: #303030;
--mem-content-border: #f6f6f6;
/* Nav Tree */
--nav-tree-bg: #E2E2E2;
--nav-tree-bg-hover: #ffffff;
--nav-tree-font: #7D7D7D;
--nav-tree-font-hover: #303030;
--nav-tree-bg-selected: #f3c60a;
--nav-tree-font-selected: #303030;
}
body, table, div, p, dl {
color: var(--bgfont);
background-color: var(--bgcolor);
line-height: 150%;
font: 14px/22px, Roboto, Arial;
}
div.contents {
margin: 20px 40px;
}
div.contents ul {
line-height: 200%;
}
/***********************************/
/********** Project header *********/
/***********************************/
#titlearea {
border-bottom: none;
padding-bottom: 20px;
padding-top: 20px;
}
#titlearea, #titlearea * {
color: var(--bg1font);
background-color: var(--bg1color);
}
#projectname {
padding: 0px 40px !important;
}
#projectbrief {
padding: 0px 40px !important;
}
#projectalign {
padding: 0px !important;
}
/***********************************/
/************ Main Menu ************/
/***********************************/
/* Margin */
#main-menu {
padding: 0px 30px;
}
#main-menu a, #main-menu a:hover {
padding-top: 10px;
padding-bottom: 10px;
}
/* Menu button */
#main-menu li a {
background-image: none;
font-family: Arial;
text-transform: uppercase;
text-shadow: none;
font-size: 14px;
font-weight: 700;
}
#main-menu, #main-menu>li>a {
background-image: none;
background-color: var(--bg2color);
color: var(--bg2font);
transition: 0.2s;
}
/* hover Effect */
#main-menu>li {
border-top: 5px solid var(--bg2color);
}
#main-menu>li:hover {
color: var(--bg2-hover-font);
background-color: var(--bg2-hover-bg);
border-top: 5px solid var(--bg2-hover-topborder);
}
#main-menu>li:hover, #main-menu>li>a:hover, #main-menu>li>a.highlighted {
color: var(--bg2-hover-font);
background-color: var(--bg2-hover-bg);
}
/* Search Bar */
#MSearchBox {
border-radius: 0;
box-shadow: none;
}
#MSearchBox>span {
margin: 10px;
}
#main-menu>li:last-child {
padding: 25px 0px;
}
/* Reset search hover color*/
#main-menu>li:last-child:hover {
color: var(--bg2font);
background-color: var(--bg2color);
border-top: 5px solid var(--bg2color);
}
#MSearchResultsWindow {
border: 1px solid var(--bg3font2);
background-color: var(--bg3color);
padding: 10px;
}
body.SRPage, body.SRPage * {
font-family: Arial;
}
/* Sub Menu */
#main-menu>li ul {
transition: max-height 0.2s ease-in-out;
padding: 0px;
border-radius: 0px !important;
}
#main-menu>li ul:before, #main-menu>li ul:after {
border-width: 0px;
}
#main-menu>li>ul li a, #main-menu>li>ul li {
background-color: var(--bgcolor);
color: var(--bgfont);
background-image: none;
}
#main-menu>li>ul li a:hover, #main-menu>li>ul li:hover {
background-color: var(--bgfont2);
color: var(--bgfont);
}
/***********************************/
/************** Header *************/
/***********************************/
div.headertitle {
padding: 5px 40px;
}
div.header, div.header * {
color: var(--bg3font);
background-color: var(--bg3color);
border-bottom: none;
}
div.summary {
padding-right: 40px;
}
/***********************************/
/************** Link *************/
/***********************************/
a, a:visited, a:active, .contents a:visited, body.SRPage a, body.SRPage a:visited, body.SRPage a:active {
color: var(--bgfont);
text-decoration: none;
}
a:hover, .contents a:hover, body.SRPage a:hover {
color: var(--bgfont-hover);
text-decoration: var(--bgfont-hover-text-decoration);
}
/***********************************/
/************ Nav-path ************/
/***********************************/
#nav-path, #nav-path ul {
background-image: none;
}
#nav-path ul {
padding: 5px 30px;
}
#nav-path, #nav-path * {
color: var(--bg3font2);
background-color: var(--bg3color);
border: none;
font-family: Arial;
}
li.navelem {
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuY29tL3N2Z2pzIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDI5Mi4zNTkgMjkyLjM1OSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgY2xhc3M9IiI+PGc+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8cGF0aCBkPSJNMjIyLjk3OSwxMzMuMzMxTDk1LjA3Myw1LjQyNEM5MS40NTYsMS44MDcsODcuMTc4LDAsODIuMjI2LDBjLTQuOTUyLDAtOS4yMzMsMS44MDctMTIuODUsNS40MjQgICBjLTMuNjE3LDMuNjE3LTUuNDI0LDcuODk4LTUuNDI0LDEyLjg0N3YyNTUuODEzYzAsNC45NDgsMS44MDcsOS4yMzIsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4ICAgYzQuOTQ5LDAsOS4yMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNi0xMjcuOTA3YzMuNjE0LTMuNjEzLDUuNDI4LTcuODk3LDUuNDI4LTEyLjg0NyAgIEMyMjguNDA3LDE0MS4yMjksMjI2LjU5NCwxMzYuOTQ4LDIyMi45NzksMTMzLjMzMXoiIGZpbGw9IiM3ZDdkN2QiIGRhdGEtb3JpZ2luYWw9IiMwMDAwMDAiIHN0eWxlPSIiIGNsYXNzPSIiPjwvcGF0aD4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8L2c+PC9zdmc+);
background-size: 9px;
}
li.navelem a {
margin-right: 20px;
}
/***********************************/
/*************** mem ***************/
/***********************************/
.memtitle {
padding: 15px;
margin-top: 30px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
.memtitle, .memtitle *, .memtitle a:visited {
border: none;
background-image: none;
color: var(--mem-title-font);
background-color: var(--mem-title-bg);
}
.memproto {
padding: 10px;
text-shadow: none;
padding: 20px;
border-top-right-radius: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-right-radius: 0px;
}
.memproto, .memproto *, .memproto a:visited {
border: none;
background-image: none;
background-color: var(--mem-subtitle-bg);
color: var(--mem-subtitle-font);
font-size: inherit;
line-height: 100%
}
.memproto a:hover {
color: var(--mem-subtitle-font-hover);
}
.memdoc {
border-bottom: 1px solid var(--mem-content-border);
border-left: 1px solid var(--mem-content-border);
border-right: 1px solid var(--mem-content-border);
background-color: var(--mem-content-bg);
color: var(--mem-content-font);
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-bottomleft: 0px;
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-left-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
}
.memdoc p, .memdoc dt {
padding: 0px 20px;
}
/***********************************/
/************* Contents ************/
/***********************************/
a.anchor {
padding-top: 20px;
}
/***********************************/
/************* fragment ************/
/***********************************/
h2.groupheader {
color: #303030;
font-size: 200%;
font-weight: bold;
border-bottom: none;
padding-top: 20px;
padding-bottom: 20px;
}
div.fragment, pre.fragment {
border: none;
padding: 20px;
margin: none;
background-color: var(--code-bg);
}
div.line {
background-color: var(--code-bg);
}
span.comment {
color: var(--code-comment);
}
span.keyword {
color: var(--code-keyword);
}
span.preprocessor {
color: var(--code-preprocessor);
}
span.keywordtype {
color: var(--code-keywordtype);
}
span.mlabel {
background-color: var(--code-text);
color: var(--code-bg);
border-top: none;
border-left: none;
border-right: none;
border-bottom: none;
padding: 10px;
border-radius: 0px;
}
a.code {
color: var(--code-code);
}
span.lineno, span.lineno>* {
color: var(--code-line);
border-right: none;
background-color: var(--code-bg);
}
span.lineno a {
background-color: var(--code-line-bg);
}
span.lineno a:hover {
color: var(--bg3font);
background-color: var(--code-line-bg);
}
/***********************************/
/************* directory ***********/
/***********************************/
.directory tr.even {
background-color: inherit;
}
.iconfclosed {
background-image: url(closed-folder.png);
margin-right: 10px;
}
.iconfopen {
background-image: url(opened-folder.png);
margin-right: 10px;
}
.icondoc {
background-image: url(document.png);
margin-right: 10px;
}
.arrow {
color: #7d7d7d;
}
.icona {
vertical-align: middle;
margin-right: 5px;
}
.icon {
background-color: var(--icon-bg);
color: var(--icon-font);
display: table-cell;
vertical-align: middle;
height: 20px;
width: 20px;
}
div.ah {
background-color: var(--qindex-icon-bg);
color: var(--qindex-icon-font);
text-align: center;
background-image: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-border-radius: 0px;
border-radius: 0px;
border: none;
}
div.qindex {
background-color: var(--qindex-menu-bg);
border: none;
padding: 20px;
}
a.qindex {
color: var(--qindex-menu-font);
font-weight: normal;
font-size: 20px;
}
a:hover.qindex {
color: var(--qindex-menu-font-hover);
}
a:visited.qindex {
color: var(--qindex-menu-font);
}
table.classindex {
margin-top: 30px;
margin-bottom: 30px;
}
table.classindex a.el {
font-weight: normal;
}
/***********************************/
/************** footer *************/
/***********************************/
div.directory {
border-top: 1px solid var(--bgborder);
border-bottom: none;
margin: 20px 0px;
}
div.directory a.el {
font-weight: normal;
}
div.directory>table {
margin: 20px 0px;
}
hr.footer {
border: none;
}
.contents>hr {
border-top: 0px;
}
/***********************************/
/*********** memberdecls ***********/
/***********************************/
.memItemLeft, .memItemRight {
padding: 15px 30px;
background-color: inherit;
}
.mdescRight {
padding: 0px 30px 10px 30px;
}
.memberdecls * {
background-color: inherit;
}
.memSeparator {
border-bottom: 1px solid var(--bgborder2);
}
.memTemplParams {
color: var(--bgfont);
}
/***********************************/
/*********** nav-tree ***********/
/***********************************/
#nav-tree-contents {
background-color: var(--nav-tree-bg);
margin: 0px;
}
#side-nav, #nav-tree {
background-image: none;
background-color: var(--nav-tree-bg);
}
#nav-tree .item {
background-color: var(--nav-tree-bg);
font-family: Arial;
text-transform: uppercase;
text-shadow: none;
font-size: 14px;
font-weight: 700;
padding: 10px;
color: var(--nav-tree-font);
}
#nav-tree .arrow {
color: var(--nav-tree-font);
}
#nav-tree .selected {
background-image: none;
background-color: var(--nav-tree-bg-selected);
}
#nav-tree .selected a {
color: var(--nav-tree-font-selected);
}
#nav-tree .item:hover {
background-color: var(--nav-tree-bg-hover);
color: var(--nav-tree-font-hover);
}
#nav-tree .item a:hover {
color: var(--nav-tree-font-hover);
}
#side-nav .ui-resizable-e {
background-image: none;
background-color: var(--nav-tree-bg);
}
#nav-sync {
background-color: transparent;
}
#nav-sync>img {
content: url(off_sync.png);
}
#nav-sync.sync>img {
content: url(on_sync.png);
}
/***********************************/
/*********** Plant UML ***********/
/***********************************/
.plantumlgraph > img {
width: 80%;
}

23
envsetup.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
#Build Tools
echo "Build Tools..."
cd tools
./build_tools.sh
cd ..
#Setup asset-arrays
echo "Generate Asset-Arrays..."
cd assets
./build_assets.sh
echo "Update Files in RenderD7..."
cp -rf code/*.cpp ../source/
cp -rf code/*.hpp ../include/renderd7/
echo "Clean Assets..."
./clear_assets.sh
cd ..
#Clear Tools
echo "Clean Tools..."
cd tools
./clear_tools.sh
cd ..
#Finished
echo "Done!"

16
include/rd7.hpp Normal file
View File

@ -0,0 +1,16 @@
#pragma once
#include <renderd7/StealConsole.hpp>
#include <renderd7/renderd7.hpp>
#include <renderd7/sound.hpp>
#include <renderd7/Message.hpp>
#include <renderd7/DrawV2.hpp>
#include <renderd7/Hid.hpp>
#include <renderd7/UI7.hpp>
#include <renderd7/FileSystem.hpp>
#include <renderd7/Image.hpp>
#include <renderd7/Timer.hpp>
#include <renderd7/music/Music.hpp>
#include <renderd7/nimg_engine.hpp>
#include <renderd7/global_db.hpp>
#include <renderd7/Error.hpp>

169
include/renderd7/Color.hpp Normal file
View File

@ -0,0 +1,169 @@
#pragma once
#include <unistd.h>
#include <cstring>
#include <functional>
#include <memory>
#include <regex>
#include <sstream>
#include <string>
#define UNPACK_RGBA(col) (uint8_t)(col >> 24), (col >> 16), (col >> 8), (col)
#define UNPACK_BGRA(col) (uint8_t)(col >> 8), (col >> 16), (col >> 24), (col)
// it is actually not RGBA lol
inline uint32_t RGBA8(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) {
#define ISIMPLEPAK(x, y) (((x) & 0xff) << y)
return (ISIMPLEPAK(r, 0) | ISIMPLEPAK(g, 8) | ISIMPLEPAK(b, 16) |
ISIMPLEPAK(a, 24));
}
/*#define RGBA8(r, g, b, a) \
((((r)&0xFF) << 0) | (((g)&0xFF) << 8) | (((b)&0xFF) << 16) | \
(((a)&0xFF) << 24))*/
typedef int RD7Color;
// MultiColor (Less FunctionNameLen)
struct Color2 {
unsigned int color0;
unsigned int color1;
};
struct Color3 {
unsigned int color0;
unsigned int color1;
unsigned int color2;
};
struct Color4 {
unsigned int color0;
unsigned int color1;
unsigned int color2;
unsigned int color3;
};
enum RD7Color_ {
RD7Color_Text, ///< This Color Should always be used for Light Backgrounds
RD7Color_TextDisabled, /// Text Disabled Color
RD7Color_Text2, ///< And This want for Texts on Dark Backgrounds
RD7Color_Background, ///< Your Bg Color
RD7Color_Header, ///< Header Color (if the header is dark text2 is used)
RD7Color_Selector,
RD7Color_SelectorFade,
RD7Color_List0,
RD7Color_List1,
RD7Color_MessageBackground,
RD7Color_Button,
RD7Color_ButtonHovered,
RD7Color_ButtonDisabled,
RD7Color_ButtonActive,
RD7Color_Checkmark,
RD7Color_FrameBg,
RD7Color_FrameBgHovered,
RD7Color_Progressbar,
};
namespace RenderD7 {
unsigned int StyleColor(RD7Color color);
void RedirectColor(RD7Color to, RD7Color from);
void TextColorByBg(RD7Color background);
/// @brief Customices a color until undone
/// For example with RebderD7::Color::Hex
void CustomizeColor(RD7Color color, unsigned int custom);
/// @brief Completly changes a theme color
void ColorNew(RD7Color color, unsigned int new_color);
void UndoColorEdit(RD7Color color);
void UndoAllColorEdits();
namespace Color {
/// @brief RGBA Class
class RGBA {
public:
/// @brief Construct
/// @param r
/// @param g
/// @param b
/// @param a
RGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
: m_r(r), m_g(g), m_b(b), m_a(a) {}
/// @brief Construct
/// @param r
/// @param g
/// @param b
/// @param a
RGBA(float r, float g, float b, float a = 1.f)
: m_r(r * 255.f), m_g(g * 255.f), m_b(b * 255.f), m_a(a * 255.f) {}
RGBA(unsigned int in) {
#define ISIMPLEUNPAK(x, y) (((x) >> y) & 0xFF)
m_r = ISIMPLEUNPAK(in, 0);
m_g = ISIMPLEUNPAK(in, 8);
m_b = ISIMPLEUNPAK(in, 16);
m_a = ISIMPLEUNPAK(in, 24);
}
RGBA(RD7Color in) {
unsigned int col = RenderD7::StyleColor(in);
m_r = ISIMPLEUNPAK(col, 0);
m_g = ISIMPLEUNPAK(col, 8);
m_b = ISIMPLEUNPAK(col, 16);
m_a = ISIMPLEUNPAK(col, 24);
}
RGBA &changeR(unsigned char r) {
m_r = r;
return *this;
}
RGBA &changeG(unsigned char g) {
m_g = g;
return *this;
}
RGBA &changeB(unsigned char b) {
m_b = b;
return *this;
}
RGBA &changeA(unsigned char a) {
m_a = a;
return *this;
}
RGBA &fade_to(const RGBA &color, float p) {
m_a =
m_a + static_cast<unsigned char>((color.m_a - m_a) * ((p + 1.0f) / 2));
m_b =
m_b + static_cast<unsigned char>((color.m_b - m_b) * ((p + 1.0f) / 2));
m_g =
m_g + static_cast<unsigned char>((color.m_g - m_g) * ((p + 1.0f) / 2));
m_r =
m_r + static_cast<unsigned char>((color.m_r - m_r) * ((p + 1.0f) / 2));
return *this;
}
/// @brief Get as Uint32
/// @return color
uint32_t toRGBA() const { return RGBA8(m_r, m_g, m_b, m_a); }
// Just calculate the "lightness" f.e. to use Text or Text2
float luminance() const {
// For Reference https://en.wikipedia.org/wiki/HSL_and_HSV#Lightness
return (0.3 * (m_r / 255.f) + 0.59 * (m_g / 255.f) + 0.11 * (m_b / 255.f));
}
bool is_light() {
// Gives us the light or dark to not
// always use the below "if" statement
return (luminance() >= 0.5);
}
uint8_t m_r, m_g, m_b, m_a;
};
/// @brief Convert RGB to Hex
/// @param r
/// @param g
/// @param b
/// @return Hex-String
std::string RGB2Hex(int r, int g, int b);
/// @brief Hex to U32
/// @param color
/// @param a
/// @return Color32
uint32_t Hex(const std::string &color, uint8_t a = 255);
} // namespace Color
} // namespace RenderD7

View File

@ -0,0 +1,51 @@
#pragma once
#include <citro2d.h>
#include <renderd7/Color.hpp>
#include <renderd7/R7Vec.hpp>
#include <renderd7/Image.hpp>
#include <string>
#define MAKEFLAG(x) (1 << x)
typedef unsigned int RD7TextFlags;
enum RD7TextFlags_ {
RD7TextFlags_None = 0, //< Align is Left and Other things are disabled
RD7TextFlags_AlignRight = MAKEFLAG(0),
RD7TextFlags_AlignMid = MAKEFLAG(1),
RD7TextFlags_Shaddow = MAKEFLAG(2), // TextBuf Killer lol (doubled Text)
RD7TextFlags_Wrap = MAKEFLAG(3),
RD7TextFlags_Short = MAKEFLAG(4),
RD7TextFlags_Scroll = MAKEFLAG(5),
};
namespace RenderD7 {
R7Vec2 GetTextDimensions(const std::string &text);
void CustomTextSize(float size);
void TextDefaultSize();
std::string TextShort(const std::string& in, int max_len);
// Overrite TextBox Size (by default Screenwidth x Text.h)
void TextMaxBox(R7Vec2 size);
void TextDefaultBox();
void TextFont(C2D_Font fnt);
void TextDefaultFont();
namespace Draw2 {
void Rect(R7Vec2 pos, R7Vec2 size, unsigned int color, int t = 1);
void RectFilled(R7Vec2 pos, R7Vec2 size, Color4 colors);
void RectFilledSolid(R7Vec2 pos, R7Vec2 size, unsigned int color);
// Wrapper of RectFilledSolid
inline void RFS(R7Vec2 pos, R7Vec2 size, unsigned int color) {
RectFilledSolid(pos, size, color);
}
void Line(R7Vec2 pos0, R7Vec2 pos1, unsigned int color, int t = 1);
void Triangle(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, Color3 colors);
void TriangleSolid(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, unsigned int color);
// Beta and Very unstable
void TriangleLined(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, unsigned int color,
int t = 1);
void Text(R7Vec2 pos, const std::string& text, RD7TextFlags flags = 0);
void Image(RenderD7::Image* img, const R7Vec2& pos = R7Vec2(0, 0), const R7Vec2& scale = R7Vec2(1, 1));
} // namespace Draw2
} // namespace RenderD7

View File

@ -0,0 +1,16 @@
#pragma once
#include <string>
namespace RenderD7 {
void Error(const std::string& msg);
inline void InlineError(const std::string& msg) {
std::string location = __FILE__ + std::string(":") + std::to_string(__LINE__);
Error("Error: \n" + location + "\n" + msg);
}
inline void InlineAssert(bool v, const std::string& msg) {
std::string location = __FILE__ + std::string(":") + std::to_string(__LINE__);
if(v == false)
Error("Assert Failed:\n" + location + "\n" + msg);
}
}

View File

@ -0,0 +1,25 @@
#pragma once
#include <string>
#include <vector>
namespace RenderD7 {
namespace FileSystem {
/// @brief A Directory Entry
struct Entry {
/// @brief Patf of The Entry
std::string path;
/// @brief Name of The Entry
std::string name;
/// @brief Directory or File
bool dir = false;
};
/// @brief Gets All Entrys of A Directory into a Vector
/// @param path The Path of the Directory
/// @return The Vector of found Entrys
std::vector<RenderD7::FileSystem::Entry> GetDirContent(std::string path);
std::string GetParentPath(std::string path, std::string mount_point);
std::vector<Entry>
GetDirContentsExt(std::string &path,
const std::vector<std::string> &extensions);
} // namespace FileSystem
} // namespace RenderD7

View File

@ -0,0 +1,53 @@
#pragma once
// Base includes
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <vector>
// 3ds does not support std::chrono
#include <3ds.h>
/// @brief 3ds System Ticks per milli second
#define TICKS_PER_MSEC 268111.856
#define f2s(x_) #x_
#define scomb(x1, x2) std::string(x1 + x2)
namespace RenderD7 {
namespace Ftrace {
/// @brief Result of FTrace
struct FTRes {
std::string group; ///< Group of the Trace
std::string func_name; ///< Function Name
uint64_t time_start; ///< when started
uint64_t time_end; ///< when stopped
float time_of; ///< stop - start (how long)
bool is_ovl; ///< is displayed in overlay?
};
/// @brief Map of Traces
extern std::map<std::string, RenderD7::Ftrace::FTRes> rd7_traces;
/// @brief Set a Start TracePoint
/// @param group Set a Group Name
/// @param func_name Set a Function Name
inline void Beg(std::string group, std::string func_name) {
std::string trace_id = scomb(group, func_name);
rd7_traces[trace_id].group = group;
rd7_traces[trace_id].func_name = func_name;
rd7_traces[trace_id].time_start = svcGetSystemTick();
}
/// @brief Set an End TracePoint
/// @param group Set a Group Name
/// @param func_name Set a Function Name
inline void End(std::string group, std::string func_name) {
std::string trace_id = scomb(group, func_name);
rd7_traces[trace_id].time_end = svcGetSystemTick();
rd7_traces[trace_id].time_of = static_cast<float>(
rd7_traces[trace_id].time_end / (float)TICKS_PER_MSEC -
rd7_traces[trace_id].time_start / (float)TICKS_PER_MSEC);
}
} // namespace Ftrace
} // namespace RenderD7

View File

@ -0,0 +1,23 @@
#pragma once
namespace RenderD7 {
namespace Hardware {
/// @brief Initialisize required Services
void Initialisize();
/// @brief Check if Headphones are Plugged in
/// @return true if headphones plugged in
bool IsHeadphones();
/// @brief Check if the 3ds Is Charging
/// @return true if System gets Charged
bool IsCharging();
/// @brief Check the Battery Percentage
/// @return Persentage as float
float GetBatteryPercentage();
/// @brief Get current State of 3d Slider
/// @return current 3dslider poition
float Get3dSliderLevel();
/// @brief Get Current state of Sound Slider
/// @return current SoundSlider state
float GetSoundSliderLevel();
} // namespace Hardware
} // namespace RenderD7

41
include/renderd7/Hid.hpp Normal file
View File

@ -0,0 +1,41 @@
/// WARNING
/// THIS IS BETA STUFF
/// ITS MAKE LIKE EXTERNAL BUT
/// FOR RENDERD7 ITS INTEGRATED
#pragma once
#include <renderd7/R7Vec.hpp>
#include <string>
namespace RenderD7 {
namespace Hid {
enum Actions {
Down = 0,
Held = 1,
Up = 2,
DownRepeat = 3,
};
// Register Functions
// Register Current state values
void RegKeyDown(uint32_t &key_down);
void RegKeyHeld(uint32_t &key_held);
void RegKeyUp(uint32_t &key_up);
void RegKeyRepeat(uint32_t &repeat);
void RegTouchCoords(R7Vec2 &touch_pos);
// Not Corectly Implemented Yet
void RegAnalog1Movement(R7Vec2 &movement);
void RegAnalog2Movement(R7Vec2 &movement);
// Register Keys
void RegKeyEvent(const std::string &event, uint32_t key);
// KeyEvents
bool IsEvent(const std::string &event, Actions action);
R7Vec2 GetTouchPosition();
R7Vec2 GetLastTouchPosition();
void Update();
// Lock/Unlock Input api for example for Keyboard
void Lock();
void Unlock();
void Clear();
} // namespace Hid
} // namespace RenderD7

View File

@ -0,0 +1,30 @@
#pragma once
#include <citro2d.h>
#include <3ds.h>
#include <renderd7/R7Vec.hpp>
#include <renderd7/nimg.hpp>
#include <string>
namespace RenderD7 {
class Image {
public:
Image();
~Image();
void load(const std::string& path);
void from_nimg(const nimg& image);
C2D_Image get();
C2D_Image& get_ref();
void set(const C2D_Image& i);
R7Vec2 get_size();
bool loaded();
private:
void safe_del();
bool ld = false;
C2D_Image img;
};
}

View File

@ -0,0 +1,25 @@
#pragma once
#include <cstdint>
#include <memory>
namespace RenderD7 {
namespace Memory {
/// @brief Metriks struct For the Internal Tracker
struct memory_metrics {
uint32_t t_TotalAllocated = 0; ///< Total Allocated Memory
uint32_t t_TotalFreed = 0; ///< Total Deleted Memory
/// @brief Gets the Currently Allocated Memory
uint32_t t_CurrentlyAllocated() { return t_TotalAllocated - t_TotalFreed; }
};
/// @brief Get Total Allocated Memory
/// @return Total Allocated Memory
size_t GetTotalAllocated();
/// @brief Get Total Deleted Memory
/// @return Total Deleted Memory
size_t GetTotalFreed();
/// @brief Get Current Allocated Memory
/// @return Current Allocated Memory
size_t GetCurrent();
} // namespace Memory
} // namespace RenderD7

View File

@ -0,0 +1,24 @@
#pragma once
#include <string>
namespace RenderD7 {
struct Message {
Message(std::string t, std::string m) {
title = t;
message = m;
animationframe = 0;
}
std::string title;
std::string message;
int animationframe;
};
void ProcessMessages();
void PushMessage(const Message& msg);
// Config
void SetMessageIdleStartFrame(int frame);
void SetMessageTotalAnimationFrames(int total_frames);
void SetMessageFadeOutStartFrame(int frame);
}

View File

@ -0,0 +1,74 @@
#pragma once
#include <renderd7/Ovl.hpp>
#include <string>
namespace RenderD7 {
class Ovl_Ftrace : public RenderD7::Ovl {
public:
/// @brief Constructor
Ovl_Ftrace(bool* is_enabled);
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
bool* i_is_enabled;
};
class Ovl_Metrik : public RenderD7::Ovl {
public:
/// @brief Constructor
Ovl_Metrik(bool* is_enabled, bool* screen, uint32_t* mt_color, uint32_t* txt_color, float* txt_size);
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
// Mutable internal values
mutable std::string mt_fps;
mutable std::string mt_cpu;
mutable std::string mt_gpu;
mutable std::string mt_cmd;
mutable std::string mt_lfr;
mutable std::string mt_tbs;
// Importand Adresses
bool* i_is_enabled;
bool* i_screen;
uint32_t* i_mt_color;
uint32_t* i_txt_color;
float* i_txt_size;
};
typedef int RD7Keyboard;
enum RD7Keyboard_ {
RD7Keyboard_Default,
RD7Keyboard_Numpad,
RD7Keyboard_Password,
};
class Ovl_Keyboard : public RenderD7::Ovl {
public:
/// @brief Constructor
/// Keyboard Type not Supported for now
Ovl_Keyboard(std::string& ref, const std::string& hint = "", RD7Keyboard type = 0);
/// @brief Deconstructor
~Ovl_Keyboard();
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
mutable std::map<unsigned char, char> shared_data;
// Pointer to useres String
std::string *typed_text = nullptr;
std::string str_bak;
int mode = 0;
int ft3 = 0;
};
} // namespace RenderD7

27
include/renderd7/Ovl.hpp Normal file
View File

@ -0,0 +1,27 @@
#pragma once
#include <memory>
namespace RenderD7 {
/// @brief The Overlay Class (Used for Toasts for example)
class Ovl {
public:
/// @brief Deconstructor
virtual ~Ovl() {}
/// @brief Function Called to Draw this
virtual void Draw() const = 0;
/// @brief Logic of the Overlay
virtual void Logic() = 0;
/// @brief Should the overlay be killed
/// @return Killed or Not
inline bool IsKilled() { return this->iskilled; }
/// @brief Kill The Overlay
inline void Kill() { iskilled = true; }
private:
/// @param iskilled For IsKilled();
bool iskilled = false;
};
/// @brief Add an Overlay to the Screen
/// @param scene Overlay to push to Screen
void AddOvl(std::unique_ptr<RenderD7::Ovl> scene);
} // namespace RenderD7

View File

@ -0,0 +1,42 @@
#pragma once
struct R7Vec2 {
// Init Funcs
R7Vec2() : x(0), y(0) {}
R7Vec2(float i0, float i1) : x(i0), y(i1) {}
R7Vec2(const R7Vec2 &i) {
x = i.x;
y = i.y;
}
// Operators
// Add
R7Vec2 &operator+=(const R7Vec2 &i) {
x += i.x;
y += i.y;
return *this;
}
R7Vec2 operator+(const R7Vec2 &i) const { return R7Vec2(x + i.x, y + i.y); }
// Sub
R7Vec2 &operator-=(const R7Vec2 &i) {
x -= i.x;
y -= i.y;
return *this;
}
R7Vec2 operator-(const R7Vec2 &i) const { return R7Vec2(x - i.x, y - i.y); }
// Compare
bool operator==(const R7Vec2 &in) const { return x == in.x && y == in.y; }
bool operator!=(const R7Vec2 &in) const {
// use the first comparefuncs result
// and swap it lol
return !(*this == in);
}
// Internal Values
float x;
float y;
};

View File

@ -0,0 +1,53 @@
#pragma once
#include <3ds.h>
#include <string>
namespace RenderD7 {
/// @brief Decoder for 3ds Result Codes
class ResultDecoder {
public:
/// @brief Constructor
ResultDecoder() {}
/// @brief Deconstructor
~ResultDecoder() {}
/// @brief Load a Result into Decoder
/// @param rescode Result Code
void Load(Result rescode);
/// @brief Load A Hex Converted Code into Decoder
/// @param rescode Result-Hex Code
void Load(std::string rescode);
/// @brief Get Hex Code
/// @return Hex-Code
std::string GetCode();
/// @brief Get Level Name
/// @return Level Name
std::string GetLevel();
/// @brief Get Level Value
/// @return Level Value
int GetLevelInt();
/// @brief Get The Mosule Name
/// @return Module Name
std::string GetModule();
/// @brief Get The Module Value
/// @return Module Value
int GetModuleInt();
/// @brief Get The Description
/// @return Description
std::string GetDescription();
/// @brief Get The Description Valur
/// @return Description Value
int GetDescriptionInt();
/// @brief Get the Summary
/// @return Summary
std::string GetSummary();
/// @brief Get the Summary Value
/// @return Summary Value
int GetSummaryInt();
/// @brief Write a Result log file to sd
void WriteLog(void);
private:
/// @param m_rescode Result code
Result m_rescode;
};
} // namespace RenderD7

View File

@ -0,0 +1,16 @@
#pragma once
#include <citro2d.h>
#include <citro3d.h>
/// \param Top Tob-Screen Target
extern C3D_RenderTarget *Top;
/// \param TopRight Top-Right-Screen Target (Never atually used)
extern C3D_RenderTarget *TopRight;
/// \param Bottom Bottom-Screen Target
extern C3D_RenderTarget *Bottom;
namespace RenderD7 {
/// @brief Begin Drawing On Specific Screen
/// @param target The Screen Target (Top, Bottom or TopTight)
void OnScreen(C3D_RenderTarget *target);
} // namespace RenderD7

View File

@ -0,0 +1,60 @@
#pragma once
#include <cstdint>
#include <functional>
#include <string>
#include <vector>
#include <3ds.h>
namespace RenderD7 {
namespace Init {
void Security();
}
class Security {
public:
/// @brief Security Levels
enum Level {
NONE, ///< Do Completly Nothing (excludes FrameEnd Security)
FULL, ///< Display Every Reports even Success
ERRORS, ///< Display Only Errors
WARNINGS, ///< Display Errors and Warnings
LOG, ///< Log Every Error with Detailed Information
};
Security();
~Security();
/// @brief Report an Output (For SafeTraceInit)
/// @param addr Adress of Pointer
/// @param result_ptr Pointer to the result
void Report(uint32_t addr, void *result_ptr);
/// @brief Set the Security Level
/// @param level Level to use
void SetLevel(Level level);
/// @brief Get Current Security Level
/// @return Security Level
Level GetLevel();
/// @brief Call a Function at Program Crash/Exit
/// @param exit_func Function to Call
void SafeExit(void (*exit_func)());
/// @brief SaveInit a Function and define a Exit Func
/// @param init_func Init Function
/// @param exit_func Exit Function
void SafeInit(void (*init_func)(), void (*exit_func)());
/// @brief SaveInit a Function and define a Exit Func
/// @param init_func Init Function
/// @param exit_func Exit Function
void SafeInit(Result (*init_func)(), void (*exit_func)());
/// @brief SaveInit a Function and define a Exit Func
/// @param init_func Init Function
/// @param exit_func Exit Function
void SafeInit(void (*init_func)(), Result (*exit_func)());
/// @brief SaveInit a Function and define a Exit Func
/// @param init_func Init Function
/// @param exit_func Exit Function
void SafeInit(Result (*init_func)(), Result (*exit_func)());
};
} // namespace RenderD7
/// @brief RenderD7 Security Object
extern RenderD7::Security *rd7_security;

View File

@ -0,0 +1,24 @@
#pragma once
#include <citro2d.h>
#include <citro3d.h>
#include <3ds.h> // Result
#include <string>
namespace RenderD7 {
/// @brief SpriteSheet Class
class Sheet {
public:
/// @brief Constructor
Sheet();
/// @brief Deconstructor
~Sheet();
/// @brief Load A Spritesheet File
/// @param path Path to the t3x
/// @return Result Code
Result Load(const std::string& path);
/// @brief Unload the Sheet
void Free();
/// \param spritesheet The Sheet
C2D_SpriteSheet spritesheet;
};
} // namespace RenderD7

View File

@ -0,0 +1,64 @@
#pragma once
#include <citro2d.h>
#include <citro3d.h>
#include <renderd7/Image.hpp>
#include <renderd7/Sheet.hpp>
namespace RenderD7 {
/// @brief Sprite Class
class Sprite {
public:
/// \brief Construct Sprite
Sprite();
/// \brief Deconstruct Sprite
~Sprite();
/// \brief Load a Sprite From SpriteSheet
/// \param sheet the Sheet to load from.(RenderD7::Sheet)
/// \param index the number of the Sprite in the Sheet
void FromSheet(RenderD7::Sheet *sheet, size_t index);
/// \brief Load a Sprite From SpriteSheet
/// \param img the Image to load from.(RenderD7::Image)
void FromImage(RenderD7::Image *img);
/// @brief Draw the Sprite
/// @return success ?
bool Draw();
/// @brief Set the Center Position
/// @param x X Pos
/// @param y Y Pos
void SetCenter(float x, float y);
/// @brief Set the Sprite's Position
/// @param x X Pos
/// @param y Y Pos
void SetPos(float x, float y);
/// @brief Set The Sprite's Scale
/// @param x Scale on X-Axis
/// @param y Scale on Y-Axis
void SetScale(float x, float y);
/// @brief Set the Sprite's Rotation
/// @param rotation ratation
void SetRotation(float rotation);
/// @brief Rotate the Sprite
/// @param speed Speed to Rotate
void Rotate(float speed);
/// @brief Get Tje Sprite's Width
/// @return Width
float getWidth();
/// @brief Get the Sprite's Height
/// @return Height
float getHeight();
/// @brief Get The Sprite's X Position
/// @return X Position
float getPosX();
/// @brief Get the Sprite's Y Position
/// @return Y Position
float getPosY();
private:
/// @param tint ImageTint (unused)
C2D_ImageTint tint;
/// @param sprite The Sprite
C2D_Sprite sprite;
};
} // namespace RenderD7

View File

@ -0,0 +1,41 @@
#pragma once
#include <renderd7/Sheet.hpp>
#include <renderd7/Sprite.hpp>
#include <citro2d.h>
#include <citro3d.h>
namespace RenderD7 {
/// @brief SpriteSheetAnimation Class
class SpriteSheetAnimation : public RenderD7::Sprite {
public:
/// @brief Constructor
SpriteSheetAnimation();
/// @brief Deconstructor
~SpriteSheetAnimation();
/// @brief Setup an Animation
/// @param sheet Input Spritesheet
/// @param imagecount Count of Images
/// @param startimage Where to Start the Loop
/// @param frame_begin Current Time (Should be 0)
/// @param frame_finish Time Length
void Setup(RenderD7::Sheet *sheet, size_t imagecount, size_t startimage,
float frame_begin, float frame_finish);
/// @brief Play the Animation
/// @param timespeed Speed of the animation
void Play(float timespeed);
private:
/// @param images Count of Images
size_t images;
/// @param imgs Another Count of images ???
size_t imgs = 0;
/// @param D_totaltime Current Time
float D_totaltime;
/// @param sheet The Sheet of Images
RenderD7::Sheet *sheet;
/// @param time Total Time from frame_finish
float time;
};
} // namespace RenderD7

View File

@ -0,0 +1,21 @@
#pragma once
#include <sstream>
#include <string>
namespace RenderD7 {
/// @brief StealConsole Class
class StealConsole {
public:
/// @brief Constructor
StealConsole();
/// @brief Deconstructor
~StealConsole();
/// @brief The Stolen Stdout
/// @return Stdout as string
std::string GetStdout();
private:
/// @param stolen_stdout Stolen Stdout
std::stringstream stolen_stdout;
};
} // namespace RenderD7

View File

@ -0,0 +1,13 @@
#pragma once
#include <3ds.h>
#include <vector>
namespace RenderD7 {
namespace Tasks {
/// @brief Push A Task
/// @param entrypoint Function of Your Task
void create(ThreadFunc entrypoint);
/// @brief Destroy all Tasks
void destroy(void);
} // namespace Tasks
} // namespace RenderD7

13
include/renderd7/Time.hpp Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include <string>
namespace RenderD7 {
/// @brief Format a String
/// @param fmt_str Format To
/// @param ... Additional Args
/// @return Formatted String
std::string FormatString(std::string fmt_str, ...);
/// @brief Get Current Time as String
/// @return Time-String
std::string GetTimeStr(void);
} // namespace RenderD7

View File

@ -0,0 +1,22 @@
#pragma once
#include <3ds.h>
namespace RenderD7 {
class Timer {
public:
Timer(bool autostart = true);
~Timer() {}
void reset();
void tick();
void pause();
void resume();
float get();
float get_live();
bool running();
private:
uint64_t last = 0;
uint64_t current = 0;
bool is_running = false;
};
}

49
include/renderd7/UI7.hpp Normal file
View File

@ -0,0 +1,49 @@
#pragma once
#include <algorithm>
#include <renderd7/R7Vec.hpp>
#include <renderd7/DrawV2.hpp>
#include <string>
#include <vector>
// UI7: The new RenderD7 UI Standart based on
// Draw2 (based on Citro2D)
#define UI7MAKEFLAG(x) (1 << x)
typedef int UI7MenuFlags;
enum UI7MenuFlags_ {
UI7MenuFlags_None = 0,
UI7MenuFlags_NoTitlebar = UI7MAKEFLAG(0),
UI7MenuFlags_TitleMid = UI7MAKEFLAG(1),
};
namespace UI7 {
// Key functions
void Init();
void Deinit();
void Update();
float GetTime();
float GetDeltaTime();
bool Button(const std::string &label, R7Vec2 size = R7Vec2(0, 0));
void Checkbox(const std::string &label, bool &c);
void Label(const std::string &label, RD7TextFlags flags = 0);
void Progressbar(float value);
/// @brief Draw Image in Menu
/// @param img Pointer f.e to RenderD7::Image2
void Image(RenderD7::Image* img);
void BrowserList(const std::vector<std::string> &entrys, int &selection, RD7TextFlags txtflags = 0,
R7Vec2 size = R7Vec2(0, 0), int max_entrys = 13);
void InputText(const std::string &label, std::string &text,
const std::string &hint = "");
bool BeginMenu(const std::string &title, R7Vec2 size = R7Vec2(0, 0),
UI7MenuFlags flags = 0);
void EndMenu();
void Grid(const std::string& name, const R7Vec2 &size, R7Vec2(*display_func)(void*, R7Vec2), void**data_array, size_t num_entrys);
R7Vec2 GetCursorPos();
void SetCursorPos(R7Vec2 cp);
void RestoreCursor();
void SameLine();
} // namespace UI7

12532
include/renderd7/external/dr_flac.h vendored Normal file

File diff suppressed because it is too large Load Diff

8668
include/renderd7/external/dr_wav.h vendored Normal file

File diff suppressed because it is too large Load Diff

25447
include/renderd7/external/json.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

2114
include/renderd7/external/lodepng.h vendored Normal file

File diff suppressed because it is too large Load Diff

8681
include/renderd7/external/stb_image.h vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5636
include/renderd7/external/stb_truetype.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
#pragma once
#include <renderd7/renderd7.hpp>
#include <renderd7/external/json.hpp>
// Outdated HidApi (HidV2Patched)
extern u32 d7_hDown;
extern u32 d7_hHeld;
extern u32 d7_hUp;
extern u32 d7_hRepeat; // Inofficial lol
extern touchPosition d7_touch;
// Outdated Screens
extern C3D_RenderTarget *Top;
extern C3D_RenderTarget *TopRight;
extern C3D_RenderTarget *Bottom;
// Modern Global Api
extern int rd7_max_objects;
extern bool rd7_do_splash;
extern bool rd7_enable_scene_system;
extern bool rd7_debugging;
extern C3D_RenderTarget *rd7_top;
extern C3D_RenderTarget *rd7_top_right;
extern C3D_RenderTarget *rd7_bottom;
// Draw2
extern float rd7_draw2_tsm;

545
include/renderd7/ini.hpp Normal file
View File

@ -0,0 +1,545 @@
#ifndef INI_INI_H_
#define INI_INI_H_
#include <algorithm>
#include <cctype>
#include <fstream>
#include <memory>
#include <sstream>
#include <string>
#include <sys/stat.h>
#include <unordered_map>
#include <utility>
#include <vector>
namespace INI {
namespace INIStringUtil {
const char *const whitespaceDelimiters = " \t\n\r\f\v";
inline void trim(std::string &str) {
str.erase(str.find_last_not_of(whitespaceDelimiters) + 1);
str.erase(0, str.find_first_not_of(whitespaceDelimiters));
}
#ifndef INI_CASE_SENSITIVE
inline void toLower(std::string &str) {
std::transform(str.begin(), str.end(), str.begin(), [](const char c) {
return static_cast<const char>(std::tolower(c));
});
}
#endif
inline void replace(std::string &str, std::string const &a,
std::string const &b) {
if (!a.empty()) {
std::size_t pos = 0;
while ((pos = str.find(a, pos)) != std::string::npos) {
str.replace(pos, a.size(), b);
pos += b.size();
}
}
}
#ifdef _WIN32
const char *const endl = "\r\n";
#else
const char *const endl = "\n";
#endif
}; // namespace INIStringUtil
template <typename T> class INIMap {
private:
using T_DataIndexMap = std::unordered_map<std::string, std::size_t>;
using T_DataItem = std::pair<std::string, T>;
using T_DataContainer = std::vector<T_DataItem>;
using T_MultiArgs = typename std::vector<std::pair<std::string, T>>;
T_DataIndexMap dataIndexMap;
T_DataContainer data;
inline std::size_t setEmpty(std::string &key) {
std::size_t index = data.size();
dataIndexMap[key] = index;
data.emplace_back(key, T());
return index;
}
public:
using const_iterator = typename T_DataContainer::const_iterator;
INIMap() {}
INIMap(INIMap const &other) {
std::size_t data_size = other.data.size();
for (std::size_t i = 0; i < data_size; ++i) {
auto const &key = other.data[i].first;
auto const &obj = other.data[i].second;
data.emplace_back(key, obj);
}
dataIndexMap = T_DataIndexMap(other.dataIndexMap);
}
T &operator[](std::string key) {
INIStringUtil::trim(key);
#ifndef INI_CASE_SENSITIVE
INIStringUtil::toLower(key);
#endif
auto it = dataIndexMap.find(key);
bool hasIt = (it != dataIndexMap.end());
std::size_t index = (hasIt) ? it->second : setEmpty(key);
return data[index].second;
}
T get(std::string key) const {
INIStringUtil::trim(key);
#ifndef INI_CASE_SENSITIVE
INIStringUtil::toLower(key);
#endif
auto it = dataIndexMap.find(key);
if (it == dataIndexMap.end()) {
return T();
}
return T(data[it->second].second);
}
bool has(std::string key) const {
INIStringUtil::trim(key);
#ifndef INI_CASE_SENSITIVE
INIStringUtil::toLower(key);
#endif
return (dataIndexMap.count(key) == 1);
}
void set(std::string key, T obj) {
INIStringUtil::trim(key);
#ifndef INI_CASE_SENSITIVE
INIStringUtil::toLower(key);
#endif
auto it = dataIndexMap.find(key);
if (it != dataIndexMap.end()) {
data[it->second].second = obj;
} else {
dataIndexMap[key] = data.size();
data.emplace_back(key, obj);
}
}
void set(T_MultiArgs const &multiArgs) {
for (auto const &it : multiArgs) {
auto const &key = it.first;
auto const &obj = it.second;
set(key, obj);
}
}
bool remove(std::string key) {
INIStringUtil::trim(key);
#ifndef INI_CASE_SENSITIVE
INIStringUtil::toLower(key);
#endif
auto it = dataIndexMap.find(key);
if (it != dataIndexMap.end()) {
std::size_t index = it->second;
data.erase(data.begin() + index);
dataIndexMap.erase(it);
for (auto &it2 : dataIndexMap) {
auto &vi = it2.second;
if (vi > index) {
vi--;
}
}
return true;
}
return false;
}
void clear() {
data.clear();
dataIndexMap.clear();
}
std::size_t size() const { return data.size(); }
const_iterator begin() const { return data.begin(); }
const_iterator end() const { return data.end(); }
};
using INIStructure = INIMap<INIMap<std::string>>;
namespace INIParser {
using T_ParseValues = std::pair<std::string, std::string>;
enum class PDataType : char {
PDATA_NONE,
PDATA_COMMENT,
PDATA_SECTION,
PDATA_KEYVALUE,
PDATA_UNKNOWN
};
inline PDataType parseLine(std::string line, T_ParseValues &parseData) {
parseData.first.clear();
parseData.second.clear();
INIStringUtil::trim(line);
if (line.empty()) {
return PDataType::PDATA_NONE;
}
char firstCharacter = line[0];
if (firstCharacter == ';') {
return PDataType::PDATA_COMMENT;
}
if (firstCharacter == '[') {
auto commentAt = line.find_first_of(';');
if (commentAt != std::string::npos) {
line = line.substr(0, commentAt);
}
auto closingBracketAt = line.find_last_of(']');
if (closingBracketAt != std::string::npos) {
auto section = line.substr(1, closingBracketAt - 1);
INIStringUtil::trim(section);
parseData.first = section;
return PDataType::PDATA_SECTION;
}
}
auto lineNorm = line;
INIStringUtil::replace(lineNorm, "\\=", " ");
auto equalsAt = lineNorm.find_first_of('=');
if (equalsAt != std::string::npos) {
auto key = line.substr(0, equalsAt);
INIStringUtil::trim(key);
INIStringUtil::replace(key, "\\=", "=");
auto value = line.substr(equalsAt + 1);
INIStringUtil::trim(value);
parseData.first = key;
parseData.second = value;
return PDataType::PDATA_KEYVALUE;
}
return PDataType::PDATA_UNKNOWN;
}
}; // namespace INIParser
class INIReader {
public:
using T_LineData = std::vector<std::string>;
using T_LineDataPtr = std::shared_ptr<T_LineData>;
private:
std::ifstream fileReadStream;
T_LineDataPtr lineData;
T_LineData readFile() {
std::string fileContents;
fileReadStream.seekg(0, std::ios::end);
fileContents.resize(fileReadStream.tellg());
fileReadStream.seekg(0, std::ios::beg);
std::size_t fileSize = fileContents.size();
fileReadStream.read(&fileContents[0], fileSize);
fileReadStream.close();
T_LineData output;
if (fileSize == 0) {
return output;
}
std::string buffer;
buffer.reserve(50);
for (std::size_t i = 0; i < fileSize; ++i) {
char &c = fileContents[i];
if (c == '\n') {
output.emplace_back(buffer);
buffer.clear();
continue;
}
if (c != '\0' && c != '\r') {
buffer += c;
}
}
output.emplace_back(buffer);
return output;
}
public:
INIReader(std::string const &filename, bool keepLineData = false) {
fileReadStream.open(filename, std::ios::in | std::ios::binary);
if (keepLineData) {
lineData = std::make_shared<T_LineData>();
}
}
~INIReader() {}
bool operator>>(INIStructure &data) {
if (!fileReadStream.is_open()) {
return false;
}
T_LineData fileLines = readFile();
std::string section;
bool inSection = false;
INIParser::T_ParseValues parseData;
for (auto const &line : fileLines) {
auto parseResult = INIParser::parseLine(line, parseData);
if (parseResult == INIParser::PDataType::PDATA_SECTION) {
inSection = true;
data[section = parseData.first];
} else if (inSection &&
parseResult == INIParser::PDataType::PDATA_KEYVALUE) {
auto const &key = parseData.first;
auto const &value = parseData.second;
data[section][key] = value;
}
if (lineData && parseResult != INIParser::PDataType::PDATA_UNKNOWN) {
if (parseResult == INIParser::PDataType::PDATA_KEYVALUE && !inSection) {
continue;
}
lineData->emplace_back(line);
}
}
return true;
}
T_LineDataPtr getLines() { return lineData; }
};
class INIGenerator {
private:
std::ofstream fileWriteStream;
public:
bool prettyPrint = false;
INIGenerator(std::string const &filename) {
fileWriteStream.open(filename, std::ios::out | std::ios::binary);
}
~INIGenerator() {}
bool operator<<(INIStructure const &data) {
if (!fileWriteStream.is_open()) {
return false;
}
if (!data.size()) {
return true;
}
auto it = data.begin();
for (;;) {
auto const &section = it->first;
auto const &collection = it->second;
fileWriteStream << "[" << section << "]";
if (collection.size()) {
fileWriteStream << INIStringUtil::endl;
auto it2 = collection.begin();
for (;;) {
auto key = it2->first;
INIStringUtil::replace(key, "=", "\\=");
auto value = it2->second;
INIStringUtil::trim(value);
fileWriteStream << key << ((prettyPrint) ? " = " : "=") << value;
if (++it2 == collection.end()) {
break;
}
fileWriteStream << INIStringUtil::endl;
}
}
if (++it == data.end()) {
break;
}
fileWriteStream << INIStringUtil::endl;
if (prettyPrint) {
fileWriteStream << INIStringUtil::endl;
}
}
return true;
}
};
class INIWriter {
private:
using T_LineData = std::vector<std::string>;
using T_LineDataPtr = std::shared_ptr<T_LineData>;
std::string filename;
T_LineData getLazyOutput(T_LineDataPtr const &lineData, INIStructure &data,
INIStructure &original) {
T_LineData output;
INIParser::T_ParseValues parseData;
std::string sectionCurrent;
bool parsingSection = false;
bool continueToNextSection = false;
bool discardNextEmpty = false;
bool writeNewKeys = false;
std::size_t lastKeyLine = 0;
for (auto line = lineData->begin(); line != lineData->end(); ++line) {
if (!writeNewKeys) {
auto parseResult = INIParser::parseLine(*line, parseData);
if (parseResult == INIParser::PDataType::PDATA_SECTION) {
if (parsingSection) {
writeNewKeys = true;
parsingSection = false;
--line;
continue;
}
sectionCurrent = parseData.first;
if (data.has(sectionCurrent)) {
parsingSection = true;
continueToNextSection = false;
discardNextEmpty = false;
output.emplace_back(*line);
lastKeyLine = output.size();
} else {
continueToNextSection = true;
discardNextEmpty = true;
continue;
}
} else if (parseResult == INIParser::PDataType::PDATA_KEYVALUE) {
if (continueToNextSection) {
continue;
}
if (data.has(sectionCurrent)) {
auto &collection = data[sectionCurrent];
auto const &key = parseData.first;
auto const &value = parseData.second;
if (collection.has(key)) {
auto outputValue = collection[key];
if (value == outputValue) {
output.emplace_back(*line);
} else {
INIStringUtil::trim(outputValue);
auto lineNorm = *line;
INIStringUtil::replace(lineNorm, "\\=", " ");
auto equalsAt = lineNorm.find_first_of('=');
auto valueAt = lineNorm.find_first_not_of(
INIStringUtil::whitespaceDelimiters, equalsAt + 1);
std::string outputLine = line->substr(0, valueAt);
if (prettyPrint && equalsAt + 1 == valueAt) {
outputLine += " ";
}
outputLine += outputValue;
output.emplace_back(outputLine);
}
lastKeyLine = output.size();
}
}
} else {
if (discardNextEmpty && line->empty()) {
discardNextEmpty = false;
} else if (parseResult != INIParser::PDataType::PDATA_UNKNOWN) {
output.emplace_back(*line);
}
}
}
if (writeNewKeys || std::next(line) == lineData->end()) {
T_LineData linesToAdd;
if (data.has(sectionCurrent) && original.has(sectionCurrent)) {
auto const &collection = data[sectionCurrent];
auto const &collectionOriginal = original[sectionCurrent];
for (auto const &it : collection) {
auto key = it.first;
if (collectionOriginal.has(key)) {
continue;
}
auto value = it.second;
INIStringUtil::replace(key, "=", "\\=");
INIStringUtil::trim(value);
linesToAdd.emplace_back(key + ((prettyPrint) ? " = " : "=") +
value);
}
}
if (!linesToAdd.empty()) {
output.insert(output.begin() + lastKeyLine, linesToAdd.begin(),
linesToAdd.end());
}
if (writeNewKeys) {
writeNewKeys = false;
--line;
}
}
}
for (auto const &it : data) {
auto const &section = it.first;
if (original.has(section)) {
continue;
}
if (prettyPrint && output.size() > 0 && !output.back().empty()) {
output.emplace_back();
}
output.emplace_back("[" + section + "]");
auto const &collection = it.second;
for (auto const &it2 : collection) {
auto key = it2.first;
auto value = it2.second;
INIStringUtil::replace(key, "=", "\\=");
INIStringUtil::trim(value);
output.emplace_back(key + ((prettyPrint) ? " = " : "=") + value);
}
}
return output;
}
public:
bool prettyPrint = false;
INIWriter(std::string const &filename) : filename(filename) {}
~INIWriter() {}
bool operator<<(INIStructure &data) {
struct stat buf;
bool fileExists = (stat(filename.c_str(), &buf) == 0);
if (!fileExists) {
INIGenerator generator(filename);
generator.prettyPrint = prettyPrint;
return generator << data;
}
INIStructure originalData;
T_LineDataPtr lineData;
bool readSuccess = false;
{
INIReader reader(filename, true);
if ((readSuccess = reader >> originalData)) {
lineData = reader.getLines();
}
}
if (!readSuccess) {
return false;
}
T_LineData output = getLazyOutput(lineData, data, originalData);
std::ofstream fileWriteStream(filename, std::ios::out | std::ios::binary);
if (fileWriteStream.is_open()) {
if (output.size()) {
auto line = output.begin();
for (;;) {
fileWriteStream << *line;
if (++line == output.end()) {
break;
}
fileWriteStream << INIStringUtil::endl;
}
}
return true;
}
return false;
}
};
class INIFile {
private:
std::string filename;
public:
INIFile(std::string const &filename) : filename(filename) {}
~INIFile() {}
bool read(INIStructure &data) const {
if (data.size()) {
data.clear();
}
if (filename.empty()) {
return false;
}
INIReader reader(filename);
return reader >> data;
}
bool generate(INIStructure const &data, bool pretty = false) const {
if (filename.empty()) {
return false;
}
INIGenerator generator(filename);
generator.prettyPrint = pretty;
return generator << data;
}
bool write(INIStructure &data, bool pretty = false) const {
if (filename.empty()) {
return false;
}
INIWriter writer(filename);
writer.prettyPrint = pretty;
return writer << data;
}
};
} // namespace INI
#endif

View File

@ -0,0 +1,55 @@
#pragma once
#include <renderd7/renderd7.hpp>
#include <renderd7/external/json.hpp>
#include <renderd7/global_db.hpp>
#define CFGVER "0"
#ifndef V_RD7BTIME
#define V_RD7BTIME "SUBMODULE"
#endif
#ifndef V_RD7CSTRING
#define V_RD7CSTRING "SUBMODULE"
#endif
/// Base ///
extern std::string rd7i_app_name;
extern std::string rd7i_config_path;
extern nlohmann::json rd7i_config;
extern u8 rd7i_console_model;
extern u8 rd7i_system_region;
extern bool rd7i_is_citra;
extern bool rd7i_settings;
extern R7Vec2 rd7i_hid_touch_pos;
extern C2D_TextBuf rd7i_text_buffer;
extern C2D_TextBuf rd7i_d2_dimbuf;
extern C2D_Font rd7i_base_font;
extern bool rd7i_is_ndsp;
extern bool rd7i_running;
extern std::unique_ptr<RenderD7::Scene> rd7i_fade_scene;
extern std::vector<std::unique_ptr<RenderD7::Ovl>> rd7i_overlays;
extern unsigned int rd7i_frames;
extern u64 rd7i_last_time;
extern float rd7i_framerate;
extern u32 rd7i_mt_color;
extern u32 rd7i_mt_txtcolor;
extern bool rd7i_mt_screen;
extern float rd7i_mt_txtSize;
extern bool rd7i_metrikd;
extern bool rd7i_ftraced;
extern bool rd7i_current_screen;
extern u64 rd7i_delta_time;
extern u64 rd7i_last_tm;
extern float rd7i_dtm;
extern float rd7i_time;
extern bool rd7i_fadeout;
extern bool rd7i_fadein;
extern bool rd7i_fadeout2;
extern bool rd7i_fadein2;
extern int rd7i_fadealpha;
extern int rd7i_fadecolor;
extern bool rd7i_wait_fade;
extern bool rd7i_fade_exit;
extern bool rd7i_fade_scene_wait;
extern bool rd7i_idb_running;
extern bool rd7i_graphics_on;

20
include/renderd7/lang.hpp Normal file
View File

@ -0,0 +1,20 @@
#pragma once
// clang-format off
#include <string>
#include <renderd7/external/json.hpp>
// clang-format on
namespace RenderD7 {
namespace Lang {
/// @brief Get 3ds System lang! [en] by default
/// @return Sytemlang as string
std::string getSys();
/// @brief Get The Translation String
/// @param key Key of Translation
/// @return The Translated String
std::string get(const std::string &key);
/// @brief Load A Language json
/// @param lang The Language Key [en], [de], etc, or getSys()
void load(const std::string &lang);
} // namespace Lang
} // namespace RenderD7

33
include/renderd7/log.hpp Normal file
View File

@ -0,0 +1,33 @@
#pragma once
#include <fstream>
#include <stdarg.h>
#include <string>
#include <time.h>
#include <unistd.h>
/// @brief Log Class
class Log {
public:
/// @brief Constructor
Log();
/// @brief Deconstructor
~Log();
/// @brief Init the Logger
/// @param filename Filename[_data_time.log]
void Init(const char *filename);
/// @brief Write a String to the File
/// @param debug_text string
void Write(std::string debug_text);
/// @brief Get the Date
/// @return Date as string fmt[data_time]
std::string logDate(void);
/// @brief Format a string like sprintf
/// @param fmt_str the string wich defines the fmt
/// @param ... Additional Data
/// @return Formatted String
std::string format(const std::string &fmt_str, ...);
private:
/// \param filename the name of the logfile
std::string filename;
};

View File

@ -0,0 +1,28 @@
#pragma once
#include <renderd7/music/Music.hpp>
#include <fstream>
#include <mpg123.h>
namespace RenderD7 {
class Mp3Decoder : public MusicDecoder {
public:
Mp3Decoder() {}
~Mp3Decoder() {}
int _init(const std::string& path, MusicMeta& meta) override;
unsigned int _getSampleRate() override;
unsigned char _getChannels() override;
size_t _getBufSize() override;
unsigned long long _decode(signed short* buf_addr) override;
void _deinit() override;
size_t _getFileSamples() override;
private:
mpg123_handle *hnd = nullptr;
size_t buf_size = 0;
long rate = 0;
int channels = 0;
};
}

View File

@ -0,0 +1,90 @@
// RenderD7 Music Backend
#pragma once
#include <string>
namespace RenderD7 {
class MusicMeta {
public:
MusicMeta() {
ititle = "Unknown";
ialbum = "Unknown";
iyear = "Unknown";
iname = "Unknown";
ipath = "Unknown";
iartist = "Unknown";
imdt = "Unknown";
}
~MusicMeta() {}
std::string name() { return iname; }
std::string album() { return ialbum; }
std::string year() { return iyear; }
std::string title() { return ititle; }
std::string path() { return ipath; }
std::string artist() { return iartist; }
std::string mdt() { return imdt; }
void name(std::string name) { iname = name; }
void album(std::string album) { ialbum = album; }
void year(std::string year) { iyear = year; }
void title(std::string title) { ititle = title; }
void path(std::string path) { ipath = path; }
void artist(std::string artist) { iartist = artist; }
void mdt(std::string mdt) { imdt = mdt; }
private:
std::string ititle = "";
std::string ialbum = "";
std::string iyear = "";
std::string iname = "";
std::string ipath = "";
std::string iartist = "";
std::string imdt = "";
};
// Template Class for Decoders
class MusicDecoder {
public:
MusicDecoder() = default;
virtual ~MusicDecoder() {}
static void LoadFile(const std::string &path);
static void CleanUp();
static int init(const std::string &path, MusicMeta &meta) {
return decoder->_init(path, meta);
}
static unsigned int getSampleRate() { return decoder->_getSampleRate(); }
static unsigned char getChannels() { return decoder->_getChannels(); }
static size_t getBufSize() { return decoder->_getBufSize(); }
static unsigned long long decode(signed short *buf_addr) {
return decoder->_decode(buf_addr);
}
static void deinit() { decoder->_deinit(); }
static size_t getFileSamples() { return decoder->_getFileSamples(); }
static MusicDecoder *decoder;
protected:
virtual int _init(const std::string &path, MusicMeta &meta) = 0;
virtual unsigned int _getSampleRate() = 0;
virtual unsigned char _getChannels() = 0;
virtual size_t _getBufSize() = 0;
virtual unsigned long long _decode(signed short *buf_addr) = 0;
virtual void _deinit() = 0;
virtual size_t _getFileSamples() = 0;
};
namespace MusicPlayer {
void PlayFile(const std::string &path);
void Play();
void Pause();
void Stop();
bool IsPlaying();
bool IsRunning();
int PosCurrent();
int Total();
int SampleRate();
MusicMeta GetMeta();
} // namespace MusicPlayer
} // namespace RenderD7

View File

@ -0,0 +1,29 @@
#pragma once
#include <renderd7/music/Music.hpp>
#include <fstream>
#include <tremor/ivorbiscodec.h>
#include <tremor/ivorbisfile.h>
namespace RenderD7 {
class VorbisDecoder : public MusicDecoder {
public:
VorbisDecoder() {}
~VorbisDecoder() {}
int _init(const std::string& path, MusicMeta& meta) override;
unsigned int _getSampleRate() override;
unsigned char _getChannels() override;
size_t _getBufSize() override;
unsigned long long _decode(signed short* buf_addr) override;
void _deinit() override;
size_t _getFileSamples() override;
private:
OggVorbis_File vorbis_file;
vorbis_info *vi;
FILE* f; // Only used cause required by lib
const size_t buf_size = 8 * 4096;
};
}

47
include/renderd7/nimg.hpp Normal file
View File

@ -0,0 +1,47 @@
#pragma once
#include <vector>
#include <cstdint>
#include <iostream>
#define NPI_NIMG_ (uint32_t)0x4e494d47 // Magic: NIMG
/**
* NIMG Format Value Description
* int format
* 0 = rgba32
* 1 = rgb24 (3x8bit)
*/
/**
* NIMG Compression Value Description
* int compression
* 0 = no compression
* 1 = npi_simple_compress (RLE Style)
*/
namespace RenderD7
{
struct nimg
{
unsigned int magic; // Magic number defaults do NPI_NIMG_
int width;
int height;
int format;
int compression;
std::vector<unsigned char> pixel_buffer;
nimg(int w = 0, int h = 0, int fmt = 0, int cmp = 0)
{
magic = NPI_NIMG_;
width = w;
height = h;
format = fmt;
compression = cmp;
pixel_buffer.resize((w*h)*(format ? 3 : 4));
}
};
nimg NIMG_Load(std::string path);
nimg NIMG_LoadFromMem(unsigned char* buffer, size_t bf_size);
void NIMG_Save(nimg image, std::string path);
}

View File

@ -0,0 +1,26 @@
#pragma once
#include <renderd7/nimg.hpp>
namespace RenderD7
{
class NIMG_Engine
{
public:
NIMG_Engine(int w, int h);
NIMG_Engine();
~NIMG_Engine();
nimg& GetImage() { return image; }
void load_file(const std::string& path);
void load_nimg(const std::string& path);
// Rendering
void draw_pixel(int x, int y, unsigned int color);
void draw_rect(int x, int y, int w, int h, unsigned int color, int t = 1);
void draw_rect_solid(int x, int y, int w, int h, unsigned int color);
void flip(bool h, bool v);
private:
nimg image;
};
}

View File

@ -0,0 +1,118 @@
#pragma once
#include <tuple>
namespace RenderD7 {
class Parameter {
private:
using id = size_t;
template <typename T> struct type {
static void id() {}
};
template <typename T> static id type_id() {
return reinterpret_cast<id>(&type<T>::id);
}
template <typename T> using decay = typename std::decay<T>::type;
template <typename T>
using none =
typename std::enable_if<!std::is_same<Parameter, T>::value>::type;
struct base {
virtual ~base() {}
virtual bool is(id) const = 0;
virtual base *copy() const = 0;
} *p = nullptr;
template <typename T> struct data : base, std::tuple<T> {
using std::tuple<T>::tuple;
T &get() & { return std::get<0>(*this); }
T const &get() const & { return std::get<0>(*this); }
bool is(id i) const override { return i == type_id<T>(); }
base *copy() const override { return new data{get()}; }
};
template <typename T> T &stat() { return static_cast<data<T> &>(*p).get(); }
template <typename T> T const &stat() const {
return static_cast<data<T> const &>(*p).get();
}
template <typename T> T &dyn() { return dynamic_cast<data<T> &>(*p).get(); }
template <typename T> T const &dyn() const {
return dynamic_cast<data<T> const &>(*p).get();
}
public:
/**
* @brief Default constructor
*/
Parameter() {}
/**
* @brief Destructs the Parameter
*/
~Parameter() { delete p; }
/**
* @brief Copy constructor
* @param s The Parameter to copy
*/
Parameter(Parameter &&s) : p{s.p} { s.p = nullptr; }
/**
* @brief Const copy constructor
* @param s The Parameter to copy
*/
Parameter(Parameter const &s) : p{s.p->copy()} {}
/**
* @brief Initializes the Parameter with the given value
* @param x The value to initialize the Parameter with
*/
template <typename T, typename U = decay<T>, typename = none<U>>
Parameter(T &&x) : p{new data<U>{std::forward<T>(x)}} {}
/**
* @brief Overloads the assignment operator
* @param s The value to set the Parameter to
*/
Parameter &operator=(Parameter s) {
swap(*this, s);
return *this;
}
friend void swap(Parameter &s, Parameter &r) { std::swap(s.p, r.p); }
/**
* @brief Clears the Parameter
*/
void clear() {
delete p;
p = nullptr;
}
/**
* @brief Checks whether the Parameter is the given type
* @tparam T The type to check
* @return Whether the Parameter has the given type or not
*/
template <typename T> bool is() const {
return p ? p->is(type_id<T>()) : false;
}
/**
* @brief Returns the value of the Parameter
* @tparam T The type of the Parameter
* @return The value of the Parameter
* @warning If the type of the Parameter doesn't match the type of it's stored
* value, it will result in undefined behaviour.
*/
template <typename T> T &get() & { return stat<T>(); }
};
} // namespace RenderD7

View File

@ -0,0 +1,243 @@
#pragma once
/// c++ Includes
#include <algorithm>
#include <codecvt>
#include <cstring>
#include <filesystem>
#include <functional>
#include <iostream>
#include <locale>
#include <map>
#include <memory>
#include <random>
#include <stack>
#include <string>
#include <vector>
/// c includes
#include <dirent.h>
#include <stdio.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
/// 3ds Includes
#include <3ds.h>
#include <citro2d.h>
#include <citro3d.h>
/// RenderD7 Includes
#include <renderd7/Color.hpp>
#include <renderd7/FunctionTrace.hpp>
#include <renderd7/Hardware.hpp>
#include <renderd7/Memory.hpp>
#include <renderd7/Ovl.hpp>
#include <renderd7/ResultDecoder.hpp>
#include <renderd7/Screen.hpp>
#include <renderd7/Security.hpp>
#include <renderd7/Sheet.hpp>
#include <renderd7/Sprite.hpp>
#include <renderd7/SpriteAnimation.hpp>
#include <renderd7/Tasks.hpp>
#include <renderd7/Time.hpp>
#include <renderd7/external/lodepng.h>
#include <renderd7/ini.hpp>
#include <renderd7/lang.hpp>
#include <renderd7/parameter.hpp>
#include <renderd7/stringtool.hpp>
#include <renderd7/thread.hpp>
#define RENDERD7VSTRING "0.9.5"
#define DEFAULT_CENTER 0.5f
/// @param rd7_do_splash Config Value To Enable RenderD7 Splash
extern bool rd7_do_splash;
/// @param rd7_enable_memtrack Config Value to Track Mem Allocations
extern bool rd7_enable_memtrack;
/// @param rd7_max_objects Config Param for C2D Mac objects
extern int rd7_max_objects;
/// @param rd7_enable_scene_system Enable/Disable Scene System (for example for your own implementations)
extern bool rd7_enable_scene_system;
/// RenderD7
namespace RenderD7 {
/// @brief Get Deltatime
/// @return Deltatime
float GetDeltaTime();
/// @brief A Button
struct TObject {
int x; ///< Position X
int y; ///< Position Y
int w; ///< Button Width
int h; ///< Button Height
std::string text = ""; ///< Text
float txtsize = 0.7f; ///< Set Text Size
};
/// @brief Scene Class
class Scene {
public:
/// @brief Stack of the Scenes
static std::stack<std::unique_ptr<Scene>> scenes;
/// @brief Deconstructor
virtual ~Scene() {}
virtual void Logic() = 0;
/// @brief Draw Func to Override
virtual void Draw() const = 0;
/// @brief Push a Scene to Stack
/// @param scene Scene to Push
/// @param fade FadeEffect (Not Correctly Implementet yet)
static void Load(std::unique_ptr<Scene> scene, bool fade = false);
/// @brief Go Back a Scene
static void Back();
/// @brief do the Draw (Called in RenderD7::MainLoop())
static void doDraw();
static void doLogic();
};
/// @brief Integrated Setting Menu of RenderD7
class RSettings : public RenderD7::Scene {
private:
/// @brief State (Define for Menus)
enum RState {
RSETTINGS,
RINFO,
RSERVICES,
RMCONFIG,
RFTRACE,
RUI7,
RCREDITS
};
/// @param shared_request Defines requests from Draw to Logic
/// As it is not planned to make Draw non const you'll need
/// A map of data or bool values that are mutable ake
/// editable by const functions
mutable std::map<unsigned int, unsigned int> shared_request;
/// @param m_state Current menu State (Default=MainMenu aka RSETTINGS)
RenderD7::RSettings::RState m_state = RenderD7::RSettings::RState::RSETTINGS;
/// @brief Position in FTrace Menu
int ftrace_index = 0;
/// @param mtovlstate State of Metricks Overlay
std::string mtovlstate = "false";
/// @param mtscreenstate Screen the Overlay is Set to
std::string mtscreenstate = "Top";
std::string kbd_test;
bool statemtold = false;
bool stateftold = false;
public:
/// @brief Constructor
RSettings();
/// @brief Override for Draw
/// @param
void Draw(void) const override;
/// @brief Deconstructor
~RSettings();
void Logic() override;
};
/// @brief Show Up the RenderD7-Settings Menu
void LoadSettings();
/// @brief Get's The Programs Time running
/// @return Time Running
float GetTime();
/// @brief Get Framerate as Number
/// @return FPS
int GetFps();
/// @brief Get A Rendom Int
/// @param b From
/// @param e To
/// @return Random Int
int GetRandomInt(int b, int e);
/// @brief DrawMetrikOvl (YOUR OWN RISK)
void DrawMetrikOvl();
/// @brief Draw Image from RenderD7 Sheet
/// @param sheet Spritesheet
/// @param index Image index Value
/// @param x Pos X
/// @param y Pos Y
/// @param scaleX Scale on X-Axis
/// @param scaleY Scale on Y-Axis
/// @return success ?
bool DrawImageFromSheet(RenderD7::Sheet *sheet, size_t index, float x, float y,
float scaleX = 1.0, float scaleY = 1.0);
/// @brief Fade In
/// @param duration Duration in Frames
void FadeIn();
/// @brief Fade Out
/// @param duration Duration in Frames
void FadeOut();
/// @brief Display Fade Effects
void FadeDisplay();
/// @brief Loads a font
/// @param path path to font (bcfnt)
/// @return link to C2D_Font Object
C2D_Font LoadFont(const std::string& path);
namespace Init {
/// @brief Init Default RenderD7
/// @param app_name Name of Your App
/// @return ResCode
Result Main(std::string app_name = "RD7Game");
/// @brief Init Minimal RenderD7 (For better Hax2.x support)
/// @param app_name Name of Your App
/// @return ResCode
Result Minimal(std::string app_name = "RD7Game");
/// @brief Reload the Graphics Engine
/// @return ResCode
Result Reload();
/// @brief Init Graphics Only (NOT SUPPORTET use Reload)
void Graphics();
/// @brief Init Ndsp for Sounds
void NdspFirm();
} // namespace Init
namespace Convert {
/// @brief Convert a String to Flaot
/// @param inp Input String
/// @return Float
inline float StringtoFloat(std::string inp) { return std::atof(inp.c_str()); }
/// @brief Convert String to Int
/// @param inp Input String
/// @return Int
inline int StringtoInt(std::string inp) { return std::atoi(inp.c_str()); }
/// @brief Convert a Float to Bool
/// @param inp Input Float
/// @return Bool
inline bool FloatToBool(float inp) { return (inp == 1 ? true : false); }
} // namespace Convert
namespace FS {
/// @brief Check if File exists
/// @param path Path to the File
/// @return exists or not
bool FileExist(const std::string &path);
} // namespace FS
/// @brief Check if Ndsp is Init
/// @return is or not
bool IsNdspInit();
/// @brief Get Current Framerate as String
/// @return Framerate String
std::string GetFramerate();
/// @brief MainLoop of RenderD7s
/// @return Is Still Running or not
bool MainLoop();
/// @brief Exit App (brak the MainLoop)
void ExitApp();
/// @brief Clear the Citro2D TextBuffers
/// @param
void ClearTextBufs(void);
/// @brief Draw Overlays And end the Frame. DO NEVER USE C3D_FRAMEEND cause it
/// breaks Overlay crash Security
void FrameEnd();
/// @brief Returns App Working Directory path
/// @return AppDir Path
std::string GetAppDirectory();
} // namespace RenderD7

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstddef>
extern unsigned char renderd7_logo[];
extern size_t renderd7_logo_size;

View File

@ -0,0 +1,30 @@
#pragma once
#include <3ds.h>
#include <string>
/** Sound Class */
class sound {
public:
/// \brief Construct new Soundeffect
/// \param path Path to the .wav file
/// \param channel the channel 1-23
/// \param toloop true:loop the sound, false: don't loop
sound(const std::string &path, int channel = 1, bool toloop = false);
/// @brief Deconstructor
~sound();
/// @brief Play the sound
void play();
/// @brief Stop the sound
void stop();
private:
/// \param dataSize Size of the filedata
u32 dataSize;
/// \param waveBuf For ndsp
ndspWaveBuf waveBuf;
/// \param data Memmory data of the sound
uint8_t *data = NULL;
/// \param chnl Channel of the sound
int chnl;
};

View File

@ -0,0 +1,103 @@
#pragma once
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
namespace RenderD7 {
/// @brief Check if A String ends with
/// @param name Input String
/// @param extensions Extensions to Check for
/// @return Ends with or not
inline bool NameIsEndingWith(const std::string &name,
const std::vector<std::string> &extensions) {
if (name.substr(0, 2) == "._") return false;
if (name.size() == 0) return false;
if (extensions.size() == 0) return true;
for (int i = 0; i < (int)extensions.size(); i++) {
const std::string ext = extensions.at(i);
if (strcasecmp(name.c_str() + name.size() - ext.size(), ext.c_str()) == 0)
return true;
}
return false;
}
/// @brief Format Milliseconds to clean string (Stolen from one of my Mc
/// Plugins)
/// @param t_time Time in ms
/// @return String
inline std::string MsTimeFmt(float t_time, bool dems = false) {
std::ostringstream oss;
if (t_time < 0.001f) {
oss << std::fixed << std::setprecision(2) << t_time * 1000.0f << "ns";
} else if (t_time < 1.0f) {
oss << std::fixed << std::setprecision(2) << t_time << "ms";
} else if (t_time < 60000.0f) {
int seconds = static_cast<int>(t_time / 1000.0f);
float milliseconds = t_time - (seconds * 1000.0f);
if (seconds > 0) {
oss << seconds << "s ";
}
if (!dems)
oss << std::fixed << std::setprecision(2) << milliseconds << "ms";
} else {
int minutes = static_cast<int>(t_time / 60000.0f);
int seconds = static_cast<int>((t_time - (minutes * 60000.0f)) / 1000.0f);
float milliseconds = t_time - (minutes * 60000.0f) - (seconds * 1000.0f);
oss << minutes << "m ";
if (seconds > 0 || milliseconds > 0.0f) {
oss << seconds << "s ";
}
if (milliseconds > 0.0f && !dems) {
oss << std::fixed << std::setprecision(2) << milliseconds << "ms";
}
}
return oss.str();
}
inline std::string FormatBytes(int bytes) {
char out[32];
if (bytes == 1)
snprintf(out, sizeof(out), "%d Byte", bytes);
else if (bytes < 1024)
snprintf(out, sizeof(out), "%d Bytes", bytes);
else if (bytes < 1024 * 1024)
snprintf(out, sizeof(out), "%.1f KB", (float)bytes / 1024);
else if (bytes < 1024 * 1024 * 1024)
snprintf(out, sizeof(out), "%.1f MB", (float)bytes / 1024 / 1024);
else
snprintf(out, sizeof(out), "%.1f GB", (float)bytes / 1024 / 1024 / 1024);
return out;
}
} // namespace RenderD7
template <class T>
T GetFileName(T const &path, T const &delims = "/\\") {
return path.substr(path.find_last_of(delims) + 1);
}
template <class T>
T remove_ext(T const &filename) {
typename T::size_type const p(filename.find_last_of('.'));
return p > 0 && p != T::npos ? filename.substr(0, p) : filename;
}
template <typename T>
std::string Int_To_Hex(T i) {
std::stringstream stream;
stream << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex
<< i;
return stream.str();
}

122
include/renderd7/thread.hpp Normal file
View File

@ -0,0 +1,122 @@
#pragma once
#include <3ds.h>
#include <atomic>
#include <functional>
#include <renderd7/parameter.hpp>
#include <string>
using CTRU_Thread = Thread;
#define THREAD_STACK_SIZE 0x1000
namespace RenderD7 {
class Thread {
public:
/**
* @brief Default constructor
* @note This should only be called when calling m3d::Thread::initialize()
* before calling m3d::Thread::start()
*/
Thread();
/**
* @brief Constructs the thread
* @param t_function The thread function
* @param t_parameter The parameter to pass to the function
* @param t_autostart Whether the thread should start instantly
* @param t_detached Whether the thread starts detached or not
* @param t_stackSize The stacksize allocated for the thread in bytes (rounded
* to multiples of 8 bytes)
* @note t_function needs to be of type `void` and take one (and only one)
* parameter of type m3d::Parameter
* @warning If the thread priority is lower than the priority of the calling
* thread, the thread will never get executed. Use
* m3d::Thread::getCurrentPriority() to get the priority of the current thread
*/
Thread(std::function<void(RenderD7::Parameter)> t_function,
RenderD7::Parameter t_parameter = nullptr, bool t_autostart = false,
bool t_detached = false,
unsigned long long int t_stackSize = 4 * 1024);
/**
* @brief Destructs the thread
*/
virtual ~Thread();
/**
* @brief Initializes the thread
* @param t_function The thread function
* @param t_parameter The parameter to pass to the function
* @param t_autostart Whether the thread should start instantly
* @param t_detached Whether the thread starts detached or not
* @param t_stackSize The stacksize allocated for the thread in bytes (rounded
* to multiples of 8 bytes)
* @note t_function needs to be of type `void` and take one (and only one)
* parameter of type m3d::Parameter
* @warning If the thread priority is lower than the priority of the calling
* thread, the thread will never get executed. Use
* m3d::Thread::getCurrentPriority() to get the priority of the current thread
*/
void initialize(std::function<void(RenderD7::Parameter)> t_function,
RenderD7::Parameter t_parameter = nullptr,
bool t_autostart = false, bool t_detached = false,
unsigned long long int t_stackSize = 4 * 1024);
/**
* @brief Sets the size of the stack that gets allocated for the next thread
* that get's started
* @param t_stackSize The allocated space in bytes (rounded to multiples of 8
* bytes)
*/
void setStackSize(unsigned long long int t_stackSize);
/**
* @brief Starts the thread. To restart it, call Thread::join() before
* @param t_detached Whether the thread should start detached or not
*/
void start(bool t_detached = false);
/**
* @brief Detaches the thread
*/
void kill();
/**
* @brief Waits for the thread to finish
* @param t_timeout The timeout in nanoseconds. Leave it for no timeout
*/
void join(long long unsigned int t_timeout = U64_MAX);
bool isRunning();
/**
* @brief Puts the thread to sleep
*
* This is needed if you have multiple threads running at the same time. It
* doesn't affect the execution-time of the thread, it just makes it possible
* for the other threads to get their chance to shine.
*/
static void sleep();
/**
* @brief Sleeps for the given time
* @param t_milliseconds The time to sleep in milliseconds
*/
static void sleep(int t_milliseconds);
private:
struct ThreadData {
RenderD7::Parameter m_parameter;
std::function<void(RenderD7::Parameter)> m_function;
std::atomic<bool> *m_running;
};
static void threadFunction(void *t_arg);
/* data */
int m_priority, m_stackSize;
bool m_started;
std::atomic<bool> m_running;
RenderD7::Thread::ThreadData m_data;
CTRU_Thread m_thread;
};
} // namespace RenderD7

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

52
not_functional/Flac.cpp Normal file
View File

@ -0,0 +1,52 @@
#include <renderd7/music/Flac.hpp>
#ifdef RENDERD7_MUSICDEC
#define DR_FLAC_IMPLEMENTATION
#include <renderd7/external/dr_flac.h>
int rd7i_check_flac(const std::string &path) {
int err = -1;
drflac* flac = drflac_open_file(path.c_str(), NULL);
if(flac != NULL)
err = 0;
drflac_close(flac);
return err;
}
namespace RenderD7 {
int FlacDecoder::_init(const std::string &path, MusicMeta& meta) {
meta.path(path);
if(path.find_last_of('/') != path.npos)
meta.name(path.substr(path.find_last_of('/')));
else
meta.name(path);
flac = drflac_open_file(path.c_str(), NULL);
return flac == NULL ? -1 : 0;
}
unsigned int FlacDecoder::_getSampleRate() { return flac->sampleRate; }
unsigned char FlacDecoder::_getChannels() { return flac->channels; }
size_t FlacDecoder::_getBufSize() { return buf_size; }
unsigned long long FlacDecoder::_decode(signed short*buf_addr) {
unsigned long long bsf = (unsigned long long)buf_size/(unsigned long long)flac->channels;
unsigned long long samples_read = drflac_read_pcm_frames_s16(flac, bsf, buf_addr);
samples_read *= (unsigned long long)flac->channels;
return samples_read;
}
void FlacDecoder::_deinit() {
drflac_close(flac);
}
size_t FlacDecoder::_getFileSamples() {
return flac->totalPCMFrameCount * (size_t)flac->channels;
}
} // namespace RenderD7
#endif

26
not_functional/Flac.hpp Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#include <renderd7/music/Music.hpp>
#include <fstream>
#include <renderd7/external/dr_flac.h>
namespace RenderD7 {
class FlacDecoder : public MusicDecoder {
public:
FlacDecoder() {}
~FlacDecoder() {}
int _init(const std::string& pat, MusicMeta& meta) override;
unsigned int _getSampleRate() override;
unsigned char _getChannels() override;
size_t _getBufSize() override;
unsigned long long _decode(signed short* buf_addr) override;
void _deinit() override;
size_t _getFileSamples() override;
private:
drflac* flac;
const size_t buf_size = 16 * 1024;
};
}

40
not_functional/MUSIC.md Normal file
View File

@ -0,0 +1,40 @@
# Copy of removed Music.cpp file loaders
```
#include <renderd7/music/Flac.hpp>
#include <renderd7/music/Wav.hpp>
// "RIFF"
/*case 0x46464952:
// "riff"
case 0x66666972:
// "RIFX"
case 0x58464952:
// "RF64"
case 0x34364652:
// "FORM"
case 0x4D524F46:
decoder = new WavDecoder();
if (init(path, rd7i_mp_internal_data.meta)) {
MusicDecoder::CleanUp();
return;
}
break;*/
// Flac
/*case 0x43614c66:
decoder = new FlacDecoder();
if (init(path, rd7i_mp_internal_data.meta)) {
RenderD7::PushMessage(
RenderD7::Message("Music Player", "Failed to load FLAC"));
MusicDecoder::CleanUp();
return;
}
break;*/
// The other one
/*else if (rd7i_check_flac(path) == 0) {
decoder = new FlacDecoder();
if (init(path, rd7i_mp_internal_data.meta)) {
MusicDecoder::CleanUp();
return;
}
}*/
```

41
not_functional/Wav.cpp Normal file
View File

@ -0,0 +1,41 @@
#include <renderd7/music/Wav.hpp>
#ifdef RENDERD7_MUSICDEC
#define DR_WAV_IMPLEMENTATION
#include <renderd7/external/dr_wav.h>
namespace RenderD7 {
int WavDecoder::_init(const std::string &path, MusicMeta& meta) {
meta.path(path);
if(path.find_last_of('/') != path.npos)
meta.name(path.substr(path.find_last_of('/')));
else
meta.name(path);
return !drwav_init_file(&wav, path.c_str(), NULL);
}
unsigned int WavDecoder::_getSampleRate() { return wav.sampleRate; }
unsigned char WavDecoder::_getChannels() { return wav.channels; }
size_t WavDecoder::_getBufSize() { return buf_size; }
unsigned long long WavDecoder::_decode(signed short*buf_addr) {
unsigned long long bsf = (unsigned long long)buf_size/(unsigned long long)wav.channels;
unsigned long long samples_read = drwav_read_pcm_frames(&wav, bsf, buf_addr);
samples_read *= (unsigned long long)wav.channels;
return samples_read;
}
void WavDecoder::_deinit() {
drwav_uninit(&wav);
}
size_t WavDecoder::_getFileSamples() {
return wav.totalPCMFrameCount * (size_t)wav.channels;
}
} // namespace RenderD7
#endif

26
not_functional/Wav.hpp Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#include <renderd7/music/Music.hpp>
#include <fstream>
#include <renderd7/external/dr_wav.h>
namespace RenderD7 {
class WavDecoder : public MusicDecoder {
public:
WavDecoder() {}
~WavDecoder() {}
int _init(const std::string& path, MusicMeta& meta) override;
unsigned int _getSampleRate() override;
unsigned char _getChannels() override;
size_t _getBufSize() override;
unsigned long long _decode(signed short* buf_addr) override;
void _deinit() override;
size_t _getFileSamples() override;
private:
drwav wav;
const size_t buf_size = 16 * 1024;
};
}

278
rd7tf/Makefile Normal file
View File

@ -0,0 +1,278 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#nicetest
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITARM)/3ds_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# GRAPHICS is a list of directories containing graphics files
# GFXBUILD is the directory where converted graphics files will be placed
# If set to $(BUILD), it will statically link in the converted
# files as if they were data files.
#
# NO_SMDH: if set to anything, no SMDH file is generated.
# ROMFS is the directory which contains the RomFS, relative to the Makefile (Optional)
# APP_TITLE is the name of the app stored in the SMDH file (Optional)
# APP_DESCRIPTION is the description of the app stored in the SMDH file (Optional)
# APP_AUTHOR is the author of the app stored in the SMDH file (Optional)
# ICON is the filename of the icon (.png), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.png
# - icon.png
# - <libctru folder>/default_icon.png
#---------------------------------------------------------------------------------
# External tools
#---------------------------------------------------------------------------------
ifeq ($(OS),Windows_NT)
MAKEROM ?= C:/devkitpro/tools/bin/makerom.exe
BANNERTOOL ?= C:/devkitpro/tools/bin/bannertool.exe
else
MAKEROM ?= makerom
BANNERTOOL ?= bannertool
endif
# If on a tagged commit, use the tag instead of the commit
ifneq ($(shell echo $(shell git tag -l --points-at HEAD) | head -c 1),)
GIT_VER := $(shell git tag -l --points-at HEAD)
else
GIT_VER := $(shell git rev-parse --short HEAD)
endif
TIME_TIME := unk
#---------------------------------------------------------------------------------
# Version number
#---------------------------------------------------------------------------------
VERSION_MAJOR := 1
VERSION_MINOR := 0
VERSION_MICRO := 0
#---------------------------------------------------------------------------------
# Make Sure to Change this paths if your Submodule
# is located somewhere else
# Using ../ cause rd7tf is shipped with the RenderD7
# Repository!
RENDERD7_SRC := ../source ../external ../source/music
RENDERD7_INC := ../include
# Libraries used for RenderD7
# if you already use -lm, -lctru etc place a # before -lm
RENDERD7_LIBS := -lcurl -lm -lcitro2dd -lcitro3d -lctru
TARGET := rd7tf
BUILD := build
SOURCES := source $(RENDERD7_SRC)
DATA := data
INCLUDES := source $(RENDERD7_INC)
GRAPHICS := gfx
#GFXBUILD := $(BUILD)
ROMFS := romfs
GFXBUILD := $(ROMFS)/gfx
APP_AUTHOR := NPI-D7
APP_DESCRIPTION := RenderD7 Test Framework
ICON := app/icon.png
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
CFLAGS := -g -Wall -Wno-psabi -O2 -mword-relocations \
-DV_STRING=\"$(GIT_VER)\" \
-DV_TIME=\"$(TIME_TIME)\" \
-ffunction-sections \
$(ARCH)
CFLAGS += $(INCLUDE) -D__3DS__ -D_GNU_SOURCE=1
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++20
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LIBS := -lstdc++ $(RENDERD7_LIBS)
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(CTRULIB)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica)))
SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist)))
GFXFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.t3s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
ifeq ($(GFXBUILD),$(BUILD))
#---------------------------------------------------------------------------------
export T3XFILES := $(GFXFILES:.t3s=.t3x)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export ROMFS_T3XFILES := $(patsubst %.t3s, $(GFXBUILD)/%.t3x, $(GFXFILES))
export T3XHFILES := $(patsubst %.t3s, $(BUILD)/%.h, $(GFXFILES))
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES_BIN := $(addsuffix .o,$(BINFILES)) \
$(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o)
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(PICAFILES:.v.pica=_shbin.h) $(SHLISTFILES:.shlist=_shbin.h) \
$(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
export _3DSXDEPS := $(if $(NO_SMDH),,$(OUTPUT).smdh)
ifeq ($(strip $(ICON)),)
icons := $(wildcard *.png)
ifneq (,$(findstring $(TARGET).png,$(icons)))
export APP_ICON := $(TOPDIR)/$(TARGET).png
else
ifneq (,$(findstring icon.png,$(icons)))
export APP_ICON := $(TOPDIR)/icon.png
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
endif
ifeq ($(strip $(NO_SMDH)),)
export _3DSXFLAGS += --smdh=$(CURDIR)/$(TARGET).smdh
endif
ifneq ($(ROMFS),)
export _3DSXFLAGS += --romfs=$(CURDIR)/$(ROMFS)
endif
.PHONY: all clean
#---------------------------------------------------------------------------------
all: $(BUILD) $(GFXBUILD) $(DEPSDIR) $(ROMFS_T3XFILES) $(T3XHFILES)
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).3dsx $(TARGET).cia $(TARGET).smdh app/*.bin
@rm -fr $(OUTDIR)
#---------------------------------------------------------------------------------
send:
@3dslink -a $(IP) $(TARGET).3dsx
#---------------------------------------------------------------------------------
run:
@flatpak run org.citra_emu.citra $(TARGET).3dsx
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
3dsx: $(BUILD)
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile 3dsx
#---------------------------------------------------------------------------------
$(GFXBUILD)/%.t3x $(BUILD)/%.h : %.t3s
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(DEVKITPRO)/tools/bin/tex3ds -i $< -H $(BUILD)/$*.h -d $(DEPSDIR)/$*.d -o $(GFXBUILD)/$*.t3x
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all: $(OUTPUT).elf $(OUTPUT).3dsx
$(OUTPUT).elf : $(OFILES)
$(OUTPUT).3dsx : $(_3DSXDEPS)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
#---------------------------------------------------------------------------------
.PRECIOUS : %.t3x %.shbin
#---------------------------------------------------------------------------------
%.t3x.o %_t3x.h : %.t3x
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.shbin.o %_shbin.h : %.shbin
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $<)
$(bin2o)
-include $(DEPSDIR)/*.d
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

BIN
rd7tf/app/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

9
rd7tf/clean.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#Clean old build
echo "Cleaning..."
make clean
rm -rf libs/*
cd ..
make clean
echo "Done!"

BIN
rd7tf/gfx/default_icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

BIN
rd7tf/gfx/folder.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
rd7tf/gfx/renderd7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

6
rd7tf/gfx/sprites.t3s Executable file
View File

@ -0,0 +1,6 @@
--atlas -f rgba -z auto
renderd7.png
folder.png
default_icon.png
unk_icon.png

BIN
rd7tf/gfx/unk_icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

1
rd7tf/romfs/gfx/Leere Datei Executable file
View File

@ -0,0 +1 @@
vcx

BIN
rd7tf/romfs/gfx/bg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
rd7tf/romfs/gfx/renderd7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
rd7tf/romfs/gfx/sprites.t3x Executable file

Binary file not shown.

BIN
rd7tf/romfs/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

5
rd7tf/romfs/lang/de/app.json Executable file
View File

@ -0,0 +1,5 @@
{
"LOADINGFILES": "Lade Dateien ...",
"MENU": "Menü",
"LOADING": "Lade ..."
}

5
rd7tf/romfs/lang/en/app.json Executable file
View File

@ -0,0 +1,5 @@
{
"LOADINGFILES": "Loading Files ...",
"MENU": "Menu",
"LOADING": "Loading ..."
}

Binary file not shown.

BIN
rd7tf/romfs/thesound.wav Normal file

Binary file not shown.

52
rd7tf/source/main.cpp Normal file
View File

@ -0,0 +1,52 @@
#include "scene.hpp"
#include "renderd7/music/Music.hpp"
void ColorThemeSample() {
RenderD7::ColorNew(RD7Color_Text, RenderD7::Color::Hex("#000000", 255));
RenderD7::ColorNew(RD7Color_TextDisabled, RenderD7::Color::Hex("#212121", 200));
RenderD7::ColorNew(RD7Color_Text2, RenderD7::Color::Hex("#ffffff", 255));
RenderD7::ColorNew(RD7Color_Background, RenderD7::Color::Hex("#eeeeee", 170));
RenderD7::ColorNew(RD7Color_Header, RenderD7::Color::Hex("#222222", 190));
RenderD7::ColorNew(RD7Color_Selector, RenderD7::Color::Hex("#4444dd", 200));
RenderD7::ColorNew(RD7Color_SelectorFade, RenderD7::Color::Hex("#7777dd", 200));
RenderD7::ColorNew(RD7Color_List0, RenderD7::Color::Hex("#555555", 130));
RenderD7::ColorNew(RD7Color_List1, RenderD7::Color::Hex("#777777", 130));
RenderD7::ColorNew(RD7Color_MessageBackground, RenderD7::Color::Hex("#222222", 180));
RenderD7::ColorNew(RD7Color_Button, RenderD7::Color::Hex("#4444dd", 150));
RenderD7::ColorNew(RD7Color_ButtonHovered, RenderD7::Color::Hex("#6666dd", 150));
RenderD7::ColorNew(RD7Color_ButtonDisabled, RenderD7::Color::Hex("#2222dd", 150));
RenderD7::ColorNew(RD7Color_ButtonActive, RenderD7::Color::Hex("#7777dd", 150));
RenderD7::ColorNew(RD7Color_Checkmark, RenderD7::Color::Hex("#4444dd", 130));
RenderD7::ColorNew(RD7Color_FrameBg, RenderD7::Color::Hex("#555555", 160));
RenderD7::ColorNew(RD7Color_FrameBgHovered, RenderD7::Color::Hex("#777777", 160));
RenderD7::ColorNew(RD7Color_Progressbar, RenderD7::Color::Hex("#4444dd", 200));
}
extern void IdbServer();
int main() {
rd7_enable_memtrack = true;
rd7_do_splash = true;
RenderD7::Ftrace::Beg("app", "app_init");
RenderD7::Init::Main("rd7tf");
RenderD7::FadeIn();
//RenderD7::InlineAssert(1 == 2, "1 is not 2!");
//IdbServer();
ColorThemeSample();
RenderD7::Init::NdspFirm();
RenderD7::Scene::Load(std::make_unique<Sample>());
RenderD7::Ftrace::End("app", "app_init");
while (RenderD7::MainLoop()) {
RenderD7::OnScreen(Top);
RenderD7::Ftrace::Beg("app", "app_mainloop");
if (d7_hDown & KEY_START) {
RenderD7::FadeOut();
RenderD7::ExitApp();
}
RenderD7::OnScreen(Top);
RenderD7::FrameEnd();
RenderD7::Ftrace::End("app", "app_mainloop");
}
return 0;
}

132
rd7tf/source/scene.cpp Normal file
View File

@ -0,0 +1,132 @@
#include "scene.hpp"
#include <cmath>
static float MakeOffset(float x) {
float y = cos(x) * 42;
return y - floor(y);
}
static void Wave(int index, R7Vec2 position, R7Vec2 size, float time,
bool dbg) {
float offset = MakeOffset(index) * 62;
float x_position =
position.x + size.x / 8 * ((index % 11) - 1) + cos(offset + time) * 10;
float y_position = position.y + size.y / 8 * (index / 11) + 40 +
sin(offset + time) * 10 + 30;
float color_effect = 1 - exp(-(index / 11) / 3.0f);
// As this is 3ds dont go out of the box
int shrink = 0;
if (y_position >= position.y + size.y - 90) {
shrink = y_position - (position.y + size.y - 90);
}
// Just to make sure...
y_position = std::min(y_position, position.y + size.y - (90 - shrink));
if (dbg)
RenderD7::Draw2::TriangleLined(
R7Vec2(x_position, y_position),
R7Vec2(x_position + 300, y_position + (90 - shrink)),
R7Vec2(x_position - 300, y_position + (90 - shrink)),
RenderD7::Color::RGBA(.94f - .17f * color_effect,
.61f - .25f * color_effect,
.36f + .38f * color_effect)
.toRGBA());
else
RenderD7::Draw2::TriangleSolid(
R7Vec2(x_position, y_position),
R7Vec2(x_position + 300, y_position + (90 - shrink)),
R7Vec2(x_position - 300, y_position + (90 - shrink)),
RenderD7::Color::RGBA(.94f - .17f * color_effect,
.61f - .25f * color_effect,
.36f + .38f * color_effect)
.toRGBA());
}
void DrawWave(R7Vec2 position, R7Vec2 size, float time, bool dbg) {
RenderD7::Draw2::RectFilledSolid(position, size, 0xff64c9fd);
int i = 0;
for (; i < 44; i++) Wave(i, position, size, time, dbg);
}
R7Vec2 testv2 = R7Vec2(48, 48);
R7Vec2 grid_display_entry(void* data, R7Vec2 pos) {
auto img = reinterpret_cast<RenderD7::Image*>(data);
RenderD7::Draw2::Image(img, pos);
RenderD7::Draw2::RFS(pos, testv2, RenderD7::Color::Hex("#0000ff", 140));
return testv2;
}
std::vector<RenderD7::Image*> imgdb;
Sample::Sample() {
/*RenderD7::Image* im = new RenderD7::Image();
im->load("romfs:/icons/icon.png");
for(int i = 0; i < 64; i++)
imgdb.push_back(im);*/
auto t = RenderD7::FileSystem::GetDirContent("sdmc:/music/");
for(const auto& it : t)
names.push_back(it.path);
}
Sample::~Sample() {
// Here you can clear your data
}
void Sample::Draw() const {
// Draw Things to Screen:
// Step 1 -> Select Screen
RenderD7::OnScreen(Top);
// Step 2 -> Draw Things
// The hbloader Triangle Wave
DrawWave(R7Vec2(0, 0), R7Vec2(400, 240), RenderD7::GetTime(),
debug_background);
// For Example A Rect with Draw2 and StyleColorApi
// And the RFS Wrapper for RectFilledSolid lol
/*RenderD7::Draw2::RFS(R7Vec2(0, 0), R7Vec2(400, 20),
RenderD7::StyleColor(RD7Color_Header));
// As the Top bar is Dark you need TextColor2
RenderD7::RedirectColor(RD7Color_Text, RD7Color_Text2);
RenderD7::Draw2::Text(R7Vec2(5, 2), "RenderD7 - Test Framework");
RenderD7::Draw2::Text(R7Vec2(395, 2), RENDERD7VSTRING,
RD7TextFlags_AlignRight);
RenderD7::UndoColorEdit(RD7Color_Text);*/
if (UI7::BeginMenu("RenderD7 Test Framework")) {
UI7::SetCursorPos(R7Vec2(395, 2));
UI7::Label(RenderD7::FormatBytes(RenderD7::Memory::GetCurrent()), RD7TextFlags_AlignRight);
UI7::RestoreCursor();
//UI7::Grid("Files", R7Vec2(390, 210), grid_display_entry, reinterpret_cast<void**>(imgdb.data()), imgdb.size());
UI7::BrowserList(names, sel);
UI7::EndMenu();
}
RenderD7::OnScreen(Bottom);
if (UI7::BeginMenu("Control Center")) {
if (UI7::Button("RenderD7 Settings"))
shared_requests[1U] = 1U; // Request a Toggle
UI7::SameLine();
if (UI7::Button("Test Message"))
shared_requests[2U] = 1U; // Request Test Msg
UI7::Checkbox("Debug BG", debug_background);
UI7::SameLine();
UI7::Checkbox("RD7-Debug", rd7_debugging);
UI7::InputText("Search", search__, "Tap Here");
UI7::EndMenu();
}
}
void Sample::Logic() {
for (const auto& it : shared_requests) {
if (it.first == 1U) {
if (it.second) RenderD7::LoadSettings();
} else if (it.first == 2U) {
if (it.second)
RenderD7::PushMessage(RenderD7::Message(
"Test Message", "Button Bressed\nBest Msg Handler..."));
}
}
// Make sure to clear after processing!!!;
shared_requests.clear();
if (d7_hDown & KEY_B) debug_background = !debug_background;
}

27
rd7tf/source/scene.hpp Normal file
View File

@ -0,0 +1,27 @@
#pragma once
#include <rd7.hpp>
class Sample : public RenderD7::Scene {
public:
Sample();
~Sample();
void Draw() const override;
void Logic() override;
private:
// Just as the RD7 Settings Shows here as example
// by using a mutale map you're able to process
// requests from the const Draw function in the
// Logic Function! you could also create lots of
// mutable bool or make all Variables mutable but
// i think seperating draw and logic is better
// editable map request_id data/operation
mutable std::map<unsigned int, unsigned int> shared_requests;
// For Checkbox its best to use mutable
mutable bool debug_background = false;
mutable std::string search__ = "";
mutable std::vector<std::string> names;
mutable int sel;
};

22
rd7tf/update.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
#Clean old build
echo "Cleaning..."
rm -rf libs/*
#Format to LLVM
echo "Format to LLVM"
cd ..
./cformat.sh
#Compile RenderD7
echo "Compiling RenderD7"
make
#Copy new build
echo "Copy New Build"
cp -r include rd7tf/libs/
cp -r lib rd7tf/libs/
#Build Test Framework
echo "Building Test Framework"
cd rd7tf
make
echo "Done!"

94
source/Color.cpp Normal file
View File

@ -0,0 +1,94 @@
#include <map>
#include <renderd7/Color.hpp>
// This is btw the default theme setup
// RenderD7 StyleColor Api
// not const cause const = error lol
std::map<RD7Color, unsigned int> rd7i_color_map = {
{RD7Color_Text, RGBA8(0, 0, 0, 255)},
{RD7Color_Text2, RGBA8(255, 255, 255, 255)}, // For Background change or so
{RD7Color_TextDisabled, RGBA8(170, 170, 170, 255)},
{RD7Color_Background, RGBA8(238, 238, 238, 255)},
{RD7Color_Header, RGBA8(17, 17, 17, 255)},
{RD7Color_Selector, RGBA8(34, 34, 34, 255)},
{RD7Color_SelectorFade, RGBA8(90, 90, 90, 255)},
{RD7Color_List0, RGBA8(204, 204, 204, 255)}, // List0 = % 2
{RD7Color_List1, RGBA8(187, 187, 187, 255)},
{RD7Color_MessageBackground, RGBA8(51, 51, 51, 255)},
{RD7Color_Button, RGBA8(17, 17, 17, 255)},
{RD7Color_ButtonHovered, RGBA8(34, 34, 34, 255)},
{RD7Color_ButtonDisabled, RGBA8(8, 8, 8, 255)},
{RD7Color_ButtonActive, RGBA8(42, 42, 42, 255)},
{RD7Color_Checkmark, RGBA8(42, 42, 42, 255)},
{RD7Color_FrameBg, RGBA8(85, 85, 85, 255)},
{RD7Color_FrameBgHovered, RGBA8(119, 119, 119, 255)},
{RD7Color_Progressbar, RGBA8(0, 255, 0, 255)},
};
std::map<RD7Color, unsigned int> rd7i_color_swap_map;
unsigned int RenderD7::StyleColor(RD7Color color) {
if (rd7i_color_swap_map.find(color) != rd7i_color_swap_map.end())
return rd7i_color_swap_map[color];
else if (rd7i_color_map.find(color) != rd7i_color_map.end())
return rd7i_color_map[color];
return RGBA8(0, 0, 0, 0);
}
void RenderD7::ColorNew(RD7Color color, unsigned int new_color) {
rd7i_color_map[color] = new_color;
}
void RenderD7::RedirectColor(RD7Color to, RD7Color from) {
// As you see at the code Redirect doesnt redirect xd
// Just named cause it feels like redirecting
// Oh and if the color is edit you redirect to it is
// grabs that redirected lol
rd7i_color_swap_map[to] = StyleColor(from);
}
void RenderD7::CustomizeColor(RD7Color color, unsigned int custom) {
rd7i_color_swap_map[color] = custom;
}
void RenderD7::TextColorByBg(RD7Color background) {
UndoColorEdit(RD7Color_Text); // To be sure
rd7i_color_swap_map[RD7Color_Text] = StyleColor(
Color::RGBA(background).is_light() ? RD7Color_Text : RD7Color_Text2);
}
void RenderD7::UndoColorEdit(RD7Color color) {
if (rd7i_color_swap_map.find(color) == rd7i_color_swap_map.end())
return;
rd7i_color_swap_map.erase(color);
}
void RenderD7::UndoAllColorEdits() { rd7i_color_swap_map.clear(); }
// Standart Color Converter
static const std::map<char, int> HEX_TO_DEC = {
{'0', 0}, {'1', 1}, {'2', 2}, {'3', 3}, {'4', 4}, {'5', 5},
{'6', 6}, {'7', 7}, {'8', 8}, {'9', 9}, {'a', 10}, {'b', 11},
{'c', 12}, {'d', 13}, {'e', 14}, {'f', 15}, {'A', 10}, {'B', 11},
{'C', 12}, {'D', 13}, {'E', 14}, {'F', 15}};
uint32_t RenderD7::Color::Hex(const std::string &color, uint8_t a) {
if (color.length() < 7 ||
std::find_if(color.begin() + 1, color.end(),
[](char c) { return !std::isxdigit(c); }) != color.end()) {
return RenderD7::Color::Hex("#000000", 0);
}
int r = HEX_TO_DEC.at(color[1]) * 16 + HEX_TO_DEC.at(color[2]);
int g = HEX_TO_DEC.at(color[3]) * 16 + HEX_TO_DEC.at(color[4]);
int b = HEX_TO_DEC.at(color[5]) * 16 + HEX_TO_DEC.at(color[6]);
return RGBA8(r, g, b, a);
}
std::string RenderD7::Color::RGB2Hex(int r, int g, int b) {
std::stringstream ss;
ss << "#";
ss << std::hex << (r << 16 | g << 8 | b);
return ss.str();
}

237
source/DrawV2.cpp Normal file
View File

@ -0,0 +1,237 @@
#include <citro2d.h>
#include <algorithm>
#include <renderd7/DrawV2.hpp>
#include <renderd7/global_db.hpp>
#include <renderd7/internal_db.hpp>
const float rd7i_d7_dts = 0.5f;
float rd7i_d2_txt_size = rd7i_d7_dts;
C2D_Font rd7i_d2_fnt = nullptr;
R7Vec2 rd7i_d7_mwh = R7Vec2(0, 0);
std::map<std::string, float> rd7i_d2_ts;
std::map<std::string, int> rd7i_d2_mln;
bool rd7i_txt_init = false;
std::string GetShortedText(const std::string &in, int maxlen) {
auto textdim = RenderD7::GetTextDimensions(in);
if (textdim.x < (float)maxlen) return in;
std::string ft = "";
std::string worker = in;
if (in.find_last_of('.') != in.npos) {
ft = in.substr(in.find_last_of('.'));
worker = in.substr(0, in.find_last_of('.'));
}
maxlen -= RenderD7::GetTextDimensions(ft).x -
RenderD7::GetTextDimensions("(...)").x;
float len_mod = (float)maxlen / textdim.x;
int pos = (in.length() * len_mod) / rd7_draw2_tsm;
std::string out;
out = in.substr(0, pos);
for (size_t i = pos; i < worker.length(); i++) {
out += worker[i];
if (RenderD7::GetTextDimensions(out + "(...)" + ft).x > (float)maxlen) {
out += "(...)";
out += ft;
return out;
}
}
return ""; // Impossible to reach
}
std::string WrapText(const std ::string &in, int maxlen) {
std::string out;
std::string line;
int line_x = 0;
std::istringstream istream(in);
std::string temp;
while (istream >> temp) {
R7Vec2 dim = RenderD7::GetTextDimensions(line + temp);
if (line_x + dim.x <= maxlen) {
line += temp + ' ';
line_x += dim.x;
} else {
out += line + '\n';
line = temp + ' ';
line_x = dim.x;
}
}
out += line;
return out;
}
bool RD7I_FNT_VALID() {
if (rd7i_d2_fnt != nullptr && !rd7i_txt_init) {
rd7i_txt_init = true;
}
if (!rd7i_txt_init) {
if (rd7i_base_font != nullptr) {
rd7i_d2_fnt = rd7i_base_font;
rd7i_txt_init = true;
return true;
}
}
if (rd7i_d2_fnt != nullptr) {
return true;
} else {
rd7i_d2_fnt = rd7i_base_font;
return true;
}
// Schould never be reached
return false;
}
namespace RenderD7 {
R7Vec2 GetTextDimensions(const std::string &text) {
C2D_TextBufClear(rd7i_d2_dimbuf);
float w = 0, h = 0;
if (!RD7I_FNT_VALID()) return R7Vec2(w, h);
C2D_Text c2dtext;
C2D_TextFontParse(&c2dtext, rd7i_d2_fnt, rd7i_d2_dimbuf, text.c_str());
C2D_TextGetDimensions(&c2dtext, rd7i_d2_txt_size, rd7i_d2_txt_size, &w, &h);
return R7Vec2(w, h);
}
void CustomTextSize(float size) { rd7i_d2_txt_size = size; }
void TextDefaultSize() { rd7i_d2_txt_size = rd7i_d7_dts; }
void TextMaxBox(R7Vec2 size) { rd7i_d7_mwh = size; }
void TextDefaultBox() { rd7i_d7_mwh = R7Vec2(0, 0); }
void TextFont(C2D_Font fnt) { rd7i_d2_fnt = fnt; }
void TextDefaultFont() { rd7i_d2_fnt = rd7i_base_font; }
std::string TextShort(const std::string &in, int max_len) {
return GetShortedText(in, max_len);
}
namespace Draw2 {
void Rect(R7Vec2 pos, R7Vec2 size, unsigned int color, int t) {
// 4 DrawLine Calls Lol
C2D_DrawLine(pos.x, pos.y, color, pos.x + size.x, pos.y, color, t, 1.f);
C2D_DrawLine(pos.x, pos.y, color, pos.x, pos.y + size.y, color, t, 1.f);
C2D_DrawLine(pos.x + size.x, pos.y, color, pos.x + size.x, pos.y + size.y,
color, t, 1.f);
C2D_DrawLine(pos.x, pos.y + size.y, color, pos.x + size.x, pos.y + size.y,
color, t, 1.f);
}
void RectFilled(R7Vec2 pos, R7Vec2 size, Color4 colors) {
C2D_DrawRectangle(pos.x, pos.y, 0.5f, size.x, size.y, colors.color0,
colors.color1, colors.color2, colors.color3);
}
void RectFilledSolid(R7Vec2 pos, R7Vec2 size, unsigned int color) {
C2D_DrawRectSolid(pos.x, pos.y, 0.5f, size.x, size.y, color);
}
void Line(R7Vec2 pos0, R7Vec2 pos1, unsigned int color, int t) {
C2D_DrawLine(pos0.x, pos0.y, color, pos1.x, pos1.y, color, t, 1.f);
}
void Triangle(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, Color3 colors) {
C2D_DrawTriangle(pos0.x, pos0.y, colors.color0, pos1.x, pos1.y, colors.color1,
pos2.x, pos2.y, colors.color2, 0.5f);
}
void TriangleSolid(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, unsigned int color) {
C2D_DrawTriangle(pos0.x, pos0.y, color, pos1.x, pos1.y, color, pos2.x, pos2.y,
color, 0.5f);
}
void TriangleLined(R7Vec2 pos0, R7Vec2 pos1, R7Vec2 pos2, unsigned int color,
int t) {
// 3 Line Cqalls lol more efficient than Rect
C2D_DrawLine(pos0.x, pos0.y, color, pos1.x, pos1.y, color, t, 1.f);
C2D_DrawLine(pos0.x, pos0.y, color, pos2.x, pos2.y, color, t, 1.f);
C2D_DrawLine(pos1.x, pos1.y, color, pos2.x, pos2.y, color, t, 1.f);
}
void Text(R7Vec2 pos, const std::string &text, RD7TextFlags flags) {
// The Start of the C2D Text Hell
if (!RD7I_FNT_VALID()) return;
// Variables
bool updated_mwh = false;
if (rd7i_d7_mwh.x == 0.0f) {
rd7i_d7_mwh.x = rd7i_current_screen ? 400 : 320;
updated_mwh = true;
}
if (rd7i_d7_mwh.y == 0.0f) {
rd7i_d7_mwh.y = 240;
updated_mwh = true;
}
std::string edit_text = text;
if (edit_text.substr(text.length() - 1) != "\n")
edit_text.append("\n"); // Add \n to end if not exist
int line = 0;
if(flags & RD7TextFlags_Wrap)
edit_text = WrapText(text, rd7i_d7_mwh.x - pos.x);
while (edit_text.find('\n') != edit_text.npos) {
std::string current_line = edit_text.substr(0, edit_text.find('\n'));
if (flags & RD7TextFlags_Short)
current_line = GetShortedText(current_line, rd7i_d7_mwh.x - pos.x);
R7Vec2 newpos = pos;
// Check Flags
R7Vec2 dim = GetTextDimensions(current_line);
if (flags & RD7TextFlags_AlignRight)
newpos.x = newpos.x - GetTextDimensions(current_line).x;
if (flags & RD7TextFlags_AlignMid) // Offset by inpos
newpos.x = (rd7i_d7_mwh.x * 0.5) - (dim.x * 0.5) + pos.x;
if (flags & RD7TextFlags_Scroll) { // Scroll Text
if (newpos.x + dim.x > rd7i_d7_mwh.x - newpos.x - 10) {
if (rd7i_d2_ts.find(current_line) == rd7i_d2_ts.end())
rd7i_d2_ts[current_line] = 0;
if (rd7i_d2_mln.find(current_line) == rd7i_d2_mln.end())
rd7i_d2_mln[current_line] =
GetShortedText(current_line, rd7i_d7_mwh.x - newpos.x).length();
rd7i_d2_ts[current_line] += rd7i_dtm * 6;
if ((int)rd7i_d2_ts[current_line] >= (int)current_line.length()) {
rd7i_d2_ts[current_line] = 0.0f;
}
std::string bcl = current_line;
current_line = current_line.substr((int)rd7i_d2_ts[current_line],
rd7i_d2_mln[current_line]);
if (newpos.x + GetTextDimensions(current_line).x <
rd7i_d7_mwh.x - newpos.x)
current_line +=
"|" + bcl.substr(0, rd7i_d2_ts[bcl] - (int)current_line.length());
}
}
if (rd7_debugging) {
RenderD7::Draw2::Rect(newpos, dim, RenderD7::Color::Hex("#ff0000"));
}
C2D_Text c2dtext;
C2D_TextFontParse(&c2dtext, rd7i_d2_fnt, rd7i_text_buffer,
current_line.c_str());
C2D_TextOptimize(&c2dtext);
if (flags & RD7TextFlags_Shaddow) // performance Killer xd
C2D_DrawText(&c2dtext, C2D_WithColor, newpos.x + 1 + (dim.y * line),
newpos.y + 1, 0.5, rd7i_d2_txt_size, rd7i_d2_txt_size,
RenderD7::StyleColor(RD7Color_TextDisabled));
C2D_DrawText(&c2dtext, C2D_WithColor, newpos.x, newpos.y + (dim.y * line),
0.5, rd7i_d2_txt_size, rd7i_d2_txt_size,
RenderD7::StyleColor(RD7Color_Text));
edit_text = edit_text.substr(edit_text.find('\n') + 1);
line++;
}
if (updated_mwh) rd7i_d7_mwh = R7Vec2(0, 0);
}
void Image(RenderD7::Image *img, const R7Vec2 &pos, const R7Vec2 &scale) {
if (img->loaded())
C2D_DrawImageAt(img->get(), pos.x, pos.y, 0.5f, nullptr, scale.x, scale.y);
}
} // namespace Draw2
} // namespace RenderD7

44
source/Error.cpp Normal file
View File

@ -0,0 +1,44 @@
#include <renderd7/Error.hpp>
#include <3ds.h>
#include <renderd7/renderd7.hpp>
#include <renderd7/internal_db.hpp>
#include <renderd7/UI7.hpp>
namespace RenderD7 {
void Error(const std::string& msg) {
if(rd7i_graphics_on) {
C3D_FrameEnd(0);
while(aptMainLoop()) {
hidScanInput();
if(hidKeysDown() & KEY_START) break;
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
RenderD7::ClearTextBufs();
C2D_TargetClear(Top, 0x00000000);
C2D_TargetClear(Bottom, 0x00000000);
RenderD7::OnScreen(Top);
if(UI7::BeginMenu("RenderD7 - Error Manager", R7Vec2(), UI7MenuFlags_TitleMid)) {
UI7::Label(msg, RD7TextFlags_Wrap);
UI7::Label("Press Start to Exit!");
UI7::EndMenu();
}
RenderD7::OnScreen(Bottom);
C3D_FrameEnd(0);
}
exit(0);
} else {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
printf("RENDERD7 - ERROR MANAGER\n\n%s\n", msg.c_str());
printf("Press Start to Exit\n");
while(aptMainLoop()) {
hidScanInput();
if(hidKeysDown() & KEY_START)
break;
gfxSwapBuffers();
}
gfxExit();
exit(0);
}
}
}

70
source/FileSystem.cpp Normal file
View File

@ -0,0 +1,70 @@
#include <3ds.h>
#include <cstring>
#include <stdarg.h>
#include <unistd.h>
#include <stdio.h>
#include <renderd7/FileSystem.hpp>
// Debugging
#include <memory>
#include <renderd7/stringtool.hpp>
#include <algorithm>
#include <filesystem>
bool ___dir__predicate__(const RenderD7::FileSystem::Entry &lhs,
const RenderD7::FileSystem::Entry &rhs) {
if (!lhs.dir && rhs.dir)
return false;
if (lhs.dir && !rhs.dir)
return true;
return strcasecmp(lhs.name.c_str(), rhs.name.c_str()) < 0;
}
std::string RenderD7::FileSystem::GetParentPath(std::string path,
std::string mount_point) {
std::string tcl = path;
if (path.substr(path.length() - 1, 1) != "/") {
tcl += "/";
}
std::string res;
if (std::filesystem::exists(
std::filesystem::path(tcl).parent_path().parent_path()))
res = std::filesystem::path(tcl).parent_path().parent_path().string();
if (res.length() > mount_point.length()) {
return res;
}
return mount_point;
}
std::vector<RenderD7::FileSystem::Entry>
RenderD7::FileSystem::GetDirContent(std::string path) {
std::vector<RenderD7::FileSystem::Entry> res;
for (const auto &entry :
std::filesystem::directory_iterator(std::filesystem::path(path))) {
res.push_back({entry.path().string(), GetFileName(entry.path().string()),
entry.is_directory()});
}
return res;
}
std::vector<RenderD7::FileSystem::Entry>
RenderD7::FileSystem::GetDirContentsExt(
std::string &path, const std::vector<std::string> &extensions) {
std::vector<RenderD7::FileSystem::Entry> res;
for (auto const &it :
std::filesystem::directory_iterator(std::filesystem::path(path))) {
RenderD7::FileSystem::Entry temp;
std::string fn = it.path().string();
temp.name = GetFileName(fn);
temp.path = it.path().string().c_str();
temp.dir = it.is_directory();
if (NameIsEndingWith(GetFileName(it.path().string()),
extensions) ||
it.is_directory()) {
res.push_back(temp);
}
}
std::sort(res.begin(), res.end(), ___dir__predicate__);
return res;
}

3
source/FunctionTrace.cpp Normal file
View File

@ -0,0 +1,3 @@
#include <renderd7/FunctionTrace.hpp>
std::map<std::string, RenderD7::Ftrace::FTRes> RenderD7::Ftrace::rd7_traces;

46
source/Hardware.cpp Normal file
View File

@ -0,0 +1,46 @@
#include <renderd7/Hardware.hpp>
#include <renderd7/Security.hpp>
// Os Specific includes
#include <3ds.h>
// RenderD7 Security
extern bool isndspinit;
void RenderD7::Hardware::Initialisize() {
rd7_security->SafeInit(mcuHwcInit, &mcuHwcExit);
rd7_security->SafeInit(ptmuInit, &ptmuExit);
}
bool RenderD7::Hardware::IsHeadphones() {
if (isndspinit) {
bool inserted;
DSP_GetHeadphoneStatus(&inserted);
return inserted;
} else
return false;
}
bool RenderD7::Hardware::IsCharging() {
uint8_t var;
PTMU_GetBatteryChargeState(&var);
// Some Security Stuff
if (var < 0x00 && var > 0x01) {
return false;
}
return (var == 0x01 ? true : false);
}
float RenderD7::Hardware::GetBatteryPercentage() {
uint8_t percentLevel;
PTMU_GetBatteryLevel(&percentLevel);
return (float)percentLevel / 100;
}
float RenderD7::Hardware::Get3dSliderLevel() { return osGet3DSliderState(); }
float RenderD7::Hardware::GetSoundSliderLevel() {
uint8_t percentLevel;
MCUHWC_GetSoundSliderLevel(&percentLevel);
return (float)percentLevel / 100;
}

Some files were not shown because too many files have changed in this diff Show More