diff options
author | Borja Lorente | 2016-07-29 12:05:46 +0200 |
---|---|---|
committer | Borja Lorente | 2016-07-31 14:05:14 +0200 |
commit | 9ce6fbd0d7faf05fcd62cd9a6ee953cdc63d53cf (patch) | |
tree | 51346d9522af9be38fa26c50561b6e9831997abc | |
parent | 1080f199957326261245da49bf0efe5059b17a18 (diff) | |
download | scummvm-rg350-9ce6fbd0d7faf05fcd62cd9a6ee953cdc63d53cf.tar.gz scummvm-rg350-9ce6fbd0d7faf05fcd62cd9a6ee953cdc63d53cf.tar.bz2 scummvm-rg350-9ce6fbd0d7faf05fcd62cd9a6ee953cdc63d53cf.zip |
GRAPHICS: Move MacMenu constants
-rw-r--r-- | engines/wage/design.cpp | 28 | ||||
-rw-r--r-- | engines/wage/design.h | 25 | ||||
-rw-r--r-- | engines/wage/gui.cpp | 4 | ||||
-rw-r--r-- | engines/wage/gui.h | 45 | ||||
-rw-r--r-- | engines/wage/world.cpp | 2 | ||||
-rw-r--r-- | engines/wage/world.h | 4 | ||||
-rw-r--r-- | graphics/macgui/macmenu.cpp | 19 | ||||
-rw-r--r-- | graphics/macgui/macmenu.h | 41 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 4 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.h | 10 |
10 files changed, 97 insertions, 85 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index a578a84f79..6255932f37 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -55,12 +55,12 @@ namespace Wage { struct PlotData { Graphics::ManagedSurface *surface; - Graphics::Patterns *patterns; + Graphics::MacPatterns *patterns; uint fillType; int thickness; Design *design; - PlotData(Graphics::ManagedSurface *s, Patterns *p, int f, int t, Design *d) : + PlotData(Graphics::ManagedSurface *s, Graphics::MacPatterns *p, int f, int t, Design *d) : surface(s), patterns(p), fillType(f), thickness(t), design(d) {} }; @@ -85,7 +85,7 @@ Design::~Design() { delete _surface; } -void Design::paint(Graphics::ManagedSurface *surface, Patterns &patterns, int x, int y) { +void Design::paint(Graphics::ManagedSurface *surface, Graphics::MacPatterns &patterns, int x, int y) { bool needRender = false; if (_surface == NULL) { @@ -141,7 +141,7 @@ void Design::paint(Graphics::ManagedSurface *surface, Patterns &patterns, int x, } } -void Design::render(Patterns &patterns) { +void Design::render(Graphics::MacPatterns &patterns) { Common::MemoryReadStream in(_data, _len); bool needRender = true; @@ -265,7 +265,7 @@ void drawPixelPlain(int x, int y, int color, void *data) { } void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); int16 y2 = in.readSint16BE(); @@ -294,7 +294,7 @@ void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, } void Design::drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); int16 y2 = in.readSint16BE(); @@ -320,7 +320,7 @@ void Design::drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream } void Design::drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { byte ignored = in.readSint16BE(); // ignored @@ -397,7 +397,7 @@ void Design::drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream & } void Design::drawOval(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); int16 y2 = in.readSint16BE(); @@ -501,11 +501,11 @@ void Design::drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadS tmp.free(); } -void Design::drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType) { drawRect(surface, rect.left, rect.top, rect.right, rect.bottom, thickness, color, patterns, fillType); } -void Design::drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawLine(x1, y1, x2, y1, kColorBlack, drawPixel, &pd); @@ -515,26 +515,26 @@ void Design::drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, } -void Design::drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType) { +void Design::drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Graphics::MacPatterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, 1, nullptr); for (int y = rect.top; y <= rect.bottom; y++) Graphics::drawHLine(rect.left, rect.right, y, color, drawPixel, &pd); } -void Design::drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType) { +void Design::drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Graphics::MacPatterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, 1, nullptr); Graphics::drawRoundRect(rect, arc, color, true, drawPixel, &pd); } -void Design::drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawHLine(x1, x2, y, color, drawPixel, &pd); } -void Design::drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawVLine(x, y1, y2, color, drawPixel, &pd); diff --git a/engines/wage/design.h b/engines/wage/design.h index 7a422a48f0..948476b43c 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -56,7 +56,6 @@ namespace Wage { using namespace Graphics::MacGUIConstants; -using Graphics::Patterns; class Design { public: @@ -71,14 +70,14 @@ public: return _bounds; } - void paint(Graphics::ManagedSurface *canvas, Graphics::Patterns &patterns, int x, int y); + void paint(Graphics::ManagedSurface *canvas, Graphics::MacPatterns &patterns, int x, int y); bool isPointOpaque(int x, int y); - static void drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Graphics::Patterns &patterns, byte fillType); - static void drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Graphics::Patterns &patterns, byte fillType); - static void drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Graphics::Patterns &patterns, byte fillType); - static void drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Graphics::Patterns &patterns, byte fillType); - static void drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Graphics::Patterns &patterns, byte fillType); - static void drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Graphics::Patterns &patterns, byte fillType); + static void drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType); + static void drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType); + static void drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Graphics::MacPatterns &patterns, byte fillType); + static void drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Graphics::MacPatterns &patterns, byte fillType); + static void drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType); + static void drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType); bool isBoundsCalculation() { return _boundsCalculationMode; } void adjustBounds(int16 x, int16 y); @@ -91,15 +90,15 @@ private: bool _boundsCalculationMode; private: - void render(Patterns &patterns); + void render(Graphics::MacPatterns &patterns); void drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType); void drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType); void drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType); void drawOval(Graphics::ManagedSurface *surface, Common::ReadStream &in, - Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); + Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType); void drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadStream &in); }; diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 49f56f3669..a8d22840d9 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -73,8 +73,8 @@ static const Graphics::MenuData menuSubItems[] = { { kMenuFile, "Quit", kMenuActionQuit, 0, true }, { kMenuEdit, "Undo", kMenuActionUndo, 'Z', false }, - { kMenuEdit, NULL, 0, 0, false }, - { kMenuEdit, "Cut", kMenuActionCut, 'K', false }, + { kMenuEdit, NULL, 0, 0, false }, + { kMenuEdit, "Cut", kMenuActionCut, 'K', false }, { kMenuEdit, "Copy", kMenuActionCopy, 'C', false }, { kMenuEdit, "Paste", kMenuActionPaste, 'V', false }, { kMenuEdit, "Clear", kMenuActionClear, 'B', false }, diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 8536a76fe1..cf30c577c1 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -59,12 +59,9 @@ #include "common/rect.h" namespace Wage { - -// Import the enum definitions -using namespace Graphics::MacMenuConstants; -using namespace Graphics::MacWindowConstants; -using namespace Graphics::MacGUIConstants; +using namespace Graphics::MacWindowConstants; + class Scene; class WageEngine; @@ -72,6 +69,44 @@ enum { kCursorHeight = 12 }; +enum { + kFontStyleBold = 1, + kFontStyleItalic = 2, + kFontStyleUnderline = 4, + kFontStyleOutline = 8, + kFontStyleShadow = 16, + kFontStyleCondensed = 32, + kFontStyleExtended = 64 +}; + +enum { + kMenuHighLevel = -1, + kMenuAbout = 0, + kMenuFile = 1, + kMenuEdit = 2, + kMenuCommands = 3, + kMenuWeapons = 4 +}; + +enum { + kMenuActionAbout, + kMenuActionNew, + kMenuActionOpen, + kMenuActionClose, + kMenuActionSave, + kMenuActionSaveAs, + kMenuActionRevert, + kMenuActionQuit, + + kMenuActionUndo, + kMenuActionCut, + kMenuActionCopy, + kMenuActionPaste, + kMenuActionClear, + + kMenuActionCommand +}; + class Gui { public: Gui(WageEngine *engine); diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 286ecddf4d..acc2a83d97 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -75,7 +75,7 @@ World::World(WageEngine *engine) { _engine = engine; - _patterns = new Patterns; + _patterns = new Graphics::MacPatterns; } World::~World() { diff --git a/engines/wage/world.h b/engines/wage/world.h index e0e044822c..5c1aaf319e 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -54,7 +54,7 @@ namespace Wage { // Import the enum definitions -using Graphics::Patterns; +using Graphics::MacPatterns; class Script; class Sound; @@ -92,7 +92,7 @@ public: ObjArray _orderedObjs; ChrArray _orderedChrs; Common::Array<Sound *> _orderedSounds; - Graphics::Patterns *_patterns; + Graphics::MacPatterns *_patterns; Scene *_storageScene; Chr *_player; int _signature; diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 3a4d624356..6169b3e3cd 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -66,6 +66,25 @@ enum { kMenuItemHeight = 20 }; +enum { + kMenuHighLevel = -1 +}; + +enum { + kFontStyleBold = 1, + kFontStyleItalic = 2, + kFontStyleUnderline = 4, + kFontStyleOutline = 8, + kFontStyleShadow = 16, + kFontStyleCondensed = 32, + kFontStyleExtended = 64 +}; + +enum { + kMenuActionCommand +}; + + struct MenuSubItem { Common::String text; int action; diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h index ce0b0ed8db..5c08f4feed 100644 --- a/graphics/macgui/macmenu.h +++ b/graphics/macgui/macmenu.h @@ -53,47 +53,6 @@ namespace Graphics { struct MenuItem; struct MenuSubItem; -namespace MacMenuConstants { - enum MacMenuFontStyle { - kFontStyleBold = 1, - kFontStyleItalic = 2, - kFontStyleUnderline = 4, - kFontStyleOutline = 8, - kFontStyleShadow = 16, - kFontStyleCondensed = 32, - kFontStyleExtended = 64 - }; - - enum MacMenuTab { - kMenuHighLevel = -1, - kMenuAbout = 0, - kMenuFile = 1, - kMenuEdit = 2, - kMenuCommands = 3, - kMenuWeapons = 4 - }; - - enum MacMenuAction { - kMenuActionAbout, - kMenuActionNew, - kMenuActionOpen, - kMenuActionClose, - kMenuActionSave, - kMenuActionSaveAs, - kMenuActionRevert, - kMenuActionQuit, - - kMenuActionUndo, - kMenuActionCut, - kMenuActionCopy, - kMenuActionPaste, - kMenuActionClear, - - kMenuActionCommand - }; -} -using namespace MacMenuConstants; - struct MenuData { int menunum; const char *title; diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 6c6e4282b7..3d4ef3bc71 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -186,11 +186,11 @@ void MacWindowManager::setActive(int id) { struct PlotData { Graphics::ManagedSurface *surface; - Patterns *patterns; + MacPatterns *patterns; uint fillType; int thickness; - PlotData(Graphics::ManagedSurface *s, Patterns *p, int f, int t) : + PlotData(Graphics::ManagedSurface *s, MacPatterns *p, int f, int t) : surface(s), patterns(p), fillType(f), thickness(t) {} }; diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index d5b817bdca..5be82e39a3 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -63,7 +63,7 @@ namespace MacGUIConstants { kDesktopArc = 7 }; - enum MacGUIColor { + enum { kColorBlack = 0, kColorGray = 1, kColorWhite = 2, @@ -71,7 +71,7 @@ namespace MacGUIConstants { kColorGreen2 = 4 }; - enum MacGUIPattern { + enum { kPatternSolid = 1, kPatternStripes = 2, kPatternCheckers = 3, @@ -84,7 +84,7 @@ class ManagedSurface; class Menu; -typedef Common::Array<byte *> Patterns; +typedef Common::Array<byte *> MacPatterns; class MacWindowManager { public: @@ -107,7 +107,7 @@ public: BaseMacWindow *getWindow(int id) { return _windows[id]; } - Patterns &getPatterns() { return _patterns; } + MacPatterns &getPatterns() { return _patterns; } void drawFilledRoundRect(ManagedSurface *surface, Common::Rect &rect, int arc, int color); void pushArrowCursor(); @@ -128,7 +128,7 @@ private: bool _fullRefresh; - Patterns _patterns; + MacPatterns _patterns; Menu *_menu; |