# 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;

View File

@ -1,44 +0,0 @@
#pragma once
/*
MIT License
Copyright (c) 2024 - 2025 René Amthor (tobid7)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <pd/core/common.hpp>
#include <pd/core/sys.hpp>
namespace PD {
class Timer {
public:
Timer() {}
~Timer() {}
void Start() {}
void Pause() {}
void Update() {}
void Reset() { start_ = Sys::GetTime(); }
u64 Get() {}
private:
u64 start_;
u64 now_;
};
} // namespace PD