diff options
author | Matthew Hoops | 2011-05-11 00:30:02 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-11 00:30:28 -0400 |
commit | a1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch) | |
tree | 8c51419daa486f1d4833757db4715dadab6c3497 /engines/tinsel | |
parent | accb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff) | |
parent | 33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff) | |
download | scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2 scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip |
Merge remote branch 'upstream/master' into t7g-ios
Conflicts:
audio/decoders/qdm2.h
common/util.cpp
engines/groovie/music.cpp
engines/groovie/resource.h
video/qt_decoder.cpp
video/qt_decoder.h
Diffstat (limited to 'engines/tinsel')
49 files changed, 407 insertions, 389 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 7a1f9fbf55..9ec253e512 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -44,6 +44,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { @@ -108,7 +109,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 +141,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 +480,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 +1279,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 +1289,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/adpcm.cpp b/engines/tinsel/adpcm.cpp index ec51d150dc..530395d754 100644 --- a/engines/tinsel/adpcm.cpp +++ b/engines/tinsel/adpcm.cpp @@ -23,6 +23,9 @@ * */ +#include "common/stream.h" +#include "common/util.h" + #include "tinsel/adpcm.h" namespace Tinsel { @@ -44,14 +47,14 @@ void Tinsel_ADPCMStream::readBufferTinselHeader() { // Negate start = ~(start | 0xC0) + 1; - _status.predictor = 1 << start; + _status.predictor = (unsigned long long int)1 << start; } else { // Lower 6 bit are positive // Truncate start &= 0x1F; - _status.predictor = ((double) 1.0) / (1 << start); + _status.predictor = ((double) 1.0) / ((unsigned long long int)1 << start); } _status.K0 = TinselFilterTable[filterVal][0]; diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 37d8de925e..61c8b67624 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -31,6 +31,7 @@ #include "tinsel/sched.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index f895ecd2da..79f051420b 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 @@ -165,7 +165,7 @@ OBJECT *GetPlayfieldList(int which) { pPlayfield = pCurBgnd->fieldArray + which; // return the display list pointer for this playfield - return (OBJECT *)&pPlayfield->pDispList; + return pPlayfield->pDispList; } /** @@ -205,10 +205,10 @@ void DrawBackgnd() { pPlay->bMoved = true; // sort the display list for this background - just in case somebody has changed object Z positions - SortObjectList((OBJECT *)&pPlay->pDispList); + SortObjectList(pPlay->pDispList); // generate clipping rects for all objects that have moved etc. - FindMovingObjects((OBJECT *)&pPlay->pDispList, &ptWin, + FindMovingObjects(pPlay->pDispList, &ptWin, &pPlay->rcClip, false, pPlay->bMoved); // clear playfield moved flag @@ -235,7 +235,7 @@ void DrawBackgnd() { if (IntersectRectangle(rcPlayClip, pPlay->rcClip, *r)) // redraw all objects within this clipping rect - UpdateClipRect((OBJECT *)&pPlay->pDispList, + UpdateClipRect(pPlay->pDispList, &ptWin, &rcPlayClip); } } 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..0e67c3a06e 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -40,6 +40,7 @@ #include "tinsel/tinlib.h" // For Control() #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { @@ -158,7 +159,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..793febdc21 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -44,6 +44,8 @@ #include "audio/decoders/raw.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- LOCAL DEFINES ---------------------------- @@ -81,7 +83,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 +352,7 @@ BMVPlayer::BMVPlayer() { memset(texts, 0, sizeof(texts)); - talkColour = 0; + talkColor = 0; bigProblemCount = 0; bIsText = 0; movieTick = 0; @@ -382,8 +384,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 +492,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 +504,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 +521,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 +543,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 +695,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..281dd2da55 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -62,6 +62,8 @@ #include "tinsel/tinsel.h" // For engine access #include "tinsel/token.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERNAL GLOBAL DATA -------------------- @@ -259,7 +261,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 +451,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 +1641,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 +2241,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 +2279,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 +2640,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 +2671,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 +2738,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 +2760,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 +2789,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 +2872,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 +2936,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 +2947,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 +3685,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 +3733,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/dialogs.h b/engines/tinsel/dialogs.h index a256ed73e8..f81a59a0b7 100644 --- a/engines/tinsel/dialogs.h +++ b/engines/tinsel/dialogs.h @@ -32,7 +32,7 @@ #include "tinsel/events.h" // for PLR_EVENT, PLR_EVENT namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp index ab606f3159..d252e45cf5 100644 --- a/engines/tinsel/drives.cpp +++ b/engines/tinsel/drives.cpp @@ -24,9 +24,7 @@ * CD/drive handling functions */ -#include "common/config-manager.h" -#include "common/substream.h" -#include "gui/message.h" +#include "common/textconsole.h" #include "tinsel/drives.h" #include "tinsel/scene.h" #include "tinsel/tinsel.h" 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..bdcd3207f9 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -32,6 +32,8 @@ #include "tinsel/tinsel.h" #include "tinsel/scn.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- LOCAL DEFINES -------------------- @@ -41,7 +43,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 +177,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 +472,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 +523,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 +597,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 +627,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 +648,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 +665,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 +695,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 +832,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 +867,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/handle.cpp b/engines/tinsel/handle.cpp index f2db42bede..6f5f92c969 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -27,6 +27,7 @@ #define BODGE #include "common/file.h" +#include "common/textconsole.h" #include "tinsel/drives.h" #include "tinsel/dw.h" diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp index cf28749e76..5d9672972a 100644 --- a/engines/tinsel/mareels.cpp +++ b/engines/tinsel/mareels.cpp @@ -28,6 +28,7 @@ #include "tinsel/pcode.h" // For D_UP, D_DOWN #include "tinsel/rince.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { 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..ad02a614a5 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -32,6 +32,8 @@ #include "tinsel/text.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + #define OID_EFFECTS 0x2000 // generic special effects object id namespace Tinsel { @@ -482,11 +484,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 +505,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..0877337603 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -32,6 +32,8 @@ #include "tinsel/tinsel.h" #include "common/system.h" +#include "common/textconsole.h" +#include "graphics/palette.h" namespace Tinsel { @@ -41,12 +43,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 +69,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 +113,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 +140,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 +158,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 +218,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 +242,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 +277,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 +296,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 +313,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 +321,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 +335,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 +371,7 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) { } // set new DAC index - iDAC = p->posInDAC + p->numColours; + iDAC = p->posInDAC + p->numColors; } // no free palettes @@ -431,43 +433,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 +503,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 +546,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 +574,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 +596,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 +622,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 +633,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/pcode.cpp b/engines/tinsel/pcode.cpp index ccd86d7ed7..a1cc02a832 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -36,6 +36,7 @@ #include "tinsel/tinlib.h" // Library routines #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h index f3690e9257..f31f2eb5c6 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -31,7 +31,7 @@ #include "tinsel/sched.h" // for PROCESS namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index 38748b703b..5022f4757a 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -44,6 +44,8 @@ #include "tinsel/text.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERNAL GLOBAL DATA -------------------- @@ -59,8 +61,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 +160,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 +192,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 +218,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 +237,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 +413,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 +458,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 +563,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 +572,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..f49dddeef4 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -34,6 +34,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { @@ -98,10 +99,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 +1625,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 +1674,7 @@ static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) { p->subtype = NodePath ? NODE : NORMAL; - PseudoCentre(p); + PseudoCenter(p); } @@ -1918,16 +1919,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..38ac0a2ce6 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -47,6 +47,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { @@ -60,8 +61,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 +89,7 @@ static void CheckBrightness(PMOVER pMover) { pMover->brightness--; // ramp down DimPartPalette(BgPal(), - pMover->startColour, + pMover->startColor, pMover->paletteLength, pMover->brightness); } @@ -107,7 +108,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 +925,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..50f6d8d00b 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -36,6 +36,7 @@ #include "common/serializer.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "gui/message.h" @@ -164,8 +165,7 @@ static bool syncSaveGameHeader(Common::Serializer &s, SaveGameHeader &hdr) { } static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) { - SCNHANDLE *pList[3] = { (SCNHANDLE *)&sm.walkReels, - (SCNHANDLE *)&sm.standReels, (SCNHANDLE *)&sm.talkReels }; + int i, j; s.syncAsUint32LE(sm.bActive); s.syncAsSint32LE(sm.actorID); @@ -173,17 +173,27 @@ static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) { s.syncAsSint32LE(sm.objY); s.syncAsUint32LE(sm.hLastfilm); - for (int pIndex = 0; pIndex < 3; ++pIndex) { - SCNHANDLE *p = pList[pIndex]; - for (int i = 0; i < TOTAL_SCALES * 4; ++i) - s.syncAsUint32LE(*p++); - } + // Sync walk reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.walkReels[i][j]); + + // Sync stand reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.standReels[i][j]); + + // Sync talk reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.talkReels[i][j]); + if (TinselV2) { 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..aa359d281f 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -48,6 +48,8 @@ #include "tinsel/tinlib.h" #include "tinsel/token.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERN FUNCTIONS -------------------- @@ -226,7 +228,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..b82bac32cc 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -51,6 +51,7 @@ #include "tinsel/sysvar.h" #include "tinsel/token.h" +#include "common/textconsole.h" namespace Tinsel { @@ -381,7 +382,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/sched.cpp b/engines/tinsel/sched.cpp index 427e28826f..37c04abd22 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -30,6 +30,7 @@ #include "tinsel/polygons.h" #include "tinsel/sched.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 17ae7c8687..20d75b6b93 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -24,9 +24,6 @@ * A (some would say very) small collection of utility functions. */ -#include "common/endian.h" -#include "common/util.h" - #include "tinsel/dw.h" #include "tinsel/film.h" #include "tinsel/handle.h" diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index 1fcdb4dcf9..ec42ca5da4 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -35,9 +35,7 @@ #include "tinsel/sysvar.h" #include "tinsel/background.h" -#include "common/config-manager.h" #include "common/endian.h" -#include "common/file.h" #include "common/memstream.h" #include "common/system.h" @@ -131,13 +129,9 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); // FIXME: Should set this in a different place ;) - bool mute = false; - if (ConfMan.hasKey("mute")) - mute = ConfMan.getBool("mute"); - - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : _vm->_config->_soundVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume); //_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : _vm->_config->_voiceVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume); Audio::AudioStream *sampleStream = 0; @@ -325,13 +319,9 @@ bool SoundManager::playSample(int id, int sub, bool bLooped, int x, int y, int p } // FIXME: Should set this in a different place ;) - bool mute = false; - if (ConfMan.hasKey("mute")) - mute = ConfMan.getBool("mute"); - - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : _vm->_config->_soundVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume); //_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : _vm->_config->_voiceVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume); curChan->sampleNum = id; curChan->subSample = sub; @@ -364,8 +354,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 @@ -385,7 +375,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/strres.cpp b/engines/tinsel/strres.cpp index aa303a5391..2dc0e833d1 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -31,6 +31,7 @@ #include "tinsel/scn.h" #include "common/file.h" #include "common/endian.h" +#include "common/textconsole.h" #include "gui/message.h" diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp index 7003d34feb..ad795fd219 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -31,6 +31,8 @@ #include "tinsel/sysvar.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + namespace Tinsel { // Return for SYS_Platform @@ -77,7 +79,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 +105,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/timers.cpp b/engines/tinsel/timers.cpp index 5f15cd9d3b..c1a4cd0ff5 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -31,7 +31,7 @@ #include "tinsel/timers.h" #include "tinsel/dw.h" #include "common/serializer.h" - +#include "common/textconsole.h" #include "common/system.h" namespace Tinsel { diff --git a/engines/tinsel/timers.h b/engines/tinsel/timers.h index 022604b662..1456d9a1d5 100644 --- a/engines/tinsel/timers.h +++ b/engines/tinsel/timers.h @@ -31,7 +31,7 @@ #include "tinsel/dw.h" namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 40418dcc43..afd409ce27 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -70,6 +70,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" namespace Tinsel { @@ -84,7 +85,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 +427,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 +523,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 +554,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 +569,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 +1197,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 +1953,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 +1966,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 +2129,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 +2182,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 +2298,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 +2491,7 @@ void ResumeLastGame() { * Returns the current run mode */ static int RunMode() { - return clRunMode; + return 0; //clRunMode; } /** @@ -3367,7 +3368,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 +3596,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.cpp b/engines/tinsel/tinsel.cpp index e1396f9715..20d4f1d31a 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -29,22 +29,14 @@ #include "common/events.h" #include "common/EventRecorder.h" #include "common/keyboard.h" -#include "common/file.h" #include "common/fs.h" -#include "common/savefile.h" #include "common/config-manager.h" #include "common/serializer.h" -#include "common/stream.h" #include "backends/audiocd/audiocd.h" #include "engines/util.h" -#include "graphics/cursorman.h" - -#include "base/plugins.h" -#include "base/version.h" - #include "tinsel/actors.h" #include "tinsel/background.h" #include "tinsel/bmv.h" @@ -911,10 +903,10 @@ Common::Error TinselEngine::run() { #else initGraphics(640, 432, true); #endif - _screenSurface.create(640, 432, 1); + _screenSurface.create(640, 432, Graphics::PixelFormat::createFormatCLUT8()); } else { initGraphics(320, 200, false); - _screenSurface.create(320, 200, 1); + _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } g_eventRec.registerRandomSource(_random, "tinsel"); @@ -972,7 +964,7 @@ Common::Error TinselEngine::run() { // errors when loading the save state. if (ConfMan.hasKey("save_slot")) { - if (loadGameState(ConfMan.getInt("save_slot")) == Common::kNoError) + if (loadGameState(ConfMan.getInt("save_slot")).getCode() == Common::kNoError) loadingFromGMM = true; } 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) |