misc shit

This commit is contained in:
Arisotura 2024-10-31 22:37:46 +01:00
parent f3bd58f75e
commit 9c8f229fed
4 changed files with 12 additions and 12 deletions

View File

@ -41,7 +41,7 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent) : QDialog(parent), ui(
emuInstance = ((MainWindow*)parent)->getEmuInstance(); emuInstance = ((MainWindow*)parent)->getEmuInstance();
auto& cfg = emuInstance->getGlobalConfig(); auto& cfg = emuInstance->getGlobalConfig();
auto& instcfg = emuInstance->getLocalConfig(); auto& instcfg = emuInstance->getLocalConfig();
bool emuActive = emuInstance->getEmuThread()->emuIsActive(); bool emuActive = emuInstance->emuIsActive();
oldInterp = cfg.GetInt("Audio.Interpolation"); oldInterp = cfg.GetInt("Audio.Interpolation");
oldBitDepth = cfg.GetInt("Audio.BitDepth"); oldBitDepth = cfg.GetInt("Audio.BitDepth");

View File

@ -319,13 +319,13 @@ void EmuThread::run()
if (!useOpenGL) if (!useOpenGL)
{ {
FrontBufferLock.lock(); frontBufferLock.lock();
FrontBuffer = emuInstance->nds->GPU.FrontBuffer; frontBuffer = emuInstance->nds->GPU.FrontBuffer;
FrontBufferLock.unlock(); frontBufferLock.unlock();
} }
else else
{ {
FrontBuffer = emuInstance->nds->GPU.FrontBuffer; frontBuffer = emuInstance->nds->GPU.FrontBuffer;
emuInstance->drawScreenGL(); emuInstance->drawScreenGL();
} }

View File

@ -136,8 +136,8 @@ public:
void updateVideoSettings() { videoSettingsDirty = true; } void updateVideoSettings() { videoSettingsDirty = true; }
void updateVideoRenderer() { videoSettingsDirty = true; lastVideoRenderer = -1; } void updateVideoRenderer() { videoSettingsDirty = true; lastVideoRenderer = -1; }
int FrontBuffer = 0; int frontBuffer = 0;
QMutex FrontBufferLock; QMutex frontBufferLock;
signals: signals:
void windowUpdate(); void windowUpdate();

View File

@ -782,17 +782,17 @@ void ScreenPanelNative::paintEvent(QPaintEvent* event)
auto nds = emuInstance->getNDS(); auto nds = emuInstance->getNDS();
assert(nds != nullptr); assert(nds != nullptr);
emuThread->FrontBufferLock.lock(); emuThread->frontBufferLock.lock();
int frontbuf = emuThread->FrontBuffer; int frontbuf = emuThread->frontBuffer;
if (!nds->GPU.Framebuffer[frontbuf][0] || !nds->GPU.Framebuffer[frontbuf][1]) if (!nds->GPU.Framebuffer[frontbuf][0] || !nds->GPU.Framebuffer[frontbuf][1])
{ {
emuThread->FrontBufferLock.unlock(); emuThread->frontBufferLock.unlock();
return; return;
} }
memcpy(screen[0].scanLine(0), nds->GPU.Framebuffer[frontbuf][0].get(), 256 * 192 * 4); 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); 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); QRect screenrc(0, 0, 256, 192);
@ -1106,7 +1106,7 @@ void ScreenPanelGL::drawScreenGL()
glUseProgram(screenShaderProgram); glUseProgram(screenShaderProgram);
glUniform2f(screenShaderScreenSizeULoc, w / factor, h / factor); glUniform2f(screenShaderScreenSizeULoc, w / factor, h / factor);
int frontbuf = emuThread->FrontBuffer; int frontbuf = emuThread->frontBuffer;
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
#ifdef OGLRENDERER_ENABLED #ifdef OGLRENDERER_ENABLED