Skip to content

Commit

Permalink
misc shit
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Oct 31, 2024
1 parent f3bd58f commit 9c8f229
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/frontend/qt_sdl/AudioSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent) : QDialog(parent), ui(
emuInstance = ((MainWindow*)parent)->getEmuInstance();
auto& cfg = emuInstance->getGlobalConfig();
auto& instcfg = emuInstance->getLocalConfig();
bool emuActive = emuInstance->getEmuThread()->emuIsActive();
bool emuActive = emuInstance->emuIsActive();

oldInterp = cfg.GetInt("Audio.Interpolation");
oldBitDepth = cfg.GetInt("Audio.BitDepth");
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ void EmuThread::run()

if (!useOpenGL)
{
FrontBufferLock.lock();
FrontBuffer = emuInstance->nds->GPU.FrontBuffer;
FrontBufferLock.unlock();
frontBufferLock.lock();
frontBuffer = emuInstance->nds->GPU.FrontBuffer;
frontBufferLock.unlock();
}
else
{
FrontBuffer = emuInstance->nds->GPU.FrontBuffer;
frontBuffer = emuInstance->nds->GPU.FrontBuffer;
emuInstance->drawScreenGL();
}

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/qt_sdl/EmuThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class EmuThread : public QThread
void updateVideoSettings() { videoSettingsDirty = true; }
void updateVideoRenderer() { videoSettingsDirty = true; lastVideoRenderer = -1; }

int FrontBuffer = 0;
QMutex FrontBufferLock;
int frontBuffer = 0;
QMutex frontBufferLock;

signals:
void windowUpdate();
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/qt_sdl/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,17 +782,17 @@ void ScreenPanelNative::paintEvent(QPaintEvent* event)
auto nds = emuInstance->getNDS();

assert(nds != nullptr);
emuThread->FrontBufferLock.lock();
int frontbuf = emuThread->FrontBuffer;
emuThread->frontBufferLock.lock();
int frontbuf = emuThread->frontBuffer;
if (!nds->GPU.Framebuffer[frontbuf][0] || !nds->GPU.Framebuffer[frontbuf][1])
{
emuThread->FrontBufferLock.unlock();
emuThread->frontBufferLock.unlock();
return;
}

memcpy(screen[0].scanLine(0), nds->GPU.Framebuffer[frontbuf][0].get(), 256 * 192 * 4);
memcpy(screen[1].scanLine(0), nds->GPU.Framebuffer[frontbuf][1].get(), 256 * 192 * 4);
emuThread->FrontBufferLock.unlock();
emuThread->frontBufferLock.unlock();

QRect screenrc(0, 0, 256, 192);

Expand Down Expand Up @@ -1106,7 +1106,7 @@ void ScreenPanelGL::drawScreenGL()
glUseProgram(screenShaderProgram);
glUniform2f(screenShaderScreenSizeULoc, w / factor, h / factor);

int frontbuf = emuThread->FrontBuffer;
int frontbuf = emuThread->frontBuffer;
glActiveTexture(GL_TEXTURE0);

#ifdef OGLRENDERER_ENABLED
Expand Down

0 comments on commit 9c8f229

Please sign in to comment.