WIP Backend System Redesign Step 1
- Created 1 Context for Backend Management and Sharing - Made every class that used a static Backend require the Context or specific Backend - Bring Back 3ds support
This commit is contained in:
@@ -26,10 +26,10 @@ SOFTWARE.
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
PD_API void Container::HandleScrolling(fvec2 scrolling, fvec4 viewport) {
|
||||
if (last_use != 0 && OS::GetTime() - last_use > 5000) {
|
||||
if (last_use != 0 && io->pCtx.Os()->GetTime() - last_use > 5000) {
|
||||
rem = true;
|
||||
}
|
||||
last_use = OS::GetTime();
|
||||
last_use = io->pCtx.Os()->GetTime();
|
||||
pos -= fvec2(0, scrolling.y);
|
||||
skippable = !Li::Renderer::InBox(
|
||||
pos, size,
|
||||
|
||||
@@ -27,7 +27,7 @@ SOFTWARE.
|
||||
namespace PD {
|
||||
PD_API void UI7::IO::Update() {
|
||||
/** Todo: find out if we even still use the Drawlist regestry */
|
||||
u64 current = OS::GetNanoTime();
|
||||
u64 current = pCtx.Os()->GetNanoTime();
|
||||
Delta = static_cast<float>(current - LastTime) / 1000000.f;
|
||||
LastTime = current;
|
||||
DeltaStats->Add(Delta * 1000);
|
||||
|
||||
@@ -132,10 +132,10 @@ PD_API void Menu::HandleFocus() {
|
||||
if (!pIsOpen) {
|
||||
newarea = fvec4(pLayout->Pos, fvec2(pLayout->Size.x, TitleBarHeight));
|
||||
}
|
||||
if ((Hid::IsDown(Hid::Key::Touch) ||
|
||||
Hid::IsEvent(Hid::Event::Event_Down, HidKb::Kb_MouseLeft)) &&
|
||||
Li::Renderer::InBox(Hid::MousePos(), newarea) &&
|
||||
!Li::Renderer::InBox(Hid::MousePos(),
|
||||
if ((pIO->pCtx.Hid()->IsDown(Hid::Key::Touch) ||
|
||||
pIO->pCtx.Hid()->IsEvent(Hid::Event::Event_Down, HidKb::Kb_MouseLeft)) &&
|
||||
Li::Renderer::InBox(pIO->pCtx.Hid()->MousePos(), newarea) &&
|
||||
!Li::Renderer::InBox(pIO->pCtx.Hid()->MousePos(),
|
||||
pIO->InputHandler->FocusedMenuRect)) {
|
||||
pIO->InputHandler->FocusedMenu = pID;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ PD_API void Menu::HandleScrolling() {
|
||||
bool allowed =
|
||||
pLayout->MaxPosition.y > (pLayout->WorkRect.w - pLayout->WorkRect.y);
|
||||
if (allowed) {
|
||||
if (PD::Hid::IsDown(PD::Hid::Key::Touch)) {
|
||||
if (pIO->pCtx.Hid()->IsDown(PD::Hid::Key::Touch)) {
|
||||
pLayout->ScrollStart = pLayout->ScrollOffset;
|
||||
}
|
||||
if (pIO->InputHandler->DragObject(
|
||||
|
||||
@@ -190,9 +190,10 @@ PD_API void Context::MetricsMenu(bool* show) {
|
||||
m->Label("Menus: " + std::to_string(pMenus.size()));
|
||||
/** Section TimeTrace */
|
||||
m->SeparatorText("TimeTrace");
|
||||
if (m->BeginTreeNode("Traces (" + std::to_string(OS::GetTraceMap().size()) +
|
||||
if (m->BeginTreeNode("Traces (" +
|
||||
std::to_string(pIO->pCtx.Os()->GetTraceMap().size()) +
|
||||
")")) {
|
||||
for (auto& it : OS::GetTraceMap()) {
|
||||
for (auto& it : pIO->pCtx.Os()->GetTraceMap()) {
|
||||
if (m->BeginTreeNode(it.second->GetID())) {
|
||||
m->Label("Diff: " + UI7DTF(it.second->GetLastDiff()));
|
||||
m->Label("Protocol Len: " +
|
||||
@@ -207,18 +208,18 @@ PD_API void Context::MetricsMenu(bool* show) {
|
||||
m->EndTreeNode();
|
||||
}
|
||||
m->SeparatorText("Palladium Info");
|
||||
m->Label("Renderer: " + PD::Gfx::pGfx->pName);
|
||||
if (m->BeginTreeNode(std::string("Input: " + PD::Hid::pHid->pName))) {
|
||||
if (PD::Hid::GetFlags() & PD::HidDriver::Flags_HasKeyboard) {
|
||||
m->Label("Renderer: " + pIO->pCtx.Gfx()->GetName());
|
||||
if (m->BeginTreeNode(std::string("Input: " + pIO->pCtx.Hid()->GetName()))) {
|
||||
if (pIO->pCtx.Hid()->Flags & PD::HidDriver::Flags_HasKeyboard) {
|
||||
m->Label("- Keyboard Supported");
|
||||
}
|
||||
if (PD::Hid::GetFlags() & PD::HidDriver::Flags_HasMouse) {
|
||||
if (pIO->pCtx.Hid()->Flags & PD::HidDriver::Flags_HasMouse) {
|
||||
m->Label("- Mouse Supported");
|
||||
}
|
||||
if (PD::Hid::GetFlags() & PD::HidDriver::Flags_HasTouch) {
|
||||
if (pIO->pCtx.Hid()->Flags & PD::HidDriver::Flags_HasTouch) {
|
||||
m->Label("- Touch Supported");
|
||||
}
|
||||
if (PD::Hid::GetFlags() & PD::HidDriver::FLags_HasGamepad) {
|
||||
if (pIO->pCtx.Hid()->Flags & PD::HidDriver::FLags_HasGamepad) {
|
||||
m->Label("- Gamepad Supported");
|
||||
}
|
||||
m->EndTreeNode();
|
||||
|
||||
Reference in New Issue
Block a user