diff options
-rw-r--r-- | engines/wage/design.cpp | 4 | ||||
-rw-r--r-- | engines/wage/design.h | 3 | ||||
-rw-r--r-- | engines/wage/dialog.cpp | 1 | ||||
-rw-r--r-- | engines/wage/entities.cpp | 7 | ||||
-rw-r--r-- | engines/wage/gui.h | 10 | ||||
-rw-r--r-- | engines/wage/macmenu.cpp | 11 | ||||
-rw-r--r-- | engines/wage/macwindow.cpp | 1 | ||||
-rw-r--r-- | engines/wage/macwindow.h | 2 | ||||
-rw-r--r-- | engines/wage/macwindowmanager.cpp | 6 | ||||
-rw-r--r-- | engines/wage/macwindowmanager.h | 28 | ||||
-rw-r--r-- | engines/wage/wage.h | 10 | ||||
-rw-r--r-- | engines/wage/world.cpp | 12 | ||||
-rw-r--r-- | engines/wage/world.h | 4 |
13 files changed, 66 insertions, 33 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index e84cf2e89e..eda28df159 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -45,8 +45,10 @@ * */ +#include "graphics/managed_surface.h" #include "graphics/primitives.h" -#include "wage/wage.h" + +#include "wage/macwindowmanager.h" #include "wage/design.h" namespace Wage { diff --git a/engines/wage/design.h b/engines/wage/design.h index a6e0df4c40..9b0231ca96 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -48,10 +48,11 @@ #ifndef WAGE_DESIGN_H #define WAGE_DESIGN_H -#include "graphics/managed_surface.h" #include "common/memstream.h" #include "common/rect.h" +#include "wage/macwindowmanager.h" + namespace Wage { class Design { diff --git a/engines/wage/dialog.cpp b/engines/wage/dialog.cpp index 7a7ed37416..d9bb3e6a61 100644 --- a/engines/wage/dialog.cpp +++ b/engines/wage/dialog.cpp @@ -49,6 +49,7 @@ #include "common/events.h" #include "wage/wage.h" +#include "wage/macwindowmanager.h" #include "wage/design.h" #include "wage/gui.h" #include "wage/dialog.h" diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index d0a838f1e7..43ac6c8cc7 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -52,6 +52,7 @@ #include "wage/world.h" #include "common/memstream.h" +#include "graphics/managed_surface.h" namespace Wage { @@ -138,16 +139,16 @@ void Scene::paint(Graphics::ManagedSurface *surface, int x, int y) { Common::Rect r(x + 5, y + 5, _design->getBounds()->width() + x - 10, _design->getBounds()->height() + y - 10); surface->fillRect(r, kColorWhite); - _design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); + _design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y); for (ObjList::const_iterator it = _objs.begin(); it != _objs.end(); ++it) { debug(2, "paining Obj: %s, index: %d, type: %d", (*it)->_name.c_str(), (*it)->_index, (*it)->_type); - (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); + (*it)->_design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y); } for (ChrList::const_iterator it = _chrs.begin(); it != _chrs.end(); ++it) { debug(2, "paining Chr: %s", (*it)->_name.c_str()); - (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); + (*it)->_design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y); } } diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 5c3c281bc5..cba02bb32b 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -50,7 +50,6 @@ #include "common/str-array.h" #include "graphics/font.h" -#include "graphics/fontman.h" #include "graphics/managed_surface.h" #include "common/events.h" #include "common/rect.h" @@ -63,15 +62,6 @@ namespace Wage { class Menu; enum { - kMenuHeight = 20, - kMenuLeftMargin = 7, - kMenuSpacing = 13, - kMenuPadding = 16, - kMenuDropdownPadding = 14, - kMenuDropdownItemHeight = 16, - kMenuItemHeight = 20, - kDesktopArc = 7, - kComponentsPadding = 10, kCursorHeight = 12 }; diff --git a/engines/wage/macmenu.cpp b/engines/wage/macmenu.cpp index bc8718b179..5aecfb6a11 100644 --- a/engines/wage/macmenu.cpp +++ b/engines/wage/macmenu.cpp @@ -52,11 +52,22 @@ #include "wage/entities.h" #include "wage/design.h" #include "wage/gui.h" +#include "wage/macwindowmanager.h" #include "wage/macmenu.h" #include "wage/world.h" namespace Wage { +enum { + kMenuHeight = 20, + kMenuLeftMargin = 7, + kMenuSpacing = 13, + kMenuPadding = 16, + kMenuDropdownPadding = 14, + kMenuDropdownItemHeight = 16, + kMenuItemHeight = 20 +}; + struct MenuSubItem { Common::String text; int action; diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index c021836032..eece48e873 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -49,6 +49,7 @@ #include "common/events.h" #include "wage/wage.h" +#include "wage/macwindowmanager.h" #include "wage/gui.h" #include "wage/macwindow.h" diff --git a/engines/wage/macwindow.h b/engines/wage/macwindow.h index 8d2fda30c9..157a62ba8e 100644 --- a/engines/wage/macwindow.h +++ b/engines/wage/macwindow.h @@ -50,6 +50,8 @@ #include "graphics/managed_surface.h" +#include "wage/macwindowmanager.h" + namespace Wage { class MacWindowManager; diff --git a/engines/wage/macwindowmanager.cpp b/engines/wage/macwindowmanager.cpp index b70ebd24b8..f741d3f71e 100644 --- a/engines/wage/macwindowmanager.cpp +++ b/engines/wage/macwindowmanager.cpp @@ -56,11 +56,11 @@ #include "graphics/managed_surface.h" #include "graphics/palette.h" -#include "wage/wage.h" +//#include "wage/wage.h" #include "wage/design.h" -#include "wage/gui.h" -#include "wage/macwindow.h" +//#include "wage/gui.h" #include "wage/macwindowmanager.h" +#include "wage/macwindow.h" #include "wage/macmenu.h" namespace Wage { diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h index fe85f8e530..53db0d65d0 100644 --- a/engines/wage/macwindowmanager.h +++ b/engines/wage/macwindowmanager.h @@ -48,8 +48,33 @@ #ifndef WAGE_MACWINDOWMANAGER_H #define WAGE_MACWINDOWMANAGER_H +#include "common/array.h" +#include "common/list.h" +#include "common/events.h" +#include "common/archive.h" + +#include "graphics/fontman.h" + +namespace Graphics { +class ManagedSurface; +} + namespace Wage { +class Gui; // FIXME + +enum { + kDesktopArc = 7 +}; + +enum { + kColorBlack = 0, + kColorGray = 1, + kColorWhite = 2, + kColorGreen = 3, + kColorGreen2 = 4 +}; + enum { kPatternSolid = 1, kPatternStripes = 2, @@ -57,9 +82,12 @@ enum { kPatternCheckers2 = 4 }; +class BaseMacWindow; class MacWindow; class Menu; +typedef Common::Array<byte *> Patterns; + class MacWindowManager { public: MacWindowManager(); diff --git a/engines/wage/wage.h b/engines/wage/wage.h index 87009c2350..eb50a2e3dd 100644 --- a/engines/wage/wage.h +++ b/engines/wage/wage.h @@ -103,14 +103,6 @@ enum { // the current limitation is 32 debug levels (1 << 31 is the last one) }; -enum { - kColorBlack = 0, - kColorGray = 1, - kColorWhite = 2, - kColorGreen = 3, - kColorGreen2 = 4 -}; - Common::String readPascalString(Common::SeekableReadStream *in); Common::Rect *readRect(Common::SeekableReadStream *in); const char *getIndefiniteArticle(const Common::String &word); @@ -118,8 +110,6 @@ const char *prependGenderSpecificPronoun(int gender); const char *getGenderSpecificPronoun(int gender, bool capitalize); bool isStorageScene(const Common::String &name); -typedef Common::Array<byte *> Patterns; - class WageEngine : public Engine { friend class Dialog; public: diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 954a425b7b..53fc1b4742 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -73,6 +73,8 @@ World::World(WageEngine *engine) { _weaponMenuDisabled = true; _engine = engine; + + _patterns = new Patterns; } World::~World() { @@ -88,8 +90,10 @@ World::~World() { for (uint i = 0; i < _orderedScenes.size(); i++) delete _orderedScenes[i]; - for (uint i = 0; i < _patterns.size(); i++) - free(_patterns[i]); + for (uint i = 0; i < _patterns->size(); i++) + free(_patterns->operator[](i)); + + delete _patterns; delete _globalScript; @@ -261,7 +265,7 @@ bool World::loadWorld(Common::MacResManager *resMan) { byte *pattern = (byte *)malloc(8); res->read(pattern, 8); - _patterns.push_back(pattern); + _patterns->push_back(pattern); } delete res; @@ -274,7 +278,7 @@ bool World::loadWorld(Common::MacResManager *resMan) { byte *pattern = (byte *)malloc(8); res->read(pattern, 8); - _patterns.push_back(pattern); + _patterns->push_back(pattern); } } delete res; diff --git a/engines/wage/world.h b/engines/wage/world.h index 355d660c8d..468bedbc59 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -48,6 +48,8 @@ #ifndef WAGE_WORLD_H #define WAGE_WORLD_H +#include "wage/macwindowmanager.h" + namespace Wage { class Sound; @@ -85,7 +87,7 @@ public: ObjArray _orderedObjs; ChrArray _orderedChrs; Common::Array<Sound *> _orderedSounds; - Patterns _patterns; + Patterns *_patterns; Scene *_storageScene; Chr *_player; //List<MoveListener> moveListeners; |