diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/m4/mads_menus.cpp | 8 | ||||
-rw-r--r-- | engines/m4/mads_menus.h | 2 | ||||
-rw-r--r-- | engines/m4/mads_scene.cpp | 2 | ||||
-rw-r--r-- | engines/m4/mads_scene.h | 4 | ||||
-rw-r--r-- | engines/m4/mads_views.cpp | 14 | ||||
-rw-r--r-- | engines/m4/mads_views.h | 9 | ||||
-rw-r--r-- | engines/m4/scene.cpp | 2 | ||||
-rw-r--r-- | engines/m4/scene.h | 4 |
8 files changed, 21 insertions, 24 deletions
diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp index d5fb0903eb..d3944e2ff4 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -586,7 +586,8 @@ void DragonMainMenuView::handleAction(MadsGameAction action) { *-------------------------------------------------------------------------- */ -RexDialogView::RexDialogView(): MadsView(_madsVm, Common::Rect(0, 0, _madsVm->_screen->width(), _madsVm->_screen->height())) { +RexDialogView::RexDialogView(): View(_madsVm, Common::Rect(0, 0, _madsVm->_screen->width(), _madsVm->_screen->height())), + MadsView(this) { _screenType = VIEWID_MENU; // Initialise class variables @@ -695,7 +696,10 @@ void RexDialogView::onRefresh(RectList *rects, M4Surface *destSurface) { // Check whether any of the dialog text entries need to be refreshed refreshText(); - MadsView::onRefresh(rects, destSurface); + // Handle the drawing of the various Mads elements + refresh(rects); + + View::onRefresh(rects, destSurface); } /** diff --git a/engines/m4/mads_menus.h b/engines/m4/mads_menus.h index 50528d3c6e..1e63cf8bab 100644 --- a/engines/m4/mads_menus.h +++ b/engines/m4/mads_menus.h @@ -112,7 +112,7 @@ public: enum MadsTextAlignment { ALIGN_CENTER = -1, ALIGN_CHAR_CENTER = -2, RIGHT_ALIGN = -3 }; -class RexDialogView : public MadsView { +class RexDialogView : public View, public MadsView { private: int _priorSceneId; diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 26acafa521..499ea880af 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -40,7 +40,7 @@ namespace M4 { -MadsScene::MadsScene(MadsEngine *vm): _sceneResources(), Scene(vm, &_sceneResources) { +MadsScene::MadsScene(MadsEngine *vm): _sceneResources(), Scene(vm, &_sceneResources), MadsView(this) { _vm = vm; _interfaceSurface = new MadsInterfaceView(vm); diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 06f039d4e2..775c2bf766 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -27,6 +27,8 @@ #define M4_MADS_SCENE_H #include "m4/scene.h" +#include "m4/mads_logic.h" +#include "m4/mads_views.h" namespace M4 { @@ -176,7 +178,7 @@ public: #define DIRTY_AREA_SIZE 90 -class MadsScene : public Scene { +class MadsScene : public Scene, public MadsView { private: MadsEngine *_vm; MadsSceneResources _sceneResources; diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index fdfbf16f9e..4e6dae7742 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -237,20 +237,12 @@ void ScreenObjects::setActive(int category, int idx, bool active) { //-------------------------------------------------------------------------- -MadsView::MadsView(MadsM4Engine *vm, const Common::Rect &viewBounds, bool transparent): View(vm, viewBounds, transparent) { -} - -MadsView::MadsView(MadsM4Engine *vm, int x, int y, bool transparent): View(vm, x, y, transparent) { -} - -void MadsView::onRefresh(RectList *rects, M4Surface *destSurface) { +void MadsView::refresh(RectList *rects) { // Draw any sprites - _spriteSlots.draw(this); + _spriteSlots.draw(_view); // Draw text elements onto the view - _textDisplay.draw(this); - - View::onRefresh(rects, destSurface); + _textDisplay.draw(_view); } /*-------------------------------------------------------------------------- diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h index bb151d7078..f1c23dc27b 100644 --- a/engines/m4/mads_views.h +++ b/engines/m4/mads_views.h @@ -154,16 +154,17 @@ public: -class MadsView: public View { +class MadsView { +private: + View *_view; public: MadsSpriteSlots _spriteSlots; MadsTextDisplay _textDisplay; ScreenObjects _screenObjects; public: - MadsView(MadsM4Engine *vm, const Common::Rect &viewBounds, bool transparent = false); - MadsView(MadsM4Engine *vm, int x = 0, int y = 0, bool transparent = false); + MadsView(View *view): _view(view) {} - void onRefresh(RectList *rects, M4Surface *destSurface); + void refresh(RectList *rects); }; #define CHEAT_SEQUENCE_MAX 8 diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp index 72e24767a9..15c68f276c 100644 --- a/engines/m4/scene.cpp +++ b/engines/m4/scene.cpp @@ -39,7 +39,7 @@ namespace M4 { -Scene::Scene(MadsM4Engine *vm, SceneResources *res): MadsView(vm, Common::Rect(0, 0, vm->_screen->width(), +Scene::Scene(MadsM4Engine *vm, SceneResources *res): View(vm, Common::Rect(0, 0, vm->_screen->width(), vm->_screen->height())), _sceneResources(res) { _screenType = VIEWID_SCENE; diff --git a/engines/m4/scene.h b/engines/m4/scene.h index e0a72fe848..633a34b549 100644 --- a/engines/m4/scene.h +++ b/engines/m4/scene.h @@ -35,8 +35,6 @@ class View; #include "m4/viewmgr.h" #include "m4/gui.h" #include "m4/m4_views.h" -#include "m4/mads_logic.h" -#include "m4/mads_views.h" #include "common/array.h" namespace M4 { @@ -76,7 +74,7 @@ class M4Engine; class MadsEngine; class InterfaceView; -class Scene : public MadsView { +class Scene : public View { private: HotSpotList _sceneHotspots; protected: |