From 8f9a75a9255fbccb8be3bbe6fc35aafec00a4260 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 24 May 2014 18:19:54 -0400 Subject: MADS: Add _sceneSurface subsurface, so sprite drawing is cropped correctly --- engines/mads/scene.cpp | 7 ++++++- engines/mads/scene.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index d589010194..944c082817 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -61,6 +61,11 @@ Scene::Scene(MADSEngine *vm): _vm(vm), _action(_vm), _depthSurface(vm), _paletteUsageF.push_back(PaletteUsage::UsageEntry(0xF)); + // Set up a scene surface that maps to our physical screen drawing surface + _sceneSurface.init(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT, MADS_SCREEN_WIDTH, + _vm->_screen.getPixels(), Graphics::PixelFormat::createFormatCLUT8()); + + // Set up the verb list _verbList.push_back(VerbInit(VERB_LOOK, VERB_THAT, PREP_NONE)); _verbList.push_back(VerbInit(VERB_TAKE, VERB_THAT, PREP_NONE)); _verbList.push_back(VerbInit(VERB_PUSH, VERB_THAT, PREP_NONE)); @@ -487,7 +492,7 @@ void Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) { // Draw sprites that have changed if (_vm->getGameID() == GType_RexNebular) // TODO: Implement for V2 games - _spriteSlots.drawSprites(&_vm->_screen); + _spriteSlots.drawSprites(&_sceneSurface); // Draw text elements onto the view _textDisplay.draw(&_vm->_screen); diff --git a/engines/mads/scene.h b/engines/mads/scene.h index 27fb901a25..7a01d7360a 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -84,6 +84,7 @@ protected: MADSEngine *_vm; public: SceneLogic *_sceneLogic; + MSurface _sceneSurface; int _priorSceneId; int _nextSceneId; int _currentSceneId; -- cgit v1.2.3