diff options
author | Matthew Hoops | 2011-05-11 00:30:02 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-11 00:30:28 -0400 |
commit | a1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch) | |
tree | 8c51419daa486f1d4833757db4715dadab6c3497 /engines/lure | |
parent | accb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff) | |
parent | 33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff) | |
download | scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2 scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip |
Merge remote branch 'upstream/master' into t7g-ios
Conflicts:
audio/decoders/qdm2.h
common/util.cpp
engines/groovie/music.cpp
engines/groovie/resource.h
video/qt_decoder.cpp
video/qt_decoder.h
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/debugger.cpp | 4 | ||||
-rw-r--r-- | engines/lure/decode.cpp | 6 | ||||
-rw-r--r-- | engines/lure/disk.h | 2 | ||||
-rw-r--r-- | engines/lure/fights.cpp | 6 | ||||
-rw-r--r-- | engines/lure/hotspots.cpp | 28 | ||||
-rw-r--r-- | engines/lure/hotspots.h | 6 | ||||
-rw-r--r-- | engines/lure/lure.h | 2 | ||||
-rw-r--r-- | engines/lure/luredefs.h | 14 | ||||
-rw-r--r-- | engines/lure/memory.cpp | 1 | ||||
-rw-r--r-- | engines/lure/menu.cpp | 36 | ||||
-rw-r--r-- | engines/lure/palette.cpp | 4 | ||||
-rw-r--r-- | engines/lure/res.cpp | 2 | ||||
-rw-r--r-- | engines/lure/res_struct.cpp | 2 | ||||
-rw-r--r-- | engines/lure/res_struct.h | 6 | ||||
-rw-r--r-- | engines/lure/room.cpp | 6 | ||||
-rw-r--r-- | engines/lure/screen.cpp | 8 | ||||
-rw-r--r-- | engines/lure/sound.h | 1 | ||||
-rw-r--r-- | engines/lure/surface.cpp | 88 | ||||
-rw-r--r-- | engines/lure/surface.h | 16 |
19 files changed, 122 insertions, 116 deletions
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index 9b1bb743e4..fc2029c6c4 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -312,7 +312,7 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) { hs->width, hs->height, hs->widthCopy, hs->heightCopy, hs->yCorrection); DebugPrintf("Talk bubble offset = %d,%d\n", hs->talkX, hs->talkY); DebugPrintf("load offset = %xh, script load = %d\n", hs->loadOffset, hs->scriptLoadFlag); - DebugPrintf("Animation Id = %xh, Colour offset = %d\n", hs->animRecordId, hs->colourOffset); + DebugPrintf("Animation Id = %xh, Color offset = %d\n", hs->animRecordId, hs->colorOffset); DebugPrintf("Talk Script offset = %xh, Tick Script offset = %xh\n", hs->talkScriptOffset, hs->tickScriptOffset); DebugPrintf("Tick Proc offset = %xh\n", hs->tickProcId); @@ -543,7 +543,7 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) { hotspot->setSize(width, height); Hotspot *player = res.activateHotspot(PLAYER_ID); - hotspot->setColourOffset(player->resource()->colourOffset); + hotspot->setColorOffset(player->resource()->colorOffset); hotspot->setAnimation(animId); diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp index ae91cc1c52..5ffdcf1884 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -111,7 +111,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { dataPos += sizeof(uint16); int bitCtr = 8; - // Decode the colour popularity table + // Decode the color popularity table for (int nibbleCtr = 0; nibbleCtr < 32; ++nibbleCtr) { for (int byteCtr = 0; byteCtr < 128; byteCtr += 32) { @@ -134,7 +134,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { READ_BIT_DX if (!bitFlag) { - // Get the favourite colour + // Get the favourite color v = popTable[tableOffset]; } else { @@ -182,7 +182,7 @@ MemoryBlock *PictureDecoder::egaDecode(MemoryBlock *src, uint32 maxOutputSize) { continue; } else { - // It's a new colour + // It's a new color v = al; } diff --git a/engines/lure/disk.h b/engines/lure/disk.h index d2848cc587..79aaf80bbc 100644 --- a/engines/lure/disk.h +++ b/engines/lure/disk.h @@ -33,7 +33,7 @@ #include "lure/res_struct.h" namespace Common { - class File; +class File; } namespace Lure { diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 789c9d924e..983033281a 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -74,7 +74,7 @@ void FightsManager::setupPigFight() { Resources &res = Resources::getReference(); Hotspot *player = res.getActiveHotspot(PLAYER_ID); player->setSkipFlag(false); - player->resource()->colourOffset = 16; + player->resource()->colorOffset = 16; player->setTickProc(PLAYER_FIGHT_TICK_PROC_ID); player->setSize(48, 53); player->setAnimationIndex(PLAYER_FIGHT_ANIM_INDEX); @@ -103,7 +103,7 @@ void FightsManager::setupSkorlFight() { rec.fwtrue_x = 282; rec.fwtrue_y = 136; player->setPosition(282, 136); - player->resource()->colourOffset = 96; + player->resource()->colorOffset = 96; } bool FightsManager::isFighting() { @@ -598,7 +598,7 @@ void FightsManager::enemyKilled() { playerHotspot->setTickProc(PLAYER_TICK_PROC_ID); playerRec.fwhits = GENERAL_MAGIC_ID; - playerHotspot->resource()->colourOffset = 128; + playerHotspot->resource()->colorOffset = 128; playerHotspot->setSize(32, 48); playerHotspot->resource()->width = 32; playerHotspot->resource()->height = 48; diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index bce98b28fd..5644ef798c 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -73,7 +73,7 @@ Hotspot::Hotspot(HotspotData *res): _pathFinder(this) { _hotspotScriptOffset = res->hotspotScriptOffset; _frameCtr = res->tickTimeout; _tempDest.counter = 0; - _colourOffset = isEGA ? 0 : res->colourOffset; + _colorOffset = isEGA ? 0 : res->colorOffset; _override = resources.getHotspotOverride(res->hotspotId); setAnimation(_data->animRecordId); @@ -103,7 +103,7 @@ Hotspot::Hotspot(Hotspot *character, uint16 objType): _pathFinder(this) { _persistant = false; _hotspotId = 0xffff; _override = NULL; - _colourOffset = 0; + _colorOffset = 0; _destHotspotId = character->hotspotId(); _blockedOffset = 0; _exitCtr = 0; @@ -174,7 +174,7 @@ Hotspot::Hotspot(): _pathFinder(NULL) { _persistant = false; _hotspotId = 0xffff; _override = NULL; - _colourOffset = 0; + _colorOffset = 0; _destHotspotId = 0; _blockedOffset = 0; _exitCtr = 0; @@ -303,7 +303,7 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { _frames = new Surface(_width * _numFrames, _height); _frameStartsUsed = false; } - _frames->data().setBytes(_colourOffset, 0, _frames->data().size()); + _frames->data().setBytes(_colorOffset, 0, _frames->data().size()); byte *pSrc = dest->data() + 0x40; byte *pDest; @@ -353,13 +353,13 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { xStart = frameNumCtr * _width; } - // Copy over the frame, applying the colour offset to each nibble + // Copy over the frame, applying the color offset to each nibble for (uint16 yPos = 0; yPos < tempHeight; ++yPos) { pDest = mDest.data() + yPos * _frames->width() + xStart; for (uint16 xPos = 0; xPos < tempWidth / 2; ++xPos) { - *pDest++ = _colourOffset + (*pSrc >> 4); - *pDest++ = _colourOffset + (*pSrc & 0xf); + *pDest++ = _colorOffset + (*pSrc >> 4); + *pDest++ = _colorOffset + (*pSrc & 0xf); ++pSrc; } } @@ -421,7 +421,7 @@ void Hotspot::copyTo(Surface *dest) { if ((r.top >= r.bottom) || (r.left >= r.right)) return; - _frames->copyTo(dest, r, (uint16) xPos, (uint16) yPos, _colourOffset); + _frames->copyTo(dest, r, (uint16) xPos, (uint16) yPos, _colorOffset); } void Hotspot::incFrameNumber() { @@ -2313,7 +2313,7 @@ void Hotspot::saveToStream(Common::WriteStream *stream) { stream->writeUint16LE(_talkY); stream->writeByte(_layer); stream->writeUint16LE(_hotspotScriptOffset); - stream->writeByte(_colourOffset); + stream->writeByte(_colorOffset); stream->writeByte((byte)_direction); stream->writeUint16LE(_animId); stream->writeUint16LE(_frameNumber); @@ -2358,7 +2358,7 @@ void Hotspot::loadFromStream(Common::ReadStream *stream) { _talkY = stream->readUint16LE(); _layer = stream->readByte(); _hotspotScriptOffset = stream->readUint16LE(); - _colourOffset = stream->readByte(); + _colorOffset = stream->readByte(); _direction = (Direction)stream->readByte(); setAnimation(stream->readUint16LE()); setFrameNumber(stream->readUint16LE()); @@ -3505,10 +3505,10 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) { screen.screen().fillRect(r, 0); // Display line - byte colour = LureEngine::getReference().isEGA() ? - ((lineNum + 1 == selectedLine) ? EGA_DIALOG_WHITE_COLOUR : EGA_DIALOG_TEXT_COLOUR) : - ((lineNum + 1 == selectedLine) ? VGA_DIALOG_WHITE_COLOUR : VGA_DIALOG_TEXT_COLOUR); - screen.screen().writeString(r.left, r.top, buffer, false, colour); + byte color = LureEngine::getReference().isEGA() ? + ((lineNum + 1 == selectedLine) ? EGA_DIALOG_WHITE_COLOR : EGA_DIALOG_TEXT_COLOR) : + ((lineNum + 1 == selectedLine) ? VGA_DIALOG_WHITE_COLOR : VGA_DIALOG_TEXT_COLOR); + screen.screen().writeString(r.left, r.top, buffer, false, color); } if (mouse.mButton() || mouse.rButton()) { diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index 2ae2e91ecf..e9f5d56edd 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -203,7 +203,7 @@ private: Direction _direction; uint8 _layer; uint16 _hotspotScriptOffset; - uint8 _colourOffset; + uint8 _colorOffset; bool _persistant; HotspotOverrideData *_override; bool _skipFlag; @@ -324,8 +324,8 @@ public: void setTickProc(uint16 newVal); bool persistant() { return _persistant; } void setPersistant(bool value) { _persistant = value; } - uint8 colourOffset() { return _colourOffset; } - void setColourOffset(uint8 value) { _colourOffset = value; } + uint8 colorOffset() { return _colorOffset; } + void setColorOffset(uint8 value) { _colorOffset = value; } void setRoomNumber(uint16 roomNum) { _roomNumber = roomNum; if (_data) _data->roomNumber = roomNum; diff --git a/engines/lure/lure.h b/engines/lure/lure.h index 99e9e3d93e..52b785a09a 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -98,7 +98,7 @@ public: virtual Common::Error run() { Common::Error err; err = init(); - if (err != Common::kNoError) + if (err.getCode() != Common::kNoError) return err; return go(); } diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index b13c4a0724..0ef7a73b7e 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -111,7 +111,7 @@ enum Action { // Basic game dimensions #define FULL_SCREEN_WIDTH 320 #define FULL_SCREEN_HEIGHT 200 -#define GAME_COLOURS 256 +#define GAME_COLORS 256 #define SCREEN_SIZE (FULL_SCREEN_HEIGHT * FULL_SCREEN_WIDTH) // Some resources include multiple packed palettes of 64 entries each @@ -120,7 +120,7 @@ enum Action { #define RES_PALETTE_ENTRIES 220 // Main working palette size #define MAIN_PALETTE_SIZE 228 -// Palette colour increment amouns for palette fade in/outs +// Palette color increment amouns for palette fade in/outs #define PALETTE_FADE_INC_SIZE 4 // EGA constants @@ -189,11 +189,11 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, #define POPMENU_CHANGE_SENSITIVITY 5 // Dialog related defines -#define EGA_DIALOG_TEXT_COLOUR 6 -#define EGA_DIALOG_WHITE_COLOUR 2 -#define VGA_DIALOG_TEXT_COLOUR 0xe2 -#define VGA_DIALOG_WHITE_COLOUR 0xe3 -#define EGA_DIALOG_BG_COLOUR 13 +#define EGA_DIALOG_TEXT_COLOR 6 +#define EGA_DIALOG_WHITE_COLOR 2 +#define VGA_DIALOG_TEXT_COLOR 0xe2 +#define VGA_DIALOG_WHITE_COLOR 0xe3 +#define EGA_DIALOG_BG_COLOR 13 #define INFO_DIALOG_X 69 #define INFO_DIALOG_Y 61 #define INFO_DIALOG_WIDTH 191 diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index f96b5015bc..d3d5067cce 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -25,6 +25,7 @@ #include "lure/memory.h" #include "common/file.h" +#include "common/textconsole.h" namespace Lure { diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 7d0816ee79..f9a78d8fc8 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -34,7 +34,7 @@ #include "lure/events.h" #include "lure/lure.h" -#if defined(_WIN32_WCE) || defined(__SYMBIAN32__) +#if defined(_WIN32_WCE) || defined(__SYMBIAN32__) || defined(WEBOS) #define LURE_CLICKABLE_MENUS #endif @@ -153,7 +153,7 @@ uint8 Menu::execute() { toggleHighlight(_selectedMenu); _surfaceMenu = Surface::newDialog( _selectedMenu->width(), _selectedMenu->numEntries(), - _selectedMenu->entries(), false, DEFAULT_TEXT_COLOUR, false); + _selectedMenu->entries(), false, DEFAULT_TEXT_COLOR, false); _surfaceMenu->copyToScreen(_selectedMenu->xstart(), MENUBAR_Y_SIZE); } @@ -230,26 +230,26 @@ uint8 Menu::getIndexAt(uint16 x, uint16 y) { return index; } -#define MENUBAR_SELECTED_COLOUR 0xf7 +#define MENUBAR_SELECTED_COLOR 0xf7 void Menu::toggleHighlight(MenuRecord *menuRec) { - const byte colourList[4] = {4, 2, 0, 0xf7}; - const byte *colours = LureEngine::getReference().isEGA() ? &colourList[0] : &colourList[2]; + const byte colorList[4] = {4, 2, 0, 0xf7}; + const byte *colors = LureEngine::getReference().isEGA() ? &colorList[0] : &colorList[2]; byte *addr = _menu->data(); for (uint16 y=0; y<MENUBAR_Y_SIZE; ++y) { for (uint16 x=menuRec->hsxstart(); x<=menuRec->hsxend(); ++x) { - if (addr[x] == colours[0]) addr[x] = colours[1]; - else if (addr[x] == colours[1]) addr[x] = colours[0]; + if (addr[x] == colors[0]) addr[x] = colors[1]; + else if (addr[x] == colors[1]) addr[x] = colors[0]; } addr += FULL_SCREEN_WIDTH; } } void Menu::toggleHighlightItem(uint8 index) { - const byte colourList[4] = {EGA_DIALOG_TEXT_COLOUR, EGA_DIALOG_WHITE_COLOUR, - VGA_DIALOG_TEXT_COLOUR, VGA_DIALOG_WHITE_COLOUR}; - const byte *colours = LureEngine::getReference().isEGA() ? &colourList[0] : &colourList[2]; + const byte colorList[4] = {EGA_DIALOG_TEXT_COLOR, EGA_DIALOG_WHITE_COLOR, + VGA_DIALOG_TEXT_COLOR, VGA_DIALOG_WHITE_COLOR}; + const byte *colors = LureEngine::getReference().isEGA() ? &colorList[0] : &colorList[2]; byte *p = _surfaceMenu->data().data() + (Surface::textY() + ((index - 1) * FONT_HEIGHT)) * _surfaceMenu->width() + Surface::textX(); int numBytes =_surfaceMenu->width() - Surface::textX() * 2; @@ -258,8 +258,8 @@ void Menu::toggleHighlightItem(uint8 index) { byte *pTemp = p; for (int x = 0; x < numBytes; ++x, ++pTemp) { - if (*pTemp == colours[0]) *pTemp = colours[1]; - else if (*pTemp == colours[1]) *pTemp = colours[0]; + if (*pTemp == colors[0]) *pTemp = colors[1]; + else if (*pTemp == colors[1]) *pTemp = colors[0]; } } @@ -475,9 +475,9 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) { Screen &screen = Screen::getReference(); Common::Rect r; bool isEGA = LureEngine::getReference().isEGA(); - byte bgColour = isEGA ? EGA_DIALOG_BG_COLOUR : 0; - byte textColour = isEGA ? EGA_DIALOG_TEXT_COLOUR : VGA_DIALOG_TEXT_COLOUR; - byte whiteColour = isEGA ? EGA_DIALOG_WHITE_COLOUR : VGA_DIALOG_WHITE_COLOUR; + byte bgColor = isEGA ? EGA_DIALOG_BG_COLOR : 0; + byte textColor = isEGA ? EGA_DIALOG_TEXT_COLOR : VGA_DIALOG_TEXT_COLOR; + byte whiteColor = isEGA ? EGA_DIALOG_WHITE_COLOR : VGA_DIALOG_WHITE_COLOR; const uint16 yMiddle = FULL_SCREEN_HEIGHT / 2; @@ -521,7 +521,7 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) { for (;;) { if (refreshFlag) { // Set up the contents of the menu - s->fillRect(r, bgColour); + s->fillRect(r, bgColor); for (int index = 0; index < numLines; ++index) { #ifndef LURE_CLICKABLE_MENUS @@ -533,9 +533,9 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) { s->writeString(Surface::textX(), Surface::textY() + index * FONT_HEIGHT, actions[actionIndex], true, #ifndef LURE_CLICKABLE_MENUS - (index == (numLines / 2)) ? whiteColour : textColour, + (index == (numLines / 2)) ? whiteColor : textColor, #else - (index == selectedIndex) ? whiteColour : textColour, + (index == selectedIndex) ? whiteColor : textColor, #endif false); } diff --git a/engines/lure/palette.cpp b/engines/lure/palette.cpp index d77f64f00a..b08ca64dfb 100644 --- a/engines/lure/palette.cpp +++ b/engines/lure/palette.cpp @@ -33,7 +33,7 @@ namespace Lure { // Defaults the palette to a full 256 entry palette Palette::Palette() { - _numEntries = GAME_COLOURS; + _numEntries = GAME_COLORS; _palette = Memory::allocate(_numEntries * 4); _palette->empty(); } @@ -91,7 +91,7 @@ Palette::Palette(uint16 resourceId, PaletteSource paletteSource) { break; case RGB64: - if (((srcData->size() % 3) != 0) || ((srcData->size() / 3) > GAME_COLOURS)) + if (((srcData->size() % 3) != 0) || ((srcData->size() / 3) > GAME_COLORS)) error("Specified resource %d is not a palette", resourceId); _numEntries = srcData->size() / 3; diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 90c2b67b85..01b0bd0d4a 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -432,7 +432,7 @@ byte *Resources::getCursor(uint8 cursorNum) { } } - // Post-process the cells to adjust the colour + // Post-process the cells to adjust the color for (int index = 0; index < CURSOR_SIZE; ++index) { if (_cursor[index] == 3) _cursor[index] = 15; } diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index f6a2092ddc..39beb2729e 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -406,7 +406,7 @@ HotspotData::HotspotData(HotspotResource *rec) { walkY = READ_LE_UINT16(&rec->walkY); talkX = rec->talkX; talkY = rec->talkY; - colourOffset = READ_LE_UINT16(&rec->colourOffset); + colorOffset = READ_LE_UINT16(&rec->colorOffset); animRecordId = READ_LE_UINT16(&rec->animRecordId); hotspotScriptOffset = READ_LE_UINT16(&rec->hotspotScriptOffset); talkScriptOffset = READ_LE_UINT16(&rec->talkScriptOffset); diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index e4b8c02f6a..58ee3f4c02 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -27,9 +27,11 @@ #define LURE_RESSTRUCT_H #include "lure/luredefs.h" +#include "common/rect.h" #include "common/list.h" #include "common/file.h" #include "common/ptr.h" +#include "common/textconsole.h" namespace Lure { @@ -88,7 +90,7 @@ struct HotspotResource { uint16 walkY; int8 talkX; int8 talkY; - uint16 colourOffset; + uint16 colorOffset; uint16 animRecordId; uint16 hotspotScriptOffset; uint16 talkScriptOffset; @@ -538,7 +540,7 @@ public: uint16 walkY; int8 talkX; int8 talkY; - uint16 colourOffset; + uint16 colorOffset; uint16 animRecordId; uint16 hotspotScriptOffset; uint16 talkScriptOffset; diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 746d6ef094..4cefe1fabb 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -432,7 +432,7 @@ void Room::update() { Surface &s = _screen.screen(); Resources &res = Resources::getReference(); HotspotList &hotspots = res.activeHotspots(); - byte white = LureEngine::getReference().isEGA() ? EGA_DIALOG_WHITE_COLOUR : VGA_DIALOG_WHITE_COLOUR; + byte white = LureEngine::getReference().isEGA() ? EGA_DIALOG_WHITE_COLOR : VGA_DIALOG_WHITE_COLOR; HotspotList::iterator i; // Copy the background to the temporary screen surface @@ -564,9 +564,9 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { if (isEGA) _screen.setPaletteEmpty(); else - // Fade out all the colours except the high index 0FFh, which is used to show the + // Fade out all the colors except the high index 0FFh, which is used to show the // disk cursor as a room changes - _screen.paletteFadeOut(GAME_COLOURS - 1); + _screen.paletteFadeOut(GAME_COLORS - 1); // Deallocate graphical layers from the room for (int layerNum = 0; layerNum < _numLayers; ++layerNum) { diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp index 282e382bba..e02f492ef2 100644 --- a/engines/lure/screen.cpp +++ b/engines/lure/screen.cpp @@ -30,6 +30,8 @@ #include "lure/decode.h" #include "lure/events.h" +#include "graphics/palette.h" + namespace Lure { static Screen *int_disk = NULL; @@ -44,7 +46,7 @@ Screen::Screen(OSystem &system): _system(system), _palette(new Palette(GAME_PALETTE_RESOURCE_ID, RGB64)) { int_disk = this; _screen->empty(); - _system.getPaletteManager()->setPalette(_palette->data(), 0, GAME_COLOURS); + _system.getPaletteManager()->setPalette(_palette->data(), 0, GAME_COLORS); } Screen::~Screen() { @@ -87,7 +89,7 @@ void Screen::setPaletteEmpty(int numEntries) { void Screen::setPalette(Palette *p) { _palette->copyFrom(p); - setSystemPalette(_palette, 0, GAME_COLOURS); + setSystemPalette(_palette, 0, GAME_COLORS); _system.updateScreen(); } @@ -138,7 +140,7 @@ void Screen::paletteFadeIn(Palette *p) { } // paletteFadeOut -// Fades the screen to black by gradually decreasing the palette colours +// Fades the screen to black by gradually decreasing the palette colors void Screen::paletteFadeOut(int numEntries) { assert((uint32)numEntries <= _palette->palette()->size()); diff --git a/engines/lure/sound.h b/engines/lure/sound.h index dd5538085c..7a894d814d 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -30,6 +30,7 @@ #include "lure/disk.h" #include "lure/memory.h" +#include "common/mutex.h" #include "common/singleton.h" #include "common/ptr.h" #include "audio/mididrv.h" diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index c4ee0f7dad..783401fde2 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -123,21 +123,21 @@ void Surface::getDialogBounds(Common::Point &size, int charWidth, int numLines, // Forms a dialog encompassing the entire surface void Surface::egaCreateDialog(bool blackFlag) { - byte lineColours1[3] = {6, 0, 9}; - byte lineColours2[3] = {7, 0, 12}; + byte lineColors1[3] = {6, 0, 9}; + byte lineColors2[3] = {7, 0, 12}; // Surface contents - data().setBytes(blackFlag ? 0 : EGA_DIALOG_BG_COLOUR, 0, data().size()); + data().setBytes(blackFlag ? 0 : EGA_DIALOG_BG_COLOR, 0, data().size()); // Top/bottom lines for (int y = 2; y >= 0; --y) { - data().setBytes(lineColours1[y], y * width(), width()); - data().setBytes(lineColours2[y], (height() - y - 1) * width(), width()); + data().setBytes(lineColors1[y], y * width(), width()); + data().setBytes(lineColors2[y], (height() - y - 1) * width(), width()); for (int p = y + 1; p < height() - y; ++p) { byte *line = data().data() + p * width(); - *(line + y) = lineColours2[y]; - *(line + width() - y - 1) = lineColours1[y]; + *(line + y) = lineColors2[y]; + *(line + width() - y - 1) = lineColors1[y]; } } } @@ -220,10 +220,10 @@ void Surface::loadScreen(MemoryBlock *rawData) { delete tmpScreen; } -int Surface::writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int colour) { +int Surface::writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int color) { byte *const addr = _data->data() + (y * _width) + x; - if (colour == DEFAULT_TEXT_COLOUR) - colour = LureEngine::getReference().isEGA() ? EGA_DIALOG_TEXT_COLOUR : VGA_DIALOG_TEXT_COLOUR; + if (color == DEFAULT_TEXT_COLOR) + color = LureEngine::getReference().isEGA() ? EGA_DIALOG_TEXT_COLOR : VGA_DIALOG_TEXT_COLOR; if ((ascii < 32) || (ascii >= 32 + numFontChars)) error("Invalid ascii character passed for display '%d'", ascii); @@ -239,7 +239,7 @@ int Surface::writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int co for (int x1 = 0; x1 < 8; ++x1, ++pDest) { if (v & 0x80) { - *pDest = colour; + *pDest = color; if (x1+1 > charWidth) charWidth = x1 + 1; } else if (!transparent) *pDest = 0; @@ -251,16 +251,16 @@ int Surface::writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int co } void Surface::writeString(uint16 x, uint16 y, Common::String line, bool transparent, - int colour, bool varLength) { - writeSubstring(x, y, line, line.size(), transparent, colour, varLength); + int color, bool varLength) { + writeSubstring(x, y, line, line.size(), transparent, color, varLength); } void Surface::writeSubstring(uint16 x, uint16 y, Common::String line, int len, - bool transparent, int colour, bool varLength) { + bool transparent, int color, bool varLength) { const char *sPtr = line.c_str(); - if (colour == DEFAULT_TEXT_COLOUR) - colour = LureEngine::getReference().isEGA() ? EGA_DIALOG_TEXT_COLOUR : VGA_DIALOG_TEXT_COLOUR; + if (color == DEFAULT_TEXT_COLOR) + color = LureEngine::getReference().isEGA() ? EGA_DIALOG_TEXT_COLOR : VGA_DIALOG_TEXT_COLOR; for (int index = 0; (index < len) && (*sPtr != '\0'); ++index, ++sPtr) { int charSize = varLength ? fontSize[(uint8)*sPtr - 32] + 2 : FONT_WIDTH; @@ -269,7 +269,7 @@ void Surface::writeSubstring(uint16 x, uint16 y, Common::String line, int len, break; // Write next character - writeChar(x, y, (uint8) *sPtr, transparent, colour); + writeChar(x, y, (uint8) *sPtr, transparent, color); // Move to after the character in preparation for the next character x += charSize; @@ -312,7 +312,7 @@ void Surface::copyTo(Surface *dest, uint16 x, uint16 y) { } void Surface::copyTo(Surface *dest, const Common::Rect &srcBounds, - uint16 destX, uint16 destY, int transparentColour) { + uint16 destX, uint16 destY, int transparentColor) { int numBytes = srcBounds.right - srcBounds.left + 1; if (destX + numBytes > dest->width()) numBytes = dest->width() - destX; @@ -322,8 +322,8 @@ void Surface::copyTo(Surface *dest, const Common::Rect &srcBounds, const uint32 srcPos = (srcBounds.top + y) * _width + srcBounds.left; const uint32 destPos = (destY+y) * dest->width() + destX; - if (transparentColour == -1) { - // No trnnsparent colour, so copy all the bytes of the line + if (transparentColor == -1) { + // No trnnsparent color, so copy all the bytes of the line dest->data().copyFrom(_data, srcPos, destPos, numBytes); } else { byte *pSrc = _data->data() + srcPos; @@ -331,7 +331,7 @@ void Surface::copyTo(Surface *dest, const Common::Rect &srcBounds, int bytesCtr = numBytes; while (bytesCtr-- > 0) { - if (*pSrc != (uint8) transparentColour) + if (*pSrc != (uint8) transparentColor) *pDest = *pSrc; ++pSrc; ++pDest; @@ -347,12 +347,12 @@ void Surface::copyFrom(MemoryBlock *src, uint32 destOffset) { } // fillRect -// Fills a rectangular area with a colour +// Fills a rectangular area with a color -void Surface::fillRect(const Common::Rect &r, uint8 colour) { +void Surface::fillRect(const Common::Rect &r, uint8 color) { for (int yp = r.top; yp <= r.bottom; ++yp) { byte *const addr = _data->data() + (yp * _width) + r.left; - memset(addr, colour, r.width()); + memset(addr, color, r.width()); } } @@ -464,7 +464,7 @@ void Surface::wordWrap(char *text, uint16 width, char **&lines, uint8 &numLines) } Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bool varLength, - int colour, bool squashedLines) { + int color, bool squashedLines) { Common::Point size; Surface::getDialogBounds(size, 0, numLines, squashedLines); @@ -473,21 +473,21 @@ Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bo uint16 yP = Surface::textY(); for (uint8 ctr = 0; ctr < numLines; ++ctr) { - s->writeString(Surface::textX(), yP, lines[ctr], true, colour, varLength); + s->writeString(Surface::textX(), yP, lines[ctr], true, color, varLength); yP += squashedLines ? FONT_HEIGHT - 1 : FONT_HEIGHT; } return s; } -Surface *Surface::newDialog(uint16 width, const char *line, int colour) { +Surface *Surface::newDialog(uint16 width, const char *line, int color) { char **lines; char *lineCopy = strdup(line); uint8 numLines; wordWrap(lineCopy, width - (Surface::textX() * 2), lines, numLines); // Create the dialog - Surface *result = newDialog(width, numLines, const_cast<const char **>(lines), true, colour); + Surface *result = newDialog(width, numLines, const_cast<const char **>(lines), true, color); // Deallocate used resources free(lines); @@ -510,7 +510,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool Mouse &mouse = Mouse::getReference(); Events &events = Events::getReference(); Screen &screen = Screen::getReference(); - uint8 bgColour = *(screen.screen().data().data() + (y * FULL_SCREEN_WIDTH) + x); + uint8 bgColor = *(screen.screen().data().data() + (y * FULL_SCREEN_WIDTH) + x); Common::String newLine(line); bool abortFlag = false; bool refreshFlag = false; @@ -527,7 +527,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool while (!abortFlag) { // Display the string - screen.screen().writeString(x, y, newLine, true, DEFAULT_TEXT_COLOUR, varLength); + screen.screen().writeString(x, y, newLine, true, DEFAULT_TEXT_COLOR, varLength); screen.update(); int stringSize = textWidth(newLine.c_str()); @@ -545,7 +545,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool if ((keycode == Common::KEYCODE_RETURN) || (keycode == Common::KEYCODE_KP_ENTER)) { // Return character screen.screen().fillRect( - Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColour); + Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColor); screen.update(); newLine.deleteLastChar(); line = newLine; @@ -556,7 +556,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool else if (keycode == Common::KEYCODE_ESCAPE) { // Escape character screen.screen().fillRect( - Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColour); + Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColor); screen.update(); abortFlag = true; } else if (keycode == Common::KEYCODE_BACKSPACE) { @@ -564,14 +564,14 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool if (newLine.size() == 1) continue; screen.screen().fillRect( - Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColour); + Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColor); newLine.deleteChar(newLine.size() - 2); refreshFlag = true; } else if ((ch >= ' ') && (stringSize + 8 < maxSize)) { if (((ch >= '0') && (ch <= '9')) || !isNumeric) { screen.screen().fillRect( - Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColour); + Common::Rect(x, y, x + maxSize - 1, y + FONT_HEIGHT), bgColor); newLine.insertChar(ch, newLine.size() - 1); refreshFlag = true; } @@ -818,7 +818,7 @@ TalkDialog::TalkDialog(uint16 characterId, uint16 destCharacterId, uint16 active // Write out the character name uint16 charWidth = Surface::textWidth(srcCharName); - byte white = LureEngine::getReference().isEGA() ? EGA_DIALOG_WHITE_COLOUR : VGA_DIALOG_WHITE_COLOUR; + byte white = LureEngine::getReference().isEGA() ? EGA_DIALOG_WHITE_COLOR : VGA_DIALOG_WHITE_COLOR; _surface->writeString((TALK_DIALOG_WIDTH - charWidth) / 2, TALK_DIALOG_EDGE_SIZE + 2, srcCharName, true, white); debugC(ERROR_DETAILED, kLureDebugAnimations, "TalkDialog end"); @@ -903,14 +903,14 @@ TalkDialog *TalkDialog::loadFromStream(Common::ReadStream *stream) { void SaveRestoreDialog::toggleHightlight(int xs, int xe, int ys, int ye) { Screen &screen = Screen::getReference(); byte *addr = screen.screen().data().data() + FULL_SCREEN_WIDTH * ys + xs; - const byte colourList[4] = {EGA_DIALOG_TEXT_COLOUR, EGA_DIALOG_WHITE_COLOUR, - VGA_DIALOG_TEXT_COLOUR, VGA_DIALOG_WHITE_COLOUR}; - const byte *colours = LureEngine::getReference().isEGA() ? &colourList[0] : &colourList[2]; + const byte colorList[4] = {EGA_DIALOG_TEXT_COLOR, EGA_DIALOG_WHITE_COLOR, + VGA_DIALOG_TEXT_COLOR, VGA_DIALOG_WHITE_COLOR}; + const byte *colors = LureEngine::getReference().isEGA() ? &colorList[0] : &colorList[2]; for (int y = 0; y < ye - ys + 1; ++y, addr += FULL_SCREEN_WIDTH) { for (int x = 0; x < xe - xs + 1; ++x) { - if (addr[x] == colours[0]) addr[x] = colours[1]; - else if (addr[x] == colours[1]) addr[x] = colours[0]; + if (addr[x] == colors[0]) addr[x] = colors[1]; + else if (addr[x] == colors[1]) addr[x] = colors[0]; } } @@ -951,9 +951,9 @@ bool SaveRestoreDialog::show(bool saveDialog) { // Create the outer dialog and dividing line s->createDialog(); byte *pDest = s->data().data() + (s->width() * SR_SEPARATOR_Y) + SR_SEPARATOR_X; - uint8 rowColours[5] = {*(pDest-2), *(pDest-1), *(pDest-1), *(pDest-2), *(pDest+1)}; + uint8 rowColors[5] = {*(pDest-2), *(pDest-1), *(pDest-1), *(pDest-2), *(pDest+1)}; for (int y = 0; y < SR_SEPARATOR_HEIGHT; ++y, pDest += s->width()) - memset(pDest, rowColours[y], s->width() - 12); + memset(pDest, rowColors[y], s->width() - 12); // Create title line Common::String title(res.stringList().getString( @@ -1248,7 +1248,7 @@ struct ItemDesc { int16 x, y; uint16 width, height; uint16 animId; - uint8 startColour; + uint8 startColor; }; #define PROT_SPR_HEADER 0x1830 @@ -1286,7 +1286,7 @@ CopyProtectionDialog::CopyProtectionDialog() { Hotspot *h = new Hotspot(); h->setPosition(ptr->x, ptr->y); h->setSize(ptr->width, ptr->height); - h->setColourOffset(ptr->startColour); + h->setColorOffset(ptr->startColor); h->setAnimation(ptr->animId); _hotspots.push_back(HotspotsList::value_type(h)); diff --git a/engines/lure/surface.h b/engines/lure/surface.h index 8fd8ae49a6..9a677cf749 100644 --- a/engines/lure/surface.h +++ b/engines/lure/surface.h @@ -34,7 +34,7 @@ namespace Lure { -#define DEFAULT_TEXT_COLOUR -1 +#define DEFAULT_TEXT_COLOR -1 class Surface { private: @@ -61,20 +61,20 @@ public: void loadScreen(uint16 resourceId); void loadScreen(MemoryBlock *data); - int writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int colour); + int writeChar(uint16 x, uint16 y, uint8 ascii, bool transparent, int color); void writeString(uint16 x, uint16 y, Common::String line, bool transparent, - int colour = DEFAULT_TEXT_COLOUR, bool varLength = true); + int color = DEFAULT_TEXT_COLOR, bool varLength = true); void writeSubstring(uint16 x, uint16 y, Common::String line, int len, - bool transparent, int colour = DEFAULT_TEXT_COLOUR, bool varLength = true); + bool transparent, int color = DEFAULT_TEXT_COLOR, bool varLength = true); void transparentCopyTo(Surface *dest); void copyTo(Surface *dest); void copyTo(Surface *dest, uint16 x, uint16 y); void copyTo(Surface *dest, const Common::Rect &srcBounds, uint16 destX, uint16 destY, - int transparentColour = -1); + int transparentColor = -1); void copyFrom(MemoryBlock *src) { _data->copyFrom(src); } void copyFrom(MemoryBlock *src, uint32 destOffset); void empty() { _data->empty(); } - void fillRect(const Common::Rect &r, uint8 colour); + void fillRect(const Common::Rect &r, uint8 color); void createDialog(bool blackFlag = false); void copyToScreen(uint16 x, uint16 y); void centerOnScreen(); @@ -82,8 +82,8 @@ public: static uint16 textWidth(const char *s, int numChars = 0); static void wordWrap(char *text, uint16 width, char **&lines, uint8 &numLines); static Surface *newDialog(uint16 width, uint8 numLines, const char **lines, bool varLength = true, - int colour = DEFAULT_TEXT_COLOUR, bool squashedLines = true); - static Surface *newDialog(uint16 width, const char *lines, int colour = DEFAULT_TEXT_COLOUR); + int color = DEFAULT_TEXT_COLOR, bool squashedLines = true); + static Surface *newDialog(uint16 width, const char *lines, int color = DEFAULT_TEXT_COLOR); static Surface *getScreen(uint16 resourceId); bool getString(Common::String &line, int maxSize, bool isNumeric, bool varLength, int16 x, int16 y); }; |