aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS8
-rw-r--r--NEWS12
-rw-r--r--audio/decoders/adpcm_intern.h4
-rw-r--r--audio/softsynth/mt32/part.cpp4
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp22
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h2
-rw-r--r--backends/platform/iphone/osys_main.h2
-rw-r--r--backends/platform/iphone/osys_video.cpp4
-rw-r--r--backends/platform/sdl/sdl.cpp14
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in4
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in4
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in4
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in4
-rw-r--r--backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml2
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.cpp2
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp2
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.h2
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp2
-rw-r--r--backends/vkeybd/virtual-keyboard.h2
-rw-r--r--common/macresman.cpp5
-rwxr-xr-xconfigure5
-rw-r--r--devtools/create_lure/create_lure_dat.cpp2
-rw-r--r--devtools/create_lure/create_lure_dat.h4
-rwxr-xr-xdevtools/credits.pl9
-rw-r--r--devtools/scumm-md5.txt1
-rw-r--r--engines/agi/agi.h4
-rw-r--r--engines/agi/graphics.cpp8
-rw-r--r--engines/agi/menu.cpp2
-rw-r--r--engines/agi/op_test.cpp6
-rw-r--r--engines/agi/picture.cpp6
-rw-r--r--engines/agi/saveload.cpp24
-rw-r--r--engines/agi/text.cpp4
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/debug.h2
-rw-r--r--engines/agos/script_dp.cpp2
-rw-r--r--engines/agos/script_ff.cpp6
-rw-r--r--engines/agos/vga_ff.cpp4
-rw-r--r--engines/cruise/ctp.cpp2
-rw-r--r--engines/cruise/ctp.h2
-rw-r--r--engines/cruise/detection.cpp2
-rw-r--r--engines/cruise/font.cpp4
-rw-r--r--engines/cruise/font.h2
-rw-r--r--engines/cruise/gfxModule.cpp8
-rw-r--r--engines/cruise/gfxModule.h4
-rw-r--r--engines/draci/animation.cpp6
-rw-r--r--engines/draci/font.cpp30
-rw-r--r--engines/draci/font.h26
-rw-r--r--engines/draci/game.cpp36
-rw-r--r--engines/draci/game.h4
-rw-r--r--engines/draci/mouse.cpp4
-rw-r--r--engines/draci/screen.cpp18
-rw-r--r--engines/draci/screen.h2
-rw-r--r--engines/draci/script.cpp8
-rw-r--r--engines/draci/sprite.cpp10
-rw-r--r--engines/draci/sprite.h6
-rw-r--r--engines/draci/surface.cpp8
-rw-r--r--engines/draci/surface.h12
-rw-r--r--engines/draci/walking.cpp14
-rw-r--r--engines/draci/walking.h6
-rw-r--r--engines/groovie/resource.cpp44
-rw-r--r--engines/groovie/resource.h6
-rw-r--r--engines/groovie/script.cpp8
-rw-r--r--engines/groovie/script.h2
-rw-r--r--engines/groovie/vdx.cpp88
-rw-r--r--engines/groovie/vdx.h6
-rw-r--r--engines/hugo/dialogs.cpp57
-rw-r--r--engines/hugo/dialogs.h6
-rw-r--r--engines/hugo/schedule.cpp53
-rw-r--r--engines/hugo/util.cpp3
-rw-r--r--engines/kyra/sound_adlib.cpp20
-rw-r--r--engines/lure/debugger.cpp4
-rw-r--r--engines/lure/decode.cpp6
-rw-r--r--engines/lure/fights.cpp6
-rw-r--r--engines/lure/hotspots.cpp28
-rw-r--r--engines/lure/hotspots.h6
-rw-r--r--engines/lure/luredefs.h14
-rw-r--r--engines/lure/menu.cpp34
-rw-r--r--engines/lure/palette.cpp4
-rw-r--r--engines/lure/res.cpp2
-rw-r--r--engines/lure/res_struct.cpp2
-rw-r--r--engines/lure/res_struct.h4
-rw-r--r--engines/lure/room.cpp6
-rw-r--r--engines/lure/screen.cpp6
-rw-r--r--engines/lure/surface.cpp88
-rw-r--r--engines/lure/surface.h16
-rw-r--r--engines/m4/actor.cpp2
-rw-r--r--engines/m4/animation.cpp2
-rw-r--r--engines/m4/converse.cpp4
-rw-r--r--engines/m4/dialogs.cpp6
-rw-r--r--engines/m4/events.cpp2
-rw-r--r--engines/m4/font.cpp8
-rw-r--r--engines/m4/font.h4
-rw-r--r--engines/m4/graphics.cpp16
-rw-r--r--engines/m4/graphics.h25
-rw-r--r--engines/m4/gui.cpp12
-rw-r--r--engines/m4/m4.cpp4
-rw-r--r--engines/m4/m4_scene.cpp14
-rw-r--r--engines/m4/m4_scene.h6
-rw-r--r--engines/m4/mads_anim.cpp2
-rw-r--r--engines/m4/mads_menus.cpp20
-rw-r--r--engines/m4/mads_scene.cpp10
-rw-r--r--engines/m4/mads_views.cpp20
-rw-r--r--engines/m4/mads_views.h12
-rw-r--r--engines/m4/scene.cpp2
-rw-r--r--engines/m4/sprite.cpp10
-rw-r--r--engines/m4/woodscript.h6
-rw-r--r--engines/m4/ws_sequence.cpp2
-rw-r--r--engines/saga/interface.cpp10
-rw-r--r--engines/saga/interface.h2
-rw-r--r--engines/saga/saveload.cpp2
-rw-r--r--engines/sci/engine/kmisc.cpp3
-rw-r--r--engines/sci/engine/kstring.cpp10
-rw-r--r--engines/sci/sound/drivers/amigamac.cpp23
-rw-r--r--engines/scumm/imuse_digi/dimuse_codecs.cpp2
-rw-r--r--engines/scumm/scumm-md5.h3
-rw-r--r--engines/sky/compact.cpp2
-rw-r--r--engines/sky/control.cpp2
-rw-r--r--engines/sky/logic.cpp4
-rw-r--r--engines/sky/screen.cpp46
-rw-r--r--engines/sky/screen.h8
-rw-r--r--engines/sky/skydefs.h4
-rw-r--r--engines/sky/struc.h6
-rw-r--r--engines/sky/text.cpp14
-rw-r--r--engines/sky/text.h8
-rw-r--r--engines/sword1/menu.cpp2
-rw-r--r--engines/sword2/controls.cpp2
-rw-r--r--engines/sword2/function.cpp16
-rw-r--r--engines/sword2/header.h10
-rw-r--r--engines/sword2/icons.cpp20
-rw-r--r--engines/sword2/interpreter.cpp2
-rw-r--r--engines/sword2/layers.cpp2
-rw-r--r--engines/sword2/logic.h2
-rw-r--r--engines/sword2/maketext.cpp38
-rw-r--r--engines/sword2/maketext.h12
-rw-r--r--engines/sword2/mouse.cpp22
-rw-r--r--engines/sword2/object.h2
-rw-r--r--engines/sword2/palette.cpp24
-rw-r--r--engines/sword2/protocol.cpp4
-rw-r--r--engines/sword2/render.cpp16
-rw-r--r--engines/sword2/router.cpp6
-rw-r--r--engines/sword2/router.h2
-rw-r--r--engines/sword2/screen.cpp16
-rw-r--r--engines/sword2/screen.h6
-rw-r--r--engines/sword2/scroll.cpp2
-rw-r--r--engines/sword2/speech.cpp8
-rw-r--r--engines/sword2/sprite.cpp32
-rw-r--r--engines/sword25/gfx/graphicengine.cpp11
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp48
-rw-r--r--engines/sword25/gfx/image/vectorimagerenderer.cpp11
-rw-r--r--engines/sword25/gfx/text.cpp4
-rw-r--r--engines/sword25/kernel/kernel.cpp4
-rw-r--r--engines/sword25/util/pluto/Makefile29
-rw-r--r--engines/sword25/util/pluto/pdep/lauxlib.h174
-rw-r--r--engines/sword25/util/pluto/pdep/ldo.h57
-rw-r--r--engines/sword25/util/pluto/pdep/lfunc.h34
-rw-r--r--engines/sword25/util/pluto/pdep/lgc.h110
-rw-r--r--engines/sword25/util/pluto/pdep/llimits.h128
-rw-r--r--engines/sword25/util/pluto/pdep/lobject.h381
-rw-r--r--engines/sword25/util/pluto/pdep/lopcodes.h268
-rw-r--r--engines/sword25/util/pluto/pdep/lstate.h169
-rw-r--r--engines/sword25/util/pluto/pdep/lstring.h31
-rw-r--r--engines/sword25/util/pluto/pdep/ltm.h54
-rw-r--r--engines/sword25/util/pluto/pdep/lua.h388
-rw-r--r--engines/sword25/util/pluto/pdep/lzio.h2
-rw-r--r--engines/sword25/util/pluto/pdep/pdep.h21
-rw-r--r--engines/sword25/util/pluto/pptest.cpp95
-rw-r--r--engines/sword25/util/pluto/pptest.lua168
-rw-r--r--engines/sword25/util/pluto/puptest.cpp81
-rw-r--r--engines/sword25/util/pluto/puptest.lua93
-rw-r--r--engines/testbed/graphics.cpp8
-rw-r--r--engines/tinsel/actors.cpp34
-rw-r--r--engines/tinsel/actors.h2
-rw-r--r--engines/tinsel/background.cpp8
-rw-r--r--engines/tinsel/background.h4
-rw-r--r--engines/tinsel/bg.cpp2
-rw-r--r--engines/tinsel/bmv.cpp22
-rw-r--r--engines/tinsel/bmv.h4
-rw-r--r--engines/tinsel/dialogs.cpp44
-rw-r--r--engines/tinsel/faders.cpp68
-rw-r--r--engines/tinsel/faders.h2
-rw-r--r--engines/tinsel/font.cpp4
-rw-r--r--engines/tinsel/graphics.cpp48
-rw-r--r--engines/tinsel/graphics.h2
-rw-r--r--engines/tinsel/move.cpp28
-rw-r--r--engines/tinsel/object.cpp8
-rw-r--r--engines/tinsel/object.h4
-rw-r--r--engines/tinsel/palette.cpp180
-rw-r--r--engines/tinsel/palette.h42
-rw-r--r--engines/tinsel/pdisplay.cpp22
-rw-r--r--engines/tinsel/pid.h6
-rw-r--r--engines/tinsel/polygons.cpp38
-rw-r--r--engines/tinsel/polygons.h4
-rw-r--r--engines/tinsel/rince.cpp10
-rw-r--r--engines/tinsel/rince.h8
-rw-r--r--engines/tinsel/saveload.cpp2
-rw-r--r--engines/tinsel/savescn.cpp2
-rw-r--r--engines/tinsel/scene.cpp2
-rw-r--r--engines/tinsel/sound.cpp6
-rw-r--r--engines/tinsel/sysvar.cpp4
-rw-r--r--engines/tinsel/sysvar.h4
-rw-r--r--engines/tinsel/text.cpp12
-rw-r--r--engines/tinsel/text.h8
-rw-r--r--engines/tinsel/tinlib.cpp42
-rw-r--r--engines/tinsel/tinlib.h2
-rw-r--r--engines/tinsel/tinsel.h4
-rw-r--r--engines/toon/character.cpp5
-rw-r--r--engines/toon/font.cpp8
-rw-r--r--engines/toon/toon.cpp6
-rw-r--r--engines/toon/toon.h1
-rw-r--r--engines/tsage/converse.cpp48
-rw-r--r--engines/tsage/converse.h18
-rw-r--r--engines/tsage/core.cpp280
-rw-r--r--engines/tsage/core.h66
-rw-r--r--engines/tsage/debugger.cpp239
-rw-r--r--engines/tsage/debugger.h6
-rw-r--r--engines/tsage/dialogs.cpp40
-rw-r--r--engines/tsage/dialogs.h4
-rw-r--r--engines/tsage/events.cpp6
-rw-r--r--engines/tsage/events.h2
-rw-r--r--engines/tsage/globals.cpp20
-rw-r--r--engines/tsage/globals.h6
-rw-r--r--engines/tsage/graphics.cpp163
-rw-r--r--engines/tsage/graphics.h42
-rw-r--r--engines/tsage/resources.cpp5
-rw-r--r--engines/tsage/resources.h12
-rw-r--r--engines/tsage/ringworld_logic.cpp137
-rw-r--r--engines/tsage/ringworld_scenes1.cpp210
-rw-r--r--engines/tsage/ringworld_scenes1.h10
-rw-r--r--engines/tsage/ringworld_scenes10.cpp102
-rw-r--r--engines/tsage/ringworld_scenes2.cpp24
-rw-r--r--engines/tsage/ringworld_scenes3.cpp51
-rw-r--r--engines/tsage/ringworld_scenes3.h19
-rw-r--r--engines/tsage/ringworld_scenes5.cpp136
-rw-r--r--engines/tsage/ringworld_scenes5.h16
-rw-r--r--engines/tsage/ringworld_scenes6.cpp4
-rw-r--r--engines/tsage/ringworld_scenes8.cpp118
-rw-r--r--engines/tsage/saveload.cpp10
-rw-r--r--engines/tsage/saveload.h8
-rw-r--r--engines/tsage/scenes.cpp4
-rw-r--r--engines/tsage/tsage.cpp4
-rw-r--r--engines/tsage/tsage.h4
-rw-r--r--graphics/png.cpp23
-rw-r--r--gui/credits.h8
-rw-r--r--gui/options.cpp11
-rw-r--r--gui/options.h5
-rw-r--r--gui/widgets/edittext.cpp8
-rw-r--r--gui/widgets/edittext.h6
-rw-r--r--video/codecs/cdtoons.cpp2
248 files changed, 2341 insertions, 4122 deletions
diff --git a/AUTHORS b/AUTHORS
index adc23e50ad..ca6342d836 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -183,6 +183,10 @@ ScummVM Team
Touche:
Gregory Montoir
+ TsAGE:
+ Paul Gilbert
+ Arnaud Boutonne
+
Tucker:
Gregory Montoir
@@ -417,7 +421,7 @@ Other contributions
David Jensen - SVG logo conversion
Jean Marc Gimenez - ScummVM logo
Raina - ScummVM forum buttons
- William Claydon - Skins for doxygen and wiki
+ William Claydon - Skins for doxygen, buildbot and wiki
Code contributions
------------------
@@ -555,7 +559,7 @@ Special thanks to
Drascula: The Vampire Strikes Back with us and his generosity with
freewaring the game.
- David P. Gray from Gray Design Associate for sharing the source code of
+ David P. Gray from Gray Design Associates for sharing the source code of
the Hugo trilogy.
Broken Sword 2.5 team for providing sources of their engine and their
diff --git a/NEWS b/NEWS
index d2ab41c29d..b1f836c4c3 100644
--- a/NEWS
+++ b/NEWS
@@ -9,10 +9,14 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added support for Playtoons: Bambou le Sauveur de la Jungle.
- Added support for Toonstruck.
- Added support for Living Books v1 and v2 games.
+ - Added support for Hugo's House of Horrors, Hugo 2: Whodunit?
+ and Hugo 3: Jungle of Doom.
+ - Added support for Amiga SCI games (except Conquests of the Longbow).
+ - Added support for Macintosh SCI1 games.
General
- - Added support for loadable modules on platforms without a dynamic loader.
- (GSoC Task)
+ - Added support for loadable modules on platforms without a dynamic
+ loader (GSoC Task).
- Added Danish translation.
- Added Norwegian Bokmaal translation.
- Added Norwegian Nynorsk translation.
@@ -91,7 +95,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Improved support for FM-TOWNS versions of games.
Sky:
- - Fixed crashes on sequences for several ports (Android, OpenGL, ...)
+ - Fixed crashes on sequences for several ports (Android, OpenGL, ...).
Teenagent:
- Closed memory leaks.
@@ -108,7 +112,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added workarounds for several issues present in the original game.
SDL ports:
- - Added support for OpenGL. (GSoC Task)
+ - Added support for OpenGL (GSoC Task).
- Closed memory leaks in Mouse Surfaces.
Android port:
diff --git a/audio/decoders/adpcm_intern.h b/audio/decoders/adpcm_intern.h
index 2d56c9d468..ea20b40338 100644
--- a/audio/decoders/adpcm_intern.h
+++ b/audio/decoders/adpcm_intern.h
@@ -24,7 +24,7 @@
*/
/**
- * Internal interfaces to the ADPCM encoders.
+ * Internal interfaces to the ADPCM decoders.
*
* These can be used to make custom ADPCM decoder subclasses,
* or to at least share some common data tables between various
@@ -52,7 +52,7 @@ protected:
uint32 _blockPos[2];
const int _rate;
- struct {
+ struct ADPCMStatus {
// OKI/IMA
struct {
int32 last;
diff --git a/audio/softsynth/mt32/part.cpp b/audio/softsynth/mt32/part.cpp
index eb087f7ea0..9f9269cba5 100644
--- a/audio/softsynth/mt32/part.cpp
+++ b/audio/softsynth/mt32/part.cpp
@@ -100,7 +100,7 @@ void RhythmPart::setBend(unsigned int midiBend) {
}
void Part::setBend(unsigned int midiBend) {
- // FIXME:KG: Slightly unbalanced increments, but I wanted min -1.0, centre 0.0 and max 1.0
+ // FIXME:KG: Slightly unbalanced increments, but I wanted min -1.0, center 0.0 and max 1.0
if (midiBend <= 0x2000) {
bend = ((signed int)midiBend - 0x2000) / (float)0x2000;
} else {
@@ -413,7 +413,7 @@ void RhythmPart::setPan(unsigned int midiPan)
}
void Part::setPan(unsigned int midiPan) {
- // FIXME:KG: Tweaked this a bit so that we have a left 100%, centre and right 100%
+ // FIXME:KG: Tweaked this a bit so that we have a left 100%, center and right 100%
// (But this makes the range somewhat skewed)
// Check against the real thing
// NOTE: Panning is inverted compared to GM.
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 3ad92b4355..576b70dd2a 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -259,13 +259,13 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) {
return true;
}
-void OSystem_DS::grabPalette(unsigned char *colours, uint start, uint num) {
+void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
// consolePrintf("Grabpalette");
for (unsigned int r = start; r < start + num; r++) {
- *colours++ = (BG_PALETTE[r] & 0x001F) << 3;
- *colours++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3;
- *colours++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3;
+ *colors++ = (BG_PALETTE[r] & 0x001F) << 3;
+ *colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3;
+ *colors++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3;
}
}
@@ -849,16 +849,16 @@ Common::WriteStream *OSystem_DS::createConfigWriteStream() {
return file.createWriteStream();
}
-u16 OSystem_DS::applyGamma(u16 colour) {
+u16 OSystem_DS::applyGamma(u16 color) {
// Attempt to do gamma correction (or something like it) to palette entries
// to improve the contrast of the image on the original DS screen.
- // Split the colour into it's component channels
- int r = colour & 0x001F;
- int g = (colour & 0x03E0) >> 5;
- int b = (colour & 0x7C00) >> 10;
+ // Split the color into it's component channels
+ int r = color & 0x001F;
+ int g = (color & 0x03E0) >> 5;
+ int b = (color & 0x7C00) >> 10;
- // Caluclate the scaling factor for this colour based on it's brightness
+ // Caluclate the scaling factor for this color based on it's brightness
int scale = ((23 - ((r + g + b) >> 2)) * _gammaValue) >> 3;
// Scale the three components by the scaling factor, with clamping
@@ -871,7 +871,7 @@ u16 OSystem_DS::applyGamma(u16 colour) {
b = b + ((b * scale) >> 4);
if (b > 31) b = 31;
- // Stick them back together into a 555 colour value
+ // Stick them back together into a 555 color value
return 0x8000 | r | (g << 5) | (b << 10);
}
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 7feed7541f..5e179d1337 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -183,7 +183,7 @@ public:
Common::WriteStream *createConfigWriteStream();
Common::SeekableReadStream *createConfigReadStream();
- u16 applyGamma(u16 colour);
+ u16 applyGamma(u16 color);
void setGammaValue(int gamma) { _gammaValue = gamma; }
void engineDone();
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 5e88510980..25c3c40cf9 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -81,7 +81,7 @@ protected:
bool _mouseVisible;
byte *_mouseBuf;
- byte _mouseKeyColour;
+ byte _mouseKeyColor;
uint _mouseWidth, _mouseHeight;
uint _mouseX, _mouseY;
int _mouseHotspotX, _mouseHotspotY;
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index d67d38932a..c5e7ab8413 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -312,7 +312,7 @@ void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect
uint16 *dst = &_fullscreen[top * _screenWidth + left];
for (int y = displayHeight; y > srcY; y--) {
for (int x = displayWidth; x > srcX; x--) {
- if (*src != _mouseKeyColour)
+ if (*src != _mouseKeyColor)
*dst = _palette[*src];
dst++;
src++;
@@ -497,7 +497,7 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _mouseKeyColour = (byte)keycolor;
+ _mouseKeyColor = (byte)keycolor;
memcpy(_mouseBuf, buf, w * h);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index d6e79248f9..2c0c45907f 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -378,7 +378,11 @@ void OSystem_SDL::setupIcon() {
unsigned int rgba[256];
unsigned int *icon;
- sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes);
+ if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) {
+ warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]);
+
+ return;
+ }
if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {
warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes);
return;
@@ -393,13 +397,17 @@ void OSystem_SDL::setupIcon() {
unsigned char code;
char color[32];
unsigned int col;
- sscanf(scummvm_icon[1 + i], "%c c %s", &code, color);
+ if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) {
+ warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]);
+ }
if (!strcmp(color, "None"))
col = 0x00000000;
else if (!strcmp(color, "black"))
col = 0xFF000000;
else if (color[0] == '#') {
- sscanf(color + 1, "%06x", &col);
+ if (sscanf(color + 1, "%06x", &col) != 1) {
+ warning("Wrong format of color (%s)", color + 1);
+ }
col |= 0xFF000000;
} else {
warning("Could not load the built-in icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]);
diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
index 12b4cb3610..8e644ae634 100644
--- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
@@ -63,8 +63,8 @@ START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
SOURCEPATH ..\res
// Source Color-depth Source-bitmap-list
-// c denotes whether the bitmap is a colour bitmap and the digits represent the
-// colour-depth of the bitmap and the bitmap mask respectively
+// c denotes whether the bitmap is a color bitmap and the digits represent the
+// color-depth of the bitmap and the bitmap mask respectively
SOURCE c24 ScummSmall.bmp
SOURCE 8 ScummSmallMask.bmp
SOURCE c24 ScummLarge.bmp
diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
index 9af6535b22..f3c12c6b19 100644
--- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
@@ -63,8 +63,8 @@ START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
SOURCEPATH ..\res
// Source Color-depth Source-bitmap-list
-// c denotes whether the bitmap is a colour bitmap and the digits represent the
-// colour-depth of the bitmap and the bitmap mask respectively
+// c denotes whether the bitmap is a color bitmap and the digits represent the
+// color-depth of the bitmap and the bitmap mask respectively
SOURCE c24 ScummSmall.bmp
SOURCE 8 ScummSmallMask.bmp
SOURCE c24 ScummLarge.bmp
diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
index 3fab5cc2b7..5cf1b1bb11 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
@@ -64,8 +64,8 @@ START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
SOURCEPATH ..\res
// Source Color-depth Source-bitmap-list
-// c denotes whether the bitmap is a colour bitmap and the digits represent the
-// colour-depth of the bitmap and the bitmap mask respectively
+// c denotes whether the bitmap is a color bitmap and the digits represent the
+// color-depth of the bitmap and the bitmap mask respectively
SOURCE c24 ScummSmall.bmp
SOURCE 8 ScummSmallMask.bmp
SOURCE c24 ScummLarge.bmp
diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
index 31dfc36399..44ec5aaf4a 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
@@ -64,8 +64,8 @@ START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
SOURCEPATH ..\res
// Source Color-depth Source-bitmap-list
-// c denotes whether the bitmap is a colour bitmap and the digits represent the
-// colour-depth of the bitmap and the bitmap mask respectively
+// c denotes whether the bitmap is a color bitmap and the digits represent the
+// color-depth of the bitmap and the bitmap mask respectively
SOURCE c24 ScummSmall.bmp
SOURCE 8 ScummSmallMask.bmp
SOURCE c24 ScummLarge.bmp
diff --git a/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml b/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
index 86f39d3d4d..85a27c71ca 100644
--- a/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
+++ b/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<keyboard initial_mode="lowercase" v_align="bottom" h_align="centre">
+<keyboard initial_mode="lowercase" v_align="bottom" h_align="center">
<!-- coords key = "start x, start y, end x, end y" -->
<!-- Lowercase -->
<mode name="lowercase" resolutions="320x240,640x480">
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index c5ab39e46b..050ab5c5a2 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -203,7 +203,7 @@ void VirtualKeyboardGUI::moveToDefaultPosition()
case VirtualKeyboard::kAlignLeft:
x = 0;
break;
- case VirtualKeyboard::kAlignCentre:
+ case VirtualKeyboard::kAlignCenter:
x = (_screenW - kbdW) / 2;
break;
case VirtualKeyboard::kAlignRight:
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index a81258b25f..3ebdfdc653 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -84,7 +84,7 @@ bool VirtualKeyboardParser::parserCallback_keyboard(ParserNode *node) {
if (h.equalsIgnoreCase("left"))
_keyboard->_hAlignment = VirtualKeyboard::kAlignLeft;
else if (h.equalsIgnoreCase("centre") || h.equalsIgnoreCase("center"))
- _keyboard->_hAlignment = VirtualKeyboard::kAlignCentre;
+ _keyboard->_hAlignment = VirtualKeyboard::kAlignCenter;
else if (h.equalsIgnoreCase("right"))
_keyboard->_hAlignment = VirtualKeyboard::kAlignRight;
}
diff --git a/backends/vkeybd/virtual-keyboard-parser.h b/backends/vkeybd/virtual-keyboard-parser.h
index 9723744dc4..1327008a80 100644
--- a/backends/vkeybd/virtual-keyboard-parser.h
+++ b/backends/vkeybd/virtual-keyboard-parser.h
@@ -51,7 +51,7 @@ keyboard layouts for different screen resolutions.
** Example keyboard pack description file **
********************************************
-<keyboard modes="normal,caps" initial_mode="normal" v_align="bottom" h_align="centre">
+<keyboard modes="normal,caps" initial_mode="normal" v_align="bottom" h_align="center">
<mode name="normal" resolutions="640x400,320x200">
<layout resolution="640x400" bitmap="normal_640x400.bmp" transparent_color="255,0,255">
<map>
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index 31fde8c0fa..5add387717 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -71,7 +71,7 @@ void VirtualKeyboard::reset() {
deleteEvents();
_modes.clear();
_initialMode = _currentMode = 0;
- _hAlignment = kAlignCentre;
+ _hAlignment = kAlignCenter;
_vAlignment = kAlignBottom;
_keyQueue.clear();
_loaded = false;
diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h
index db94cbe476..169cd67833 100644
--- a/backends/vkeybd/virtual-keyboard.h
+++ b/backends/vkeybd/virtual-keyboard.h
@@ -134,7 +134,7 @@ protected:
enum HorizontalAlignment {
kAlignLeft,
- kAlignCentre,
+ kAlignCenter,
kAlignRight
};
diff --git a/common/macresman.cpp b/common/macresman.cpp
index e7d4a30789..b06d986ca2 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -623,6 +623,11 @@ void MacResManager::convertCrsrCursor(SeekableReadStream *data, byte **cursor, i
// Pixel data for cursor
int iconDataSize = iconRowBytes * (iconBounds[3] - iconBounds[1]);
byte *iconData = new byte[iconDataSize];
+
+ if (!iconData) {
+ error("Cannot allocate iconData in macresman.cpp");
+ }
+
data->read(iconData, iconDataSize);
// Color table
diff --git a/configure b/configure
index 3c59481021..d673f2d612 100755
--- a/configure
+++ b/configure
@@ -88,7 +88,7 @@ add_engine drascula "Drascula: The Vampire Strikes Back" yes
add_engine gob "Gobli*ns" yes
add_engine groovie "Groovie" yes "groovie2"
add_engine groovie2 "Groovie 2 games" no
-add_engine hugo "Hugo Trilogy" no
+add_engine hugo "Hugo Trilogy" yes
add_engine kyra "Legend of Kyrandia" yes "lol"
add_engine lol "Lands of Lore" no
add_engine lastexpress "The Last Express" no
@@ -704,7 +704,8 @@ Special configuration feature:
wince for Windows CE
Game engines:
- --enable-all-engines enable all engines
+ --enable-all-engines enable all engines, including those which are
+ broken or unsupported
--disable-all-engines disable all engines
$engines_help
Optional Features:
diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp
index ad883b808f..4964b26903 100644
--- a/devtools/create_lure/create_lure_dat.cpp
+++ b/devtools/create_lure/create_lure_dat.cpp
@@ -503,7 +503,7 @@ void read_hotspot_data(byte *&data, uint16 &totalSize) {
r->tickSequenceOffset = entry.tickSequenceOffset;
r->layer = entry.layer;
- r->colourOffset = entry.colourOffset;
+ r->colorOffset = entry.colorOffset;
r->hotspotScriptOffset = entry.hotspotScriptOffset;
r->talkScriptOffset = entry.talkScriptOffset;
r->flags = entry.flags;
diff --git a/devtools/create_lure/create_lure_dat.h b/devtools/create_lure/create_lure_dat.h
index 4743f6ac3f..23090072bd 100644
--- a/devtools/create_lure/create_lure_dat.h
+++ b/devtools/create_lure/create_lure_dat.h
@@ -125,7 +125,7 @@ struct HotspotResource {
uint16 yCorrection;
uint16 tickTimeout;
uint16 animOffset;
- byte colourOffset;
+ byte colorOffset;
uint16 hotspotScriptOffset;
byte unused1[7];
uint16 talkScriptOffset;
@@ -166,7 +166,7 @@ struct HotspotResourceOutput {
uint16 walkY;
int8 talkX;
int8 talkY;
- uint16 colourOffset;
+ uint16 colorOffset;
uint16 animRecordId;
uint16 hotspotScriptOffset;
uint16 talkScriptOffset;
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 075d7b03db..94f72617af 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -695,6 +695,11 @@ begin_credits("Credits");
add_person("Gregory Montoir", "cyx", "");
end_section();
+ begin_section("TsAGE");
+ add_person("Paul Gilbert", "dreammaster", "");
+ add_person("Arnaud Boutonn&eacute;", "Strangerke", "");
+ end_section();
+
begin_section("Tucker");
add_person("Gregory Montoir", "cyx", "");
end_section();
@@ -972,7 +977,7 @@ begin_credits("Credits");
add_person("David Jensen", "Tyst", "SVG logo conversion");
add_person("Jean Marc Gimenez", "", "ScummVM logo");
add_person("", "Raina", "ScummVM forum buttons");
- add_person("William Claydon", "billwashere", "Skins for doxygen and wiki");
+ add_person("William Claydon", "billwashere", "Skins for doxygen, buildbot and wiki");
end_persons();
end_section();
@@ -1113,7 +1118,7 @@ begin_credits("Credits");
"freewaring the game.");
add_paragraph(
- "David P. Gray from Gray Design Associate for sharing the source code ".
+ "David P. Gray from Gray Design Associates for sharing the source code ".
"of the Hugo trilogy.");
add_paragraph(
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 60fc615057..e9e155925e 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -466,6 +466,7 @@ fbear Fatty Bear's Birthday Surprise
fbpack Fatty Bear's Fun Pack
e01acc8c12ef44e8f778fe87e5f90f4e -1 en 3DO - - - sev
c9717ee6059f1e43b768b464493d2fba -1 jp 3DO - - - clone2727
+ 4cfd3fda4a4e6e64a1fc488eba973b7a -1 en DOS - - - velocity37
f06e66fd45b2f8b0f4a2833ff4476050 -1 he DOS - - - sev
freddi Freddi Fish 1: The Case of the Missing Kelp Seeds
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index df19f55b52..1bee78e765 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -92,7 +92,7 @@ typedef signed int Err;
#define CRYPT_KEY_SIERRA "Avis Durgan"
#define CRYPT_KEY_AGDS "Alex Simkin"
-#define MSG_BOX_COLOUR 0x0f // White
+#define MSG_BOX_COLOR 0x0f // White
#define MSG_BOX_TEXT 0x00 // Black
#define MSG_BOX_LINE 0x04 // Red
#define BUTTON_BORDER 0x00 // Black
@@ -935,7 +935,7 @@ public:
private:
// Some submethods of testIfCode
uint8 testObjRight(uint8, uint8, uint8, uint8, uint8);
- uint8 testObjCentre(uint8, uint8, uint8, uint8, uint8);
+ uint8 testObjCenter(uint8, uint8, uint8, uint8, uint8);
uint8 testObjInBox(uint8, uint8, uint8, uint8, uint8);
uint8 testPosn(uint8, uint8, uint8, uint8, uint8);
uint8 testSaid(uint8, uint8 *);
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 58982a2931..d0bc83d4c4 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -685,14 +685,14 @@ void GfxMgr::drawFrame(int x1, int y1, int x2, int y2, int c1, int c2) {
}
}
-void GfxMgr::drawBox(int x1, int y1, int x2, int y2, int colour1, int colour2, int m) {
+void GfxMgr::drawBox(int x1, int y1, int x2, int y2, int color1, int color2, int m) {
x1 += m;
y1 += m;
x2 -= m;
y2 -= m;
- drawRectangle(x1, y1, x2, y2, colour1);
- drawFrame(x1 + 2, y1 + 2, x2 - 2, y2 - 2, colour2, colour2);
+ drawRectangle(x1, y1, x2, y2, color1);
+ drawFrame(x1 + 2, y1 + 2, x2 - 2, y2 - 2, color2, color2);
flushBlock(x1, y1, x2, y2);
}
@@ -752,7 +752,7 @@ void GfxMgr::rawDrawButton(int x, int y, const char *s, int fgcolor, int bgcolor
// Draw a filled rectangle that's larger than the button. Used for drawing
// a border around the button as the button itself is drawn after this.
- drawRectangle(x1, y1, x2, y2, border ? BUTTON_BORDER : MSG_BOX_COLOUR);
+ drawRectangle(x1, y1, x2, y2, border ? BUTTON_BORDER : MSG_BOX_COLOR);
while (*s) {
putTextCharacter(0, x + textOffset, y + textOffset, *s++, fgcolor, bgcolor);
diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp
index 5ec4908e4a..b62bcd9ad8 100644
--- a/engines/agi/menu.cpp
+++ b/engines/agi/menu.cpp
@@ -117,7 +117,7 @@ void Menu::drawMenuOptionHilite(int hMenu, int vMenu) {
AgiMenuOption *d = getMenuOption(hMenu, vMenu);
// Disabled menu items are "greyed out" with a checkerboard effect,
- // rather than having a different colour. -- dsymonds
+ // rather than having a different color. -- dsymonds
_vm->printText(d->text, 0, m->wincol + 1, vMenu + 2, m->width + 2,
MENU_BG, MENU_FG, !d->enabled);
}
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index ab4f6cadc5..f5234d4e6c 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -132,8 +132,8 @@ uint8 AgiEngine::testObjInBox(uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2) {
v->yPos >= y1 && v->xPos + v->xSize - 1 <= x2 && v->yPos <= y2;
}
-// if n is in centre of box
-uint8 AgiEngine::testObjCentre(uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2) {
+// if n is in center of box
+uint8 AgiEngine::testObjCenter(uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2) {
VtEntry *v = &_game.viewTable[n];
return v->xPos + v->xSize / 2 >= x1 &&
@@ -311,7 +311,7 @@ int AgiEngine::testIfCode(int lognum) {
ec = testObjInBox(p[0], p[1], p[2], p[3], p[4]);
break;
case 0x11:
- ec = testObjCentre(p[0], p[1], p[2], p[3], p[4]);
+ ec = testObjCenter(p[0], p[1], p[2], p[3], p[4]);
break;
case 0x12:
ec = testObjRight(p[0], p[1], p[2], p[3], p[4]);
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index 47b72cc8c6..d17fe1d497 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -601,7 +601,7 @@ void PictureMgr::drawPicture() {
_patCode = nextByte();
plotBrush();
break;
- case 0xf0: // set colour on screen (AGI pic v2)
+ case 0xf0: // set color on screen (AGI pic v2)
if (_pictureVersion == AGIPIC_V15)
break;
@@ -615,7 +615,7 @@ void PictureMgr::drawPicture() {
_scrColor &= 0xF; // for v3 drawing diff
_scrOn = true;
_priOn = false;
- } else if (_pictureVersion == AGIPIC_V15) { // set colour on screen
+ } else if (_pictureVersion == AGIPIC_V15) { // set color on screen
_scrColor = nextByte();
_scrColor &= 0xF;
_scrOn = true;
@@ -623,7 +623,7 @@ void PictureMgr::drawPicture() {
_scrOn = false;
}
break;
- case 0xf2: // set colour on priority (AGI pic v2)
+ case 0xf2: // set color on priority (AGI pic v2)
if (_pictureVersion == AGIPIC_V15)
break;
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index 9194cc642c..13e7215180 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -597,7 +597,7 @@ int AgiEngine::selectSlot() {
int hm = 1, vm = 3; // box margins
int xmin, xmax, slotClicked;
char desc[NUM_VISIBLE_SLOTS][40];
- int textCentre, buttonLength, buttonX[2], buttonY;
+ int textCenter, buttonLength, buttonX[2], buttonY;
const char *buttonText[] = { " OK ", "Cancel", NULL };
_noSaveLoadAllowed = true;
@@ -606,10 +606,10 @@ int AgiEngine::selectSlot() {
getSavegameDescription(_firstSlot + i, desc[i]);
}
- textCentre = GFX_WIDTH / CHAR_LINES / 2;
+ textCenter = GFX_WIDTH / CHAR_LINES / 2;
buttonLength = 6;
- buttonX[0] = (textCentre - 3 * buttonLength / 2) * CHAR_COLS;
- buttonX[1] = (textCentre + buttonLength / 2) * CHAR_COLS;
+ buttonX[0] = (textCenter - 3 * buttonLength / 2) * CHAR_COLS;
+ buttonX[1] = (textCenter + buttonLength / 2) * CHAR_COLS;
buttonY = (vm + 17) * CHAR_LINES;
for (i = 0; i < 2; i++)
@@ -642,8 +642,8 @@ int AgiEngine::selectSlot() {
for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
sprintf(dstr, "[%2d. %-28.28s]", i + _firstSlot, desc[i]);
printText(dstr, 0, hm + 1, vm + 4 + i,
- (40 - 2 * hm) - 1, i == active ? MSG_BOX_COLOUR : MSG_BOX_TEXT,
- i == active ? MSG_BOX_TEXT : MSG_BOX_COLOUR);
+ (40 - 2 * hm) - 1, i == active ? MSG_BOX_COLOR : MSG_BOX_TEXT,
+ i == active ? MSG_BOX_TEXT : MSG_BOX_COLOR);
}
char upArrow[] = "^";
@@ -651,11 +651,11 @@ int AgiEngine::selectSlot() {
char scrollBar[] = " ";
for (i = 1; i < NUM_VISIBLE_SLOTS - 1; i++)
- printText(scrollBar, 35, hm + 1, vm + 4 + i, 1, MSG_BOX_COLOUR, 7, true);
+ printText(scrollBar, 35, hm + 1, vm + 4 + i, 1, MSG_BOX_COLOR, 7, true);
printText(upArrow, 35, hm + 1, vm + 4, 1, 8, 7);
printText(downArrow, 35, hm + 1, vm + 4 + NUM_VISIBLE_SLOTS - 1, 1, 8, 7);
- printText(scrollBar, 35, hm + 1, vm + 4 + sbPos, 1, MSG_BOX_COLOUR, MSG_BOX_TEXT);
+ printText(scrollBar, 35, hm + 1, vm + 4 + sbPos, 1, MSG_BOX_COLOR, MSG_BOX_TEXT);
oldActive = active;
oldFirstSlot = _firstSlot;
@@ -808,7 +808,7 @@ int AgiEngine::saveGameDialog() {
do {
drawWindow(hp, vp, GFX_WIDTH - hp, GFX_HEIGHT - vp);
printText("Select a slot in which you wish to\nsave the game:",
- 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+ 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOR);
slot = selectSlot();
if (slot + _firstSlot == 0)
messageBox("That slot is for Autosave only.");
@@ -819,7 +819,7 @@ int AgiEngine::saveGameDialog() {
drawWindow(hp, vp + 5 * CHAR_LINES, GFX_WIDTH - hp,
GFX_HEIGHT - vp - 9 * CHAR_LINES);
printText("Enter a description for this game:",
- 0, hm + 1, vm + 6, w, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+ 0, hm + 1, vm + 6, w, MSG_BOX_TEXT, MSG_BOX_COLOR);
_gfx->drawRectangle(3 * CHAR_COLS, 11 * CHAR_LINES - 1,
37 * CHAR_COLS, 12 * CHAR_LINES, MSG_BOX_TEXT);
_gfx->flushBlock(3 * CHAR_COLS, 11 * CHAR_LINES - 1,
@@ -844,7 +844,7 @@ int AgiEngine::saveGameDialog() {
for (numChars = 0; numChars < 28 && name[numChars]; numChars++)
handleGetstring(name[numChars]);
- _gfx->printCharacter(numChars + 3, 11, _game.cursorChar, MSG_BOX_COLOUR, MSG_BOX_TEXT);
+ _gfx->printCharacter(numChars + 3, 11, _game.cursorChar, MSG_BOX_COLOR, MSG_BOX_TEXT);
do {
mainCycle();
} while (_game.inputMode == INPUT_GETSTRING);
@@ -902,7 +902,7 @@ int AgiEngine::loadGameDialog() {
drawWindow(hp, vp, GFX_WIDTH - hp, GFX_HEIGHT - vp);
printText("Select a game which you wish to\nrestore:",
- 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+ 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOR);
slot = selectSlot();
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index af3881170a..f85c4c1cdd 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -166,7 +166,7 @@ void AgiEngine::blitTextbox(const char *p, int y, int x, int len) {
drawWindow(xoff, yoff, xoff + w - 1, yoff + h - 1);
printText2(2, msg, 0, CHAR_COLS + xoff, CHAR_LINES + yoff,
- len + 1, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+ len + 1, MSG_BOX_TEXT, MSG_BOX_COLOR);
free(msg);
@@ -730,7 +730,7 @@ void AgiEngine::drawWindow(int x1, int y1, int x2, int y2) {
debugC(4, kDebugLevelText, "x1=%d, y1=%d, x2=%d, y2=%d", x1, y1, x2, y2);
_gfx->saveBlock(x1, y1, x2, y2, _game.window.buffer);
- _gfx->drawBox(x1, y1, x2, y2, MSG_BOX_COLOUR, MSG_BOX_LINE, 2);
+ _gfx->drawBox(x1, y1, x2, y2, MSG_BOX_COLOR, MSG_BOX_LINE, 2);
}
} // End of namespace Agi
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index bf51b31c43..1d9602f639 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1140,7 +1140,7 @@ protected:
int getScale(int16 y, int16 x);
void checkScrollX(int16 x, int16 xpos);
void checkScrollY(int16 y, int16 ypos);
- void centreScroll();
+ void centerScroll();
virtual void clearVideoWindow(uint16 windowNum, uint16 color);
void clearVideoBackGround(uint16 windowNum, uint16 color);
@@ -1921,7 +1921,7 @@ public:
void off_mouseOff();
void off_loadVideo();
void off_playVideo();
- void off_centreScroll();
+ void off_centerScroll();
void off_resetPVCount();
void off_setPathValues();
void off_stopClock();
diff --git a/engines/agos/debug.h b/engines/agos/debug.h
index 38674de765..5865065ac3 100644
--- a/engines/agos/debug.h
+++ b/engines/agos/debug.h
@@ -2058,7 +2058,7 @@ static const char *const feeblefiles_opcodeNameTable[256] = {
"W|UNLOAD_ZONE",
NULL,
"|UNFREEZE_ZONES",
- "|CENTRE_SCROLL",
+ "|CENTER_SCROLL",
/* 188 */
"BSJ|STRING2_IS",
"|CLEAR_MARKS",
diff --git a/engines/agos/script_dp.cpp b/engines/agos/script_dp.cpp
index 57610017a1..6eb3ca4779 100644
--- a/engines/agos/script_dp.cpp
+++ b/engines/agos/script_dp.cpp
@@ -271,7 +271,7 @@ void AGOSEngine_DIMP::setupOpcodes() {
OPCODE(os1_unloadZone),
OPCODE(o_invalid),
OPCODE(os1_unfreezeZones),
- OPCODE(off_centreScroll),
+ OPCODE(off_centerScroll),
/* 188 */
OPCODE(os2_isShortText),
OPCODE(os2_clearMarks),
diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp
index dbd89cebf5..8dfee7f7c7 100644
--- a/engines/agos/script_ff.cpp
+++ b/engines/agos/script_ff.cpp
@@ -272,7 +272,7 @@ void AGOSEngine_Feeble::setupOpcodes() {
OPCODE(os1_unloadZone),
OPCODE(o_invalid),
OPCODE(os1_unfreezeZones),
- OPCODE(off_centreScroll),
+ OPCODE(off_centerScroll),
/* 188 */
OPCODE(os2_isShortText),
OPCODE(os2_clearMarks),
@@ -590,9 +590,9 @@ void AGOSEngine_Feeble::off_playVideo() {
}
}
-void AGOSEngine_Feeble::off_centreScroll() {
+void AGOSEngine_Feeble::off_centerScroll() {
// 187
- centreScroll();
+ centerScroll();
}
void AGOSEngine_Feeble::off_resetPVCount() {
diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp
index 38a3479292..14a1c60ae5 100644
--- a/engines/agos/vga_ff.cpp
+++ b/engines/agos/vga_ff.cpp
@@ -201,7 +201,7 @@ void AGOSEngine::vc78_computeXY() {
if (getGameType() == GType_FF) {
setBitFlag(85, false);
if (getBitFlag(74)) {
- centreScroll();
+ centerScroll();
}
}
}
@@ -348,7 +348,7 @@ void AGOSEngine::checkScrollY(int16 y, int16 ypos) {
}
}
-void AGOSEngine::centreScroll() {
+void AGOSEngine::centerScroll() {
int16 x, y, tmp;
if (_scrollXMax != 0) {
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 4f6c21e0e4..f1223c12e6 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -167,7 +167,7 @@ void makeCtStruct(Common::Array<CtStruct> &lst, int16 table[][40], int num, int
}
ct.num = num;
- ct.colour = walkboxColor[num];
+ ct.color = walkboxColor[num];
ct.bounds.left = minX;
ct.bounds.right = maxX;
ct.bounds.top = minY;
diff --git a/engines/cruise/ctp.h b/engines/cruise/ctp.h
index 3c6c9582cc..0aec9c52d8 100644
--- a/engines/cruise/ctp.h
+++ b/engines/cruise/ctp.h
@@ -57,7 +57,7 @@ class CtStruct {
public:
CtStruct *next;
int16 num;
- int16 colour;
+ int16 color;
Common::Rect bounds;
Common::Array<CtEntry> slices;
};
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index e43fadf598..66018fac2e 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -74,7 +74,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
{
{
"cruise",
- "16 colours",
+ "16 colors",
AD_ENTRY1("D1", "cd29a4cd9162076e9a18495fe56a48f3"),
Common::EN_GRB,
Common::kPlatformPC,
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index 3a609cb8d4..2bf36bbdbd 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -266,13 +266,13 @@ int32 prepareWordRender(int32 inRightBorder_X, int16 wordSpacingWidth,
return counter;
}
-void drawString(int32 x, int32 y, const char *string, uint8 *buffer, uint8 fontColour, int32 rightBorder_X) {
+void drawString(int32 x, int32 y, const char *string, uint8 *buffer, uint8 fontColor, int32 rightBorder_X) {
// Get the rendered text to display
gfxEntryStruct *s = renderText(rightBorder_X, string);
// Draw the message
- drawMessage(s, x, y, rightBorder_X - x, fontColour, buffer);
+ drawMessage(s, x, y, rightBorder_X - x, fontColor, buffer);
// Free the data
delete s->imagePtr;
diff --git a/engines/cruise/font.h b/engines/cruise/font.h
index 849c074ac5..17bb4372cf 100644
--- a/engines/cruise/font.h
+++ b/engines/cruise/font.h
@@ -66,7 +66,7 @@ void renderWord(uint8 *fontPtr_Data, uint8 *outBufferPtr,
int32 drawPosPixel_X, int32 heightOff, int32 height, int32 param4,
int32 stringRenderBufferSize, int32 width, int32 charWidth);
gfxEntryStruct *renderText(int inRightBorder_X, const char *string);
-void drawString(int32 x, int32 y, const char *string, uint8 * buffer, uint8 fontColour,
+void drawString(int32 x, int32 y, const char *string, uint8 * buffer, uint8 fontColor,
int32 inRightBorder_X);
void freeGfx(gfxEntryStruct *pGfx);
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index f9ab193399..1b6f3942de 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -203,7 +203,7 @@ void gfxModuleData_gfxWaitVSync() {
void gfxModuleData_flip() {
}
-void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int colour) {
+void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int color) {
int xp, yp;
for (yp = 0; yp < height; ++yp) {
@@ -216,7 +216,7 @@ void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, i
int yDest = y + yp;
if ((v != 0) && (xDest >= 0) && (yDest >= 0) && (xDest < 320) && (yDest < 200))
- *destP = (v == 1) ? 0 : colour;
+ *destP = (v == 1) ? 0 : color;
}
}
}
@@ -324,10 +324,10 @@ void flip() {
g_system->updateScreen();
}
-void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 colour) {
+void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color) {
for (int y = y1; y < y2; ++y) {
byte *p = &gfxModuleData.pPage00[y * 320 + x1];
- Common::set_to(p, p + (x2 - x1), colour);
+ Common::set_to(p, p + (x2 - x1), color);
}
}
diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h
index 1dbc5afc9b..1ca2581af5 100644
--- a/engines/cruise/gfxModule.h
+++ b/engines/cruise/gfxModule.h
@@ -55,7 +55,7 @@ void gfxModuleData_flip();
void gfxModuleData_updatePalette();
void gfxModuleData_updateScreen();
-void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int colour);
+void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int color);
void gfxModuleData_gfxCopyScreen(const uint8 *sourcePtr, uint8 *destPtr);
void convertGfxFromMode4(const uint8 *sourcePtr, int width, int height, uint8 *destPtr);
void convertGfxFromMode5(const uint8 *sourcePtr, int width, int height, uint8 *destPtr);
@@ -67,7 +67,7 @@ void gfxModuleData_setPalEntries(const byte *ptr, int start, int num);
void gfxModuleData_setPal256(const byte *ptr);
void gfxModuleData_addDirtyRect(const Common::Rect &r);
void flip();
-void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 colour);
+void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color);
void resetBitmap(uint8 *dataPtr, int32 dataSize);
void switchBackground(const byte *newBg);
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index d7582ec31d..bc38e84d72 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -359,7 +359,7 @@ void AnimationManager::insert(Animation *anim, bool allocateIndex) {
}
void AnimationManager::drawScene(Surface *surf) {
- // Fill the screen with colour zero since some rooms may rely on the screen being black
+ // Fill the screen with color zero since some rooms may rely on the screen being black
_vm->_screen->getSurface()->fill(0);
sortAnimations();
@@ -498,8 +498,8 @@ const Animation *AnimationManager::getTopAnimation(int x, int y) const {
Animation *retval = NULL;
- // Get transparent colour for the current screen
- const int transparent = _vm->_screen->getSurface()->getTransparentColour();
+ // Get transparent color for the current screen
+ const int transparent = _vm->_screen->getSurface()->getTransparentColor();
for (it = _animations.reverse_begin(); it != _animations.end(); --it) {
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp
index 688458f3d4..d869d046f3 100644
--- a/engines/draci/font.cpp
+++ b/engines/draci/font.cpp
@@ -125,7 +125,7 @@ uint8 Font::getCharWidth(uint8 chr) const {
* @param ty Vertical offset on the surface
*/
-void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) const {
+void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_color) const {
assert(dst != NULL);
assert(tx >= 0);
assert(ty >= 0);
@@ -147,39 +147,39 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) co
int ySpaceLeft = dst->h - ty - 1;
int yPixelsToDraw = (_fontHeight < ySpaceLeft) ? _fontHeight : ySpaceLeft;
- int _transparent = dst->getTransparentColour();
+ int _transparent = dst->getTransparentColor();
for (int y = 0; y < yPixelsToDraw; ++y) {
for (int x = 0; x <= xPixelsToDraw; ++x) {
int curr = y * _maxCharWidth + x;
- int colour = _charData[charOffset + curr];
+ int color = _charData[charOffset + curr];
// If pixel is transparent, skip it
- if (colour == _transparent)
+ if (color == _transparent)
continue;
- // Replace colour with font colours
- switch (colour) {
+ // Replace color with font colors
+ switch (color) {
case 254:
- colour = with_colour;
+ color = with_color;
break;
case 253:
- colour = kFontColour2;
+ color = kFontColor2;
break;
case 252:
- colour = kFontColour3;
+ color = kFontColor3;
break;
case 251:
- colour = kFontColour4;
+ color = kFontColor4;
break;
}
// Paint the pixel
- ptr[x] = colour;
+ ptr[x] = color;
}
// Advance to next row
@@ -198,8 +198,8 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) co
* @param spacing Space to leave between individual characters. Defaults to 0.
*/
void Font::drawString(Surface *dst, const byte *str, uint len,
- int x, int y, int with_colour, int spacing, bool markDirty) const {
- drawString(dst, Common::String((const char *)str, len), x, y, with_colour, spacing, markDirty);
+ int x, int y, int with_color, int spacing, bool markDirty) const {
+ drawString(dst, Common::String((const char *)str, len), x, y, with_color, spacing, markDirty);
}
/**
@@ -213,7 +213,7 @@ void Font::drawString(Surface *dst, const byte *str, uint len,
*/
void Font::drawString(Surface *dst, const Common::String &str,
- int x, int y, int with_colour, int spacing, bool markDirty) const {
+ int x, int y, int with_color, int spacing, bool markDirty) const {
assert(dst != NULL);
assert(x >= 0);
assert(y >= 0);
@@ -238,7 +238,7 @@ void Font::drawString(Surface *dst, const Common::String &str,
break;
}
- drawChar(dst, str[i], curx, cury, with_colour);
+ drawChar(dst, str[i], curx, cury, with_color);
curx += getCharWidth(str[i]) + spacing;
}
diff --git a/engines/draci/font.h b/engines/draci/font.h
index 010de66e2c..0ccc900465 100644
--- a/engines/draci/font.h
+++ b/engines/draci/font.h
@@ -36,19 +36,19 @@ extern const char * const kFontBig;
class Surface;
/**
- * Default font colours. They all seem to remain constant except for the
+ * Default font colors. They all seem to remain constant except for the
* first one which varies depending on the character speaking.
- * kOverFontColour is set to transparent.
+ * kOverFontColor is set to transparent.
*/
enum {
- kFontColour1 = 2,
- kFontColour2 = 0,
- kFontColour3 = 3,
- kFontColour4 = 4,
- kOverFontColour = 255,
- kTitleColour = 255,
- kLineActiveColour = 254,
- kLineInactiveColour = 255
+ kFontColor1 = 2,
+ kFontColor2 = 0,
+ kFontColor3 = 3,
+ kFontColor4 = 4,
+ kOverFontColor = 255,
+ kTitleColor = 255,
+ kLineActiveColor = 254,
+ kLineInactiveColor = 255
};
/**
@@ -64,12 +64,12 @@ public:
uint8 getFontHeight() const { return _fontHeight; }
uint8 getMaxCharWidth() const { return _maxCharWidth; }
uint8 getCharWidth(byte chr) const;
- void drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) const;
+ void drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_color) const;
- void drawString(Surface *dst, const byte *str, uint len, int x, int y, int with_colour,
+ void drawString(Surface *dst, const byte *str, uint len, int x, int y, int with_color,
int spacing, bool markDirty) const;
void drawString(Surface *dst, const Common::String &str,
- int x, int y, int with_colour, int spacing, bool markDirty) const;
+ int x, int y, int with_color, int spacing, bool markDirty) const;
uint getStringWidth(const Common::String &str, int spacing) const;
uint getStringHeight(const Common::String &str) const;
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 060ee41077..e19ec67810 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -47,9 +47,9 @@ static const char *dialoguePath = "ROZH";
static double real_to_double(byte real[6]);
enum {
- kWalkingMapOverlayColour = 2,
- kWalkingShortestPathOverlayColour = 120,
- kWalkingObliquePathOverlayColour = 73
+ kWalkingMapOverlayColor = 2,
+ kWalkingShortestPathOverlayColor = 120,
+ kWalkingObliquePathOverlayColor = 73
};
Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {
@@ -69,7 +69,7 @@ Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {
for (i = 0; i < numPersons; ++i) {
_persons[i]._x = personData.readUint16LE();
_persons[i]._y = personData.readUint16LE();
- _persons[i]._fontColour = personData.readByte();
+ _persons[i]._fontColor = personData.readByte();
}
// Read in dialogue offsets
@@ -217,12 +217,12 @@ void Game::init() {
// Initialize animation for object / room titles
_titleAnim = new Animation(_vm, kTitleText, 257, true);
- _titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColour, 0, 0, 0), NULL);
+ _titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColor, 0, 0, 0), NULL);
_vm->_anims->insert(_titleAnim, false);
// Initialize animation for speech text
Animation *speechAnim = new Animation(_vm, kSpeechText, 257, true);
- speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColour1, 0, 0, 0), NULL);
+ speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColor1, 0, 0, 0), NULL);
_vm->_anims->insert(speechAnim, false);
// Initialize inventory animation. _iconsArchive is never flushed.
@@ -236,7 +236,7 @@ void Game::init() {
for (uint i = 0; i < kDialogueLines; ++i) {
_dialogueAnims[i] = new Animation(_vm, kDialogueLinesID - i, 254, true);
- _dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColour, 0, 0, 0), NULL);
+ _dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColor, 0, 0, 0), NULL);
_dialogueAnims[i]->setRelative(1,
kScreenHeight - (i + 1) * _vm->_smallFont->getFontHeight());
@@ -418,9 +418,9 @@ void Game::handleDialogueLoop() {
text = reinterpret_cast<Text *>(_dialogueAnims[i]->getCurrentFrame());
if (_animUnderCursor == _dialogueAnims[i]) {
- text->setColour(kLineActiveColour);
+ text->setColor(kLineActiveColor);
} else {
- text->setColour(kLineInactiveColour);
+ text->setColor(kLineInactiveColor);
}
}
@@ -442,7 +442,7 @@ void Game::fadePalette(bool fading_out) {
}
for (int i = 1; i <= kBlackFadingIterations; ++i) {
_vm->_system->delayMillis(kBlackFadingTimeUnit);
- _vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColours, i, kBlackFadingIterations);
+ _vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColors, i, kBlackFadingIterations);
_vm->_screen->copyToScreen();
}
}
@@ -454,7 +454,7 @@ void Game::advanceAnimationsAndTestLoopExit() {
--_fadePhase;
const byte *startPal = _currentRoom._palette >= 0 ? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data : NULL;
const byte *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette())->_data : NULL;
- _vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColours, _fadePhases - _fadePhase, _fadePhases);
+ _vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColors, _fadePhases - _fadePhase, _fadePhases);
if (_fadePhase == 0) {
if (_loopSubstatus == kInnerWhileFade) {
setExitLoop(true);
@@ -997,7 +997,7 @@ int Game::dialogueDraw() {
dialogueLine = reinterpret_cast<Text *>(anim->getCurrentFrame());
dialogueLine->setText(_dialogueBlocks[i]._title);
- dialogueLine->setColour(kLineInactiveColour);
+ dialogueLine->setColor(kLineInactiveColor);
_lines[_dialogueLinesNum] = i;
_dialogueLinesNum++;
}
@@ -1114,8 +1114,8 @@ int Game::playHeroAnimation(int anim_index) {
return anim->currentFrameNum();
}
-void Game::redrawWalkingPath(Animation *anim, byte colour, const WalkingPath &path) {
- Sprite *ov = _walkingMap.newOverlayFromPath(path, colour);
+void Game::redrawWalkingPath(Animation *anim, byte color, const WalkingPath &path) {
+ Sprite *ov = _walkingMap.newOverlayFromPath(path, color);
delete anim->getFrame(0);
anim->replaceFrame(0, ov, NULL);
anim->markDirtyRect(_vm->_screen->getSurface());
@@ -1148,8 +1148,8 @@ void Game::walkHero(int x, int y, SightDirection dir) {
_walkingMap.obliquePath(shortestPath, &obliquePath);
debugC(2, kDraciWalkingDebugLevel, "Walking path lengths: shortest=%d oblique=%d", shortestPath.size(), obliquePath.size());
if (_vm->_showWalkingMap) {
- redrawWalkingPath(_walkingShortestPathOverlay, kWalkingShortestPathOverlayColour, shortestPath);
- redrawWalkingPath(_walkingObliquePathOverlay, kWalkingObliquePathOverlayColour, obliquePath);
+ redrawWalkingPath(_walkingShortestPathOverlay, kWalkingShortestPathOverlayColor, shortestPath);
+ redrawWalkingPath(_walkingObliquePathOverlay, kWalkingObliquePathOverlayColor, obliquePath);
}
// Start walking. Walking will be gradually advanced by
@@ -1211,7 +1211,7 @@ void Game::loadWalkingMap(int mapID) {
f = _vm->_walkingMapsArchive->getFile(mapID);
_walkingMap.load(f->_data, f->_length);
- Sprite *ov = _walkingMap.newOverlayFromMap(kWalkingMapOverlayColour);
+ Sprite *ov = _walkingMap.newOverlayFromMap(kWalkingMapOverlayColor);
delete _walkingMapOverlay->getFrame(0);
_walkingMapOverlay->replaceFrame(0, ov, NULL);
_walkingMapOverlay->markDirtyRect(_vm->_screen->getSurface());
@@ -1385,7 +1385,7 @@ void Game::enterNewRoom() {
loadOverlays();
// Draw the scene with the black palette and slowly fade into the right palette.
- _vm->_screen->setPalette(NULL, 0, kNumColours);
+ _vm->_screen->setPalette(NULL, 0, kNumColors);
_vm->_anims->drawScene(_vm->_screen->getSurface());
_vm->_screen->copyToScreen();
fadePalette(false);
diff --git a/engines/draci/game.h b/engines/draci/game.h
index 21baaed5cc..0ecbcf68f0 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -145,7 +145,7 @@ public:
struct Person {
uint _x, _y;
- byte _fontColour;
+ byte _fontColor;
};
struct Dialogue {
@@ -348,7 +348,7 @@ private:
void enterNewRoom();
void initWalkingOverlays();
void loadRoomObjects();
- void redrawWalkingPath(Animation *anim, byte colour, const WalkingPath &path);
+ void redrawWalkingPath(Animation *anim, byte color, const WalkingPath &path);
DraciEngine *_vm;
diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp
index 14d1162fed..d493fe192f 100644
--- a/engines/draci/mouse.cpp
+++ b/engines/draci/mouse.cpp
@@ -106,7 +106,7 @@ void Mouse::setCursorType(CursorType cur) {
f = _vm->_iconsArchive->getFile(cur);
Sprite sp(f->_data, f->_length, 0, 0, true);
- CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
+ CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColors);
CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),
sp.getWidth() / 2, sp.getHeight() / 2, 255);
}
@@ -124,7 +124,7 @@ void Mouse::loadItemCursor(const GameItem *item, bool highlighted) {
f = _vm->_itemImagesArchive->getFile(archiveIndex);
Sprite sp(f->_data, f->_length, 0, 0, true);
- CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
+ CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColors);
CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),
sp.getWidth() / 2, sp.getHeight() / 2, 255);
}
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp
index dbe3fd98b8..c04f0668bb 100644
--- a/engines/draci/screen.cpp
+++ b/engines/draci/screen.cpp
@@ -36,12 +36,12 @@ namespace Draci {
Screen::Screen(DraciEngine *vm) : _vm(vm) {
_surface = new Surface(kScreenWidth, kScreenHeight);
- _palette = new byte[3 * kNumColours];
- _blackPalette = new byte[3 * kNumColours];
- for (int i = 0; i < 3 * kNumColours; ++i) {
+ _palette = new byte[3 * kNumColors];
+ _blackPalette = new byte[3 * kNumColors];
+ for (int i = 0; i < 3 * kNumColors; ++i) {
_blackPalette[i] = 0;
}
- setPalette(NULL, 0, kNumColours);
+ setPalette(NULL, 0, kNumColors);
this->clearScreen();
}
@@ -54,11 +54,11 @@ Screen::~Screen() {
/**
* @brief Sets a part of the palette
* @param data Pointer to a buffer containing new palette data
- * start Index of the colour where replacement should start
- * num Number of colours to replace
+ * start Index of the color where replacement should start
+ * num Number of colors to replace
*/
void Screen::setPalette(const byte *data, uint16 start, uint16 num) {
- Common::MemoryReadStream pal(data ? data : _blackPalette, 3 * kNumColours);
+ Common::MemoryReadStream pal(data ? data : _blackPalette, 3 * kNumColors);
pal.seek(start * 3);
// Copy the palette
@@ -78,8 +78,8 @@ void Screen::setPalette(const byte *data, uint16 start, uint16 num) {
}
void Screen::interpolatePalettes(const byte *first, const byte *second, uint16 start, uint16 num, int index, int number) {
- Common::MemoryReadStream firstPal(first ? first : _blackPalette, 3 * kNumColours);
- Common::MemoryReadStream secondPal(second ? second : _blackPalette, 3 * kNumColours);
+ Common::MemoryReadStream firstPal(first ? first : _blackPalette, 3 * kNumColors);
+ Common::MemoryReadStream secondPal(second ? second : _blackPalette, 3 * kNumColors);
firstPal.seek(start * 3);
secondPal.seek(start * 3);
diff --git a/engines/draci/screen.h b/engines/draci/screen.h
index dc1aca092d..e4e910475a 100644
--- a/engines/draci/screen.h
+++ b/engines/draci/screen.h
@@ -33,7 +33,7 @@ namespace Draci {
enum ScreenParameters {
kScreenWidth = 320,
kScreenHeight = 200,
- kNumColours = 256,
+ kNumColors = 256,
kDefaultTransparent = 255
};
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 2a27541ad9..a7ce8b27d9 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -716,14 +716,14 @@ void Script::talk(const Common::Array<int> &params) {
SoundSample *sample = _vm->_sound->isMutedVoice()
? NULL : _vm->_dubbingArchive->getSample(sentenceID, 0);
- // Set the string and text colour
+ // Set the string and text color
surface->markDirtyRect(speechFrame->getRect(kNoDisplacement));
if (_vm->_sound->showSubtitles() || !sample) {
speechFrame->setText(Common::String((const char *)f->_data+1, f->_length-1));
} else {
speechFrame->setText("");
}
- speechFrame->setColour(person->_fontColour);
+ speechFrame->setColor(person->_fontColor);
speechFrame->repeatedlySplitLongLines(kScreenWidth);
// Speak the dubbing if possible
@@ -873,11 +873,11 @@ void Script::fadePalettePlay(const Common::Array<int> &params) {
void Script::setPalette(const Common::Array<int> &params) {
if (_vm->_game->getScheduledPalette() == -1) {
- _vm->_screen->setPalette(NULL, 0, kNumColours);
+ _vm->_screen->setPalette(NULL, 0, kNumColors);
} else {
const BAFile *f;
f = _vm->_paletteArchive->getFile(_vm->_game->getScheduledPalette());
- _vm->_screen->setPalette(f->_data, 0, kNumColours);
+ _vm->_screen->setPalette(f->_data, 0, kNumColors);
}
// Immediately update the palette
_vm->_screen->copyToScreen();
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp
index 65c6e21ee4..b4296375f2 100644
--- a/engines/draci/sprite.cpp
+++ b/engines/draci/sprite.cpp
@@ -144,7 +144,7 @@ void Sprite::drawReScaled(Surface *surface, bool markDirty, const Displacement &
// Get pointers to source and destination buffers
byte *dst = (byte *)surface->getBasePtr(clippedDestRect.left, clippedDestRect.top);
- const int transparent = surface->getTransparentColour();
+ const int transparent = surface->getTransparentColor();
// Calculate how many rows and columns we need to draw
const int rows = clippedDestRect.height();
@@ -212,7 +212,7 @@ void Sprite::draw(Surface *surface, bool markDirty, int relX, int relY) const {
const byte *src = _data + croppedBy.y * _width +
(!_mirror ? croppedBy.x : _width - 1 - croppedBy.x);
- const int transparent = surface->getTransparentColour();
+ const int transparent = surface->getTransparentColor();
// Calculate how many rows and columns we need to draw
const int rows = clippedDestRect.height();
@@ -252,7 +252,7 @@ Common::Rect Sprite::getRect(const Displacement &displacement) const {
_y + displacement.relY + scummvm_lround(_scaledHeight * displacement.extraScaleY));
}
-Text::Text(const Common::String &str, const Font *font, byte fontColour,
+Text::Text(const Common::String &str, const Font *font, byte fontColor,
int x, int y, uint spacing) {
_x = x;
_y = y;
@@ -268,7 +268,7 @@ Text::Text(const Common::String &str, const Font *font, byte fontColour,
}
_spacing = spacing;
- _colour = fontColour;
+ _color = fontColor;
_font = font;
@@ -294,7 +294,7 @@ void Text::setText(const Common::String &str) {
}
void Text::draw(Surface *surface, bool markDirty, int relX, int relY) const {
- _font->drawString(surface, _text, _x + relX, _y + relY, _colour, _spacing, true);
+ _font->drawString(surface, _text, _x + relX, _y + relY, _color, _spacing, true);
}
Common::Rect Text::getRect(const Displacement &displacement) const {
diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h
index ddc56ecd80..15e1cf80ca 100644
--- a/engines/draci/sprite.h
+++ b/engines/draci/sprite.h
@@ -139,12 +139,12 @@ private:
class Text : public Drawable {
public:
- Text(const Common::String &str, const Font *font, byte fontColour,
+ Text(const Common::String &str, const Font *font, byte fontColor,
int x, int y, uint spacing);
~Text() {}
void setText(const Common::String &str);
- void setColour(byte fontColour) { _colour = fontColour; }
+ void setColor(byte fontColor) { _color = fontColor; }
void setSpacing(uint spacing) { _spacing = spacing; }
void setFont(const Font *font);
@@ -165,7 +165,7 @@ private:
Common::String _text;
uint _length;
- uint8 _colour;
+ uint8 _color;
uint _spacing;
const Font *_font;
};
diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp
index 1c7ecfb23b..532d87a19f 100644
--- a/engines/draci/surface.cpp
+++ b/engines/draci/surface.cpp
@@ -31,7 +31,7 @@ namespace Draci {
Surface::Surface(int width, int height) {
this->create(width, height, 1);
this->markClean();
- _transparentColour = kDefaultTransparent;
+ _transparentColor = kDefaultTransparent;
}
Surface::~Surface() {
@@ -80,12 +80,12 @@ void Surface::markClean() {
}
/**
- * @brief Fills the surface with the specified colour
+ * @brief Fills the surface with the specified color
*/
-void Surface::fill(uint colour) {
+void Surface::fill(uint color) {
byte *ptr = (byte *)getBasePtr(0, 0);
- memset(ptr, colour, w * h);
+ memset(ptr, color, w * h);
}
/**
diff --git a/engines/draci/surface.h b/engines/draci/surface.h
index a5c9ddb597..b00abcd943 100644
--- a/engines/draci/surface.h
+++ b/engines/draci/surface.h
@@ -43,18 +43,18 @@ public:
void markDirty();
void markClean();
bool needsFullUpdate() const { return _fullUpdate; }
- uint getTransparentColour() const { return _transparentColour; }
- void setTransparentColour(uint colour) { _transparentColour = colour; }
- void fill(uint colour);
+ uint getTransparentColor() const { return _transparentColor; }
+ void setTransparentColor(uint color) { _transparentColor = color; }
+ void fill(uint color);
uint putAboveY(int y, int height) const;
uint centerOnX(int x, int width) const;
Common::Rect getDimensions() const { return Common::Rect(w, h); }
private:
- /** The current transparent colour of the surface. See getTransparentColour() and
- * setTransparentColour().
+ /** The current transparent color of the surface. See getTransparentColor() and
+ * setTransparentColor().
*/
- uint _transparentColour;
+ uint _transparentColor;
/** Set when the surface is scheduled for a full update.
* See markDirty(), markClean(). Accessed via needsFullUpdate().
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index c6f9a58a85..d72e50be07 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -58,7 +58,7 @@ bool WalkingMap::isWalkable(const Common::Point &p) const {
return getPixel(p.x / _deltaX, p.y / _deltaY);
}
-Sprite *WalkingMap::newOverlayFromMap(byte colour) const {
+Sprite *WalkingMap::newOverlayFromMap(byte color) const {
// HACK: Create a visible overlay from the walking map so we can test it
byte *wlk = new byte[_realWidth * _realHeight];
memset(wlk, 255, _realWidth * _realHeight);
@@ -66,7 +66,7 @@ Sprite *WalkingMap::newOverlayFromMap(byte colour) const {
for (int i = 0; i < _mapWidth; ++i) {
for (int j = 0; j < _mapHeight; ++j) {
if (getPixel(i, j)) {
- drawOverlayRectangle(Common::Point(i, j), colour, wlk);
+ drawOverlayRectangle(Common::Point(i, j), color, wlk);
}
}
}
@@ -285,7 +285,7 @@ void WalkingMap::obliquePath(const WalkingPath& path, WalkingPath *obliquedPath)
while (managedToOblique(obliquedPath)) {}
}
-Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) const {
+Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte color) const {
// HACK: Create a visible overlay from the walking map so we can test it
byte *wlk = new byte[_realWidth * _realHeight];
memset(wlk, 255, _realWidth * _realHeight);
@@ -297,14 +297,14 @@ Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) con
// Draw only points in the interval [v1, v2). These half-open
// half-closed intervals connect all the way to the last point.
for (int step = 0; step < steps; ++step) {
- drawOverlayRectangle(interpolate(v1, v2, step, steps), colour, wlk);
+ drawOverlayRectangle(interpolate(v1, v2, step, steps), color, wlk);
}
}
// Draw the last point. This works also when the path has no segment,
// but just one point.
if (path.size() > 0) {
const Common::Point &vLast = path[path.size()-1];
- drawOverlayRectangle(vLast, colour, wlk);
+ drawOverlayRectangle(vLast, color, wlk);
}
Sprite *ov = new Sprite(_realWidth, _realHeight, wlk, 0, 0, false);
@@ -313,10 +313,10 @@ Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) con
return ov;
}
-void WalkingMap::drawOverlayRectangle(const Common::Point &p, byte colour, byte *buf) const {
+void WalkingMap::drawOverlayRectangle(const Common::Point &p, byte color, byte *buf) const {
for (int i = 0; i < _deltaX; ++i) {
for (int j = 0; j < _deltaY; ++j) {
- buf[(p.y * _deltaY + j) * _realWidth + (p.x * _deltaX + i)] = colour;
+ buf[(p.y * _deltaY + j) * _realWidth + (p.x * _deltaX + i)] = color;
}
}
}
diff --git a/engines/draci/walking.h b/engines/draci/walking.h
index 55b39792f1..d6c7f0691d 100644
--- a/engines/draci/walking.h
+++ b/engines/draci/walking.h
@@ -45,12 +45,12 @@ public:
bool getPixel(int x, int y) const;
bool isWalkable(const Common::Point &p) const;
- Sprite *newOverlayFromMap(byte colour) const;
+ Sprite *newOverlayFromMap(byte color) const;
Common::Point findNearestWalkable(int x, int y) const;
bool findShortestPath(Common::Point p1, Common::Point p2, WalkingPath *path) const;
void obliquePath(const WalkingPath& path, WalkingPath *obliquedPath);
- Sprite *newOverlayFromPath(const WalkingPath &path, byte colour) const;
+ Sprite *newOverlayFromPath(const WalkingPath &path, byte color) const;
Common::Point getDelta() const { return Common::Point(_deltaX, _deltaY); }
static int pointsBetween(const Common::Point &p1, const Common::Point &p2);
@@ -68,7 +68,7 @@ private:
// 4 possible directions to walk from a pixel.
static const int kDirections[][2];
- void drawOverlayRectangle(const Common::Point &p, byte colour, byte *buf) const;
+ void drawOverlayRectangle(const Common::Point &p, byte color, byte *buf) const;
bool lineIsCovered(const Common::Point &p1, const Common::Point &p2) const;
// Returns true if the number of vertices on the path was decreased.
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp
index 5d4ccf7d91..9c4e6fb2fa 100644
--- a/engines/groovie/resource.cpp
+++ b/engines/groovie/resource.cpp
@@ -92,7 +92,7 @@ ResMan_t7g::ResMan_t7g(Common::MacResManager *macResFork) : _macResFork(macResFo
}
}
-uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) {
+uint32 ResMan_t7g::getRef(Common::String name, Common::String scriptname) {
// Get the name of the RL file
Common::String rlFileName(t7g_gjds[_lastGjd]);
rlFileName += ".rl";
@@ -110,7 +110,7 @@ uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) {
if (!rlFile)
error("Groovie::Resource: Couldn't open %s", rlFileName.c_str());
- uint16 resNum;
+ uint32 resNum;
bool found = false;
for (resNum = 0; !found && !rlFile->err() && !rlFile->eos(); resNum++) {
// Read the resource name
@@ -134,7 +134,7 @@ uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) {
// Verify we really found the resource
if (!found) {
error("Groovie::Resource: Couldn't find resource %s in %s", name.c_str(), rlFileName.c_str());
- return (uint16)-1;
+ return (uint32)-1;
}
return (_lastGjd << 10) | (resNum - 1);
@@ -217,8 +217,42 @@ ResMan_v2::ResMan_v2() {
indexfile.close();
}
-uint16 ResMan_v2::getRef(Common::String name, Common::String scriptname) {
- return 0;
+uint32 ResMan_v2::getRef(Common::String name, Common::String scriptname) {
+ // Open the RL file
+ Common::File rlFile;
+ if (!rlFile.open("dir.rl")) {
+ error("Groovie::Resource: Couldn't open dir.rl");
+ return false;
+ }
+
+ uint32 resNum;
+ bool found = false;
+ for (resNum = 0; !found && !rlFile.err() && !rlFile.eos(); resNum++) {
+ // Seek past metadata
+ rlFile.seek(14, SEEK_CUR);
+
+ // Read the resource name
+ char readname[18];
+ rlFile.read(readname, 18);
+
+ // Test whether it's the resource we're searching
+ Common::String resname(readname, 18);
+ if (resname.hasPrefix(name.c_str())) {
+ debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str());
+ found = true;
+ }
+ }
+
+ // Close the RL file
+ rlFile.close();
+
+ // Verify we really found the resource
+ if (!found) {
+ error("Groovie::Resource: Couldn't find resource %s", name.c_str());
+ return (uint32)-1;
+ }
+
+ return resNum;
}
bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) {
diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h
index ca2ea177cb..37fa50f2ea 100644
--- a/engines/groovie/resource.h
+++ b/engines/groovie/resource.h
@@ -43,7 +43,7 @@ public:
virtual ~ResMan() {}
Common::SeekableReadStream *open(uint32 fileRef);
- virtual uint16 getRef(Common::String name, Common::String scriptname = "") = 0;
+ virtual uint32 getRef(Common::String name, Common::String scriptname = "") = 0;
protected:
Common::Array<Common::String> _gjds;
@@ -57,7 +57,7 @@ public:
ResMan_t7g(Common::MacResManager *macResFork = 0);
~ResMan_t7g() {}
- uint16 getRef(Common::String name, Common::String scriptname);
+ uint32 getRef(Common::String name, Common::String scriptname);
bool getResInfo(uint32 fileRef, ResInfo &resInfo);
private:
@@ -69,7 +69,7 @@ public:
ResMan_v2();
~ResMan_v2() {}
- uint16 getRef(Common::String name, Common::String scriptname);
+ uint32 getRef(Common::String name, Common::String scriptname);
bool getResInfo(uint32 fileRef, ResInfo &resInfo);
};
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 4abfff74f2..9b58f8bd5a 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -320,7 +320,7 @@ uint8 Script::readScriptChar(bool allow7C, bool limitVal, bool limitVar) {
return result;
}
-uint16 Script::getVideoRefString() {
+uint32 Script::getVideoRefString() {
Common::String str;
byte c;
@@ -717,7 +717,7 @@ void Script::o_hotspot_center() {
debugScript(5, true, "HOTSPOT-CENTER @0x%04X", address);
- // Mark the centremost 240 pixels of the game area
+ // Mark the centermost 240 pixels of the game area
Common::Rect rect(200, 80, 440, 400);
hotspot(rect, address, 0);
}
@@ -1015,7 +1015,7 @@ void Script::o_add() {
void Script::o_videofromstring1() {
uint16 instStart = _currentInstruction;
- uint16 fileref = getVideoRefString();
+ uint32 fileref = getVideoRefString();
// Show the debug information just when starting the playback
if (fileref != _videoRef) {
@@ -1031,7 +1031,7 @@ void Script::o_videofromstring1() {
void Script::o_videofromstring2() {
uint16 instStart = _currentInstruction;
- uint16 fileref = getVideoRefString();
+ uint32 fileref = getVideoRefString();
// Show the debug information just when starting the playback
if (fileref != _videoRef) {
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index cda87a8917..b959810bb6 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -137,7 +137,7 @@ private:
uint16 readScript8or16bits();
uint8 readScriptChar(bool allow7C, bool limitVal, bool limitVar);
uint8 readScriptVar();
- uint16 getVideoRefString();
+ uint32 getVideoRefString();
bool hotspot(Common::Rect rect, uint16 addr, uint8 cursor);
diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp
index 1b4a2b7800..6643177328 100644
--- a/engines/groovie/vdx.cpp
+++ b/engines/groovie/vdx.cpp
@@ -70,7 +70,7 @@ uint16 VDXPlayer::loadInternal() {
}
// Flags:
// - 1 Puzzle piece? Skip palette, don't redraw full screen, draw still to b/ack buffer
- // - 2 Transparent colour is 0xFF
+ // - 2 Transparent color is 0xFF
// - 5 Skip still chunks
// - 7
// - 8 Just show the first frame
@@ -251,26 +251,26 @@ void VDXPlayer::getDelta(Common::ReadStream *in) {
uint16 currentLine = 0;
uint32 offset = 0;
while (!in->eos()) {
- byte colours[16];
+ byte colors[16];
if (currOpCode < 0x60) {
param1 = in->readByte();
param2 = in->readByte();
- expandColourMap(colours, vdxBlockMapLookup[currOpCode], param1, param2);
- decodeBlockDelta(offset, colours, 640);
+ expandColorMap(colors, vdxBlockMapLookup[currOpCode], param1, param2);
+ decodeBlockDelta(offset, colors, 640);
offset += TILE_SIZE;
} else if (currOpCode > 0x7f) {
param1 = in->readByte();
param2 = in->readByte();
param3 = in->readByte();
- expandColourMap(colours, (param1 << 8) + currOpCode, param2, param3);
- decodeBlockDelta(offset, colours, 640);
+ expandColorMap(colors, (param1 << 8) + currOpCode, param2, param3);
+ decodeBlockDelta(offset, colors, 640);
offset += TILE_SIZE;
} else switch (currOpCode) {
- case 0x60: /* Fill tile with the 16 colours given as parameters */
+ case 0x60: /* Fill tile with the 16 colors given as parameters */
for (l = 0; l < 16; l++) {
- colours[l] = in->readByte();
+ colors[l] = in->readByte();
}
- decodeBlockDelta(offset, colours, 640);
+ decodeBlockDelta(offset, colors, 640);
offset += TILE_SIZE;
break;
case 0x61: /* Skip to the end of this line, next block is start of next */
@@ -299,14 +299,14 @@ void VDXPlayer::getDelta(Common::ReadStream *in) {
case 0x72:
case 0x73:
case 0x74:
- case 0x75: /* Next param1 blocks are filled with colour param2 */
+ case 0x75: /* Next param1 blocks are filled with color param2 */
param1 = currOpCode - 0x6b;
param2 = in->readByte();
for (l = 0; l < 16; l++) {
- colours[l] = param2;
+ colors[l] = param2;
}
for (k = 0; k < param1; k++) {
- decodeBlockDelta(offset, colours, 640);
+ decodeBlockDelta(offset, colors, 640);
offset += TILE_SIZE;
}
break;
@@ -319,14 +319,14 @@ void VDXPlayer::getDelta(Common::ReadStream *in) {
case 0x7c:
case 0x7d:
case 0x7e:
- case 0x7f: /* Next bytes contain colours to fill the next param1 blocks in the current line*/
+ case 0x7f: /* Next bytes contain colors to fill the next param1 blocks in the current line*/
param1 = currOpCode - 0x75;
for (k = 0; k < param1; k++) {
param2 = in->readByte();
for (l = 0; l < 16; l++) {
- colours[l] = param2;
+ colors[l] = param2;
}
- decodeBlockDelta(offset, colours, 640);
+ decodeBlockDelta(offset, colors, 640);
offset += TILE_SIZE;
}
break;
@@ -344,8 +344,8 @@ void VDXPlayer::getStill(Common::ReadStream *in) {
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numYTiles=%d", numYTiles);
// It's skipped in the original:
- uint16 colourDepth = in->readUint16LE();
- debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colourDepth=%d", colourDepth);
+ uint16 colorDepth = in->readUint16LE();
+ debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colorDepth=%d", colorDepth);
uint16 imageWidth = TILE_SIZE * numXTiles;
@@ -378,15 +378,15 @@ void VDXPlayer::getStill(Common::ReadStream *in) {
// Skip the frame when flag 5 is set, unless flag 1 is set
if (!_flagFive || _flagOne) {
- byte colours[16];
+ byte colors[16];
for (uint16 j = 0; j < numYTiles; j++) {
byte *currentTile = buf + j * TILE_SIZE * imageWidth;
for (uint16 i = numXTiles; i; i--) {
- uint8 colour1 = in->readByte();
- uint8 colour0 = in->readByte();
- uint16 colourMap = in->readUint16LE();
- expandColourMap(colours, colourMap, colour1, colour0);
- decodeBlockStill(currentTile, colours, 640, mask);
+ uint8 color1 = in->readByte();
+ uint8 color0 = in->readByte();
+ uint16 colorMap = in->readUint16LE();
+ expandColorMap(colors, colorMap, color1, color0);
+ decodeBlockStill(currentTile, colors, 640, mask);
currentTile += TILE_SIZE;
}
@@ -425,22 +425,22 @@ void VDXPlayer::getStill(Common::ReadStream *in) {
}
}
-void VDXPlayer::expandColourMap(byte *out, uint16 colourMap, uint8 colour1, uint8 colour0) {
+void VDXPlayer::expandColorMap(byte *out, uint16 colorMap, uint8 color1, uint8 color0) {
// It's a bit faster to start from the end
out += 16;
for (int i = 16; i; i--) {
- // Set the corresponding colour
+ // Set the corresponding color
// The following is an optimized version of:
- // *--out = (colourMap & 1) ? colour1 : colour0;
- uint8 selector = -(colourMap & 1);
- *--out = (selector & colour1) | (~selector & colour0);
+ // *--out = (colorMap & 1) ? color1 : color0;
+ uint8 selector = -(colorMap & 1);
+ *--out = (selector & color1) | (~selector & color0);
- // Update the flag map to test the next colour
- colourMap >>= 1;
+ // Update the flag map to test the next color
+ colorMap >>= 1;
}
}
-void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, uint8 mask) {
+void VDXPlayer::decodeBlockStill(byte *buf, byte *colors, uint16 imageWidth, uint8 mask) {
assert(TILE_SIZE == 4);
for (int y = TILE_SIZE; y; y--) {
@@ -448,15 +448,15 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui
// TODO: optimize with bit logic?
for (int x = 0; x < TILE_SIZE; x++) {
// 0xff pixels don't modify the buffer
- if (*colours != 0xff) {
- // Write the colour
- *buf = *colours | mask;
+ if (*colors != 0xff) {
+ // Write the color
+ *buf = *colors | mask;
// Note: if the mask is 0, it paints the image
// else, it paints the image's mask using 0xff
}
- // Point to the next colour
- colours++;
+ // Point to the next color
+ colors++;
// Point to the next pixel
buf++;
@@ -465,8 +465,8 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui
// Point to the start of the next line
buf += imageWidth - TILE_SIZE;
} else {
- *((uint32 *)buf) = *((uint32 *)colours);
- colours += 4;
+ *((uint32 *)buf) = *((uint32 *)colors);
+ colors += 4;
// Point to the start of the next line
buf += imageWidth;
@@ -474,7 +474,7 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui
}
}
-void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth) {
+void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth) {
assert(TILE_SIZE == 4);
byte *dest;
@@ -501,19 +501,19 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth
for (int x = 0; x < TILE_SIZE; x++) {
// TODO: this can probably be optimized with bit logic
if (fgBuf[x] != 0xff) {
- if (*colours == 0xff) {
+ if (*colors == 0xff) {
dest[x] = fgBuf[x];
} else {
- dest[x] = *colours;
+ dest[x] = *colors;
}
}
- colours++;
+ colors++;
}
fgBuf += imageWidth;
} else {
// Paint directly
- *((uint32 *)dest) = *((uint32 *)colours);
- colours += 4;
+ *((uint32 *)dest) = *((uint32 *)colors);
+ colors += 4;
}
// Move to the next line
diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h
index 0b29493108..38dd030bcb 100644
--- a/engines/groovie/vdx.h
+++ b/engines/groovie/vdx.h
@@ -73,9 +73,9 @@ private:
void getStill(Common::ReadStream *in);
void getDelta(Common::ReadStream *in);
- void expandColourMap(byte *out, uint16 colourMap, uint8 colour1, uint8 colour0);
- void decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, uint8 mask);
- void decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth);
+ void expandColorMap(byte *out, uint16 colorMap, uint8 color1, uint8 color0);
+ void decodeBlockStill(byte *buf, byte *colors, uint16 imageWidth, uint8 mask);
+ void decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth);
void chunkSound(Common::ReadStream *in);
void setPalette(uint8 *palette);
void fadeIn(uint8 *palette);
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index ead432c5df..096cea8a72 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -26,6 +26,7 @@
#include "common/substream.h"
#include "graphics/imagedec.h"
#include "gui/gui-manager.h"
+#include "gui/ThemeEval.h"
#include "hugo/hugo.h"
#include "hugo/display.h"
@@ -231,12 +232,52 @@ void TopMenu::handleMouseUp(int x, int y, int button, int clickCount) {
}
EntryDialog::EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue) : GUI::Dialog(20, 20, 100, 50) {
- new GUI::StaticTextWidget(this, 0, 0, 10, 10, title, Graphics::kTextAlignCenter);
-
- _text = new GUI::EditTextWidget(this, 0, 0, 50, 10, "");
+ const int screenW = g_system->getOverlayWidth();
+ const int screenH = g_system->getOverlayHeight();
+
+ int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+ int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
+
+ // First, determine the size the dialog needs. For this we have to break
+ // down the string into lines, and taking the maximum of their widths.
+ // Using this, and accounting for the space the button(s) need, we can set
+ // the real size of the dialog
+ Common::Array<Common::String> lines;
+ int lineCount, buttonPos;
+ int maxlineWidth = g_gui.getFont().wordWrapText(title, screenW - 2 * 30, lines);
+
+ // Calculate the desired dialog size (maxing out at 300*180 for now)
+ _w = MAX(maxlineWidth, buttonWidth) + 20;
+
+ lineCount = lines.size();
+
+ _h = 16 + buttonHeight + 8;
+
+ // Limit the number of lines so that the dialog still fits on the screen.
+ if (lineCount > (screenH - 20 - _h) / kLineHeight) {
+ lineCount = (screenH - 20 - _h) / kLineHeight;
+ }
+ _h += lineCount * kLineHeight;
+
+ // Center the dialog
+ _x = (screenW - _w) / 2;
+ _y = (screenH - _h) / 2;
+
+ // Each line is represented by one static text item.
+ for (int i = 0; i < lineCount; i++) {
+ new GUI::StaticTextWidget(this, 10, 10 + i * kLineHeight, maxlineWidth, kLineHeight,
+ lines[i], Graphics::kTextAlignCenter);
+ }
+
+ _text = new GUI::EditTextWidget(this, 10, 10 + lineCount * (kLineHeight + 1), _w - 20, kLineHeight, "", "", 0, kCmdFinishEdit);
_text->setEditString(defaultValue);
- new GUI::ButtonWidget(this, 20, 20, 30, 10, buttonLabel, 0, kCmdButton);
+ _h += kLineHeight + 5;
+
+ buttonPos = (_w - buttonWidth) / 2;
+
+ new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, buttonLabel, 0, kCmdButton, Common::ASCII_RETURN); // Confirm dialog
+
}
EntryDialog::~EntryDialog() {
@@ -245,6 +286,7 @@ EntryDialog::~EntryDialog() {
void EntryDialog::handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) {
switch (command) {
case kCmdButton:
+ case kCmdFinishEdit:
close();
break;
default:
@@ -252,11 +294,4 @@ void EntryDialog::handleCommand(GUI::CommandSender *sender, uint32 command, uint
}
}
-void EntryDialog::reflowLayout() {
-}
-
-void EntryDialog::init() {
-}
-
-
} // End of namespace Hugo
diff --git a/engines/hugo/dialogs.h b/engines/hugo/dialogs.h
index f870414a93..56dbd41f81 100644
--- a/engines/hugo/dialogs.h
+++ b/engines/hugo/dialogs.h
@@ -67,7 +67,8 @@ enum {
kCmdInvent = 'INVT',
// EntryDialog commands
- kCmdButton = 'BTNP'
+ kCmdButton = 'BTNP',
+ kCmdFinishEdit = 'FNSH'
};
class TopMenu : public GUI::Dialog {
@@ -105,14 +106,11 @@ public:
EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue);
virtual ~EntryDialog();
- void reflowLayout();
void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data);
const Common::String &getEditString() const { return _text->getEditString(); }
protected:
- void init();
-
GUI::EditTextWidget *_text;
};
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 45a2b77826..ca1583921e 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -1529,28 +1529,22 @@ void Scheduler_v1d::runScheduler() {
}
void Scheduler_v1d::promptAction(act *action) {
- Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
-
- warning("STUB: doAction(act3)");
- // TODO: The answer of the player is not handled currently! Once it'll be read in the messageBox, uncomment this block
-#if 0
- char response[256];
- // TODO: Put user input in response
-
- Utils::strlwr(response);
- if (action->a3.encodedFl) {
- warning("Encrypted flag set");
- decodeString(response);
- }
+ Common::String response;
+
+ response = Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
+
+ response.toLowercase();
+
+ char resp[256];
+ strncpy(resp, response.c_str(), 256);
+
+ if (action->a3.encodedFl)
+ decodeString(resp);
- if (strstr(response, _vm->_file->fetchString(action->a3.responsePtr[0]))
+ if (strstr(resp, _vm->_file->fetchString(action->a3.responsePtr[0])))
insertActionList(action->a3.actPassIndex);
else
insertActionList(action->a3.actFailIndex);
-#endif
-
- // HACK: As the answer is not read, currently it's always considered correct
- insertActionList(action->a3.actPassIndex);
}
/**
@@ -1578,19 +1572,22 @@ const char *Scheduler_v2d::getCypher() const {
}
void Scheduler_v2d::promptAction(act *action) {
- Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
- warning("STUB: doAction(act3), expecting answer %s", _vm->_file->fetchString(action->a3.responsePtr[0]));
+ Common::String response;
+
+ response = Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
+ response.toLowercase();
- // TODO: The answer of the player is not handled currently! Once it'll be read in the messageBox, uncomment this block
-#if 0
- char *response = Utils::Box(BOX_PROMPT, "%s", _vm->_file->fetchString(action->a3.promptIndex));
+ debug(1, "doAction(act3), expecting answer %s", _vm->_file->fetchString(action->a3.responsePtr[0]));
bool found = false;
- char *tmpStr; // General purpose string ptr
+ const char *tmpStr; // General purpose string ptr
- for (dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) {
+ char resp[256];
+ strncpy(resp, response.c_str(), 256);
+
+ for (int dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) {
tmpStr = _vm->_file->fetchString(action->a3.responsePtr[dx]);
- if (strstr(Utils::strlwr(response) , tmpStr))
+ if (strstr(Utils::strlwr(resp), tmpStr))
found = true;
}
@@ -1598,10 +1595,6 @@ void Scheduler_v2d::promptAction(act *action) {
insertActionList(action->a3.actPassIndex);
else
insertActionList(action->a3.actFailIndex);
-#endif
-
- // HACK: As the answer is not read, currently it's always considered correct
- insertActionList(action->a3.actPassIndex);
}
/**
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index 044b58e986..6846bc98af 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -104,6 +104,9 @@ Common::String promptBox(const Common::String &msg) {
return Common::String();
EntryDialog dialog(msg, "OK", "");
+
+ dialog.runModal();
+
return dialog.getEditString();
}
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 758d66192d..e2654afe12 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -909,7 +909,7 @@ void AdLibDriver::unkOutput2(uint8 chan) {
// including the two most significant frequency bit, and the octave -
// set to zero.
//
- // This is very strange behaviour, and causes problems with the ancient
+ // This is very strange behavior, and causes problems with the ancient
// FMOPL code we borrowed from AdPlug. I've added a workaround. See
// fmopl.cpp for more details.
//
@@ -984,7 +984,7 @@ void AdLibDriver::setupNote(uint8 rawNote, Channel &channel, bool flag) {
uint16 freq = _unkTable[note] + channel.baseFreq;
- // When called from callback 41, the behaviour is slightly different:
+ // When called from callback 41, the behavior is slightly different:
// We adjust the frequency, even when channel.unk16 is 0.
if (channel.unk16 || flag) {
@@ -1093,12 +1093,12 @@ void AdLibDriver::adjustVolume(Channel &channel) {
// tree) and turning Kallak to stone. Related functions and variables:
//
// update_setupPrimaryEffect1()
-// - Initialises unk29, unk30 and unk31
+// - Initializes unk29, unk30 and unk31
// - unk29 is not further modified
// - unk30 is not further modified, except by update_removePrimaryEffect1()
//
// update_removePrimaryEffect1()
-// - Deinitialises unk30
+// - Deinitializes unk30
//
// unk29 - determines how often the notes are played
// unk30 - modifies the frequency
@@ -1115,7 +1115,7 @@ void AdLibDriver::primaryEffect1(Channel &channel) {
if (channel.unk31 >= temp)
return;
- // Initialise unk1 to the current frequency
+ // Initialize unk1 to the current frequency
uint16 unk1 = ((channel.regBx & 3) << 8) | channel.regAx;
// This is presumably to shift the "note on" bit so far to the left
@@ -1167,10 +1167,10 @@ void AdLibDriver::primaryEffect1(Channel &channel) {
// and leaving Kallak's hut. Related functions and variables:
//
// update_setupPrimaryEffect2()
-// - Initialises unk32, unk33, unk34, unk35 and unk36
+// - Initializes unk32, unk33, unk34, unk35 and unk36
// - unk32 is not further modified
// - unk33 is not further modified
-// - unk34 is a countdown that gets reinitialised to unk35 on zero
+// - unk34 is a countdown that gets reinitialized to unk35 on zero
// - unk35 is based on unk34 and not further modified
// - unk36 is not further modified
//
@@ -1182,13 +1182,13 @@ void AdLibDriver::primaryEffect1(Channel &channel) {
// unk32 - determines how often the notes are played
// unk33 - modifies the frequency
// unk34 - countdown, updates frequency on zero
-// unk35 - initialiser for unk34 countdown
-// unk36 - initialiser for unk38 countdown
+// unk35 - initializer for unk34 countdown
+// unk36 - initializer for unk38 countdown
// unk37 - frequency
// unk38 - countdown, begins playing on zero
// unk41 - determines how often the notes are played
//
-// Note that unk41 is never initialised. Not that it should matter much, but it
+// Note that unk41 is never initialized. Not that it should matter much, but it
// is a bit sloppy.
void AdLibDriver::primaryEffect2(Channel &channel) {
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/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/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/menu.cpp b/engines/lure/menu.cpp
index 7d0816ee79..c4654c3e93 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -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..6e2c11cb24 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -88,7 +88,7 @@ struct HotspotResource {
uint16 walkY;
int8 talkX;
int8 talkY;
- uint16 colourOffset;
+ uint16 colorOffset;
uint16 animRecordId;
uint16 hotspotScriptOffset;
uint16 talkScriptOffset;
@@ -538,7 +538,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..b64ef6393b 100644
--- a/engines/lure/screen.cpp
+++ b/engines/lure/screen.cpp
@@ -44,7 +44,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 +87,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 +138,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/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);
};
diff --git a/engines/m4/actor.cpp b/engines/m4/actor.cpp
index f342ca6b46..ce8574a134 100644
--- a/engines/m4/actor.cpp
+++ b/engines/m4/actor.cpp
@@ -59,7 +59,7 @@ void Actor::placeWalkerSpriteAt(int spriteNum, int x, int y) {
info.height = info.sprite->height();
info.scaleX = info.scaleY = _scaling;
info.palette = _walkerSprites[_direction]->getPalette();
- info.inverseColourTable = _m4Vm->scene()->getInverseColourTable();
+ info.inverseColorTable = _m4Vm->scene()->getInverseColorTable();
_vm->_scene->drawSprite(x, y, info, Common::Rect(640, 400));
}
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index 37314eff44..26de121611 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -426,7 +426,7 @@ void MadsAnimation::update() {
// Start displaying the message
AnimMessage &me = _messages[idx];
- // The colour index to use is dependant on how many messages are currently on-screen
+ // The color index to use is dependant on how many messages are currently on-screen
uint8 colIndex;
switch (_messageCtr) {
case 1:
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index 2d1b8e7e4f..f67291f0a6 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -97,7 +97,7 @@ void ConversationView::setNode(int32 nodeIndex) {
_vm->_font->setFont(FONT_CONVERSATION);
// TODO: Conversation styles and colors
- _vm->_font->current()->setColours(2, 1, 3);
+ _vm->_font->current()->setColors(2, 1, 3);
_currentNodeIndex = nodeIndex;
@@ -164,7 +164,7 @@ void ConversationView::onRefresh(RectList *rects, M4Surface *destSurface) {
if (i > CONV_MAX_SHOWN_ENTRIES - 1)
break;
- _vm->_font->current()->setColour((_highlightedIndex == i) ? CONVERSATION_ENTRY_HIGHLIGHTED :
+ _vm->_font->current()->setColor((_highlightedIndex == i) ? CONVERSATION_ENTRY_HIGHLIGHTED :
CONVERSATION_ENTRY_NORMAL);
_vm->_font->current()->writeString(this, _activeItems[i]->text, CONV_ENTRIES_X_OFFSET,
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp
index da828ccf5b..7efbc523f8 100644
--- a/engines/m4/dialogs.cpp
+++ b/engines/m4/dialogs.cpp
@@ -452,7 +452,7 @@ void Dialog::draw() {
// Set up the dialog
fillRect(Common::Rect(0, 0, width(), height()), 3);
- setColour(2);
+ setColor(2);
hLine(1, width() - 1, height() - 2); // Bottom edge
hLine(0, width(), height() - 1);
vLine(width() - 2, 2, height()); // Right edge
@@ -480,8 +480,8 @@ void Dialog::draw() {
}
// Handle drawing the text contents
- _vm->_font->current()->setColours(7, 7, 7);
- setColour(7);
+ _vm->_font->current()->setColors(7, 7, 7);
+ setColor(7);
for (uint lineCtr = 0, yp = 5; lineCtr < _lines.size(); ++lineCtr, yp += _vm->_font->current()->getHeight() + 1) {
diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp
index 29b243aceb..a9641eb542 100644
--- a/engines/m4/events.cpp
+++ b/engines/m4/events.cpp
@@ -257,7 +257,7 @@ bool Mouse::setCursorNum(int cursorIndex) {
// Set the cursor to the sprite
CursorMan.replaceCursor((const byte *)_cursor->getBasePtr(), _cursor->width(), _cursor->height(),
- _cursor->xOffset, _cursor->yOffset, TRANSPARENT_COLOUR_INDEX);
+ _cursor->xOffset, _cursor->yOffset, TRANSPARENT_COLOR_INDEX);
return true;
}
diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp
index 3ed419675d..582fbaebc7 100644
--- a/engines/m4/font.cpp
+++ b/engines/m4/font.cpp
@@ -159,14 +159,14 @@ Font::~Font() {
}
}
-void Font::setColour(uint8 colour) {
+void Font::setColor(uint8 color) {
if (_sysFont)
- _fontColors[1] = colour;
+ _fontColors[1] = color;
else
- _fontColors[3] = colour;
+ _fontColors[3] = color;
}
-void Font::setColours(uint8 col1, uint8 col2, uint8 col3) {
+void Font::setColors(uint8 col1, uint8 col2, uint8 col3) {
if (_sysFont)
_fontColors[1] = col3;
else {
diff --git a/engines/m4/font.h b/engines/m4/font.h
index 19d15faa1e..64e54f35b5 100644
--- a/engines/m4/font.h
+++ b/engines/m4/font.h
@@ -62,8 +62,8 @@ public:
Font(MadsM4Engine *vm, const char *filename);
~Font();
- void setColour(uint8 colour);
- void setColours(uint8 col1, uint8 col2, uint8 col3);
+ void setColor(uint8 color);
+ void setColors(uint8 col1, uint8 col2, uint8 col3);
int32 getWidth(const char *text, int spaceWidth = -1);
int32 getHeight() const { return _maxHeight; }
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index 5fc46d3881..a3eca13e1e 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -300,7 +300,7 @@ void M4Surface::drawSprite(int x, int y, SpriteInfo &info, const Common::Rect &c
r = CLIP((info.palette[destPixel].r * pixel) >> 10, 0, 31);
g = CLIP((info.palette[destPixel].g * pixel) >> 10, 0, 31);
b = CLIP((info.palette[destPixel].b * pixel) >> 10, 0, 31);
- pixel = info.inverseColourTable[(b << 10) | (g << 5) | r];
+ pixel = info.inverseColorTable[(b << 10) | (g << 5) | r];
}
}
@@ -361,7 +361,7 @@ void M4Surface::fillRect(const Common::Rect &r, uint8 color) {
}
void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY,
- int transparentColour) {
+ int transparentColor) {
// Validation of the rectangle and position
if ((destX >= w) || (destY >= h))
return;
@@ -390,13 +390,13 @@ void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int dest
byte *destPtr = (byte *)pixels + (destY * width()) + destX;
for (int rowCtr = 0; rowCtr < copyRect.height(); ++rowCtr) {
- if (transparentColour == -1)
+ if (transparentColor == -1)
// No transparency, so copy line over
Common::copy(srcPtr, srcPtr + copyRect.width(), destPtr);
else {
// Copy each byte one at a time checking for the transparency color
for (int xCtr = 0; xCtr < copyRect.width(); ++xCtr)
- if (srcPtr[xCtr] != transparentColour) destPtr[xCtr] = srcPtr[xCtr];
+ if (srcPtr[xCtr] != transparentColor) destPtr[xCtr] = srcPtr[xCtr];
}
srcPtr += src->width();
@@ -411,7 +411,7 @@ void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int dest
* the specified depth requirement on a secondary surface contain depth information
*/
void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
- M4Surface *depthsSurface, int scale, int transparentColour) {
+ M4Surface *depthsSurface, int scale, int transparentColor) {
if (scale == 100) {
// Copy the specified area
@@ -443,7 +443,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
for (int rowCtr = 0; rowCtr < copyRect.height(); ++rowCtr) {
// Copy each byte one at a time checking against the depth
for (int xCtr = 0; xCtr < copyRect.width(); ++xCtr) {
- if ((depth <= (depthsPtr[xCtr] & 0x7f)) && (srcPtr[xCtr] != transparentColour))
+ if ((depth <= (depthsPtr[xCtr] & 0x7f)) && (srcPtr[xCtr] != transparentColor))
destPtr[xCtr] = srcPtr[xCtr];
}
@@ -557,7 +557,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
// Not a display pixel
continue;
- if ((*srcP != transparentColour) && (depth <= (*depthP & 0x7f)))
+ if ((*srcP != transparentColor) && (depth <= (*depthP & 0x7f)))
*destP = *srcP;
++destP;
@@ -933,7 +933,7 @@ void M4Surface::translate(RGBList *list, bool isTransparent) {
byte *palIndexes = list->palIndexes();
for (int i = 0; i < width() * height(); ++i, ++p) {
- if (!isTransparent || (*p != TRANSPARENT_COLOUR_INDEX)) {
+ if (!isTransparent || (*p != TRANSPARENT_COLOR_INDEX)) {
if (*p < list->size())
*p = palIndexes[*p];
else
diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h
index d58ed69403..dbf6fac8c8 100644
--- a/engines/m4/graphics.h
+++ b/engines/m4/graphics.h
@@ -40,7 +40,7 @@ namespace M4 {
#define MADS_SCREEN_HEIGHT 200
#define MADS_Y_OFFSET ((MADS_SCREEN_HEIGHT - MADS_SURFACE_HEIGHT) / 2)
-#define TRANSPARENT_COLOUR_INDEX 0xFF
+#define TRANSPARENT_COLOR_INDEX 0xFF
struct BGR8 {
uint8 b, g, r;
@@ -89,7 +89,7 @@ struct SpriteInfo {
int width, height;
int scaleX, scaleY;
uint8 encoding;
- byte *inverseColourTable;
+ byte *inverseColorTable;
RGB8 *palette;
};
@@ -141,7 +141,6 @@ public:
void madsLoadInterface(const Common::String &filename);
void setColor(byte value) { _color = value; }
- void setColour(byte value) { _color = value; }
inline byte getColor() const { return _color; }
void vLine(int x, int y1, int y2);
void hLine(int x1, int x2, int y);
@@ -173,9 +172,9 @@ public:
void reset();
void frameRect(const Common::Rect &r, uint8 color);
void fillRect(const Common::Rect &r, uint8 color);
- void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, int transparentColour = -1);
+ void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, int transparentColor = -1);
void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface,
- int scale, int transparentColour = -1);
+ int scale, int transparentColor = -1);
void update() {
if (_isScreen) {
@@ -185,19 +184,19 @@ public:
}
// copyTo methods
- inline void copyTo(M4Surface *dest, int transparentColour = -1) {
- dest->copyFrom(this, Common::Rect(width(), height()), 0, 0, transparentColour);
+ inline void copyTo(M4Surface *dest, int transparentColor = -1) {
+ dest->copyFrom(this, Common::Rect(width(), height()), 0, 0, transparentColor);
}
- inline void copyTo(M4Surface *dest, int x, int y, int transparentColour = -1) {
- dest->copyFrom(this, Common::Rect(width(), height()), x, y, transparentColour);
+ inline void copyTo(M4Surface *dest, int x, int y, int transparentColor = -1) {
+ dest->copyFrom(this, Common::Rect(width(), height()), x, y, transparentColor);
}
inline void copyTo(M4Surface *dest, const Common::Rect &srcBounds, int destX, int destY,
- int transparentColour = -1) {
- dest->copyFrom(this, srcBounds, destX, destY, transparentColour);
+ int transparentColor = -1) {
+ dest->copyFrom(this, srcBounds, destX, destY, transparentColor);
}
inline void copyTo(M4Surface *dest, int destX, int destY, int depth, M4Surface *depthsSurface, int scale,
- int transparentColour = -1) {
- dest->copyFrom(this, destX, destY, depth, depthsSurface, scale, transparentColour);
+ int transparentColor = -1) {
+ dest->copyFrom(this, destX, destY, depth, depthsSurface, scale, transparentColor);
}
void scrollX(int xAmount);
diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp
index 8665b4e767..6619b37707 100644
--- a/engines/m4/gui.cpp
+++ b/engines/m4/gui.cpp
@@ -290,26 +290,26 @@ void MenuButton::onRefresh() {
case OBJTYPE_SL_TEXT:
switch (_objectState) {
case OS_MOUSEOVER:
- _vm->_font->current()->setColours(TEXT_COLOR_MOUSEOVER_SHADOW, TEXT_COLOR_MOUSEOVER_FOREGROUND,
+ _vm->_font->current()->setColors(TEXT_COLOR_MOUSEOVER_SHADOW, TEXT_COLOR_MOUSEOVER_FOREGROUND,
TEXT_COLOR_MOUSEOVER_HILIGHT);
sprite = sprites[SL_LINE_MOUSEOVER];
break;
case OS_PRESSED:
- _vm->_font->current()->setColours(TEXT_COLOR_PRESSED_SHADOW, TEXT_COLOR_PRESSED_FOREGROUND,
+ _vm->_font->current()->setColors(TEXT_COLOR_PRESSED_SHADOW, TEXT_COLOR_PRESSED_FOREGROUND,
TEXT_COLOR_PRESSED_HILIGHT);
sprite = sprites[SL_LINE_PRESSED];
break;
case OS_GREYED:
- _vm->_font->current()->setColours(TEXT_COLOR_GREYED_SHADOW, TEXT_COLOR_GREYED_FOREGROUND,
+ _vm->_font->current()->setColors(TEXT_COLOR_GREYED_SHADOW, TEXT_COLOR_GREYED_FOREGROUND,
TEXT_COLOR_GREYED_HILIGHT);
sprite = sprites[SL_LINE_NORMAL];
break;
default:
case OS_NORMAL:
- _vm->_font->current()->setColours(TEXT_COLOR_NORMAL_SHADOW, TEXT_COLOR_NORMAL_FOREGROUND,
+ _vm->_font->current()->setColors(TEXT_COLOR_NORMAL_SHADOW, TEXT_COLOR_NORMAL_FOREGROUND,
TEXT_COLOR_NORMAL_HILIGHT);
sprite = sprites[SL_LINE_NORMAL];
break;
@@ -955,7 +955,7 @@ void MenuTextField::onRefresh() {
// Draw the text
_vm->_font->setFont(FONT_MENU);
- _vm->_font->current()->setColours(TEXT_COLOR_NORMAL_SHADOW, TEXT_COLOR_NORMAL_FOREGROUND,
+ _vm->_font->current()->setColors(TEXT_COLOR_NORMAL_SHADOW, TEXT_COLOR_NORMAL_FOREGROUND,
TEXT_COLOR_NORMAL_HILIGHT);
int xp = _bounds.left + 4;
@@ -1140,7 +1140,7 @@ GUITextField::GUITextField(View *owner, const Common::Rect &bounds): GUIRect(own
void GUITextField::onRefresh() {
_parent->fillRect(_bounds, _vm->_palette->BLACK);
- _vm->_font->current()->setColours(3, 3, 3);
+ _vm->_font->current()->setColors(3, 3, 3);
_vm->_font->setFont(FONT_INTERFACE);
_vm->_font->current()->writeString(_parent, _text.c_str(), _bounds.left, _bounds.top, 0, 1);
}
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 4cc2bf8783..d9a1bf940f 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -416,7 +416,7 @@ Common::Error M4Engine::run() {
_scene->loadScene(_kernel->currentRoom);
_ws->setBackgroundSurface(_scene->getBackgroundSurface());
- _ws->setInverseColourTable(scene()->getInverseColourTable());
+ _ws->setInverseColorTable(scene()->getInverseColorTable());
_kernel->loadSectionScriptFunctions();
_kernel->loadRoomScriptFunctions();
@@ -554,7 +554,7 @@ Common::Error MadsEngine::run() {
_scene->show();
_font->setFont(FONT_MAIN_MADS);
- _font->current()->setColours(2, 1, 3);
+ _font->current()->setColors(2, 1, 3);
_font->current()->writeString(_scene->getBackgroundSurface(), "Testing the M4/MADS ScummVM engine", 5, 160, 310, 2);
_font->current()->writeString(_scene->getBackgroundSurface(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 5, 180, 310, 2);
diff --git a/engines/m4/m4_scene.cpp b/engines/m4/m4_scene.cpp
index 738f414add..0ace40bfc5 100644
--- a/engines/m4/m4_scene.cpp
+++ b/engines/m4/m4_scene.cpp
@@ -41,7 +41,7 @@ namespace M4 {
M4Scene::M4Scene(M4Engine *vm): _sceneResources(), Scene(vm, &_sceneResources) {
_vm = vm;
_sceneSprites = NULL;
- _inverseColourTable = NULL;
+ _inverseColorTable = NULL;
_sceneResources.hotspots = new HotSpotList();
_sceneResources.parallax = new HotSpotList();
@@ -110,15 +110,15 @@ void M4Scene::loadSceneResources(int sceneNumber) {
}
}
-void M4Scene::loadSceneInverseColourTable(int sceneNumber) {
+void M4Scene::loadSceneInverseColorTable(int sceneNumber) {
char filename[kM4MaxFilenameSize];
Common::SeekableReadStream *iplS;
sprintf(filename, "%i.ipl", sceneNumber);
iplS = _vm->res()->openFile(filename);
- delete[] _inverseColourTable;
- _inverseColourTable = new byte[iplS->size()];
- iplS->read(_inverseColourTable, iplS->size());
+ delete[] _inverseColorTable;
+ _inverseColorTable = new byte[iplS->size()];
+ iplS->read(_inverseColorTable, iplS->size());
_vm->res()->toss(filename);
}
@@ -163,7 +163,7 @@ void M4Scene::loadScene(int sceneNumber) {
loadSceneCodes(sceneNumber);
// Load inverse color table file (*.IPL)
- loadSceneInverseColourTable(sceneNumber);
+ loadSceneInverseColorTable(sceneNumber);
if (_vm->getGameType() != GType_Burger) {
// Load scene sprites file (*.SSB)
@@ -202,7 +202,7 @@ void M4Scene::leaveScene() {
_sceneResources.parallax->clear();
delete _sceneResources.parallax;
- delete[] _inverseColourTable;
+ delete[] _inverseColorTable;
Scene::leaveScene();
}
diff --git a/engines/m4/m4_scene.h b/engines/m4/m4_scene.h
index 2216779a3e..9c2edbc06c 100644
--- a/engines/m4/m4_scene.h
+++ b/engines/m4/m4_scene.h
@@ -53,11 +53,11 @@ private:
M4SceneResources _sceneResources;
SpriteAsset *_sceneSprites;
SpriteAsset *_walkerSprite;
- byte *_inverseColourTable;
+ byte *_inverseColorTable;
void loadSceneSprites(int sceneNumber);
void loadSceneResources(int sceneNumber);
- void loadSceneInverseColourTable(int sceneNumber);
+ void loadSceneInverseColorTable(int sceneNumber);
void loadSceneSpriteCodes(int sceneNumber);
void nextCommonCursor();
public:
@@ -75,7 +75,7 @@ public:
virtual void update();
virtual void showHotSpots();
- byte *getInverseColourTable() const { return _inverseColourTable; }
+ byte *getInverseColorTable() const { return _inverseColorTable; }
M4InterfaceView *getInterface() { return (M4InterfaceView *)_interfaceSurface; }
M4SceneResources &getSceneResources() { return _sceneResources; }
void setStatusText(const char *text);
diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp
index 1d15cbbaf7..571a6fa899 100644
--- a/engines/m4/mads_anim.cpp
+++ b/engines/m4/mads_anim.cpp
@@ -60,7 +60,7 @@ TextviewView::TextviewView(MadsM4Engine *vm):
_vm->_palette->setPalette(&palData[0], 4, 3);
_vm->_palette->blockRange(4, 3);
- _vm->_font->current()->setColours(5, 6, 4);
+ _vm->_font->current()->setColors(5, 6, 4);
clear();
_bgSurface.clear();
diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp
index 91db7d343a..4ca8154793 100644
--- a/engines/m4/mads_menus.cpp
+++ b/engines/m4/mads_menus.cpp
@@ -695,11 +695,11 @@ void RexDialogView::updateState() {
void RexDialogView::onRefresh(RectList *rects, M4Surface *destSurface) {
// Draw the framed base area
fillRect(this->bounds(), _madsVm->_palette->BLACK);
- setColour(2);
+ setColor(2);
hLine(0, width(), MADS_Y_OFFSET - 2);
hLine(0, width(), MADS_Y_OFFSET + MADS_SURFACE_HEIGHT + 2);
- // Add in the loaded background vertically centred
+ // Add in the loaded background vertically centered
_backgroundSurface->copyTo(this, 0, (height() - MADS_SURFACE_HEIGHT) / 2);
// Check whether any of the dialog text entries need to be refreshed
@@ -943,20 +943,20 @@ void RexDialogView::refreshText() {
if (!_dialogText[i].in_use)
continue;
- // Get the item's colours
- uint colour;
+ // Get the item's colors
+ uint color;
if (_dialogText[i].state == STATE_DESELECTED)
- colour = 0xB0A;
+ color = 0xB0A;
else if (_dialogText[i].state == STATE_SELECTED)
- colour = 0xD0C;
+ color = 0xD0C;
else
- colour = 0xF0E;
+ color = 0xF0E;
- // If there's an associated text display entry, check to see if it's colour needs to change
+ // If there's an associated text display entry, check to see if it's color needs to change
if (_dialogText[i].textDisplay_index >= 0) {
MadsTextDisplayEntry &tdEntry = _textDisplay[_dialogText[i].textDisplay_index];
- if ((tdEntry.colour1 == (colour & 0xff)) && (tdEntry.colour2 == (colour >> 8)))
+ if ((tdEntry.color1 == (color & 0xff)) && (tdEntry.color2 == (color >> 8)))
// It's still the same, so no further action needed
continue;
@@ -967,7 +967,7 @@ void RexDialogView::refreshText() {
// Create a new text display entry for the dialog text line
_dialogText[i].textDisplay_index = _textDisplay.add(_dialogText[i].pos.x, _dialogText[i].pos.y,
- colour, _dialogText[i].widthAdjust, _dialogText[i].text, _dialogText[i].font);
+ color, _dialogText[i].widthAdjust, _dialogText[i].text, _dialogText[i].font);
}
}
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index fd8a609b53..fd972cc6ea 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -855,13 +855,13 @@ MadsInterfaceView::~MadsInterfaceView() {
void MadsInterfaceView::setFontMode(InterfaceFontMode newMode) {
switch (newMode) {
case ITEM_NORMAL:
- _vm->_font->current()->setColours(4, 4, 0xff);
+ _vm->_font->current()->setColors(4, 4, 0xff);
break;
case ITEM_HIGHLIGHTED:
- _vm->_font->current()->setColours(5, 5, 0xff);
+ _vm->_font->current()->setColors(5, 5, 0xff);
break;
case ITEM_SELECTED:
- _vm->_font->current()->setColours(6, 6, 0xff);
+ _vm->_font->current()->setColors(6, 6, 0xff);
break;
}
}
@@ -939,7 +939,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) {
int actionIndex = 0;
for (int x = 0; x < 2; ++x) {
for (int y = 0; y < 5; ++y, ++actionIndex) {
- // Determine the font colour depending on whether an item is selected. Note that the first action,
+ // Determine the font color depending on whether an item is selected. Note that the first action,
// 'Look', is always 'selected', even when another action is clicked on
setFontMode((_highlightedElement == actionIndex) ? ITEM_HIGHLIGHTED :
((actionIndex == 0) ? ITEM_SELECTED : ITEM_NORMAL));
@@ -994,7 +994,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) {
// Display object sprite. Note that the frame number isn't used directly, because it would result
// in too fast an animation
M4Sprite *spr = _objectSprites->getFrame(_objectFrameNumber / INV_ANIM_FRAME_SPEED);
- spr->copyTo(destSurface, INVENTORY_X, INVENTORY_Y, TRANSPARENT_COLOUR_INDEX);
+ spr->copyTo(destSurface, INVENTORY_X, INVENTORY_Y, TRANSPARENT_COLOR_INDEX);
if (!_madsVm->globals()->_config.invObjectsStill && !dialogVisible) {
// If objects need to be animated, move to the next frame
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index cc127032eb..b4385dbead 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -244,10 +244,10 @@ void MadsAction::refresh() {
}
// Add a new text display entry to display the status text at the bottom of the screen area
- uint colours = (_vm->getGameType() == GType_DragonSphere) ? 0x0300 : 0x0003;
+ uint colors = (_vm->getGameType() == GType_DragonSphere) ? 0x0300 : 0x0003;
_statusTextIndex = _owner._textDisplay.add(160 - (strWidth / 2),
- MADS_SURFACE_HEIGHT + _owner._posAdjust.y - 13, colours, textSpacing, _statusText, font);
+ MADS_SURFACE_HEIGHT + _owner._posAdjust.y - 13, colors, textSpacing, _statusText, font);
}
}
@@ -616,7 +616,7 @@ void MadsTextDisplay::clear() {
_entries[i].active = false;
}
-int MadsTextDisplay::add(int xp, int yp, uint fontColour, int charSpacing, const char *msg, Font *font) {
+int MadsTextDisplay::add(int xp, int yp, uint fontColor, int charSpacing, const char *msg, Font *font) {
int usedSlot = -1;
for (int idx = 0; idx < TEXT_DISPLAY_SIZE; ++idx) {
@@ -629,8 +629,8 @@ int MadsTextDisplay::add(int xp, int yp, uint fontColour, int charSpacing, const
_entries[idx].msg = msg;
_entries[idx].bounds.setWidth(font->getWidth(msg, charSpacing));
_entries[idx].bounds.setHeight(font->getHeight());
- _entries[idx].colour1 = fontColour & 0xff;
- _entries[idx].colour2 = fontColour >> 8;
+ _entries[idx].color1 = fontColor & 0xff;
+ _entries[idx].color2 = fontColor >> 8;
_entries[idx].spacing = charSpacing;
_entries[idx].expire = 1;
_entries[idx].active = true;
@@ -666,7 +666,7 @@ void MadsTextDisplay::setDirtyAreas2() {
void MadsTextDisplay::draw(M4Surface *view) {
for (uint idx = 0; idx < _entries.size(); ++idx) {
if (_entries[idx].active && (_entries[idx].expire >= 0)) {
- _entries[idx].font->setColours(_entries[idx].colour1, _entries[idx].colour2, 0);
+ _entries[idx].font->setColors(_entries[idx].color1, _entries[idx].color2, 0);
_entries[idx].font->writeString(view, _entries[idx].msg,
_entries[idx].bounds.left, _entries[idx].bounds.top, _entries[idx].bounds.width(),
_entries[idx].spacing);
@@ -707,7 +707,7 @@ void MadsKernelMessageList::clear() {
_talkFont = _vm->_font->getFont(FONT_CONVERSATION_MADS);
}
-int MadsKernelMessageList::add(const Common::Point &pt, uint fontColour, uint8 flags, uint8 abortTimers, uint32 timeout, const char *msg) {
+int MadsKernelMessageList::add(const Common::Point &pt, uint fontColor, uint8 flags, uint8 abortTimers, uint32 timeout, const char *msg) {
// Find a free slot
uint idx = 0;
while ((idx < _entries.size()) && ((_entries[idx].flags & KMSG_ACTIVE) != 0))
@@ -722,8 +722,8 @@ int MadsKernelMessageList::add(const Common::Point &pt, uint fontColour, uint8 f
MadsKernelMessageEntry &rec = _entries[idx];
strcpy(rec.msg, msg);
rec.flags = flags | KMSG_ACTIVE;
- rec.colour1 = fontColour & 0xff;
- rec.colour2 = fontColour >> 8;
+ rec.color1 = fontColor & 0xff;
+ rec.color2 = fontColor >> 8;
rec.position = pt;
rec.textDisplayIndex = -1;
rec.timeout = timeout;
@@ -918,7 +918,7 @@ void MadsKernelMessageList::processText(int msgIndex) {
if (msg.textDisplayIndex < 0) {
// Need to create a new text display entry for this message
- int idx = _owner._textDisplay.add(x1, y1, msg.colour1 | (msg.colour2 << 8), _owner._textSpacing, msg.msg, _talkFont);
+ int idx = _owner._textDisplay.add(x1, y1, msg.color1 | (msg.color2 << 8), _owner._textSpacing, msg.msg, _talkFont);
if (idx >= 0)
msg.textDisplayIndex = idx;
}
diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h
index c93d0beda3..ce5ba9c4e5 100644
--- a/engines/m4/mads_views.h
+++ b/engines/m4/mads_views.h
@@ -174,8 +174,8 @@ public:
int expire;
int spacing;
Common::Rect bounds;
- uint8 colour1;
- uint8 colour2;
+ uint8 color1;
+ uint8 color2;
Font *font;
const char *msg;
@@ -201,7 +201,7 @@ public:
_entries[idx].expire = -1;
}
- int add(int xp, int yp, uint fontColour, int charSpacing, const char *msg, Font *font);
+ int add(int xp, int yp, uint fontColor, int charSpacing, const char *msg, Font *font);
void clear();
void draw(M4Surface *view);
void setDirtyAreas();
@@ -221,8 +221,8 @@ public:
int sequenceIndex;
char asciiChar;
char asciiChar2;
- int colour1;
- int colour2;
+ int color1;
+ int color2;
Common::Point position;
int textDisplayIndex;
int msgOffset;
@@ -251,7 +251,7 @@ public:
MadsKernelMessageList(MadsView &owner);
void clear();
- int add(const Common::Point &pt, uint fontColour, uint8 flags, uint8 abortTimers, uint32 timeout, const char *msg);
+ int add(const Common::Point &pt, uint fontColor, uint8 flags, uint8 abortTimers, uint32 timeout, const char *msg);
int addQuote(int quoteId, int abortTimers, uint32 timeout);
void scrollMessage(int msgIndex, int numTicks, bool quoted);
void setSeqIndex(int msgIndex, int seqIndex);
diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp
index 0f684ebced..c0cbd879b2 100644
--- a/engines/m4/scene.cpp
+++ b/engines/m4/scene.cpp
@@ -163,7 +163,7 @@ void Scene::showCodes() {
// Show all the scene's walk nodes
SceneNodeList &nodeList = _madsVm->scene()->getSceneResources()._nodes;
- _backgroundSurface->setColour(_madsVm->_palette->WHITE);
+ _backgroundSurface->setColor(_madsVm->_palette->WHITE);
for (uint i = 0; i < nodeList.size() - 2; ++i) {
// Draw a little cross at the node's position
_backgroundSurface->hLine(nodeList[i].pt.x - 2, nodeList[i].pt.x + 2, nodeList[i].pt.y);
diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp
index 641b93baea..77528ec8a6 100644
--- a/engines/m4/sprite.cpp
+++ b/engines/m4/sprite.cpp
@@ -124,7 +124,7 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) {
bool spriteEnd = false;
// Set entire sprite contents to transparent pixels
- fillRect(bounds(), TRANSPARENT_COLOUR_INDEX);
+ fillRect(bounds(), TRANSPARENT_COLOR_INDEX);
// Major line loop
for (int yp = 0; yp < h; ++yp) {
@@ -153,7 +153,7 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) {
byte v = source->readByte();
while (cmd-- > 0) {
if (x2 < w)
- *destP++ = (v == 0xFD) ? TRANSPARENT_COLOUR_INDEX : v;
+ *destP++ = (v == 0xFD) ? TRANSPARENT_COLOR_INDEX : v;
++x2;
}
}
@@ -173,13 +173,13 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) {
byte v = source->readByte();
while (cmd-- > 0) {
if (x2 < w) {
- *destP++ = (v == 0xFD) ? TRANSPARENT_COLOUR_INDEX : v;
+ *destP++ = (v == 0xFD) ? TRANSPARENT_COLOR_INDEX : v;
}
++x2;
}
} else {
// Handle writing out single pixel
- *destP++ = (cmd == 0xFD) ? TRANSPARENT_COLOUR_INDEX : cmd;
+ *destP++ = (cmd == 0xFD) ? TRANSPARENT_COLOR_INDEX : cmd;
++x2;
}
}
@@ -203,7 +203,7 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) {
}
byte M4Sprite::getTransparencyIndex() const {
- return TRANSPARENT_COLOUR_INDEX;
+ return TRANSPARENT_COLOR_INDEX;
}
} // End of namespace M4
diff --git a/engines/m4/woodscript.h b/engines/m4/woodscript.h
index 4b0f457193..a9a884a4b0 100644
--- a/engines/m4/woodscript.h
+++ b/engines/m4/woodscript.h
@@ -319,8 +319,8 @@ public:
RGB8 *getMainPalette() const;
- void setInverseColourTable(byte *inverseColourTable) { _inverseColourTable = inverseColourTable; }
- byte *getInverseColourTable() const { return _inverseColourTable; }
+ void setInverseColorTable(byte *inverseColorTable) { _inverseColorTable = inverseColorTable; }
+ byte *getInverseColorTable() const { return _inverseColorTable; }
protected:
MadsM4Engine *_vm;
@@ -338,7 +338,7 @@ protected:
/* Misc */
int16 *_depthTable;
- byte *_inverseColourTable;
+ byte *_inverseColorTable;
M4Surface *_backgroundSurface;
View *_surfaceView;
diff --git a/engines/m4/ws_sequence.cpp b/engines/m4/ws_sequence.cpp
index bb6230d041..3ee496da0d 100644
--- a/engines/m4/ws_sequence.cpp
+++ b/engines/m4/ws_sequence.cpp
@@ -291,7 +291,7 @@ void Sequence::draw(M4Surface *surface, const Common::Rect &clipRect, Common::Re
info.hotX = _curFrame->xOffset;
info.hotY = _curFrame->yOffset;
info.encoding = _curFrame->encoding;
- info.inverseColourTable = _m4Vm->scene()->getInverseColourTable();
+ info.inverseColorTable = _m4Vm->scene()->getInverseColorTable();
info.palette = _ws->getMainPalette();
info.width = _curFrame->width();
info.height = _curFrame->height();
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 5a3b229c9d..0f84b09547 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -1379,9 +1379,7 @@ void Interface::setSave(PanelButton *panelButton) {
fileName = _vm->calcSaveFileName(_vm->getSaveFile(_optionSaveFileTitleNumber)->slotNumber);
_vm->save(fileName, _textInputString);
}
- _vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
- _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
- setSaveReminderState(1);
+ resetSaveReminder();
_textInput = false;
setMode(kPanelOption);
@@ -1393,6 +1391,12 @@ void Interface::setSave(PanelButton *panelButton) {
}
}
+void Interface::resetSaveReminder() {
+ _vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
+ _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ setSaveReminderState(1);
+}
+
void Interface::handleOptionUpdate(const Point& mousePoint) {
int16 mouseY;
Rect rect;
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index b9a96653a7..09631bf0e8 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -288,6 +288,8 @@ public:
int32 getProtectHash() { return _protectHash; }
+ void resetSaveReminder();
+
private:
void handleMainUpdate(const Point& mousePoint); // main panel update
void handleMainClick(const Point& mousePoint); // main panel click
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 9edb79fa7c..6a6992fb5f 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -256,6 +256,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
warning("Can't write file '%s'. (Disk full?)", fileName);
delete out;
+
+ _interface->resetSaveReminder();
}
void SagaEngine::load(const char *fileName) {
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 907e0ba2e4..80425224bf 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -411,7 +411,8 @@ reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
return kIconBar(s, argc - 1, argv + 1);
case 7: // Unknown, but always return -1
return SIGNAL_REG;
- case 1: // Unknown, calls QuickDraw region functions (KQ5, QFG1VGA)
+ case 1: // Unknown, calls QuickDraw region functions (KQ5, QFG1VGA, Dr. Brain 1)
+ break; // removed warning, as it produces a lot of spam in the console
case 2: // Unknown, "UseNextWaitEvent" (Various)
case 3: // Unknown, "ProcessOpenDocuments" (Various)
case 5: // Unknown, plays a sound (KQ7)
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index d9bb1c3531..e79af70158 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -175,7 +175,7 @@ reg_t kReadNumber(EngineState *s, int argc, reg_t *argv) {
#define ALIGN_NONE 0
#define ALIGN_RIGHT 1
#define ALIGN_LEFT -1
-#define ALIGN_CENTRE 2
+#define ALIGN_CENTER 2
/* Format(targ_address, textresnr, index_inside_res, ...)
** or
@@ -246,7 +246,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
if (xfer == '0')
fillchar = '0';
else if (xfer == '=')
- align = ALIGN_CENTRE;
+ align = ALIGN_CENTER;
else if (isdigit(xfer) || (xfer == '-'))
source--; // Go to start of length argument
@@ -258,7 +258,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
if (str_leng < 0) {
align = ALIGN_LEFT;
str_leng = -str_leng;
- } else if (align != ALIGN_CENTRE)
+ } else if (align != ALIGN_CENTER)
align = ALIGN_RIGHT;
xfer = *source++;
@@ -298,7 +298,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
*target++ = ' '; /* Format into the text */
break;
- case ALIGN_CENTRE: {
+ case ALIGN_CENTER: {
int half_extralen = extralen >> 1;
while (half_extralen-- > 0)
*target++ = ' '; /* Format into the text */
@@ -315,7 +315,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
switch (align) {
- case ALIGN_CENTRE: {
+ case ALIGN_CENTER: {
int half_extralen;
align = 0;
half_extralen = extralen - (extralen >> 1);
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp
index d64dfac23c..030b095cc9 100644
--- a/engines/sci/sound/drivers/amigamac.cpp
+++ b/engines/sci/sound/drivers/amigamac.cpp
@@ -132,6 +132,7 @@ private:
};
bool _isSci1;
+ bool _isSci1Early; // KQ1 Amiga, patch 5
bool _playSwitch;
int _masterVolume;
int _frequency;
@@ -557,6 +558,7 @@ uint32 MidiDriver_AmigaMac::property(int prop, uint32 param) {
int MidiDriver_AmigaMac::open() {
_isSci1 = false;
+ _isSci1Early = false;
for (int i = 0; i < 48; i++)
_freqTable[i] = pow(2, i / (double)48);
@@ -589,9 +591,15 @@ int MidiDriver_AmigaMac::open() {
} else {
ResourceManager *resMan = g_sci->getResMan();
- Resource *resource = resMan->findResource(ResourceId(kResourceTypePatch, 7), false);
+ Resource *resource = resMan->findResource(ResourceId(kResourceTypePatch, 7), false); // Mac
if (!resource)
- resource = resMan->findResource(ResourceId(kResourceTypePatch, 9), false);
+ resource = resMan->findResource(ResourceId(kResourceTypePatch, 9), false); // Amiga
+
+ if (!resource) {
+ resource = resMan->findResource(ResourceId(kResourceTypePatch, 5), false); // KQ1 Amiga
+ if (resource)
+ _isSci1Early = true;
+ }
// If we have a patch by this point, it's SCI1
if (resource)
@@ -896,6 +904,9 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0Mac(Common::SeekableReadStream &fil
bool MidiDriver_AmigaMac::loadInstrumentsSCI1(Common::SeekableReadStream &file) {
_bank.size = 128;
+ if (_isSci1Early)
+ file.skip(4); // TODO: What is this offset for?
+
Common::Array<uint32> instrumentOffsets;
instrumentOffsets.resize(_bank.size);
_bank.instruments.resize(_bank.size);
@@ -908,11 +919,17 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI1(Common::SeekableReadStream &file)
if (instrumentOffsets[i] == 0)
continue;
- file.seek(instrumentOffsets[i]);
+ file.seek(instrumentOffsets[i] + (_isSci1Early ? 4 : 0));
// Read in the instrument name
file.read(_bank.instruments[i].name, 10); // last two bytes are always 0
+ // TODO: Finish off support of SCI1 early patches (patch.005 - KQ1 Amiga)
+ if (_isSci1Early) {
+ warning("Music patch 5 isn't supported yet - ignoring instrument %d", i);
+ continue;
+ }
+
for (uint32 j = 0; ; j++) {
InstrumentSample *sample = new InstrumentSample;
memset(sample, 0, sizeof(InstrumentSample));
diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp
index fd9deb7b44..c78e313fc2 100644
--- a/engines/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp
@@ -229,7 +229,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) {
// Every block starts with a 2 byte word. If that word is
// non-zero, it indicates the size of a block of raw audio
// data (not encoded) following it. That data we simply copy
- // to the output buffer and the proceed by decoding the
+ // to the output buffer and then proceed by decoding the
// remaining data.
//
// If on the other hand the word is zero, then what follows
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 40eeba3663..8f555818f4 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Mon Oct 18 00:42:16 2010
+ This file was generated by the md5table tool on Sun Apr 17 10:46:26 2011
DO NOT EDIT MANUALLY!
*/
@@ -206,6 +206,7 @@ static const MD5Table md5table[] = {
{ "4c4820518e16e1a0e3616a3b021a04f3", "catalog", "HE CUP", "Preview", 10927456, Common::DE_DEU, Common::kPlatformUnknown },
{ "4cb9c3618f71668f8e4346c8f323fa82", "monkey2", "", "", 10700, Common::EN_ANY, Common::kPlatformMacintosh },
{ "4ce2d5b355964bbcb5e5ce73236ef868", "freddicove", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows },
+ { "4cfd3fda4a4e6e64a1fc488eba973b7a", "fbpack", "", "", -1, Common::EN_ANY, Common::kPlatformPC },
{ "4d34042713958b971cb139fba4658586", "atlantis", "FM-TOWNS", "", -1, Common::JA_JPN, Common::kPlatformFMTowns },
{ "4dbff3787aedcd96b0b325f2d92d7ad9", "maze", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "4dc780f1bc587a193ce8a97652791438", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformAmiga },
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp
index 78884e96dc..08184adcdb 100644
--- a/engines/sky/compact.cpp
+++ b/engines/sky/compact.cpp
@@ -85,7 +85,7 @@ static const uint32 compactOffsets[] = {
MK16(Compact, alt),
MK16(Compact, request),
MK16(Compact, spWidth_xx),
- MK16(Compact, spColour),
+ MK16(Compact, spColor),
MK16(Compact, spTextId),
MK16(Compact, spTime),
MK16(Compact, arAnimIndex),
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index 55ba6039c3..8a5409a488 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -1275,7 +1275,7 @@ void Control::importOldCompact(Compact* destCpt, uint8 **srcPos, uint16 numElems
LODSW(*srcPos, destCpt->alt);
LODSW(*srcPos, destCpt->request);
LODSW(*srcPos, destCpt->spWidth_xx);
- LODSW(*srcPos, destCpt->spColour);
+ LODSW(*srcPos, destCpt->spColor);
LODSW(*srcPos, destCpt->spTextId);
LODSW(*srcPos, destCpt->spTime);
LODSW(*srcPos, destCpt->arAnimIndex);
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index 1c1e2c9682..b52e908455 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -1823,7 +1823,7 @@ bool Logic::fnHighlight(uint32 itemNo, uint32 pen, uint32 c) {
pen += 241;
Compact *textCompact = _skyCompact->fetchCpt(itemNo);
uint8 *sprData = (uint8 *)SkyEngine::fetchItem(textCompact->flag);
- _skyText->changeTextSpriteColour(sprData, (uint8)pen);
+ _skyText->changeTextSpriteColor(sprData, (uint8)pen);
return true;
}
@@ -2547,7 +2547,7 @@ void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 bas
// form the text sprite, if player wants subtitles or
// if we couldn't find the speech file
DisplayedText textInfo;
- textInfo = _skyText->lowTextManager(textNum, FIXED_TEXT_WIDTH, 0, (uint8)target->spColour, true);
+ textInfo = _skyText->lowTextManager(textNum, FIXED_TEXT_WIDTH, 0, (uint8)target->spColor, true);
Compact *textCompact = _skyCompact->fetchCpt(textInfo.compactNum);
target->spTextId = textInfo.compactNum; //So we know what text to kill
byte *textGfx = textInfo.textData;
diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp
index a77017de38..1b815b9c38 100644
--- a/engines/sky/screen.cpp
+++ b/engines/sky/screen.cpp
@@ -38,7 +38,7 @@
namespace Sky {
-uint8 Screen::_top16Colours[16*3] = {
+uint8 Screen::_top16Colors[16*3] = {
0, 0, 0,
38, 38, 38,
63, 63, 63,
@@ -63,7 +63,7 @@ Screen::Screen(OSystem *pSystem, Disk *pDisk, SkyCompact *skyCompact) {
_skyCompact = skyCompact;
int i;
- uint8 tmpPal[VGA_COLOURS * 3];
+ uint8 tmpPal[VGA_COLORS * 3];
_gameGrid = (uint8 *)malloc(GRID_X * GRID_Y * 2);
forceRefresh();
@@ -72,17 +72,17 @@ Screen::Screen(OSystem *pSystem, Disk *pDisk, SkyCompact *skyCompact) {
_scrollScreen = NULL;
//blank the first 240 colors of the palette
- memset(tmpPal, 0, GAME_COLOURS * 3);
+ memset(tmpPal, 0, GAME_COLORS * 3);
//set the remaining colors
- for (i = 0; i < (VGA_COLOURS-GAME_COLOURS); i++) {
- tmpPal[3 * GAME_COLOURS + i * 3 + 0] = (_top16Colours[i * 3 + 0] << 2) + (_top16Colours[i * 3 + 0] >> 4);
- tmpPal[3 * GAME_COLOURS + i * 3 + 1] = (_top16Colours[i * 3 + 1] << 2) + (_top16Colours[i * 3 + 1] >> 4);
- tmpPal[3 * GAME_COLOURS + i * 3 + 2] = (_top16Colours[i * 3 + 2] << 2) + (_top16Colours[i * 3 + 2] >> 4);
+ for (i = 0; i < (VGA_COLORS-GAME_COLORS); i++) {
+ tmpPal[3 * GAME_COLORS + i * 3 + 0] = (_top16Colors[i * 3 + 0] << 2) + (_top16Colors[i * 3 + 0] >> 4);
+ tmpPal[3 * GAME_COLORS + i * 3 + 1] = (_top16Colors[i * 3 + 1] << 2) + (_top16Colors[i * 3 + 1] >> 4);
+ tmpPal[3 * GAME_COLORS + i * 3 + 2] = (_top16Colors[i * 3 + 2] << 2) + (_top16Colors[i * 3 + 2] >> 4);
}
//set the palette
- _system->getPaletteManager()->setPalette(tmpPal, 0, VGA_COLOURS);
+ _system->getPaletteManager()->setPalette(tmpPal, 0, VGA_COLORS);
_currentPalette = 0;
_seqInfo.nextFrame = _seqInfo.framesLeft = 0;
@@ -109,32 +109,32 @@ void Screen::setFocusRectangle(const Common::Rect& rect) {
//set a new palette, pal is a pointer to dos vga rgb components 0..63
void Screen::setPalette(uint8 *pal) {
convertPalette(pal, _palette);
- _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLOURS);
+ _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLORS);
_system->updateScreen();
}
void Screen::setPaletteEndian(uint8 *pal) {
#ifdef SCUMM_BIG_ENDIAN
- uint8 endPalette[VGA_COLOURS * 3];
- for (uint16 cnt = 0; cnt < VGA_COLOURS * 3; cnt++)
+ uint8 endPalette[VGA_COLORS * 3];
+ for (uint16 cnt = 0; cnt < VGA_COLORS * 3; cnt++)
endPalette[cnt] = pal[cnt ^ 1];
convertPalette(endPalette, _palette);
#else
convertPalette(pal, _palette);
#endif
- _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLOURS);
+ _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLORS);
_system->updateScreen();
}
void Screen::halvePalette() {
- uint8 halfPalette[VGA_COLOURS * 3];
+ uint8 halfPalette[VGA_COLORS * 3];
- for (uint8 cnt = 0; cnt < GAME_COLOURS; cnt++) {
+ for (uint8 cnt = 0; cnt < GAME_COLORS; cnt++) {
halfPalette[cnt * 3 + 0] = _palette[cnt * 3 + 0] >> 1;
halfPalette[cnt * 3 + 1] = _palette[cnt * 3 + 1] >> 1;
halfPalette[cnt * 3 + 2] = _palette[cnt * 3 + 2] >> 1;
}
- _system->getPaletteManager()->setPalette(halfPalette, 0, GAME_COLOURS);
+ _system->getPaletteManager()->setPalette(halfPalette, 0, GAME_COLORS);
}
void Screen::setPalette(uint16 fileNum) {
@@ -168,7 +168,7 @@ void Screen::showScreen(uint8 *pScreen) {
void Screen::convertPalette(uint8 *inPal, uint8* outPal) {
int i;
- for (i = 0; i < VGA_COLOURS; i++) {
+ for (i = 0; i < VGA_COLORS; i++) {
outPal[3 * i + 0] = (inPal[3 * i + 0] << 2) + (inPal[3 * i + 0] >> 4);
outPal[3 * i + 1] = (inPal[3 * i + 1] << 2) + (inPal[3 * i + 1] >> 4);
outPal[3 * i + 2] = (inPal[3 * i + 2] << 2) + (inPal[3 * i + 2] >> 4);
@@ -247,8 +247,8 @@ void Screen::fnFadeDown(uint32 scroll) {
uint32 delayTime = _system->getMillis();
for (uint8 cnt = 0; cnt < 32; cnt++) {
delayTime += 20;
- palette_fadedown_helper(_palette, GAME_COLOURS);
- _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLOURS);
+ palette_fadedown_helper(_palette, GAME_COLORS);
+ _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLORS);
_system->updateScreen();
int32 waitTime = (int32)delayTime - _system->getMillis();
if (waitTime < 0)
@@ -296,7 +296,7 @@ void Screen::paletteFadeUp(uint16 fileNr) {
}
void Screen::paletteFadeUp(uint8 *pal) {
- byte tmpPal[VGA_COLOURS * 3];
+ byte tmpPal[VGA_COLORS * 3];
convertPalette(pal, tmpPal);
@@ -304,13 +304,13 @@ void Screen::paletteFadeUp(uint8 *pal) {
for (uint8 cnt = 1; cnt <= 32; cnt++) {
delayTime += 20;
- for (uint8 colCnt = 0; colCnt < GAME_COLOURS; colCnt++) {
+ for (uint8 colCnt = 0; colCnt < GAME_COLORS; colCnt++) {
_palette[colCnt * 3 + 0] = (tmpPal[colCnt * 3 + 0] * cnt) >> 5;
_palette[colCnt * 3 + 1] = (tmpPal[colCnt * 3 + 1] * cnt) >> 5;
_palette[colCnt * 3 + 2] = (tmpPal[colCnt * 3 + 2] * cnt) >> 5;
}
- _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLOURS);
+ _system->getPaletteManager()->setPalette(_palette, 0, GAME_COLORS);
_system->updateScreen();
int32 waitTime = (int32)delayTime - _system->getMillis();
@@ -331,8 +331,8 @@ void Screen::fnFadeUp(uint32 palNum, uint32 scroll) {
if (palette == NULL)
error("Screen::fnFadeUp: can't fetch compact %X", palNum);
#ifdef SCUMM_BIG_ENDIAN
- byte tmpPal[VGA_COLOURS * 3];
- for (uint16 cnt = 0; cnt < VGA_COLOURS * 3; cnt++)
+ byte tmpPal[VGA_COLORS * 3];
+ for (uint16 cnt = 0; cnt < VGA_COLORS * 3; cnt++)
tmpPal[cnt] = palette[cnt ^ 1];
paletteFadeUp(tmpPal);
#else
diff --git a/engines/sky/screen.h b/engines/sky/screen.h
index 69a9a2fc8f..2c870ebd89 100644
--- a/engines/sky/screen.h
+++ b/engines/sky/screen.h
@@ -44,8 +44,8 @@ struct Compact;
struct DataFileHeader;
#define SCROLL_JUMP 16
-#define VGA_COLOURS 256
-#define GAME_COLOURS 240
+#define VGA_COLORS 256
+#define GAME_COLORS 240
#define FORE 1
#define BACK 0
@@ -100,8 +100,8 @@ private:
OSystem *_system;
Disk *_skyDisk;
SkyCompact *_skyCompact;
- static uint8 _top16Colours[16 * 3];
- uint8 _palette[VGA_COLOURS * 3];
+ static uint8 _top16Colors[16 * 3];
+ uint8 _palette[VGA_COLORS * 3];
uint32 _currentPalette;
uint8 _seqGrid[20 * 12];
diff --git a/engines/sky/skydefs.h b/engines/sky/skydefs.h
index f68c0f826b..e3f3f3101f 100644
--- a/engines/sky/skydefs.h
+++ b/engines/sky/skydefs.h
@@ -92,7 +92,7 @@ namespace Sky {
#define C_BASE_MODE 0
#define C_BASE_MODE56 56
#define C_ACTION_MODE 4
-#define C_SP_COLOUR 90
+#define C_SP_COLOR 90
#define C_MEGA_SET 112
#define C_GRID_WIDTH 114
#define C_ANIM_UP 122
@@ -141,7 +141,7 @@ namespace Sky {
#define L_WAIT_SYNC 15
#define L_SIMPLE_MOD 16
-// characters with own colour set
+// characters with own color set
#define SP_COL_FOSTER 194
#define SP_COL_JOEY 216
#define SP_COL_JOBS 209
diff --git a/engines/sky/struc.h b/engines/sky/struc.h
index 295e31d9b0..987f074ed1 100644
--- a/engines/sky/struc.h
+++ b/engines/sky/struc.h
@@ -37,9 +37,9 @@ struct DisplayedText {
#include "common/pack-start.h" // START STRUCT PACKING
struct DataFileHeader {
- uint16 flag; // bit 0: set for colour data, clear for not
+ uint16 flag; // bit 0: set for color data, clear for not
// bit 1: set for compressed, clear for uncompressed
- // bit 2: set for 32 colours, clear for 16 colours
+ // bit 2: set for 32 colors, clear for 16 colors
uint16 s_x;
uint16 s_y;
uint16 s_width;
@@ -139,7 +139,7 @@ struct Compact {
uint16 request; // 42
uint16 spWidth_xx; // 43
- uint16 spColour; // 44
+ uint16 spColor; // 44
uint16 spTextId; // 45
uint16 spTime; // 46
diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp
index 73c376dbbe..548c9cb3c2 100644
--- a/engines/sky/text.cpp
+++ b/engines/sky/text.cpp
@@ -231,13 +231,13 @@ char Text::getTextChar(uint8 **data, uint32 *bitPos) {
}
}
-DisplayedText Text::displayText(uint32 textNum, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) {
+DisplayedText Text::displayText(uint32 textNum, uint8 *dest, bool center, uint16 pixelWidth, uint8 color) {
//Render text into buffer *dest
getText(textNum);
- return displayText(_textBuffer, dest, centre, pixelWidth, color);
+ return displayText(_textBuffer, dest, center, pixelWidth, color);
}
-DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) {
+DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool center, uint16 pixelWidth, uint8 color) {
//Render text pointed to by *textPtr in buffer *dest
uint32 centerTable[10];
uint16 lineWidth = 0;
@@ -319,7 +319,7 @@ DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16
uint32 *centerTblPtr = centerTable;
do {
- if (centre) {
+ if (center) {
uint32 width = (pixelWidth - *centerTblPtr) >> 1;
centerTblPtr++;
curDest += width;
@@ -379,9 +379,9 @@ void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, ui
dest = startPos + charWidth + _dtCharSpacing * 2 - 1;
}
-DisplayedText Text::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre) {
+DisplayedText Text::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool center) {
getText(textNum);
- DisplayedText textInfo = displayText(_textBuffer, NULL, centre, width, color);
+ DisplayedText textInfo = displayText(_textBuffer, NULL, center, width, color);
uint32 compactNum = FIRST_TEXT_COMPACT;
Compact *cpt = _skyCompact->fetchCpt(compactNum);
@@ -405,7 +405,7 @@ DisplayedText Text::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum
return textInfo;
}
-void Text::changeTextSpriteColour(uint8 *sprData, uint8 newCol) {
+void Text::changeTextSpriteColor(uint8 *sprData, uint8 newCol) {
DataFileHeader *header = (DataFileHeader *)sprData;
sprData += sizeof(DataFileHeader);
for (uint16 cnt = 0; cnt < header->s_sp_size; cnt++)
diff --git a/engines/sky/text.h b/engines/sky/text.h
index 890cfb2e47..06aabf5094 100644
--- a/engines/sky/text.h
+++ b/engines/sky/text.h
@@ -52,14 +52,14 @@ class Text {
public:
Text(Disk *skyDisk, SkyCompact *skyCompact);
~Text();
- struct DisplayedText displayText(uint32 textNum, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
- struct DisplayedText displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
- struct DisplayedText lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre);
+ struct DisplayedText displayText(uint32 textNum, uint8 *dest, bool center, uint16 pixelWidth, uint8 color);
+ struct DisplayedText displayText(char *textPtr, uint8 *dest, bool center, uint16 pixelWidth, uint8 color);
+ struct DisplayedText lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool center);
void fnSetFont(uint32 fontNr);
void fnTextModule(uint32 textInfoId, uint32 textNo);
void fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY);
void logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY);
- void changeTextSpriteColour(uint8 *sprData, uint8 newCol);
+ void changeTextSpriteColor(uint8 *sprData, uint8 newCol);
uint32 giveCurrentCharSet();
uint32 _numLetters; //no of chars in message
diff --git a/engines/sword1/menu.cpp b/engines/sword1/menu.cpp
index 34f6daf276..582bea82f8 100644
--- a/engines/sword1/menu.cpp
+++ b/engines/sword1/menu.cpp
@@ -309,7 +309,7 @@ void Menu::buildMenu() {
if (Logic::_scriptVars[MENU_LOOKING] || _subjectBarStatus == MENU_OPEN) { // either we're in the chooser or we're doing a 'LOOK AT'
if ((!objHeld) || (objHeld == _menuList[menuSlot]))
_objects[menuSlot]->setSelect(true);
- } else if (Logic::_scriptVars[SECOND_ITEM]) { // clicked luggage onto 2nd icon - we need to colour-highlight the 2 relevant icons & grey out the rest
+ } else if (Logic::_scriptVars[SECOND_ITEM]) { // clicked luggage onto 2nd icon - we need to color-highlight the 2 relevant icons & grey out the rest
if ((_menuList[menuSlot] == objHeld) || (_menuList[menuSlot] == Logic::_scriptVars[SECOND_ITEM]))
_objects[menuSlot]->setSelect(true);
} else { // this object is selected - ie. GREYED OUT
diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp
index c55cc72493..b488092007 100644
--- a/engines/sword2/controls.cpp
+++ b/engines/sword2/controls.cpp
@@ -465,7 +465,7 @@ void Widget::createSurfaceImage(int state, uint32 res, int x, int y, uint32 pc)
break;
case RLE16:
spriteType |= RDSPR_RLE256;
- // Points to just after last cdt_entry, i.e. start of colour
+ // Points to just after last cdt_entry, i.e. start of color
// table
colTablePtr = _vm->fetchAnimHeader(file) + AnimHeader::size()
+ anim_head.noAnimFrames * CdtEntry::size();
diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp
index 5e570fbaad..a968a5600d 100644
--- a/engines/sword2/function.cpp
+++ b/engines/sword2/function.cpp
@@ -1859,15 +1859,15 @@ int32 Logic::fnSetScrollRightMouse(int32 *params) {
return IR_CONT;
}
-int32 Logic::fnColour(int32 *params) {
- // set border colour - useful during script development
- // eg. set to colour during a timer situation, then black when timed
+int32 Logic::fnColor(int32 *params) {
+ // set border color - useful during script development
+ // eg. set to color during a timer situation, then black when timed
// out
- // params 0: colour (see defines above)
+ // params 0: color (see defines above)
#ifdef SWORD2_DEBUG
- // what colour?
+ // what color?
switch (params[0]) {
case BLACK:
_vm->_screen->setPalette(0, 1, black, RDPAL_INSTANT);
@@ -1905,14 +1905,14 @@ static const uint8 blue[3] = { 0, 0, 255 };
#endif
int32 Logic::fnFlash(int32 *params) {
- // flash colour 0 (ie. border) - useful during script development
+ // flash color 0 (ie. border) - useful during script development
// eg. fnFlash(BLUE) where a text line is missed; RED when some code
// missing, etc
- // params: 0 colour to flash
+ // params: 0 color to flash
#ifdef SWORD2_DEBUG
- // what colour?
+ // what color?
switch (params[0]) {
case WHITE:
_vm->_screen->setPalette(0, 1, white, RDPAL_INSTANT);
diff --git a/engines/sword2/header.h b/engines/sword2/header.h
index 3f64152bb9..ed63c806bc 100644
--- a/engines/sword2/header.h
+++ b/engines/sword2/header.h
@@ -114,7 +114,7 @@ enum {
// standard file header
// animation header
// a string of CDT entries (one per frame of the anim)
-// a 16-byte colour table ONLY if (runTimeComp==RLE16)
+// a 16-byte color table ONLY if (runTimeComp==RLE16)
// a string of groups of (frame header + frame data)
// Animation Header
@@ -147,11 +147,11 @@ struct AnimHeader {
enum {
NONE = 0, // No frame compression
- RLE256 = 1, // James's RLE for 256-colour sprites
- RLE16 = 2 // James's RLE for 16- or 17-colour sprites
- // (raw blocks have max 16 colours for 2 pixels
+ RLE256 = 1, // James's RLE for 256-color sprites
+ RLE16 = 2 // James's RLE for 16- or 17-color sprites
+ // (raw blocks have max 16 colors for 2 pixels
// per byte, so '0's are encoded only as FLAT
- // for 17-colour sprites eg. George's mega-set)
+ // for 17-color sprites eg. George's mega-set)
};
// CDT Entry
diff --git a/engines/sword2/icons.cpp b/engines/sword2/icons.cpp
index b115eb373b..8336178ae5 100644
--- a/engines/sword2/icons.cpp
+++ b/engines/sword2/icons.cpp
@@ -157,33 +157,33 @@ void Mouse::buildMenu() {
byte *icon = NULL;
if (res) {
- bool icon_coloured;
+ bool icon_colored;
uint32 object_held = _vm->_logic->readVar(OBJECT_HELD);
uint32 combine_base = _vm->_logic->readVar(COMBINE_BASE);
if (_examiningMenuIcon) {
// When examining an object, that object is
- // coloured. The rest are greyed out.
- icon_coloured = (res == object_held);
+ // colored. The rest are greyed out.
+ icon_colored = (res == object_held);
} else if (combine_base) {
// When combining two menu object (i.e. using
- // one on another), both are coloured. The rest
+ // one on another), both are colored. The rest
// are greyed out.
- icon_coloured = (res == object_held || combine_base);
+ icon_colored = (res == object_held || combine_base);
} else {
// If an object is selected but we are not yet
// doing anything with it, the selected object
- // is greyed out. The rest are coloured.
- icon_coloured = (res != object_held);
+ // is greyed out. The rest are colored.
+ icon_colored = (res != object_held);
}
icon = _vm->_resman->openResource(res) + ResHeader::size();
- // The coloured icon is stored directly after the
+ // The colored icon is stored directly after the
// greyed out one.
- if (icon_coloured)
+ if (icon_colored)
icon += (menuIconWidth * RDMENU_ICONDEEP);
}
@@ -216,7 +216,7 @@ void Mouse::buildSystemMenu() {
else
menuIconWidth = RDMENU_ICONWIDE;
- // Build them all high in full colour - when one is clicked on all the
+ // Build them all high in full color - when one is clicked on all the
// rest will grey out.
for (int i = 0; i < ARRAYSIZE(icon_list); i++) {
diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp
index a51ce5702c..e039ae3888 100644
--- a/engines/sword2/interpreter.cpp
+++ b/engines/sword2/interpreter.cpp
@@ -147,7 +147,7 @@ void Logic::setupOpcodes() {
OPCODE(fnSetScrollLeftMouse),
OPCODE(fnSetScrollRightMouse),
/* 4C */
- OPCODE(fnColour),
+ OPCODE(fnColor),
OPCODE(fnFlash),
OPCODE(fnPreFetch),
OPCODE(fnGetPlayerSaveData),
diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp
index d97b1395d5..c5091a248f 100644
--- a/engines/sword2/layers.cpp
+++ b/engines/sword2/layers.cpp
@@ -166,7 +166,7 @@ void Screen::initBackground(int32 res, int32 new_palette) {
spriteInfo.type = 0;
spriteInfo.blend = 0;
spriteInfo.data = _vm->fetchShadingMask(file);
- spriteInfo.colourTable = 0;
+ spriteInfo.colorTable = 0;
if (openLightMask(&spriteInfo) != RD_OK)
error("Could not open light mask");
diff --git a/engines/sword2/logic.h b/engines/sword2/logic.h
index 793f87d037..e40a12bba3 100644
--- a/engines/sword2/logic.h
+++ b/engines/sword2/logic.h
@@ -260,7 +260,7 @@ public:
int32 fnStandAtAnim(int32 *params);
int32 fnSetScrollLeftMouse(int32 *params);
int32 fnSetScrollRightMouse(int32 *params);
- int32 fnColour(int32 *params);
+ int32 fnColor(int32 *params);
int32 fnFlash(int32 *params);
int32 fnPreFetch(int32 *params);
int32 fnGetPlayerSaveData(int32 *params);
diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp
index 84a2fccedd..648d1d761b 100644
--- a/engines/sword2/maketext.cpp
+++ b/engines/sword2/maketext.cpp
@@ -27,17 +27,17 @@
// MAKETEXT - Constructs a single-frame text sprite: returns a handle to a
// FLOATING memory block containing the sprite, given a
-// null-terminated string, max width allowed, pen colour and
+// null-terminated string, max width allowed, pen color and
// pointer to required character set.
//
// NB 1) The routine does not create a standard file header or
// an anim header for the text sprite - the data simply begins
// with the frame header.
//
-// NB 2) If pen colour is zero, it copies the characters into
-// the sprite without remapping the colours.
-// ie. It can handle both the standard 2-colour font for speech
-// and any multicoloured fonts for control panels, etc.
+// NB 2) If pen color is zero, it copies the characters into
+// the sprite without remapping the colors.
+// ie. It can handle both the standard 2-color font for speech
+// and any multicolored fonts for control panels, etc.
//
// Based on textsprt.c as used for Broken Sword 1, but updated
// for new system by JEL on 9oct96 and updated again (for font
@@ -58,10 +58,10 @@ namespace Sword2 {
#define MAX_LINES 30 // max character lines in output sprite
-#define BORDER_COL 200 // source colour for character border (only
- // needed for remapping colours)
+#define BORDER_COL 200 // source color for character border (only
+ // needed for remapping colors)
-#define LETTER_COL 193 // source colour for bulk of character ( " )
+#define LETTER_COL 193 // source color for bulk of character ( " )
#define LETTER_COL_PSX1 33
#define LETTER_COL_PSX2 34
#define SPACE ' '
@@ -76,9 +76,9 @@ namespace Sword2 {
*
* @param sentence pointer to a null-terminated string
* @param maxWidth the maximum allowed text sprite width in pixels
- * @param pen the text colour, or zero to use the source colours
+ * @param pen the text color, or zero to use the source colors
* @param fontRes the font resource id
- * @param border the border colour; black by default
+ * @param border the border color; black by default
* @return a handle to a floating memory block containing the text sprite
* @note The sentence must contain no leading, trailing or extra spaces.
* Out-of-range characters in the string are replaced by a special
@@ -200,7 +200,7 @@ uint16 FontRenderer::analyseSentence(byte *sentence, uint16 maxWidth, uint32 fon
*
* @param sentence pointer to a null-terminated string
* @param fontRes the font resource id
- * @param pen the text colour, or zero to use the source colours
+ * @param pen the text color, or zero to use the source colors
* @param line array of LineInfo structures, created by analyseSentence()
* @param noOfLines the number of lines, i.e. the number of elements in 'line'
* @return a handle to a floating memory block containing the text sprite
@@ -448,7 +448,7 @@ byte *FontRenderer::findChar(byte ch, byte *charSet) {
* @param spritePtr pointer to the sprite buffer
* @param spriteWidth the width of the character
* @param pen If zero, copy the data directly. Otherwise remap the
- * sprite's colours from BORDER_COL to _borderPen and from
+ * sprite's colors from BORDER_COL to _borderPen and from
* LETTER_COL to pen.
*/
@@ -464,7 +464,7 @@ void FontRenderer::copyChar(byte *charPtr, byte *spritePtr, uint16 spriteWidth,
byte *dest = rowPtr;
if (pen) {
- // Use the specified colours
+ // Use the specified colors
for (uint j = 0; j < frame.width; j++) {
switch (*source++) {
case 0:
@@ -489,7 +489,7 @@ void FontRenderer::copyChar(byte *charPtr, byte *spritePtr, uint16 spriteWidth,
}
} else {
// Pen is zero, so just copy character sprites
- // directly into text sprite without remapping colours.
+ // directly into text sprite without remapping colors.
// Apparently overlapping is never considered here?
memcpy(dest, source, frame.width);
source += frame.width;
@@ -528,13 +528,13 @@ uint32 FontRenderer::buildNewBloc(byte *ascii, int16 x, int16 y, uint16 width, u
frame_head.read(_blocList[i].text_mem);
switch (justification) {
- case POSITION_AT_CENTRE_OF_BASE:
+ case POSITION_AT_CENTER_OF_BASE:
// This one is always used for SPEECH TEXT; possibly
// also for pointer text
x -= (frame_head.width / 2);
y -= frame_head.height;
break;
- case POSITION_AT_CENTRE_OF_TOP:
+ case POSITION_AT_CENTER_OF_TOP:
x -= (frame_head.width / 2);
break;
case POSITION_AT_LEFT_OF_TOP:
@@ -550,10 +550,10 @@ uint32 FontRenderer::buildNewBloc(byte *ascii, int16 x, int16 y, uint16 width, u
x -= frame_head.width;
y -= frame_head.height;
break;
- case POSITION_AT_LEFT_OF_CENTRE:
+ case POSITION_AT_LEFT_OF_CENTER:
y -= (frame_head.height / 2);
break;
- case POSITION_AT_RIGHT_OF_CENTRE:
+ case POSITION_AT_RIGHT_OF_CENTER:
x -= frame_head.width;
y -= (frame_head.height) / 2;
break;
@@ -613,7 +613,7 @@ void FontRenderer::printTextBlocs() {
spriteInfo.type = _blocList[i].type;
spriteInfo.blend = 0;
spriteInfo.data = _blocList[i].text_mem + FrameHeader::size();
- spriteInfo.colourTable = 0;
+ spriteInfo.colorTable = 0;
spriteInfo.isText = true;
uint32 rv = _vm->_screen->drawSprite(&spriteInfo);
diff --git a/engines/sword2/maketext.h b/engines/sword2/maketext.h
index 63b65a32b1..52740d9de9 100644
--- a/engines/sword2/maketext.h
+++ b/engines/sword2/maketext.h
@@ -32,7 +32,7 @@
namespace Sword2 {
-// Output colour for character border - should be be black but note that we
+// Output color for character border - should be be black but note that we
// have to use a different pen number during sequences
#define BORDER_PEN 194
@@ -47,14 +47,14 @@ enum {
NO_JUSTIFICATION = 0,
// These all force text inside the screen edge margin when necessary
- POSITION_AT_CENTRE_OF_BASE = 1,
- POSITION_AT_CENTRE_OF_TOP = 2,
+ POSITION_AT_CENTER_OF_BASE = 1,
+ POSITION_AT_CENTER_OF_TOP = 2,
POSITION_AT_LEFT_OF_TOP = 3,
POSITION_AT_RIGHT_OF_TOP = 4,
POSITION_AT_LEFT_OF_BASE = 5,
POSITION_AT_RIGHT_OF_BASE = 6,
- POSITION_AT_LEFT_OF_CENTRE = 7,
- POSITION_AT_RIGHT_OF_CENTRE = 8
+ POSITION_AT_LEFT_OF_CENTER = 7,
+ POSITION_AT_RIGHT_OF_CENTER = 8
};
enum {
@@ -92,7 +92,7 @@ private:
// for overlap
int8 _charSpacing; // no. of pixels to separate characters along
// each line - negative for overlap
- uint8 _borderPen; // output pen colour of character borders
+ uint8 _borderPen; // output pen color of character borders
uint16 analyseSentence(byte *sentence, uint16 maxWidth, uint32 fontRes, LineInfo *line);
byte *buildTextSprite(byte *sentence, uint32 fontRes, uint8 pen, LineInfo *line, uint16 noOfLines);
diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp
index c8e9387cb7..b6e9b169c3 100644
--- a/engines/sword2/mouse.cpp
+++ b/engines/sword2/mouse.cpp
@@ -1270,8 +1270,8 @@ void Mouse::createPointerText(uint32 text_id, uint32 pointer_res) {
// Above right
justification = POSITION_AT_LEFT_OF_BASE;
} else {
- // Above centre
- justification = POSITION_AT_CENTRE_OF_BASE;
+ // Above center
+ justification = POSITION_AT_CENTER_OF_BASE;
}
} else if (yOffset > 0) {
// Below pointer
@@ -1282,20 +1282,20 @@ void Mouse::createPointerText(uint32 text_id, uint32 pointer_res) {
// Below right
justification = POSITION_AT_LEFT_OF_TOP;
} else {
- // Below centre
- justification = POSITION_AT_CENTRE_OF_TOP;
+ // Below center
+ justification = POSITION_AT_CENTER_OF_TOP;
}
} else {
// Same y-coord as pointer
if (xOffset < 0) {
- // Centre left
- justification = POSITION_AT_RIGHT_OF_CENTRE;
+ // Center left
+ justification = POSITION_AT_RIGHT_OF_CENTER;
} else if (xOffset > 0) {
- // Centre right
- justification = POSITION_AT_LEFT_OF_CENTRE;
+ // Center right
+ justification = POSITION_AT_LEFT_OF_CENTER;
} else {
- // Centre centre - shouldn't happen anyway!
- justification = POSITION_AT_LEFT_OF_CENTRE;
+ // Center center - shouldn't happen anyway!
+ justification = POSITION_AT_LEFT_OF_CENTER;
}
}
@@ -1433,7 +1433,7 @@ void Mouse::refreshInventory() {
// Can reset this now
_vm->_logic->writeVar(COMBINE_BASE, 0);
- // Cause 'object_held' icon to be greyed. The rest are coloured.
+ // Cause 'object_held' icon to be greyed. The rest are colored.
_examiningMenuIcon = true;
buildMenu();
_examiningMenuIcon = false;
diff --git a/engines/sword2/object.h b/engines/sword2/object.h
index 53819c08cc..94a968e58d 100644
--- a/engines/sword2/object.h
+++ b/engines/sword2/object.h
@@ -139,7 +139,7 @@ public:
// speech structure - contains fields used by speech scripts & text output
class ObjectSpeech {
- // int32 pen; // colour to use for body of characters
+ // int32 pen; // color to use for body of characters
// int32 width; // max width of text sprite
// int32 command; // speech script command id
// int32 ins1; // speech script instruction parameters
diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp
index b348fd6bb5..f43efcaa7f 100644
--- a/engines/sword2/palette.cpp
+++ b/engines/sword2/palette.cpp
@@ -107,8 +107,8 @@ void Screen::setFullPalette(int32 palRes) {
pal += ResHeader::size();
- // always set colour 0 to black because most background screen
- // palettes have a bright colour 0 although it should come out
+ // always set color 0 to black because most background screen
+ // palettes have a bright color 0 although it should come out
// as black in the game!
_palette[0] = 0;
@@ -144,11 +144,11 @@ void Screen::setFullPalette(int32 palRes) {
}
/**
- * Matches a colour triplet to a palette index.
- * @param r red colour component
- * @param g green colour component
- * @param b blue colour component
- * @return the palette index of the closest matching colour in the palette
+ * Matches a color triplet to a palette index.
+ * @param r red color component
+ * @param g green color component
+ * @param b blue color component
+ * @return the palette index of the closest matching color in the palette
*/
// FIXME: This used to be inlined - probably a good idea - but the
@@ -160,16 +160,16 @@ uint8 Screen::quickMatch(uint8 r, uint8 g, uint8 b) {
/**
* Sets the palette.
- * @param startEntry the first colour entry to set
- * @param noEntries the number of colour entries to set
- * @param colourTable the new colour entries
+ * @param startEntry the first color entry to set
+ * @param noEntries the number of color entries to set
+ * @param colorTable the new color entries
* @param fadeNow whether to perform the change immediately or delayed
*/
-void Screen::setPalette(int16 startEntry, int16 noEntries, byte *colourTable, uint8 fadeNow) {
+void Screen::setPalette(int16 startEntry, int16 noEntries, byte *colorTable, uint8 fadeNow) {
assert(noEntries > 0);
- memmove(&_palette[3 * startEntry], colourTable, noEntries * 3);
+ memmove(&_palette[3 * startEntry], colorTable, noEntries * 3);
if (fadeNow == RDPAL_INSTANT) {
setSystemPalette(_palette, startEntry, noEntries);
diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp
index ef2c622287..3d16e4ea4c 100644
--- a/engines/sword2/protocol.cpp
+++ b/engines/sword2/protocol.cpp
@@ -52,8 +52,8 @@ void Sword2Engine::fetchPalette(byte *screenFile, byte *palBuffer) {
palette = screenFile + ResHeader::size() + mscreenHeader.palette;
}
- // Always set colour 0 to black, because while most background screen
- // palettes have a bright colour 0 it should come out as black in the
+ // Always set color 0 to black, because while most background screen
+ // palettes have a bright color 0 it should come out as black in the
// game.
palBuffer[0] = 0;
diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp
index a71d503d95..a47f8abe0d 100644
--- a/engines/sword2/render.cpp
+++ b/engines/sword2/render.cpp
@@ -234,24 +234,24 @@ void Screen::scaleImageGood(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16
* used for debugging.
* @param x x-coordinate of the point
* @param y y-coordinate of the point
- * @param colour colour of the point
+ * @param color color of the point
*/
-void Screen::plotPoint(int x, int y, uint8 colour) {
+void Screen::plotPoint(int x, int y, uint8 color) {
byte *buf = _buffer + MENUDEEP * RENDERWIDE;
x -= _scrollX;
y -= _scrollY;
if (x >= 0 && x < RENDERWIDE && y >= 0 && y < RENDERDEEP) {
- buf[y * RENDERWIDE + x] = colour;
+ buf[y * RENDERWIDE + x] = color;
markAsDirty(x, y + MENUDEEP, x, y + MENUDEEP);
}
}
-static void plot(int x, int y, int colour, void *data) {
+static void plot(int x, int y, int color, void *data) {
Screen *screen = (Screen *)data;
- screen->plotPoint(x, y, (uint8) colour);
+ screen->plotPoint(x, y, (uint8) color);
}
/**
@@ -260,11 +260,11 @@ static void plot(int x, int y, int colour, void *data) {
* @param y0 y-coordinate of the start point
* @param x1 x-coordinate of the end point
* @param y1 y-coordinate of the end point
- * @param colour colour of the line
+ * @param color color of the line
*/
-void Screen::drawLine(int x0, int y0, int x1, int y1, uint8 colour) {
- Graphics::drawLine(x0, y0, x1, y1, colour, &plot, this);
+void Screen::drawLine(int x0, int y0, int x1, int y1, uint8 color) {
+ Graphics::drawLine(x0, y0, x1, y1, color, &plot, this);
}
/**
diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp
index 1548536ccb..8f355151f4 100644
--- a/engines/sword2/router.cpp
+++ b/engines/sword2/router.cpp
@@ -2344,9 +2344,9 @@ void Router::plotWalkGrid() {
plotCross(_node[i].x, _node[i].y, 184);
}
-void Router::plotCross(int16 x, int16 y, uint8 colour) {
- _vm->_screen->drawLine(x - 1, y - 1, x + 1, y + 1, colour);
- _vm->_screen->drawLine(x + 1, y - 1, x - 1, y + 1, colour);
+void Router::plotCross(int16 x, int16 y, uint8 color) {
+ _vm->_screen->drawLine(x - 1, y - 1, x + 1, y + 1, color);
+ _vm->_screen->drawLine(x + 1, y - 1, x - 1, y + 1, color);
}
void Router::loadWalkGrid() {
diff --git a/engines/sword2/router.h b/engines/sword2/router.h
index f556850797..1ad3dd74c4 100644
--- a/engines/sword2/router.h
+++ b/engines/sword2/router.h
@@ -193,7 +193,7 @@ private:
int32 solidWalkAnimator(WalkData *walkAnim);
#endif
- void plotCross(int16 x, int16 y, uint8 colour);
+ void plotCross(int16 x, int16 y, uint8 color);
public:
Router(Sword2Engine *vm) : _vm(vm), _diagonalx(0), _diagonaly(0) {
diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp
index 8c2db79297..74a23c8b2c 100644
--- a/engines/sword2/screen.cpp
+++ b/engines/sword2/screen.cpp
@@ -253,7 +253,7 @@ void Screen::updateDisplay(bool redrawScene) {
}
/**
- * Fill the screen buffer with palette colour zero. Note that it does not
+ * Fill the screen buffer with palette color zero. Note that it does not
* touch the menu areas of the screen.
*/
@@ -392,7 +392,7 @@ void Screen::displayMsg(byte *text, int time) {
spriteInfo.type = RDSPR_DISPLAYALIGN | RDSPR_NOCOMPRESSION | RDSPR_TRANS;
spriteInfo.blend = 0;
spriteInfo.data = text_spr + FrameHeader::size();
- spriteInfo.colourTable = 0;
+ spriteInfo.colorTable = 0;
spriteInfo.isText = true;
uint32 rv = drawSprite(&spriteInfo);
@@ -530,7 +530,7 @@ void Screen::processLayer(byte *file, uint32 layer_number) {
}
spriteInfo.blend = 0;
- spriteInfo.colourTable = 0;
+ spriteInfo.colorTable = 0;
// check for largest layer for debug info
@@ -572,7 +572,7 @@ void Screen::processImage(BuildUnit *build_unit) {
cdt_entry.read(_vm->fetchCdtEntry(file, build_unit->anim_pc));
frame_head.read(frame);
- // so that 0-colour is transparent
+ // so that 0-color is transparent
uint32 spriteType = RDSPR_TRANS;
if (anim_head.blend)
@@ -606,7 +606,7 @@ void Screen::processImage(BuildUnit *build_unit) {
case RLE16:
spriteType |= RDSPR_RLE16;
// points to just after last cdt_entry, ie.
- // start of colour table
+ // start of color table
colTablePtr = _vm->fetchAnimHeader(file) + AnimHeader::size() + anim_head.noAnimFrames * CdtEntry::size();
if (Sword2Engine::isPsx())
colTablePtr++; // There is one additional byte to skip before the table in psx version
@@ -632,7 +632,7 @@ void Screen::processImage(BuildUnit *build_unit) {
spriteInfo.blend = anim_head.blend;
// points to just after frame header, ie. start of sprite data
spriteInfo.data = frame + FrameHeader::size();
- spriteInfo.colourTable = colTablePtr;
+ spriteInfo.colorTable = colTablePtr;
spriteInfo.isText = false;
// check for largest layer for debug info
@@ -895,7 +895,7 @@ void Screen::rollCredits() {
// palette 3 * 256 bytes
// data width * height bytes
//
- // Note that the maximum colour component in the palette is 0x3F.
+ // Note that the maximum color component in the palette is 0x3F.
// This is the same resolution as the _paletteMatch table. I doubt
// that this is a coincidence, but let's use the image palette
// directly anyway, just to be safe.
@@ -1261,7 +1261,7 @@ void Screen::splashScreen() {
barSprite.scaledHeight = 0;
barSprite.type = RDSPR_RLE256FAST | RDSPR_TRANS;
barSprite.blend = 0;
- barSprite.colourTable = 0;
+ barSprite.colorTable = 0;
barSprite.data = frame + FrameHeader::size();
barSprite.isText = false;
diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h
index 46eb53d0db..9ef4f28049 100644
--- a/engines/sword2/screen.h
+++ b/engines/sword2/screen.h
@@ -172,7 +172,7 @@ struct SpriteInfo {
uint16 type; // mask containing 'RDSPR_' bits specifying compression type, flip, transparency, etc
uint16 blend; // holds the blending values.
byte *data; // pointer to the sprite data
- byte *colourTable; // pointer to 16-byte colour table, only applicable to 16-col compression type
+ byte *colorTable; // pointer to 16-byte color table, only applicable to 16-col compression type
bool isText; // It is a engine-generated sprite containing text
};
@@ -442,8 +442,8 @@ public:
void buildDisplay();
- void plotPoint(int x, int y, uint8 colour);
- void drawLine(int x0, int y0, int x1, int y1, uint8 colour);
+ void plotPoint(int x, int y, uint8 color);
+ void drawLine(int x0, int y0, int x1, int y1, uint8 color);
void rollCredits();
void splashScreen();
diff --git a/engines/sword2/scroll.cpp b/engines/sword2/scroll.cpp
index eb080eb4b3..11ba546cf3 100644
--- a/engines/sword2/scroll.cpp
+++ b/engines/sword2/scroll.cpp
@@ -73,7 +73,7 @@ void Screen::setScrolling() {
return;
}
- // George's offset from the centre - the desired position for him
+ // George's offset from the center - the desired position for him
int16 offset_x = _thisScreen.player_feet_x - _thisScreen.feet_x;
int16 offset_y = _thisScreen.player_feet_y - _thisScreen.feet_y;
diff --git a/engines/sword2/speech.cpp b/engines/sword2/speech.cpp
index a0ddc333c2..b67f079a83 100644
--- a/engines/sword2/speech.cpp
+++ b/engines/sword2/speech.cpp
@@ -104,16 +104,16 @@ void Logic::locateTalker(int32 *params) {
uint16 scale = obMega.calcScale();
- // Calc suitable centre point above the head, based on scaled
+ // Calc suitable center point above the head, based on scaled
// height
- // just use 'feet_x' as centre
+ // just use 'feet_x' as center
_textX = obMega.getFeetX();
// Add scaled y-offset to feet_y coord to get top of sprite
_textY = obMega.getFeetY() + (cdt_entry.y * scale) / 256;
} else {
- // It's a non-scaling anim - calc suitable centre point above
+ // It's a non-scaling anim - calc suitable center point above
// the head, based on scaled width
// x-coord + half of width
@@ -185,7 +185,7 @@ void Logic::formText(int32 *params) {
text + 2, _textX, _textY,
textWidth, obSpeech.getPen(),
RDSPR_TRANS | RDSPR_DISPLAYALIGN,
- _vm->_speechFontId, POSITION_AT_CENTRE_OF_BASE);
+ _vm->_speechFontId, POSITION_AT_CENTER_OF_BASE);
_vm->_resman->closeResource(text_res);
diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp
index 255176292a..9a25812178 100644
--- a/engines/sword2/sprite.cpp
+++ b/engines/sword2/sprite.cpp
@@ -51,7 +51,7 @@ void Screen::mirrorSprite(byte *dst, byte *src, int16 w, int16 h) {
}
/**
- * This function takes a compressed frame of a sprite with up to 256 colours
+ * This function takes a compressed frame of a sprite with up to 256 colors
* and decompresses it.
* @param dst destination buffer
* @param src source buffer
@@ -82,7 +82,7 @@ int32 Screen::decompressRLE256(byte *dst, byte *src, int32 decompSize) {
break;
}
- // set the next 'headerByte' pixels to the next colour
+ // set the next 'headerByte' pixels to the next color
// at 'source'
memset(dst, *src, headerByte);
@@ -90,7 +90,7 @@ int32 Screen::decompressRLE256(byte *dst, byte *src, int32 decompSize) {
// block
dst += headerByte;
- // increment source pointer to just after this colour
+ // increment source pointer to just after this color
src++;
// if we've decompressed all of the data
@@ -135,7 +135,7 @@ int32 Screen::decompressRLE256(byte *dst, byte *src, int32 decompSize) {
}
/**
- * Unwinds a run of 16-colour data into 256-colour palette data.
+ * Unwinds a run of 16-color data into 256-color palette data.
*/
void Screen::unwindRaw16(byte *dst, byte *src, uint16 blockSize, byte *colTable) {
@@ -143,11 +143,11 @@ void Screen::unwindRaw16(byte *dst, byte *src, uint16 blockSize, byte *colTable)
while (blockSize > 1) {
if (Sword2Engine::isPsx()) {
- // 1st colour = number in table at position given by upper
+ // 1st color = number in table at position given by upper
// nibble of source byte
*dst++ = colTable[(*src) & 0x0f];
- // 2nd colour = number in table at position given by lower
+ // 2nd color = number in table at position given by lower
// nibble of source byte
*dst++ = colTable[(*src) >> 4];
} else {
@@ -165,19 +165,19 @@ void Screen::unwindRaw16(byte *dst, byte *src, uint16 blockSize, byte *colTable)
// if there's a final odd pixel
if (blockSize) {
- // colour = number in table at position given by upper nibble
+ // color = number in table at position given by upper nibble
// of source byte
*dst++ = colTable[(*src) >> 4];
}
}
/**
- * This function takes a compressed frame of a sprite (with up to 16 colours)
+ * This function takes a compressed frame of a sprite (with up to 16 colors)
* and decompresses it.
* @param dst destination buffer
* @param src source buffer
* @param decompSize the expected size of the uncompressed sprite
- * @param colTable mapping from the 16 encoded colours to the current palette
+ * @param colTable mapping from the 16 encoded colors to the current palette
*/
int32 Screen::decompressRLE16(byte *dst, byte *src, int32 decompSize, byte *colTable) {
@@ -199,14 +199,14 @@ int32 Screen::decompressRLE16(byte *dst, byte *src, int32 decompSize, byte *colT
}
// set the next 'headerByte' pixels to the next
- // colour at 'source'
+ // color at 'source'
memset(dst, *src, headerByte);
// increment destination pointer to just after this
// block
dst += headerByte;
- // increment source pointer to just after this colour
+ // increment source pointer to just after this color
src++;
// if we've decompressed all of the data
@@ -470,13 +470,13 @@ void Screen::deleteSurface(byte *surface) {
* RDSPR_DISPLAYALIGN The sprite is drawn relative to the top left corner
* of the screen
* RDSPR_FLIP The sprite is mirrored
- * RDSPR_TRANS The sprite has a transparent colour zero
+ * RDSPR_TRANS The sprite has a transparent color zero
* RDSPR_BLEND The sprite is translucent
* RDSPR_SHADOW The sprite is affected by the light mask. (Scaled
* sprites always are.)
* RDSPR_NOCOMPRESSION The sprite data is not compressed
- * RDSPR_RLE16 The sprite data is a 16-colour compressed sprite
- * RDSPR_RLE256 The sprite data is a 256-colour compressed sprite
+ * RDSPR_RLE16 The sprite data is a 16-color compressed sprite
+ * RDSPR_RLE256 The sprite data is a 256-color compressed sprite
* @param s all the information needed to draw the sprite
* @warning Sprites will only be drawn onto the background, not over menubar
* areas.
@@ -538,7 +538,7 @@ int32 Screen::drawSprite(SpriteInfo *s) {
byte *tempBuf2 = (byte *)malloc(s->w * s->h * 10);
memset(tempBuf2, 0, s->w * s->h * 2);
- unwindRaw16(tempBuf2, tempBuf, (s->w * (s->h / 2)), s->colourTable);
+ unwindRaw16(tempBuf2, tempBuf, (s->w * (s->h / 2)), s->colorTable);
sprite = (byte *)malloc(s->w * s->h);
if (!sprite) {
@@ -557,7 +557,7 @@ int32 Screen::drawSprite(SpriteInfo *s) {
if (!sprite)
return RDERR_OUTOFMEMORY;
- if (decompressRLE16(sprite, s->data, s->w * s->h, s->colourTable)) {
+ if (decompressRLE16(sprite, s->data, s->w * s->h, s->colorTable)) {
free(sprite);
return RDERR_DECOMPRESSION;
}
diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp
index 5fefcec420..502d2d3b2a 100644
--- a/engines/sword25/gfx/graphicengine.cpp
+++ b/engines/sword25/gfx/graphicengine.cpp
@@ -206,6 +206,7 @@ bool GraphicEngine::fill(const Common::Rect *fillRectPtr, uint color) {
for (int i = rect.top; i < rect.bottom; i++) {
out = outo;
for (int j = rect.left; j < rect.right; j++) {
+#if defined(SCUMM_LITTLE_ENDIAN)
*out += (byte)(((cb - *out) * ca) >> 8);
out++;
*out += (byte)(((cg - *out) * ca) >> 8);
@@ -214,6 +215,16 @@ bool GraphicEngine::fill(const Common::Rect *fillRectPtr, uint color) {
out++;
*out = 255;
out++;
+#else
+ *out = 255;
+ out++;
+ *out += (byte)(((cr - *out) * ca) >> 8);
+ out++;
+ *out += (byte)(((cg - *out) * ca) >> 8);
+ out++;
+ *out += (byte)(((cb - *out) * ca) >> 8);
+ out++;
+#endif
}
outo += _backSurface.pitch;
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index ced3296e57..b740c0ec68 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -267,10 +267,11 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
out = outo;
in = ino;
for (int j = 0; j < img->w; j++) {
- int b = in[0];
- int g = in[1];
- int r = in[2];
- int a = in[3];
+ uint32 pix = *(uint32 *)in;
+ int b = (pix >> 0) & 0xff;
+ int g = (pix >> 8) & 0xff;
+ int r = (pix >> 16) & 0xff;
+ int a = (pix >> 24) & 0xff;
in += inStep;
if (ca != 255) {
@@ -282,6 +283,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
out += 4;
break;
case 255: // Full opacity
+#if defined(SCUMM_LITTLE_ENDIAN)
if (cb != 255)
*out++ = (b * cb) >> 8;
else
@@ -298,9 +300,28 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
*out++ = r;
*out++ = a;
+#else
+ *out++ = a;
+
+ if (cr != 255)
+ *out++ = (r * cr) >> 8;
+ else
+ *out++ = r;
+
+ if (cg != 255)
+ *out++ = (g * cg) >> 8;
+ else
+ *out++ = g;
+
+ if (cb != 255)
+ *out++ = (b * cb) >> 8;
+ else
+ *out++ = b;
+#endif
break;
default: // alpha blending
+#if defined(SCUMM_LITTLE_ENDIAN)
if (cb != 255)
*out += ((b - *out) * a * cb) >> 16;
else
@@ -318,6 +339,25 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
out++;
*out = 255;
out++;
+#else
+ *out = 255;
+ out++;
+ if (cr != 255)
+ *out += ((r - *out) * a * cr) >> 16;
+ else
+ *out += ((r - *out) * a) >> 8;
+ out++;
+ if (cg != 255)
+ *out += ((g - *out) * a * cg) >> 16;
+ else
+ *out += ((g - *out) * a) >> 8;
+ out++;
+ if (cb != 255)
+ *out += ((b - *out) * a * cb) >> 16;
+ else
+ *out += ((b - *out) * a) >> 8;
+ out++;
+#endif
}
}
outo += _backSurface->pitch;
diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp
index e8acd08909..99a47015fb 100644
--- a/engines/sword25/gfx/image/vectorimagerenderer.cpp
+++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp
@@ -67,6 +67,7 @@ void art_rgb_run_alpha1(byte *buf, byte r, byte g, byte b, int alpha, int n) {
int v;
for (i = 0; i < n; i++) {
+#if defined(SCUMM_LITTLE_ENDIAN)
v = *buf;
*buf++ = v + (((b - v) * alpha + 0x80) >> 8);
v = *buf;
@@ -75,6 +76,16 @@ void art_rgb_run_alpha1(byte *buf, byte r, byte g, byte b, int alpha, int n) {
*buf++ = v + (((r - v) * alpha + 0x80) >> 8);
v = *buf;
*buf++ = MIN(v + alpha, 0xff);
+#else
+ v = *buf;
+ *buf++ = MIN(v + alpha, 0xff);
+ v = *buf;
+ *buf++ = v + (((r - v) * alpha + 0x80) >> 8);
+ v = *buf;
+ *buf++ = v + (((g - v) * alpha + 0x80) >> 8);
+ v = *buf;
+ *buf++ = v + (((b - v) * alpha + 0x80) >> 8);
+#endif
}
}
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index bbfc3804a3..b1c1708565 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -173,10 +173,8 @@ bool Text::doRender() {
Common::Rect curRect = fontPtr->getCharacterRect((byte)(*iter).text[i]);
Common::Rect renderRect(curX, curY, curX + curRect.width(), curY + curRect.height());
- int renderX = curX + (renderRect.left - renderRect.left);
- int renderY = curY + (renderRect.top - renderRect.top);
renderRect.translate(curRect.left - curX, curRect.top - curY);
- result = charMapPtr->blit(renderX, renderY, Image::FLIP_NONE, &renderRect, _modulationColor);
+ result = charMapPtr->blit(curX, curY, Image::FLIP_NONE, &renderRect, _modulationColor);
if (!result)
break;
diff --git a/engines/sword25/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp
index 6b99b0a115..99fec52040 100644
--- a/engines/sword25/kernel/kernel.cpp
+++ b/engines/sword25/kernel/kernel.cpp
@@ -95,10 +95,8 @@ Kernel::Kernel() :
_geometry = new Geometry(this);
assert(_geometry);
-#ifdef USE_THEORADEC
_fmv = new MoviePlayer(this);
assert(_fmv);
-#endif
_initSuccess = true;
}
@@ -121,10 +119,8 @@ Kernel::~Kernel() {
delete _geometry;
_geometry = 0;
-#ifdef USE_THEORADEC
delete _fmv;
_fmv = 0;
-#endif
delete _script;
_script = 0;
diff --git a/engines/sword25/util/pluto/Makefile b/engines/sword25/util/pluto/Makefile
deleted file mode 100644
index 611ecc83d2..0000000000
--- a/engines/sword25/util/pluto/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-LDLIBS= -lm -ldl -llua
-LDFLAGS = -rdynamic # -L../lua-5.1.3/src
-# CFLAGS= -g3 -Wall -fprofile-arcs -ftest-coverage
-CFLAGS= -g3 -Wall -ansi -pedantic
-
-LIBTOOL=libtool --tag=CC
-
-default: pluto.so pptest puptest
-
-%.lo: %.c
- $(LIBTOOL) --mode=compile cc $(CFLAGS) -c $<
-
-pluto.so: pluto.lo pdep.lo lzio.lo
- $(LIBTOOL) --mode=link cc -rpath /usr/local/lib/lua/5.1 -o libpluto.la $^
- mv .libs/libpluto.so.0.0.0 $@
-
-test: pptest puptest pptest.lua puptest.lua pluto.so
- ./pptest
- ./puptest
-
-pptest: pptest.o
- $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
-
-puptest: puptest.o
- $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
-
-clean:
- -rm -r *.so *.la *.lo .libs *.a *.o *.bb *.bbg *.da *.gcov pptest puptest test.plh
-
diff --git a/engines/sword25/util/pluto/pdep/lauxlib.h b/engines/sword25/util/pluto/pdep/lauxlib.h
deleted file mode 100644
index d58f290527..0000000000
--- a/engines/sword25/util/pluto/pdep/lauxlib.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-** $Id$
-** Auxiliary functions for building Lua libraries
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lauxlib_h
-#define lauxlib_h
-
-
-#include <stddef.h>
-#include <stdio.h>
-
-#include "lua.h"
-
-
-#if defined(LUA_COMPAT_GETN)
-LUALIB_API int (luaL_getn) (lua_State *L, int t);
-LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
-#else
-#define luaL_getn(L,i) ((int)lua_objlen(L, i))
-#define luaL_setn(L,i,j) ((void)0) /* no op! */
-#endif
-
-#if defined(LUA_COMPAT_OPENLIB)
-#define luaI_openlib luaL_openlib
-#endif
-
-
-/* extra error code for `luaL_load' */
-#define LUA_ERRFILE (LUA_ERRERR+1)
-
-
-typedef struct luaL_Reg {
- const char *name;
- lua_CFunction func;
-} luaL_Reg;
-
-
-
-LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
- const luaL_Reg *l, int nup);
-LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
- const luaL_Reg *l);
-LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
-LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
-LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
-LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
-LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
- size_t *l);
-LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
- const char *def, size_t *l);
-LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
-LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
-
-LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
-LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
- lua_Integer def);
-
-LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
-LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
-LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
-
-LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
-LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
-
-LUALIB_API void (luaL_where) (lua_State *L, int lvl);
-LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
-
-LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
- const char *const lst[]);
-
-LUALIB_API int (luaL_ref) (lua_State *L, int t);
-LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
-
-LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
-LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
- const char *name);
-LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
-
-LUALIB_API lua_State *(luaL_newstate) (void);
-
-
-LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
- const char *r);
-
-LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
- const char *fname, int szhint);
-
-
-
-
-/*
-** ===============================================================
-** some useful macros
-** ===============================================================
-*/
-
-#define luaL_argcheck(L, cond,numarg,extramsg) \
- ((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
-#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
-#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
-#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
-#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
-#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
-#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
-
-#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
-
-#define luaL_dofile(L, fn) \
- (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
-
-#define luaL_dostring(L, s) \
- (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
-
-#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
-
-#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
-
-/*
-** {======================================================
-** Generic Buffer manipulation
-** =======================================================
-*/
-
-
-
-typedef struct luaL_Buffer {
- char *p; /* current position in buffer */
- int lvl; /* number of strings in the stack (level) */
- lua_State *L;
- char buffer[LUAL_BUFFERSIZE];
-} luaL_Buffer;
-
-#define luaL_addchar(B,c) \
- ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
- (*(B)->p++ = (char)(c)))
-
-/* compatibility only */
-#define luaL_putchar(B,c) luaL_addchar(B,c)
-
-#define luaL_addsize(B,n) ((B)->p += (n))
-
-LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
-LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
-LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
-LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
-LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
-LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
-
-
-/* }====================================================== */
-
-
-/* compatibility with ref system */
-
-/* pre-defined references */
-#define LUA_NOREF (-2)
-#define LUA_REFNIL (-1)
-
-#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
- (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
-
-#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
-
-#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
-
-
-#define luaL_reg luaL_Reg
-
-#endif
-
-
diff --git a/engines/sword25/util/pluto/pdep/ldo.h b/engines/sword25/util/pluto/pdep/ldo.h
deleted file mode 100644
index 4c97134805..0000000000
--- a/engines/sword25/util/pluto/pdep/ldo.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** $Id$
-** Stack and Call structure of Lua
-** See Copyright Notice in lua.h
-*/
-
-#ifndef ldo_h
-#define ldo_h
-
-
-#include "lobject.h"
-#include "lstate.h"
-#include "lzio.h"
-
-
-#define luaD_checkstack(L,n) \
- if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
- luaD_growstack(L, n); \
- else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
-
-
-#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
-
-#define savestack(L,p) ((char *)(p) - (char *)L->stack)
-#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
-
-#define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
-#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
-
-
-/* results from luaD_precall */
-#define PCRLUA 0 /* initiated a call to a Lua function */
-#define PCRC 1 /* did a call to a C function */
-#define PCRYIELD 2 /* C funtion yielded */
-
-
-/* type of protected functions, to be ran by `runprotected' */
-typedef void (*Pfunc) (lua_State *L, void *ud);
-
-LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
-LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
-LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
-LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
-LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
- ptrdiff_t oldtop, ptrdiff_t ef);
-LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
-LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
-LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
-LUAI_FUNC void luaD_growstack (lua_State *L, int n);
-
-LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
-LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
-
-LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
-
-#endif
-
diff --git a/engines/sword25/util/pluto/pdep/lfunc.h b/engines/sword25/util/pluto/pdep/lfunc.h
deleted file mode 100644
index 4c2b7fd138..0000000000
--- a/engines/sword25/util/pluto/pdep/lfunc.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-** $Id$
-** Auxiliary functions to manipulate prototypes and closures
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lfunc_h
-#define lfunc_h
-
-
-#include "lobject.h"
-
-
-#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
- cast(int, sizeof(TValue)*((n)-1)))
-
-#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
- cast(int, sizeof(TValue *)*((n)-1)))
-
-
-LUAI_FUNC Proto *luaF_newproto (lua_State *L);
-LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
-LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
-LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
-LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
-LUAI_FUNC void luaF_close (lua_State *L, StkId level);
-LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
-LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
-LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
-LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
- int pc);
-
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/lgc.h b/engines/sword25/util/pluto/pdep/lgc.h
deleted file mode 100644
index 5123ccb479..0000000000
--- a/engines/sword25/util/pluto/pdep/lgc.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-** $Id$
-** Garbage Collector
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lgc_h
-#define lgc_h
-
-
-#include "lobject.h"
-
-
-/*
-** Possible states of the Garbage Collector
-*/
-#define GCSpause 0
-#define GCSpropagate 1
-#define GCSsweepstring 2
-#define GCSsweep 3
-#define GCSfinalize 4
-
-
-/*
-** some userful bit tricks
-*/
-#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
-#define setbits(x,m) ((x) |= (m))
-#define testbits(x,m) ((x) & (m))
-#define bitmask(b) (1<<(b))
-#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
-#define l_setbit(x,b) setbits(x, bitmask(b))
-#define resetbit(x,b) resetbits(x, bitmask(b))
-#define testbit(x,b) testbits(x, bitmask(b))
-#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
-#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
-#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2)))
-
-
-
-/*
-** Layout for bit use in `marked' field:
-** bit 0 - object is white (type 0)
-** bit 1 - object is white (type 1)
-** bit 2 - object is black
-** bit 3 - for userdata: has been finalized
-** bit 3 - for tables: has weak keys
-** bit 4 - for tables: has weak values
-** bit 5 - object is fixed (should not be collected)
-** bit 6 - object is "super" fixed (only the main thread)
-*/
-
-
-#define WHITE0BIT 0
-#define WHITE1BIT 1
-#define BLACKBIT 2
-#define FINALIZEDBIT 3
-#define KEYWEAKBIT 3
-#define VALUEWEAKBIT 4
-#define FIXEDBIT 5
-#define SFIXEDBIT 6
-#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
-
-
-#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
-#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
-#define isgray(x) (!isblack(x) && !iswhite(x))
-
-#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
-#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS)
-
-#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
-#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
-
-#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
-
-#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
-
-
-#define luaC_checkGC(L) { \
- condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
- if (G(L)->totalbytes >= G(L)->GCthreshold) \
- luaC_step(L); }
-
-
-#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
- luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
-
-#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \
- luaC_barrierback(L,t); }
-
-#define luaC_objbarrier(L,p,o) \
- { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
- luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
-
-#define luaC_objbarriert(L,t,o) \
- { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
-
-LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
-LUAI_FUNC void luaC_callGCTM (lua_State *L);
-LUAI_FUNC void luaC_freeall (lua_State *L);
-LUAI_FUNC void luaC_step (lua_State *L);
-LUAI_FUNC void luaC_fullgc (lua_State *L);
-LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
-LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
-LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
-LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
-
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/llimits.h b/engines/sword25/util/pluto/pdep/llimits.h
deleted file mode 100644
index a31ad160ad..0000000000
--- a/engines/sword25/util/pluto/pdep/llimits.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-** $Id$
-** Limits, basic types, and some other `installation-dependent' definitions
-** See Copyright Notice in lua.h
-*/
-
-#ifndef llimits_h
-#define llimits_h
-
-
-#include <limits.h>
-#include <stddef.h>
-
-
-#include "lua.h"
-
-
-typedef LUAI_UINT32 lu_int32;
-
-typedef LUAI_UMEM lu_mem;
-
-typedef LUAI_MEM l_mem;
-
-
-
-/* chars used as small naturals (so that `char' is reserved for characters) */
-typedef unsigned char lu_byte;
-
-
-#define MAX_SIZET ((size_t)(~(size_t)0)-2)
-
-#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2)
-
-
-#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */
-
-/*
-** conversion of pointer to integer
-** this is for hashing only; there is no problem if the integer
-** cannot hold the whole pointer value
-*/
-#define IntPoint(p) ((unsigned int)(lu_mem)(p))
-
-
-
-/* type to ensure maximum alignment */
-typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
-
-
-/* result of a `usual argument conversion' over lua_Number */
-typedef LUAI_UACNUMBER l_uacNumber;
-
-
-/* internal assertions for in-house debugging */
-#ifdef lua_assert
-
-#define check_exp(c,e) (lua_assert(c), (e))
-#define api_check(l,e) lua_assert(e)
-
-#else
-
-#define lua_assert(c) ((void)0)
-#define check_exp(c,e) (e)
-#define api_check luai_apicheck
-
-#endif
-
-
-#ifndef UNUSED
-#define UNUSED(x) ((void)(x)) /* to avoid warnings */
-#endif
-
-
-#ifndef cast
-#define cast(t, exp) ((t)(exp))
-#endif
-
-#define cast_byte(i) cast(lu_byte, (i))
-#define cast_num(i) cast(lua_Number, (i))
-#define cast_int(i) cast(int, (i))
-
-
-
-/*
-** type for virtual-machine instructions
-** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
-*/
-typedef lu_int32 Instruction;
-
-
-
-/* maximum stack for a Lua function */
-#define MAXSTACK 250
-
-
-
-/* minimum size for the string table (must be power of 2) */
-#ifndef MINSTRTABSIZE
-#define MINSTRTABSIZE 32
-#endif
-
-
-/* minimum size for string buffer */
-#ifndef LUA_MINBUFFER
-#define LUA_MINBUFFER 32
-#endif
-
-
-#ifndef lua_lock
-#define lua_lock(L) ((void) 0)
-#define lua_unlock(L) ((void) 0)
-#endif
-
-#ifndef luai_threadyield
-#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);}
-#endif
-
-
-/*
-** macro to control inclusion of some hard tests on stack reallocation
-*/
-#ifndef HARDSTACKTESTS
-#define condhardstacktests(x) ((void)0)
-#else
-#define condhardstacktests(x) x
-#endif
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/lobject.h b/engines/sword25/util/pluto/pdep/lobject.h
deleted file mode 100644
index 35aaed028a..0000000000
--- a/engines/sword25/util/pluto/pdep/lobject.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-** $Id$
-** Type definitions for Lua objects
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lobject_h
-#define lobject_h
-
-
-#include <stdarg.h>
-
-
-#include "llimits.h"
-#include "lua.h"
-
-
-/* tags for values visible from Lua */
-#define LAST_TAG LUA_TTHREAD
-
-#define NUM_TAGS (LAST_TAG+1)
-
-
-/*
-** Extra tags for non-values
-*/
-#define LUA_TPROTO (LAST_TAG+1)
-#define LUA_TUPVAL (LAST_TAG+2)
-#define LUA_TDEADKEY (LAST_TAG+3)
-
-
-/*
-** Union of all collectable objects
-*/
-typedef union GCObject GCObject;
-
-
-/*
-** Common Header for all collectable objects (in macro form, to be
-** included in other objects)
-*/
-#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
-
-
-/*
-** Common header in struct form
-*/
-typedef struct GCheader {
- CommonHeader;
-} GCheader;
-
-
-
-
-/*
-** Union of all Lua values
-*/
-typedef union {
- GCObject *gc;
- void *p;
- lua_Number n;
- int b;
-} Value;
-
-
-/*
-** Tagged Values
-*/
-
-#define TValuefields Value value; int tt
-
-typedef struct lua_TValue {
- TValuefields;
-} TValue;
-
-
-/* Macros to test type */
-#define ttisnil(o) (ttype(o) == LUA_TNIL)
-#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
-#define ttisstring(o) (ttype(o) == LUA_TSTRING)
-#define ttistable(o) (ttype(o) == LUA_TTABLE)
-#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION)
-#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
-#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
-#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
-#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
-
-/* Macros to access values */
-#define ttype(o) ((o)->tt)
-#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc)
-#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p)
-#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n)
-#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
-#define tsvalue(o) (&rawtsvalue(o)->tsv)
-#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u)
-#define uvalue(o) (&rawuvalue(o)->uv)
-#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl)
-#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h)
-#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b)
-#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th)
-
-#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
-
-/*
-** for internal debug only
-*/
-#define checkconsistency(obj) \
- lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt))
-
-#define checkliveness(g,obj) \
- lua_assert(!iscollectable(obj) || \
- ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc)))
-
-
-/* Macros to set values */
-#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
-
-#define setnvalue(obj,x) \
- { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }
-
-#define setpvalue(obj,x) \
- { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; }
-
-#define setbvalue(obj,x) \
- { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; }
-
-#define setsvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \
- checkliveness(G(L),i_o); }
-
-#define setuvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \
- checkliveness(G(L),i_o); }
-
-#define setthvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \
- checkliveness(G(L),i_o); }
-
-#define setclvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \
- checkliveness(G(L),i_o); }
-
-#define sethvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \
- checkliveness(G(L),i_o); }
-
-#define setptvalue(L,obj,x) \
- { TValue *i_o=(obj); \
- i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \
- checkliveness(G(L),i_o); }
-
-
-
-
-#define setobj(L,obj1,obj2) \
- { const TValue *o2=(obj2); TValue *o1=(obj1); \
- o1->value = o2->value; o1->tt=o2->tt; \
- checkliveness(G(L),o1); }
-
-
-/*
-** different types of sets, according to destination
-*/
-
-/* from stack to (same) stack */
-#define setobjs2s setobj
-/* to stack (not from same stack) */
-#define setobj2s setobj
-#define setsvalue2s setsvalue
-#define sethvalue2s sethvalue
-#define setptvalue2s setptvalue
-/* from table to same table */
-#define setobjt2t setobj
-/* to table */
-#define setobj2t setobj
-/* to new object */
-#define setobj2n setobj
-#define setsvalue2n setsvalue
-
-#define setttype(obj, tt) (ttype(obj) = (tt))
-
-
-#define iscollectable(o) (ttype(o) >= LUA_TSTRING)
-
-
-
-typedef TValue *StkId; /* index to stack elements */
-
-
-/*
-** String headers for string table
-*/
-typedef union TString {
- L_Umaxalign dummy; /* ensures maximum alignment for strings */
- struct {
- CommonHeader;
- lu_byte reserved;
- unsigned int hash;
- size_t len;
- } tsv;
-} TString;
-
-
-#define getstr(ts) cast(const char *, (ts) + 1)
-#define svalue(o) getstr(tsvalue(o))
-
-
-
-typedef union Udata {
- L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */
- struct {
- CommonHeader;
- struct Table *metatable;
- struct Table *env;
- size_t len;
- } uv;
-} Udata;
-
-
-
-
-/*
-** Function Prototypes
-*/
-typedef struct Proto {
- CommonHeader;
- TValue *k; /* constants used by the function */
- Instruction *code;
- struct Proto **p; /* functions defined inside the function */
- int *lineinfo; /* map from opcodes to source lines */
- struct LocVar *locvars; /* information about local variables */
- TString **upvalues; /* upvalue names */
- TString *source;
- int sizeupvalues;
- int sizek; /* size of `k' */
- int sizecode;
- int sizelineinfo;
- int sizep; /* size of `p' */
- int sizelocvars;
- int linedefined;
- int lastlinedefined;
- GCObject *gclist;
- lu_byte nups; /* number of upvalues */
- lu_byte numparams;
- lu_byte is_vararg;
- lu_byte maxstacksize;
-} Proto;
-
-
-/* masks for new-style vararg */
-#define VARARG_HASARG 1
-#define VARARG_ISVARARG 2
-#define VARARG_NEEDSARG 4
-
-
-typedef struct LocVar {
- TString *varname;
- int startpc; /* first point where variable is active */
- int endpc; /* first point where variable is dead */
-} LocVar;
-
-
-
-/*
-** Upvalues
-*/
-
-typedef struct UpVal {
- CommonHeader;
- TValue *v; /* points to stack or to its own value */
- union {
- TValue value; /* the value (when closed) */
- struct { /* double linked list (when open) */
- struct UpVal *prev;
- struct UpVal *next;
- } l;
- } u;
-} UpVal;
-
-
-/*
-** Closures
-*/
-
-#define ClosureHeader \
- CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
- struct Table *env
-
-typedef struct CClosure {
- ClosureHeader;
- lua_CFunction f;
- TValue upvalue[1];
-} CClosure;
-
-
-typedef struct LClosure {
- ClosureHeader;
- struct Proto *p;
- UpVal *upvals[1];
-} LClosure;
-
-
-typedef union Closure {
- CClosure c;
- LClosure l;
-} Closure;
-
-
-#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
-#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
-
-
-/*
-** Tables
-*/
-
-typedef union TKey {
- struct {
- TValuefields;
- struct Node *next; /* for chaining */
- } nk;
- TValue tvk;
-} TKey;
-
-
-typedef struct Node {
- TValue i_val;
- TKey i_key;
-} Node;
-
-
-typedef struct Table {
- CommonHeader;
- lu_byte flags; /* 1<<p means tagmethod(p) is not present */
- lu_byte lsizenode; /* log2 of size of `node' array */
- struct Table *metatable;
- TValue *array; /* array part */
- Node *node;
- Node *lastfree; /* any free position is before this position */
- GCObject *gclist;
- int sizearray; /* size of `array' array */
-} Table;
-
-
-
-/*
-** `module' operation for hashing (size is always a power of 2)
-*/
-#define lmod(s,size) \
- (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
-
-
-#define twoto(x) (1<<(x))
-#define sizenode(t) (twoto((t)->lsizenode))
-
-
-#define luaO_nilobject (&luaO_nilobject_)
-
-LUAI_DATA const TValue luaO_nilobject_;
-
-#define ceillog2(x) (luaO_log2((x)-1) + 1)
-
-LUAI_FUNC int luaO_log2 (unsigned int x);
-LUAI_FUNC int luaO_int2fb (unsigned int x);
-LUAI_FUNC int luaO_fb2int (int x);
-LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
-LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
-LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
- va_list argp);
-LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
-LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);
-
-
-#endif
-
diff --git a/engines/sword25/util/pluto/pdep/lopcodes.h b/engines/sword25/util/pluto/pdep/lopcodes.h
deleted file mode 100644
index e1aed0f637..0000000000
--- a/engines/sword25/util/pluto/pdep/lopcodes.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
-** $Id$
-** Opcodes for Lua virtual machine
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lopcodes_h
-#define lopcodes_h
-
-#include "llimits.h"
-
-
-/*===========================================================================
- We assume that instructions are unsigned numbers.
- All instructions have an opcode in the first 6 bits.
- Instructions can have the following fields:
- `A' : 8 bits
- `B' : 9 bits
- `C' : 9 bits
- `Bx' : 18 bits (`B' and `C' together)
- `sBx' : signed Bx
-
- A signed argument is represented in excess K; that is, the number
- value is the unsigned value minus K. K is exactly the maximum value
- for that argument (so that -max is represented by 0, and +max is
- represented by 2*max), which is half the maximum for the corresponding
- unsigned argument.
-===========================================================================*/
-
-
-enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */
-
-
-/*
-** size and position of opcode arguments.
-*/
-#define SIZE_C 9
-#define SIZE_B 9
-#define SIZE_Bx (SIZE_C + SIZE_B)
-#define SIZE_A 8
-
-#define SIZE_OP 6
-
-#define POS_OP 0
-#define POS_A (POS_OP + SIZE_OP)
-#define POS_C (POS_A + SIZE_A)
-#define POS_B (POS_C + SIZE_C)
-#define POS_Bx POS_C
-
-
-/*
-** limits for opcode arguments.
-** we use (signed) int to manipulate most arguments,
-** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)
-*/
-#if SIZE_Bx < LUAI_BITSINT-1
-#define MAXARG_Bx ((1<<SIZE_Bx)-1)
-#define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */
-#else
-#define MAXARG_Bx MAX_INT
-#define MAXARG_sBx MAX_INT
-#endif
-
-
-#define MAXARG_A ((1<<SIZE_A)-1)
-#define MAXARG_B ((1<<SIZE_B)-1)
-#define MAXARG_C ((1<<SIZE_C)-1)
-
-
-/* creates a mask with `n' 1 bits at position `p' */
-#define MASK1(n,p) ((~((~(Instruction)0)<<n))<<p)
-
-/* creates a mask with `n' 0 bits at position `p' */
-#define MASK0(n,p) (~MASK1(n,p))
-
-/*
-** the following macros help to manipulate instructions
-*/
-
-#define GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
-#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
- ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
-
-#define GETARG_A(i) (cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))
-#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
- ((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))
-
-#define GETARG_B(i) (cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))
-#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
- ((cast(Instruction, b)<<POS_B)&MASK1(SIZE_B,POS_B))))
-
-#define GETARG_C(i) (cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))
-#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
- ((cast(Instruction, b)<<POS_C)&MASK1(SIZE_C,POS_C))))
-
-#define GETARG_Bx(i) (cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))
-#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
- ((cast(Instruction, b)<<POS_Bx)&MASK1(SIZE_Bx,POS_Bx))))
-
-#define GETARG_sBx(i) (GETARG_Bx(i)-MAXARG_sBx)
-#define SETARG_sBx(i,b) SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
-
-
-#define CREATE_ABC(o,a,b,c) ((cast(Instruction, o)<<POS_OP) \
- | (cast(Instruction, a)<<POS_A) \
- | (cast(Instruction, b)<<POS_B) \
- | (cast(Instruction, c)<<POS_C))
-
-#define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \
- | (cast(Instruction, a)<<POS_A) \
- | (cast(Instruction, bc)<<POS_Bx))
-
-
-/*
-** Macros to operate RK indices
-*/
-
-/* this bit 1 means constant (0 means register) */
-#define BITRK (1 << (SIZE_B - 1))
-
-/* test whether value is a constant */
-#define ISK(x) ((x) & BITRK)
-
-/* gets the index of the constant */
-#define INDEXK(r) ((int)(r) & ~BITRK)
-
-#define MAXINDEXRK (BITRK - 1)
-
-/* code a constant index as a RK value */
-#define RKASK(x) ((x) | BITRK)
-
-
-/*
-** invalid register that fits in 8 bits
-*/
-#define NO_REG MAXARG_A
-
-
-/*
-** R(x) - register
-** Kst(x) - constant (in constant table)
-** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)
-*/
-
-
-/*
-** grep "ORDER OP" if you change these enums
-*/
-
-typedef enum {
-/*----------------------------------------------------------------------
-name args description
-------------------------------------------------------------------------*/
-OP_MOVE,/* A B R(A) := R(B) */
-OP_LOADK,/* A Bx R(A) := Kst(Bx) */
-OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */
-OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */
-OP_GETUPVAL,/* A B R(A) := UpValue[B] */
-
-OP_GETGLOBAL,/* A Bx R(A) := Gbl[Kst(Bx)] */
-OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */
-
-OP_SETGLOBAL,/* A Bx Gbl[Kst(Bx)] := R(A) */
-OP_SETUPVAL,/* A B UpValue[B] := R(A) */
-OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */
-
-OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */
-
-OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */
-
-OP_ADD,/* A B C R(A) := RK(B) + RK(C) */
-OP_SUB,/* A B C R(A) := RK(B) - RK(C) */
-OP_MUL,/* A B C R(A) := RK(B) * RK(C) */
-OP_DIV,/* A B C R(A) := RK(B) / RK(C) */
-OP_MOD,/* A B C R(A) := RK(B) % RK(C) */
-OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */
-OP_UNM,/* A B R(A) := -R(B) */
-OP_NOT,/* A B R(A) := not R(B) */
-OP_LEN,/* A B R(A) := length of R(B) */
-
-OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */
-
-OP_JMP,/* sBx pc+=sBx */
-
-OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */
-OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */
-OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */
-
-OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
-OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
-
-OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
-OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
-OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
-
-OP_FORLOOP,/* A sBx R(A)+=R(A+2);
- if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
-OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
-
-OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
- if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
-OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
-
-OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
-OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */
-
-OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
-} OpCode;
-
-
-#define NUM_OPCODES (cast(int, OP_VARARG) + 1)
-
-
-
-/*===========================================================================
- Notes:
- (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,
- and can be 0: OP_CALL then sets `top' to last_result+1, so
- next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.
-
- (*) In OP_VARARG, if (B == 0) then use actual number of varargs and
- set top (like in OP_CALL with C == 0).
-
- (*) In OP_RETURN, if (B == 0) then return up to `top'
-
- (*) In OP_SETLIST, if (B == 0) then B = `top';
- if (C == 0) then next `instruction' is real C
-
- (*) For comparisons, A specifies what condition the test should accept
- (true or false).
-
- (*) All `skips' (pc++) assume that next instruction is a jump
-===========================================================================*/
-
-
-/*
-** masks for instruction properties. The format is:
-** bits 0-1: op mode
-** bits 2-3: C arg mode
-** bits 4-5: B arg mode
-** bit 6: instruction set register A
-** bit 7: operator is a test
-*/
-
-enum OpArgMask {
- OpArgN, /* argument is not used */
- OpArgU, /* argument is used */
- OpArgR, /* argument is a register or a jump offset */
- OpArgK /* argument is a constant or register/constant */
-};
-
-LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
-
-#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
-#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
-#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
-#define testAMode(m) (luaP_opmodes[m] & (1 << 6))
-#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
-
-
-LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
-
-
-/* number of list items to accumulate before a SETLIST instruction */
-#define LFIELDS_PER_FLUSH 50
-
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/lstate.h b/engines/sword25/util/pluto/pdep/lstate.h
deleted file mode 100644
index 94a6249461..0000000000
--- a/engines/sword25/util/pluto/pdep/lstate.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-** $Id$
-** Global State
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lstate_h
-#define lstate_h
-
-#include "lua.h"
-
-#include "lobject.h"
-#include "ltm.h"
-#include "lzio.h"
-
-
-
-struct lua_longjmp; /* defined in ldo.c */
-
-
-/* table of globals */
-#define gt(L) (&L->l_gt)
-
-/* registry */
-#define registry(L) (&G(L)->l_registry)
-
-
-/* extra stack space to handle TM calls and some other extras */
-#define EXTRA_STACK 5
-
-
-#define BASIC_CI_SIZE 8
-
-#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
-
-
-
-typedef struct stringtable {
- GCObject **hash;
- lu_int32 nuse; /* number of elements */
- int size;
-} stringtable;
-
-
-/*
-** informations about a call
-*/
-typedef struct CallInfo {
- StkId base; /* base for this function */
- StkId func; /* function index in the stack */
- StkId top; /* top for this function */
- const Instruction *savedpc;
- int nresults; /* expected number of results from this function */
- int tailcalls; /* number of tail calls lost under this entry */
-} CallInfo;
-
-
-
-#define curr_func(L) (clvalue(L->ci->func))
-#define ci_func(ci) (clvalue((ci)->func))
-#define f_isLua(ci) (!ci_func(ci)->c.isC)
-#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci))
-
-
-/*
-** `global state', shared by all threads of this state
-*/
-typedef struct global_State {
- stringtable strt; /* hash table for strings */
- lua_Alloc frealloc; /* function to reallocate memory */
- void *ud; /* auxiliary data to `frealloc' */
- lu_byte currentwhite;
- lu_byte gcstate; /* state of garbage collector */
- int sweepstrgc; /* position of sweep in `strt' */
- GCObject *rootgc; /* list of all collectable objects */
- GCObject **sweepgc; /* position of sweep in `rootgc' */
- GCObject *gray; /* list of gray objects */
- GCObject *grayagain; /* list of objects to be traversed atomically */
- GCObject *weak; /* list of weak tables (to be cleared) */
- GCObject *tmudata; /* last element of list of userdata to be GC */
- Mbuffer buff; /* temporary buffer for string concatentation */
- lu_mem GCthreshold;
- lu_mem totalbytes; /* number of bytes currently allocated */
- lu_mem estimate; /* an estimate of number of bytes actually in use */
- lu_mem gcdept; /* how much GC is `behind schedule' */
- int gcpause; /* size of pause between successive GCs */
- int gcstepmul; /* GC `granularity' */
- lua_CFunction panic; /* to be called in unprotected errors */
- TValue l_registry;
- struct lua_State *mainthread;
- UpVal uvhead; /* head of double-linked list of all open upvalues */
- struct Table *mt[NUM_TAGS]; /* metatables for basic types */
- TString *tmname[TM_N]; /* array with tag-method names */
-} global_State;
-
-
-/*
-** `per thread' state
-*/
-struct lua_State {
- CommonHeader;
- lu_byte status;
- StkId top; /* first free slot in the stack */
- StkId base; /* base of current function */
- global_State *l_G;
- CallInfo *ci; /* call info for current function */
- const Instruction *savedpc; /* `savedpc' of current function */
- StkId stack_last; /* last free slot in the stack */
- StkId stack; /* stack base */
- CallInfo *end_ci; /* points after end of ci array*/
- CallInfo *base_ci; /* array of CallInfo's */
- int stacksize;
- int size_ci; /* size of array `base_ci' */
- unsigned short nCcalls; /* number of nested C calls */
- unsigned short baseCcalls; /* nested C calls when resuming coroutine */
- lu_byte hookmask;
- lu_byte allowhook;
- int basehookcount;
- int hookcount;
- lua_Hook hook;
- TValue l_gt; /* table of globals */
- TValue env; /* temporary place for environments */
- GCObject *openupval; /* list of open upvalues in this stack */
- GCObject *gclist;
- struct lua_longjmp *errorJmp; /* current error recover point */
- ptrdiff_t errfunc; /* current error handling function (stack index) */
-};
-
-
-#define G(L) (L->l_G)
-
-
-/*
-** Union of all collectable objects
-*/
-union GCObject {
- GCheader gch;
- union TString ts;
- union Udata u;
- union Closure cl;
- struct Table h;
- struct Proto p;
- struct UpVal uv;
- struct lua_State th; /* thread */
-};
-
-
-/* macros to convert a GCObject into a specific value */
-#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
-#define gco2ts(o) (&rawgco2ts(o)->tsv)
-#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
-#define gco2u(o) (&rawgco2u(o)->uv)
-#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
-#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
-#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
-#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
-#define ngcotouv(o) \
- check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
-#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
-
-/* macro to convert any Lua object into a GCObject */
-#define obj2gco(v) (cast(GCObject *, (v)))
-
-
-LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
-LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
-
-#endif
-
diff --git a/engines/sword25/util/pluto/pdep/lstring.h b/engines/sword25/util/pluto/pdep/lstring.h
deleted file mode 100644
index c88e4c12a9..0000000000
--- a/engines/sword25/util/pluto/pdep/lstring.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-** $Id$
-** String table (keep all strings handled by Lua)
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lstring_h
-#define lstring_h
-
-
-#include "lgc.h"
-#include "lobject.h"
-#include "lstate.h"
-
-
-#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
-
-#define sizeudata(u) (sizeof(union Udata)+(u)->len)
-
-#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
-#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
- (sizeof(s)/sizeof(char))-1))
-
-#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
-
-LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
-LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
-LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
-
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/ltm.h b/engines/sword25/util/pluto/pdep/ltm.h
deleted file mode 100644
index 1b89683ef3..0000000000
--- a/engines/sword25/util/pluto/pdep/ltm.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-** $Id$
-** Tag methods
-** See Copyright Notice in lua.h
-*/
-
-#ifndef ltm_h
-#define ltm_h
-
-
-#include "lobject.h"
-
-
-/*
-* WARNING: if you change the order of this enumeration,
-* grep "ORDER TM"
-*/
-typedef enum {
- TM_INDEX,
- TM_NEWINDEX,
- TM_GC,
- TM_MODE,
- TM_EQ, /* last tag method with `fast' access */
- TM_ADD,
- TM_SUB,
- TM_MUL,
- TM_DIV,
- TM_MOD,
- TM_POW,
- TM_UNM,
- TM_LEN,
- TM_LT,
- TM_LE,
- TM_CONCAT,
- TM_CALL,
- TM_N /* number of elements in the enum */
-} TMS;
-
-
-
-#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
- ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
-
-#define fasttm(l,et,e) gfasttm(G(l), et, e)
-
-LUAI_DATA const char *const luaT_typenames[];
-
-
-LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
-LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
- TMS event);
-LUAI_FUNC void luaT_init (lua_State *L);
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/lua.h b/engines/sword25/util/pluto/pdep/lua.h
deleted file mode 100644
index 68dd887f0f..0000000000
--- a/engines/sword25/util/pluto/pdep/lua.h
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-** $Id$
-** Lua - An Extensible Extension Language
-** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
-** See Copyright Notice at the end of this file
-*/
-
-
-#ifndef lua_h
-#define lua_h
-
-#include <stdarg.h>
-#include <stddef.h>
-
-
-#include "sword25/util/lua/luaconf.h"
-
-
-#define LUA_VERSION "Lua 5.1"
-#define LUA_RELEASE "Lua 5.1.3"
-#define LUA_VERSION_NUM 501
-#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
-#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
-
-
-/* mark for precompiled code (`<esc>Lua') */
-#define LUA_SIGNATURE "\033Lua"
-
-/* option for multiple returns in `lua_pcall' and `lua_call' */
-#define LUA_MULTRET (-1)
-
-
-/*
-** pseudo-indices
-*/
-#define LUA_REGISTRYINDEX (-10000)
-#define LUA_ENVIRONINDEX (-10001)
-#define LUA_GLOBALSINDEX (-10002)
-#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
-
-
-/* thread status; 0 is OK */
-#define LUA_YIELD 1
-#define LUA_ERRRUN 2
-#define LUA_ERRSYNTAX 3
-#define LUA_ERRMEM 4
-#define LUA_ERRERR 5
-
-
-typedef struct lua_State lua_State;
-
-typedef int (*lua_CFunction) (lua_State *L);
-
-
-/*
-** functions that read/write blocks when loading/dumping Lua chunks
-*/
-typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
-
-typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
-
-
-/*
-** prototype for memory-allocation functions
-*/
-typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
-
-
-/*
-** basic types
-*/
-#define LUA_TNONE (-1)
-
-#define LUA_TNIL 0
-#define LUA_TBOOLEAN 1
-#define LUA_TLIGHTUSERDATA 2
-#define LUA_TNUMBER 3
-#define LUA_TSTRING 4
-#define LUA_TTABLE 5
-#define LUA_TFUNCTION 6
-#define LUA_TUSERDATA 7
-#define LUA_TTHREAD 8
-
-
-
-/* minimum Lua stack available to a C function */
-#define LUA_MINSTACK 20
-
-
-/*
-** generic extra include file
-*/
-#if defined(LUA_USER_H)
-#include LUA_USER_H
-#endif
-
-
-/* type of numbers in Lua */
-typedef LUA_NUMBER lua_Number;
-
-
-/* type for integer functions */
-typedef LUA_INTEGER lua_Integer;
-
-
-
-/*
-** state manipulation
-*/
-LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
-LUA_API void (lua_close) (lua_State *L);
-LUA_API lua_State *(lua_newthread) (lua_State *L);
-
-LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
-
-
-/*
-** basic stack manipulation
-*/
-LUA_API int (lua_gettop) (lua_State *L);
-LUA_API void (lua_settop) (lua_State *L, int idx);
-LUA_API void (lua_pushvalue) (lua_State *L, int idx);
-LUA_API void (lua_remove) (lua_State *L, int idx);
-LUA_API void (lua_insert) (lua_State *L, int idx);
-LUA_API void (lua_replace) (lua_State *L, int idx);
-LUA_API int (lua_checkstack) (lua_State *L, int sz);
-
-LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);
-
-
-/*
-** access functions (stack -> C)
-*/
-
-LUA_API int (lua_isnumber) (lua_State *L, int idx);
-LUA_API int (lua_isstring) (lua_State *L, int idx);
-LUA_API int (lua_iscfunction) (lua_State *L, int idx);
-LUA_API int (lua_isuserdata) (lua_State *L, int idx);
-LUA_API int (lua_type) (lua_State *L, int idx);
-LUA_API const char *(lua_typename) (lua_State *L, int tp);
-
-LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2);
-LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
-LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2);
-
-LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx);
-LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx);
-LUA_API int (lua_toboolean) (lua_State *L, int idx);
-LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
-LUA_API size_t (lua_objlen) (lua_State *L, int idx);
-LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
-LUA_API void *(lua_touserdata) (lua_State *L, int idx);
-LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
-LUA_API const void *(lua_topointer) (lua_State *L, int idx);
-
-
-/*
-** push functions (C -> stack)
-*/
-LUA_API void (lua_pushnil) (lua_State *L);
-LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
-LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
-LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l);
-LUA_API void (lua_pushstring) (lua_State *L, const char *s);
-LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
- va_list argp);
-LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
-LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
-LUA_API void (lua_pushboolean) (lua_State *L, int b);
-LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
-LUA_API int (lua_pushthread) (lua_State *L);
-
-
-/*
-** get functions (Lua -> stack)
-*/
-LUA_API void (lua_gettable) (lua_State *L, int idx);
-LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
-LUA_API void (lua_rawget) (lua_State *L, int idx);
-LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
-LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
-LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
-LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
-LUA_API void (lua_getfenv) (lua_State *L, int idx);
-
-
-/*
-** set functions (stack -> Lua)
-*/
-LUA_API void (lua_settable) (lua_State *L, int idx);
-LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
-LUA_API void (lua_rawset) (lua_State *L, int idx);
-LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
-LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
-LUA_API int (lua_setfenv) (lua_State *L, int idx);
-
-
-/*
-** `load' and `call' functions (load and run Lua code)
-*/
-LUA_API void (lua_call) (lua_State *L, int nargs, int nresults);
-LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
-LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
-LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
- const char *chunkname);
-
-LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
-
-
-/*
-** coroutine functions
-*/
-LUA_API int (lua_yield) (lua_State *L, int nresults);
-LUA_API int (lua_resume) (lua_State *L, int narg);
-LUA_API int (lua_status) (lua_State *L);
-
-/*
-** garbage-collection function and options
-*/
-
-#define LUA_GCSTOP 0
-#define LUA_GCRESTART 1
-#define LUA_GCCOLLECT 2
-#define LUA_GCCOUNT 3
-#define LUA_GCCOUNTB 4
-#define LUA_GCSTEP 5
-#define LUA_GCSETPAUSE 6
-#define LUA_GCSETSTEPMUL 7
-
-LUA_API int (lua_gc) (lua_State *L, int what, int data);
-
-
-/*
-** miscellaneous functions
-*/
-
-LUA_API int (lua_error) (lua_State *L);
-
-LUA_API int (lua_next) (lua_State *L, int idx);
-
-LUA_API void (lua_concat) (lua_State *L, int n);
-
-LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
-LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
-
-
-
-/*
-** ===============================================================
-** some useful macros
-** ===============================================================
-*/
-
-#define lua_pop(L,n) lua_settop(L, -(n)-1)
-
-#define lua_newtable(L) lua_createtable(L, 0, 0)
-
-#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
-
-#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
-
-#define lua_strlen(L,i) lua_objlen(L, (i))
-
-#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
-#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
-#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
-#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
-#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
-#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
-#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
-#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
-
-#define lua_pushliteral(L, s) \
- lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
-
-#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
-#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
-
-#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
-
-
-
-/*
-** compatibility macros and functions
-*/
-
-#define lua_open() luaL_newstate()
-
-#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
-
-#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0)
-
-#define lua_Chunkreader lua_Reader
-#define lua_Chunkwriter lua_Writer
-
-
-/* hack */
-LUA_API void lua_setlevel (lua_State *from, lua_State *to);
-
-
-/*
-** {======================================================================
-** Debug API
-** =======================================================================
-*/
-
-
-/*
-** Event codes
-*/
-#define LUA_HOOKCALL 0
-#define LUA_HOOKRET 1
-#define LUA_HOOKLINE 2
-#define LUA_HOOKCOUNT 3
-#define LUA_HOOKTAILRET 4
-
-
-/*
-** Event masks
-*/
-#define LUA_MASKCALL (1 << LUA_HOOKCALL)
-#define LUA_MASKRET (1 << LUA_HOOKRET)
-#define LUA_MASKLINE (1 << LUA_HOOKLINE)
-#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
-
-typedef struct lua_Debug lua_Debug; /* activation record */
-
-
-/* Functions to be called by the debuger in specific events */
-typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
-
-
-LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
-LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
-LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
-LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
-LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);
-LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);
-
-LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
-LUA_API lua_Hook lua_gethook (lua_State *L);
-LUA_API int lua_gethookmask (lua_State *L);
-LUA_API int lua_gethookcount (lua_State *L);
-
-
-struct lua_Debug {
- int event;
- const char *name; /* (n) */
- const char *namewhat; /* (n) `global', `local', `field', `method' */
- const char *what; /* (S) `Lua', `C', `main', `tail' */
- const char *source; /* (S) */
- int currentline; /* (l) */
- int nups; /* (u) number of upvalues */
- int linedefined; /* (S) */
- int lastlinedefined; /* (S) */
- char short_src[LUA_IDSIZE]; /* (S) */
- /* private part */
- int i_ci; /* active function */
-};
-
-/* }====================================================================== */
-
-
-/******************************************************************************
-* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-******************************************************************************/
-
-
-#endif
diff --git a/engines/sword25/util/pluto/pdep/lzio.h b/engines/sword25/util/pluto/pdep/lzio.h
index 2f167d7d58..2e37f8d202 100644
--- a/engines/sword25/util/pluto/pdep/lzio.h
+++ b/engines/sword25/util/pluto/pdep/lzio.h
@@ -8,7 +8,7 @@
#ifndef lzio_h
#define lzio_h
-#include "lua.h"
+#include "sword25/util/lua/lua.h"
#define EOZ (-1) /* end of stream */
diff --git a/engines/sword25/util/pluto/pdep/pdep.h b/engines/sword25/util/pluto/pdep/pdep.h
index c26f4566c5..664fc812b5 100644
--- a/engines/sword25/util/pluto/pdep/pdep.h
+++ b/engines/sword25/util/pluto/pdep/pdep.h
@@ -1,16 +1,17 @@
#ifndef PDEP_H
#define PDEP_H
-#include "lua.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "llimits.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "lauxlib.h"
+#include "sword25/util/lua/lua.h"
+#include "sword25/util/pluto/pdep/lzio.h"
+#include "sword25/util/lua/ldo.h"
+#include "sword25/util/lua/lfunc.h"
+#include "sword25/util/lua/lgc.h"
+#include "sword25/util/lua/llimits.h"
+#include "sword25/util/lua/lobject.h"
+#include "sword25/util/lua/lopcodes.h"
+#include "sword25/util/lua/lstate.h"
+#include "sword25/util/lua/lstring.h"
+#include "sword25/util/lua/lauxlib.h"
#define pdep_reallocv(L,b,on,n,e) \
diff --git a/engines/sword25/util/pluto/pptest.cpp b/engines/sword25/util/pluto/pptest.cpp
deleted file mode 100644
index 1bfecf2b75..0000000000
--- a/engines/sword25/util/pluto/pptest.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $Id$ */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "lua.h"
-#include "lualib.h"
-#include "lauxlib.h"
-
-static int LUAF_createludata(lua_State *L)
-{
- lua_pushlightuserdata(L, (void*)321);
- return 1;
-}
-
-/* A userdata that may be literally persisted */
-static int LUAF_boxinteger(lua_State *L)
-{
- /* num */
- int* ptr = lua_newuserdata(L, sizeof(int));
- /* num udata */
- *ptr = luaL_checkint(L, 1);
- lua_newtable(L);
- /* num udata mt */
- lua_pushstring(L, "__persist");
- /* num udata mt "__persist" */
- lua_pushboolean(L, 1);
- /* num udata mt "__persist" true */
- lua_rawset(L, 3);
- /* num udata mt */
- lua_setmetatable(L, 2);
- /* num udata */
- return 1;
-}
-
-static int LUAF_boxboolean(lua_State *L)
-{
- /* bool */
- char* ptr = lua_newuserdata(L, sizeof(char));
- /* bool udata */
- *ptr = lua_toboolean(L, 1);
- lua_newtable(L);
- /* num udata mt */
- lua_pushstring(L, "__persist");
- /* num udata mt "__persist" */
- lua_getglobal(L, "booleanpersist");
- /* num udata mt "__persist" booleanpersist */
- lua_rawset(L, 3);
- /* num udata mt */
- lua_setmetatable(L, 2);
- /* num udata */
- return 1;
-}
-
-static int LUAF_unboxboolean(lua_State *L)
-{
- /* udata */
- lua_pushboolean(L, *(char*)lua_touserdata(L, 1));
- /* udata bool */
- return 1;
-}
-
-static int LUAF_onerror(lua_State *L)
-{
-
- const char* str = 0;
- if(lua_gettop(L) != 0)
- {
- str = lua_tostring(L, -1);
- printf("%s\n",str);
- }
- return 0;
-}
-
-int main()
-{
- lua_State* L = lua_open();
-
- luaL_openlibs(L);
- lua_settop(L, 0);
-
- lua_register(L, "createludata", LUAF_createludata);
- lua_register(L, "boxinteger", LUAF_boxinteger);
- lua_register(L, "boxboolean", LUAF_boxboolean);
- lua_register(L, "unboxboolean", LUAF_unboxboolean);
- lua_register(L, "onerror", LUAF_onerror);
-
- lua_pushcfunction(L, LUAF_onerror);
- luaL_loadfile(L, "pptest.lua");
- lua_pcall(L,0,0,1);
-
- lua_close(L);
-
- return 0;
-}
diff --git a/engines/sword25/util/pluto/pptest.lua b/engines/sword25/util/pluto/pptest.lua
deleted file mode 100644
index 144da3ee80..0000000000
--- a/engines/sword25/util/pluto/pptest.lua
+++ /dev/null
@@ -1,168 +0,0 @@
--- $Id$
-
-require "pluto"
-
-permtable = { 1234 }
-
-perms = { [coroutine.yield] = 1, [permtable] = 2 }
-
-twithmt = {}
-setmetatable( twithmt, { __call = function() return 21 end } )
-
-function testfenv()
- return abc
-end
-
-setfenv(testfenv, { abc = 456 })
-
-function fa(i)
- local ia = i + 1
- return fb(ia)
-end
-
-function fb(i)
- local ib = i + 1
- ib = ib + fc(ib)
- return ib
-end
-
-function fc(i)
- local ic = i + 1
- coroutine.yield()
- return ic*2
-end
-
-function func()
- return 4
-end
-
-thr = coroutine.create(fa)
-coroutine.resume(thr, 2)
-
-testtbl = { a = 2, [2] = 4 }
-
-function funcreturningclosure(n)
- return function()
- return n
- end
-end
-
-function nestedfunc(n)
- return (function(m) return m+2 end)(n+3)
-end
-
-testloopa = {}
-testloopb = { testloopa = testloopa }
-testloopa.testloopb = testloopb
-
-sharedref = {}
-refa = {sharedref = sharedref}
-refb = {sharedref = sharedref}
-
-sptable = { a = 3 }
-
-setmetatable(sptable, {
- __persist = function(tbl)
- local a = tbl.a
- return function()
- return { a = a+3 }
- end
- end
-})
-
-literaludata = boxinteger(71)
-
-function booleanpersist(udata)
- local b = unboxboolean(udata)
- return function()
- return boxboolean(b)
- end
-end
-
-function makecounter()
- local a = 0
- return {
- inc = function() a = a + 1 end,
- cur = function() return a end
- }
-end
-
-function uvinthreadfunc()
- local a = 1
- local b = function()
- a = a+1
- coroutine.yield()
- a = a+1
- end
- a = a+1
- b()
- a = a+1
- return a
-end
-
-uvinthread = coroutine.create(uvinthreadfunc)
-coroutine.resume(uvinthread)
-
-niinmt = { a = 3 }
-setmetatable(niinmt, {__newindex = function(key, val) end })
-
-
-
-
-local function GenerateObjects()
- local Table = {}
-
- function Table:Func()
- return { Table, self }
- end
-
- function uvcycle()
- return Table:Func()
- end
-end
-
-GenerateObjects()
-
-
-
-function debuginfo(foo)
- foo = foo + foo
- return debug.getlocal(1,1)
-end
-
-rootobj = {
- testfalse = false,
- testtrue = true,
- testseven = 7,
- testfoobar = "foobar",
- testfuncreturnsfour = func,
- testnil = nil,
- testthread = thr,
- testperm = permtable,
- testmt = twithmt,
- testtbl = testtbl,
- testfenv = testfenv,
- testclosure = funcreturningclosure(11),
- testnilclosure = funcreturningclosure(nil),
- testnest = nestedfunc,
- testludata = createludata(),
- testlooptable = testloopa,
- testsharedrefa = refa,
- testsharedrefb = refb,
- testsptable = sptable,
- testliteraludata = literaludata,
- testspudata1 = boxboolean(true),
- testspudata2 = boxboolean(false),
- testsharedupval = makecounter(),
- testuvinthread = uvinthread,
- testniinmt = niinmt,
- testuvcycle = uvcycle,
- testdebuginfo = debuginfo
-}
-
-buf = pluto.persist(perms, rootobj)
-
-onerror()
-outfile = io.open("test.plh", "wb")
-outfile:write(buf)
-outfile:close()
diff --git a/engines/sword25/util/pluto/puptest.cpp b/engines/sword25/util/pluto/puptest.cpp
deleted file mode 100644
index e9aa7ea305..0000000000
--- a/engines/sword25/util/pluto/puptest.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $Id$ */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "lua.h"
-#include "lualib.h"
-#include "lauxlib.h"
-
-static int LUAF_checkludata(lua_State *L)
-{
- lua_pushboolean(L, lua_touserdata(L, -1) == (void*)321);
- return 1;
-}
-
-static int LUAF_unboxinteger(lua_State *L)
-{
- lua_pushnumber(L, *((int*)lua_touserdata(L, -1)));
- return 1;
-}
-
-static int LUAF_unboxboolean(lua_State *L)
-{
- /* udata */
- lua_pushboolean(L, *(char*)lua_touserdata(L, 1));
- /* udata bool */
- return 1;
-}
-
-static int LUAF_boxboolean(lua_State *L)
-{
- /* bool */
- char* ptr = lua_newuserdata(L, sizeof(char));
- /* bool udata */
- *ptr = lua_toboolean(L, 1);
- lua_newtable(L);
- /* num udata mt */
- lua_pushstring(L, "__persist");
- /* num udata mt "__persist" */
- lua_getglobal(L, "booleanpersist");
- /* num udata mt "__persist" booleanpersist */
- lua_rawset(L, 3);
- /* num udata mt */
- lua_setmetatable(L, 2);
- /* num udata */
- return 1;
-}
-
-static int LUAF_onerror(lua_State *L)
-{
-
- const char* str = 0;
- if(lua_gettop(L) != 0)
- {
- str = lua_tostring(L, -1);
- printf("%s\n",str);
- }
- return 0;
-}
-
-int main()
-{
- lua_State* L = lua_open();
-
- luaL_openlibs(L);
- lua_settop(L, 0);
-
- lua_register(L, "checkludata", LUAF_checkludata);
- lua_register(L, "unboxinteger", LUAF_unboxinteger);
- lua_register(L, "boxboolean", LUAF_boxboolean);
- lua_register(L, "unboxboolean", LUAF_unboxboolean);
- lua_register(L, "onerror", LUAF_onerror);
-
- lua_pushcfunction(L, LUAF_onerror);
- luaL_loadfile(L, "puptest.lua");
- lua_pcall(L,0,0,1);
-
- lua_close(L);
-
- return 0;
-}
diff --git a/engines/sword25/util/pluto/puptest.lua b/engines/sword25/util/pluto/puptest.lua
deleted file mode 100644
index e5ccdd64bd..0000000000
--- a/engines/sword25/util/pluto/puptest.lua
+++ /dev/null
@@ -1,93 +0,0 @@
--- $Id$
-
-require "pluto"
-
-permtable = { 1234 }
-
-perms = { [1] = coroutine.yield, [2] = permtable }
-
-function testcounter(counter)
- local a = counter.cur()
- counter.inc()
- return counter.cur() == a+1
-end
-
-function testuvinthread(func)
- local success, result = coroutine.resume(func)
- return success and result == 5
-end
-
-
-function test(rootobj)
- local passed = 0
- local total = 0
- local dotest = function(name,cond)
- total = total+1
- if cond then
- print(name, " PASSED")
- passed = passed + 1
- else
- print(name, "* FAILED")
- end
- end
-
-
- dotest("Boolean FALSE ", rootobj.testfalse == false)
- dotest("Boolean TRUE ", rootobj.testtrue == true)
- dotest("Number 7 ", rootobj.testseven == 7)
- dotest("String 'foobar' ", rootobj.testfoobar == "foobar")
- dotest("Func returning 4 ", rootobj.testfuncreturnsfour() == 4)
- dotest("Nil value ", rootobj.testnil == nil)
- dotest("Thread resume ", coroutine.resume(rootobj.testthread) == true,14)
- dotest("Table ", rootobj.testtbl.a == 2 and rootobj.testtbl[2] == 4);
- dotest("Permanent table ", rootobj.testperm == permtable)
- dotest("Table metatable ", rootobj.testmt() == 21)
- dotest("Function env ", rootobj.testfenv() == 456)
- dotest("Lua closure ", rootobj.testclosure() == 11)
- dotest("Nil in closure ", rootobj.testnilclosure() == nil)
- dotest("Nested func ", rootobj.testnest(1) == 6)
- dotest("Light userdata ", checkludata(rootobj.testludata))
- dotest("Looped tables ",
- rootobj.testlooptable.testloopb.testloopa ==
- rootobj.testlooptable)
- dotest("Shared reference ", rootobj.testsharedrefa.sharedref ==
- rootobj.testsharedrefb.sharedref)
- dotest("Identical tables ", rootobj.testsharedrefa ~=
- rootobj.testsharedrefb)
- dotest("Table special persist", rootobj.testsptable.a == 6)
- dotest("Udata literal persist",
- unboxinteger(rootobj.testliteraludata) == 71)
- dotest("Udata special persist",
- unboxboolean(rootobj.testspudata1) == true and
- unboxboolean(rootobj.testspudata2) == false)
- dotest("Shared upvalues ",
- testcounter(rootobj.testsharedupval))
- dotest("Open upvalues ",
- testuvinthread(rootobj.testuvinthread))
- dotest("Upvalue cycles ",
- rootobj.testuvcycle()[1] == rootobj.testuvcycle()[2])
- dotest("__newindex metamethod", rootobj.testniinmt.a == 3)
- dotest("Debug info ", (rootobj.testdebuginfo(2)) == "foo")
- print()
- if passed == total then
- print("All tests passed.")
- else
- print(passed .. "/" .. total .. " tests passed.")
- end
-end
-
-infile, err = io.open("test.plh", "rb")
-if infile == nil then
- error("While opening: " .. (err or "no error"))
-end
-
-buf, err = infile:read("*a")
-if buf == nil then
- error("While reading: " .. (err or "no error"))
-end
-
-infile:close()
-
-rootobj = pluto.unpersist(perms, buf)
-
-test(rootobj)
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 588aad8248..c0ce3fea32 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -606,7 +606,7 @@ TestExitStatus GFXtests::mouseMovements() {
Common::String info = "Testing Automated Mouse movements.\n"
"You should expect cursor hotspot(top-left corner) to automatically move from (0, 0) to (100, 100).\n"
- "There we have a rectangle drawn, finally the cursor would lie centred in that rectangle.";
+ "There we have a rectangle drawn, finally the cursor would lie centered in that rectangle.";
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("Info! Skipping test : Mouse Movements\n");
@@ -637,7 +637,7 @@ TestExitStatus GFXtests::mouseMovements() {
g_system->delayMillis(1500);
CursorMan.showMouse(false);
- if (Testsuite::handleInteractiveInput("Was the cursor centred in the rectangle at (100, 100)?", "Yes", "No", kOptionRight)) {
+ if (Testsuite::handleInteractiveInput("Was the cursor centered in the rectangle at (100, 100)?", "Yes", "No", kOptionRight)) {
return kTestFailed;
}
@@ -654,7 +654,7 @@ TestExitStatus GFXtests::copyRectToScreen() {
Testsuite::clearScreen();
Common::String info = "Testing Blitting a Bitmap to screen.\n"
- "You should expect to see a 20x40 yellow horizontal rectangle centred at the screen.";
+ "You should expect to see a 20x40 yellow horizontal rectangle centered at the screen.";
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("Info! Skipping test : Blitting Bitmap\n");
@@ -1113,7 +1113,7 @@ TestExitStatus GFXtests::pixelFormats() {
Graphics::Surface *screen = g_system->lockScreen();
- // Draw 6 rectangles centred at (50, 160), piled over one another
+ // Draw 6 rectangles centered at (50, 160), piled over one another
// each with color in colors[]
for (int i = 0; i < 6; i++) {
screen->fillRect(Common::Rect::center(160, 20 + i * 10, 100, 10), colors[i]);
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 7a1f9fbf55..1d25723a35 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -108,7 +108,7 @@ struct ACTORINFO {
bool bEscOn;
int escEvent;
- COLORREF textColour; // Text colour
+ COLORREF textColor; // Text color
SCNHANDLE playFilm; // revert to this after talks
SCNHANDLE talkFilm; // this be deleted in the future!
@@ -140,7 +140,7 @@ typedef TAGACTOR *PTAGACTOR;
static ACTORINFO *actorInfo = NULL;
-static COLORREF defaultColour = 0; // Text colour
+static COLORREF defaultColor = 0; // Text color
static bool bActorsOn = false;
@@ -479,13 +479,13 @@ void DropActors() {
for (int i = 0; i < NumActors; i++) {
if (TinselV2) {
- // Save text colour
- COLORREF tColour = actorInfo[i].textColour;
+ // Save text color
+ COLORREF tColor = actorInfo[i].textColor;
memset(&actorInfo[i], 0, sizeof(ACTORINFO));
- // Restor text colour
- actorInfo[i].textColour = tColour;
+ // Restor text color
+ actorInfo[i].textColor = tColor;
// Clear extra arrays
memset(zFactors, 0, NumActors);
@@ -1278,7 +1278,7 @@ void SetMoverZ(PMOVER pMover, int y, int32 zFactor) {
/**
* Stores actor's attributes.
- * Currently only the speech colours.
+ * Currently only the speech colors.
*/
void storeActorAttr(int ano, int r1, int g1, int b1) {
assert((ano > 0 && ano <= NumActors) || ano == -1); // illegal actor number
@@ -1288,36 +1288,36 @@ void storeActorAttr(int ano, int r1, int g1, int b1) {
if (b1 > MAX_INTENSITY) b1 = MAX_INTENSITY; // }
if (ano == -1)
- defaultColour = TINSEL_RGB(r1, g1, b1);
+ defaultColor = TINSEL_RGB(r1, g1, b1);
else
- actorInfo[ano - 1].textColour = TINSEL_RGB(r1, g1, b1);
+ actorInfo[ano - 1].textColor = TINSEL_RGB(r1, g1, b1);
}
/**
- * Called from ActorRGB() - Stores actor's speech colour.
+ * Called from ActorRGB() - Stores actor's speech color.
*/
-void SetActorRGB(int ano, COLORREF colour) {
+void SetActorRGB(int ano, COLORREF color) {
assert(ano >= 0 && ano <= NumActors);
if (ano)
- actorInfo[ano - 1].textColour = TO_LE_32(colour);
+ actorInfo[ano - 1].textColor = TO_LE_32(color);
else
- defaultColour = TO_LE_32(colour);
+ defaultColor = TO_LE_32(color);
}
/**
- * Get the actor's stored speech colour.
+ * Get the actor's stored speech color.
* @param ano Actor Id
*/
COLORREF GetActorRGB(int ano) {
// Not used in JAPAN version
assert((ano >= -1) && (ano <= NumActors)); // illegal actor number
- if ((ano == -1) || !actorInfo[ano - 1].textColour)
- return defaultColour;
+ if ((ano == -1) || !actorInfo[ano - 1].textColor)
+ return defaultColor;
else
- return actorInfo[ano - 1].textColour;
+ return actorInfo[ano - 1].textColor;
}
/**
diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h
index fbad5d9955..2be42b00e6 100644
--- a/engines/tinsel/actors.h
+++ b/engines/tinsel/actors.h
@@ -109,7 +109,7 @@ void ActorEvent(int ano, TINSEL_EVENT event, PLR_EVENT be);
void storeActorAttr(int ano, int r1, int g1, int b1);
COLORREF GetActorRGB(int ano);
-void SetActorRGB(int ano, COLORREF colour);
+void SetActorRGB(int ano, COLORREF color);
void SetActorZfactor(int ano, uint32 zFactor);
uint32 GetActorZfactor(int ano);
diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp
index f895ecd2da..dfff093c09 100644
--- a/engines/tinsel/background.cpp
+++ b/engines/tinsel/background.cpp
@@ -51,8 +51,8 @@ void InitBackground(const BACKGND *pBgnd) {
// set current background
pCurBgnd = pBgnd;
- // init background sky colour
- SetBgndColour(pBgnd->rgbSkyColour);
+ // init background sky color
+ SetBgndColor(pBgnd->rgbSkyColor);
// start of playfield array
pPlayfield = pBgnd->fieldArray;
@@ -127,11 +127,11 @@ void PlayfieldGetPos(int which, int *pXpos, int *pYpos) {
}
/**
- * Returns the x position of the centre of the specified playfield
+ * Returns the x position of the center of the specified playfield
* @param which Which playfield
*/
-int PlayfieldGetCentreX(int which) {
+int PlayfieldGetCenterX(int which) {
PLAYFIELD *pPlayfield; // pointer to relavent playfield
// make sure there is a background
diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h
index d0b27e6e40..06789e50bf 100644
--- a/engines/tinsel/background.h
+++ b/engines/tinsel/background.h
@@ -60,7 +60,7 @@ struct PLAYFIELD {
/** multi-playfield background structure - a backgnd is a container of playfields */
struct BACKGND {
- COLORREF rgbSkyColour; ///< background sky colour
+ COLORREF rgbSkyColor; ///< background sky color
Common::Point ptInitWorld; ///< initial world position
Common::Rect rcScrollLimits; ///< scroll limits
int refreshRate; ///< background update process refresh rate
@@ -93,7 +93,7 @@ void PlayfieldGetPos( // Returns the xy position of the specified playfield in
int *pXpos, // returns current x position
int *pYpos); // returns current y position
-int PlayfieldGetCentreX( // Returns the xy position of the specified playfield in the current background
+int PlayfieldGetCenterX( // Returns the xy position of the specified playfield in the current background
int which); // which playfield
OBJECT *GetPlayfieldList( // Returns the display list for the specified playfield
diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp
index 68653b16f4..747fdfe93c 100644
--- a/engines/tinsel/bg.cpp
+++ b/engines/tinsel/bg.cpp
@@ -158,7 +158,7 @@ static void BGmainProcess(CORO_PARAM, const void *param) {
FadeInFast(NULL);
bDoFadeIn = false;
} else if (TinselV2)
- PokeInTagColour();
+ PokeInTagColor();
for (;;) {
for (int i = 0; i < bgReels; i++) {
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index b5b84ceaee..e3fbad678c 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -81,7 +81,7 @@ namespace Tinsel {
#define BIT0 0x01
#define CD_XSCR 0x04 // Screen has a scroll offset
-#define CD_CMAP 0x08 // Colour map is included
+#define CD_CMAP 0x08 // Color map is included
#define CD_CMND 0x10 // Command is included
#define CD_AUDIO 0x20 // Audio data is included
#define CD_EXTEND 0x40 // Extended modes "A"-"z"
@@ -350,7 +350,7 @@ BMVPlayer::BMVPlayer() {
memset(texts, 0, sizeof(texts));
- talkColour = 0;
+ talkColor = 0;
bigProblemCount = 0;
bIsText = 0;
movieTick = 0;
@@ -382,8 +382,8 @@ void BMVPlayer::MoviePalette(int paletteOffset) {
UpdateDACqueue(1, 255, &moviePal[1]);
// Don't clobber talk
- if (talkColour != 0)
- SetTextPal(talkColour);
+ if (talkColor != 0)
+ SetTextPal(talkColor);
}
void BMVPlayer::InitialiseMovieSound() {
@@ -490,7 +490,7 @@ void BMVPlayer::BmvDrawText(bool bDraw) {
|-------------------------------------------------------|
\*-----------------------------------------------------*/
-void BMVPlayer::MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, COLORREF *pTalkColour, int duration) {
+void BMVPlayer::MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, COLORREF *pTalkColor, int duration) {
SCNHANDLE hFont;
int index;
@@ -502,8 +502,8 @@ void BMVPlayer::MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, CO
} else {
// It's a 'talk'
- if (pTalkColour != NULL)
- SetTextPal(*pTalkColour);
+ if (pTalkColor != NULL)
+ SetTextPal(*pTalkColor);
hFont = GetTalkFontHandle();
index = 1;
}
@@ -519,7 +519,7 @@ void BMVPlayer::MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, CO
0,
x, y,
hFont,
- TXT_CENTRE, 0);
+ TXT_CENTER, 0);
KeepOnScreen(texts[index].pText, &x, &y);
}
@@ -541,13 +541,13 @@ int BMVPlayer::MovieCommand(char cmd, int commandOffset) {
} else {
if (_vm->_config->_useSubtitles) {
TALK_CMD *pCmd = (TALK_CMD *)(bigBuffer + commandOffset);
- talkColour = TINSEL_RGB(pCmd->r, pCmd->g, pCmd->b);
+ talkColor = TINSEL_RGB(pCmd->r, pCmd->g, pCmd->b);
MovieText(nullContext, (int16)READ_LE_UINT16(&pCmd->stringId),
(int16)READ_LE_UINT16(&pCmd->x),
(int16)READ_LE_UINT16(&pCmd->y),
0,
- &talkColour,
+ &talkColor,
pCmd->duration);
}
return sz_CMD_TALK_pkt;
@@ -693,7 +693,7 @@ void BMVPlayer::InitialiseBMV() {
bFileEnd = false;
blobsInBuffer = 0;
memset(texts, 0, sizeof(texts));
- talkColour = 0;
+ talkColor = 0;
bigProblemCount = 0;
movieTick = 0;
diff --git a/engines/tinsel/bmv.h b/engines/tinsel/bmv.h
index 99a43e0740..d90d68fc13 100644
--- a/engines/tinsel/bmv.h
+++ b/engines/tinsel/bmv.h
@@ -96,7 +96,7 @@ class BMVPlayer {
int dieFrame;
} texts[2];
- COLORREF talkColour;
+ COLORREF talkColor;
int bigProblemCount;
@@ -143,7 +143,7 @@ private:
void MovieAudio(int audioOffset, int blobs);
void FettleMovieText();
void BmvDrawText(bool bDraw);
- void MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, COLORREF *pTalkColour, int duration);
+ void MovieText(CORO_PARAM, int stringId, int x, int y, int fontId, COLORREF *pTalkColor, int duration);
int MovieCommand(char cmd, int commandOffset);
int FollowingPacket(int thisPacket, bool bReallyImportant);
void LoadSlots(int number);
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 73cad7a68f..ee9c9aed39 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -259,7 +259,7 @@ enum PARTS_INDEX {
#define MD_XLBUTR (TinselV2 ? 26 : 10)
#define MD_XRBUTL (TinselV2 ? 173 : 105)
#define MD_XRBUTR (TinselV2 ? 195 : 114)
-#define ROTX1 60 // Rotate button's offsets from the centre
+#define ROTX1 60 // Rotate button's offsets from the center
// Number of objects that makes up an empty window
#define MAX_WCOMP 21 // 4 corners + (3+3) sides + (2+2) extra sides
@@ -449,7 +449,7 @@ static bool bMoveOnUnHide; // Set before start of conversation
//----- Data pertinant to configure (incl. load/save game) -----
-#define COL_MAINBOX TBLUE1 // Base blue colour
+#define COL_MAINBOX TBLUE1 // Base blue color
#define COL_BOX TBLUE1
#define COL_HILIGHT TBLUE4
@@ -1639,7 +1639,7 @@ static void Select(int i, bool force) {
switch (cd.box[i].boxType) {
case RGROUP:
iconArray[HL2] = RectangleObject(BgPal(),
- (TinselV2 ? HighlightColour() : COL_HILIGHT), cd.box[i].w, cd.box[i].h);
+ (TinselV2 ? HighlightColor() : COL_HILIGHT), cd.box[i].w, cd.box[i].h);
MultiInsertObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL2]);
MultiSetAniXY(iconArray[HL2],
InvD[ino].inventoryX + cd.box[i].xpos,
@@ -2239,7 +2239,7 @@ static int WhichMenuBox(int curX, int curY, bool bSlides) {
/***/
/**************************************************************************/
-#define ROTX1 60 // Rotate button's offsets from the centre
+#define ROTX1 60 // Rotate button's offsets from the center
/**
* InvBoxes
@@ -2277,7 +2277,7 @@ static void InvBoxes(bool InBody, int curX, int curY) {
cd.box[cd.pointBox].boxType == AATBUT ||
cd.box[cd.pointBox].boxType == AABUT) {
iconArray[HL1] = RectangleObject(BgPal(),
- (TinselV2 ? HighlightColour() : COL_HILIGHT),
+ (TinselV2 ? HighlightColor() : COL_HILIGHT),
cd.box[cd.pointBox].w, cd.box[cd.pointBox].h);
MultiInsertObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL1]);
MultiSetAniXY(iconArray[HL1],
@@ -2638,14 +2638,14 @@ static void AddBackground(OBJECT **rect, OBJECT **title, int extraH, int extraV,
LoadStringRes(InvD[ino].hInvTitle, TextBufferAddr(), TBUFSZ);
*title = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0,
InvD[ino].inventoryX + width/2, InvD[ino].inventoryY + M_TOFF,
- GetTagFontHandle(), TXT_CENTRE);
+ GetTagFontHandle(), TXT_CENTER);
assert(*title); // Inventory title string produced NULL text
MultiSetZPosition(*title, Z_INV_HTEXT);
} else if (textFrom == FROM_STRING && cd.ixHeading != NO_HEADING) {
LoadStringRes(configStrings[cd.ixHeading], TextBufferAddr(), TBUFSZ);
*title = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0,
InvD[ino].inventoryX + width/2, InvD[ino].inventoryY + M_TOFF,
- GetTagFontHandle(), TXT_CENTRE);
+ GetTagFontHandle(), TXT_CENTER);
assert(*title); // Inventory title string produced NULL text
MultiSetZPosition(*title, Z_INV_HTEXT);
}
@@ -2669,7 +2669,7 @@ static void AddTitle(POBJECT *title, int extraH) {
LoadStringRes(InvD[ino].hInvTitle, TextBufferAddr(), TBUFSZ);
*title = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0,
InvD[ino].inventoryX + (width/2)+NM_BG_POS_X, InvD[ino].inventoryY + NM_TOFF,
- GetTagFontHandle(), TXT_CENTRE, 0);
+ GetTagFontHandle(), TXT_CENTER, 0);
assert(*title);
MultiSetZPosition(*title, Z_INV_HTEXT);
}
@@ -2736,7 +2736,7 @@ static void AddBox(int *pi, const int i) {
break;
// Give us a box
- iconArray[*pi] = RectangleObject(BgPal(), TinselV2 ? BoxColour() : COL_BOX,
+ iconArray[*pi] = RectangleObject(BgPal(), TinselV2 ? BoxColor() : COL_BOX,
cd.box[i].w, cd.box[i].h);
MultiInsertObject(GetPlayfieldList(FIELD_STATUS), iconArray[*pi]);
MultiSetAniXY(iconArray[*pi], x, y);
@@ -2758,9 +2758,9 @@ static void AddBox(int *pi, const int i) {
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), cd.box[i].boxText, 0,
#ifdef JAPAN
// Note: it never seems to go here!
- x + cd.box[i].w/2, y+2, GetTagFontHandle(), TXT_CENTRE);
+ x + cd.box[i].w/2, y+2, GetTagFontHandle(), TXT_CENTER);
#else
- x + cd.box[i].w / 2, y + TYOFF, GetTagFontHandle(), TXT_CENTRE);
+ x + cd.box[i].w / 2, y + TYOFF, GetTagFontHandle(), TXT_CENTER);
#endif
}
@@ -2787,9 +2787,9 @@ static void AddBox(int *pi, const int i) {
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0,
#ifdef JAPAN
- x + cd.box[i].w/2, y+2, GetTagFontHandle(), TXT_CENTRE);
+ x + cd.box[i].w/2, y+2, GetTagFontHandle(), TXT_CENTER);
#else
- x + cd.box[i].w / 2, y + TYOFF, GetTagFontHandle(), TXT_CENTRE);
+ x + cd.box[i].w / 2, y + TYOFF, GetTagFontHandle(), TXT_CENTER);
#endif
MultiSetZPosition(iconArray[*pi], Z_INV_ITEXT);
*pi += 1;
@@ -2870,7 +2870,7 @@ static void AddBox(int *pi, const int i) {
if (cd.box[i].boxType == TOGGLE2) {
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, x + cd.box[i].w / 2, y + TOG2_YOFF,
- GetTagFontHandle(), TXT_CENTRE, 0);
+ GetTagFontHandle(), TXT_CENTER, 0);
} else {
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, x + MDTEXT_XOFF, y + MDTEXT_YOFF,
@@ -2934,7 +2934,7 @@ static void AddBox(int *pi, const int i) {
LoadStringRes(SysString(cd.box[i].ixText), TextBufferAddr(), TBUFSZ);
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, x + cd.box[i].w / 2, y + TOG2_YOFF,
- GetTagFontHandle(), TXT_CENTRE, 0);
+ GetTagFontHandle(), TXT_CENTER, 0);
MultiSetZPosition(iconArray[*pi], Z_INV_ITEXT);
*pi += 1;
}
@@ -2945,7 +2945,7 @@ static void AddBox(int *pi, const int i) {
LoadStringRes(LanguageDesc(displayedLanguage), TextBufferAddr(), TBUFSZ);
iconArray[*pi] = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0,
- x + cd.box[i].w / 2, y + ROT_YOFF, GetTagFontHandle(), TXT_CENTRE, 0);
+ x + cd.box[i].w / 2, y + ROT_YOFF, GetTagFontHandle(), TXT_CENTER, 0);
MultiSetZPosition(iconArray[*pi], Z_INV_ITEXT);
*pi += 1;
@@ -3683,15 +3683,15 @@ extern void HideConversation(bool bHide) {
/*
* First time, position it appropriately
*/
- int left, centre;
+ int left, center;
int x, y, deltay;
// Only do it once per conversation
bMoveOnUnHide = false;
- // Current centre of the window
+ // Current center of the window
left = MultiLeftmost(RectObject);
- centre = (MultiRightmost(RectObject) + left) / 2;
+ center = (MultiRightmost(RectObject) + left) / 2;
// Get the x-offset for the conversation window
if (thisConvActor) {
@@ -3731,12 +3731,12 @@ extern void HideConversation(bool bHide) {
// Move it all
for (i = 0; objArray[i] && i < MAX_WCOMP; i++) {
- MultiMoveRelXY(objArray[i], x - centre, deltay);
+ MultiMoveRelXY(objArray[i], x - center, deltay);
}
for (i = 0; iconArray[i] && i < MAX_ICONS; i++) {
- MultiMoveRelXY(iconArray[i], x - centre, deltay);
+ MultiMoveRelXY(iconArray[i], x - center, deltay);
}
- InvD[INV_CONV].inventoryX += x - centre;
+ InvD[INV_CONV].inventoryX += x - center;
/*
* Now positioned as worked out
diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp
index a82285b12f..99a8b9ff14 100644
--- a/engines/tinsel/faders.cpp
+++ b/engines/tinsel/faders.cpp
@@ -37,7 +37,7 @@ namespace Tinsel {
/** structure used by the "FadeProcess" process */
struct FADE {
- const long *pColourMultTable; // list of fixed point colour multipliers - terminated with negative entry
+ const long *pColorMultTable; // list of fixed point color multipliers - terminated with negative entry
PALQ *pPalQ; // palette queue entry to fade
};
@@ -46,42 +46,42 @@ struct FADE {
//const long fadein[] = {0, 0x1000, 0x3000, 0x5000, 0x7000, 0x9000, 0xb000, 0xd000, 0x10000L, -1};
/**
- * Scale 'colour' by the fixed point colour multiplier 'colourMult'
- * @param colour Colour to scale
- * @param colourMult Fixed point multiplier
+ * Scale 'color' by the fixed point color multiplier 'colorMult'
+ * @param color Color to scale
+ * @param colorMult Fixed point multiplier
*/
-static COLORREF ScaleColour(COLORREF colour, uint32 colourMult) {
+static COLORREF ScaleColor(COLORREF color, uint32 colorMult) {
// apply multiplier to RGB components
- uint32 red = ((TINSEL_GetRValue(colour) * colourMult) << 8) >> 24;
- uint32 green = ((TINSEL_GetGValue(colour) * colourMult) << 8) >> 24;
- uint32 blue = ((TINSEL_GetBValue(colour) * colourMult) << 8) >> 24;
+ uint32 red = ((TINSEL_GetRValue(color) * colorMult) << 8) >> 24;
+ uint32 green = ((TINSEL_GetGValue(color) * colorMult) << 8) >> 24;
+ uint32 blue = ((TINSEL_GetBValue(color) * colorMult) << 8) >> 24;
- // return new colour
+ // return new color
return TINSEL_RGB(red, green, blue);
}
/**
- * Applies the fixed point multiplier 'mult' to all colours in
- * 'pOrig' to produce 'pNew'. Each colour in the palette will be
+ * Applies the fixed point multiplier 'mult' to all colors in
+ * 'pOrig' to produce 'pNew'. Each color in the palette will be
* multiplied by 'mult'.
* @param pNew Pointer to new palette
* @param pOrig Pointer to original palette
- * @param numColours Number of colours in the above palettes
+ * @param numColors Number of colors in the above palettes
* @param mult Fixed point multiplier
*/
-static void FadePalette(COLORREF *pNew, COLORREF *pOrig, int numColours, uint32 mult) {
- for (int i = 0; i < numColours; i++, pNew++, pOrig++) {
+static void FadePalette(COLORREF *pNew, COLORREF *pOrig, int numColors, uint32 mult) {
+ for (int i = 0; i < numColors; i++, pNew++, pOrig++) {
if (!TinselV2)
// apply multiplier to RGB components
- *pNew = ScaleColour(*pOrig, mult);
- else if (i == (TalkColour() - 1)) {
- *pNew = GetTalkColourRef();
- *pNew = ScaleColour(*pNew, mult);
- } else if (SysVar(SV_TAGCOLOUR) && i == (SysVar(SV_TAGCOLOUR) - 1)) {
+ *pNew = ScaleColor(*pOrig, mult);
+ else if (i == (TalkColor() - 1)) {
+ *pNew = GetTalkColorRef();
+ *pNew = ScaleColor(*pNew, mult);
+ } else if (SysVar(SV_TAGCOLOR) && i == (SysVar(SV_TAGCOLOR) - 1)) {
*pNew = GetTagColorRef();
- *pNew = ScaleColour(*pNew, mult);
+ *pNew = ScaleColor(*pNew, mult);
} else {
- *pNew = ScaleColour(*pOrig, mult);
+ *pNew = ScaleColor(*pOrig, mult);
}
}
}
@@ -94,8 +94,8 @@ static void FadePalette(COLORREF *pNew, COLORREF *pOrig, int numColours, uint32
static void FadeProcess(CORO_PARAM, const void *param) {
// COROUTINE
CORO_BEGIN_CONTEXT;
- COLORREF fadeRGB[MAX_COLOURS]; // local copy of palette
- const long *pColMult; // pointer to colour multiplier table
+ COLORREF fadeRGB[MAX_COLORS]; // local copy of palette
+ const long *pColMult; // pointer to color multiplier table
PALETTE *pPalette; // pointer to palette
CORO_END_CONTEXT(_ctx);
@@ -111,19 +111,19 @@ static void FadeProcess(CORO_PARAM, const void *param) {
// get pointer to palette - reduce pointer indirection a bit
_ctx->pPalette = (PALETTE *)LockMem(pFade->pPalQ->hPal);
- for (_ctx->pColMult = pFade->pColourMultTable; *_ctx->pColMult >= 0; _ctx->pColMult++) {
+ for (_ctx->pColMult = pFade->pColorMultTable; *_ctx->pColMult >= 0; _ctx->pColMult++) {
// go through all multipliers in table - until a negative entry
// fade palette using next multiplier
if (TinselV2)
FadePalette(_ctx->fadeRGB, pFade->pPalQ->palRGB,
- pFade->pPalQ->numColours, (uint32) *_ctx->pColMult);
+ pFade->pPalQ->numColors, (uint32) *_ctx->pColMult);
else
FadePalette(_ctx->fadeRGB, _ctx->pPalette->palRGB,
- FROM_LE_32(_ctx->pPalette->numColours), (uint32) *_ctx->pColMult);
+ FROM_LE_32(_ctx->pPalette->numColors), (uint32) *_ctx->pColMult);
// send new palette to video DAC
- UpdateDACqueue(pFade->pPalQ->posInDAC, FROM_LE_32(_ctx->pPalette->numColours), _ctx->fadeRGB);
+ UpdateDACqueue(pFade->pPalQ->posInDAC, FROM_LE_32(_ctx->pPalette->numColors), _ctx->fadeRGB);
// allow time for video DAC to be updated
CORO_SLEEP(1);
@@ -139,7 +139,7 @@ static void FadeProcess(CORO_PARAM, const void *param) {
/**
* Generic palette fader/unfader. Creates a 'FadeProcess' process
* for each palette that is to fade.
- * @param multTable Fixed point colour multiplier table
+ * @param multTable Fixed point color multiplier table
* @param noFadeTable List of palettes not to fade
*/
static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {
@@ -175,7 +175,7 @@ static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {
FADE fade;
// fill in FADE struct
- fade.pColourMultTable = multTable;
+ fade.pColorMultTable = multTable;
fade.pPalQ = pPal;
// create a fader process for this palette
@@ -210,7 +210,7 @@ void FadeOutFast(SCNHANDLE noFadeTable[]) {
}
/**
- * Fades a list of palettes from black to their current colours.
+ * Fades a list of palettes from black to their current colors.
* 'noFadeTable' is a NULL terminated list of palettes not to fade.
*/
void FadeInMedium(SCNHANDLE noFadeTable[]) {
@@ -223,7 +223,7 @@ void FadeInMedium(SCNHANDLE noFadeTable[]) {
}
/**
- * Fades a list of palettes from black to their current colours.
+ * Fades a list of palettes from black to their current colors.
* @param noFadeTable A NULL terminated list of palettes not to fade.
*/
void FadeInFast(SCNHANDLE noFadeTable[]) {
@@ -234,10 +234,10 @@ void FadeInFast(SCNHANDLE noFadeTable[]) {
Fader(fadein, noFadeTable);
}
-void PokeInTagColour() {
- if (SysVar(SV_TAGCOLOUR)) {
+void PokeInTagColor() {
+ if (SysVar(SV_TAGCOLOR)) {
const COLORREF c = GetActorRGB(-1);
- UpdateDACqueue(SysVar(SV_TAGCOLOUR), c);
+ UpdateDACqueue(SysVar(SV_TAGCOLOR), c);
}
}
diff --git a/engines/tinsel/faders.h b/engines/tinsel/faders.h
index e77bff2661..b30a26d893 100644
--- a/engines/tinsel/faders.h
+++ b/engines/tinsel/faders.h
@@ -50,7 +50,7 @@ void FadeOutMedium(SCNHANDLE noFadeTable[]);
void FadeOutFast(SCNHANDLE noFadeTable[]);
void FadeInMedium(SCNHANDLE noFadeTable[]);
void FadeInFast(SCNHANDLE noFadeTable[]);
-void PokeInTagColour();
+void PokeInTagColor();
} // End of namespace Tinsel
diff --git a/engines/tinsel/font.cpp b/engines/tinsel/font.cpp
index 4c76d12400..f57a6d5d54 100644
--- a/engines/tinsel/font.cpp
+++ b/engines/tinsel/font.cpp
@@ -118,10 +118,10 @@ void FettleFontPal(SCNHANDLE fontPal) {
else
pImg->hImgPal = 0;
- if (TinselV2 && SysVar(SV_TAGCOLOUR)) {
+ if (TinselV2 && SysVar(SV_TAGCOLOR)) {
const COLORREF c = GetActorRGB(-1);
SetTagColorRef(c);
- UpdateDACqueue(SysVar(SV_TAGCOLOUR), c);
+ UpdateDACqueue(SysVar(SV_TAGCOLOR), c);
}
}
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index aefc6e6144..0b550f50f3 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -41,7 +41,7 @@ namespace Tinsel {
#define CHAR_WIDTH 4
#define CHAR_HEIGHT 4
-extern uint8 transPalette[MAX_COLOURS];
+extern uint8 transPalette[MAX_COLORS];
//----------------- SUPPORT FUNCTIONS ---------------------
@@ -175,14 +175,14 @@ static void t0WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
x += clipAmount;
if (repeatFlag) {
- // Repeat of a given colour
- uint8 colour = (numBytes >> 8) & 0xff;
+ // Repeat of a given color
+ uint8 color = (numBytes >> 8) & 0xff;
int runLength = (numBytes & 0xff) - clipAmount;
int rptLength = MAX(MIN(runLength, pObj->width - rightClip - x), 0);
if (yClip == 0) {
- if (colour != 0)
- memset(tempDest, colour, rptLength);
+ if (color != 0)
+ memset(tempDest, color, rptLength);
tempDest += rptLength;
}
@@ -470,18 +470,18 @@ static void t2WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
x+= clipAmount;
int runLength = numBytes - clipAmount;
- uint8 colour = *srcP++;
+ uint8 color = *srcP++;
- if ((yClip == 0) && (runLength > 0) && (colour != 0)) {
+ if ((yClip == 0) && (runLength > 0) && (color != 0)) {
runLength = MIN(runLength, pObj->width - rightClip - x);
if (runLength > 0) {
// Non-transparent run length
- colour += pObj->constant;
+ color += pObj->constant;
if (horizFlipped)
- Common::set_to(tempP - runLength + 1, tempP + 1, colour);
+ Common::set_to(tempP - runLength + 1, tempP + 1, color);
else
- Common::set_to(tempP, tempP + runLength, colour);
+ Common::set_to(tempP, tempP + runLength, color);
}
}
@@ -521,7 +521,7 @@ static void t2WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
}
/**
- * Fill the destination area with a constant colour
+ * Fill the destination area with a constant color
*/
static void WrtConst(DRAWOBJECT *pObj, uint8 *destP, bool applyClipping) {
if (applyClipping) {
@@ -595,11 +595,11 @@ static void WrtAll(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool applyClippi
*/
static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
bool applyClipping, bool horizFlipped, int packingType) {
- uint8 numColours = 0;
- uint8 *colourTable = NULL;
+ uint8 numColors = 0;
+ uint8 *colorTable = NULL;
int topClip = 0;
int xOffset = 0;
- int numBytes, colour;
+ int numBytes, color;
int v;
if (_vm->getLanguage() == Common::RU_RUS) {
@@ -625,10 +625,10 @@ static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
}
if (packingType == 3) {
- // Variable colours
- numColours = *srcP++;
- colourTable = srcP;
- srcP += numColours;
+ // Variable colors
+ numColors = *srcP++;
+ colorTable = srcP;
+ srcP += numColors;
}
for (int y = 0; y < pObj->height; ++y) {
@@ -646,7 +646,7 @@ static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
int x = 0;
while (x < pObj->width) {
- // Get next run size and colour to use
+ // Get next run size and color to use
for (;;) {
if (xOffset > 0) {
x += xOffset;
@@ -663,9 +663,9 @@ static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
v = *srcP++;
numBytes = v & 0xf; // No. bytes 1-15
if (packingType == 3)
- colour = colourTable[v >> 4];
+ color = colorTable[v >> 4];
else
- colour = pObj->baseCol + (v >> 4);
+ color = pObj->baseCol + (v >> 4);
if (numBytes != 0)
break;
@@ -693,7 +693,7 @@ static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
while (numBytes-- > 0) {
if ((topClip == 0) && (x < (pObj->width - rightClip))) {
- *tempP = colour;
+ *tempP = color;
if (horizFlipped) --tempP; else ++tempP;
}
++x;
@@ -830,7 +830,7 @@ void DrawObject(DRAWOBJECT *pObj) {
int packType = pObj->flags >> 14;
if (packType == 0) {
- // No colour packing
+ // No color packing
switch (typeId) {
case 0x01:
case 0x11:
@@ -865,7 +865,7 @@ void DrawObject(DRAWOBJECT *pObj) {
} else {
// 1 = 16 from 240
// 2 = 16 from 224
- // 3 = variable colour
+ // 3 = variable color
if (packType == 1) pObj->baseCol = 0xF0;
else if (packType == 2) pObj->baseCol = 0xE0;
diff --git a/engines/tinsel/graphics.h b/engines/tinsel/graphics.h
index 8b8bb6488d..de16082441 100644
--- a/engines/tinsel/graphics.h
+++ b/engines/tinsel/graphics.h
@@ -43,7 +43,7 @@ struct DRAWOBJECT {
int transOffset; // transparent character offset
int flags; // object flags - see above for list
PALQ *pPal; // objects palette Q position
- int constant; // which colour in palette for monochrome objects
+ int constant; // which color in palette for monochrome objects
int width; // width of object
int height; // height of object
SCNHANDLE hBits; // image bitmap handle
diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp
index 5b9e650689..5fc555f9b0 100644
--- a/engines/tinsel/move.cpp
+++ b/engines/tinsel/move.cpp
@@ -584,7 +584,7 @@ static void SetMoverUltDest(PMOVER pActor, int x, int y) {
* If in a neighbouring path to the final destination, if the target path
* is a follow nodes path, head for the end node, otherwise head straight
* for the target.
- * Otherwise, head towards the pseudo-centre or end node of the first
+ * Otherwise, head towards the pseudo-center or end node of the first
* en-route path.
*/
static void SetMoverIntDest(PMOVER pMover, int x, int y) {
@@ -636,7 +636,7 @@ static void SetMoverIntDest(PMOVER pMover, int x, int y) {
} else if (hIpath != NOPOLY) {
/* Head for an en-route path */
if (PolySubtype(hIpath) != NODE) {
- /* En-route path is normal - head for pseudo centre. */
+ /* En-route path is normal - head for pseudo center. */
if (CanGetThere(pMover, x, y) == GT_OK) {
pMover->ItargetX = x;
pMover->ItargetY = y;
@@ -644,8 +644,8 @@ static void SetMoverIntDest(PMOVER pMover, int x, int y) {
// make damn sure that Itarget is in hIpath
pMover->hIpath = InPolygon(x, y, PATH);
} else {
- pMover->ItargetX = PolyCentreX(hIpath);
- pMover->ItargetY = PolyCentreY(hIpath);
+ pMover->ItargetX = PolyCenterX(hIpath);
+ pMover->ItargetY = PolyCenterY(hIpath);
if (TinselV2)
// make damn sure that Itarget is in hIpath
pMover->hIpath = InPolygon(pMover->ItargetX, pMover->ItargetY, PATH);
@@ -943,12 +943,12 @@ static void SetNextDest(PMOVER pMover) {
assert(hPath == pMover->hIpath);
if (pMover->InDifficulty == NO_PROB) {
- x = PolyCentreX(hPath);
- y = PolyCentreY(hPath);
+ x = PolyCenterX(hPath);
+ y = PolyCenterY(hPath);
SetMoverDest(pMover, x, y);
- pMover->InDifficulty = TRY_CENTRE;
+ pMover->InDifficulty = TRY_CENTER;
pMover->over = false;
- } else if (pMover->InDifficulty == TRY_CENTRE) {
+ } else if (pMover->InDifficulty == TRY_CENTER) {
NearestCorner(&x, &y, pMover->hCpath, pMover->hIpath);
SetMoverDest(pMover, x, y);
pMover->InDifficulty = TRY_CORNER;
@@ -986,7 +986,7 @@ static void SetNextDest(PMOVER pMover) {
!IsAdjacentPath(pMover->hCpath, pMover->hIpath)) {
/*----------------------------------------------------------
If just entering a follow nodes polygon, go to first node.|
- Else if just going to pass through, go to pseudo-centre. |
+ Else if just going to pass through, go to pseudo-center. |
----------------------------------------------------------*/
if (PolySubtype(hPath) == NODE && pMover->hFnpath != hPath && pMover->npstatus != LEAVING) {
int node = NearestEndNode(hPath, x, y);
@@ -995,7 +995,7 @@ static void SetNextDest(PMOVER pMover) {
pMover->over = true;
} else if (!IsInPolygon(pMover->ItargetX, pMover->ItargetY, hPath) &&
!IsInPolygon(pMover->ItargetX, pMover->ItargetY, pMover->hCpath)) {
- SetMoverDest(pMover, PolyCentreX(hPath), PolyCentreY(hPath));
+ SetMoverDest(pMover, PolyCenterX(hPath), PolyCenterY(hPath));
pMover->over = true;
} else {
SetMoverDest(pMover, pMover->ItargetX, pMover->ItargetY);
@@ -1258,8 +1258,8 @@ static void SetOffWithinNodePath(PMOVER pMover, HPOLYGON StartPath, HPOLYGON Des
endnode = NearestEndNode(StartPath, targetX, targetY);
} else {
if (PolySubtype(hIpath) != NODE) {
- x = PolyCentreX(hIpath);
- y = PolyCentreY(hIpath);
+ x = PolyCenterX(hIpath);
+ y = PolyCenterY(hIpath);
endnode = NearestEndNode(StartPath, x, y);
} else {
endnode = NearEndNode(StartPath, hIpath);
@@ -1278,7 +1278,7 @@ static void SetOffWithinNodePath(PMOVER pMover, HPOLYGON StartPath, HPOLYGON Des
{
// could go for its end node if it's an NPATH
// but we probably will when we hit it anyway!
- SetMoverDest(pMover, PolyCentreX(hIpath), PolyCentreY(hIpath));
+ SetMoverDest(pMover, PolyCenterX(hIpath), PolyCenterY(hIpath));
}
}
} else
@@ -1500,7 +1500,7 @@ static void EnteringNewPath(PMOVER pMover, HPOLYGON hPath, int x, int y) {
assert(hIpath != NOPOLY); // No path on the way
if (PolySubtype(hIpath) != NODE) {
- lastnode = NearestEndNode(hPath, PolyCentreX(hIpath), PolyCentreY(hIpath));
+ lastnode = NearestEndNode(hPath, PolyCenterX(hIpath), PolyCenterY(hIpath));
} else {
lastnode = NearEndNode(hPath, hIpath);
}
diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp
index bf31cdfa25..1aac68c7f0 100644
--- a/engines/tinsel/object.cpp
+++ b/engines/tinsel/object.cpp
@@ -482,11 +482,11 @@ void AnimateObject(OBJECT *pAniObj, SCNHANDLE hNewImg) {
* Creates a rectangle object of the given dimensions and returns
* a pointer to the object.
* @param hPal Palette for the rectangle object
- * @param colour Which colour offset from the above palette
+ * @param color Which color offset from the above palette
* @param width Width of rectangle
* @param height Height of rectangle
*/
-OBJECT *RectangleObject(SCNHANDLE hPal, int colour, int width, int height) {
+OBJECT *RectangleObject(SCNHANDLE hPal, int color, int width, int height) {
// template for initialising the rectangle object
static const OBJ_INIT rectObj = {0, DMA_CONST, OID_EFFECTS, 0, 0, 0};
PALQ *pPalQ; // palette queue pointer
@@ -503,8 +503,8 @@ OBJECT *RectangleObject(SCNHANDLE hPal, int colour, int width, int height) {
// assign palette to object
pRect->pPal = pPalQ;
- // set colour in the palette
- pRect->constant = colour;
+ // set color in the palette
+ pRect->constant = color;
// set rectangle width
pRect->width = width;
diff --git a/engines/tinsel/object.h b/engines/tinsel/object.h
index a000dee72c..9f10c06cd2 100644
--- a/engines/tinsel/object.h
+++ b/engines/tinsel/object.h
@@ -87,7 +87,7 @@ struct OBJECT {
Common::Rect rcPrev; ///< previous screen coordinates of object bounding rectangle
int flags; ///< object flags - see above for list
PALQ *pPal; ///< objects palette Q position
- int constant; ///< which colour in palette for monochrome objects
+ int constant; ///< which color in palette for monochrome objects
int width; ///< width of object
int height; ///< height of object
SCNHANDLE hBits; ///< image bitmap handle
@@ -184,7 +184,7 @@ void HideObject( // Hides a object by giving it a "NullImage" image pointer
OBJECT *RectangleObject( // create a rectangle object of the given dimensions
SCNHANDLE hPal, // palette for the rectangle object
- int colour, // which colour offset from the above palette
+ int color, // which color offset from the above palette
int width, // width of rectangle
int height); // height of rectangle
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index a0ceec54eb..2d2ebd6f60 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -41,12 +41,12 @@ namespace Tinsel {
struct VIDEO_DAC_Q {
union {
SCNHANDLE hRGBarray; ///< handle of palette or
- COLORREF *pRGBarray; ///< list of palette colours
+ COLORREF *pRGBarray; ///< list of palette colors
COLORREF singleRGB;
} pal;
bool bHandle; ///< when set - use handle of palette
int destDACindex; ///< start index of palette in video DAC
- int numColours; ///< number of colours in "hRGBarray"
+ int numColors; ///< number of colors in "hRGBarray"
};
@@ -67,13 +67,13 @@ static VIDEO_DAC_Q vidDACdata[VDACQLENGTH];
/** video DAC transfer Q head pointer */
static VIDEO_DAC_Q *pDAChead;
-/** colour index of the 4 colours used for the translucent palette */
+/** color index of the 4 colors used for the translucent palette */
#define COL_HILIGHT TBLUE1
/** the translucent palette lookup table */
-uint8 transPalette[MAX_COLOURS]; // used in graphics.cpp
+uint8 transPalette[MAX_COLORS]; // used in graphics.cpp
-uint8 ghostPalette[MAX_COLOURS];
+uint8 ghostPalette[MAX_COLORS];
static int translucentIndex = 228;
@@ -111,7 +111,7 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
}
// Check for correspondent color
- for (uint i = 0; (i < FROM_LE_32(pal->numColours)) && !colorFound; i++) {
+ for (uint i = 0; (i < FROM_LE_32(pal->numColors)) && !colorFound; i++) {
// get R G B values in the same way as psx format converters
uint16 psxEquivalent = TINSEL_PSX_RGB(TINSEL_GetRValue(pal->palRGB[i]) >> 3, TINSEL_GetGValue(pal->palRGB[i]) >> 3, TINSEL_GetBValue(pal->palRGB[i]) >> 3);
@@ -138,15 +138,15 @@ void PalettesToVideoDAC() {
// while Q is not empty
while (pDAChead != pDACtail) {
const PALETTE *pPalette; // pointer to hardware palette
- const COLORREF *pColours; // pointer to list of RGB triples
+ const COLORREF *pColors; // pointer to list of RGB triples
#ifdef DEBUG
// make sure palette does not overlap
- assert(pDACtail->destDACindex + pDACtail->numColours <= MAX_COLOURS);
+ assert(pDACtail->destDACindex + pDACtail->numColors <= MAX_COLORS);
#else
// make sure palette does not overlap
- if (pDACtail->destDACindex + pDACtail->numColours > MAX_COLOURS)
- pDACtail->numColours = MAX_COLOURS - pDACtail->destDACindex;
+ if (pDACtail->destDACindex + pDACtail->numColors > MAX_COLORS)
+ pDACtail->numColors = MAX_COLORS - pDACtail->destDACindex;
#endif
if (pDACtail->bHandle) {
@@ -156,23 +156,23 @@ void PalettesToVideoDAC() {
pPalette = (const PALETTE *)LockMem(pDACtail->pal.hRGBarray);
// get RGB pointer
- pColours = pPalette->palRGB;
- } else if (pDACtail->numColours == 1) {
+ pColors = pPalette->palRGB;
+ } else if (pDACtail->numColors == 1) {
// we are using a single color palette
- pColours = &pDACtail->pal.singleRGB;
+ pColors = &pDACtail->pal.singleRGB;
} else {
// we are using a palette pointer
- pColours = pDACtail->pal.pRGBarray;
+ pColors = pDACtail->pal.pRGBarray;
}
- for (int i = 0; i < pDACtail->numColours; ++i) {
- pal[i * 3 + 0] = TINSEL_GetRValue(pColours[i]);
- pal[i * 3 + 1] = TINSEL_GetGValue(pColours[i]);
- pal[i * 3 + 2] = TINSEL_GetBValue(pColours[i]);
+ for (int i = 0; i < pDACtail->numColors; ++i) {
+ pal[i * 3 + 0] = TINSEL_GetRValue(pColors[i]);
+ pal[i * 3 + 1] = TINSEL_GetGValue(pColors[i]);
+ pal[i * 3 + 2] = TINSEL_GetBValue(pColors[i]);
}
// update the system palette
- g_system->getPaletteManager()->setPalette(pal, pDACtail->destDACindex, pDACtail->numColours);
+ g_system->getPaletteManager()->setPalette(pal, pDACtail->destDACindex, pDACtail->numColors);
// update tail pointer
pDACtail++;
@@ -216,15 +216,15 @@ void PaletteStats() {
/**
* Places a palette in the video DAC queue.
* @param posInDAC Position in video DAC
- * @param numColours Number of colours in palette
+ * @param numColors Number of colors in palette
* @param hPalette Handle to palette
*/
-void UpdateDACqueueHandle(int posInDAC, int numColours, SCNHANDLE hPalette) {
+void UpdateDACqueueHandle(int posInDAC, int numColors, SCNHANDLE hPalette) {
// check Q overflow
assert(pDAChead < vidDACdata + VDACQLENGTH);
pDAChead->destDACindex = posInDAC & ~PALETTE_MOVED; // set index in video DAC
- pDAChead->numColours = numColours; // set number of colours
+ pDAChead->numColors = numColors; // set number of colors
pDAChead->pal.hRGBarray = hPalette; // set handle of palette
pDAChead->bHandle = true; // we are using a palette handle
@@ -240,19 +240,19 @@ void UpdateDACqueueHandle(int posInDAC, int numColours, SCNHANDLE hPalette) {
/**
* Places a palette in the video DAC queue.
* @param posInDAC Position in video DAC
- * @param numColours Number of colours in palette
- * @param pColours List of RGB triples
+ * @param numColors Number of colors in palette
+ * @param pColors List of RGB triples
*/
-void UpdateDACqueue(int posInDAC, int numColours, COLORREF *pColours) {
+void UpdateDACqueue(int posInDAC, int numColors, COLORREF *pColors) {
// check Q overflow
assert(pDAChead < vidDACdata + NUM_PALETTES);
pDAChead->destDACindex = posInDAC & ~PALETTE_MOVED; // set index in video DAC
- pDAChead->numColours = numColours; // set number of colours
- if (numColours == 1)
- pDAChead->pal.singleRGB = *pColours; // set single color of which the "palette" consists
+ pDAChead->numColors = numColors; // set number of colors
+ if (numColors == 1)
+ pDAChead->pal.singleRGB = *pColors; // set single color of which the "palette" consists
else
- pDAChead->pal.pRGBarray = pColours; // set addr of palette
+ pDAChead->pal.pRGBarray = pColors; // set addr of palette
pDAChead->bHandle = false; // we are not using a palette handle
// update head pointer
@@ -275,7 +275,7 @@ void UpdateDACqueue(int posInDAC, COLORREF color) {
assert(pDAChead < vidDACdata + NUM_PALETTES);
pDAChead->destDACindex = posInDAC & ~PALETTE_MOVED; // set index in video DAC
- pDAChead->numColours = 1; // set number of colours
+ pDAChead->numColors = 1; // set number of colors
pDAChead->pal.singleRGB = color; // set single color of which the "palette" consists
pDAChead->bHandle = false; // we are not using a palette handle
@@ -294,7 +294,7 @@ void UpdateDACqueue(int posInDAC, COLORREF color) {
*/
PALQ *AllocPalette(SCNHANDLE hNewPal) {
PALQ *pPrev, *p; // walks palAllocData
- int iDAC; // colour index in video DAC
+ int iDAC; // color index in video DAC
PALQ *pNxtPal; // next PALQ struct in palette allocator
PALETTE *pNewPal;
@@ -311,7 +311,7 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) {
}
// search all structs in palette allocator - find a free slot
- iDAC = FGND_DAC_INDEX; // init DAC index to first available foreground colour
+ iDAC = FGND_DAC_INDEX; // init DAC index to first available foreground color
for (p = palAllocData; p < palAllocData + NUM_PALETTES; p++) {
if (p->hPal == 0) {
@@ -319,11 +319,11 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) {
p->objCount = 1; // init number of objects using palette
p->posInDAC = iDAC; // set palettes start pos in video DAC
p->hPal = hNewPal; // set hardware palette data
- p->numColours = FROM_LE_32(pNewPal->numColours); // set number of colours in palette
+ p->numColors = FROM_LE_32(pNewPal->numColors); // set number of colors in palette
if (TinselV2)
- // Copy all the colours
- memcpy(p->palRGB, pNewPal->palRGB, p->numColours * sizeof(COLORREF));
+ // Copy all the colors
+ memcpy(p->palRGB, pNewPal->palRGB, p->numColors * sizeof(COLORREF));
#ifdef DEBUG
// one more palette in use
@@ -333,30 +333,30 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) {
// Q the change to the video DAC
if (TinselV2)
- UpdateDACqueue(p->posInDAC, p->numColours, p->palRGB);
+ UpdateDACqueue(p->posInDAC, p->numColors, p->palRGB);
else
- UpdateDACqueueHandle(p->posInDAC, p->numColours, p->hPal);
+ UpdateDACqueueHandle(p->posInDAC, p->numColors, p->hPal);
// move all palettes after this one down (if necessary)
for (pPrev = p, pNxtPal = pPrev + 1; pNxtPal < palAllocData + NUM_PALETTES; pNxtPal++) {
if (pNxtPal->hPal != 0) {
// palette slot is in use
- if (pNxtPal->posInDAC >= pPrev->posInDAC + pPrev->numColours)
+ if (pNxtPal->posInDAC >= pPrev->posInDAC + pPrev->numColors)
// no need to move palettes down
break;
// move palette down - indicate change
pNxtPal->posInDAC = (pPrev->posInDAC
- + pPrev->numColours) | PALETTE_MOVED;
+ + pPrev->numColors) | PALETTE_MOVED;
// Q the palette change in position to the video DAC
if (!TinselV2)
UpdateDACqueueHandle(pNxtPal->posInDAC,
- pNxtPal->numColours,
+ pNxtPal->numColors,
pNxtPal->hPal);
else if (!pNxtPal->bFading)
UpdateDACqueue(pNxtPal->posInDAC,
- pNxtPal->numColours,
+ pNxtPal->numColors,
pNxtPal->palRGB);
// update previous palette to current palette
@@ -369,7 +369,7 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) {
}
// set new DAC index
- iDAC = p->posInDAC + p->numColours;
+ iDAC = p->posInDAC + p->numColors;
}
// no free palettes
@@ -431,43 +431,43 @@ void SwapPalette(PALQ *pPalQ, SCNHANDLE hNewPal) {
// validate palette Q pointer
assert(pPalQ >= palAllocData && pPalQ <= palAllocData + NUM_PALETTES - 1);
- if (pPalQ->numColours >= (int)FROM_LE_32(pNewPal->numColours)) {
+ if (pPalQ->numColors >= (int)FROM_LE_32(pNewPal->numColors)) {
// new palette will fit the slot
// install new palette
pPalQ->hPal = hNewPal;
if (TinselV2) {
- pPalQ->numColours = FROM_LE_32(pNewPal->numColours);
+ pPalQ->numColors = FROM_LE_32(pNewPal->numColors);
- // Copy all the colours
- memcpy(pPalQ->palRGB, pNewPal->palRGB, FROM_LE_32(pNewPal->numColours) * sizeof(COLORREF));
+ // Copy all the colors
+ memcpy(pPalQ->palRGB, pNewPal->palRGB, FROM_LE_32(pNewPal->numColors) * sizeof(COLORREF));
if (!pPalQ->bFading)
// Q the change to the video DAC
- UpdateDACqueue(pPalQ->posInDAC, FROM_LE_32(pNewPal->numColours), pPalQ->palRGB);
+ UpdateDACqueue(pPalQ->posInDAC, FROM_LE_32(pNewPal->numColors), pPalQ->palRGB);
} else {
// Q the change to the video DAC
- UpdateDACqueueHandle(pPalQ->posInDAC, FROM_LE_32(pNewPal->numColours), hNewPal);
+ UpdateDACqueueHandle(pPalQ->posInDAC, FROM_LE_32(pNewPal->numColors), hNewPal);
}
} else {
- // # colours are different - will have to update all following palette entries
+ // # colors are different - will have to update all following palette entries
assert(!TinselV2); // Fatal error for Tinsel 2
PALQ *pNxtPalQ; // next palette queue position
for (pNxtPalQ = pPalQ + 1; pNxtPalQ < palAllocData + NUM_PALETTES; pNxtPalQ++) {
- if (pNxtPalQ->posInDAC >= pPalQ->posInDAC + pPalQ->numColours)
+ if (pNxtPalQ->posInDAC >= pPalQ->posInDAC + pPalQ->numColors)
// no need to move palettes down
break;
// move palette down
pNxtPalQ->posInDAC = (pPalQ->posInDAC
- + pPalQ->numColours) | PALETTE_MOVED;
+ + pPalQ->numColors) | PALETTE_MOVED;
// Q the palette change in position to the video DAC
UpdateDACqueueHandle(pNxtPalQ->posInDAC,
- pNxtPalQ->numColours,
+ pNxtPalQ->numColors,
pNxtPalQ->hPal);
// update previous palette to current palette
@@ -501,12 +501,12 @@ PALQ *GetNextPalette(PALQ *pStrtPal) {
}
/**
- * Sets the current background colour.
- * @param colour Colour to set the background to
+ * Sets the current background color.
+ * @param color Color to set the background to
*/
-void SetBgndColour(COLORREF colour) {
- // update background colour struct by queuing the change to the video DAC
- UpdateDACqueue(BGND_DAC_INDEX, colour);
+void SetBgndColor(COLORREF color) {
+ // update background color struct by queuing the change to the video DAC
+ UpdateDACqueue(BGND_DAC_INDEX, color);
}
/**
@@ -544,23 +544,23 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {
// get a pointer to the palette
PALETTE *pPal = (PALETTE *)LockMem(hPalette);
- // leave background colour alone
+ // leave background color alone
transPalette[0] = 0;
- for (uint i = 0; i < FROM_LE_32(pPal->numColours); i++) {
- // get the RGB colour model values
+ for (uint i = 0; i < FROM_LE_32(pPal->numColors); i++) {
+ // get the RGB color model values
uint8 red = TINSEL_GetRValue(pPal->palRGB[i]);
uint8 green = TINSEL_GetGValue(pPal->palRGB[i]);
uint8 blue = TINSEL_GetBValue(pPal->palRGB[i]);
- // calculate the Value field of the HSV colour model
+ // calculate the Value field of the HSV color model
unsigned val = (red > green) ? red : green;
val = (val > blue) ? val : blue;
- // map the Value field to one of the 4 colours reserved for the translucent palette
+ // map the Value field to one of the 4 colors reserved for the translucent palette
val /= 63;
transPalette[i + 1] = (uint8)((val == 0) ? 0 : val +
- (TinselV2 ? TranslucentColour() : COL_HILIGHT) - 1);
+ (TinselV2 ? TranslucentColor() : COL_HILIGHT) - 1);
}
}
@@ -572,20 +572,20 @@ void CreateGhostPalette(SCNHANDLE hPalette) {
PALETTE *pPal = (PALETTE *)LockMem(hPalette);
int i;
- // leave background colour alone
+ // leave background color alone
ghostPalette[0] = 0;
- for (i = 0; i < (int)FROM_LE_32(pPal->numColours); i++) {
- // get the RGB colour model values
+ for (i = 0; i < (int)FROM_LE_32(pPal->numColors); i++) {
+ // get the RGB color model values
uint8 red = TINSEL_GetRValue(pPal->palRGB[i]);
uint8 green = TINSEL_GetGValue(pPal->palRGB[i]);
uint8 blue = TINSEL_GetBValue(pPal->palRGB[i]);
- // calculate the Value field of the HSV colour model
+ // calculate the Value field of the HSV color model
unsigned val = (red > green) ? red : green;
val = (val > blue) ? val : blue;
- // map the Value field to one of the 4 colours reserved for the translucent palette
+ // map the Value field to one of the 4 colors reserved for the translucent palette
val /= 64;
assert(/*val >= 0 &&*/ val <= 3);
ghostPalette[i + 1] = (uint8)(val + SysVar(ISV_GHOST_BASE));
@@ -594,25 +594,25 @@ void CreateGhostPalette(SCNHANDLE hPalette) {
/**
- * Returns an adjusted colour RGB
- * @param colour Colour to scale
+ * Returns an adjusted color RGB
+ * @param color Color to scale
*/
-static COLORREF DimColour(COLORREF colour, int factor) {
+static COLORREF DimColor(COLORREF color, int factor) {
uint32 red, green, blue;
if (factor == 10) {
// No change
- return colour;
+ return color;
} else if (factor == 0) {
// No brightness
return 0;
} else {
// apply multiplier to RGB components
- red = TINSEL_GetRValue(colour) * factor / 10;
- green = TINSEL_GetGValue(colour) * factor / 10;
- blue = TINSEL_GetBValue(colour) * factor / 10;
+ red = TINSEL_GetRValue(color) * factor / 10;
+ green = TINSEL_GetGValue(color) * factor / 10;
+ blue = TINSEL_GetBValue(color) * factor / 10;
- // return new colour
+ // return new color
return TINSEL_RGB(red, green, blue);
}
}
@@ -620,10 +620,10 @@ static COLORREF DimColour(COLORREF colour, int factor) {
/**
* DimPartPalette
*/
-void DimPartPalette(SCNHANDLE hDimPal, int startColour, int length, int brightness) {
+void DimPartPalette(SCNHANDLE hDimPal, int startColor, int length, int brightness) {
PALQ *pPalQ;
PALETTE *pDimPal;
- int iColour;
+ int iColor;
pPalQ = FindPalette(hDimPal);
assert(pPalQ);
@@ -631,42 +631,42 @@ void DimPartPalette(SCNHANDLE hDimPal, int startColour, int length, int brightne
// get pointer to dim palette
pDimPal = (PALETTE *)LockMem(hDimPal);
- // Adjust for the fact that palettes don't contain colour 0
- startColour -= 1;
+ // Adjust for the fact that palettes don't contain color 0
+ startColor -= 1;
// Check some other things
- if (startColour + length > pPalQ->numColours)
- error("DimPartPalette(): colour overrun");
+ if (startColor + length > pPalQ->numColors)
+ error("DimPartPalette(): color overrun");
- for (iColour = startColour; iColour < startColour + length; iColour++) {
- pPalQ->palRGB[iColour] = DimColour(pDimPal->palRGB[iColour], brightness);
+ for (iColor = startColor; iColor < startColor + length; iColor++) {
+ pPalQ->palRGB[iColor] = DimColor(pDimPal->palRGB[iColor], brightness);
}
if (!pPalQ->bFading) {
// Q the change to the video DAC
- UpdateDACqueue(pPalQ->posInDAC + startColour, length, &pPalQ->palRGB[startColour]);
+ UpdateDACqueue(pPalQ->posInDAC + startColor, length, &pPalQ->palRGB[startColor]);
}
}
-int TranslucentColour() {
+int TranslucentColor() {
return translucentIndex;
}
-int HighlightColour() {
+int HighlightColor() {
UpdateDACqueue(talkIndex, (COLORREF)SysVar(SYS_HighlightRGB));
return talkIndex;
}
-int TalkColour() {
+int TalkColor() {
return TinselV2 ? talkIndex : TALKFONT_COL;
}
-void SetTalkColourRef(COLORREF colRef) {
+void SetTalkColorRef(COLORREF colRef) {
talkColRef = colRef;
}
-COLORREF GetTalkColourRef() {
+COLORREF GetTalkColorRef() {
return talkColRef;
}
diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h
index 9743ee53aa..694eff504d 100644
--- a/engines/tinsel/palette.h
+++ b/engines/tinsel/palette.h
@@ -42,14 +42,14 @@ typedef uint32 COLORREF;
#define TINSEL_PSX_RGB(r,g,b) ((uint16)(((uint8)(r))|((uint16)(g)<<5)|(((uint16)(b))<<10)))
enum {
- MAX_COLOURS = 256, ///< maximum number of colours - for VGA 256
+ MAX_COLORS = 256, ///< maximum number of colors - for VGA 256
BITS_PER_PIXEL = 8, ///< number of bits per pixel for VGA 256
MAX_INTENSITY = 255, ///< the biggest value R, G or B can have
NUM_PALETTES = 32, ///< number of palettes
// Discworld has some fixed apportioned bits in the palette.
- BGND_DAC_INDEX = 0, ///< index of background colour in Video DAC
- FGND_DAC_INDEX = 1, ///< index of first foreground colour in Video DAC
+ BGND_DAC_INDEX = 0, ///< index of background color in Video DAC
+ FGND_DAC_INDEX = 1, ///< index of first foreground color in Video DAC
TBLUE1 = 228, ///< Blue used in translucent rectangles
TBLUE2 = 229, ///< Blue used in translucent rectangles
TBLUE3 = 230, ///< Blue used in translucent rectangles
@@ -57,7 +57,7 @@ enum {
TALKFONT_COL = 233
};
-// some common colours
+// some common colors
#define BLACK (TINSEL_RGB(0, 0, 0))
#define WHITE (TINSEL_RGB(MAX_INTENSITY, MAX_INTENSITY, MAX_INTENSITY))
@@ -73,8 +73,8 @@ enum {
/** hardware palette structure */
struct PALETTE {
- int32 numColours; ///< number of colours in the palette
- COLORREF palRGB[MAX_COLOURS]; ///< actual palette colours
+ int32 numColors; ///< number of colors in the palette
+ COLORREF palRGB[MAX_COLORS]; ///< actual palette colors
} PACKED_STRUCT;
#include "common/pack-end.h" // END STRUCT PACKING
@@ -85,10 +85,10 @@ struct PALQ {
SCNHANDLE hPal; ///< handle to palette data struct
int objCount; ///< number of objects using this palette
int posInDAC; ///< palette position in the video DAC
- int numColours; ///< number of colours in the palette
+ int numColors; ///< number of colors in the palette
// Discworld 2 fields
bool bFading; // Whether or not fading
- COLORREF palRGB[MAX_COLOURS]; // actual palette colours
+ COLORREF palRGB[MAX_COLORS]; // actual palette colors
};
#define PALETTE_MOVED 0x8000 // when this bit is set in the "posInDAC"
@@ -114,13 +114,13 @@ void PalettesToVideoDAC(); // Update the video DAC with palettes currently the t
void UpdateDACqueueHandle(
int posInDAC, // position in video DAC
- int numColours, // number of colours in palette
+ int numColors, // number of colors in palette
SCNHANDLE hPalette); // handle to palette
void UpdateDACqueue( // places a palette in the video DAC queue
int posInDAC, // position in video DAC
- int numColours, // number of colours in palette
- COLORREF *pColours); // list of RGB tripples
+ int numColors, // number of colors in palette
+ COLORREF *pColors); // list of RGB tripples
void UpdateDACqueue(int posInDAC, COLORREF color);
@@ -140,10 +140,10 @@ void SwapPalette( // swaps palettes at the specified palette queue position
PALQ *GetNextPalette( // returns the next palette in the queue
PALQ *pStrtPal); // queue position to start from - when NULL will start from beginning of queue
-COLORREF GetBgndColour(); // returns current background colour
+COLORREF GetBgndColor(); // returns current background color
-void SetBgndColour( // sets current background colour
- COLORREF colour); // colour to set the background to
+void SetBgndColor( // sets current background color
+ COLORREF color); // color to set the background to
void FadingPalette(PALQ *pPalQ, bool bFading);
@@ -155,22 +155,22 @@ void NoFadingPalettes(); // All fading processes have just been killed
void DimPartPalette(
SCNHANDLE hPal,
- int startColour,
+ int startColor,
int length,
int brightness); // 0 = black, 10 == 100%
-int TranslucentColour();
+int TranslucentColor();
-#define BoxColour TranslucentColour
+#define BoxColor TranslucentColor
-int HighlightColour();
+int HighlightColor();
-int TalkColour();
+int TalkColor();
-void SetTalkColourRef(COLORREF colRef);
+void SetTalkColorRef(COLORREF colRef);
-COLORREF GetTalkColourRef();
+COLORREF GetTalkColorRef();
void SetTagColorRef(COLORREF colRef);
diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index 38748b703b..33eee8bc98 100644
--- a/engines/tinsel/pdisplay.cpp
+++ b/engines/tinsel/pdisplay.cpp
@@ -59,8 +59,8 @@ extern int newestString; // The overrun counter, in STRRES.C
#define LPOSX 295 // X-co-ord of lead actor's position display
#define CPOSX 24 // X-co-ord of cursor's position display
-#define OPOSX SCRN_CENTRE_X // X-co-ord of overrun counter's display
-#define SPOSX SCRN_CENTRE_X // X-co-ord of string numbner's display
+#define OPOSX SCRN_CENTER_X // X-co-ord of overrun counter's display
+#define SPOSX SCRN_CENTER_X // X-co-ord of string numbner's display
#define POSY 0 // Y-co-ord of these position displays
@@ -158,7 +158,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
// New text objects
sprintf(PositionString, "%d %d", aniX + Loffset, aniY + Toffset);
_ctx->cpText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), PositionString,
- 0, CPOSX, POSY, GetTagFontHandle(), TXT_CENTRE);
+ 0, CPOSX, POSY, GetTagFontHandle(), TXT_CENTER);
if (DispPath) {
HPOLYGON hp = InPolygon(aniX + Loffset, aniY + Toffset, PATH);
if (hp == NOPOLY)
@@ -190,7 +190,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
sprintf(PositionString, "%d", Overrun);
_ctx->opText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), PositionString,
- 0, OPOSX, POSY, GetTagFontHandle(), TXT_CENTRE);
+ 0, OPOSX, POSY, GetTagFontHandle(), TXT_CENTER);
// update previous value
_ctx->prevOver = Overrun;
@@ -216,7 +216,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
// create new text object list
sprintf(PositionString, "%d %d", aniX, aniY);
_ctx->rpText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), PositionString,
- 0, LPOSX, POSY, GetTagFontHandle(), TXT_CENTRE);
+ 0, LPOSX, POSY, GetTagFontHandle(), TXT_CENTER);
// update previous position
_ctx->prevlX = aniX;
@@ -235,7 +235,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
sprintf(PositionString, "String: %d", newestString);
_ctx->spText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), PositionString,
- 0, SPOSX, POSY+10, GetTalkFontHandle(), TXT_CENTRE);
+ 0, SPOSX, POSY+10, GetTalkFontHandle(), TXT_CENTER);
// update previous value
_ctx->prevString = newestString;
@@ -411,7 +411,7 @@ static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) {
// May have buggered cursor
EndCursorFollowed();
*ppText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), tagBuffer,
- 0, tagX, tagY, GetTagFontHandle(), TXT_CENTRE, 0);
+ 0, tagX, tagY, GetTagFontHandle(), TXT_CENTER, 0);
assert(*ppText);
MultiSetZPosition(*ppText, Z_TAG_TEXT);
} else
@@ -456,7 +456,7 @@ static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) {
PlayfieldGetPos(FIELD_WORLD, &tagX, &tagY);
LoadStringRes(GetActorTag(ano), TextBufferAddr(), TBUFSZ);
*ppText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
- 0, xtext - tagX, ytext - tagY, GetTagFontHandle(), TXT_CENTRE);
+ 0, xtext - tagX, ytext - tagY, GetTagFontHandle(), TXT_CENTER);
assert(*ppText); // Actor tag string produced NULL text
MultiSetZPosition(*ppText, Z_TAG_TEXT);
} else {
@@ -561,7 +561,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
*ppText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, tagx - Loffset, tagy - Toffset,
- GetTagFontHandle(), TXT_CENTRE, 0);
+ GetTagFontHandle(), TXT_CENTER, 0);
} else if (TinselV2) {
// Bugger cursor
const char *tagPtr = TextBufferAddr();
@@ -570,12 +570,12 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
GetCursorXYNoWait(&curX, &curY, false);
*ppText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
- 0, curX, curY, GetTagFontHandle(), TXT_CENTRE, 0);
+ 0, curX, curY, GetTagFontHandle(), TXT_CENTER, 0);
} else {
// Handle displaying the tag text on-screen
*ppText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
0, tagx - Loffset, tagy - Toffset,
- GetTagFontHandle(), TXT_CENTRE);
+ GetTagFontHandle(), TXT_CENTER);
assert(*ppText); // Polygon tag string produced NULL text
}
diff --git a/engines/tinsel/pid.h b/engines/tinsel/pid.h
index 786ccc6327..d6f87bdf98 100644
--- a/engines/tinsel/pid.h
+++ b/engines/tinsel/pid.h
@@ -32,11 +32,11 @@ namespace Tinsel {
#define PID_DESTROY 0x8000 // process id of any process that is to be destroyed between scenes
#define PID_EFFECTS (0x0010 | PID_DESTROY) // generic special effects process id
-#define PID_FLASH (PID_EFFECTS + 1) // flash colour process
-#define PID_CYCLE (PID_EFFECTS + 2) // cycle colour range process
+#define PID_FLASH (PID_EFFECTS + 1) // flash color process
+#define PID_CYCLE (PID_EFFECTS + 2) // cycle color range process
#define PID_MORPH (PID_EFFECTS + 3) // morph process
#define PID_FADER (PID_EFFECTS + 4) // fader process
-#define PID_FADE_BGND (PID_EFFECTS + 5) // fade background colour process
+#define PID_FADE_BGND (PID_EFFECTS + 5) // fade background color process
#define PID_BACKGND (0x0020 | PID_DESTROY) // background update process id
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index 1620881b01..0811dae079 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -98,10 +98,10 @@ struct POLYGON {
/*
* Internal derived data for speed and conveniance
- * set up by PseudoCentre()
+ * set up by PseudoCenter()
*/
- int pcentrex; // Pseudo-centre
- int pcentrey; //
+ int pcenterx; // Pseudo-center
+ int pcentery; //
/**
* List of adjacent polygons. For Path polygons only.
@@ -1624,34 +1624,34 @@ static PPOLYGON CommonInits(PTYPE polyType, int pno, const Poly &ptp, bool bRest
}
/**
- * Calculate a point approximating to the centre of a polygon.
+ * Calculate a point approximating to the center of a polygon.
* Not very sophisticated.
*/
-static void PseudoCentre(POLYGON *p) {
- p->pcentrex = (p->cx[0] + p->cx[1] + p->cx[2] + p->cx[3])/4;
- p->pcentrey = (p->cy[0] + p->cy[1] + p->cy[2] + p->cy[3])/4;
+static void PseudoCenter(POLYGON *p) {
+ p->pcenterx = (p->cx[0] + p->cx[1] + p->cx[2] + p->cx[3])/4;
+ p->pcentery = (p->cy[0] + p->cy[1] + p->cy[2] + p->cy[3])/4;
- if (!IsInPolygon(p->pcentrex, p->pcentrey, PolygonIndex(p))) {
+ if (!IsInPolygon(p->pcenterx, p->pcentery, PolygonIndex(p))) {
int i, top = 0, bot = 0;
for (i = p->ptop; i <= p->pbottom; i++) {
- if (IsInPolygon(p->pcentrex, i, PolygonIndex(p))) {
+ if (IsInPolygon(p->pcenterx, i, PolygonIndex(p))) {
top = i;
break;
}
}
for (i = p->pbottom; i >= p->ptop; i--) {
- if (IsInPolygon(p->pcentrex, i, PolygonIndex(p))) {
+ if (IsInPolygon(p->pcenterx, i, PolygonIndex(p))) {
bot = i;
break;
}
}
- p->pcentrex = (top+bot)/2;
+ p->pcenterx = (top+bot)/2;
}
#ifdef DEBUG
- // assert(IsInPolygon(p->pcentrex, p->pcentrey, PolygonIndex(p))); // Pseudo-centre is not in path
- if (!IsInPolygon(p->pcentrex, p->pcentrey, PolygonIndex(p))) {
- sprintf(TextBufferAddr(), "Pseudo-centre is not in path (starting (%d, %d)) - polygon reversed?",
+ // assert(IsInPolygon(p->pcenterx, p->pcentery, PolygonIndex(p))); // Pseudo-center is not in path
+ if (!IsInPolygon(p->pcenterx, p->pcentery, PolygonIndex(p))) {
+ sprintf(TextBufferAddr(), "Pseudo-center is not in path (starting (%d, %d)) - polygon reversed?",
p->cx[0], p->cy[0]);
error(TextBufferAddr());
}
@@ -1673,7 +1673,7 @@ static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) {
p->subtype = NodePath ? NODE : NORMAL;
- PseudoCentre(p);
+ PseudoCenter(p);
}
@@ -1918,16 +1918,16 @@ int PolySubtype(HPOLYGON hp) {
return Polys[hp]->subtype;
}
-int PolyCentreX(HPOLYGON hp) {
+int PolyCenterX(HPOLYGON hp) {
CHECK_HP(hp, "Out of range polygon handle (27)");
- return Polys[hp]->pcentrex;
+ return Polys[hp]->pcenterx;
}
-int PolyCentreY(HPOLYGON hp) {
+int PolyCenterY(HPOLYGON hp) {
CHECK_HP(hp, "Out of range polygon handle (28)");
- return Polys[hp]->pcentrey;
+ return Polys[hp]->pcentery;
}
int PolyCornerX(HPOLYGON hp, int n) {
diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h
index 4be1dabf98..cf8f9e98c2 100644
--- a/engines/tinsel/polygons.h
+++ b/engines/tinsel/polygons.h
@@ -127,8 +127,8 @@ void RestorePolygonStuff(POLY_VOLATILE *sps);
PTYPE PolyType(HPOLYGON hp); // ->type
int PolySubtype(HPOLYGON hp); // ->subtype
-int PolyCentreX(HPOLYGON hp); // ->pcentrex
-int PolyCentreY(HPOLYGON hp); // ->pcentrey
+int PolyCenterX(HPOLYGON hp); // ->pcenterx
+int PolyCenterY(HPOLYGON hp); // ->pcentery
int PolyCornerX(HPOLYGON hp, int n); // ->cx[n]
int PolyCornerY(HPOLYGON hp, int n); // ->cy[n]
PSTATE PolyPointState(HPOLYGON hp); // ->pointState
diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp
index 6ea1dd7464..c0878b6849 100644
--- a/engines/tinsel/rince.cpp
+++ b/engines/tinsel/rince.cpp
@@ -60,8 +60,8 @@ static MOVER Movers[MAX_MOVERS]; // FIXME: Avoid non-const global vars
/**
* Called from ActorPalette(), normally once just after the beginning of time.
*/
-void StoreMoverPalette(PMOVER pMover, int startColour, int length) {
- pMover->startColour = startColour;
+void StoreMoverPalette(PMOVER pMover, int startColor, int length) {
+ pMover->startColor = startColor;
pMover->paletteLength = length;
}
@@ -88,7 +88,7 @@ static void CheckBrightness(PMOVER pMover) {
pMover->brightness--; // ramp down
DimPartPalette(BgPal(),
- pMover->startColour,
+ pMover->startColor,
pMover->paletteLength,
pMover->brightness);
}
@@ -107,7 +107,7 @@ void MoverBrightness(PMOVER pMover, int brightness) {
assert(BgPal());
// Do it all immediately
- DimPartPalette(BgPal(), pMover->startColour, pMover->paletteLength, brightness);
+ DimPartPalette(BgPal(), pMover->startColor, pMover->paletteLength, brightness);
// The actor is probably hidden at this point,
pMover->brightness = brightness;
@@ -924,7 +924,7 @@ void SaveMovers(SAVED_MOVER *sMoverInfo) {
if (TinselV2) {
sMoverInfo[i].bHidden = Movers[i].bHidden;
sMoverInfo[i].brightness = Movers[i].brightness;
- sMoverInfo[i].startColour = Movers[i].startColour;
+ sMoverInfo[i].startColor = Movers[i].startColor;
sMoverInfo[i].paletteLength = Movers[i].paletteLength;
}
diff --git a/engines/tinsel/rince.h b/engines/tinsel/rince.h
index 57eac00fa4..5d09a1e945 100644
--- a/engines/tinsel/rince.h
+++ b/engines/tinsel/rince.h
@@ -38,7 +38,7 @@ struct PROCESS;
enum NPS {NOT_IN, GOING_UP, GOING_DOWN, LEAVING, ENTERING};
-enum IND {NO_PROB, TRY_CENTRE, TRY_CORNER, TRY_NEXTCORNER};
+enum IND {NO_PROB, TRY_CENTER, TRY_CORNER, TRY_NEXTCORNER};
enum DIRECTION { LEFTREEL, RIGHTREEL, FORWARD, AWAY };
@@ -119,7 +119,7 @@ struct MOVER {
int32 zOverride;
bool bHidden;
int brightness; // Current brightness
- int startColour;
+ int startColor;
int paletteLength;
HPOLYGON hRpath; // Recent path
};
@@ -140,7 +140,7 @@ void MoverProcessCreate(int X, int Y, int id, PMOVER pMover);
enum AR_FUNCTION { AR_NORMAL, AR_PUSHREEL, AR_POPREEL, AR_WALKREEL };
-void StoreMoverPalette(PMOVER pMover, int startColour, int length);
+void StoreMoverPalette(PMOVER pMover, int startColor, int length);
void MoverBrightness(PMOVER pMover, int brightness);
@@ -204,7 +204,7 @@ struct SAVED_MOVER {
bool bActive;
bool bHidden;
int brightness;
- int startColour;
+ int startColor;
int paletteLength;
};
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 3182593a88..7a6b5877e8 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -183,7 +183,7 @@ static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) {
s.syncAsByte(sm.bHidden);
s.syncAsSint32LE(sm.brightness);
- s.syncAsSint32LE(sm.startColour);
+ s.syncAsSint32LE(sm.startColor);
s.syncAsSint32LE(sm.paletteLength);
}
}
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index a3fe393b79..ef0f5cdc25 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -226,7 +226,7 @@ static void SortMAProcess(CORO_PARAM, const void *) {
}
ActorPalette(rsd->SavedMoverInfo[_ctx->i].actorID,
- rsd->SavedMoverInfo[_ctx->i].startColour, rsd->SavedMoverInfo[_ctx->i].paletteLength);
+ rsd->SavedMoverInfo[_ctx->i].startColor, rsd->SavedMoverInfo[_ctx->i].paletteLength);
if (rsd->SavedMoverInfo[_ctx->i].brightness != BOGUS_BRIGHTNESS)
ActorBrightness(rsd->SavedMoverInfo[_ctx->i].actorID, rsd->SavedMoverInfo[_ctx->i].brightness);
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index 67e0ea9ffd..80f4c585a7 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -381,7 +381,7 @@ void PrimeBackground() {
// structure for background
static const BACKGND backgnd = {
- BLACK, // sky colour
+ BLACK, // sky color
Common::Point(0, 0), // initial world pos
Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), // scroll limits
0, // no background update process
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index 3fef59edef..304223ed61 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -356,8 +356,8 @@ bool SoundManager::offscreenChecks(int x, int &y) {
if (x == -1)
return true;
- // convert x to offset from screen centre
- x -= PlayfieldGetCentreX(FIELD_WORLD);
+ // convert x to offset from screen center
+ x -= PlayfieldGetCenterX(FIELD_WORLD);
if (x < -SCREEN_WIDTH || x > SCREEN_WIDTH) {
// A long way offscreen, ignore it
@@ -377,7 +377,7 @@ int8 SoundManager::getPan(int x) {
if (x == -1)
return 0;
- x -= PlayfieldGetCentreX(FIELD_WORLD);
+ x -= PlayfieldGetCenterX(FIELD_WORLD);
if (x == 0)
return 0;
diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp
index 7003d34feb..ed4c99a560 100644
--- a/engines/tinsel/sysvar.cpp
+++ b/engines/tinsel/sysvar.cpp
@@ -77,7 +77,7 @@ static int systemVars[SV_TOPVALID] = {
2, // Speech Delay
2, // Music dim factor
- 0, // if set, default actor's text colour gets poked in here
+ 0, // if set, default actor's text color gets poked in here
0, // user 1
0, // user 2
@@ -103,7 +103,7 @@ static int systemVars[SV_TOPVALID] = {
0, // ISV_GHOST_ACTOR
0, // ISV_GHOST_BASE
- 0 // ISV_GHOST_COLOUR
+ 0 // ISV_GHOST_COLOR
};
static SCNHANDLE systemStrings[SS_MAX_VALID]; // FIXME: Avoid non-const global vars
diff --git a/engines/tinsel/sysvar.h b/engines/tinsel/sysvar.h
index e407e6ffa3..4cdb1364b4 100644
--- a/engines/tinsel/sysvar.h
+++ b/engines/tinsel/sysvar.h
@@ -60,7 +60,7 @@ typedef enum { SV_DEFAULT_INV,
SV_SPEECHDELAY, // Delay 'twixt text/animation and sample
SV_MUSICDIMFACTOR, // dimVolume = volume - volume/SV_MDF
- SV_TAGCOLOUR, // if set, default actor's text colour gets poked in here
+ SV_TAGCOLOR, // if set, default actor's text color gets poked in here
SV_USER1,
SV_USER2,
@@ -85,7 +85,7 @@ typedef enum { SV_DEFAULT_INV,
ISV_NO_BLOCKING,
ISV_GHOST_ACTOR,
ISV_GHOST_BASE,
- ISV_GHOST_COLOUR,
+ ISV_GHOST_COLOR,
SV_TOPVALID } SYSVARS;
diff --git a/engines/tinsel/text.cpp b/engines/tinsel/text.cpp
index d2939281eb..3652d6ed3e 100644
--- a/engines/tinsel/text.cpp
+++ b/engines/tinsel/text.cpp
@@ -78,8 +78,8 @@ int StringLengthPix(char *szStr, const FONT *pFont) {
* @param mode Mode flags for the string
*/
int JustifyText(char *szStr, int xPos, const FONT *pFont, int mode) {
- if (mode & TXT_CENTRE) {
- // centre justify the text
+ if (mode & TXT_CENTER) {
+ // center justify the text
// adjust x positioning by half the length of line in pixels
xPos -= StringLengthPix(szStr, pFont) / 2;
@@ -100,14 +100,14 @@ int JustifyText(char *szStr, int xPos, const FONT *pFont, int mode) {
* of the list is returned.
* @param pList Object list to add text to
* @param szStr String to output
- * @param colour Colour for monochrome text
+ * @param color Color for monochrome text
* @param xPos X position of string
* @param yPos Y position of string
* @param hFont Which font to use
* @param mode Mode flags for the string
* @param sleepTime Sleep time between each character (if non-zero)
*/
-OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int colour,
+OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color,
int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime) {
int xJustify; // x position of text after justification
int yOffset; // offset to next line of text
@@ -183,8 +183,8 @@ OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int colour,
if (mode & TXT_ABSOLUTE)
pChar->flags |= DMA_ABS;
- // set characters colour - only effective for mono fonts
- pChar->constant = colour;
+ // set characters color - only effective for mono fonts
+ pChar->constant = color;
// get Y animation offset
GetAniOffset(hImg, pChar->flags, &aniX, &aniY);
diff --git a/engines/tinsel/text.h b/engines/tinsel/text.h
index a849e286ec..ea804f58d7 100644
--- a/engines/tinsel/text.h
+++ b/engines/tinsel/text.h
@@ -34,7 +34,7 @@ namespace Tinsel {
/** text mode flags - defaults to left justify */
enum {
- TXT_CENTRE = 0x0001, ///< centre justify text
+ TXT_CENTER = 0x0001, ///< center justify text
TXT_RIGHT = 0x0002, ///< right justify text
TXT_SHADOW = 0x0004, ///< shadow each character
TXT_ABSOLUTE = 0x0008 ///< position of text is absolute (only for object text)
@@ -72,7 +72,7 @@ struct FONT {
struct TEXTOUT {
OBJECT *pList; ///< object list to add text to
char *szStr; ///< string to output
- int colour; ///< colour for monochrome text
+ int color; ///< color for monochrome text
int xPos; ///< x position of string
int yPos; ///< y position of string
SCNHANDLE hFont; ///< which font to use
@@ -91,14 +91,14 @@ struct TEXTOUT {
* of the list is returned.
* @param pList object list to add text to
* @param szStr string to output
- * @param colour colour for monochrome text
+ * @param color color for monochrome text
* @param xPos x position of string
* @param yPos y position of string
* @param hFont which font to use
* @param mode mode flags for the string
* @param sleepTime Sleep time between each character (if non-zero)
*/
-OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int colour,
+OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color,
int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime = 0);
OBJECT *ObjectTextOutIndirect( // output a string of text
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 40418dcc43..13b08a234c 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -84,7 +84,7 @@ extern bool bNoPause;
// In DOS_MAIN.C
// TODO/FIXME: From dos_main.c: "Only used on PSX so far"
-int clRunMode = 0;
+//int clRunMode = 0;
//----------------- EXTERNAL FUNCTIONS ---------------------
@@ -426,11 +426,11 @@ static void ScrollMonitorProcess(CORO_PARAM, const void *param) {
/**
* NOT A LIBRARY FUNCTION
*
- * Poke supplied colour into the DAC queue.
+ * Poke supplied color into the DAC queue.
*/
void SetTextPal(COLORREF col) {
- SetTalkColourRef(col);
- UpdateDACqueue(TalkColour(), col);
+ SetTalkColorRef(col);
+ UpdateDACqueue(TalkColor(), col);
}
/**
@@ -522,7 +522,7 @@ void TinGetVersion(WHICH_VER which, char *buffer, int length) {
/**
* Set actor's attributes.
- * - currently only the text colour.
+ * - currently only the text color.
*/
static void ActorAttr(int actor, int r1, int g1, int b1) {
storeActorAttr(actor, r1, g1, b1);
@@ -553,11 +553,11 @@ static int ActorDirection(int actor) {
/**
* Set actor's palette details for path brightnesses
*/
-void ActorPalette(int actor, int startColour, int length) {
+void ActorPalette(int actor, int startColor, int length) {
PMOVER pMover = GetMover(actor);
assert(pMover);
- StoreMoverPalette(pMover, startColour, length);
+ StoreMoverPalette(pMover, startColor, length);
}
/**
@@ -568,10 +568,10 @@ static void ActorPriority(int actor, int zFactor) {
}
/**
- * Set actor's text colour.
+ * Set actor's text color.
*/
-static void ActorRGB(int actor, COLORREF colour) {
- SetActorRGB(actor, colour);
+static void ActorRGB(int actor, COLORREF color) {
+ SetActorRGB(actor, color);
}
/**
@@ -1196,9 +1196,9 @@ static int GetInvLimit(int invno) {
/**
* Ghost
*/
-static void Ghost(int actor, int tColour, int tPalOffset) {
+static void Ghost(int actor, int tColor, int tPalOffset) {
SetSysVar(ISV_GHOST_ACTOR, actor);
- SetSysVar(ISV_GHOST_COLOUR, tColour);
+ SetSysVar(ISV_GHOST_COLOR, tColor);
SetSysVar(ISV_GHOST_BASE, tPalOffset);
CreateGhostPalette(BgPal());
}
@@ -1952,7 +1952,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset);
_ctx->pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, x - Loffset, y - Toffset, GetTagFontHandle(),
- TXT_CENTRE, 0);
+ TXT_CENTER, 0);
assert(_ctx->pText);
// Adjust x, y, or z if necessary
@@ -1965,7 +1965,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset);
_ctx->pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
0, x - Loffset, y - Toffset,
- TinselV2 ? GetTagFontHandle() : GetTalkFontHandle(), TXT_CENTRE);
+ TinselV2 ? GetTagFontHandle() : GetTalkFontHandle(), TXT_CENTER);
assert(_ctx->pText); // string produced NULL text
if (IsTopWindow())
MultiSetZPosition(_ctx->pText, Z_TOPW_TEXT);
@@ -2128,7 +2128,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo,
LoadStringRes(hText, TextBufferAddr(), TBUFSZ);
_ctx->pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
- 0, _ctx->textx, _ctx->texty, GetTagFontHandle(), TXT_CENTRE);
+ 0, _ctx->textx, _ctx->texty, GetTagFontHandle(), TXT_CENTER);
assert(_ctx->pText); // PrintObj() string produced NULL text
MultiSetZPosition(_ctx->pText, Z_INV_ITEXT);
@@ -2181,7 +2181,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo,
LoadStringRes(hText, TextBufferAddr(), TBUFSZ);
_ctx->pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, _ctx->textx, _ctx->texty, GetTagFontHandle(),
- TXT_CENTRE, 0);
+ TXT_CENTER, 0);
assert(_ctx->pText);
KeepOnScreen(_ctx->pText, &_ctx->textx, &_ctx->texty);
@@ -2297,7 +2297,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const INV_OBJECT *
// Re-display in the same place
LoadStringRes(text, TextBufferAddr(), TBUFSZ);
pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS), TextBufferAddr(),
- 0, textx, texty, GetTagFontHandle(), TXT_CENTRE);
+ 0, textx, texty, GetTagFontHandle(), TXT_CENTER);
assert(pText); // PrintObj() string produced NULL text
MultiSetZPosition(pText, Z_INV_ITEXT);
}
@@ -2490,7 +2490,7 @@ void ResumeLastGame() {
* Returns the current run mode
*/
static int RunMode() {
- return clRunMode;
+ return 0; //clRunMode;
}
/**
@@ -3367,7 +3367,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
_ctx->pText = ObjectTextOut(GetPlayfieldList(FIELD_STATUS),
TextBufferAddr(), 0, _ctx->x - _ctx->Loffset, _ctx->y - _ctx->Toffset,
- GetTalkFontHandle(), TXT_CENTRE);
+ GetTalkFontHandle(), TXT_CENTER);
assert(_ctx->pText); // talk() string produced NULL text;
if (IsTopWindow())
@@ -3595,12 +3595,12 @@ static void TalkPaletteIndex(unsigned index) {
/**
* Set talk font's palette entry.
*/
-static void TalkRGB(COLORREF colour, int myescEvent) {
+static void TalkRGB(COLORREF color, int myescEvent) {
// Don't do it if it's not wanted
if (myescEvent && myescEvent != GetEscEvents())
return;
- SetTextPal(colour);
+ SetTextPal(color);
}
/**
diff --git a/engines/tinsel/tinlib.h b/engines/tinsel/tinlib.h
index 11e59f380d..7bd2a19d55 100644
--- a/engines/tinsel/tinlib.h
+++ b/engines/tinsel/tinlib.h
@@ -48,7 +48,7 @@ void TinGetVersion(WHICH_VER which, char *buffer, int length);
// Library functions in TINLIB.C
void ActorBrightness(int actor, int brightness);
-void ActorPalette(int actor, int startColour, int length);
+void ActorPalette(int actor, int startColor, int length);
void Control(int param);
void HookScene(SCNHANDLE scene, int entrance, int transition);
void NewScene(CORO_PARAM, SCNHANDLE scene, int entrance, int transition);
diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h
index 5c7a1cdfb2..35ea43074c 100644
--- a/engines/tinsel/tinsel.h
+++ b/engines/tinsel/tinsel.h
@@ -125,8 +125,8 @@ typedef bool (*KEYFPTR)(const Common::KeyState &);
#define SCREEN_WIDTH (_vm->screen().w) // PC screen dimensions
#define SCREEN_HEIGHT (_vm->screen().h)
-#define SCRN_CENTRE_X ((SCREEN_WIDTH - 1) / 2) // screen centre x
-#define SCRN_CENTRE_Y ((SCREEN_HEIGHT - 1) / 2) // screen centre y
+#define SCRN_CENTER_X ((SCREEN_WIDTH - 1) / 2) // screen center x
+#define SCRN_CENTER_Y ((SCREEN_HEIGHT - 1) / 2) // screen center y
#define UNUSED_LINES 48
#define EXTRA_UNUSED_LINES 3
//#define SCREEN_BOX_HEIGHT1 (SCREEN_HEIGHT - UNUSED_LINES)
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index 69051d45fd..e63bc912c4 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -166,8 +166,9 @@ bool Character::walkTo(int32 newPosX, int32 newPosY) {
_vm->getPathFinding()->resetBlockingRects();
- if (_id == 1) {
- int32 sizeX = MAX<int32>(5, 40 * _vm->getDrew()->getScale() / 1024);
+ // don't allow flux to go at the same position as drew
+ if (_id == 1 ) {
+ int32 sizeX = MAX<int32>(5, 30 * _vm->getDrew()->getScale() / 1024);
int32 sizeY = MAX<int32>(2, 20 * _vm->getDrew()->getScale() / 1024);
_vm->getPathFinding()->addBlockingEllipse(_vm->getDrew()->getFinalX(), _vm->getDrew()->getFinalY(), sizeX, sizeY);
}
diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp
index 8192a6f6f1..0e2d58ca83 100644
--- a/engines/toon/font.cpp
+++ b/engines/toon/font.cpp
@@ -81,7 +81,7 @@ void FontRenderer::renderText(int32 x, int32 y, Common::String origText, int32 m
x -= xx / 2;
}
- _vm->addDirtyRect(x, y, x + xx, y + yy);
+ _vm->addDirtyRect(x, y, x + xx + 2, y + yy);
int32 curX = x;
int32 curY = y;
@@ -214,7 +214,7 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
curChar = textToFont(curChar);
int width = _currentFont->getFrameWidth(curChar);
- curWidth += width - 2;
+ curWidth += MAX<int32>(width - 2, 0);
it++;
curLetterNr++;
}
@@ -275,12 +275,12 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
for (int32 i = 0; i < numLines; i++) {
const byte *line = lines[i];
curX = x - lineSize[i] / 2;
- _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, y, curX + lineSize[i] + _vm->state()->_currentScrollValue, curY + height);
+ _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, curY, curX + lineSize[i] + _vm->state()->_currentScrollValue + 2, curY + height);
while (*line) {
byte curChar = textToFont(*line);
if (curChar != 32) _currentFont->drawFontFrame(_vm->getMainSurface(), curChar, curX + _vm->state()->_currentScrollValue, curY, _currentFontColor);
- curX = curX + _currentFont->getFrameWidth(curChar) - 2;
+ curX = curX + MAX<int32>(_currentFont->getFrameWidth(curChar) - 2, 0);
//height = MAX(height, _currentFont->getFrameHeight(curChar));
line++;
}
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 2040668245..1bc53e0e20 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -843,6 +843,7 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription)
_backupPalette = NULL;
_additionalPalette1 = NULL;
_additionalPalette2 = NULL;
+ _additionalPalette2Present = false;
_cutawayPalette = NULL;
_universalPalette = NULL;
_fluxPalette = NULL;
@@ -1148,6 +1149,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) {
strcat(temp, ".NPP");
loadAdditionalPalette(temp, 0);
+ _additionalPalette2Present = false;
strcpy(temp, state()->_locations[SceneId]._name);
strcat(temp, ".NP2");
loadAdditionalPalette(temp, 1);
@@ -1318,6 +1320,7 @@ void ToonEngine::loadAdditionalPalette(Common::String fileName, int32 mode) {
case 1:
memcpy(_additionalPalette2, palette, 69);
fixPaletteEntries(_additionalPalette2, 23);
+ _additionalPalette2Present = true;
break;
case 2:
memcpy(_cutawayPalette, palette, size);
@@ -1786,7 +1789,8 @@ void ToonEngine::flipScreens() {
if (_gameState->_inCloseUp) {
_gameState->_currentScrollValue = TOON_SCREEN_WIDTH;
setPaletteEntries(_cutawayPalette, 1, 128);
- setPaletteEntries(_additionalPalette2, 232, 23);
+ if (_additionalPalette2Present)
+ setPaletteEntries(_additionalPalette2, 232, 23);
} else {
_gameState->_currentScrollValue = 0;
_currentPicture->setupPalette();
diff --git a/engines/toon/toon.h b/engines/toon/toon.h
index 3554900684..373437d658 100644
--- a/engines/toon/toon.h
+++ b/engines/toon/toon.h
@@ -352,6 +352,7 @@ protected:
uint8 *_backupPalette;
uint8 *_additionalPalette1;
uint8 *_additionalPalette2;
+ bool _additionalPalette2Present;
uint8 *_cutawayPalette;
uint8 *_universalPalette;
uint8 *_fluxPalette;
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index bcda6dbdcd..d77e536d5b 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -150,11 +150,11 @@ void SequenceManager::signal() {
case 10: {
int resNum= getNextValue();
int lineNum = getNextValue();
- int colour = getNextValue();
+ int color = getNextValue();
int xp = getNextValue();
int yp = getNextValue();
int width = getNextValue();
- setMessage(resNum, lineNum, colour, Common::Point(xp, yp), width);
+ setMessage(resNum, lineNum, color, Common::Point(xp, yp), width);
break;
}
case 11:
@@ -332,10 +332,10 @@ uint16 SequenceManager::getNextValue() {
return result;
}
-void SequenceManager::setMessage(int resNum, int lineNum, int colour, const Common::Point &pt, int width) {
- _sceneText._colour1 = colour;
- _sceneText._colour2 = 0;
- _sceneText._colour3 = 0;
+void SequenceManager::setMessage(int resNum, int lineNum, int color, const Common::Point &pt, int width) {
+ _sceneText._color1 = color;
+ _sceneText._color2 = 0;
+ _sceneText._color3 = 0;
_sceneText._fontNumber = 2;
_sceneText._width = width;
@@ -374,8 +374,8 @@ SequenceManager *SequenceManager::globalManager() {
/*--------------------------------------------------------------------------*/
ConversationChoiceDialog::ConversationChoiceDialog() {
- _stdColour = 23;
- _highlightColour = _globals->_scenePalette._colours.background;
+ _stdColor = 23;
+ _highlightColor = _globals->_scenePalette._colors.background;
_fontNumber = 1;
}
@@ -438,7 +438,7 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
if (idx != _selectedIndex) {
if (_selectedIndex != _choiceList.size()) {
// De-highlight previously selected item
- _gfxManager._font._colours.foreground = _stdColour;
+ _gfxManager._font._colors.foreground = _stdColor;
_gfxManager._font.writeLines(_choiceList[_selectedIndex]._msg.c_str(),
_choiceList[_selectedIndex]._bounds, ALIGN_LEFT);
}
@@ -447,7 +447,7 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
if (_selectedIndex != _choiceList.size()) {
// Highlight the new item
- _gfxManager._font._colours.foreground = _highlightColour;
+ _gfxManager._font._colors.foreground = _highlightColor;
_gfxManager._font.writeLines(_choiceList[idx]._msg.c_str(), _choiceList[idx]._bounds, ALIGN_LEFT);
}
@@ -472,7 +472,7 @@ void ConversationChoiceDialog::draw() {
drawFrame();
_gfxManager._bounds = tempRect;
- _gfxManager._font._colours.foreground = _stdColour;
+ _gfxManager._font._colors.foreground = _stdColor;
_gfxManager.activate();
// Loop through writing the conversation choices
@@ -530,7 +530,7 @@ void StripManager::start(int stripNum, EventHandler *owner, StripCallback *callb
_stripNum = stripNum;
_callbackObject = callback;
- _sceneNumber = _globals->_sceneManager._sceneNumber;
+ _sceneNumber = _globals->_sceneManager._scene->_sceneNumber;
_sceneBounds = _globals->_sceneManager._scene->_sceneBounds;
_script.clear();
@@ -790,7 +790,7 @@ Speaker::Speaker() : EventHandler() {
_textPos = Common::Point(10, 20);
_fontNumber = 2;
_textMode = ALIGN_LEFT;
- _colour1 = _colour2 = _colour3 = _globals->_scenePalette._colours.foreground;
+ _color1 = _color2 = _color3 = _globals->_scenePalette._colors.foreground;
_action = NULL;
_speakerName = "SPEAKER";
}
@@ -806,9 +806,9 @@ void Speaker::synchronise(Serialiser &s) {
s.syncAsSint16LE(_textPos.x); s.syncAsSint16LE(_textPos.y);
s.syncAsSint32LE(_fontNumber);
SYNC_ENUM(_textMode, TextAlign);
- s.syncAsSint16LE(_colour1);
- s.syncAsSint16LE(_colour2);
- s.syncAsSint16LE(_colour3);
+ s.syncAsSint16LE(_color1);
+ s.syncAsSint16LE(_color2);
+ s.syncAsSint16LE(_color3);
s.syncAsByte(_hideObjects);
}
@@ -839,9 +839,9 @@ void Speaker::proc12(Action *action) {
void Speaker::setText(const Common::String &msg) {
_globals->_sceneObjects->draw();
- _sceneText._colour1 = _colour1;
- _sceneText._colour2 = _colour2;
- _sceneText._colour3 = _colour3;
+ _sceneText._color1 = _color1;
+ _sceneText._color2 = _color2;
+ _sceneText._color3 = _color3;
_sceneText._width = _textWidth;
_sceneText._fontNumber = _fontNumber;
_sceneText._textMode = _textMode;
@@ -871,8 +871,8 @@ void Speaker::removeText() {
SpeakerGameText::SpeakerGameText() : Speaker() {
_speakerName = "GAMETEXT";
_textPos = Common::Point(40, 40);
- _textMode = ALIGN_CENTRE;
- _colour1 = 7;
+ _textMode = ALIGN_CENTER;
+ _color1 = 7;
_textWidth = 230;
_hideObjects = false;
}
@@ -881,7 +881,7 @@ SpeakerGameText::SpeakerGameText() : Speaker() {
ScreenSpeaker::ScreenSpeaker() : Speaker() {
_npc = NULL;
- _textMode = ALIGN_CENTRE;
+ _textMode = ALIGN_CENTER;
}
void ScreenSpeaker::setText(const Common::String &msg) {
@@ -892,9 +892,9 @@ void ScreenSpeaker::setText(const Common::String &msg) {
_globals->gfxManager().getStringBounds(msg.c_str(), textRect, _textWidth);
if (_npc) {
- textRect.centre(_npc->_position.x, _npc->_bounds.top - (textRect.height() / 2 + 10));
+ textRect.center(_npc->_position.x, _npc->_bounds.top - (textRect.height() / 2 + 10));
} else {
- textRect.centre(_globals->_sceneManager._scene->_sceneBounds.left +
+ textRect.center(_globals->_sceneManager._scene->_sceneBounds.left +
(_globals->_sceneManager._scene->_sceneBounds.width() / 2),
_globals->_sceneManager._scene->_sceneBounds.top);
}
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index 4d6e51a6b8..7b8d944647 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -40,7 +40,7 @@ class SequenceManager : public Action {
private:
void setup();
uint16 getNextValue();
- void setMessage(int resNum, int lineNum, int colour, const Common::Point &pt, int width);
+ void setMessage(int resNum, int lineNum, int color, const Common::Point &pt, int width);
SequenceManager *globalManager();
public:
SceneText _sceneText;
@@ -80,7 +80,7 @@ public:
Common::Point _textPos;
int _fontNumber;
TextAlign _textMode;
- int _colour1, _colour2, _colour3;
+ int _color1, _color2, _color3;
bool _hideObjects;
public:
Speaker();
@@ -143,19 +143,19 @@ public:
class ConversationChoiceDialog : public ModalDialog {
public:
- int _stdColour;
- int _highlightColour;
+ int _stdColor;
+ int _highlightColor;
int _fontNumber;
- int _savedFgColour;
+ int _savedFgColor;
int _savedFontNumber;
Common::Array<ChoiceEntry> _choiceList;
uint _selectedIndex;
public:
ConversationChoiceDialog();
- void setColours(int stdColour, int highlightColour) {
- _stdColour = stdColour;
- _highlightColour = highlightColour;
+ void setColors(int stdColor, int highlightColor) {
+ _stdColor = stdColor;
+ _highlightColor = highlightColor;
}
void setFontNumber(int fontNum) { _fontNumber = fontNum; }
int execute(const Common::StringArray &choiceList);
@@ -219,7 +219,7 @@ public:
void start(int stripNum, EventHandler *owner, StripCallback *callback = NULL);
void setCallback(StripCallback *callback) { _callbackObject = callback; }
- void setColours(int stdColour, int highlightColour) { _choiceDialog.setColours(stdColour, highlightColour); }
+ void setColors(int stdColor, int highlightColor) { _choiceDialog.setColors(stdColor, highlightColor); }
void setFontNumber(int fontNum) { _choiceDialog.setFontNumber(fontNum); }
void addSpeaker(Speaker *speaker);
};
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 81088b4eaa..b3b1693cc3 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -65,7 +65,7 @@ void InvObject::setCursor() {
GfxSurface s = surfaceFromRes(_iconResNum, _rlbNum, _cursorNum);
Graphics::Surface src = s.lockSurface();
- _globals->_events.setCursor(src, s._transColour, s._centroid, _cursorId);
+ _globals->_events.setCursor(src, s._transColor, s._centroid, _cursorId);
}
}
@@ -1036,18 +1036,35 @@ PaletteModifier::PaletteModifier() {
/*--------------------------------------------------------------------------*/
-PaletteRotation::PaletteRotation() : PaletteModifier() {
- _disabled = false;
- _delayFrames = 0;
+PaletteModifierCached::PaletteModifierCached(): PaletteModifier() {
+ _step = 0;
+ _percent = 0;
+}
+
+void PaletteModifierCached::setPalette(ScenePalette *palette, int step) {
+ _scenePalette = palette;
+ _step = step;
+ _percent = 100;
+}
+
+void PaletteModifierCached::synchronise(Serialiser &s) {
+ PaletteModifier::synchronise(s);
+
+ s.syncAsByte(_step);
+ s.syncAsSint32LE(_percent);
+}
+
+/*--------------------------------------------------------------------------*/
+
+PaletteRotation::PaletteRotation() : PaletteModifierCached() {
+ _percent = 0;
_delayCtr = 0;
_frameNumber = _globals->_events.getFrameNumber();
}
void PaletteRotation::synchronise(Serialiser &s) {
- PaletteModifier::synchronise(s);
+ PaletteModifierCached::synchronise(s);
- s.syncAsByte(_disabled);
- s.syncAsSint32LE(_delayFrames);
s.syncAsSint32LE(_delayCtr);
s.syncAsUint32LE(_frameNumber);
s.syncAsSint32LE(_currIndex);
@@ -1055,11 +1072,7 @@ void PaletteRotation::synchronise(Serialiser &s) {
s.syncAsSint32LE(_end);
s.syncAsSint32LE(_rotationMode);
s.syncAsSint32LE(_duration);
- for (int i = 0; i < 256; ++i) {
- s.syncAsByte(_palette[i].r);
- s.syncAsByte(_palette[i].g);
- s.syncAsByte(_palette[i].b);
- }
+ s.syncBytes(&_palette[0], 256 * 3);
}
void PaletteRotation::signal() {
@@ -1077,8 +1090,8 @@ void PaletteRotation::signal() {
if (_delayCtr)
return;
- _delayCtr = _delayFrames;
- if (_disabled)
+ _delayCtr = _percent;
+ if (_step)
return;
bool flag = true;
@@ -1120,17 +1133,17 @@ void PaletteRotation::signal() {
if (flag) {
int count2 = _currIndex - _start;
int count = _end - _currIndex;
- g_system->getPaletteManager()->setPalette((const byte *)&_palette[_currIndex], _start, count);
+ g_system->getPaletteManager()->setPalette((const byte *)&_palette[_currIndex * 3], _start, count);
if (count2) {
- g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start], _start + count, count2);
+ g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start * 3], _start + count, count2);
}
}
}
void PaletteRotation::remove() {
Action *action = _action;
- g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start], _start, _end - _start);
+ g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start * 3], _start, _end - _start);
_scenePalette->_listeners.remove(this);
@@ -1141,11 +1154,11 @@ void PaletteRotation::remove() {
void PaletteRotation::set(ScenePalette *palette, int start, int end, int rotationMode, int duration, Action *action) {
_duration = duration;
- _disabled = false;
+ _step = false;
_action = action;
_scenePalette = palette;
- Common::copy(&palette->_palette[0], &palette->_palette[256], &_palette[0]);
+ Common::copy(&palette->_palette[0], &palette->_palette[256 * 3], &_palette[0]);
_start = start;
_end = end + 1;
@@ -1162,12 +1175,6 @@ void PaletteRotation::set(ScenePalette *palette, int start, int end, int rotatio
}
}
-void PaletteRotation::setPalette(ScenePalette *palette, bool disabled) {
- _scenePalette = palette;
- _disabled = disabled;
- _delayFrames = 100;
-}
-
bool PaletteRotation::decDuration() {
if (_duration) {
if (--_duration == 0) {
@@ -1179,26 +1186,20 @@ bool PaletteRotation::decDuration() {
}
void PaletteRotation::setDelay(int amount) {
- _delayFrames = _delayCtr = amount;
+ _percent = _delayCtr = amount;
}
/*--------------------------------------------------------------------------*/
-void PaletteUnknown::synchronise(Serialiser &s) {
- PaletteModifier::synchronise(s);
+void PaletteFader::synchronise(Serialiser &s) {
+ PaletteModifierCached::synchronise(s);
s.syncAsSint16LE(_step);
s.syncAsSint16LE(_percent);
- s.syncAsSint16LE(_field12);
- s.syncAsSint16LE(_field14);
- for (int i = 0; i < 256; ++i) {
- s.syncAsByte(_palette[i].r);
- s.syncAsByte(_palette[i].g);
- s.syncAsByte(_palette[i].b);
- }
+ s.syncBytes(&_palette[0], 256 * 3);
}
-void PaletteUnknown::signal() {
+void PaletteFader::signal() {
_percent -= _step;
if (_percent > 0) {
_scenePalette->fade((byte *)_palette, true /* 256 */, _percent);
@@ -1207,25 +1208,29 @@ void PaletteUnknown::signal() {
}
}
-void PaletteUnknown::remove() {
- if (_scenePalette) {
- for (int i = 0; i < 256; i++)
- _scenePalette->_palette[i] = _palette[i];
- _scenePalette->refresh();
- _scenePalette->_listeners.remove(this);
- delete this;
- }
+void PaletteFader::remove() {
+ // Save of a copy of the object's action, since it will be used after the object is destroyed
+ Action *action = _action;
- if (_action)
- _action->signal();
+ Common::copy(&_palette[0], &_palette[256 * 3], &_scenePalette->_palette[0]);
+ _scenePalette->refresh();
+ _scenePalette->_listeners.remove(this);
+ delete this;
+
+ if (action)
+ action->signal();
}
/*--------------------------------------------------------------------------*/
ScenePalette::ScenePalette() {
// Set a default gradiant range
- for (int idx = 0; idx < 256; ++idx)
- _palette[idx].r = _palette[idx].g = _palette[idx].b = idx;
+ byte *palData = &_palette[0];
+ for (int idx = 0; idx < 256; ++idx) {
+ *palData++ = idx;
+ *palData++ = idx;
+ *palData++ = idx;
+ }
_field412 = 0;
}
@@ -1243,25 +1248,25 @@ bool ScenePalette::loadPalette(int paletteNum) {
int palSize = READ_LE_UINT16(palData + 2);
assert(palSize <= 256);
- RGB8 *destP = &_palette[palStart];
- RGB8 *srcP = (RGB8 *)(palData + 6);
+ byte *destP = &_palette[palStart * 3];
+ byte *srcP = palData + 6;
- Common::copy(&srcP[0], &srcP[palSize], destP);
+ Common::copy(&srcP[0], &srcP[palSize * 3], destP);
DEALLOCATE(palData);
return true;
}
void ScenePalette::refresh() {
- // Set indexes for standard colours to closest colour in the palette
- _colours.background = indexOf(255, 255, 255); // White background
- _colours.foreground = indexOf(0, 0, 0); // Black foreground
- _redColour = indexOf(180, 0, 0); // Red-ish
- _greenColour = indexOf(0, 180, 0); // Green-ish
- _blueColour = indexOf(0, 0, 180); // Blue-ish
- _aquaColour = indexOf(0, 180, 180); // Aqua
- _purpleColour = indexOf(180, 0, 180); // Purple
- _limeColour = indexOf(180, 180, 0); // Lime
+ // Set indexes for standard colors to closest color in the palette
+ _colors.background = indexOf(255, 255, 255); // White background
+ _colors.foreground = indexOf(0, 0, 0); // Black foreground
+ _redColor = indexOf(180, 0, 0); // Red-ish
+ _greenColor = indexOf(0, 180, 0); // Green-ish
+ _blueColor = indexOf(0, 0, 180); // Blue-ish
+ _aquaColor = indexOf(0, 180, 180); // Aqua
+ _purpleColor = indexOf(180, 0, 180); // Purple
+ _limeColor = indexOf(180, 180, 0); // Lime
// Refresh the palette
g_system->getPaletteManager()->setPalette((const byte *)&_palette[0], 0, 256);
@@ -1271,24 +1276,28 @@ void ScenePalette::refresh() {
* Loads a section of the palette into the game palette
*/
void ScenePalette::setPalette(int index, int count) {
- g_system->getPaletteManager()->setPalette((const byte *)&_palette[index], index, count);
+ g_system->getPaletteManager()->setPalette((const byte *)&_palette[index * 3], index, count);
}
/**
- * Returns the palette index with the closest matching colour to that specified
+ * Returns the palette index with the closest matching color to that specified
* @param r R component
* @param g G component
* @param b B component
* @param threshold Closeness threshold.
- * @remarks A threshold may be provided to specify how close the matching colour must be
+ * @remarks A threshold may be provided to specify how close the matching color must be
*/
uint8 ScenePalette::indexOf(uint r, uint g, uint b, int threshold) {
int palIndex = -1;
+ byte *palData = &_palette[0];
for (int i = 0; i < 256; ++i) {
- int rDiff = abs(_palette[i].r - (int)r);
- int gDiff = abs(_palette[i].g - (int)g);
- int bDiff = abs(_palette[i].b - (int)b);
+ byte ir = *palData++;
+ byte ig = *palData++;
+ byte ib = *palData++;
+ int rDiff = abs(ir - (int)r);
+ int gDiff = abs(ig - (int)g);
+ int bDiff = abs(ib - (int)b);
int idxThreshold = rDiff * rDiff + gDiff * gDiff + bDiff * bDiff;
if (idxThreshold <= threshold) {
@@ -1325,14 +1334,14 @@ void ScenePalette::clearListeners() {
}
void ScenePalette::fade(const byte *adjustData, bool fullAdjust, int percent) {
- RGB8 tempPalette[256];
+ byte tempPalette[256 * 3];
// Ensure the percent adjustment is within 0 - 100%
percent = CLIP(percent, 0, 100);
for (int palIndex = 0; palIndex < 256; ++palIndex) {
- const byte *srcP = (const byte *)&_palette[palIndex];
- byte *destP = (byte *)&tempPalette[palIndex].r;
+ const byte *srcP = (const byte *)&_palette[palIndex * 3];
+ byte *destP = &tempPalette[palIndex * 3];
for (int rgbIndex = 0; rgbIndex < 3; ++rgbIndex, ++srcP, ++destP) {
*destP = *srcP - ((*srcP - adjustData[rgbIndex]) * (100 - percent)) / 100;
@@ -1358,18 +1367,21 @@ PaletteRotation *ScenePalette::addRotation(int start, int end, int rotationMode,
return obj;
}
-PaletteUnknown *ScenePalette::addUnkPal(RGB8 *arrBufferRGB, int unkNumb, bool disabled, Action *action) {
- PaletteUnknown *paletteUnk = new PaletteUnknown();
- paletteUnk->_action = action;
- for (int i = 0; i < 256; i++) {
- if (unkNumb <= 1)
- paletteUnk->_palette[i] = arrBufferRGB[i];
- else
- paletteUnk->_palette[i] = arrBufferRGB[0];
+PaletteFader *ScenePalette::addFader(const byte *arrBufferRGB, int palSize, int percent, Action *action) {
+ PaletteFader *fader = new PaletteFader();
+ fader->_action = action;
+ for (int i = 0; i < 256 * 3; i += 3) {
+ fader->_palette[i] = *(arrBufferRGB + 0);
+ fader->_palette[i + 1] = *(arrBufferRGB + 1);
+ fader->_palette[i + 2] = *(arrBufferRGB + 2);
+
+ if (palSize > 1)
+ arrBufferRGB += 3;
}
-// PaletteRotation::setPalette(this, disabled);
- _globals->_scenePalette._listeners.push_back(paletteUnk);
- return paletteUnk;
+
+ fader->setPalette(this, percent);
+ _globals->_scenePalette._listeners.push_back(fader);
+ return fader;
}
@@ -1403,21 +1415,17 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) {
}
void ScenePalette::synchronise(Serialiser &s) {
- for (int i = 0; i < 256; ++i) {
- s.syncAsByte(_palette[i].r);
- s.syncAsByte(_palette[i].g);
- s.syncAsByte(_palette[i].b);
- }
- s.syncAsSint32LE(_colours.foreground);
- s.syncAsSint32LE(_colours.background);
+ s.syncBytes(_palette, 256 * 3);
+ s.syncAsSint32LE(_colors.foreground);
+ s.syncAsSint32LE(_colors.background);
s.syncAsSint32LE(_field412);
- s.syncAsByte(_redColour);
- s.syncAsByte(_greenColour);
- s.syncAsByte(_blueColour);
- s.syncAsByte(_aquaColour);
- s.syncAsByte(_purpleColour);
- s.syncAsByte(_limeColour);
+ s.syncAsByte(_redColor);
+ s.syncAsByte(_greenColor);
+ s.syncAsByte(_blueColor);
+ s.syncAsByte(_aquaColor);
+ s.syncAsByte(_purpleColor);
+ s.syncAsByte(_limeColor);
}
/*--------------------------------------------------------------------------*/
@@ -1485,7 +1493,7 @@ void SceneItem::display(int resNum, int lineNum, ...) {
Rect textRect;
int maxWidth = 120;
bool keepOnscreen = false;
- bool centreText = true;
+ bool centerText = true;
if (resNum) {
va_list va;
@@ -1515,40 +1523,40 @@ void SceneItem::display(int resNum, int lineNum, ...) {
_globals->_sceneText._fontNumber = va_arg(va, int);
_globals->gfxManager()._font.setFontNumber(_globals->_sceneText._fontNumber);
break;
- case SET_BG_COLOUR: {
- // Set the background colour
- int bgColour = va_arg(va, int);
- _globals->gfxManager()._font._colours.background = bgColour;
- if (!bgColour)
+ case SET_BG_COLOR: {
+ // Set the background color
+ int bgColor = va_arg(va, int);
+ _globals->gfxManager()._font._colors.background = bgColor;
+ if (!bgColor)
_globals->gfxManager().setFillFlag(false);
break;
}
- case SET_FG_COLOUR:
- // Set the foreground colour
- _globals->_sceneText._colour1 = va_arg(va, int);
- _globals->gfxManager()._font._colours.foreground = _globals->_sceneText._colour1;
+ case SET_FG_COLOR:
+ // Set the foreground color
+ _globals->_sceneText._color1 = va_arg(va, int);
+ _globals->gfxManager()._font._colors.foreground = _globals->_sceneText._color1;
break;
case SET_KEEP_ONSCREEN:
// Suppresses immediate display
keepOnscreen = va_arg(va, int) != 0;
break;
- case SET_EXT_BGCOLOUR: {
- // Set secondary bg colour
+ case SET_EXT_BGCOLOR: {
+ // Set secondary bg color
int v = va_arg(va, int);
- _globals->_sceneText._colour2 = v;
- _globals->gfxManager()._font._colours2.background = v;
+ _globals->_sceneText._color2 = v;
+ _globals->gfxManager()._font._colors2.background = v;
break;
}
- case SET_EXT_FGCOLOUR: {
- // Set secondary fg colour
+ case SET_EXT_FGCOLOR: {
+ // Set secondary fg color
int v = va_arg(va, int);
- _globals->_sceneText._colour3 = v;
- _globals->gfxManager()._font._colours.foreground = v;
+ _globals->_sceneText._color3 = v;
+ _globals->gfxManager()._font._colors.foreground = v;
break;
}
case SET_POS_MODE:
// Set whether a custom x/y is used
- centreText = va_arg(va, int) != 0;
+ centerText = va_arg(va, int) != 0;
break;
case SET_TEXT_MODE:
// Set the text mode
@@ -1565,17 +1573,17 @@ void SceneItem::display(int resNum, int lineNum, ...) {
if (resNum) {
// Get required bounding size
_globals->gfxManager().getStringBounds(msg.c_str(), textRect, maxWidth);
- textRect.centre(pos.x, pos.y);
+ textRect.center(pos.x, pos.y);
textRect.contain(_globals->gfxManager()._bounds);
- if (centreText) {
- _globals->_sceneText._colour1 = _globals->_sceneText._colour2;
- _globals->_sceneText._colour2 = 0;
- _globals->_sceneText._colour3 = 0;
+ if (centerText) {
+ _globals->_sceneText._color1 = _globals->_sceneText._color2;
+ _globals->_sceneText._color2 = 0;
+ _globals->_sceneText._color3 = 0;
}
_globals->_sceneText.setup(msg);
- if (centreText) {
+ if (centerText) {
_globals->_sceneText.setPosition(Common::Point(
_globals->_sceneManager._scene->_sceneBounds.left + textRect.left,
_globals->_sceneManager._scene->_sceneBounds.top + textRect.top), 0);
@@ -1607,18 +1615,18 @@ void SceneItem::display(int resNum, int lineNum, ...) {
void SceneHotspot::doAction(int action) {
switch ((int)action) {
case CURSOR_LOOK:
- display(1, 0, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(1, 0, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
- display(1, 5, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(1, 5, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_TALK:
- display(1, 15, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(1, 15, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_WALK:
break;
default:
- display(2, action, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(2, action, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
}
}
@@ -1634,13 +1642,13 @@ void NamedHotspot::doAction(int action) {
if (_lookLineNum == -1)
SceneHotspot::doAction(action);
else
- SceneItem::display(_resnum, _lookLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(_resnum, _lookLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (_useLineNum == -1)
SceneHotspot::doAction(action);
else
- SceneItem::display(_resnum, _useLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(_resnum, _useLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
default:
SceneHotspot::doAction(action);
@@ -2235,7 +2243,6 @@ void SceneObject::removeObject() {
_globals->_sceneObjects->remove(this);
if (_visage) {
- _vm->_memoryManager.deallocate(_visage);
_visage = 0;
}
@@ -2563,8 +2570,8 @@ SceneText::SceneText() : SceneObject() {
_fontNumber = 2;
_width = 160;
_textMode = ALIGN_LEFT;
- _colour2 = 0;
- _colour3 = 0;
+ _color2 = 0;
+ _color3 = 0;
}
SceneText::~SceneText() {
@@ -2576,16 +2583,16 @@ void SceneText::setup(const Common::String &msg) {
Rect textRect;
gfxMan._font.setFontNumber(_fontNumber);
- gfxMan._font._colours.foreground = _colour1;
- gfxMan._font._colours2.background = _colour2;
- gfxMan._font._colours2.foreground = _colour3;
+ gfxMan._font._colors.foreground = _color1;
+ gfxMan._font._colors2.background = _color2;
+ gfxMan._font._colors2.foreground = _color3;
gfxMan.getStringBounds(msg.c_str(), textRect, _width);
// Set up a new blank surface to hold the text
_textSurface.create(textRect.width(), textRect.height());
- _textSurface._transColour = 0xff;
- _textSurface.fillRect(textRect, _textSurface._transColour);
+ _textSurface._transColor = 0xff;
+ _textSurface.fillRect(textRect, _textSurface._transColor);
// Write the text to the surface
gfxMan._bounds = textRect;
@@ -2601,9 +2608,9 @@ void SceneText::synchronise(Serialiser &s) {
s.syncAsSint16LE(_fontNumber);
s.syncAsSint16LE(_width);
- s.syncAsSint16LE(_colour1);
- s.syncAsSint16LE(_colour2);
- s.syncAsSint16LE(_colour3);
+ s.syncAsSint16LE(_color1);
+ s.syncAsSint16LE(_color2);
+ s.syncAsSint16LE(_color3);
SYNC_ENUM(_textMode, TextAlign);
}
@@ -2654,7 +2661,7 @@ GfxSurface Visage::getFrame(int frameNum) {
if (frameNum > 0)
--frameNum;
- int offset = READ_UINT32(_data + 2 + frameNum * 4);
+ int offset = READ_LE_UINT32(_data + 2 + frameNum * 4);
byte *frameData = _data + offset;
return surfaceFromRes(frameData);
@@ -3700,6 +3707,7 @@ void Game::restart() {
_globals->_inventory._bone._sceneNumber = 5300;
_globals->_inventory._jar._sceneNumber = 7700;
_globals->_inventory._emptyJar._sceneNumber = 7700;
+ _globals->_inventory._selectedItem = NULL;
// Change to the first game scene
_globals->_sceneManager.changeScene(30);
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 77923606d1..6508d1576a 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -317,10 +317,21 @@ public:
virtual void remove() = 0;
};
-class PaletteRotation : public PaletteModifier {
+class PaletteModifierCached: public PaletteModifier {
+public:
+ byte _palette[256 * 3];
+ int _step;
+ int _percent;
+
+ PaletteModifierCached();
+
+ void setPalette(ScenePalette *palette, int step);
+ virtual Common::String getClassName() { return "PaletteModifierCached"; }
+ virtual void synchronise(Serialiser &s);
+};
+
+class PaletteRotation: public PaletteModifierCached {
public:
- bool _disabled;
- int _delayFrames;
int _delayCtr;
uint32 _frameNumber;
int _currIndex;
@@ -328,7 +339,6 @@ public:
int _end;
int _rotationMode;
int _duration;
- RGB8 _palette[256];
public:
PaletteRotation();
@@ -337,41 +347,39 @@ public:
virtual void signal();
virtual void remove();
- void setDisabled(bool v) { _disabled = v; }
+ void setStep(int step) { _step = step; }
void set(ScenePalette *palette, int start, int end, int rotationMode, int duration, Action *action);
- void setPalette(ScenePalette *palette, bool disabled);
bool decDuration();
void setDelay(int amount);
};
-/*--------------------------------------------------------------------------*/
-
-class PaletteUnknown : public PaletteModifier {
+class PaletteFader: public PaletteModifierCached {
public:
- int _step, _percent, _field12, _field14;
- RGB8 _palette[256];
+ byte _palette[256 * 3];
public:
- virtual Common::String getClassName() { return "PaletteUnknown"; }
+ virtual Common::String getClassName() { return "PaletteFader"; }
virtual void synchronise(Serialiser &s);
virtual void signal();
virtual void remove();
};
+/*--------------------------------------------------------------------------*/
+
enum FadeMode {FADEMODE_NONE = 0, FADEMODE_GRADUAL = 1, FADEMODE_IMMEDIATE = 2};
class ScenePalette : public SavedObject {
public:
- RGB8 _palette[256];
- GfxColours _colours;
+ byte _palette[256 * 3];
+ GfxColors _colors;
SynchronisedList<PaletteModifier *> _listeners;
int _field412;
- uint8 _redColour;
- uint8 _greenColour;
- uint8 _blueColour;
- uint8 _aquaColour;
- uint8 _purpleColour;
- uint8 _limeColour;
+ uint8 _redColor;
+ uint8 _greenColor;
+ uint8 _blueColor;
+ uint8 _aquaColor;
+ uint8 _purpleColor;
+ uint8 _limeColor;
public:
ScenePalette();
ScenePalette(int paletteNum);
@@ -385,7 +393,7 @@ public:
void clearListeners();
void fade(const byte *adjustData, bool fullAdjust, int percent);
PaletteRotation *addRotation(int start, int end, int rotationMode, int duration = 0, Action *action = NULL);
- PaletteUnknown *addUnkPal(RGB8 *arrBufferRGB, int unkNumb, bool disabled, Action *action);
+ PaletteFader *addFader(const byte *arrBufferRGB, int palSize, int percent, Action *action);
static void changeBackground(const Rect &bounds, FadeMode fadeMode);
@@ -398,11 +406,11 @@ const int SET_WIDTH = 0;
const int SET_X = 1;
const int SET_Y = 2;
const int SET_FONT = 3;
-const int SET_BG_COLOUR = 4;
-const int SET_FG_COLOUR = 5;
+const int SET_BG_COLOR = 4;
+const int SET_FG_COLOR = 5;
const int SET_KEEP_ONSCREEN = 6;
-const int SET_EXT_BGCOLOUR = 7;
-const int SET_EXT_FGCOLOUR = 8;
+const int SET_EXT_BGCOLOR = 7;
+const int SET_EXT_FGCOLOR = 8;
const int SET_POS_MODE = 9;
const int SET_TEXT_MODE = 10;
const int LIST_END = -999;
@@ -430,7 +438,7 @@ public:
void setBounds(const int ys, const int xe, const int ye, const int xs) { _bounds = Rect(MIN(xs, xe), MIN(ys, ye), MAX(xs, xe), MAX(ys, ye)); }
static void display(int resNum, int lineNum, ...);
static void display2(int resNum, int lineNum) {
- display(resNum, lineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(resNum, lineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
};
@@ -602,9 +610,9 @@ public:
int _fontNumber;
int _width;
TextAlign _textMode;
- int _colour1;
- int _colour2;
- int _colour3;
+ int _color1;
+ int _color2;
+ int _color3;
GfxSurface _textSurface;
public:
SceneText();
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index d04fd71461..ad4e76f61c 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -37,6 +37,12 @@ Debugger::Debugger() : GUI::Debugger() {
DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene));
DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions));
DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions));
+ DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag));
+ DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag));
+ DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag));
+ DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects));
+ DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
+
DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item));
}
@@ -81,14 +87,14 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
return true;
}
- // Colour index to use for the first walk region
- int colour = 16;
+ // Color index to use for the first walk region
+ int color = 16;
// Lock the background surface for access
Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface();
- // Loop through drawing each walk region in a different colour to the background surface
- for (uint regionIndex = 0; regionIndex < _globals->_walkRegions._regionList.size(); ++regionIndex, ++colour) {
+ // Loop through drawing each walk region in a different color to the background surface
+ for (uint regionIndex = 0; regionIndex < _globals->_walkRegions._regionList.size(); ++regionIndex, ++color) {
WalkRegion &wr = _globals->_walkRegions._regionList[regionIndex];
for (int yp = wr._bounds.top; yp < wr._bounds.bottom; ++yp) {
@@ -96,7 +102,7 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
for (uint idx = 0; idx < sliceSet.items.size(); ++idx)
destSurface.hLine(sliceSet.items[idx].xs - _globals->_sceneOffset.x, yp,
- sliceSet.items[idx].xe - _globals->_sceneOffset.x, colour);
+ sliceSet.items[idx].xe - _globals->_sceneOffset.x, color);
}
}
@@ -119,8 +125,8 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
if (argc == 2)
regionNum = strToInt(argv[1]);
- // Colour index to use for the first priority region
- int colour = 16;
+ // Color index to use for the first priority region
+ int color = 16;
int count = 0;
// Lock the background surface for access
@@ -129,7 +135,7 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
Common::List<Region>::iterator i = _globals->_sceneManager._scene->_priorities.begin();
Common::String regionsDesc;
- for (; i != _globals->_sceneManager._scene->_priorities.end(); ++i, ++colour, ++count) {
+ for (; i != _globals->_sceneManager._scene->_priorities.end(); ++i, ++color, ++count) {
Region &r = *i;
if ((regionNum == 0) || (regionNum == (count + 1))) {
@@ -139,7 +145,7 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
for (int x = 0; x < destSurface.w; ++x) {
if (r.contains(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + x,
_globals->_sceneManager._scene->_sceneBounds.top + y)))
- *destP = colour;
+ *destP = color;
++destP;
}
}
@@ -161,6 +167,220 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
return true;
}
+/*
+ * This command sets a flag
+ */
+bool Debugger::Cmd_SetFlag(int argc, const char **argv) {
+ // Check for a flag to set
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ _globals->setFlag(flagNum);
+ return true;
+}
+
+/*
+ * This command gets the value of a flag
+ */
+bool Debugger::Cmd_GetFlag(int argc, const char **argv) {
+ // Check for an flag to display
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ DebugPrintf("Value: %d\n", _globals->getFlag(flagNum));
+ return true;
+}
+
+/*
+ * This command clears a flag
+ */
+bool Debugger::Cmd_ClearFlag(int argc, const char **argv) {
+ // Check for a flag to clear
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ _globals->clearFlag(flagNum);
+ return true;
+}
+
+/*
+ * This command lists the objects available, and their ID
+ */
+bool Debugger::Cmd_ListObjects(int argc, const char **argv) {
+ if (argc != 1) {
+ DebugPrintf("Usage: %s\n", argv[0]);
+ return true;
+ }
+
+ DebugPrintf("Available objects for this game are:\n");
+ DebugPrintf("0 - Stunner\n");
+ DebugPrintf("1 - Scanner\n");
+ DebugPrintf("2 - Stasis Box\n");
+ DebugPrintf("3 - Info Disk\n");
+ DebugPrintf("4 - Stasis Negator\n");
+ DebugPrintf("5 - Key Device\n");
+ DebugPrintf("6 - Medkit\n");
+ DebugPrintf("7 - Ladder\n");
+ DebugPrintf("8 - Rope\n");
+ DebugPrintf("9 - Key\n");
+ DebugPrintf("10 - Translator\n");
+ DebugPrintf("11 - Ale\n");
+ DebugPrintf("12 - Paper\n");
+ DebugPrintf("13 - Waldos\n");
+ DebugPrintf("14 - Stasis Box 2\n");
+ DebugPrintf("15 - Ring\n");
+ DebugPrintf("16 - Cloak\n");
+ DebugPrintf("17 - Tunic\n");
+ DebugPrintf("18 - Candle\n");
+ DebugPrintf("19 - Straw\n");
+ DebugPrintf("20 - Scimitar\n");
+ DebugPrintf("21 - Sword\n");
+ DebugPrintf("22 - Helmet\n");
+ DebugPrintf("23 - Items\n");
+ DebugPrintf("24 - Concentrator\n");
+ DebugPrintf("25 - Nullifier\n");
+ DebugPrintf("26 - Peg\n");
+ DebugPrintf("27 - Vial\n");
+ DebugPrintf("28 - Jacket\n");
+ DebugPrintf("29 - Tunic 2\n");
+ DebugPrintf("30 - Bone\n");
+ DebugPrintf("31 - Empty Jar\n");
+ DebugPrintf("32 - Jar\n");
+ return true;
+}
+
+/*
+ * This command gets an item, or move it to a room
+ */
+bool Debugger::Cmd_MoveObject(int argc, const char **argv) {
+ // Check for a flag to clear
+ if ((argc < 2) || (argc > 3)){
+ DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]);
+ DebugPrintf("If no scene is specified, the object will be added to inventory\n");
+ return true;
+ }
+
+ int objNum = strToInt(argv[1]);
+ int sceneNum = 1;
+ if (argc == 3)
+ sceneNum = strToInt(argv[2]);
+
+ switch (objNum) {
+ case OBJECT_STUNNER:
+ _globals->_inventory._stunner._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SCANNER:
+ _globals->_inventory._scanner._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_BOX:
+ _globals->_inventory._stasisBox._sceneNumber = sceneNum;
+ break;
+ case OBJECT_INFODISK:
+ _globals->_inventory._infoDisk._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_NEGATOR:
+ _globals->_inventory._stasisNegator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_KEY_DEVICE:
+ _globals->_inventory._keyDevice._sceneNumber = sceneNum;
+ break;
+ case OBJECT_MEDKIT:
+ _globals->_inventory._medkit._sceneNumber = sceneNum;
+ break;
+ case OBJECT_LADDER:
+ _globals->_inventory._ladder._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ROPE:
+ _globals->_inventory._rope._sceneNumber = sceneNum;
+ break;
+ case OBJECT_KEY:
+ _globals->_inventory._key._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TRANSLATOR:
+ _globals->_inventory._translator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ALE:
+ _globals->_inventory._ale._sceneNumber = sceneNum;
+ break;
+ case OBJECT_PAPER:
+ _globals->_inventory._paper._sceneNumber = sceneNum;
+ break;
+ case OBJECT_WALDOS:
+ _globals->_inventory._waldos._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_BOX2:
+ _globals->_inventory._stasisBox2._sceneNumber = sceneNum;
+ break;
+ case OBJECT_RING:
+ _globals->_inventory._ring._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CLOAK:
+ _globals->_inventory._cloak._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TUNIC:
+ _globals->_inventory._tunic._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CANDLE:
+ _globals->_inventory._candle._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STRAW:
+ _globals->_inventory._straw._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SCIMITAR:
+ _globals->_inventory._scimitar._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SWORD:
+ _globals->_inventory._sword._sceneNumber = sceneNum;
+ break;
+ case OBJECT_HELMET:
+ _globals->_inventory._helmet._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ITEMS:
+ _globals->_inventory._items._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CONCENTRATOR:
+ _globals->_inventory._concentrator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_NULLIFIER:
+ _globals->_inventory._nullifier._sceneNumber = sceneNum;
+ break;
+ case OBJECT_PEG:
+ _globals->_inventory._peg._sceneNumber = sceneNum;
+ break;
+ case OBJECT_VIAL:
+ _globals->_inventory._vial._sceneNumber = sceneNum;
+ break;
+ case OBJECT_JACKET:
+ _globals->_inventory._jacket._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TUNIC2:
+ _globals->_inventory._tunic2._sceneNumber = sceneNum;
+ break;
+ case OBJECT_BONE:
+ _globals->_inventory._bone._sceneNumber = sceneNum;
+ break;
+ case OBJECT_EMPTY_JAR:
+ _globals->_inventory._emptyJar._sceneNumber = sceneNum;
+ break;
+ case OBJECT_JAR:
+ _globals->_inventory._jar._sceneNumber = sceneNum;
+ break;
+ default:
+ DebugPrintf("Invlid object Id %s\n", argv[1]);
+ }
+
+ return true;
+}
+
/**
* Give a specified item to the player
*/
@@ -169,4 +389,5 @@ bool Debugger::Cmd_Item(int argc, const char **argv) {
return true;
}
+
} // End of namespace tSage
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index c94d77b2ab..a34bb1ef0a 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -40,6 +40,12 @@ protected:
bool Cmd_Scene(int argc, const char **argv);
bool Cmd_WalkRegions(int argc, const char **argv);
bool Cmd_PriorityRegions(int argc, const char **argv);
+ bool Cmd_SetFlag(int argc, const char **argv);
+ bool Cmd_GetFlag(int argc, const char **argv);
+ bool Cmd_ClearFlag(int argc, const char **argv);
+ bool Cmd_ListObjects(int argc, const char **argv);
+ bool Cmd_MoveObject(int argc, const char **argv);
+
bool Cmd_Item(int argc, const char **argv);
};
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index b76d60ac48..21970cee24 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -64,8 +64,8 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String
// Do post setup for the dialog
setDefaults();
- // Set the dialog's centre
- setCentre(_globals->_dialogCentre.x, _globals->_dialogCentre.y);
+ // Set the dialog's center
+ setCenter(_globals->_dialogCenter.x, _globals->_dialogCenter.y);
}
int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) {
@@ -167,7 +167,7 @@ RightClickDialog::RightClickDialog() : GfxDialog(),
// Set the dialog position
dialogRect.resize(_surface, 0, 0, 100);
- dialogRect.centre(_globals->_events._mousePos.x, _globals->_events._mousePos.y);
+ dialogRect.center(_globals->_events._mousePos.x, _globals->_events._mousePos.y);
// Ensure the dialog will be entirely on-screen
Rect screenRect = _globals->gfxManager()._bounds;
@@ -379,36 +379,34 @@ bool GfxInvImage::process(Event &event) {
/*--------------------------------------------------------------------------*/
-void InventoryDialog::show(bool allFlag) {
- if (!allFlag) {
- // Determine how many items are in the player's inventory
- int itemCount = 0;
- SynchronisedList<InvObject *>::iterator i;
- for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
- if ((*i)->inInventory())
- ++itemCount;
- }
+void InventoryDialog::show() {
+ // Determine how many items are in the player's inventory
+ int itemCount = 0;
+ SynchronisedList<InvObject *>::iterator i;
+ for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
+ if ((*i)->inInventory())
+ ++itemCount;
+ }
- if (itemCount == 0) {
- MessageDialog::show(INV_EMPTY_MSG, OK_BTN_STRING);
- return;
- }
+ if (itemCount == 0) {
+ MessageDialog::show(INV_EMPTY_MSG, OK_BTN_STRING);
+ return;
}
- InventoryDialog *dlg = new InventoryDialog(allFlag);
+ InventoryDialog *dlg = new InventoryDialog();
dlg->draw();
dlg->execute();
delete dlg;
}
-InventoryDialog::InventoryDialog(bool allFlag) {
+InventoryDialog::InventoryDialog() {
// Determine the maximum size of the image of any item in the player's inventory
int imgWidth = 0, imgHeight = 0;
SynchronisedList<InvObject *>::iterator i;
for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
InvObject *invObject = *i;
- if (allFlag || invObject->inInventory()) {
+ if (invObject->inInventory()) {
// Get the image for the item
GfxSurface itemSurface = surfaceFromRes(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum);
@@ -457,7 +455,7 @@ InventoryDialog::InventoryDialog(bool allFlag) {
addElements(&_btnLook, &_btnOk, NULL);
frame();
- setCentre(SCREEN_CENTRE_X, SCREEN_CENTRE_Y);
+ setCenter(SCREEN_CENTER_X, SCREEN_CENTER_Y);
}
void InventoryDialog::execute() {
@@ -591,7 +589,7 @@ OptionsDialog::OptionsDialog() {
// Set the dialog size and position
frame();
- setCentre(160, 100);
+ setCenter(160, 100);
}
diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h
index 8e766372b4..d7828526eb 100644
--- a/engines/tsage/dialogs.h
+++ b/engines/tsage/dialogs.h
@@ -108,11 +108,11 @@ private:
Common::Array<GfxInvImage> _images;
GfxButton _btnOk, _btnLook;
public:
- InventoryDialog(bool allFlag = false);
+ InventoryDialog();
virtual ~InventoryDialog() {}
void execute();
- static void show(bool allFlag = false);
+ static void show();
};
/*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index fa5ecdcde6..83cafcaac5 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -201,16 +201,16 @@ void EventsClass::setCursor(CursorType cursorType) {
Graphics::Surface surface = s.lockSurface();
const byte *cursorData = (const byte *)surface.getBasePtr(0, 0);
- CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColour);
+ CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
s.unlockSurface();
if (delFlag)
DEALLOCATE(cursor);
}
-void EventsClass::setCursor(Graphics::Surface &cursor, int transColour, const Common::Point &hotspot, CursorType cursorId) {
+void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId) {
const byte *cursorData = (const byte *)cursor.getBasePtr(0, 0);
- CursorMan.replaceCursor(cursorData, cursor.w, cursor.h, hotspot.x, hotspot.y, transColour);
+ CursorMan.replaceCursor(cursorData, cursor.w, cursor.h, hotspot.x, hotspot.y, transColor);
_currentCursor = cursorId;
}
diff --git a/engines/tsage/events.h b/engines/tsage/events.h
index 202ac9ccd2..ef0256e81f 100644
--- a/engines/tsage/events.h
+++ b/engines/tsage/events.h
@@ -82,7 +82,7 @@ public:
CursorType _currentCursor;
void setCursor(CursorType cursorType);
- void setCursor(Graphics::Surface &cursor, int transColour, const Common::Point &hotspot, CursorType cursorId);
+ void setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId);
void setCursorFromFlag();
CursorType getCursor() const { return _currentCursor; }
void showCursor();
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index b9abb9d751..7f41ab0978 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -47,15 +47,15 @@ static SavedObject *classFactoryProc(const Common::String &className) {
/*--------------------------------------------------------------------------*/
Globals::Globals() :
- _dialogCentre(160, 140),
+ _dialogCenter(160, 140),
_gfxManagerInstance(_screenSurface) {
reset();
_stripNum = 0;
_gfxFontNumber = 50;
- _gfxColours.background = 53;
- _gfxColours.foreground = 18;
- _fontColours.background = 51;
- _fontColours.foreground = 54;
+ _gfxColors.background = 53;
+ _gfxColors.foreground = 18;
+ _fontColors.background = 51;
+ _fontColors.foreground = 54;
_screenSurface.setScreenSurface();
_gfxManagers.push_back(&_gfxManagerInstance);
@@ -84,12 +84,12 @@ void Globals::synchronise(Serialiser &s) {
SYNC_POINTER(_sceneObjects);
_sceneObjects_queue.synchronise(s);
s.syncAsSint32LE(_gfxFontNumber);
- s.syncAsSint32LE(_gfxColours.background);
- s.syncAsSint32LE(_gfxColours.foreground);
- s.syncAsSint32LE(_fontColours.background);
- s.syncAsSint32LE(_fontColours.foreground);
+ s.syncAsSint32LE(_gfxColors.background);
+ s.syncAsSint32LE(_gfxColors.foreground);
+ s.syncAsSint32LE(_fontColors.background);
+ s.syncAsSint32LE(_fontColors.foreground);
- s.syncAsSint16LE(_dialogCentre.x); s.syncAsSint16LE(_dialogCentre.y);
+ s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
_sceneListeners.synchronise(s);
for (int i = 0; i < 256; ++i)
s.syncAsByte(_flags[i]);
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 59afe140a0..6fe8e6295a 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -52,10 +52,10 @@ public:
SynchronisedList<SceneObjectList *> _sceneObjects_queue;
SceneText _sceneText;
int _gfxFontNumber;
- GfxColours _gfxColours;
- GfxColours _fontColours;
+ GfxColors _gfxColors;
+ GfxColors _fontColors;
SoundManager _soundManager;
- Common::Point _dialogCentre;
+ Common::Point _dialogCenter;
WalkRegions _walkRegions;
SynchronisedList<EventHandler *> _sceneListeners;
bool _flags[256];
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 641e10b3e9..77316d2d7d 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -72,7 +72,7 @@ GfxSurface surfaceFromRes(const byte *imgData) {
s.create(r.width(), r.height());
s._centroid.x = READ_LE_UINT16(imgData + 4);
s._centroid.y = READ_LE_UINT16(imgData + 6);
- s._transColour = *(imgData + 8);
+ s._transColor = *(imgData + 8);
bool rleEncoded = (imgData[9] & 2) != 0;
@@ -83,7 +83,7 @@ GfxSurface surfaceFromRes(const byte *imgData) {
if (!rleEncoded) {
Common::copy(srcP, srcP + (r.width() * r.height()), destP);
} else {
- Common::set_to(destP, destP + (r.width() * r.height()), s._transColour);
+ Common::set_to(destP, destP + (r.width() * r.height()), s._transColor);
for (int yp = 0; yp < r.height(); ++yp) {
int width = r.width();
@@ -147,22 +147,22 @@ void Rect::collapse(int dx, int dy) {
}
/**
- * Centres the rectangle at a given position
+ * Centers the rectangle at a given position
*
- * @xp x position for new centre
- * @yp y position for new centre
+ * @xp x position for new center
+ * @yp y position for new center
*/
-void Rect::centre(int xp, int yp) {
+void Rect::center(int xp, int yp) {
moveTo(xp - (width() / 2), yp - (height() / 2));
}
/**
- * Centres the rectangle at the centre of a second passed rectangle
+ * Centers the rectangle at the center of a second passed rectangle
*
- * @r Second rectangle whose centre to use
+ * @r Second rectangle whose center to use
*/
-void Rect::centre(const Rect &r) {
- centre(r.left + (r.width() / 2), r.top + (r.height() / 2));
+void Rect::center(const Rect &r) {
+ center(r.left + (r.width() / 2), r.top + (r.height() / 2));
}
/*
@@ -301,14 +301,14 @@ void GfxSurface::unlockSurface() {
}
/**
- * Fills a specified rectangle on the surface with the specified colour
+ * Fills a specified rectangle on the surface with the specified color
*
* @bounds Area to fill
- * @colour Colour to use
+ * @color Color to use
*/
-void GfxSurface::fillRect(const Rect &bounds, int colour) {
+void GfxSurface::fillRect(const Rect &bounds, int color) {
Graphics::Surface surface = lockSurface();
- surface.fillRect(bounds, colour);
+ surface.fillRect(bounds, color);
unlockSurface();
}
@@ -326,7 +326,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) {
_disableUpdates = s._disableUpdates;
_bounds = s._bounds;
_centroid = s._centroid;
- _transColour = s._transColour;
+ _transColor = s._transColor;
if (_customSurface) {
// Surface owns the internal data, so replicate it so new surface owns it's own
@@ -348,14 +348,14 @@ bool GfxSurface::displayText(const Common::String &msg, const Common::Point &pt)
// Set up a new graphics manager
GfxManager gfxManager;
gfxManager.activate();
- gfxManager._font._colours.background = 0;
- gfxManager._font._colours.foreground = 7;
+ gfxManager._font._colors.background = 0;
+ gfxManager._font._colors.foreground = 7;
gfxManager._font.setFontNumber(2);
// Get the area for text display
Rect textRect;
gfxManager.getStringBounds(msg.c_str(), textRect, 200);
- textRect.centre(pt.x, pt.y);
+ textRect.center(pt.x, pt.y);
// Make a backup copy of the area the text will occupy
Rect saveRect = textRect;
@@ -410,19 +410,20 @@ void GfxSurface::loadScreenSection(Graphics::Surface &dest, int xHalf, int yHalf
* included in a scaled image
*/
static int *scaleLine(int size, int srcSize) {
- int scale = 100 * size / srcSize;
+ const int PRECISION_FACTOR = 1000;
+ int scale = PRECISION_FACTOR * size / srcSize;
assert(scale >= 0);
int *v = new int[size];
- Common::set_to(v, &v[size], 0);
+ Common::set_to(v, &v[size], -1);
int distCtr = 0;
int *destP = v;
for (int distIndex = 0; distIndex < srcSize; ++distIndex) {
distCtr += scale;
- while (distCtr >= 100) {
+ while (distCtr >= PRECISION_FACTOR) {
assert(destP < &v[size]);
*destP++ = distIndex;
- distCtr -= 100;
+ distCtr -= PRECISION_FACTOR;
}
}
@@ -436,7 +437,7 @@ static int *scaleLine(int size, int srcSize) {
* @param NewHeight New height for scaled image
* @remarks Caller is responsible for freeing the returned surface
*/
-static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize) {
+static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int transIndex) {
GfxSurface s;
s.create(xSize, ySize);
@@ -448,12 +449,22 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize) {
// Loop to create scaled version
for (int yp = 0; yp < ySize; ++yp) {
- const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]);
byte *destP = (byte *)destImage.getBasePtr(0, yp);
- for (int xp = 0; xp < xSize; ++xp) {
- const byte *tempSrcP = srcP + horizUsage[xp];
- *destP++ = *tempSrcP++;
+ if (vertUsage[yp] == -1) {
+ Common::set_to(destP, destP + xSize, transIndex);
+ } else {
+ const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]);
+
+ for (int xp = 0; xp < xSize; ++xp) {
+ if (horizUsage[xp] != -1) {
+ const byte *tempSrcP = srcP + horizUsage[xp];
+ *destP++ = *tempSrcP++;
+ } else {
+ // Pixel overrun at the end of the line
+ *destP++ = transIndex;
+ }
+ }
}
}
@@ -493,7 +504,7 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi
}
if ((destBounds.width() != srcBounds.width()) || (destBounds.height() != srcBounds.height()))
- srcImage = ResizeSurface(srcImage, destBounds.width(), destBounds.height());
+ srcImage = ResizeSurface(srcImage, destBounds.width(), destBounds.height(), src._transColor);
Graphics::Surface srcSurface = srcImage.lockSurface();
Graphics::Surface destSurface = lockSurface();
@@ -519,7 +530,7 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi
for (int y = 0; y < destBounds.height(); ++y, pSrc += srcSurface.pitch, pDest += destSurface.pitch) {
- if (!priorityRegion && (src._transColour == -1))
+ if (!priorityRegion && (src._transColor == -1))
Common::copy(pSrc, pSrc + destBounds.width(), pDest);
else {
const byte *tempSrc = pSrc;
@@ -530,7 +541,7 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi
if (!priorityRegion || !priorityRegion->contains(Common::Point(
xp + _globals->_sceneManager._scene->_sceneBounds.left,
destBounds.top + y + _globals->_sceneManager._scene->_sceneBounds.top))) {
- if (*tempSrc != src._transColour)
+ if (*tempSrc != src._transColor)
*tempDest = *tempSrc;
}
++tempSrc;
@@ -570,8 +581,8 @@ GfxElement::GfxElement() {
void GfxElement::setDefaults() {
_flags = 0;
_fontNumber = _globals->_gfxFontNumber;
- _colours = _globals->_gfxColours;
- _fontColours = _globals->_fontColours;
+ _colors = _globals->_gfxColors;
+ _fontColors = _globals->_fontColors;
}
/**
@@ -583,15 +594,15 @@ void GfxElement::highlight() {
Graphics::Surface surface = gfxManager.lockSurface();
// Scan through the contents of the element, switching any occurances of the foreground
- // colour with the background colour and vice versa
+ // color with the background color and vice versa
Rect tempRect(_bounds);
tempRect.collapse(2, 2);
for (int yp = tempRect.top; yp < tempRect.bottom; ++yp) {
byte *lineP = (byte *)surface.getBasePtr(tempRect.left, yp);
for (int xp = tempRect.left; xp < tempRect.right; ++xp, ++lineP) {
- if (*lineP == _colours.background) *lineP = _colours.foreground;
- else if (*lineP == _colours.foreground) *lineP = _colours.background;
+ if (*lineP == _colors.background) *lineP = _colors.foreground;
+ else if (*lineP == _colors.foreground) *lineP = _colors.background;
}
}
@@ -607,31 +618,31 @@ void GfxElement::drawFrame() {
GfxManager &gfxManager = _globals->gfxManager();
gfxManager.lockSurface();
- uint8 bgColour, fgColour;
+ uint8 bgColor, fgColor;
if (_flags & GFXFLAG_THICK_FRAME) {
- bgColour = 0;
- fgColour = 0;
+ bgColor = 0;
+ fgColor = 0;
} else {
- bgColour = _fontColours.background;
- fgColour = _fontColours.foreground;
+ bgColor = _fontColors.background;
+ fgColor = _fontColors.foreground;
}
Rect tempRect = _bounds;
tempRect.collapse(3, 3);
tempRect.collapse(-1, -1);
- gfxManager.fillRect(tempRect, _colours.background);
+ gfxManager.fillRect(tempRect, _colors.background);
--tempRect.bottom; --tempRect.right;
- gfxManager.fillArea(tempRect.left, tempRect.top, bgColour);
- gfxManager.fillArea(tempRect.left, tempRect.bottom, fgColour);
- gfxManager.fillArea(tempRect.right, tempRect.top, fgColour);
- gfxManager.fillArea(tempRect.right, tempRect.bottom, fgColour);
+ gfxManager.fillArea(tempRect.left, tempRect.top, bgColor);
+ gfxManager.fillArea(tempRect.left, tempRect.bottom, fgColor);
+ gfxManager.fillArea(tempRect.right, tempRect.top, fgColor);
+ gfxManager.fillArea(tempRect.right, tempRect.bottom, fgColor);
tempRect.collapse(-1, -1);
- gfxManager.fillRect2(tempRect.left + 1, tempRect.top, tempRect.width() - 1, 1, bgColour);
- gfxManager.fillRect2(tempRect.left, tempRect.top + 1, 1, tempRect.height() - 1, bgColour);
- gfxManager.fillRect2(tempRect.left + 1, tempRect.bottom, tempRect.width() - 1, 1, fgColour);
- gfxManager.fillRect2(tempRect.right, tempRect.top + 1, 1, tempRect.height() - 1, fgColour);
+ gfxManager.fillRect2(tempRect.left + 1, tempRect.top, tempRect.width() - 1, 1, bgColor);
+ gfxManager.fillRect2(tempRect.left, tempRect.top + 1, 1, tempRect.height() - 1, bgColor);
+ gfxManager.fillRect2(tempRect.left + 1, tempRect.bottom, tempRect.width() - 1, 1, fgColor);
+ gfxManager.fillRect2(tempRect.right, tempRect.top + 1, 1, tempRect.height() - 1, fgColor);
gfxManager.fillArea(tempRect.left, tempRect.top, 0);
gfxManager.fillArea(tempRect.left, tempRect.bottom, 0);
@@ -753,10 +764,10 @@ void GfxMessage::draw() {
GfxFontBackup font;
GfxManager &gfxManager = _globals->gfxManager();
- // Set the font and colour
+ // Set the font and color
gfxManager.setFillFlag(false);
gfxManager._font.setFontNumber(_fontNumber);
- gfxManager._font._colours.foreground = this->_colours.foreground;
+ gfxManager._font._colors.foreground = this->_colors.foreground;
// Display the text
gfxManager._font.writeLines(_message.c_str(), _bounds, _textAlign);
@@ -791,14 +802,14 @@ void GfxButton::draw() {
// Draw a basic frame for the button
drawFrame();
- // Set the font and colour
+ // Set the font and color
gfxManager._font.setFontNumber(_fontNumber);
- gfxManager._font._colours.foreground = this->_colours.foreground;
+ gfxManager._font._colors.foreground = this->_colors.foreground;
// Display the button's text
Rect tempRect(_bounds);
tempRect.collapse(3, 3);
- gfxManager._font.writeLines(_message.c_str(), tempRect, ALIGN_CENTRE);
+ gfxManager._font.writeLines(_message.c_str(), tempRect, ALIGN_CENTER);
gfxManager.unlockSurface();
}
@@ -928,7 +939,7 @@ void GfxDialog::setTopLeft(int xp, int yp) {
_bounds.moveTo(xp - 6, yp - 6);
}
-void GfxDialog::setCentre(int xp, int yp) {
+void GfxDialog::setCenter(int xp, int yp) {
setTopLeft(xp - (_bounds.width() / 2), yp - (_bounds.height() / 2));
}
@@ -986,9 +997,9 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) {
void GfxDialog::setPalette() {
_globals->_scenePalette.loadPalette(0);
_globals->_scenePalette.setPalette(0, 1);
- _globals->_scenePalette.setPalette(_globals->_scenePalette._colours.foreground, 1);
- _globals->_scenePalette.setPalette(_globals->_fontColours.background, 1);
- _globals->_scenePalette.setPalette(_globals->_fontColours.foreground, 1);
+ _globals->_scenePalette.setPalette(_globals->_scenePalette._colors.foreground, 1);
+ _globals->_scenePalette.setPalette(_globals->_fontColors.background, 1);
+ _globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1);
_globals->_scenePalette.setPalette(255, 1);
}
@@ -1013,7 +1024,7 @@ void GfxManager::setDefaults() {
_pane0Rect4 = screenBounds;
_font._edgeSize = Common::Point(1, 1);
- _font._colours = _globals->_fontColours;
+ _font._colors = _globals->_fontColors;
_font.setFontNumber(_globals->_gfxFontNumber);
}
@@ -1040,20 +1051,20 @@ void GfxManager::getStringBounds(const char *s, Rect &bounds, int maxWidth) {
_font.getStringBounds(s, bounds, maxWidth);
}
-void GfxManager::fillArea(int xp, int yp, int colour) {
+void GfxManager::fillArea(int xp, int yp, int color) {
_surface.setBounds(_bounds);
Rect tempRect(xp, yp, xp + _font._edgeSize.x, yp + _font._edgeSize.y);
- _surface.fillRect(tempRect, colour);
+ _surface.fillRect(tempRect, color);
}
-void GfxManager::fillRect(const Rect &bounds, int colour) {
+void GfxManager::fillRect(const Rect &bounds, int color) {
_surface.setBounds(_bounds);
- _surface.fillRect(bounds, colour);
+ _surface.fillRect(bounds, color);
}
-void GfxManager::fillRect2(int xs, int ys, int width, int height, int colour) {
+void GfxManager::fillRect2(int xs, int ys, int width, int height, int color) {
_surface.setBounds(_bounds);
- _surface.fillRect(Rect(xs, ys, xs + width, ys + height), colour);
+ _surface.fillRect(Rect(xs, ys, xs + width, ys + height), color);
}
/**
@@ -1061,10 +1072,10 @@ void GfxManager::fillRect2(int xs, int ys, int width, int height, int colour) {
*/
void GfxManager::setDialogPalette() {
// Get the main palette information
- RGB8 palData[256];
+ byte palData[256 * 3];
uint count, start;
_vm->_dataManager->getPalette(0, &palData[0], &start, &count);
- g_system->getPaletteManager()->setPalette((byte *)&palData[0], start, count);
+ g_system->getPaletteManager()->setPalette(&palData[0], start, count);
// Miscellaneous
uint32 white = 0xffffffff;
@@ -1268,7 +1279,7 @@ int GfxFont::writeChar(const char ch) {
charRect.translate(_topLeft.x + _position.x, _topLeft.y + _position.y + yOffset);
if (_fillFlag)
- surfacePtr.fillRect(charRect, _colours.background);
+ surfacePtr.fillRect(charRect, _colors.background);
charRect.bottom = charRect.top + charHeight;
@@ -1279,7 +1290,7 @@ int GfxFont::writeChar(const char ch) {
byte *destP = (byte *)surfacePtr.getBasePtr(charRect.left, yp);
for (int xs = 0; xs < charRect.width(); ++xs, ++destP) {
- // Get the next colour index to use
+ // Get the next color index to use
if ((bitCtr % 8) == 0) v = *dataP++;
int colIndex = 0;
for (int subCtr = 0; subCtr < _bpp; ++subCtr, ++bitCtr) {
@@ -1288,10 +1299,10 @@ int GfxFont::writeChar(const char ch) {
}
switch (colIndex) {
- //case 0: *destP = _colours.background; break;
- case 1: *destP = _colours.foreground; break;
- case 2: *destP = _colours2.background; break;
- case 3: *destP = _colours2.foreground; break;
+ //case 0: *destP = _colors.background; break;
+ case 1: *destP = _colors.foreground; break;
+ case 2: *destP = _colors2.background; break;
+ case 3: *destP = _colors2.foreground; break;
}
}
}
@@ -1355,7 +1366,7 @@ void GfxFont::writeLines(const char *s, const Rect &bounds, TextAlign align) {
writeString(s, numChars);
break;
- case ALIGN_CENTRE:
+ case ALIGN_CENTER:
// Center aligned text
_position.x = bounds.left + (bounds.width() / 2) - (getStringWidth(s, numChars) / 2);
writeString(s, numChars);
@@ -1415,7 +1426,7 @@ void GfxFont::writeLines(const char *s, const Rect &bounds, TextAlign align) {
GfxFontBackup::GfxFontBackup() {
_edgeSize = _globals->gfxManager()._font._edgeSize;
_position = _globals->gfxManager()._font._position;
- _colours = _globals->gfxManager()._font._colours;
+ _colors = _globals->gfxManager()._font._colors;
_fontNumber = _globals->gfxManager()._font._fontNumber;
}
@@ -1423,7 +1434,7 @@ GfxFontBackup::~GfxFontBackup() {
_globals->gfxManager()._font.setFontNumber(_fontNumber);
_globals->gfxManager()._font._edgeSize = _edgeSize;
_globals->gfxManager()._font._position = _position;
- _globals->gfxManager()._font._colours = _colours;
+ _globals->gfxManager()._font._colors = _colors;
}
diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h
index 0ad76772b3..c266d74bc5 100644
--- a/engines/tsage/graphics.h
+++ b/engines/tsage/graphics.h
@@ -48,9 +48,9 @@ public:
void set(int16 x1, int16 y1, int16 x2, int16 y2);
void collapse(int dx, int dy);
- void centre(int dx, int dy);
- void centre(const Rect &r);
- void centre(const Common::Point &pt) { centre(pt.x, pt.y); }
+ void center(int dx, int dy);
+ void center(const Rect &r);
+ void center(const Common::Point &pt) { center(pt.x, pt.y); }
void contain(const Rect &r);
void resize(const GfxSurface &surface, int xp, int yp, int percent);
void expandPanes();
@@ -58,12 +58,12 @@ public:
virtual void synchronise(Serialiser &s);
};
-class GfxColours {
+class GfxColors {
public:
uint8 foreground;
uint8 background;
- GfxColours() : foreground(0), background(0) {};
+ GfxColors() : foreground(0), background(0) {};
};
class LineSlice {
@@ -85,7 +85,7 @@ private:
Rect _bounds;
public:
Common::Point _centroid;
- int _transColour;
+ int _transColor;
public:
GfxSurface();
GfxSurface(const GfxSurface &s);
@@ -108,14 +108,14 @@ public:
copyFrom(src, tempRect, priorityRegion);
}
void draw(const Common::Point &pt, Rect *rect = NULL);
- void fillRect(const Rect &bounds, int colour);
+ void fillRect(const Rect &bounds, int color);
GfxSurface &operator=(const GfxSurface &s);
static void loadScreenSection(Graphics::Surface &dest, int xHalf, int yHalf, int xSection, int ySection);
static bool displayText(const Common::String &msg, const Common::Point &pt = Common::Point(160, 100));
};
-enum TextAlign {ALIGN_LEFT = 0, ALIGN_CENTRE = 1, ALIGN_RIGHT = 2, ALIGN_JUSTIFIED = 3};
+enum TextAlign {ALIGN_LEFT = 0, ALIGN_CENTER = 1, ALIGN_RIGHT = 2, ALIGN_JUSTIFIED = 3};
class GfxFont {
friend class GfxFontBackup;
@@ -131,8 +131,8 @@ public:
Common::Point _edgeSize;
Common::Point _position;
bool _fillFlag;
- GfxColours _colours;
- GfxColours _colours2;
+ GfxColors _colors;
+ GfxColors _colors2;
uint32 _fontNumber;
Common::Point _topLeft;
public:
@@ -160,7 +160,7 @@ private:
GfxSurface *_surface;
Common::Point _edgeSize;
Common::Point _position;
- GfxColours _colours;
+ GfxColors _colors;
uint32 _fontNumber;
public:
GfxFontBackup();
@@ -177,8 +177,8 @@ public:
Rect _bounds;
uint16 _flags;
uint16 _fontNumber;
- GfxColours _colours;
- GfxColours _fontColours;
+ GfxColors _colors;
+ GfxColors _fontColors;
uint16 _keycode;
public:
GfxElement();
@@ -275,19 +275,19 @@ public:
return _surface.lockSurface();
}
void unlockSurface() { _surface.unlockSurface(); };
- void fillArea(int xp, int yp, int colour);
- void fillRect(const Rect &bounds, int colour);
- void fillRect2(int xs, int ys, int width, int height, int colour);
+ void fillArea(int xp, int yp, int color);
+ void fillRect(const Rect &bounds, int color);
+ void fillRect2(int xs, int ys, int width, int height, int color);
void setFillFlag(bool v) { _font._fillFlag = v; }
static int getAngle(const Common::Point &p1, const Common::Point &p2);
// Virtual method table
- virtual void xorArea(const Common::Rect &r, int colour, int fillMode) {
- //_surface->xorArea(r, colour, fillMode);
+ virtual void xorArea(const Common::Rect &r, int color, int fillMode) {
+ //_surface->xorArea(r, color, fillMode);
}
- virtual void draw(const Common::Rect &r, void *gfxData, int v1, GfxColours *colours) {
- //_surface->draw(r, gfxData, v1, colours);
+ virtual void draw(const Common::Rect &r, void *gfxData, int v1, GfxColors *colors) {
+ //_surface->draw(r, gfxData, v1, colors);
}
virtual void copy(const byte *src, byte *dest, int size) {
Common::copy(src, src + size, dest);
@@ -325,7 +325,7 @@ public:
void add(GfxElement *element);
void addElements(GfxElement *ge, ...);
void setTopLeft(int xp, int yp);
- void setCentre(int xp, int yp);
+ void setCenter(int xp, int yp);
void frame() {
setDefaults();
_bounds.collapse(6, 6);
diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp
index c87c3eaf1e..21397f238a 100644
--- a/engines/tsage/resources.cpp
+++ b/engines/tsage/resources.cpp
@@ -356,18 +356,17 @@ void RlbManager::loadIndex() {
*
* @paletteNum Specefies the palette number
*/
-void RlbManager::getPalette(int paletteNum, RGB8 *palData, uint *startNum, uint *numEntries) {
+void RlbManager::getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries) {
// Get the specified palette
byte *dataIn = getResource(RES_PALETTE, 0, paletteNum);
assert(dataIn);
*startNum = READ_LE_UINT16(dataIn);
*numEntries = READ_LE_UINT16(dataIn + 2);
- RGB8 *srcPal = (RGB8 *)(dataIn + 6);
assert((*startNum < 256) && ((*startNum + *numEntries) <= 256));
// Copy over the data
- Common::copy(&srcPal[0], &srcPal[*numEntries], palData);
+ Common::copy(&dataIn[6], &dataIn[6 + *numEntries * 3], palData);
_memoryManager.deallocate(dataIn);
}
diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h
index 9024ff0f03..2cf5069d36 100644
--- a/engines/tsage/resources.h
+++ b/engines/tsage/resources.h
@@ -45,16 +45,6 @@ enum ResourceType { RES_LIBRARY, RES_STRIP, RES_IMAGE, RES_PALETTE, RES_VISAGE,
RES_FONT, RES_POINTER, RES_BANK, RES_SND_DRIVER, RES_PRIORITY, RES_CONTROL, RES_WALKRGNS,
RES_BITMAP, RES_SAVE, RES_SEQUENCE };
-#include "common/pack-start.h" // START STRUCT PACKING
-
-struct RGB8 {
- uint8 r;
- uint8 g;
- uint8 b;
-} PACKED_STRUCT;
-
-#include "common/pack-end.h" // END STRUCT PACKING
-
class MemoryHeader {
public:
uint32 id;
@@ -165,7 +155,7 @@ public:
byte *getResource(uint16 id, bool suppressErrors = false);
byte *getResource(ResourceType resType, uint16 resNum, uint16 rlbNum, bool suppressErrors = false);
- void getPalette(int paletteNum, RGB8 *palData, uint *startNum, uint *numEntries);
+ void getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries);
byte *getSubResource(int resNum, int rlbNum, int index, uint *size);
Common::String getMessage(int resNum, int lineNum);
};
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index 32f62bea76..6c3a40af48 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -141,32 +141,47 @@ Scene *SceneFactory::createScene(int sceneNumber) {
case 5300: return new Scene5300();
/* Scene group 8 */
- // Scene 7000: Landing
+ // Landing near beach
case 7000: return new Scene7000();
- // Scene 7100: swimming under water
+ // Underwater: swimming
case 7100: return new Scene7100();
- // Scene 7200: Entering the underwater cave
+ // Underwater: Entering the cave
case 7200: return new Scene7200();
- // Scene 7300: Discussion with Lord Poria
+ // Underwater: Lord Poria
case 7300: return new Scene7300();
+ // Floating Buildings: Outside
case 7600: return new Scene7600();
+ // Floating Buildings: In the lab
case 7700: return new Scene7700();
/* Scene group 10 */
+ // Near beach: Slave washing clothes
case 9100: return new Scene9100();
+ // Castle: Outside the bulwarks
case 9150: return new Scene9150();
+ // Castle: Near the fountain
case 9200: return new Scene9200();
+ // Castle: In front of a large guarded door
case 9300: return new Scene9300();
+ // Castle: In a hallway
case 9350: return new Scene9350();
+ // Castle: In a hallway
case 9360: return new Scene9360();
+ // Castle: Black-Smith room
case 9400: return new Scene9400();
+ // Castle: Dining room
case 9450: return new Scene9450();
+ // Castle: Bedroom
case 9500: return new Scene9500();
+ // Castle: Balcony
case 9700: return new Scene9700();
+ // Castle: In the garden
case 9750: return new Scene9750();
+ // Castle: Dressing room
case 9850: return new Scene9850();
- // Scene 9900: Ending
+ // Ending
case 9900: return new Scene9900();
+ // Space travel
case 9999: return new Scene9999();
default:
@@ -196,7 +211,7 @@ DisplayHotspot::DisplayHotspot(int regionId, ...) {
bool DisplayHotspot::performAction(int action) {
for (uint i = 0; i < _actions.size(); i += 3) {
if (_actions[i] == action) {
- display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
return true;
}
}
@@ -223,7 +238,7 @@ DisplayObject::DisplayObject(int firstAction, ...) {
bool DisplayObject::performAction(int action) {
for (uint i = 0; i < _actions.size(); i += 3) {
if (_actions[i] == action) {
- display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
return true;
}
}
@@ -313,7 +328,7 @@ SpeakerGText::SpeakerGText() {
_speakerName = "GTEXT";
_textWidth = 160;
_textPos = Common::Point(130, 10);
- _colour1 = 42;
+ _color1 = 42;
_hideObjects = false;
}
@@ -331,7 +346,7 @@ void SpeakerGText::setText(const Common::String &msg) {
// Set the text
Rect textRect;
_globals->gfxManager()._font.getStringBounds(msg.c_str(), textRect, _textWidth);
- textRect.centre(_sceneObject._position.x, _sceneObject._position.y);
+ textRect.center(_sceneObject._position.x, _sceneObject._position.y);
_textPos.x = textRect.left;
Speaker::setText(msg);
}
@@ -347,7 +362,7 @@ SpeakerPOR::SpeakerPOR() {
_speakerName = "POR";
_newSceneNumber = 7221;
_textPos = Common::Point(10, 30);
- _colour1 = 41;
+ _color1 = 41;
}
void SpeakerPOR::SpeakerAction1::signal(){
@@ -395,7 +410,7 @@ SpeakerOR::SpeakerOR() {
_speakerName = "OR";
_newSceneNumber = 9430;
_textPos = Common::Point(8, 36);
- _colour1 = 42;
+ _color1 = 42;
_textWidth = 136;
}
@@ -427,7 +442,7 @@ SpeakerOText::SpeakerOText() : SpeakerGText() {
_speakerName = "OTEXT";
_textWidth = 240;
_textPos = Common::Point(130, 10);
- _colour1 = 42;
+ _color1 = 42;
_hideObjects = false;
}
@@ -436,9 +451,9 @@ SpeakerOText::SpeakerOText() : SpeakerGText() {
SpeakerQText::SpeakerQText() : ScreenSpeaker() {
_speakerName = "QTEXT";
_textPos = Common::Point(160, 40);
- _colour1 = 35;
+ _color1 = 35;
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
+ _textMode = ALIGN_CENTER;
_hideObjects = false;
}
@@ -446,9 +461,9 @@ SpeakerQText::SpeakerQText() : ScreenSpeaker() {
SpeakerSText::SpeakerSText() : ScreenSpeaker() {
_speakerName = "STEXT";
- _colour1 = 13;
+ _color1 = 13;
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
+ _textMode = ALIGN_CENTER;
_hideObjects = false;
}
@@ -457,8 +472,8 @@ SpeakerSText::SpeakerSText() : ScreenSpeaker() {
SpeakerPOText::SpeakerPOText() : ScreenSpeaker() {
_speakerName = "POTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 41;
+ _textMode = ALIGN_CENTER;
+ _color1 = 41;
_hideObjects = false;
}
@@ -466,9 +481,9 @@ SpeakerPOText::SpeakerPOText() : ScreenSpeaker() {
SpeakerMText::SpeakerMText() {
_speakerName = "MTEXT";
- _colour1 = 11;
- _textWidth = 160;
- _textMode = ALIGN_CENTRE;
+ _color1 = 22;
+ _textWidth = 230;
+ _textMode = ALIGN_CENTER;
_hideObjects = false;
}
@@ -476,9 +491,9 @@ SpeakerMText::SpeakerMText() {
SpeakerCText::SpeakerCText() {
_speakerName = "CTEXT";
- _colour1 = 4;
+ _color1 = 4;
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
+ _textMode = ALIGN_CENTER;
_hideObjects = false;
}
@@ -487,7 +502,7 @@ SpeakerCText::SpeakerCText() {
SpeakerEText::SpeakerEText() {
_speakerName = "ETEXT";
_textPos = Common::Point(20, 20);
- _colour1 = 22;
+ _color1 = 22;
_hideObjects = false;
}
@@ -498,7 +513,7 @@ SpeakerGR::SpeakerGR() {
_newSceneNumber = 9220;
_textWidth = 136;
_textPos = Common::Point(168, 36);
- _colour1 = 14;
+ _color1 = 14;
}
/*--------------------------------------------------------------------------*/
@@ -506,7 +521,7 @@ SpeakerGR::SpeakerGR() {
SpeakerHText::SpeakerHText() {
_speakerName = "HTEXT";
_textPos = Common::Point(160, 40);
- _colour1 = 52;
+ _color1 = 52;
_hideObjects = false;
}
@@ -515,8 +530,8 @@ SpeakerHText::SpeakerHText() {
SpeakerSKText::SpeakerSKText() : ScreenSpeaker() {
_speakerName = "SKTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 5;
+ _textMode = ALIGN_CENTER;
+ _color1 = 5;
_hideObjects = false;
}
@@ -525,8 +540,8 @@ SpeakerSKText::SpeakerSKText() : ScreenSpeaker() {
SpeakerPText::SpeakerPText() {
_speakerName = "PTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 5;
+ _textMode = ALIGN_CENTER;
+ _color1 = 5;
_hideObjects = false;
}
@@ -535,8 +550,8 @@ SpeakerPText::SpeakerPText() {
SpeakerCHFText::SpeakerCHFText() {
_speakerName = "CHFTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 56;
+ _textMode = ALIGN_CENTER;
+ _color1 = 56;
_hideObjects = false;
}
@@ -545,8 +560,8 @@ SpeakerCHFText::SpeakerCHFText() {
SpeakerCDRText::SpeakerCDRText() {
_speakerName = "CDRTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 52;
+ _textMode = ALIGN_CENTER;
+ _color1 = 52;
_hideObjects = false;
}
@@ -555,7 +570,7 @@ SpeakerCDRText::SpeakerCDRText() {
SpeakerFLText::SpeakerFLText() {
_speakerName = "FLTEXT";
_textPos = Common::Point(10, 40);
- _colour1 = 17;
+ _color1 = 17;
_hideObjects = false;
}
@@ -564,8 +579,8 @@ SpeakerFLText::SpeakerFLText() {
SpeakerBatText::SpeakerBatText() {
_speakerName = "BATTEXT";
_textWidth = 240;
- _textMode = ALIGN_CENTRE;
- _colour1 = 3;
+ _textMode = ALIGN_CENTER;
+ _color1 = 3;
_hideObjects = false;
}
@@ -575,7 +590,7 @@ SpeakerSKL::SpeakerSKL() : AnimatedSpeaker() {
_speakerName = "SKL";
_newSceneNumber = 7011;
_textPos = Common::Point(10, 30);
- _colour1 = 10;
+ _color1 = 10;
}
void SpeakerSKL::setText(const Common::String &msg) {
@@ -606,8 +621,8 @@ SpeakerQL::SpeakerQL() : AnimatedSpeaker() {
_speakerName = "QL";
_newSceneNumber = 2610;
_textPos = Common::Point(160, 30);
- _colour1 = 35;
- _textMode = ALIGN_CENTRE;
+ _color1 = 35;
+ _textMode = ALIGN_CENTER;
}
void SpeakerQL::setText(const Common::String &msg) {
@@ -638,8 +653,8 @@ SpeakerSR::SpeakerSR() {
_speakerName = "SR";
_newSceneNumber = 2811;
_textPos = Common::Point(10, 30);
- _colour1 = 13;
- _textMode = ALIGN_CENTRE;
+ _color1 = 13;
+ _textMode = ALIGN_CENTER;
}
void SpeakerSR::setText(const Common::String &msg) {
@@ -679,8 +694,8 @@ SpeakerSL::SpeakerSL() {
_newSceneNumber = 2810;
_textPos = Common::Point(140, 30);
_textWidth = 160;
- _colour1 = 13;
- _textMode = ALIGN_CENTRE;
+ _color1 = 13;
+ _textMode = ALIGN_CENTER;
}
void SpeakerSL::setText(const Common::String &msg) {
@@ -711,8 +726,8 @@ SpeakerQR::SpeakerQR() {
_speakerName = "QR";
_newSceneNumber = 2611;
_textPos = Common::Point(10, 30);
- _colour1 = 13;
- _textMode = ALIGN_CENTRE;
+ _color1 = 13;
+ _textMode = ALIGN_CENTER;
}
void SpeakerQR::setText(const Common::String &msg) {
@@ -743,8 +758,8 @@ SpeakerQU::SpeakerQU() {
_speakerName = "QU";
_newSceneNumber = 7020;
_textPos = Common::Point(160, 30);
- _colour1 = 35;
- _textMode = ALIGN_CENTRE;
+ _color1 = 35;
+ _textMode = ALIGN_CENTER;
}
void SpeakerQU::setText(const Common::String &msg) {
@@ -775,7 +790,7 @@ SpeakerCR::SpeakerCR() {
_speakerName = "CR";
_newSceneNumber = 9010;
_textPos = Common::Point(20, 40);
- _colour1 = 4;
+ _color1 = 4;
}
void SpeakerCR::setText(const Common::String &msg) {
@@ -802,7 +817,7 @@ SpeakerMR::SpeakerMR() {
_speakerName = "MR";
_newSceneNumber = 2711;
_textPos = Common::Point(40, 10);
- _colour1 = 22;
+ _color1 = 22;
}
void SpeakerMR::setText(const Common::String &msg) {
@@ -832,8 +847,8 @@ SpeakerSAL::SpeakerSAL() {
_speakerName = "SAL";
_newSceneNumber = 2851;
_textPos = Common::Point(10, 30);
- _colour1 = 13;
- _textMode = ALIGN_CENTRE;
+ _color1 = 13;
+ _textMode = ALIGN_CENTER;
}
void SpeakerSAL::setText(const Common::String &msg) {
@@ -863,7 +878,7 @@ SpeakerML::SpeakerML() {
_speakerName = "ML";
_newSceneNumber = 2710;
_textPos = Common::Point(160, 40);
- _colour1 = 22;
+ _color1 = 22;
}
void SpeakerML::setText(const Common::String &msg) {
@@ -893,7 +908,7 @@ SpeakerCHFL::SpeakerCHFL() {
_speakerName = "CHFL";
_newSceneNumber = 4111;
_textPos = Common::Point(10, 40);
- _colour1 = 56;
+ _color1 = 56;
}
void SpeakerCHFL::setText(const Common::String &msg) {
@@ -923,7 +938,7 @@ SpeakerCHFR::SpeakerCHFR() {
_speakerName = "CHFR";
_newSceneNumber = 4110;
_textPos = Common::Point(160, 40);
- _colour1 = 56;
+ _color1 = 56;
}
void SpeakerCHFR::setText(const Common::String &msg) {
@@ -953,7 +968,7 @@ SpeakerPL::SpeakerPL() {
_speakerName = "PL";
_newSceneNumber = 4060;
_textPos = Common::Point(160, 40);
- _colour1 = 5;
+ _color1 = 5;
}
void SpeakerPL::setText(const Common::String &msg) {
@@ -996,7 +1011,7 @@ SpeakerPR::SpeakerPR() {
_speakerName = "PR";
_newSceneNumber = 4061;
_textPos = Common::Point(10, 40);
- _colour1 = 5;
+ _color1 = 5;
}
void SpeakerPR::setText(const Common::String &msg) {
@@ -1041,7 +1056,7 @@ SpeakerCDR::SpeakerCDR() {
_speakerName = "CDR";
_newSceneNumber = 4161;
_textPos = Common::Point(10, 40);
- _colour1 = 52;
+ _color1 = 52;
}
void SpeakerCDR::setText(const Common::String &msg) {
@@ -1072,7 +1087,7 @@ SpeakerCDL::SpeakerCDL() {
_speakerName = "CDL";
_newSceneNumber = 4160;
_textPos = Common::Point(160, 40);
- _colour1 = 52;
+ _color1 = 52;
}
void SpeakerCDL::setText(const Common::String &msg) {
@@ -1103,7 +1118,7 @@ SpeakerFLL::SpeakerFLL() {
_speakerName = "FLL";
_newSceneNumber = 5221;
_textPos = Common::Point(10, 40);
- _colour1 = 17;
+ _color1 = 17;
}
void SpeakerFLL::setText(const Common::String &msg) {
@@ -1134,7 +1149,7 @@ SpeakerBatR::SpeakerBatR() {
_speakerName = "BATR";
_newSceneNumber = 5360;
_textPos = Common::Point(140, 40);
- _colour1 = 3;
+ _color1 = 3;
}
void SpeakerBatR::setText(const Common::String &msg) {
diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp
index c78bc12d94..c8d10e1708 100644
--- a/engines/tsage/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld_scenes1.cpp
@@ -48,7 +48,7 @@ void Scene10::Action1::signal() {
break;
case 2:
scene->_speakerSText.setTextPos(Common::Point(20, 20));
- scene->_speakerSText._colour1 = 10;
+ scene->_speakerSText._color1 = 10;
scene->_speakerSText._textWidth = 160;
scene->_stripManager.start(11, this, scene);
break;
@@ -138,10 +138,10 @@ void Scene10::postInit(SceneObjectList *OwnerList) {
_speakerSText._hideObjects = false;
_speakerQText._hideObjects = false;
_speakerQText.setTextPos(Common::Point(140, 120));
- _speakerQText._colour1 = 4;
+ _speakerQText._color1 = 4;
_speakerQText._textWidth = 160;
_speakerSText.setTextPos(Common::Point(20, 20));
- _speakerSText._colour1 = 7;
+ _speakerSText._color1 = 7;
_speakerSText._textWidth = 320;
_stripManager.setCallback(this);
@@ -221,12 +221,12 @@ void Scene15::Action1::signal() {
setDelay(60);
break;
case 1:
- SceneItem::display(15, 0, SET_Y, 20, SET_FONT, 2, SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 7,
+ SceneItem::display(15, 0, SET_Y, 20, SET_FONT, 2, SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 7,
SET_WIDTH, 320, SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(300);
break;
case 2: {
- SceneItem::display(15, 1, SET_Y, 20, SET_FONT, 2, SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 7,
+ SceneItem::display(15, 1, SET_Y, 20, SET_FONT, 2, SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 7,
SET_WIDTH, 320, SET_KEEP_ONSCREEN, 1, LIST_END);
scene->_object1.postInit();
scene->_object1.setVisage(15);
@@ -300,7 +300,7 @@ void Scene20::Action2::signal() {
break;
case 1:
SceneItem::display(20, 1, SET_WIDTH, 200, SET_Y, 20, SET_X, 160, SET_KEEP_ONSCREEN, true,
- SET_EXT_BGCOLOUR, 4, LIST_END);
+ SET_EXT_BGCOLOR, 4, LIST_END);
setDelay(120);
break;
case 2: {
@@ -533,6 +533,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_speakerQText._npc = &_globals->_player;
if (_globals->_sceneManager._previousScene == 30) {
+ // Cut scene: Assassins are coming
_globals->_player.postInit();
_globals->_player.setVisage(20);
_globals->_player.setPosition(Common::Point(405, 69));
@@ -558,23 +559,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_sceneBounds = Rect(320, 0, 640, 200);
} else if (_globals->_sceneManager._previousScene == 60) {
- _globals->_player.postInit();
- _globals->_player.setVisage(2640);
- _globals->_player.animate(ANIM_MODE_NONE, NULL);
- _globals->_player.setStrip2(1);
- _globals->_player.setFrame2(4);
- _globals->_player.setPriority2(200);
- _globals->_player.setPosition(Common::Point(425, 233));
-
- setAction(&_action1);
- _speakerQText.setTextPos(Common::Point(350, 20));
- _speakerQText._textWidth = 260;
- _speakerGameText.setTextPos(Common::Point(350, 20));
- _speakerGameText._textWidth = 260;
-
- _globals->_soundHandler.startSound(8);
- _sceneBounds = Rect(320, 0, 640, 200);
- } else {
+ // Evasion
_sound.startSound(30);
_globals->_player.postInit();
_globals->_player.setVisage(20);
@@ -590,22 +575,41 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_sceneObject3.postInit();
_sceneObject3.setVisage(20);
- _sceneObject3.setStrip(2);
- _SceneObjectExt.setPosition(Common::Point(595, 79));
- _SceneObjectExt.animate(ANIM_MODE_1, NULL);
+ _sceneObject3.setStrip2(2);
+ _sceneObject3.setPosition(Common::Point(595, 79));
+ _sceneObject3.animate(ANIM_MODE_1, NULL);
if ((_globals->getFlag(120) && _globals->getFlag(116)) ||
(_globals->getFlag(117) && _globals->getFlag(119))) {
+ // Successful evasion
setAction(&_action3);
} else if (_globals->getFlag(104)) {
_sceneMode = 21;
setAction(&_sequenceManager, this, 21, &_globals->_player, &_SceneObjectExt, NULL);
} else {
+ // Failed evasion
_sceneObject3._moveDiff = Common::Point(8, 8);
setAction(&_action4);
}
+ _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y);
+ } else {
+ // Intro: Quinn looking at the monaster
+ _globals->_player.postInit();
+ _globals->_player.setVisage(2640);
+ _globals->_player.animate(ANIM_MODE_NONE, NULL);
+ _globals->_player.setStrip2(1);
+ _globals->_player.setFrame2(4);
+ _globals->_player.setPriority2(200);
+ _globals->_player.setPosition(Common::Point(425, 233));
- _sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y);
+ setAction(&_action1);
+ _speakerQText.setTextPos(Common::Point(350, 20));
+ _speakerQText._textWidth = 260;
+ _speakerGameText.setTextPos(Common::Point(350, 20));
+ _speakerGameText._textWidth = 260;
+
+ _globals->_soundHandler.startSound(8);
+ _sceneBounds = Rect(320, 0, 640, 200);
}
_globals->_player.disableControl();
@@ -624,9 +628,9 @@ void Scene20::signal() {
void Scene30::BeamObject::doAction(int action) {
if (action == OBJECT_SCANNER)
- display(30, 14, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display2(30, 14);
else if (action == CURSOR_LOOK)
- display(30, 2, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display2(30, 2);
else if (action == CURSOR_USE) {
Scene30 *parent = (Scene30 *)_globals->_sceneManager._scene;
parent->setAction(&parent->_beamAction);
@@ -636,11 +640,11 @@ void Scene30::BeamObject::doAction(int action) {
void Scene30::DoorObject::doAction(int action) {
if (action == OBJECT_SCANNER)
- display(30, 13, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display2(30, 13);
else if (action == CURSOR_LOOK)
- display(30, 1, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display2(30, 1);
else if (action == CURSOR_USE)
- display(30, 7, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ display2(30, 7);
else
SceneObject::doAction(action);
}
@@ -1000,7 +1004,8 @@ void Scene40::Action1::signal() {
break;
case 9: {
scene->_dyingKzin.setStrip(1);
- scene->_dyingKzin.setFrame(1);
+ //Workaround: The original uses setFrame(1) but it's completely wrong.
+ scene->_dyingKzin.setFrame(2);
scene->_dyingKzin._moveDiff.y = 15;
scene->_dyingKzin.animate(ANIM_MODE_5, NULL);
Common::Point pt(223, 186);
@@ -1203,7 +1208,7 @@ void Scene40::Action5::signal() {
switch (_actionIndex++) {
case 0:
- setDelay(_globals->_randomSource.getRandomNumber(120));
+ setDelay(_globals->_randomSource.getRandomNumber(119) + 120);
break;
case 1:
scene->_object2.animate(ANIM_MODE_8, 1, this);
@@ -1219,12 +1224,13 @@ void Scene40::Action6::signal() {
scene->_object1.postInit();
scene->_object1.setVisage(16);
scene->_object1.setStrip2(6);
+ scene->_object1._moveDiff = Common::Point(40, 40);
scene->_object1.setPosition(Common::Point(313, 53));
scene->_object1._field7A = 60;
Common::Point pt(141, 194);
NpcMover *mover = new NpcMover();
- scene->_object1.addMover(mover, &pt, this);
+ scene->_object1.addMover(mover, &pt, NULL);
scene->_object1.animate(ANIM_MODE_5, NULL);
scene->_doorway.postInit();
@@ -1252,6 +1258,7 @@ void Scene40::Action7::signal() {
switch (_actionIndex++) {
case 0:
+ // TODO: check if it's rand(500) or rand(499)+500
setDelay(_globals->_randomSource.getRandomNumber(500));
break;
case 1:
@@ -1265,6 +1272,8 @@ void Scene40::Action7::signal() {
scene->_object7.setPosition(Common::Point(305, 61));
scene->_object7.setFrame(15);
}
+ scene->_object7.animate(ANIM_MODE_5, this);
+ scene->_soundHandler.startSound(25);
break;
case 2:
scene->_object7.remove();
@@ -1330,11 +1339,11 @@ void Scene40::Action8::signal() {
void Scene40::DyingKzin::doAction(int action) {
switch (action) {
case OBJECT_STUNNER:
- SceneItem::display2(40, 43);
- break;
- case CURSOR_CROSSHAIRS:
SceneItem::display2(40, 44);
break;
+ case OBJECT_SCANNER:
+ SceneItem::display2(40, 43);
+ break;
case CURSOR_LOOK:
SceneItem::display2(40, 12);
break;
@@ -1351,7 +1360,7 @@ void Scene40::Assassin::doAction(int action) {
Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene;
switch (action) {
- case CURSOR_CROSSHAIRS:
+ case OBJECT_STUNNER:
if (scene->_assassin._visage == 44)
SceneItem::display2(40, 21);
else {
@@ -1359,6 +1368,7 @@ void Scene40::Assassin::doAction(int action) {
Common::Point pt(230, 187);
NpcMover *mover = new NpcMover();
addMover(mover, &pt, NULL);
+ scene->setAction(&scene->_action2);
}
break;
case OBJECT_SCANNER:
@@ -1393,7 +1403,7 @@ void Scene40::Assassin::doAction(int action) {
void Scene40::Item2::doAction(int action) {
switch (action) {
- case CURSOR_CROSSHAIRS:
+ case OBJECT_STUNNER:
SceneItem::display2(40, 35);
_globals->_events.setCursor(CURSOR_WALK);
break;
@@ -1417,7 +1427,7 @@ void Scene40::Item2::doAction(int action) {
void Scene40::Item6::doAction(int action) {
switch (action) {
- case CURSOR_CROSSHAIRS:
+ case OBJECT_STUNNER:
SceneItem::display2(40, 25);
_globals->_events.setCursor(CURSOR_WALK);
break;
@@ -1439,12 +1449,12 @@ void Scene40::Item6::doAction(int action) {
/*--------------------------------------------------------------------------*/
Scene40::Scene40() :
- _item1(2, OBJECT_SCANNER, 40, 24, CURSOR_CROSSHAIRS, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END),
- _item3(5, OBJECT_SCANNER, 40, 26, CURSOR_CROSSHAIRS, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END),
- _item4(6, OBJECT_SCANNER, 40, 31, CURSOR_CROSSHAIRS, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END),
+ _item1(2, OBJECT_SCANNER, 40, 24, OBJECT_STUNNER, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END),
+ _item3(5, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END),
+ _item4(6, OBJECT_SCANNER, 40, 31, OBJECT_STUNNER, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END),
_item5(0, CURSOR_LOOK, 40, 11, LIST_END),
- _item7(4, OBJECT_SCANNER, 40, 26, CURSOR_CROSSHAIRS, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END),
- _item8(8, OBJECT_SCANNER, 40, 39, CURSOR_CROSSHAIRS, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) {
+ _item7(4, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END),
+ _item8(8, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) {
}
void Scene40::postInit(SceneObjectList *OwnerList) {
@@ -1460,7 +1470,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) {
_stripManager.addSpeaker(&_speakerSText);
_stripManager.addSpeaker(&_speakerGameText);
- _speakerGameText._colour1 = 9;
+ _speakerGameText._color1 = 9;
_speakerGameText.setTextPos(Common::Point(160, 30));
_speakerQText._npc = &_globals->_player;
_speakerSText._npc = &_object1;
@@ -1871,7 +1881,7 @@ void Scene60::Action1::signal() {
scene->_object10.animate(ANIM_MODE_8, 0, NULL);
scene->_object10._numFrames = 5;
- scene->_object6.animate(ANIM_MODE_2, NULL);
+ scene->_controlButton.animate(ANIM_MODE_2, NULL);
if (!_globals->getFlag(83)) {
scene->_object5.postInit();
@@ -1896,9 +1906,9 @@ void Scene60::Action1::signal() {
if (_globals->_sceneObjects->contains(&scene->_object10))
scene->_object10.remove();
- scene->_object6.remove();
+ scene->_controlButton.remove();
scene->_slaveButton.remove();
- scene->_object8.remove();
+ scene->_masterButton.remove();
scene->_item1.remove();
scene->_item2.remove();
@@ -1936,7 +1946,7 @@ void Scene60::Action1::signal() {
case 6:
case 7:
SceneItem::display(60, _actionIndex - 4, SET_Y, 40, SET_X, 25, SET_FONT, 75,
- SET_EXT_BGCOLOUR, -1, SET_FG_COLOUR, 34, SET_POS_MODE, 0,
+ SET_EXT_BGCOLOR, -1, SET_FG_COLOR, 34, SET_POS_MODE, 0,
SET_WIDTH, 280, SET_KEEP_ONSCREEN, 1, LIST_END);
_globals->_events.setCursor(CURSOR_USE);
break;
@@ -1947,8 +1957,8 @@ void Scene60::Action1::signal() {
if (_globals->_sceneObjects->contains(&scene->_object5))
scene->_object5.remove();
- scene->_object6.animate(ANIM_MODE_NONE);
- scene->_object6.setFrame(1);
+ scene->_controlButton.animate(ANIM_MODE_NONE);
+ scene->_controlButton.setFrame(1);
scene->_object10.remove();
scene->_object9.postInit();
@@ -1961,8 +1971,8 @@ void Scene60::Action1::signal() {
scene->_soundHandler1.startSound(35);
scene->_soundHandler3.proc3();
- scene->_object8.setFrame(1);
- scene->_object8._state = 0;
+ scene->_masterButton.setFrame(1);
+ scene->_masterButton._state = 0;
_globals->clearFlag(103);
_globals->clearFlag(!_globals->_stripNum ? 116 : 119);
@@ -1975,6 +1985,7 @@ void Scene60::Action1::signal() {
scene->_object9.remove();
remove();
break;
+ case 8:
default:
break;
}
@@ -2050,21 +2061,22 @@ void Scene60::Object4::doAction(int action) {
SceneItem::display(0, 0);
scene->loadScene(60);
- scene->_object6.setVisage(60);
- scene->_object6.setPosition(Common::Point(233, 143));
- scene->_object6.animate(ANIM_MODE_2, NULL);
+ scene->_controlButton.postInit();
+ scene->_controlButton.setVisage(60);
+ scene->_controlButton.setPosition(Common::Point(233, 143));
+ scene->_controlButton.animate(ANIM_MODE_2, NULL);
scene->_slaveButton.postInit();
scene->_slaveButton.setVisage(60);
scene->_slaveButton.setStrip(8);
scene->_slaveButton.setPosition(Common::Point(143, 125));
- scene->_object8.postInit();
- scene->_object8.setVisage(60);
- scene->_object8.setStrip(8);
- scene->_object8.setPosition(Common::Point(143, 105));
+ scene->_masterButton.postInit();
+ scene->_masterButton.setVisage(60);
+ scene->_masterButton.setStrip(8);
+ scene->_masterButton.setPosition(Common::Point(143, 105));
- _globals->_sceneItems.push_front(&scene->_object8);
+ _globals->_sceneItems.push_front(&scene->_masterButton);
_globals->_sceneItems.push_front(&scene->_slaveButton);
scene->_object10.postInit();
@@ -2076,13 +2088,13 @@ void Scene60::Object4::doAction(int action) {
if (scene->_slaveButton._state)
scene->_slaveButton.setFrame(2);
- if (scene->_object8._state)
- scene->_object8.setFrame(2);
+ if (scene->_masterButton._state)
+ scene->_masterButton.setFrame(2);
_globals->_sceneItems.push_front(&scene->_item1);
- _globals->_sceneItems.push_front(&scene->_object6);
+ _globals->_sceneItems.push_front(&scene->_controlButton);
_globals->_sceneItems.push_front(&scene->_slaveButton);
- _globals->_sceneItems.push_front(&scene->_object8);
+ _globals->_sceneItems.push_front(&scene->_masterButton);
_globals->_sceneItems.push_back(&scene->_item2);
_globals->gfxManager()._font.setFontNumber(2);
@@ -2110,7 +2122,7 @@ void Scene60::Object5::doAction(int action) {
}
}
-void Scene60::Object6::doAction(int action) {
+void Scene60::ControlObject::doAction(int action) {
Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
@@ -2137,7 +2149,7 @@ void Scene60::SlaveObject::doAction(int action) {
if (action == CURSOR_LOOK) {
SceneItem::display2(60, 8);
} else if (action == CURSOR_USE) {
- if (scene->_object8._state)
+ if (scene->_masterButton._state)
scene->_sceneMode = 19;
else if (_state) {
scene->_soundHandler3.proc3();
@@ -2161,20 +2173,22 @@ void Scene60::SlaveObject::doAction(int action) {
}
}
-void Scene60::Object8::doAction(int action) {
+void Scene60::MasterObject::doAction(int action) {
Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
SceneItem::display2(60, 7);
} else if (action == CURSOR_USE) {
- if (!scene->_object8._state)
+ if (!scene->_controlButton._animateMode)
scene->_sceneMode = 14;
+ else if (scene->_slaveButton._state)
+ scene->_sceneMode = 20;
else if (_state) {
scene->_soundHandler3.proc3();
animate(ANIM_MODE_6, NULL);
+ _state = 0;
_globals->clearFlag(103);
_globals->clearFlag(!_globals->_stripNum ? 116 : 119);
- _state = 0;
scene->_sceneMode = 9998;
} else {
scene->_soundHandler3.startSound(39);
@@ -2287,20 +2301,20 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_slaveButton.setPosition(Common::Point(143, 125));
_slaveButton._state = 0;
- _object8.postInit();
- _object8.setVisage(60);
- _object8.setStrip(8);
- _object8.setPosition(Common::Point(143, 105));
- _object8._state = 0;
+ _masterButton.postInit();
+ _masterButton.setVisage(60);
+ _masterButton.setStrip(8);
+ _masterButton.setPosition(Common::Point(143, 105));
+ _masterButton._state = 0;
- _globals->_sceneItems.push_back(&_object8);
+ _globals->_sceneItems.push_back(&_masterButton);
_globals->_sceneItems.push_back(&_slaveButton);
- _object6.postInit();
- _object6.setVisage(60);
- _object6.setStrip(5);
- _object6.setPosition(Common::Point(233, 143));
- _globals->_sceneItems.push_back(&_object6);
+ _controlButton.postInit();
+ _controlButton.setVisage(60);
+ _controlButton.setStrip(5);
+ _controlButton.setPosition(Common::Point(233, 143));
+ _globals->_sceneItems.push_back(&_controlButton);
if (_globals->_stripNum == -1) {
_globals->_stripNum = 0;
@@ -2320,12 +2334,12 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
}
if (_globals->getFlag(116)) {
- _object8._state = 1;
- _object8.setFrame(2);
+ _masterButton._state = 1;
+ _masterButton.setFrame(2);
}
if (_globals->getFlag(118)) {
- _object6.animate(ANIM_MODE_2, NULL);
+ _controlButton.animate(ANIM_MODE_2, NULL);
_object10.postInit();
_object10.setVisage(60);
@@ -2354,12 +2368,12 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
}
if (_globals->getFlag(119)) {
- _object8._state = 1;
- _object8.setFrame(2);
+ _masterButton._state = 1;
+ _masterButton.setFrame(2);
}
if (_globals->getFlag(121)) {
- _object6.animate(ANIM_MODE_2, NULL);
+ _controlButton.animate(ANIM_MODE_2, NULL);
_object10.postInit();
_object10.setVisage(60);
@@ -2397,7 +2411,7 @@ void Scene60::signal() {
_globals->_events.setCursor(CURSOR_USE);
_gfxButton.setText(EXIT_MSG);
- _gfxButton._bounds.centre(160, 193);
+ _gfxButton._bounds.center(160, 193);
_gfxButton.draw();
_gfxButton._bounds.expandPanes();
} else {
@@ -2497,7 +2511,7 @@ void Scene90::Action1::signal() {
scene->_object3.animate(ANIM_MODE_6, NULL);
SceneItem::display(90, _globals->getFlag(104) ? 15 : 14,
- SET_EXT_BGCOLOUR, 13, SET_KEEP_ONSCREEN, -1, SET_X, 120, SET_Y, 20, LIST_END);
+ SET_EXT_BGCOLOR, 13, SET_KEEP_ONSCREEN, -1, SET_X, 120, SET_Y, 20, LIST_END);
break;
case 12:
SceneItem::display(0, 0);
@@ -2690,7 +2704,7 @@ void Scene95::Action1::signal() {
case 1:
if (_state) {
SceneItem::display(95, _state % 2, SET_FONT, 2,
- SET_EXT_BGCOLOUR, -1, SET_EXT_BGCOLOUR, 20,
+ SET_EXT_BGCOLOR, -1, SET_EXT_BGCOLOR, 20,
SET_WIDTH, 200, SET_KEEP_ONSCREEN, 1, SET_TEXT_MODE, 1, LIST_END);
--_state;
_actionIndex = 1;
@@ -2724,7 +2738,7 @@ void Scene95::Action1::signal() {
scene->_object1.addMover(mover2, &pt2, NULL);
SceneItem::display(95, 2, SET_Y, 45, SET_FONT, 2,
- SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 13, SET_WIDTH, 200,
+ SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 13, SET_WIDTH, 200,
SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(240);
break;
@@ -2733,13 +2747,13 @@ void Scene95::Action1::signal() {
scene->_object3.remove();
SceneItem::display(95, 3, SET_Y, 45, SET_FONT, 2,
- SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 35, SET_WIDTH, 200,
+ SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 35, SET_WIDTH, 200,
SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(240);
break;
case 5:
SceneItem::display(95, 4, SET_Y, 45, SET_FONT, 2,
- SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 35, SET_WIDTH, 200,
+ SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 35, SET_WIDTH, 200,
SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(240);
break;
@@ -3254,7 +3268,7 @@ void Scene6100::dispatch() {
_sceneText.setPosition(Common::Point(24, 160));
_sceneText._fontNumber = 0;
- _sceneText._colour1 = 35;
+ _sceneText._color1 = 35;
_sceneText.setup(s);
}
@@ -3267,7 +3281,7 @@ void Scene6100::dispatch() {
}
}
-void Scene6100::showMessage(const Common::String &msg, int colour, Action *action) {
+void Scene6100::showMessage(const Common::String &msg, int color, Action *action) {
if (_msgActive) {
_msgActive = false;
_speaker1.removeText();
@@ -3277,7 +3291,7 @@ void Scene6100::showMessage(const Common::String &msg, int colour, Action *actio
_msgActive = true;
_speaker1._textPos.x = 20;
_speaker1._textWidth = 280;
- _speaker1._colour1 = colour;
+ _speaker1._color1 = color;
_speaker1._action = action;
_speaker1.setText(msg);
}
diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h
index 66f7282684..4862bedfe0 100644
--- a/engines/tsage/ringworld_scenes1.h
+++ b/engines/tsage/ringworld_scenes1.h
@@ -339,7 +339,7 @@ class Scene60 : public Scene {
public:
virtual void doAction(int action);
};
- class Object6 : public SceneObject {
+ class ControlObject : public SceneObject {
public:
virtual void doAction(int action);
};
@@ -347,7 +347,7 @@ class Scene60 : public Scene {
public:
virtual void doAction(int action);
};
- class Object8 : public SceneObjectExt {
+ class MasterObject : public SceneObjectExt {
public:
virtual void doAction(int action);
};
@@ -383,9 +383,9 @@ public:
Object3 _object3;
Object4 _object4;
Object5 _object5;
- Object6 _object6;
+ ControlObject _controlButton;
SlaveObject _slaveButton;
- Object8 _object8;
+ MasterObject _masterButton;
Object9 _object9;
SceneObject _object10;
Item1 _item1;
@@ -527,7 +527,7 @@ public:
virtual void remove();
virtual void process(Event &event);
virtual void dispatch();
- void showMessage(const Common::String &msg, int colour, Action *action);
+ void showMessage(const Common::String &msg, int color, Action *action);
};
diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp
index 7b3d00d637..4d413a09fb 100644
--- a/engines/tsage/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld_scenes10.cpp
@@ -155,7 +155,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) {
_sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46);
_sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48);
- _globals->_soundHandler.startSound(251, 0, 127);
+ _globals->_soundHandler.startSound(251);
if (_globals->_sceneManager._previousScene == 9150) {
if (_globals->getFlag(20)) {
_globals->_player.disableControl();
@@ -240,7 +240,7 @@ void Scene9150::dispatch() {
} else {
_globals->_player.disableControl();
if (_globals->getFlag(11)) {
- _globals->_soundHandler.startSound(286, 0, 127);
+ _globals->_soundHandler.startSound(286);
_sceneMode = 9153;
} else {
_sceneMode = 9156;
@@ -274,7 +274,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) {
_sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1);
_sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59);
- _globals->_soundHandler.startSound(285, 0, 127);
+ _globals->_soundHandler.startSound(285);
_globals->_player.disableControl();
if (_globals->getFlag(20)) {
@@ -406,7 +406,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_2, 0);
_object1.setPosition(Common::Point(132, 114), 0);
_object1.setPriority2(140);
- _soundHandler.startSound(297, 0, 127);
+ _soundHandler.startSound(297);
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerGR);
_stripManager.addSpeaker(&_speakerGText);
@@ -479,7 +479,7 @@ void Scene9300::signal() {
_globals->setFlag(84);
// No break on purpose
case 9303:
- _globals->_soundHandler.startSound(295, 0, 127);
+ _globals->_soundHandler.startSound(295);
_globals->_sceneManager.changeScene(9350);
break;
case 9302:
@@ -509,7 +509,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) {
_globals->_player.changeZoom(-1);
_object1.postInit();
_object2.postInit();
- _globals->_soundHandler.startSound(289, 0, 127);
+ _globals->_soundHandler.startSound(289);
_hotspot1.setup(35, 142, 76, 212, 9300, 0, 1);
_hotspot2.setup(28, 90, 81, 143, 9300, 2, 3);
@@ -763,7 +763,7 @@ void Scene9400::signal() {
void Scene9400::dispatch() {
if ((_object1._animateMode == 2) && (_object1._strip == 1) && (_object1._frame == 4)){
if (_field1032 == 0) {
- _soundHandler.startSound(296, 0, 127);
+ _soundHandler.startSound(296);
_field1032 = 1;
}
} else {
@@ -859,13 +859,13 @@ void Scene9450::Hotspot3::doAction(int action) {
setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, 0);
break;
case OBJECT_TUNIC:
- SceneItem::display(9450, 49, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9450, 49, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_WALK:
// nothing
break;
case CURSOR_LOOK:
- SceneItem::display(9450, 41, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9450, 41, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
case CURSOR_TALK:
@@ -876,7 +876,7 @@ void Scene9450::Hotspot3::doAction(int action) {
_globals->_player.disableControl();
setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0);
} else if ((_globals->_inventory._cloak._sceneNumber != 1) && (_globals->_inventory._jacket._sceneNumber != 1) && (_globals->_inventory._tunic2._sceneNumber != 1)) {
- SceneItem::display(9450, 38, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9450, 38, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
scene->_sceneMode = 9460;
_globals->_player.disableControl();
@@ -884,7 +884,7 @@ void Scene9450::Hotspot3::doAction(int action) {
}
break;
default:
- SceneItem::display(9450, 45, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9450, 45, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
}
}
@@ -1072,7 +1072,7 @@ void Scene9500::signal() {
switch (_sceneMode) {
case 9503:
_globals->_sceneManager.changeScene(9200);
- _globals->_soundHandler.startSound(295, 0, 127);
+ _globals->_soundHandler.startSound(295);
break;
case 9504:
_globals->_sceneManager.changeScene(9850);
@@ -1128,7 +1128,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) {
setZoomPercents(110, 75, 200, 150);
_globals->_player.postInit();
- _globals->_soundHandler.startSound(305, 0, 127);
+ _globals->_soundHandler.startSound(305);
_candle.postInit(0);
_candle.setVisage(9500);
@@ -1228,7 +1228,7 @@ void Scene9700::signal() {
case 9701:
case 9702:
_gfxButton1.setText(EXIT_MSG);
- _gfxButton1._bounds.centre(50, 190);
+ _gfxButton1._bounds.center(50, 190);
_gfxButton1.draw();
_gfxButton1._bounds.expandPanes();
_globals->_player.enableControl();
@@ -1236,7 +1236,7 @@ void Scene9700::signal() {
_globals->_events.setCursor(CURSOR_USE);
break;
case 9704:
- _globals->_soundHandler.startSound(323, 0, 127);
+ _globals->_soundHandler.startSound(323);
_globals->_sceneManager.changeScene(9750);
break;
}
@@ -1330,7 +1330,7 @@ void Scene9750::postInit(SceneObjectList *OwnerList) {
void Scene9850::Object6::doAction(int action) {
if ((_flags & OBJFLAG_HIDE) == 0) {
if (action == CURSOR_LOOK) {
- SceneItem::display(9850, 27, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 27, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
_globals->_inventory._scimitar._sceneNumber = 1;
hide();
@@ -1342,7 +1342,7 @@ void Scene9850::Object6::doAction(int action) {
void Scene9850::Object7::doAction(int action) {
if ((_flags & OBJFLAG_HIDE) == 0) {
if (action == CURSOR_LOOK) {
- SceneItem::display(9850, 28, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 28, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
_globals->_inventory._sword._sceneNumber = 1;
hide();
@@ -1371,7 +1371,7 @@ void Scene9850::Hotspot12::doAction(int action) {
} else if ((action != CURSOR_LOOK) || (_globals->_inventory._tunic2._sceneNumber != 1)) {
NamedHotspot::doAction(action);
} else {
- SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
}
@@ -1393,7 +1393,7 @@ void Scene9850::Hotspot14::doAction(int action) {
} else if ((action != CURSOR_LOOK) || (_globals->_inventory._jacket._sceneNumber != 1)) {
NamedHotspot::doAction(action);
} else {
- SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
}
@@ -1415,7 +1415,7 @@ void Scene9850::Hotspot16::doAction(int action) {
} else if ((action != CURSOR_LOOK) || (_globals->_inventory._cloak._sceneNumber != 1)) {
NamedHotspot::doAction(action);
} else {
- SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
}
@@ -1423,10 +1423,10 @@ void Scene9850::Hotspot17::doAction(int action) {
Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene;
if (action == OBJECT_SCANNER) {
- SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306, 0, 127);
+ scene->_soundHandler.startSound(306);
NamedHotspot::doAction(action);
}
}
@@ -1435,10 +1435,10 @@ void Scene9850::Hotspot18::doAction(int action) {
Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene;
if (action == OBJECT_SCANNER) {
- SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306, 0, 127);
+ scene->_soundHandler.startSound(306);
NamedHotspot::doAction(action);
}
}
@@ -1447,10 +1447,10 @@ void Scene9850::Hotspot19::doAction(int action) {
Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene;
if (action == OBJECT_SCANNER) {
- SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(313, 0, 127);
+ scene->_soundHandler.startSound(313);
NamedHotspot::doAction(action);
}
}
@@ -1632,15 +1632,14 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
*
*--------------------------------------------------------------------------*/
void Scene9900::strAction1::signal() {
- RGB8 mask1, mask2;
- mask1.r = mask1.g = mask1.b = 0xff;
- mask2.r = mask2.g = mask2.b = 0;
+ const byte mask1[3] = {0xff, 0xff, 0xff};
+ const byte mask2[3] = {0, 0, 0};
Scene9900 *scene = (Scene9900 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
case 0:
- scene->_soundHandler.startSound(351, 0, 127);
+ scene->_soundHandler.startSound(351);
_object9.postInit();
_object9.setVisage(18);
_object9._frame = 1;
@@ -1652,18 +1651,18 @@ void Scene9900::strAction1::signal() {
break;
case 1:
_palette1.getPalette();
- _globals->_scenePalette.addUnkPal(&mask1, 1, true /*10*/, this);
+ _globals->_scenePalette.addFader(&mask1[0], 1, 10, this);
break;
case 2:
_object9.remove();
- _globals->_scenePalette.addUnkPal(&mask2, 1, true /*5*/, this);
+ _globals->_scenePalette.addFader(&mask2[0], 1, 5, this);
break;
case 3:
- _globals->_soundHandler.startSound(377, 0, 127);
+ _globals->_soundHandler.startSound(377);
setDelay(120);
break;
case 4:
- _globals->_scenePalette.addUnkPal(_palette1._palette, 256, 1, this);
+ _globals->_scenePalette.addFader(_palette1._palette, 256, 1, this);
break;
case 5:
remove();
@@ -1702,10 +1701,10 @@ void Scene9900::strAction2::signal() {
_txtArray1Index = (_txtArray1Index + 1) % 2;
}
_var3 = 1;
- _txtArray1[_txtArray1Index]._textMode = ALIGN_CENTRE;
+ _txtArray1[_txtArray1Index]._textMode = ALIGN_CENTER;
_txtArray1[_txtArray1Index]._width = 240;
_txtArray1[_txtArray1Index]._fontNumber = 2;
- _txtArray1[_txtArray1Index]._colour1 = 7;
+ _txtArray1[_txtArray1Index]._color1 = 7;
_txtArray1[_txtArray1Index].setup(msg);
_txtArray1[_txtArray1Index]._field7A = 20;
_txtArray1[_txtArray1Index]._moveDiff.y = 2;
@@ -1717,10 +1716,10 @@ void Scene9900::strAction2::signal() {
Common::Point pt2(_txtArray1[_txtArray1Index]._position.x, 100);
_txtArray1[_txtArray1Index].addMover(mover2, &pt2, 0);
- _txtArray2[_txtArray1Index]._textMode = ALIGN_CENTRE;
+ _txtArray2[_txtArray1Index]._textMode = ALIGN_CENTER;
_txtArray2[_txtArray1Index]._width = 240;
_txtArray2[_txtArray1Index]._fontNumber = 2;
- _txtArray2[_txtArray1Index]._colour1 = 23;
+ _txtArray2[_txtArray1Index]._color1 = 23;
msg = _vm->_dataManager->getMessage(8030, _lineNum++);
_txtArray2[_txtArray1Index].setup(msg);
@@ -1769,26 +1768,25 @@ void Scene9900::strAction2::dispatch() {
}
void Scene9900::strAction3::signal() {
- RGB8 mask3, mask4;
- mask3.r = 0xff; mask3.g = mask3.b = 0;
- mask4.r = mask4.g = mask4.b = 0;
+ const byte mask3[3] = {0xff, 0, 0};
+ const byte mask4[3] = {0, 0, 0};
switch (_actionIndex++) {
case 0:
_palette2.getPalette();
_palette3.loadPalette(2003);
- _globals->_scenePalette.addUnkPal(_palette3._palette, 256, true /*5*/, this);
+ _globals->_scenePalette.addFader(_palette3._palette, 256, 5, this);
break;
case 1:
- _globals->_scenePalette.addUnkPal(&mask3, 1, true /*10*/, this);
+ _globals->_scenePalette.addFader(&mask3[0], 1, 10, this);
break;
case 2:
- _globals->_scenePalette.addUnkPal(&mask4, 1, true /*1*/, this);
+ _globals->_scenePalette.addFader(&mask4[0], 1, 1, this);
break;
case 3:
_palette2.loadPalette(17);
_globals->_sceneManager._scene->loadScene(17);
- _globals->_scenePalette.addUnkPal(_palette2._palette, 256, true /*5*/, this);
+ _globals->_scenePalette.addFader(_palette2._palette, 256, 5, this);
break;
case 4:
_globals->_game.endGame(9900, 61);
@@ -1831,7 +1829,7 @@ void Scene9900::signal() {
switch (_sceneMode){
case 150:
- _globals->_soundHandler.startSound(380, 0, 127);
+ _globals->_soundHandler.startSound(380);
_object8.postInit(0);
_object8.setVisage(2002);
_object8.setStrip(1);
@@ -1864,7 +1862,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9904:
- _globals->_soundHandler.startSound(390, 0, 127);
+ _globals->_soundHandler.startSound(390);
_sceneMode = 9912;
setAction(&_strAction2, this);
break;
@@ -1895,7 +1893,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9909:
- _globals->_soundHandler.startSound(375, 0, 127);
+ _globals->_soundHandler.startSound(375);
_globals->_player.disableControl();
_sceneMode = 9907;
setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -1906,7 +1904,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9911:
- _globals->_soundHandler.startSound(367, 0, 127);
+ _globals->_soundHandler.startSound(367);
_globals->_player.disableControl();
_sceneMode = 9909;
setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -1999,7 +1997,7 @@ void Scene9999::Action2::signal() {
setDelay(10);
break;
case 1:
- SceneItem::display(9999, 0, SET_Y, 10, SET_X, 30, SET_FONT, 2, SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 23, SET_WIDTH, 260, SET_KEEP_ONSCREEN, 1, LIST_END);
+ SceneItem::display(9999, 0, SET_Y, 10, SET_X, 30, SET_FONT, 2, SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 23, SET_WIDTH, 260, SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(300);
break;
case 2:
@@ -2048,7 +2046,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
else
setAction(&_action1);
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
@@ -2057,7 +2055,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
else
_globals->_stripNum = 2121;
- _globals->_soundHandler.startSound(118, 0, 127);
+ _globals->_soundHandler.startSound(118);
}
diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp
index 8d95460615..9d941d3242 100644
--- a/engines/tsage/ringworld_scenes2.cpp
+++ b/engines/tsage/ringworld_scenes2.cpp
@@ -76,8 +76,8 @@ void Scene1000::Action2::signal() {
setDelay(10);
break;
case 1:
- SceneItem::display(1000, 0, SET_Y, 20, SET_FONT, 2, SET_BG_COLOUR, -1,
- SET_EXT_BGCOLOUR, 35, SET_WIDTH, 200, SET_KEEP_ONSCREEN, 1, LIST_END);
+ SceneItem::display(1000, 0, SET_Y, 20, SET_FONT, 2, SET_BG_COLOR, -1,
+ SET_EXT_BGCOLOR, 35, SET_WIDTH, 200, SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(180);
break;
case 2:
@@ -266,7 +266,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) {
setAction(&_action2);
- _globals->_sceneManager._scene->_sceneBounds.centre(_object1._position.x, _object1._position.y);
+ _globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
@@ -280,7 +280,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) {
_object1._moveDiff = Common::Point(2, 2);
_object1.setPosition(Common::Point(120, 180));
- _globals->_sceneManager._scene->_sceneBounds.centre(_object1._position.x, _object1._position.y);
+ _globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
@@ -301,7 +301,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) {
_globals->_player.hide();
_globals->_player.disableControl();
- _globals->_sceneManager._scene->_sceneBounds.centre(_object3._position.x, _object3._position.y);
+ _globals->_sceneManager._scene->_sceneBounds.center(_object3._position.x, _object3._position.y);
setAction(&_action3);
}
@@ -521,7 +521,7 @@ void Scene1001::postInit(SceneObjectList *OwnerList) {
_stripManager.addSpeaker(&_speakerCText);
_stripManager.addSpeaker(&_speakerCR);
_stripManager.addSpeaker(&_speakerSL);
- _speakerQText._colour1 = 11;
+ _speakerQText._color1 = 11;
_object3.postInit();
_object3.setVisage(16);
@@ -666,7 +666,7 @@ void Scene1400::Action1::signal() {
setDelay(5);
break;
case 1: {
- SceneItem::display(1400, 0, SET_X, 120, SET_Y, 610, SET_FONT, 2, SET_EXT_BGCOLOUR, 23, SET_KEEP_ONSCREEN, -1, LIST_END);
+ SceneItem::display(1400, 0, SET_X, 120, SET_Y, 610, SET_FONT, 2, SET_EXT_BGCOLOR, 23, SET_KEEP_ONSCREEN, -1, LIST_END);
Common::Point pt(160, 700);
NpcMover *mover = new NpcMover();
@@ -687,7 +687,7 @@ void Scene1400::Action1::signal() {
}
case 3:
SceneItem::display(1400, 2, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80,
- SET_FONT, 2, SET_FG_COLOUR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
+ SET_FONT, 2, SET_FG_COLOR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
setDelay(420);
break;
case 4:
@@ -696,7 +696,7 @@ void Scene1400::Action1::signal() {
break;
case 5:
SceneItem::display(1400, 3, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80,
- SET_FONT, 2, SET_FG_COLOUR, 23, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
+ SET_FONT, 2, SET_FG_COLOR, 23, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
setDelay(360);
break;
case 6:
@@ -722,7 +722,7 @@ void Scene1400::Action1::signal() {
_globals->_player.animate(ANIM_MODE_2, NULL);
SceneItem::display(1400, 4, SET_X, 30, SET_Y, _globals->_player._position.y + 10, SET_FONT, 2,
- SET_FG_COLOUR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
+ SET_FG_COLOR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END);
setDelay(300);
break;
case 9: {
@@ -776,7 +776,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) {
_globals->_player._moveDiff = Common::Point(4, 2);
_globals->_player.setPosition(Common::Point(160, 800));
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100;
@@ -897,7 +897,7 @@ void Scene1500::Action2::signal() {
case 3:
scene->_soundHandler.proc4();
_globals->_stripNum = 1505;
- _globals->_sceneManager.changeScene(1505);
+ _globals->_sceneManager.changeScene(2400);
break;
}
}
diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp
index b37b156907..1571f18f84 100644
--- a/engines/tsage/ringworld_scenes3.cpp
+++ b/engines/tsage/ringworld_scenes3.cpp
@@ -226,8 +226,8 @@ void Scene2000::Action10::signal() {
error("Old stuff");
break;
case 2:
- SceneItem::display(2000, 17, SET_Y, 20, SET_X, 110, SET_FONT, 2, SET_BG_COLOUR, -1,
- SET_FG_COLOUR, 17, SET_WIDTH, 200, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, 1, LIST_END);
+ SceneItem::display(2000, 17, SET_Y, 20, SET_X, 110, SET_FONT, 2, SET_BG_COLOR, -1,
+ SET_FG_COLOR, 17, SET_WIDTH, 200, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, 1, LIST_END);
break;
case 3:
SceneItem::display(0, 0);
@@ -1995,12 +1995,12 @@ void Scene2120::Action1::signal() {
break;
case 1:
// First page of index
- SceneItem::display(2120, 0, SET_X, 120, SET_FONT, 1, SET_EXT_BGCOLOUR, 7, SET_BG_COLOUR, -1,
+ SceneItem::display(2120, 0, SET_X, 120, SET_FONT, 1, SET_EXT_BGCOLOR, 7, SET_BG_COLOR, -1,
SET_WIDTH, 200, SET_KEEP_ONSCREEN, -1, SET_TEXT_MODE, 0, LIST_END);
break;
case 2:
// Second page of index
- SceneItem::display(2120, 1, SET_X, 120, SET_FONT, 1, SET_EXT_BGCOLOUR, 7, SET_BG_COLOUR, -1,
+ SceneItem::display(2120, 1, SET_X, 120, SET_FONT, 1, SET_EXT_BGCOLOR, 7, SET_BG_COLOR, -1,
SET_WIDTH, 200, SET_KEEP_ONSCREEN, -1, SET_TEXT_MODE, 0, LIST_END);
break;
case 3:
@@ -2016,7 +2016,7 @@ void Scene2120::Action1::signal() {
case 4:
// Display page of text
SceneItem::display(2121, _entries[scene->_subjectIndex]._lineNum + scene->_lineOffset,
- SET_X, 130, SET_FONT, 1, SET_EXT_BGCOLOUR, 7, SET_BG_COLOUR, -1, SET_WIDTH, 200,
+ SET_X, 130, SET_FONT, 1, SET_EXT_BGCOLOR, 7, SET_BG_COLOR, -1, SET_WIDTH, 200,
SET_KEEP_ONSCREEN, -1, SET_TEXT_MODE, 0, LIST_END);
_actionIndex = 4;
break;
@@ -2731,7 +2731,7 @@ void Scene2200::Action3::signal() {
scene->_hotspot7.setFrame(1);
scene->_hotspot7.setPosition(Common::Point(145, 165));
- SceneItem::display(60, 1, SET_Y, 40, SET_X, 25, SET_FONT, 75, SET_BG_COLOUR, -1, SET_FG_COLOUR, 34,
+ SceneItem::display(60, 1, SET_Y, 40, SET_X, 25, SET_FONT, 75, SET_BG_COLOR, -1, SET_FG_COLOR, 34,
SET_POS_MODE, 0, SET_WIDTH, 280, SET_KEEP_ONSCREEN, 1, LIST_END);
_state = 1;
setDelay(1800);
@@ -2740,7 +2740,7 @@ void Scene2200::Action3::signal() {
case 3:
case 4:
case 5:
- SceneItem::display(60, _actionIndex - 2, SET_Y, 40, SET_X, 25, SET_FONT, 75, SET_BG_COLOUR, -1, SET_FG_COLOUR, 34,
+ SceneItem::display(60, _actionIndex - 2, SET_Y, 40, SET_X, 25, SET_FONT, 75, SET_BG_COLOR, -1, SET_FG_COLOR, 34,
SET_POS_MODE, 0, SET_WIDTH, 280, SET_KEEP_ONSCREEN, 1, LIST_END);
setDelay(1800);
break;
@@ -3096,7 +3096,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) {
_hotspot5.postInit();
_hotspot5.setVisage(3401);
_hotspot5.setStrip2(2);
- _hotspot5._frame = 5;
+ _hotspot5.setFrame(5);
_hotspot5.animate(ANIM_MODE_2, 0);
if (_globals->_sceneManager._previousScene == 2100) {
@@ -3118,7 +3118,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) {
}
_soundHandler.startSound(116);
- _globals->_sceneManager._scene->_sceneBounds.centre(_hotspot1._position);
+ _globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
@@ -4546,7 +4546,7 @@ void Scene2300::Action2::signal() {
case 7:
scene->_hotspot7._strip = 2;
scene->_hotspot7._frame = 1;
- scene->_hotspot7.animate(ANIM_MODE_7, this);
+ scene->_hotspot7.animate(ANIM_MODE_5, this);
break;
case 8:
scene->_hotspot2.animate(ANIM_MODE_6, this);
@@ -4672,7 +4672,7 @@ void Scene2300::Hotspot5::doAction(int action) {
}
}
-void Scene2300::Hotspot6::doAction(int action) {
+void Scene2300::Hotspot7::doAction(int action) {
Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene;
switch (action) {
@@ -4707,7 +4707,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) {
setZoomPercents(0, 100, 200, 100);
_stripManager.addSpeaker(&_speakerSL);
- _stripManager.addSpeaker(&_speakerML);
+ _stripManager.addSpeaker(&_speakerMText);
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerSText);
@@ -4864,7 +4864,10 @@ void Scene2310::postInit(SceneObjectList *OwnerList) {
_globals->_events.setCursor(CURSOR_WALK);
_wireIndex = 5;
- _pageIndex = _globals->_randomSource.getRandomNumber(19) + 1;
+ if (_vm->getFeatures() & GF_CD)
+ _pageIndex = _globals->_randomSource.getRandomNumber(14) + 2;
+ else
+ _pageIndex = _globals->_randomSource.getRandomNumber(19) + 1;
signal();
}
@@ -4875,8 +4878,8 @@ void Scene2310::signal() {
Common::String msg = Common::String::format(fmtString.c_str(), _pageList[_pageIndex]._pageNumber);
_sceneText._width = 280;
- _sceneText._textMode = ALIGN_CENTRE;
- _sceneText._colour1 = 35;
+ _sceneText._textMode = ALIGN_CENTER;
+ _sceneText._color1 = 35;
_sceneText._fontNumber = 2;
_sceneText.setup(msg);
_sceneText.setPriority2(255);
@@ -4966,10 +4969,7 @@ void Scene2310::process(Event &event) {
}
void Scene2310::dispatch() {
- if ((_vm->getFeatures() & GF_CD) && !ConfMan.getBool("copy_protection")) {
- // CD version of Ringworld has the copy protection disabled
- signal();
- } else if (_wireIndex != 5) {
+ if (_wireIndex != 5) {
for (int idx = 0; idx < 5; ++idx) {
if (_rectList[idx].contains(_globals->_events._mousePos)) {
_wireList[_wireIndex].setFrame(idx + 2);
@@ -5798,7 +5798,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_globals->_sceneItems.push_back(&_hotspot8);
}
- _area1.setup(2100, 2, 1, 2150);
+ _area1.setup(2100, 2, 1, 2100);
_area1._pt = Common::Point(200, 31);
_area2.setup(2153, 3, 1, 2150);
_area2._pt = Common::Point(200, 50);
@@ -5812,13 +5812,16 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot11.setVisage(2705);
_hotspot11._strip = 3;
_hotspot11.setPosition(Common::Point(510, 156));
+ _globals->_sceneItems.push_back(&_hotspot11);
_hotspot11._state = 0;
_hotspot11.setAction(&_action1);
-
- _globals->_sceneItems.push_back(&_hotspot11);
}
_globals->_player.postInit();
+ if (_globals->getFlag(13))
+ _globals->_player.setVisage(2170);
+ else
+ _globals->_player.setVisage(0);
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setPosition(Common::Point(320, 79));
@@ -5971,7 +5974,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
}
_globals->_stripNum = 0;
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
loadScene(2320);
_hotspot14._sceneRegionId = 8;
@@ -6088,7 +6091,7 @@ void Scene2400::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h
index 61aac522f2..2cbe8de65b 100644
--- a/engines/tsage/ringworld_scenes3.h
+++ b/engines/tsage/ringworld_scenes3.h
@@ -462,8 +462,6 @@ class Scene2222 : public Scene {
virtual void signal();
};
- /* Hotspots */
-
public:
SoundHandler _soundHandler;
SpeakerSText _speakerSText;
@@ -710,22 +708,14 @@ class Scene2300 : public Scene {
public:
virtual void doAction(int action);
};
- class Hotspot6 : public SceneObject {
- public:
- virtual void doAction(int action);
- };
- class Hotspot12 : public SceneObject {
- public:
- virtual void doAction(int action);
- };
- class Hotspot13 : public SceneObject {
+ class Hotspot7 : public SceneObject {
public:
virtual void doAction(int action);
};
public:
SoundHandler _soundHandler1, _soundHandler2;
SpeakerSL _speakerSL;
- SpeakerML _speakerML;
+ SpeakerMText _speakerMText;
SpeakerQText _speakerQText;
SpeakerSText _speakerSText;
Action1 _action1;
@@ -734,8 +724,9 @@ public:
Action4 _action4;
SceneObject _hotspot1, _hotspot2, _hotspot3, _hotspot4;
Hotspot5 _hotspot5;
- Hotspot6 _hotspot6;
- SceneObject _hotspot7, _hotspot8, _hotspot9, _hotspot10;
+ SceneObject _hotspot6;
+ Hotspot7 _hotspot7;
+ SceneObject _hotspot8, _hotspot9, _hotspot10;
DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14, _hotspot15;
Scene2300();
diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp
index de29a1cefc..297ea943c3 100644
--- a/engines/tsage/ringworld_scenes5.cpp
+++ b/engines/tsage/ringworld_scenes5.cpp
@@ -1594,7 +1594,7 @@ void Scene4025::signal() {
if (_sceneMode != 4027) {
if (_sceneMode != 4028) {
_gfxButton.setText(EXIT_MSG);
- _gfxButton._bounds.centre(144, 107);
+ _gfxButton._bounds.center(144, 107);
_gfxButton.draw();
_gfxButton._bounds.expandPanes();
}
@@ -1642,7 +1642,7 @@ void Scene4045::Action1::signal() {
scene->_stripManager.start(4040, this, scene);
break;
case 2:
- scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ scene->_olloFace.animate(ANIM_MODE_NONE, NULL);
scene->_hotspot4.animate(ANIM_MODE_5, this);
break;
case 3:
@@ -1674,7 +1674,7 @@ void Scene4045::Action2::signal() {
scene->_stripManager.start(_globals->_stripNum, this, scene);
break;
case 2:
- scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ scene->_olloFace.animate(ANIM_MODE_NONE, NULL);
setDelay(10);
break;
case 3:
@@ -1705,7 +1705,7 @@ void Scene4045::Action3::signal() {
break;
case 2:
scene->_hotspot4.animate(ANIM_MODE_6, NULL);
- scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ scene->_olloFace.animate(ANIM_MODE_NONE, NULL);
ADD_MOVER(_globals->_player, 91, 1264);
break;
case 3:
@@ -1717,7 +1717,7 @@ void Scene4045::Action3::signal() {
/*--------------------------------------------------------------------------*/
-void Scene4045::Hotspot1::doAction(int action) {
+void Scene4045::OlloStand::doAction(int action) {
Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1759,7 +1759,7 @@ void Scene4045::Hotspot1::doAction(int action) {
}
}
-void Scene4045::Hotspot2::doAction(int action) {
+void Scene4045::Miranda::doAction(int action) {
Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1777,7 +1777,7 @@ void Scene4045::Hotspot2::doAction(int action) {
}
}
-void Scene4045::Hotspot6::doAction(int action) {
+void Scene4045::Necklace::doAction(int action) {
Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1793,7 +1793,7 @@ void Scene4045::Hotspot6::doAction(int action) {
} else {
scene->_sceneMode = 4047;
_globals->_player.disableControl();
- scene->setAction(&scene->_sequenceManager, scene, 4047, &_globals->_player, &scene->_hotspot1, NULL);
+ scene->setAction(&scene->_sequenceManager, scene, 4047, &_globals->_player, &scene->_olloStand, NULL);
}
break;
default:
@@ -1805,15 +1805,15 @@ void Scene4045::Hotspot6::doAction(int action) {
/*--------------------------------------------------------------------------*/
Scene4045::Scene4045() :
- _hotspot3(0, CURSOR_LOOK, 4045, 1, CURSOR_USE, 4100, 21, LIST_END),
- _hotspot7(9, CURSOR_LOOK, 4045, 0, CURSOR_USE, 4045, 15, LIST_END),
- _hotspot8(10, CURSOR_LOOK, 4045, 2, LIST_END),
- _hotspot9(11, CURSOR_LOOK, 4045, 3, CURSOR_USE, 4045, 15, LIST_END),
- _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4045, 19, LIST_END),
- _hotspot11(13, CURSOR_LOOK, 4045, 6, CURSOR_USE, 4045, 15, LIST_END),
- _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4045, 29, LIST_END),
- _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4045, 19, LIST_END),
- _hotspot14(0, CURSOR_LOOK, 4045, 10, LIST_END) {
+ _flame(0, CURSOR_LOOK, 4045, 1, CURSOR_USE, 4100, 21, LIST_END),
+ _hotspot7(9, CURSOR_LOOK, 4045, 0, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot8(10, CURSOR_LOOK, 4045, 2, LIST_END),
+ _hotspot9(11, CURSOR_LOOK, 4045, 3, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4045, 19, LIST_END),
+ _hotspot11(13, CURSOR_LOOK, 4045, 6, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4045, 29, LIST_END),
+ _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4045, 19, LIST_END),
+ _hotspot14(0, CURSOR_LOOK, 4045, 10, LIST_END) {
_hotspot14.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
}
@@ -1833,12 +1833,12 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_speakerQText._textPos.y = 140;
- _hotspot3.postInit();
- _hotspot3.setVisage(4045);
- _hotspot3.setPosition(Common::Point(47, 111));
- _hotspot3.animate(ANIM_MODE_2, NULL);
- _hotspot3.setPriority2(156);
- _globals->_sceneItems.push_back(&_hotspot3);
+ _flame.postInit();
+ _flame.setVisage(4045);
+ _flame.setPosition(Common::Point(47, 111));
+ _flame.animate(ANIM_MODE_2, NULL);
+ _flame.setPriority2(156);
+ _globals->_sceneItems.push_back(&_flame);
_globals->_player.postInit();
_globals->_player.setVisage(4200);
@@ -1846,65 +1846,67 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player._moveDiff = Common::Point(7, 4);
- _hotspot1.postInit();
- _hotspot1.setVisage(4051);
+ _olloStand.postInit();
+ _olloStand.setVisage(4051);
- _hotspot5.postInit();
- _hotspot5.setVisage(4051);
- _hotspot5.setStrip(4);
- _hotspot5.setPriority2(152);
+ _olloFace.postInit();
+ _olloFace.setVisage(4051);
+ _olloFace.setStrip(4);
+ _olloFace.setPriority2(152);
if(_globals->_sceneManager._previousScene == 4050) {
_globals->_soundHandler.startSound(155);
_globals->_player.setPosition(Common::Point(72, 128));
_globals->_player.enableControl();
- _hotspot1.setStrip(5);
- _hotspot1.setPosition(Common::Point(173, 99));
- _hotspot1._numFrames = 1;
- _hotspot1.animate(ANIM_MODE_2, NULL);
+ _olloStand.setStrip(5);
+ _olloStand.setPosition(Common::Point(173, 99));
+ _olloStand._numFrames = 1;
+ _olloStand.animate(ANIM_MODE_2, NULL);
- _hotspot5.setPosition(Common::Point(177, 40));
+ _olloFace.setPosition(Common::Point(177, 40));
if (_globals->_inventory._peg._sceneNumber == 4045) {
- _hotspot6.postInit();
- _hotspot6.setVisage(4045);
- _hotspot6.setStrip(2);
- _hotspot6.setPosition(Common::Point(108, 82));
- _globals->_sceneItems.push_back(&_hotspot6);
+ _necklace.postInit();
+ _necklace.setVisage(4045);
+ _necklace.setStrip(2);
+ _necklace.setPosition(Common::Point(108, 82));
+ _globals->_sceneItems.push_back(&_necklace);
}
} else {
_globals->_player.setPosition(Common::Point(108, 192));
_globals->_player.setStrip(4);
if (!_globals->getFlag(36) && !_globals->getFlag(43)) {
- _hotspot2.postInit();
- _hotspot2.setVisage(4102);
- _hotspot2.animate(ANIM_MODE_NONE, NULL);
- _hotspot2.setStrip(3);
- _hotspot2.changeZoom(-1);
- _hotspot2.setPosition(Common::Point(66, 209));
- _globals->_sceneItems.push_back(&_hotspot2);
+ _miranda.postInit();
+ _miranda.setVisage(4102);
+ _miranda.animate(ANIM_MODE_NONE, NULL);
+ _miranda.setStrip(3);
+ _miranda.setFrame(2);
+ _miranda.changeZoom(-1);
+
+ _miranda.setPosition(Common::Point(66, 209));
+ _globals->_sceneItems.push_back(&_miranda);
}
if (_globals->getFlag(31)) {
- _hotspot1.setVisage(4051);
- _hotspot1.setStrip(5);
- _hotspot1.setPosition(Common::Point(173, 99));
- _hotspot1._numFrames = 1;
- _hotspot1.animate(ANIM_MODE_2, NULL);
+ _olloStand.setVisage(4051);
+ _olloStand.setStrip(5);
+ _olloStand.setPosition(Common::Point(173, 99));
+ _olloStand._numFrames = 1;
+ _olloStand.animate(ANIM_MODE_2, NULL);
- _hotspot5.setPosition(Common::Point(177, 40));
+ _olloFace.setPosition(Common::Point(177, 40));
if (_globals->_inventory._peg._sceneNumber == 4045) {
- _hotspot6.postInit();
- _hotspot6.setVisage(4045);
- _hotspot6.setStrip(2);
- _hotspot6.setPosition(Common::Point(108, 82));
- _globals->_sceneItems.push_back(&_hotspot6);
+ _necklace.postInit();
+ _necklace.setVisage(4045);
+ _necklace.setStrip(2);
+ _necklace.setPosition(Common::Point(108, 82));
+ _globals->_sceneItems.push_back(&_necklace);
}
} else {
- _hotspot1.setPosition(Common::Point(186, 149));
+ _olloStand.setPosition(Common::Point(186, 149));
_hotspot4.postInit();
_hotspot4.setVisage(4051);
@@ -1912,7 +1914,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_hotspot4.setPriority2(152);
_hotspot4.setPosition(Common::Point(202, 80));
- _hotspot5.setPosition(Common::Point(192, 77));
+ _olloFace.setPosition(Common::Point(192, 77));
_globals->setFlag(31);
setAction(&_action1);
@@ -1920,17 +1922,17 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
}
}
- _globals->_sceneItems.addItems(&_hotspot1, &_hotspot7, &_hotspot8, &_hotspot9, &_hotspot10,
+ _globals->_sceneItems.addItems(&_olloStand, &_hotspot7, &_hotspot8, &_hotspot9, &_hotspot10,
&_hotspot13, &_hotspot11, &_hotspot12, &_hotspot14, NULL);
}
void Scene4045::stripCallback(int v) {
switch (v) {
case 1:
- _hotspot5.animate(ANIM_MODE_7, 0, NULL);
+ _olloFace.animate(ANIM_MODE_7, 0, NULL);
break;
case 2:
- _hotspot5.animate(ANIM_MODE_NONE, NULL);
+ _olloFace.animate(ANIM_MODE_NONE, NULL);
break;
}
}
@@ -1939,7 +1941,7 @@ void Scene4045::signal() {
switch (_sceneMode) {
case 4046:
case 4047:
- _hotspot5.animate(ANIM_MODE_NONE, NULL);
+ _olloFace.animate(ANIM_MODE_NONE, NULL);
break;
case 4050:
_globals->_sceneManager.changeScene(4000);
@@ -1954,11 +1956,11 @@ void Scene4045::dispatch() {
if (!_action) {
if (_globals->_player.getRegionIndex() == 8) {
_globals->_player.addMover(NULL);
- if (_hotspot1._strip == 1) {
+ if (_olloStand._strip == 1) {
_globals->_player.disableControl();
_sceneMode = 4046;
- _hotspot1._numFrames = 10;
- setAction(&_sequenceManager, this, 4046, &_globals->_player, &_hotspot1, NULL);
+ _olloStand._numFrames = 10;
+ setAction(&_sequenceManager, this, 4046, &_globals->_player, &_olloStand, NULL);
} else {
setAction(&_action3);
}
@@ -4108,7 +4110,7 @@ void Scene4300::signal() {
_hotspot14.setPosition(Common::Point(60, 199));
_gfxButton.setText(EXIT_MSG);
- _gfxButton._bounds.centre(60, 193);
+ _gfxButton._bounds.center(60, 193);
_gfxButton.draw();
_gfxButton._bounds.expandPanes();
diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h
index 0def49ebe6..b1b85c9c59 100644
--- a/engines/tsage/ringworld_scenes5.h
+++ b/engines/tsage/ringworld_scenes5.h
@@ -271,15 +271,15 @@ class Scene4045 : public Scene {
};
/* Hotspots */
- class Hotspot1 : public SceneObject {
+ class OlloStand : public SceneObject {
public:
virtual void doAction(int action);
};
- class Hotspot2 : public SceneObject {
+ class Miranda : public SceneObject {
public:
virtual void doAction(int action);
};
- class Hotspot6 : public SceneObject {
+ class Necklace : public SceneObject {
public:
virtual void doAction(int action);
};
@@ -292,11 +292,11 @@ public:
SpeakerPText _speakerPText;
SpeakerQText _speakerQText;
SpeakerQL _speakerQL;
- Hotspot1 _hotspot1;
- Hotspot2 _hotspot2;
- DisplayHotspot _hotspot3;
- SceneObject _hotspot4, _hotspot5;
- Hotspot6 _hotspot6;
+ OlloStand _olloStand;
+ Miranda _miranda;
+ DisplayHotspot _flame;
+ SceneObject _hotspot4, _olloFace;
+ Necklace _necklace;
DisplayHotspot _hotspot7, _hotspot8, _hotspot9, _hotspot10;
DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14;
Action1 _action1;
diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp
index 3ea4d7b279..5fdb09732a 100644
--- a/engines/tsage/ringworld_scenes6.cpp
+++ b/engines/tsage/ringworld_scenes6.cpp
@@ -1277,7 +1277,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_hotspot15.setPosition(Common::Point(977, 173));
_hotspot15.setPriority2(1);
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
loadScene(5100);
_globals->_soundHandler.startSound(205);
}
@@ -1703,7 +1703,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_hotspot10._sceneRegionId = 9;
_globals->_sceneItems.addItems(&_hotspot12, &_hotspot13, &_hotspot9, &_hotspot10, &_hotspot11, NULL);
- _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position);
+ _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
loadScene(5200);
}
diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp
index 416b7fe0fd..35db3cd387 100644
--- a/engines/tsage/ringworld_scenes8.cpp
+++ b/engines/tsage/ringworld_scenes8.cpp
@@ -48,7 +48,7 @@ void Scene7000::Action1::signal() {
setAction(&scene->_action6, this);
break;
case 2:
- scene->_soundHandler.startSound(252, 0, 127);
+ scene->_soundHandler.startSound(252);
scene->_object8.remove();
scene->_object1.postInit();
scene->_object1.setVisage(7003);
@@ -169,7 +169,7 @@ void Scene7000::Action4::signal() {
setDelay(300);
break;
case 2:
- _globals->_soundHandler.startSound(252, 0, 127);
+ _globals->_soundHandler.startSound(252);
scene->_object1.show();
scene->_object1.setStrip(3);
scene->_object1.setFrame(1);
@@ -199,7 +199,7 @@ void Scene7000::Action5::signal() {
}
case 1:
_globals->_player.checkAngle(&scene->_object1);
- _globals->_soundHandler.startSound(252, 0, 127);
+ _globals->_soundHandler.startSound(252);
scene->_object1.setStrip(2);
scene->_stripManager.start(7015, this);
break;
@@ -340,7 +340,7 @@ void Scene7000::Action7::signal() {
void Scene7000::SceneItem1::doAction(int action) {
if (action == CURSOR_LOOK)
- SceneItem::display(7000, 2, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7000, 2, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
SceneItem::doAction(action);
}
@@ -406,9 +406,9 @@ void Scene7000::Object1::doAction(int action) {
break;
case CURSOR_LOOK:
if (_globals->getFlag(81))
- SceneItem::display(7000, 1, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7000, 1, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
- SceneItem::display(7000, 0, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7000, 0, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (_globals->getFlag(81)) {
@@ -416,7 +416,7 @@ void Scene7000::Object1::doAction(int action) {
_globals->_player.disableControl();
scene->setAction(&scene->_action5);
} else {
- SceneItem::display(7000, 5, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7000, 5, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
break;
case CURSOR_TALK:
@@ -451,7 +451,7 @@ void Scene7000::dispatch() {
if (!_globals->getFlag(13)) {
_globals->_player.disableControl();
_globals->_player.addMover(0);
- SceneItem::display(7000, 3, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7000, 3, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
_sceneMode = 7001;
setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL);
} else if (!_globals->getFlag(52)) {
@@ -532,7 +532,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_8, 0, 0);
_globals->_sceneItems.addItems(&_object1, 0);
}
- _soundHandler.startSound(251, 0, 127);
+ _soundHandler.startSound(251);
if (_globals->_sceneManager._previousScene == 2100) {
if (_globals->getFlag(72)) {
_globals->_player.postInit();
@@ -550,7 +550,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
}
} else {
- _globals->_soundHandler.startSound(250, 0, 127);
+ _globals->_soundHandler.startSound(250);
_globals->setFlag(72);
_object3.postInit();
@@ -597,9 +597,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object3.setVisage(5001);
_object3.setStrip2(1);
_object3.setPosition(Common::Point(307, 0), 0);
- _soundHandler.startSound(151, 0, 127);
+ _soundHandler.startSound(151);
_soundHandler.proc5(1);
- _globals->_soundHandler.startSound(250, 0, 127);
+ _globals->_soundHandler.startSound(250);
setAction(&_action3);
}
}
@@ -1114,9 +1114,9 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object1.setPosition(Common::Point(100, 100), 0);
setAction(&_action11);
- _soundHandler1.startSound(270, 0, 127);
- _soundHandler2.startSound(275, 0, 127);
- _globals->_soundHandler.startSound(270, 0, 127);
+ _soundHandler1.startSound(270);
+ _soundHandler2.startSound(275);
+ _globals->_soundHandler.startSound(270);
}
/*--------------------------------------------------------------------------
* Scene 7200
@@ -1281,7 +1281,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) {
_swimmer.setPosition(Common::Point(-8, 16), 0);
setAction(&_action1);
- _soundHandler.startSound(271, 0, 127);
+ _soundHandler.startSound(271);
}
/*--------------------------------------------------------------------------
@@ -1476,7 +1476,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) {
_object8._numFrames = 2;
setAction(&_action1);
- _globals->_soundHandler.startSound(272, 0, 127);
+ _globals->_soundHandler.startSound(272);
}
/*--------------------------------------------------------------------------
@@ -1578,7 +1578,7 @@ void Scene7600::postInit(SceneObjectList *OwnerList) {
_globals->_player.setPosition(Common::Point(-50, 195));
setAction(&_action1);
}
- _sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y);
+ _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y);
loadScene(7600);
_soundHandler2.startSound(255);
_soundHandler1.startSound(251);
@@ -1644,7 +1644,7 @@ void Scene7700::Action3::signal() {
setDelay(60);
// No break on purpose!
case 2:
- scene->_soundHandler.startSound(260, 0, 127);
+ scene->_soundHandler.startSound(260);
scene->_object8.setVisage(7703);
scene->_object8.setPosition(Common::Point(177, 97), 0);
scene->_object8.setStrip2(3);
@@ -1677,7 +1677,7 @@ void Scene7700::Action4::signal() {
break;
case 3:
CursorMan.showMouse(true);
- SceneItem::display(7700, 11, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 11, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
_globals->_player.enableControl();
remove();
break;
@@ -1737,14 +1737,14 @@ void Scene7700::Action6::signal() {
void Scene7700::SceneHotspot1::doAction(int action) {
if (action == CURSOR_LOOK)
- SceneItem::display(7700, 4, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 4, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
SceneHotspot::doAction(action);
}
void Scene7700::SceneHotspot2::doAction(int action) {
if (action == CURSOR_LOOK)
- SceneItem::display(7700, 6, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 6, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
SceneHotspot::doAction(action);
}
@@ -1754,14 +1754,14 @@ void Scene7700::SceneHotspot3::doAction(int action) {
switch (action) {
case OBJECT_KEY:
- SceneItem::display(7702, 3, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7702, 3, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
_globals->_inventory._key._sceneNumber = 7700;
break;
case CURSOR_LOOK:
if (_globals->_inventory._key._sceneNumber == 7700)
scene->setAction(&scene->_action4, 0);
else
- SceneItem::display(7700, 53, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 53, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (!_globals->getFlag(78)) {
@@ -1784,14 +1784,14 @@ void Scene7700::SceneHotspot4::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (!_globals->getFlag(78)) {
scene->_sceneMode = 7712;
scene->setAction(&scene->_sequenceManager, scene, 7715, 0);
} else {
- SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
break;
default:
@@ -1805,7 +1805,7 @@ void Scene7700::SceneHotspot5::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 28, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 28, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (_globals->getFlag(78)) {
@@ -1828,10 +1828,10 @@ void Scene7700::SceneHotspot5::doAction(int action) {
void Scene7700::SceneHotspot6::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 43, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 43, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
- SceneItem::display(7700, 56, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 56, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
default:
SceneHotspot::doAction(action);
@@ -1841,7 +1841,7 @@ void Scene7700::SceneHotspot6::doAction(int action) {
void Scene7700::SceneItem7::doAction(int action) {
if (action == CURSOR_LOOK)
- SceneItem::display(7700, 51, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 51, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
void Scene7700::SceneHotspot8::doAction(int action) {
@@ -1849,11 +1849,11 @@ void Scene7700::SceneHotspot8::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259, 0, 127);
+ scene->_soundHandler.startSound(259);
scene->_object15.setFrame(scene->_object15.getFrameCount());
scene->_object15.animate(ANIM_MODE_6, scene);
if ((scene->_field977 == 2) && (scene->_field97B == 0)) {
@@ -1875,11 +1875,11 @@ void Scene7700::SceneHotspot9::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259, 0, 127);
+ scene->_soundHandler.startSound(259);
scene->_object15.setFrame(1);
scene->_object15.animate(ANIM_MODE_5, scene);
if (scene->_field977 > 2) {
@@ -1917,7 +1917,7 @@ void Scene7700::Object1::doAction(int action) {
Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
- SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
if (_globals->getFlag(78)) {
_globals->_player.disableControl();
@@ -1934,10 +1934,10 @@ void Scene7700::Object1::doAction(int action) {
void Scene7700::SceneHotspot11::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
- SceneItem::display(7701, _useLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, _useLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
default:
SceneHotspot::doAction(action);
@@ -1948,7 +1948,7 @@ void Scene7700::SceneHotspot11::doAction(int action) {
void Scene7700::Object1::signal() {
if (_state == 0) {
_state = 1;
- SceneItem::display(7701, _defltLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, _defltLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
_state = 0;
}
@@ -1959,7 +1959,7 @@ void Scene7700::Object3::doAction(int action) {
Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
- SceneItem::display(7700, 34, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 34, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
if (_globals->getFlag(78)) {
if (scene->_object3._frame == 1) {
@@ -1967,7 +1967,7 @@ void Scene7700::Object3::doAction(int action) {
scene->_sceneMode = 7707;
scene->setAction(&scene->_sequenceManager, scene, 7707, &_globals->_player, this, 0);
} else {
- SceneItem::display(7700, 60, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 60, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
}
} else {
scene->_sceneMode = 7712;
@@ -1984,13 +1984,13 @@ void Scene7700::Object7::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
if (_globals->getFlag(78))
- SceneItem::display(7700, 45, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 45, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
- SceneItem::display(7700, 44, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 44, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (_globals->getFlag(78)) {
- SceneItem::display(7701, 41, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, 41, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
scene->_sceneMode = 7712;
scene->setAction(&scene->_sequenceManager, scene, 7714, 0);
@@ -1998,7 +1998,7 @@ void Scene7700::Object7::doAction(int action) {
break;
case CURSOR_TALK:
if (_globals->getFlag(78)) {
- SceneItem::display(7702, 1, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7702, 1, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
_globals->_player.disableControl();
if (_state == 0) {
@@ -2045,7 +2045,7 @@ void Scene7700::Object8::doAction(int action) {
scene->_object14.setPosition(Common::Point(139, 151), 0);
scene->_gfxButton.setText(EXIT_MSG);
- scene->_gfxButton._bounds.centre(140, 189);
+ scene->_gfxButton._bounds.center(140, 189);
scene->_gfxButton.draw();
scene->_gfxButton._bounds.expandPanes();
@@ -2059,7 +2059,7 @@ void Scene7700::Object8::doAction(int action) {
scene->_object15.setPriority2(200);
scene->_gfxButton.setText(EXIT_MSG);
- scene->_gfxButton._bounds.centre(140, 186);
+ scene->_gfxButton._bounds.center(140, 186);
scene->_gfxButton.draw();
scene->_gfxButton._bounds.expandPanes();
@@ -2084,13 +2084,13 @@ void Scene7700::Object9::doAction(int action) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display(7700, 49, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 49, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
- SceneItem::display(7701, 42, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, 42, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_TALK:
- SceneItem::display(7702, 4, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7702, 4, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case OBJECT_KEY:
if (_frame == 1) {
@@ -2102,7 +2102,7 @@ void Scene7700::Object9::doAction(int action) {
_globals->_sceneItems.push_front(&scene->_object10);
scene->_object10.setPriority2(240);
}
- scene->_soundHandler.startSound(262, 0, 127);
+ scene->_soundHandler.startSound(262);
scene->_object14.animate(ANIM_MODE_5, 0);
}
_globals->_events.setCursor(CURSOR_WALK);
@@ -2116,7 +2116,7 @@ void Scene7700::Object10::doAction(int action) {
Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
- SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
_globals->setFlag(80);
scene->_sceneItem10.remove();
@@ -2135,19 +2135,19 @@ void Scene7700::Object11::doAction(int action) {
switch (action) {
case OBJECT_SCANNER:
if (_frame != 1)
- SceneItem::display(7701, 44, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, 44, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
SceneItem::doAction(action);
break;
case CURSOR_LOOK:
if (_frame != 1)
- SceneItem::display(7700, 9, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 9, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
else
- SceneItem::display(7700, 52, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 52, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case CURSOR_USE:
if (_frame != 1) {
- SceneItem::display(7701, 8, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7701, 8, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
_globals->setFlag(49);
_globals->_player.disableControl();
@@ -2171,7 +2171,7 @@ void Scene7700::Object12::doAction(int action) {
Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
- SceneItem::display(7700, 15, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 15, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
if (_globals->getFlag(78)) {
scene->_sceneMode = 7713;
@@ -2209,7 +2209,7 @@ void Scene7700::signal() {
_globals->_player.enableControl();
break;
case 7704:
- _globals->_soundHandler.startSound(256, 0, 127);
+ _globals->_soundHandler.startSound(256);
_prof.setStrip2(4);
_prof.setFrame2(1);
_prof.setPosition(Common::Point(159, 87), 0);
@@ -2225,7 +2225,7 @@ void Scene7700::signal() {
break;
case 7710:
_globals->_player.enableControl();
- SceneItem::display(7700, 62, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END);
+ SceneItem::display(7700, 62, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
break;
case 7713:
_emptyJar.remove();
@@ -2493,7 +2493,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_sceneMode = 7701;
setAction(&_sequenceManager, this, 7701, &_globals->_player, 0);
- _soundHandler.startSound(256, 0, 127);
+ _soundHandler.startSound(256);
}
Scene7700::Scene7700() {
diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp
index 7983e2a34c..594d30fa3c 100644
--- a/engines/tsage/saveload.cpp
+++ b/engines/tsage/saveload.cpp
@@ -261,16 +261,8 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h
out->write(header.saveName.c_str(), header.saveName.size() + 1);
// Get the active palette
- uint32 workPal[256];
uint8 thumbPalette[256 * 3];
- const byte *srcP = (const byte *)&workPal[0];
- byte *destP = &thumbPalette[0];
- g_system->getPaletteManager()->grabPalette((byte *)workPal, 0, 256);
- for (int idx = 0; idx < 256; ++idx, ++srcP) {
- *destP++ = *srcP++;
- *destP++ = *srcP++;
- *destP++ = *srcP++;
- }
+ g_system->getPaletteManager()->grabPalette(thumbPalette, 0, 256);
// Create a thumbnail and save it
Graphics::Surface *thumb = new Graphics::Surface();
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 83661b8f15..945d144ae5 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -51,7 +51,13 @@ struct tSageSavegameHeader {
/*--------------------------------------------------------------------------*/
-#define SYNC_POINTER(x) s.syncPointer((SavedObject **)&x)
+// FIXME: workaround to supress spurious strict-alias warnings on older GCC
+// versions. this should be resolved with the savegame rewrite
+#define SYNC_POINTER(x) do { \
+ SavedObject *y = (SavedObject *)x; \
+ s.syncPointer(&y); \
+} while (false)
+
#define SYNC_ENUM(FIELD, TYPE) int v_##FIELD = (int)FIELD; s.syncAsUint16LE(v_##FIELD); \
if (s.isLoading()) FIELD = (TYPE)v_##FIELD;
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index 68320066d7..748e8662fd 100644
--- a/engines/tsage/scenes.cpp
+++ b/engines/tsage/scenes.cpp
@@ -46,6 +46,7 @@ SceneManager::~SceneManager() {
}
void SceneManager::setNewScene(int sceneNumber) {
+ warning("SetNewScene(%d)", sceneNumber);
_nextSceneNumber = sceneNumber;
}
@@ -133,6 +134,7 @@ void SceneManager::fadeInIfNecessary() {
}
void SceneManager::changeScene(int newSceneNumber) {
+ warning("changeScene(%d)", newSceneNumber);
// Fade out the scene
ScenePalette scenePalette;
uint32 adjustData = 0;
@@ -230,6 +232,7 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
_backgroundBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) {
_sceneMode = 0;
_oldSceneBounds = Rect(4000, 4000, 4100, 4100);
+ Common::set_to(&_zoomPercents[0], &_zoomPercents[256], 0);
}
Scene::~Scene() {
@@ -269,6 +272,7 @@ void Scene::dispatch() {
}
void Scene::loadScene(int sceneNum) {
+ warning("loadScene(%d)", sceneNum);
_sceneNumber = sceneNum;
if (_globals->_scenePalette.loadPalette(sceneNum))
_globals->_sceneManager._hasPalette = true;
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 1f6442f2ff..9d5d7223cb 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -101,14 +101,14 @@ Common::Error TSageEngine::run() {
* Returns true if it is currently okay to restore a game
*/
bool TSageEngine::canLoadGameStateCurrently() {
- return _globals->getFlag(50) == 0;
+ return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled;
}
/**
* Returns true if it is currently okay to save the game
*/
bool TSageEngine::canSaveGameStateCurrently() {
- return _globals->getFlag(50) == 0;
+ return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled;
}
/**
diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h
index 2a627d80bc..25a99f094b 100644
--- a/engines/tsage/tsage.h
+++ b/engines/tsage/tsage.h
@@ -61,8 +61,8 @@ struct tSageGameDescription;
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 200
-#define SCREEN_CENTRE_X 160
-#define SCREEN_CENTRE_Y 100
+#define SCREEN_CENTER_X 160
+#define SCREEN_CENTER_Y 100
class TSageEngine : public Engine {
private:
diff --git a/graphics/png.cpp b/graphics/png.cpp
index eb066efa57..b256c87cf5 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -99,8 +99,6 @@ enum PNGFilters {
kFilterPaeth = 4
};
-#define PNG_HEADER(a, b, c, d) CONSTANT_LE_32(d | (c << 8) | (b << 16) | (a << 24))
-
PNG::PNG() : _compressedBuffer(0), _compressedBufferSize(0),
_unfilteredSurface(0), _transparentColorSpecified(false) {
}
@@ -175,8 +173,16 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
// Convert the indexed surface to the target pixel format
for (uint16 i = 0; i < output->h; i++) {
+ bool otherPixel = false;
+
for (uint16 j = 0; j < output->w; j++) {
- index = *src;
+ if (_header.bitDepth != 4)
+ index = *src;
+ else if (!otherPixel)
+ index = (*src) >> 4;
+ else
+ index = (*src) & 0xf;
+
r = _palette[index * 4 + 0];
g = _palette[index * 4 + 1];
b = _palette[index * 4 + 2];
@@ -187,8 +193,13 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
else
*((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor(a, r, g, b);
- src++;
+ if (_header.bitDepth != 4 || otherPixel)
+ src++;
+ otherPixel = !otherPixel;
}
+ // The surface is a whole scanline wide, skip the rest of it.
+ if (_header.bitDepth == 4)
+ src += output->w / 2;
}
}
@@ -200,11 +211,11 @@ bool PNG::read(Common::SeekableReadStream *str) {
_stream = str;
// First, check the PNG signature
- if (_stream->readUint32BE() != PNG_HEADER(0x89, 0x50, 0x4e, 0x47)) {
+ if (_stream->readUint32BE() != MKTAG(0x89, 0x50, 0x4e, 0x47)) {
delete _stream;
return false;
}
- if (_stream->readUint32BE() != PNG_HEADER(0x0d, 0x0a, 0x1a, 0x0a)) {
+ if (_stream->readUint32BE() != MKTAG(0x0d, 0x0a, 0x1a, 0x0a)) {
delete _stream;
return false;
}
diff --git a/gui/credits.h b/gui/credits.h
index a6a8a4f483..7ad480032e 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -206,6 +206,10 @@ static const char *credits[] = {
"C1""Touch\351",
"C0""Gregory Montoir",
"",
+"C1""TsAGE",
+"C0""Paul Gilbert",
+"C0""Arnaud Boutonn\351",
+"",
"C1""Tucker",
"C0""Gregory Montoir",
"",
@@ -472,7 +476,7 @@ static const char *credits[] = {
"C0""Raina",
"C2""ScummVM forum buttons",
"C0""William Claydon",
-"C2""Skins for doxygen and wiki",
+"C2""Skins for doxygen, buildbot and wiki",
"",
"C1""Code contributions",
"C0""Ori Avtalion",
@@ -649,7 +653,7 @@ static const char *credits[] = {
"C0""",
"C0""Emilio de Paz Aragon from Alcachofa Soft for sharing the source code of Drascula: The Vampire Strikes Back with us and his generosity with freewaring the game.",
"C0""",
-"C0""David P. Gray from Gray Design Associate for sharing the source code of the Hugo trilogy.",
+"C0""David P. Gray from Gray Design Associates for sharing the source code of the Hugo trilogy.",
"C0""",
"C0""Broken Sword 2.5 team for providing sources of their engine and their great support.",
"C0""",
diff --git a/gui/options.cpp b/gui/options.cpp
index a540fbb9d1..a12630a0e7 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -144,6 +144,7 @@ void OptionsDialog::init() {
_subSpeedDesc = 0;
_subSpeedSlider = 0;
_subSpeedLabel = 0;
+ _oldTheme = ConfMan.get("gui_theme");
// Retrieve game GUI options
_guioptions = 0;
@@ -509,6 +510,13 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
setResult(1);
close();
break;
+ case kCloseCmd:
+ if (g_gui.theme()->getThemeId() != _oldTheme) {
+ g_gui.loadNewTheme(_oldTheme);
+ ConfMan.set("gui_theme", _oldTheme);
+ }
+ close();
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
@@ -1316,7 +1324,6 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
#ifdef USE_TRANSLATION
Common::String lang = TransMan.getCurrentLanguage();
#endif
- Common::String oldTheme = g_gui.theme()->getThemeId();
if (g_gui.loadNewTheme(theme)) {
#ifdef USE_TRANSLATION
// If the charset has changed, it means the font were not found for the
@@ -1324,7 +1331,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
// language without restarting, we let the user know about this.
if (lang != TransMan.getCurrentLanguage()) {
TransMan.setLanguage(lang.c_str());
- g_gui.loadNewTheme(oldTheme);
+ g_gui.loadNewTheme(_oldTheme);
MessageDialog error(_("The theme you selected does not support your current language. If you want to use this theme you need to switch to another language first."));
error.runModal();
} else {
diff --git a/gui/options.h b/gui/options.h
index eba1779b69..5cc13b5cf6 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -174,6 +174,11 @@ protected:
//
uint32 _guioptions;
Common::String _guioptionsString;
+
+ //
+ //Theme Options
+ //
+ Common::String _oldTheme;
};
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index 3ef813283e..159943fcdd 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -30,18 +30,20 @@
namespace GUI {
-EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd)
+ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, x, y - 1, w, h + 2, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
-EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd)
+EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, name, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
@@ -107,6 +109,8 @@ void EditTextWidget::startEditMode() {
void EditTextWidget::endEditMode() {
releaseFocus();
+
+ sendCommand(_finishCmd, 0);
}
void EditTextWidget::abortEditMode() {
diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h
index a2549882ca..b94e58780c 100644
--- a/gui/widgets/edittext.h
+++ b/gui/widgets/edittext.h
@@ -41,8 +41,8 @@ protected:
int _rightPadding;
public:
- EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0);
- EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0);
+ EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0);
+ EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0);
void setEditString(const String &str);
@@ -62,6 +62,8 @@ protected:
void abortEditMode();
Common::Rect getEditRect() const;
+
+ uint32 _finishCmd;
};
} // End of namespace GUI
diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp
index bdca5f9c80..d4552b78d7 100644
--- a/video/codecs/cdtoons.cpp
+++ b/video/codecs/cdtoons.cpp
@@ -75,7 +75,7 @@ Graphics::Surface *CDToonsDecoder::decodeImage(Common::SeekableReadStream *strea
uint16 blocksValidUntil = stream->readUint16BE();
byte u6 = stream->readByte();
byte backgroundColor = stream->readByte();
- debugN(5, "CDToons frame %d, size %d, unknown %04x (at 0), blocks valid until %d, unknown 6 is %02x, bkg colour is %02x\n",
+ debugN(5, "CDToons frame %d, size %d, unknown %04x (at 0), blocks valid until %d, unknown 6 is %02x, bkg color is %02x\n",
frameId, stream->size(), u0, blocksValidUntil, u6, backgroundColor);
Common::Rect clipRect = readRect(stream);