From 344290283a6eab4214e2963cf45e7e0fb4b91329 Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 10 Mar 2016 19:46:37 +0000 Subject: [PATCH] GPU: - The DidFrameBegin callback now reports whether frameskip was requested or not. --- desmume/src/GPU.cpp | 5 ++--- desmume/src/GPU.h | 4 ++-- desmume/src/cocoa/cocoa_GPU.mm | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index e056339ed..accee0106 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -3560,12 +3560,11 @@ void GPUEngineBase::_SpriteRenderPerform(const u16 lineIndex, u16 *__restrict ds } else if (objMode == OBJMode_Bitmap) //sprite is in BMP format { - srcadr = this->_SpriteAddressBMP(spriteInfo, sprSize, y); - //transparent (i think, dont bother to render?) if alpha is 0 if (spriteInfo.PaletteIndex == 0) continue; + srcadr = this->_SpriteAddressBMP(spriteInfo, sprSize, y); this->_RenderSpriteBMP(i, lineIndex, dst, srcadr, dst_alpha, typeTab, prioTab, prio, lg, sprX, x, xdir, spriteInfo.PaletteIndex); } else if (spriteInfo.PaletteMode == PaletteMode_1x256) //256 colors @@ -6187,7 +6186,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested) if (l == 0) { - this->_event->DidFrameBegin(); + this->_event->DidFrameBegin(isFrameSkipRequested); // Clear displays to black if they are turned off by the user. if (!isFrameSkipRequested) diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index 2bd3424f5..306f95af8 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -1467,7 +1467,7 @@ public: class GPUEventHandler { public: - virtual void DidFrameBegin() = 0; + virtual void DidFrameBegin(bool isFrameSkipRequested) = 0; virtual void DidFrameEnd(bool isFrameSkipped) = 0; virtual void DidRender3DBegin() = 0; virtual void DidRender3DEnd() = 0; @@ -1479,7 +1479,7 @@ public: class GPUEventHandlerDefault : public GPUEventHandler { public: - virtual void DidFrameBegin() {}; + virtual void DidFrameBegin(bool isFrameSkipRequested) {}; virtual void DidFrameEnd(bool isFrameSkipped) {}; virtual void DidRender3DBegin() {}; virtual void DidRender3DEnd() {}; diff --git a/desmume/src/cocoa/cocoa_GPU.mm b/desmume/src/cocoa/cocoa_GPU.mm index c727e038e..3a314e4c3 100644 --- a/desmume/src/cocoa/cocoa_GPU.mm +++ b/desmume/src/cocoa/cocoa_GPU.mm @@ -68,7 +68,7 @@ public: void SetOutputList(NSMutableArray *outputList, pthread_mutex_t *theMutex); bool GetRender3DNeedsFinish(); - virtual void DidFrameBegin(); + virtual void DidFrameBegin(bool isFrameSkipRequested); virtual void DidFrameEnd(bool isFrameSkipped); virtual void DidRender3DBegin(); virtual void DidRender3DEnd(); @@ -791,7 +791,7 @@ GPUEventHandlerOSX::~GPUEventHandlerOSX() pthread_mutex_destroy(&this->_mutex3DRender); } -void GPUEventHandlerOSX::DidFrameBegin() +void GPUEventHandlerOSX::DidFrameBegin(bool isFrameSkipRequested) { this->FramebufferLockWrite(); }