diff options
-rw-r--r-- | engines/avalanche/animation.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/animation.h | 2 | ||||
-rw-r--r-- | engines/avalanche/avalanche.h | 2 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 7 | ||||
-rw-r--r-- | engines/avalanche/avalot.h | 11 | ||||
-rw-r--r-- | engines/avalanche/dialogs.cpp | 6 | ||||
-rw-r--r-- | engines/avalanche/enums.h | 8 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 9 | ||||
-rw-r--r-- | engines/avalanche/menu.cpp | 12 | ||||
-rw-r--r-- | engines/avalanche/menu.h | 14 |
11 files changed, 45 insertions, 38 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 960705f17a..5d60a73d14 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -81,8 +81,8 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) { _info._yLength = inf.readByte(); _stat._seq = inf.readByte(); _info._size = inf.readUint16LE(); - _stat._fgBubbleCol = inf.readByte(); - _stat._bgBubbleCol = inf.readByte(); + _stat._fgBubbleCol = (Color)inf.readByte(); + _stat._bgBubbleCol = (Color)inf.readByte(); _stat._acciNum = inf.readByte(); _animCount = 0; // = 1; diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h index 1b616f9fae..591e955e8f 100644 --- a/engines/avalanche/animation.h +++ b/engines/avalanche/animation.h @@ -50,7 +50,7 @@ struct StatType { Common::String _comment; // Comment. byte _frameNum; // Number of pictures. byte _seq; // How many in one stride. - byte _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors. + Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors. byte _acciNum; // The number according to Acci. (1=Avvy, etc.) }; diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 91473e185a..212840ba3f 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -279,7 +279,7 @@ public: byte _thinks; bool _thinkThing; int16 _talkX, _talkY; - byte _talkBackgroundColor, _talkFontColor; + Color _talkBackgroundColor, _talkFontColor; byte _scrollBells; // no. of times to ring the bell bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll? char _objectList[10]; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index f77b54fc61..2bf5a93c57 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -201,7 +201,7 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so _oldMinute = _minute; } -void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) { +void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color) { if (angle > 900) { endPoint.x = 177; return; @@ -210,7 +210,7 @@ void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color); } -void Clock::drawHand(const Common::Point &endPoint, byte color) { +void Clock::drawHand(const Common::Point &endPoint, Color color) { if (endPoint.x == 177) return; @@ -522,7 +522,7 @@ void AvalancheEngine::loadAlso(byte num) { curLine->_y1 = file.readSint16LE(); curLine->_x2 = file.readSint16LE(); curLine->_y2 = file.readSint16LE(); - curLine->_color = file.readByte(); + curLine->_color = (Color)file.readByte(); } memset(_peds, 177, sizeof(_peds)); @@ -1483,6 +1483,7 @@ void AvalancheEngine::spriteRun() { _doingSpriteRun = false; } +// CHECKME: Unused function void AvalancheEngine::fixFlashers() { _ledStatus = 177; _animation->setOldDirection(kDirNone); diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h index af7ba2c71d..189b9cb488 100644 --- a/engines/avalanche/avalot.h +++ b/engines/avalanche/avalot.h @@ -57,8 +57,8 @@ private: uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle; Common::Point _clockHandHour, _clockHandMinute; - void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color); - void drawHand(const Common::Point &endPoint, byte color); + void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color); + void drawHand(const Common::Point &endPoint, Color color); void plotHands(); void chime(); }; @@ -92,13 +92,16 @@ struct ByteField { }; struct LineType : public FieldType { - byte _color; + Color _color; }; typedef int8 TuneType[31]; struct QuasipedType { - byte _whichPed, _foregroundColor, _room, _backgroundColor; + byte _whichPed; + Color _foregroundColor; + Room _room; + Color _backgroundColor; People _who; }; diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index a3cbd63c01..3970f68231 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -51,7 +51,7 @@ void Dialogs::setReadyLight(byte state) { // Sets "Ready" light to whatever if (_vm->_ledStatus == state) return; // Already like that! - byte color = kColorBlack; + Color color = kColorBlack; switch (state) { case 0: color = kColorBlack; @@ -621,8 +621,8 @@ void Dialogs::reset() { void Dialogs::setBubbleStateNatural() { _vm->_talkX = 320; _vm->_talkY = 200; - _vm->_talkBackgroundColor = 8; - _vm->_talkFontColor = 15; + _vm->_talkBackgroundColor = kColorDarkgray; + _vm->_talkFontColor = kColorWhite; } Common::String Dialogs::displayMoney() { diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h index c3c9a54480..a25b58e938 100644 --- a/engines/avalanche/enums.h +++ b/engines/avalanche/enums.h @@ -30,10 +30,10 @@ namespace Avalanche { enum Color { - kColorBlack, kColorBlue, kColorGreen, kColorCyan, kColorRed, - kColorMagenta, kColorBrown, kColorLightgray, kColorDarkgray, kColorLightblue, - kColorLightgreen, kColorLightcyan, kColorLightred, kColorLightmagenta, kColorYellow, - kColorWhite + kColorBlack = 0, kColorBlue, kColorGreen, kColorCyan, kColorRed, + kColorMagenta = 5, kColorBrown, kColorLightgray, kColorDarkgray, kColorLightblue, + kColorLightgreen = 10, kColorLightcyan, kColorLightred, kColorLightmagenta, kColorYellow, + kColorWhite = 15 }; // CHECKME: kRoomBossKey is a guess diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 643025fec7..bc0a83ab5b 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -76,7 +76,7 @@ void Graphics::fleshColors() { g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1); } -Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) { +Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) { Common::Point endPoint; const double pi = 3.14; const double convfac = pi / 180.0; @@ -162,12 +162,12 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, return endPoint; } -void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) { +void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) { while (radius > 0) drawArc(surface, x, y, stAngle, endAngle, radius--, color); } -void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color) { +void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color) { // Draw the borders with a marking color. _scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255); _scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255); @@ -204,7 +204,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte _scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color); } -void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) { +void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) { for (uint i = 0; i < text.size(); i++) { for (int j = 0; j < fontHeight; j++) { byte pixel = font[(byte)text[i]][j]; diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 4cf338bb3f..e83dbf6e72 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -32,6 +32,7 @@ #include "common/rect.h" #include "graphics/surface.h" +#include "avalanche/enums.h" namespace Avalanche { class AvalancheEngine; @@ -74,11 +75,11 @@ public: // Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc. // Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().) // TODO: Make it more accurate later. - Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color); + Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); - void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color); - void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color); - void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color); + void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); + void drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color); + void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color); // The caller has to .free() the returned Surfaces!!! // Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp index 7264cbcf19..81fb818025 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/menu.cpp @@ -103,11 +103,11 @@ void MenuItem::setupOption(Common::String title, char trigger, Common::String sh } void MenuItem::displayOption(byte y, bool highlit) { - byte backgroundColor; + Color backgroundColor; if (highlit) - backgroundColor = 0; + backgroundColor = kColorBlack; else - backgroundColor = 7; + backgroundColor = kColorLightgray; _dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor); Common::String text = _options[y]._title; @@ -290,8 +290,8 @@ void Menu::findWhatYouCanDoWithIt() { } void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) { - byte fontColor; - byte backgroundColor; + Color fontColor; + Color backgroundColor; if (highlighted) { fontColor = kColorWhite; backgroundColor = kColorBlack; @@ -339,7 +339,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo } void Menu::bleep() { - warning("STUB: Dropdown::bleep()"); + warning("STUB: Menu::bleep()"); } void Menu::parseKey(char r, char re) { diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h index e1d42055bb..815ff230e9 100644 --- a/engines/avalanche/menu.h +++ b/engines/avalanche/menu.h @@ -131,12 +131,14 @@ private: static const byte kIndent = 5; static const byte kSpacing = 10; - static const byte kMenuBackgroundColor = kColorLightgray; - static const byte kMenuFontColor = kColorBlack; - static const byte kMenuBorderColor = kColorBlack; - static const byte kHighlightBackgroundColor = kColorBlack; - static const byte kHighlightFontColor = kColorWhite; - static const byte kDisabledColor = kColorDarkgray; + static const Color kMenuBackgroundColor = kColorLightgray; + static const Color kMenuBorderColor = kColorBlack; + +// Checkme: Useless constants? +// static const Color kMenuFontColor = kColorBlack; +// static const Color kHighlightBackgroundColor = kColorBlack; +// static const Color kHighlightFontColor = kColorWhite; +// static const Color kDisabledColor = kColorDarkgray; bool _menuActive; // Kludge so we don't have to keep referring to the menu. |