# Stage 2.2

- Move Timer to core
- Use Timer for app_time
- Fix Deltatime Bug in App
- Add HwInfo to lib3ds (stolen from hbloader 2 pd-rewrite port)
- Add GetSystemLanguage to lib3ds
- Add Net Header for pd-net (still need to find a way to make this working)
- Add base Decoder and Player Headers for pd-sound
- Add Mp3 Decoder (useless and untested yet)
- Add GetDataDirectory to App
- Add InitFLag to App for HwInfo
- Actually write the Timer class
- Rework the UI7 Theme API to use SmartCtor
- UI7::Menu::JoinAlign: Use a loop to determinate max width for centering a group
- Add some Doctumentation around UI7::Menu
This commit is contained in:
2025-02-28 19:49:24 +01:00
parent f9a1d8aefb
commit debedf59c6
27 changed files with 840 additions and 98 deletions

View File

@ -24,6 +24,7 @@ SOFTWARE.
*/
#include <pd/core/common.hpp>
#include <pd/core/timer.hpp>
#include <pd/core/timetrace.hpp>
#include <pd/lib3ds/drv_hid.hpp>
#include <pd/lithium/renderer.hpp>
@ -46,15 +47,16 @@ class App {
};
using AppInitFlags = u32;
enum AppInitFlags_ {
AppInitFlags_None = 0,
AppInitFlags_MountRomfs = 1 << 0,
AppInitFlags_InitGraphics = 1 << 1,
AppInitFlags_New3dsMode = 1 << 2,
AppInitFlags_InitGraphicsNoC3D = 1 << 3,
AppInitFlags_InitLithium = 1 << 4,
AppInitFlags_None = 0, /// Do nothing (probably a useles ability)
AppInitFlags_MountRomfs = 1 << 0, /// Mount Romfs on PreInit
AppInitFlags_InitGraphics = 1 << 1, /// Default Init Graphics for GPU use
AppInitFlags_New3dsMode = 1 << 2, /// Enable New3DS Speedup
AppInitFlags_InitGraphicsNoC3D = 1 << 3, /// Init GFX for Buf Modification
AppInitFlags_InitLithium = 1 << 4, /// Init 2D Rendering Engine
/// I dont have a name for this one yet
/// It Inits Internal Directory structure
AppInitFlags_UnnamedOption1 = 1 << 5,
AppInitFlags_InitHwInfo = 1 << 6, /// Init HwInfo from lib3ds
AppInitFlags_Default = AppInitFlags_MountRomfs | AppInitFlags_InitGraphics |
AppInitFlags_New3dsMode | AppInitFlags_InitLithium,
};
@ -95,6 +97,8 @@ class App {
void FeatureDisable(AppFlags flags) { runtimeflags &= ~flags; }
AppFlags& GetFeatureSet() { return runtimeflags; }
std::string GetDataDirectory();
protected:
Screen::Ref Top;
Screen::Ref Bottom;
@ -110,8 +114,8 @@ class App {
MessageMgr::Ref msg_mgr;
OverlayMgr::Ref overlay_mgr;
Hid::Ref input_mgr;
Timer::Ref app_time;
u64 last_time;
float app_time;
float fps;
std::string name;