Skip to content

Commit

Permalink
integrate OSD into ScreenPanel and make it nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Dec 28, 2023
1 parent fa835ec commit 345b743
Show file tree
Hide file tree
Showing 10 changed files with 540 additions and 709 deletions.
1 change: 0 additions & 1 deletion src/frontend/qt_sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ set(SOURCES_QT_SDL
LAN_PCap.cpp
LAN_Socket.cpp
LocalMP.cpp
OSD.cpp
OSD_shaders.h
font.h
Platform.cpp
Expand Down
15 changes: 5 additions & 10 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "version.h"

#include "FrontendUtil.h"
#include "OSD.h"

#include "Args.h"
#include "NDS.h"
Expand Down Expand Up @@ -80,15 +79,15 @@ EmuThread::EmuThread(QObject* parent) : QThread(parent)
EmuPauseStack = EmuPauseStackRunning;
RunningSomething = false;

connect(this, SIGNAL(windowUpdate()), mainWindow->panelWidget, SLOT(repaint()));
connect(this, SIGNAL(windowUpdate()), mainWindow->panel, SLOT(repaint()));
connect(this, SIGNAL(windowTitleChange(QString)), mainWindow, SLOT(onTitleUpdate(QString)));
connect(this, SIGNAL(windowEmuStart()), mainWindow, SLOT(onEmuStart()));
connect(this, SIGNAL(windowEmuStop()), mainWindow, SLOT(onEmuStop()));
connect(this, SIGNAL(windowEmuPause()), mainWindow->actPause, SLOT(trigger()));
connect(this, SIGNAL(windowEmuReset()), mainWindow->actReset, SLOT(trigger()));
connect(this, SIGNAL(windowEmuFrameStep()), mainWindow->actFrameStep, SLOT(trigger()));
connect(this, SIGNAL(windowLimitFPSChange()), mainWindow->actLimitFramerate, SLOT(trigger()));
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panelWidget, SLOT(onScreenLayoutChanged()));
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panel, SLOT(onScreenLayoutChanged()));
connect(this, SIGNAL(windowFullscreenToggle()), mainWindow, SLOT(onFullscreenToggled()));
connect(this, SIGNAL(swapScreensToggle()), mainWindow->actScreenSwap, SLOT(trigger()));
connect(this, SIGNAL(screenEmphasisToggle()), mainWindow, SLOT(onScreenEmphasisToggled()));
Expand Down Expand Up @@ -386,19 +385,15 @@ void EmuThread::run()
int level = NDS->GBACartSlot.SetInput(GBACart::Input_SolarSensorDown, true);
if (level != -1)
{
char msg[64];
sprintf(msg, "Solar sensor level: %d", level);
OSD::AddMessage(0, msg);
mainWindow->osdAddMessage(0, "Solar sensor level: %d", level);
}
}
if (Input::HotkeyPressed(HK_SolarSensorIncrease))
{
int level = NDS->GBACartSlot.SetInput(GBACart::Input_SolarSensorUp, true);
if (level != -1)
{
char msg[64];
sprintf(msg, "Solar sensor level: %d", level);
OSD::AddMessage(0, msg);
mainWindow->osdAddMessage(0, "Solar sensor level: %d", level);
}
}

Expand Down Expand Up @@ -480,7 +475,7 @@ void EmuThread::run()
{
bool lid = !NDS->IsLidClosed();
NDS->SetLidClosed(lid);
OSD::AddMessage(0, lid ? "Lid closed" : "Lid opened");
mainWindow->osdAddMessage(0, lid ? "Lid closed" : "Lid opened");
}

// microphone input
Expand Down
Loading

0 comments on commit 345b743

Please sign in to comment.