From 72b198b752d4b05cda3be2f5fa8cd6532b3dd2b2 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 2 Dec 2012 07:55:59 +0100 Subject: WINTERMUTE: Reset renderTicket-system on SaveGame-load --- engines/wintermute/base/gfx/base_renderer.h | 2 +- engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 13 +++++++++++++ engines/wintermute/base/gfx/osystem/base_render_osystem.h | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'engines/wintermute') diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h index 0475824464..9027c66a14 100644 --- a/engines/wintermute/base/gfx/base_renderer.h +++ b/engines/wintermute/base/gfx/base_renderer.h @@ -179,7 +179,7 @@ public: void setIndicator(int width, int height, int x, int y, uint32 color); void persistSaveLoadImages(BasePersistenceManager *persistMgr); void initSaveLoad(bool isSaving, bool quickSave = false); - void endSaveLoad(); + virtual void endSaveLoad(); void setLoadingScreen(const char *filename, int x, int y); void setSaveImage(const char *filename, int x, int y); diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 074ea2b9a0..350fc2d87c 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -612,4 +612,17 @@ BaseSurface *BaseRenderOSystem::createSurface() { return new BaseSurfaceOSystem(_gameRef); } +void BaseRenderOSystem::endSaveLoad() { + BaseRenderer::endSaveLoad(); + + // Clear the scale-buffered tickets as we just loaded. + RenderQueueIterator it = _renderQueue.begin(); + while (it != _renderQueue.end()) { + RenderTicket *ticket = *it; + it = _renderQueue.erase(it); + delete ticket; + } + _drawNum = 1; +} + } // end of namespace Wintermute diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h index 1e72508cd0..0d52611b17 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h @@ -97,7 +97,7 @@ public: float getScaleRatioY() const { return _ratioY; } - + void endSaveLoad(); void drawSurface(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY, bool disableAlpha = false); BaseSurface *createSurface(); private: -- cgit v1.2.3