From 696897b0583ad52ebc6f7666525277847619a8ce Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 1 Jan 2009 15:06:43 +0000 Subject: Whoa! Removing trailing spaces. svn-id: r35648 --- engines/tinsel/actors.cpp | 10 ++++---- engines/tinsel/anim.cpp | 6 ++--- engines/tinsel/bg.cpp | 2 +- engines/tinsel/bmv.cpp | 10 ++++---- engines/tinsel/cliprect.cpp | 4 ++-- engines/tinsel/config.cpp | 4 ++-- engines/tinsel/coroutine.h | 4 ++-- engines/tinsel/cursor.cpp | 6 ++--- engines/tinsel/debugger.cpp | 2 +- engines/tinsel/detection.cpp | 10 ++++---- engines/tinsel/dialogs.cpp | 56 ++++++++++++++++++++++---------------------- engines/tinsel/dialogs.h | 2 +- engines/tinsel/events.cpp | 6 ++--- engines/tinsel/graphics.cpp | 20 ++++++++-------- engines/tinsel/handle.cpp | 2 +- engines/tinsel/heapmem.cpp | 2 +- engines/tinsel/move.cpp | 4 ++-- engines/tinsel/music.cpp | 6 ++--- engines/tinsel/object.cpp | 2 +- engines/tinsel/palette.cpp | 4 ++-- engines/tinsel/pcode.cpp | 10 ++++---- engines/tinsel/pcode.h | 4 ++-- engines/tinsel/pdisplay.cpp | 8 +++---- engines/tinsel/play.cpp | 30 ++++++++++++------------ engines/tinsel/play.h | 2 +- engines/tinsel/polygons.cpp | 32 ++++++++++++------------- engines/tinsel/rince.cpp | 10 ++++---- engines/tinsel/saveload.cpp | 12 +++++----- engines/tinsel/savescn.cpp | 10 ++++---- engines/tinsel/scene.cpp | 4 ++-- engines/tinsel/sched.cpp | 14 +++++------ engines/tinsel/sched.h | 26 ++++++++++---------- engines/tinsel/scn.cpp | 2 +- engines/tinsel/scroll.cpp | 8 +++---- engines/tinsel/serializer.h | 8 +++---- engines/tinsel/sound.cpp | 6 ++--- engines/tinsel/sound.h | 4 ++-- engines/tinsel/strres.cpp | 14 +++++------ engines/tinsel/sysvar.h | 2 +- engines/tinsel/text.cpp | 6 ++--- engines/tinsel/text.h | 2 +- engines/tinsel/timers.cpp | 2 +- engines/tinsel/tinlib.cpp | 52 ++++++++++++++++++++-------------------- engines/tinsel/tinsel.cpp | 44 +++++++++++++++++----------------- 44 files changed, 237 insertions(+), 237 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index c2402285b8..6020fa7d24 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -285,7 +285,7 @@ static void ActorTinselProcess(CORO_PARAM, const void *param) { // Run the Glitter code assert(actorInfo[atp->id - 1].actorCode); // no code to run - _ctx->pic = InitInterpretContext(GS_ACTOR, actorInfo[atp->id - 1].actorCode, + _ctx->pic = InitInterpretContext(GS_ACTOR, actorInfo[atp->id - 1].actorCode, atp->event, NOPOLY, atp->id, NULL); CORO_INVOKE_1(Interpret, _ctx->pic); @@ -374,7 +374,7 @@ void ActorEvent(CORO_PARAM, int ano, TINSEL_EVENT tEvent, bool bWait, int myEsca ano, // Actor NULL, // No object myEscape); - + if (atp.pic != NULL) { _ctx->pProc = g_scheduler->createProcess(PID_TCODE, ActorTinselProcess, &atp, sizeof(atp)); AttachInterpret(atp.pic, _ctx->pProc); @@ -386,7 +386,7 @@ void ActorEvent(CORO_PARAM, int ano, TINSEL_EVENT tEvent, bool bWait, int myEsca CORO_END_CODE; } - + /** * Called at the start of each scene for each actor with a code block. * @param as Actor structure @@ -1525,7 +1525,7 @@ bool ActorTagIsWanted(int actor) { } /** - * Given cursor position and an actor number, ascertains + * Given cursor position and an actor number, ascertains * whether the cursor is within the actor's tag area. * Returns True for a positive result, False for negative. */ @@ -1664,7 +1664,7 @@ int GetActorFilmNumber(int ano) { void StoreActorReel(int actor, int column, OBJECT *pObj) { RANGE_CHECK(actor); int i; - + for (i = 0; i < MAX_REELS; i++) { if (actorInfo[actor-1].presColumns[i] == -1) { // Store reel and object diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 055e0bba94..b52d01860b 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -44,8 +44,8 @@ SCRIPTSTATE DoNextFrame(ANIM *pAnim) { const ANI_SCRIPT *pAni = (const ANI_SCRIPT *)LockMem(pAnim->hScript); while (1) { // repeat until a real image - debugC(DEBUG_DETAILED, kTinselDebugAnimations, - "DoNextFrame %ph index=%d, op=%xh", (byte *)pAnim, pAnim->scriptIndex, + debugC(DEBUG_DETAILED, kTinselDebugAnimations, + "DoNextFrame %ph index=%d, op=%xh", (byte *)pAnim, pAnim->scriptIndex, FROM_LE_32(pAni[pAnim->scriptIndex].op)); switch ((int32)FROM_LE_32(pAni[pAnim->scriptIndex].op)) { @@ -212,7 +212,7 @@ SCRIPTSTATE DoNextFrame(ANIM *pAnim) { void InitStepAnimScript(ANIM *pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int aniSpeed) { OBJECT *pObj; // multi-object list iterator - debugC(DEBUG_DETAILED, kTinselDebugAnimations, + debugC(DEBUG_DETAILED, kTinselDebugAnimations, "InitStepAnimScript Object=(%d,%d,%xh) script=%xh aniSpeed=%d rec=%ph", !pAniObj ? 0 : fracToInt(pAniObj->xPos), !pAniObj ? 0 : fracToInt(pAniObj->yPos), diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index a5b4170673..0f83760987 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -211,7 +211,7 @@ static void BGotherProcess(CORO_PARAM, const void *param) { while (StepAnimScript(&_ctx->anim) != ScriptFinished) CORO_SLEEP(1); - + CORO_END_CODE; } diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index feac5d2c76..ef23ce06be 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -285,7 +285,7 @@ static void PrepBMV(const byte *sourceData, int length, short deltaFetchDisp) { // Shift another 2 bits to get hi nibble eax = (eax & 0xffffff00) | ((eax & 0xff) >> 2); NEXT_BYTE(esi); - + if ((eax & 0xC) != 0) { flag = true; ROL(eax, ecx); @@ -679,10 +679,10 @@ static int FollowingPacket(int thisPacket, bool bReallyImportant) { // Following 3 bytes are the length if (bReallyImportant) { // wrapped round or at least 3 bytes - assert(((nextReadSlot * SLOT_SIZE) < thisPacket) || + assert(((nextReadSlot * SLOT_SIZE) < thisPacket) || ((thisPacket + 3) < (nextReadSlot * SLOT_SIZE))); - if ((nextReadSlot * SLOT_SIZE >= thisPacket) && + if ((nextReadSlot * SLOT_SIZE >= thisPacket) && ((thisPacket + 3) >= nextReadSlot*SLOT_SIZE)) { // MaintainBuffer calls this back, but with false MaintainBuffer(); @@ -1005,7 +1005,7 @@ static bool DoBMVFrame(void) { xscr = -640; else xscr = 0; - + PrepBMV(bigBuffer + graphOffset, length, xscr); currentFrame++; @@ -1112,7 +1112,7 @@ void CopyMovieToScreen(void) { int yStart = (SCREEN_HEIGHT - SCREEN_HIGH) / 2; memset(_vm->screen().getBasePtr(0, 0), 0, yStart * SCREEN_WIDTH); memcpy(_vm->screen().getBasePtr(0, yStart), ScreenBeg, SCREEN_WIDTH * SCREEN_HIGH); - memset(_vm->screen().getBasePtr(0, yStart + SCREEN_HIGH), 0, + memset(_vm->screen().getBasePtr(0, yStart + SCREEN_HIGH), 0, (SCREEN_HEIGHT - SCREEN_HIGH - yStart) * SCREEN_WIDTH); BmvDrawText(true); diff --git a/engines/tinsel/cliprect.cpp b/engines/tinsel/cliprect.cpp index b67ae7b17f..bd84cc0049 100644 --- a/engines/tinsel/cliprect.cpp +++ b/engines/tinsel/cliprect.cpp @@ -128,7 +128,7 @@ void FindMovingObjects(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pCli if ((pObj->flags & DMA_CHANGED) || // object changed HasPalMoved(pObj->pPal)) { // or palette moved // object has changed in some way - + Common::Rect rcClip; // objects clipped bounding rectangle Common::Rect rcObj; // objects bounding rectangle @@ -152,7 +152,7 @@ void FindMovingObjects(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pCli rcObj.right = rcObj.left + pObj->width; rcObj.bottom = rcObj.top + pObj->height; - // calc intersection of object with clipping rect + // calc intersection of object with clipping rect if (IntersectRectangle(rcClip, rcObj, *pClip)) { // current position is within clipping rect AddClipRect(rcClip); diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp index bec286a96b..4695a2e435 100644 --- a/engines/tinsel/config.cpp +++ b/engines/tinsel/config.cpp @@ -83,10 +83,10 @@ void WriteConfig(void) { default: lang = Common::EN_ANY; } - + ConfMan.set("language", Common::getLanguageCode(lang)); } - + // Write to disk ConfMan.flushToDisk(); } diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index 8cdbd44b19..30d90970b6 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -35,7 +35,7 @@ namespace Tinsel { * . * However, many improvements and tweaks have been made, in particular * by taking advantage of C++ features not available in C. - * + * * Why is this code here? Well, the Tinsel engine apparently used * setjmp/longjmp based coroutines as a core tool from the start, and * so they are deeply ingrained into the whole code base. When we @@ -45,7 +45,7 @@ namespace Tinsel { * would have meant a major restructuring of the entire code base, a * rather daunting task. Also, it would have very likely introduced * tons of regressons. - * + * * So instead of getting rid of the coroutines, we chose to implement * them in an alternate way, using Simon Tatham's trick as described * above. While the trick is dirty, the result seems to be clear enough, diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp index 3fc3b974e9..c58a15849d 100644 --- a/engines/tinsel/cursor.cpp +++ b/engines/tinsel/cursor.cpp @@ -172,7 +172,7 @@ void SetCursorXY(int newx, int newy) { int Loffset, Toffset; // Screen offset PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset); - newx -= Loffset; + newx -= Loffset; newy -= Toffset; if (GetDriverPosition(&x, &y)) @@ -210,7 +210,7 @@ bool GetCursorXYNoWait(int *x, int *y, bool absolute) { *x += Loffset; *y += Toffset; } - + return true; } @@ -443,7 +443,7 @@ static void DoCursorMove(void) { // get new mouse driver position - could have been modified ptMouse = _vm->getMousePosition(); - + if (lastCursorX != ptMouse.x || lastCursorY != ptMouse.y) { resetUserEventTime(); diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp index 904763e228..b3cb2d1b92 100644 --- a/engines/tinsel/debugger.cpp +++ b/engines/tinsel/debugger.cpp @@ -46,7 +46,7 @@ extern SCNHANDLE GetSceneHandle(void); //----------------- SUPPORT FUNCTIONS --------------------- -//static +//static int strToInt(const char *s) { if (!*s) // No string at all diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 4cae5885b5..32d4562ad9 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -52,8 +52,8 @@ uint32 TinselEngine::getFeatures() const { return _gameDescription->features; } -Common::Language TinselEngine::getLanguage() const { - return _gameDescription->desc.language; +Common::Language TinselEngine::getLanguage() const { + return _gameDescription->desc.language; } Common::Platform TinselEngine::getPlatform() const { @@ -454,14 +454,14 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const; - virtual bool hasFeature(MetaEngineFeature f) const; + virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; bool TinselMetaEngine::hasFeature(MetaEngineFeature f) const { - return + return (f == kSupportsListSaves) || // TODO: See tinsel.cpp ll 994-1005 #if 0 @@ -561,7 +561,7 @@ Common::Error TinselEngine::loadGameState(int slot) { // slot numbers instead of savelist entry numbers for loading. // This would also allow '-2' as slot for CD changes without // any major hackery. - + int listSlot = -1; const int numStates = Tinsel::getList(); for (int i = 0; i < numStates; ++i) { diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index b807abce57..c5d7449d3b 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -351,9 +351,9 @@ struct INV_DEF { int FirstDisp; // Index to first item currently displayed int inventoryX; // } Display position - int inventoryY; // } + int inventoryY; // } int otherX; // } Display position - int otherY; // } + int otherY; // } int MaxInvObj; // Max. allowed contents @@ -417,7 +417,7 @@ static OBJECT *RectObject = 0, *SlideObject = 0; // Current display objects, for // objects are in objArray. static int sliderYpos = 0; // For positioning the slider -static int sliderYmax = 0, sliderYmin = 0; // +static int sliderYmax = 0, sliderYmin = 0; // #define sliderRange (sliderYmax - sliderYmin) @@ -541,14 +541,14 @@ enum BFUNC { OPENQUIT, INITGAME, MUSICVOL, - + HOPPER2, // Call up Scene Hopper 2 BF_CHANGESCENE, CLANG, RLANG #ifdef MAC_OPTIONS - , MASTERVOL, SAMPVOL + , MASTERVOL, SAMPVOL #endif }; @@ -1418,7 +1418,7 @@ static void ObjectProcess(CORO_PARAM, const void *param) { */ void InvTinselEvent(INV_OBJECT *pinvo, TINSEL_EVENT event, PLR_EVENT be, int index) { OP_INIT to = { pinvo, event, be, 0 }; - + if (InventoryHidden || (TinselV2 && !pinvo->hScript)) return; @@ -1523,7 +1523,7 @@ void InvLoadGame(void) { if (iconArray[HL1] != NULL) { MultiDeleteObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL1]); iconArray[HL1] = NULL; - } + } RestoreGame(rGame+cd.extraBase); } } @@ -1643,7 +1643,7 @@ void Select(int i, bool force) { // New highlight box switch (cd.box[i].boxType) { case RGROUP: - iconArray[HL2] = RectangleObject(BgPal(), + iconArray[HL2] = RectangleObject(BgPal(), (TinselV2 ? HighlightColour() : COL_HILIGHT), cd.box[i].w, cd.box[i].h); MultiInsertObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL2]); MultiSetAniXY(iconArray[HL2], @@ -1745,8 +1745,8 @@ void AddToInventory(int invno, int icon, bool hold) { INV_OBJECT *invObj; // Validate trying to add to a legal inventory - assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV - || invno == INV_OPEN || (invno == INV_DEFAULT && TinselV2)); + assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV + || invno == INV_OPEN || (invno == INV_DEFAULT && TinselV2)); if (invno == INV_OPEN) { assert(InventoryState == ACTIVE_INV && (ino == INV_1 || ino == INV_2)); // addopeninv() with inventry not open @@ -2219,11 +2219,11 @@ static int WhichMenuBox(int curX, int curY, bool bSlides) { // Slider on extra window if (cd.bExtraWin) { const Common::Rect &r = TinselV2 ? - Common::Rect(411, 46, 425, 339) : + Common::Rect(411, 46, 425, 339) : Common::Rect(20 + 181, 24 + 2, 20 + 181 + 8, 24 + 139 + 5); if (r.contains(curX, curY)) { - + if (curY < (r.top + (TinselV2 ? 18 : 5))) return IB_UP; else if (curY > (r.bottom - (TinselV2 ? 18 : 5))) @@ -2269,7 +2269,7 @@ void InvBoxes(bool InBody, int curX, int curY) { if (iconArray[HL1] != NULL) { MultiDeleteObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL1]); iconArray[HL1] = NULL; - } + } } else if (index != cd.pointBox) { cd.pointBox = index; // A new box is pointed to - high-light it @@ -2281,7 +2281,7 @@ void InvBoxes(bool InBody, int curX, int curY) { ///* I don't agree */ cd.box[cd.pointBox].boxType == RGROUP || cd.box[cd.pointBox].boxType == AATBUT || cd.box[cd.pointBox].boxType == AABUT) { - iconArray[HL1] = RectangleObject(BgPal(), + iconArray[HL1] = RectangleObject(BgPal(), (TinselV2 ? HighlightColour() : COL_HILIGHT), cd.box[cd.pointBox].w, cd.box[cd.pointBox].h); MultiInsertObject(GetPlayfieldList(FIELD_STATUS), iconArray[HL1]); @@ -2633,7 +2633,7 @@ static void AddBackground(OBJECT **rect, OBJECT **title, int extraH, int extraV, // add it to display list and position it MultiInsertObject(GetPlayfieldList(FIELD_STATUS), *rect); - MultiSetAniXY(*rect, InvD[ino].inventoryX + NM_BG_POS_X, + MultiSetAniXY(*rect, InvD[ino].inventoryX + NM_BG_POS_X, InvD[ino].inventoryY + NM_BG_POS_Y); MultiSetZPosition(*rect, Z_INV_BRECT); @@ -2752,7 +2752,7 @@ void AddBox(int *pi, int i) { *pi += 1; // Stick in the text - if ((cd.box[i].textMethod == TM_POINTER) || + if ((cd.box[i].textMethod == TM_POINTER) || (!TinselV2 && (cd.box[i].ixText == USE_POINTER))) { if (cd.box[i].boxText != NULL) { if (cd.box[i].boxType == RGROUP) { @@ -2849,7 +2849,7 @@ void AddBox(int *pi, int i) { assert(cd.box[i].ixText != USE_POINTER); LoadStringRes(configStrings[cd.box[i].ixText], TextBufferAddr(), TBUFSZ); } - iconArray[*pi] = ObjectTextOut(nullContext, GetPlayfieldList(FIELD_STATUS), + iconArray[*pi] = ObjectTextOut(nullContext, GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0, x + MDTEXT_XOFF, y + MDTEXT_YOFF, GetTagFontHandle(), TXT_RIGHT); MultiSetZPosition(iconArray[*pi], Z_INV_ITEXT); *pi += 1; @@ -2915,7 +2915,7 @@ void AddBox(int *pi, int i) { assert(cd.box[i].ixText != USE_POINTER); LoadStringRes(configStrings[cd.box[i].ixText], TextBufferAddr(), TBUFSZ); } - iconArray[*pi] = ObjectTextOut(nullContext, GetPlayfieldList(FIELD_STATUS), + iconArray[*pi] = ObjectTextOut(nullContext, GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), 0, x+MDTEXT_XOFF, y+MDTEXT_YOFF, GetTagFontHandle(), TXT_RIGHT); MultiSetZPosition(iconArray[*pi], Z_INV_ITEXT); *pi += 1; @@ -3060,7 +3060,7 @@ int AddExtraWindow(int x, int y, OBJECT **retObj) { MultiSetZPosition(retObj[n], Z_INV_MFRAME); n++; retObj[n] = AddObject(&pfilm->reels[IX_H156], -1); // Bottom - MultiSetAniXY(retObj[n], x + (TinselV2 ? TLwidth : 6), y + + MultiSetAniXY(retObj[n], x + (TinselV2 ? TLwidth : 6), y + (TinselV2 ? TLheight + 208 + BLheight + NM_BSY : 143)); MultiSetZPosition(retObj[n], Z_INV_MFRAME); n++; @@ -3241,7 +3241,7 @@ void ConstructInventory(InventoryType filling) { // Bottom side extra retObj[n] = AddObject(&pfilm->reels[IX_H26], -1); MultiSetAniXY(retObj[n], invX + offx, invY + TLheight + eV + BLheight + NM_BSY); - + MultiSetZPosition(retObj[n], zpos); n++; } @@ -3387,7 +3387,7 @@ bool RePosition(void) { InvD[ino].inventoryY += MAXTOP - p; bMoveitMoveit = true; // I like to.... } - + return bMoveitMoveit; } @@ -3731,7 +3731,7 @@ void HideConversation(bool bHide) { case CONV_DEF: InvD[INV_CONV].inventoryY = y - SysVar(SV_CONV_ABOVE_Y); break; - + default: break; } @@ -3764,7 +3764,7 @@ void HideConversation(bool bHide) { int Loffset, Toffset; PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset); - y = GetActorBottom(thisConvActor) - MultiHighest(RectObject) + + y = GetActorBottom(thisConvActor) - MultiHighest(RectObject) + SysVar(SV_CONV_BELOW_Y); y -= Toffset; } @@ -3816,7 +3816,7 @@ bool ConvIsHidden(void) { * Start up an inventory window. */ void PopUpInventory(int invno) { - assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV + assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV || invno == INV_CONF || invno == INV_MENU); // Trying to open illegal inventory if (InventoryState == IDLE_INV) { @@ -4220,7 +4220,7 @@ void InventoryProcess(CORO_PARAM, const void *) { } } else CORO_INVOKE_1(ButtonToggle, g_buttonEffect.box); - + g_buttonEffect.bButAnim = false; } @@ -5098,7 +5098,7 @@ void InvPickup(int index) { return; // If not holding anything - if (HeldItem == INV_NOICON && InvD[ino].contents[index] && + if (HeldItem == INV_NOICON && InvD[ino].contents[index] && (!TinselV2 || InvD[ino].contents[index] != HeldItem)) { // Pick-up invObj = GetInvObject(InvD[ino].contents[index]); @@ -5186,7 +5186,7 @@ static void InvWalkTo(const Common::Point &coOrds) { // To cater for drop in dead space between icons, // look 1 pixel right, then 1 down, then 1 right and down. - if (i == INV_NOICON && HeldItem != INV_NOICON && + if (i == INV_NOICON && HeldItem != INV_NOICON && (ino == INV_1 || ino == INV_2)) { pt.x += 1; // 1 to the right i = InvItem(pt, false); @@ -5203,7 +5203,7 @@ static void InvWalkTo(const Common::Point &coOrds) { if (ino == INV_CONV) { ConvAction(i); - } else + } else InvPickup(i); } break; diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h index faf95c7d1c..670f695a06 100644 --- a/engines/tinsel/dialogs.h +++ b/engines/tinsel/dialogs.h @@ -69,7 +69,7 @@ struct INV_OBJECT { void PopUpInventory(int invno); enum CONFTYPE { - MAIN_MENU, SAVE_MENU, LOAD_MENU, QUIT_MENU, RESTART_MENU, SOUND_MENU, + MAIN_MENU, SAVE_MENU, LOAD_MENU, QUIT_MENU, RESTART_MENU, SOUND_MENU, CONTROLS_MENU, SUBTITLES_MENU, HOPPER_MENU1, HOPPER_MENU2, TOP_WINDOW }; diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp index 91f75fe71e..ea5dbf0655 100644 --- a/engines/tinsel/events.cpp +++ b/engines/tinsel/events.cpp @@ -310,7 +310,7 @@ static void ProcessUserEvent(TINSEL_EVENT uEvent, const Common::Point &coOrds, P GetCursorXY(&aniX, &aniY, true); // There could be a poly involved which has no tag. - if ((hPoly = InPolygon(aniX, aniY, TAG)) != NOPOLY || + if ((hPoly = InPolygon(aniX, aniY, TAG)) != NOPOLY || (!TinselV2 && ((hPoly = InPolygon(aniX, aniY, EXIT)) != NOPOLY))) { if (TinselV2 && (uEvent != PROV_WALKTO)) PolygonEvent(nullContext, hPoly, uEvent, 0, false, 0); @@ -391,7 +391,7 @@ void PlayerEvent(PLR_EVENT pEvent, const Common::Point &coOrds) { "PLR_MENU", "PLR_QUIT", "PLR_PGUP", "PLR_PGDN", "PLR_HOME", "PLR_END", "PLR_DRAG1_START", "PLR_DRAG1_END", "PLR_DRAG2_START", "PLR_DRAG2_END", "PLR_JUMP", "PLR_NOEVENT"}; - debugC(DEBUG_BASIC, kTinselDebugActions, "%s - (%d,%d)", + debugC(DEBUG_BASIC, kTinselDebugActions, "%s - (%d,%d)", actionList[pEvent], coOrds.x, coOrds.y); static uint32 lastRealAction = 0; @@ -602,7 +602,7 @@ void PolyTinselProcess(CORO_PARAM, const void *param) { /** * Run the Polygon process with the given event */ -void PolygonEvent(CORO_PARAM, HPOLYGON hPoly, TINSEL_EVENT tEvent, int actor, bool bWait, +void PolygonEvent(CORO_PARAM, HPOLYGON hPoly, TINSEL_EVENT tEvent, int actor, bool bWait, int myEscape, bool *result) { CORO_BEGIN_CONTEXT; PTP_INIT to; diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 210bff0d5f..4209d1fe33 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -63,7 +63,7 @@ static void t0WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply int leftClip = applyClipping ? pObj->leftClip : 0; int rightClip = applyClipping ? pObj->rightClip : 0; - + // Horizontal loop for (int x = 0; x < pObj->width; ) { uint32 numBytes = READ_UINT32(srcP); @@ -91,7 +91,7 @@ static void t0WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply } else { // Copy a specified sequence length of pixels srcP += clipAmount; - + int runLength = numBytes - clipAmount; int rptLength = MAX(MIN(runLength, pObj->width - rightClip - x), 0); if (yClip == 0) { @@ -209,7 +209,7 @@ static void WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool applyCl tempDest += boxBounds.right - boxBounds.left + 1; width -= 3 - boxBounds.left + 1; - + // None of the remaining horizontal blocks should be left clipped boxBounds.left = 0; } @@ -340,7 +340,7 @@ static void WrtTrans(DRAWOBJECT *pObj, uint8 *destP, bool applyClipping) { return; } - // Set up the offset between destination lines + // Set up the offset between destination lines int lineOffset = SCREEN_WIDTH - pObj->width; // Loop through any remaining lines @@ -350,7 +350,7 @@ static void WrtTrans(DRAWOBJECT *pObj, uint8 *destP, bool applyClipping) { --pObj->height; destP += lineOffset; - } + } } /** @@ -494,7 +494,7 @@ void ClearScreen() { void *pDest = _vm->screen().getBasePtr(0, 0); memset(pDest, 0, SCREEN_WIDTH * SCREEN_HEIGHT); g_system->clearScreen(); - g_system->updateScreen(); + g_system->updateScreen(); } /** @@ -505,7 +505,7 @@ void UpdateScreenRect(const Common::Rect &pClip) { byte *pSrc = (byte *)_vm->screen().getBasePtr(pClip.left, pClip.top); g_system->copyRectToScreen(pSrc, _vm->screen().pitch, pClip.left, pClip.top + yOffset, pClip.width(), pClip.height()); - g_system->updateScreen(); + g_system->updateScreen(); } /** @@ -515,7 +515,7 @@ void DrawObject(DRAWOBJECT *pObj) { uint8 *srcPtr = NULL; uint8 *destPtr; - if ((pObj->width <= 0) || (pObj->height <= 0)) + if ((pObj->width <= 0) || (pObj->height <= 0)) // Empty image, so return immediately return; @@ -527,7 +527,7 @@ void DrawObject(DRAWOBJECT *pObj) { pObj->transOffset = 0; } else { byte *p = (byte *)LockMem(pObj->hBits & HANDLEMASK); - + srcPtr = p + (pObj->hBits & OFFSETMASK); pObj->charBase = (char *)p + READ_LE_UINT32(p + 0x10); pObj->transOffset = READ_LE_UINT32(p + 0x14); @@ -536,7 +536,7 @@ void DrawObject(DRAWOBJECT *pObj) { // Get destination starting point destPtr = (byte *)_vm->screen().getBasePtr(pObj->xPos, pObj->yPos); - + // Handle various draw types uint8 typeId = pObj->flags & 0xff; diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 41774a9c88..b463244123 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -411,7 +411,7 @@ uint8 *LockMem(SCNHANDLE offset) { if (pH->pNode->pBaseAddr && (pH->filesize & fLoaded)) // already allocated and loaded return pH->pNode->pBaseAddr + (offset & OFFSETMASK); - + if (pH->pNode->pBaseAddr == NULL) // must have been discarded - reallocate the memory MemoryReAlloc(pH->pNode, pH->filesize & FSIZE_MASK, diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index 704f3c8104..e77f505edb 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -259,7 +259,7 @@ bool HeapCompact(long size, bool bDiscard) { } } } - + if (pOldest) // discard the oldest block MemoryDiscard(pOldest); diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp index 20e4175e01..4422a7cf4a 100644 --- a/engines/tinsel/move.cpp +++ b/engines/tinsel/move.cpp @@ -1195,7 +1195,7 @@ static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY, // Ignore if already in it (it may have just appeared) if (!InMoverBlock(pMover, pMover->objX, pMover->objY)) { *s2 = ENTERING_MBLOCK; // Trying to walk through an actor - + *hS2p = -1; if (collisionActor) *collisionActor = ma; @@ -1359,7 +1359,7 @@ int SetActorDest(PMOVER pMover, int clickX, int clickY, bool igPath, SCNHANDLE h } } else { int wodResult = WorkOutDestination(clickX, clickY, &targetX, &targetY); - + if (pMover->actorID == GetLeadId()) { lastLeadXdest = targetX; lastLeadYdest = targetY; diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 979fc61270..4e5b890335 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -124,7 +124,7 @@ const int enhancedAudioSCNVersion[] = { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 52, 4, - 0, 0, 0, 0 + 0, 0, 0, 0 }; int GetTrackNumber(SCNHANDLE hMidi) { @@ -918,8 +918,8 @@ void dumpMusic() { int outFileSize = 0; char buffer[20000]; - int total = (_vm->getFeatures() & GF_SCNFILES) ? - ARRAYSIZE(midiOffsetsSCNVersion) : + int total = (_vm->getFeatures() & GF_SCNFILES) ? + ARRAYSIZE(midiOffsetsSCNVersion) : ARRAYSIZE(midiOffsetsGRAVersion); for (int i = 0; i < total; i++) { diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index c9766631f9..6add275341 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -252,7 +252,7 @@ void SortObjectList(OBJECT *pObjList) { // set head of list dummy OBJ Z Y values to lowest possible head.yPos = intToFrac(MIN_INT16); head.zPos = MIN_INT; - + for (pPrev = &head, pObj = head.pNext; pObj != NULL; pPrev = pObj, pObj = pObj->pNext) { // check Z order if (pObj->zPos < pPrev->zPos) { diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index afbe6555fc..cd628439ad 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -376,7 +376,7 @@ void SwapPalette(PALQ *pPalQ, SCNHANDLE hNewPal) { // Copy all the colours memcpy(pPalQ->palRGB, pNewPal->palRGB, pNewPal->numColours * sizeof(COLORREF)); - + if (!pPalQ->bFading) // Q the change to the video DAC UpdateDACqueue(pPalQ->posInDAC, FROM_LE_32(pNewPal->numColours), pPalQ->palRGB); @@ -496,7 +496,7 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) { // map the Value field to one of the 4 colours reserved for the translucent palette val /= 63; - transPalette[i + 1] = (uint8)((val == 0) ? 0 : val + + transPalette[i + 1] = (uint8)((val == 0) ? 0 : val + (TinselV2 ? TranslucentColour() : COL_HILIGHT) - 1); } } diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index 81e7459c71..b90a90bfc2 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -160,7 +160,7 @@ static void FreeWaitCheck(PINT_CONTEXT pic, bool bVoluntary) { (icList + i)->waitNumber2 = 0; break; } - } + } } // Is someone waiting for this? @@ -249,7 +249,7 @@ void FreeMasterInterpretContext(void) { * @param actorId Associated actor (if any) * @param pinvo Associated inventory object */ -INT_CONTEXT *InitInterpretContext(GSORT gsort, SCNHANDLE hCode, TINSEL_EVENT event, +INT_CONTEXT *InitInterpretContext(GSORT gsort, SCNHANDLE hCode, TINSEL_EVENT event, HPOLYGON hpoly, int actorid, INV_OBJECT *pinvo, int myEscape) { INT_CONTEXT *ic; @@ -326,7 +326,7 @@ void RegisterGlobals(int num) { if (TinselV2) { // read initial values CdCD(nullContext); - + Common::File f; if (!f.open(GLOBALS_FILENAME)) error(CANNOT_FIND_FILE, GLOBALS_FILENAME); @@ -340,7 +340,7 @@ void RegisterGlobals(int num) { if (f.ioFailed()) error(FILE_IS_CORRUPT, GLOBALS_FILENAME); - + f.close(); } } @@ -514,7 +514,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) { // same spot (i.e. here). // // The reasons we do it this way, instead of turning Interpret into - // a 'proper' coroutine are (1) we avoid implementation problems + // a 'proper' coroutine are (1) we avoid implementation problems // (CORO_INVOKE involves adding 'case' statements, but Interpret // already has a huge switch/case, so that would not work out of the // box), (2) we incurr less overhead, (3) it's easier to debug, diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h index fef45d5e03..ec8b9e4587 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -41,7 +41,7 @@ enum RESUME_STATE { }; enum { - PCODE_STACK_SIZE = 128 //!< interpeters stack size + PCODE_STACK_SIZE = 128 //!< interpeters stack size }; enum GSORT { @@ -128,7 +128,7 @@ void WaitInterpret(CORO_PARAM, PPROCESS pWaitProc, bool *result); #define CONV_BOTTOM 1 // conversation() parameter #define CONV_END 2 // -#define CONTROL_OFF 0 // control() +#define CONTROL_OFF 0 // control() #define CONTROL_ON 1 // parameter #define CONTROL_OFFV 2 // #define CONTROL_OFFV2 3 // diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index 8cb6fcde0e..0eecaf28ef 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -317,7 +317,7 @@ int GetTaggedActor(void) { } /** - * Tag process keeps us updated as to which polygon is currently tagged + * Tag process keeps us updated as to which polygon is currently tagged * (if one is). Tag process asks us for this information, as does ProcessUserEvent(). */ static void SaveTaggedPoly(HPOLYGON hp) { @@ -559,7 +559,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) { int strLen; if (GetPolyTagHandle(hp) != 0) strLen = LoadStringRes(GetPolyTagHandle(hp), TextBufferAddr(), TBUFSZ); - else + else strLen = LoadStringRes(hTagtext, TextBufferAddr(), TBUFSZ); if (strLen == 0) @@ -656,7 +656,7 @@ void TagProcess(CORO_PARAM, const void *) { CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - + _ctx->pText = NULL; _ctx->Tag = NO_HOTSPOT_TAG; @@ -735,7 +735,7 @@ static void leavingpoly(CORO_PARAM, HPOLYGON hp) { SetPolyTagWanted(hp, false, false, 0); } else if (PolyTagState(hp) == TAG_ON) { - // Delete this tag entry + // Delete this tag entry SetPolyTagState(hp, TAG_OFF); } diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp index e42a531939..55616863ee 100644 --- a/engines/tinsel/play.cpp +++ b/engines/tinsel/play.cpp @@ -277,7 +277,7 @@ static void SoundReel(CORO_PARAM, SCNHANDLE hFilm, int column, int speed, } else if (pAni[_ctx->frameNumber].op == ANI_ADJUSTXY) { _ctx->frameNumber += 3; } else { - // ANI_STOP, ANI_HIDE, ANI_HFLIP, + // ANI_STOP, ANI_HIDE, ANI_HFLIP, // ANI_VFLIP, ANI_HVFLIP, default _ctx->frameNumber++; } @@ -388,7 +388,7 @@ static void ResSoundReel(CORO_PARAM, const void *) { CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_ARGS(SoundReel, (CORO_SUBCTX, soundReels[i].hFilm, soundReels[i].column, + CORO_INVOKE_ARGS(SoundReel, (CORO_SUBCTX, soundReels[i].hFilm, soundReels[i].column, -1, 0, soundReels[i].actorCol)); CORO_KILL_SELF(); @@ -422,11 +422,11 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) { CORO_BEGIN_CONTEXT; OBJECT *pPlayObj; // Object ANIM thisAnim; // Animation structure - + bool mActor; // Gets set if this is a moving actor bool lifeNoMatter; bool replaced; - + const FREEL *pfreel; // The 'column' to play int stepCount; int frameCount; @@ -658,13 +658,13 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) { /** * - Don't bother if this reel is already playing for this actor. * - If explicit co-ordinates, use these, If embedded co-ordinates, - * leave alone, otherwise use actor's current position. - * - Moving actors get hidden during this play, other actors get - * replaced by this play. + * leave alone, otherwise use actor's current position. + * - Moving actors get hidden during this play, other actors get + * replaced by this play. * - Column 0 of a film gets its appropriate Z-position, slave columns - * get slightly bigger Z-positions, in column order. + * get slightly bigger Z-positions, in column order. * - Play proceeds until the script finishes, another reel starts up for - * this actor, or the actor gets killed. + * this actor, or the actor gets killed. * - If called from an splay(), moving actor's co-ordinates are updated * after the play, any walk still in progress will go on from there. * @param x Co-ordinates from the play(), set to (-1, -1) if none @@ -854,7 +854,7 @@ static void t2PlayReel(CORO_PARAM, int x, int y, bool bRestore, int speed, SCNHA */ InitStepAnimScript(&_ctx->thisAnim, _ctx->pPlayObj, _ctx->pFreel->script, speed); - if (bRestore || (ActorEsc(_ctx->reelActor) == true && + if (bRestore || (ActorEsc(_ctx->reelActor) == true && ActorEev(_ctx->reelActor) != GetEscEvents())) { // From restore, step to jump or end SkipFrames(&_ctx->thisAnim, -1); @@ -938,7 +938,7 @@ static void PlayProcess(CORO_PARAM, const void *param) { CORO_BEGIN_CODE(_ctx); if (TinselV2) - CORO_INVOKE_ARGS(t2PlayReel, (CORO_SUBCTX, ppi->x, ppi->y, ppi->bRestore, ppi->speed, + CORO_INVOKE_ARGS(t2PlayReel, (CORO_SUBCTX, ppi->x, ppi->y, ppi->bRestore, ppi->speed, ppi->hFilm, ppi->column, ppi->myescEvent, ppi->bTop)); else CORO_INVOKE_1(t1PlayReel, ppi); @@ -968,7 +968,7 @@ void NewestFilm(SCNHANDLE film, const FREEL *reel) { * NOTE: The processes are started in reverse order so that the first * column's process kicks in first. */ -void PlayFilm(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, bool escOn, +void PlayFilm(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, bool escOn, int myescEvent, bool bTop) { assert(hFilm != 0); // Trying to play NULL film const FILM *pFilm; @@ -1027,7 +1027,7 @@ void PlayFilm(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int myescEvent, bool bT * Start up a play process for each slave column in a film. * Play the first column directly from the parent process. */ -void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, +void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, bool escOn, int myescEvent, bool bTop) { CORO_BEGIN_CONTEXT; PPINIT ppi; @@ -1039,7 +1039,7 @@ void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool spla assert(hFilm != 0); // Trying to play NULL film const FILM *pFilm; - + pFilm = (const FILM *)LockMem(hFilm); // Now allowed empty films! @@ -1059,7 +1059,7 @@ void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool spla _ctx->ppi.escOn = escOn; _ctx->ppi.myescEvent = myescEvent; - // Start display process for each secondary reel in the film in Tinsel 1, + // Start display process for each secondary reel in the film in Tinsel 1, // or all of them in Tinsel 2 for (int i = FROM_LE_32(pFilm->numreels) - 1; i >= (TinselV2 ? 0 : 1); i--) { NewestFilm(hFilm, &pFilm->reels[i]); diff --git a/engines/tinsel/play.h b/engines/tinsel/play.h index 5cdca25faa..dd79b304f8 100644 --- a/engines/tinsel/play.h +++ b/engines/tinsel/play.h @@ -47,7 +47,7 @@ void PlayFilm(CORO_PARAM, SCNHANDLE film, int x, int y, int actorid, bool splay, void PlayFilm(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int myescEvent, bool bTop); -void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, +void PlayFilmc(CORO_PARAM, SCNHANDLE hFilm, int x, int y, int actorid, bool splay, bool sfact, bool escOn, int myescEvent, bool bTop); void RestoreActorReels(SCNHANDLE hFilm, short reelnum, short z, int x, int y); diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 7d00a8a37a..184bd24f6b 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -95,7 +95,7 @@ struct POLYGON { int a[4]; // y1-y2 } int b[4]; // x2-x1 } See IsInPolygon() long c[4]; // y1x2 - x1y2 } - + /* * Internal derived data for speed and conveniance * set up by PseudoCentre() @@ -173,7 +173,7 @@ public: int32 nodecount; //!b2); //!< b squared int32 a2pb2 = (int)FROM_LE_32(line->a2pb2); //!< a squared + b squared int32 ra2pb2 = (int)FROM_LE_32(line->ra2pb2); //!< root(a squared + b squared) - + int32 ab = (int)FROM_LE_32(line->ab); int32 ac = (int)FROM_LE_32(line->ac); int32 bc = (int)FROM_LE_32(line->bc); @@ -736,7 +736,7 @@ static const POLYGON *TryPath(POLYGON *last, POLYGON *whereto, POLYGON *current) */ static HPOLYGON PathOnTheWay(HPOLYGON from, HPOLYGON to) { // TODO: Fingolfin says: This code currently uses DFS (depth first search), - // in the TryPath function, to compute a path between 'from' and 'to'. + // in the TryPath function, to compute a path between 'from' and 'to'. // However, a BFS (breadth first search) might yield more natural results, // at least in cases where there are multiple possible paths. // There is a small risk of regressions caused by such a change, though. @@ -753,7 +753,7 @@ static HPOLYGON PathOnTheWay(HPOLYGON from, HPOLYGON to) { for (i = 0; i < MAX_POLY; i++) { // For each polygon.. POLYGON *p = Polys[i]; - if (p && p->polyType == PATH) //...if it's a path + if (p && p->polyType == PATH) //...if it's a path p->tried = false; } Polys[from]->tried = true; @@ -818,7 +818,7 @@ int NearestEndNode(HPOLYGON hPath, int x, int y) { nlistx = (int32 *)(pps + (int)FROM_LE_32(ptp.pnodelistx)); nlisty = (int32 *)(pps + (int)FROM_LE_32(ptp.pnodelisty)); - + const int nodecount = (int)FROM_LE_32(ptp.nodecount); d1 = ABS(x - (int)FROM_LE_32(nlistx[0])) + ABS(y - (int)FROM_LE_32(nlisty[0])); @@ -926,7 +926,7 @@ int NearestNodeWithin(HPOLYGON hNpath, int x, int y) { */ void NearestCorner(int *x, int *y, HPOLYGON hStartPoly, HPOLYGON hDestPoly) { const POLYGON *psp, *pdp; - int j; + int j; int ncorn = 0; // nearest corner HPOLYGON hNpath = NOPOLY; // path containing nearest corner int ThisD, SmallestD = 1000; @@ -942,7 +942,7 @@ void NearestCorner(int *x, int *y, HPOLYGON hStartPoly, HPOLYGON hDestPoly) { for (j = 0; j < 4; j++) { if (IsInPolygon(psp->cx[j], psp->cy[j], hDestPoly)) { ThisD = ABS(*x - psp->cx[j]) + ABS(*y - psp->cy[j]); - if (ThisD < SmallestD) { + if (ThisD < SmallestD) { hNpath = hStartPoly; ncorn = j; // Try to ignore it if virtually stood on it @@ -956,7 +956,7 @@ void NearestCorner(int *x, int *y, HPOLYGON hStartPoly, HPOLYGON hDestPoly) { for (j = 0; j < 4; j++) { if (IsInPolygon(pdp->cx[j], pdp->cy[j], hStartPoly)) { ThisD = ABS(*x - pdp->cx[j]) + ABS(*y - pdp->cy[j]); - if (ThisD < SmallestD) { + if (ThisD < SmallestD) { hNpath = hDestPoly; ncorn = j; // Try to ignore it if virtually stood on it @@ -1187,7 +1187,7 @@ bool deadPolys[MAX_POLY]; // Currently just for dead blocks void RebootDeadTags(void) { nextfreeT = numScenesT = 0; nextfreeE = numScenesE = 0; - + memset(SceneTags, 0, sizeof(SceneTags)); memset(SceneExits, 0, sizeof(SceneExits)); memset(TagStates, 0, sizeof(TagStates)); @@ -1357,14 +1357,14 @@ static void SetPathAdjacencies() { // For each polygon.. for (i1 = 0; i1 < MAX_POLY-1; i1++) { - // Get polygon, but only carry on if it's a path + // Get polygon, but only carry on if it's a path p1 = Polys[i1]; if (!p1 || p1->polyType != PATH) continue; // For each subsequent polygon.. for (i2 = i1 + 1; i2 < MAX_POLY; i2++) { - // Get polygon, but only carry on if it's a path + // Get polygon, but only carry on if it's a path p2 = Polys[i2]; if (!p2 || p2->polyType != PATH) continue; @@ -1421,7 +1421,7 @@ void CheckNPathIntegrity() { for (i = 0; i < MAX_POLY; i++) { // For each polygon.. rp = Polys[i]; - if (rp && rp->polyType == PATH && rp->subtype == NODE) { //...if it's a node path + if (rp && rp->polyType == PATH && rp->subtype == NODE) { //...if it's a node path // Get compiled polygon structure cp = (const POLY *)pps + rp->pIndex; // This polygon nlistx = (int32 *)(pps + (int)FROM_LE_32(cp.pnodelistx)); @@ -1495,7 +1495,7 @@ static void SetExTags(SCNHANDLE ph) { return; } } - + i = numScenesT++; currentTScene = i; assert(numScenesT < MAX_SCENES); // Dead tag remembering: scene limit @@ -1582,7 +1582,7 @@ static void FiddlyBit(POLYGON *p) { p->lright[t1] = MAX(p->cx[t1], p->cx[(t1+1)%4]); p->lleft[t1] = MIN(p->cx[t1], p->cx[(t1+1)%4]); - p->ltop[t1] = MIN(p->cy[t1], p->cy[(t1+1)%4]); + p->ltop[t1] = MIN(p->cy[t1], p->cy[(t1+1)%4]); p->lbottom[t1] = MAX(p->cy[t1], p->cy[(t1+1)%4]); p->a[t1] = p->cy[t1] - p->cy[(t1+1)%4]; diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index 6590aed749..f92b8800db 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -229,7 +229,7 @@ void HideMover(PMOVER pMover, int sf) { if (!TinselV2) { // sf is only passed in Tinsel v1 pMover->SlowFactor = sf; - } else { + } else { // Tinsel 2 specific code if (IsTaggedActor(pMover->actorID)) { // It may be pointed to @@ -575,7 +575,7 @@ void AlterMover(PMOVER pMover, SCNHANDLE film, AR_FUNCTION fn) { StepAnimScript(&pMover->actorAnim); // 04/01/95 #endif } - + // Hang on, we may not want him yet! 04/01/95 if (pMover->bHidden) MultiSetZPosition(pMover->actorObj, -1); @@ -689,7 +689,7 @@ static void InitialPathChecks(PMOVER pMover, int xpos, int ypos) { z = GetScale(FirstPathPoly(), pMover->objY); } - SetMoverWalkReel(pMover, FORWARD, z, false); + SetMoverWalkReel(pMover, FORWARD, z, false); } static void MoverProcessHelper(int X, int Y, int id, PMOVER pMover) { @@ -758,7 +758,7 @@ void T1MoverProcess(CORO_PARAM, const void *param) { const PMOVER pActor = *(const PMOVER *)param; CORO_BEGIN_CODE(_ctx); - + while (1) { if (pActor->bSpecReel) { if (!pActor->bHidden) @@ -882,7 +882,7 @@ PMOVER InMoverBlock(PMOVER pMover, int x, int y) { caR = GetMoverRight(pMover) + x - caX; for (int i = 0; i < MAX_MOVERS; i++) { - if (pMover == &Movers[i] || + if (pMover == &Movers[i] || (TinselV2 && (Movers[i].actorObj == NULL)) || (!TinselV2 && !Movers[i].bActive)) continue; diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 02153aed59..05fad82a66 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -157,7 +157,7 @@ static bool syncSaveGameHeader(Serializer &s, SaveGameHeader &hdr) { } static void syncSavedMover(Serializer &s, SAVED_MOVER &sm) { - SCNHANDLE *pList[3] = { (SCNHANDLE *)&sm.walkReels, + SCNHANDLE *pList[3] = { (SCNHANDLE *)&sm.walkReels, (SCNHANDLE *)&sm.standReels, (SCNHANDLE *)&sm.talkReels }; s.syncAsUint32LE(sm.bActive); @@ -165,7 +165,7 @@ static void syncSavedMover(Serializer &s, SAVED_MOVER &sm) { s.syncAsSint32LE(sm.objX); 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) @@ -281,7 +281,7 @@ static char *NewName(void) { static char result[FNAMELEN]; int i; int ano = 1; // Allocated number - + while (1) { Common::String fname = _vm->getSavegameFilename(ano); strcpy(result, fname.c_str()); @@ -343,7 +343,7 @@ int getList(Common::SaveFileManager *saveFileMan, const Common::String &target) if (difftime(mktime(&hdr.dateTime), mktime(&savedFiles[i].dateTime)) > 0) { Common::copy_backward(&savedFiles[i], &savedFiles[numSfiles], &savedFiles[numSfiles + 1]); break; - } + } } #endif @@ -366,7 +366,7 @@ int getList(void) { // TODO/FIXME: Just always reload this data? Be careful about slow downs!!! if (!NeedLoad) return numSfiles; - + return getList(_vm->getSaveFileMan(), _vm->getTargetName()); } @@ -478,7 +478,7 @@ static void DoSave(void) { return; Serializer s(0, f); - + // Write out a savegame header SaveGameHeader hdr; hdr.id = SAVEGAME_ID; diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index 66564f1c81..32f375290f 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -226,7 +226,7 @@ static void SortMAProcess(CORO_PARAM, const void *) { HideMover(GetMover(rsd->SavedMoverInfo[_ctx->i].actorID)); } - ActorPalette(rsd->SavedMoverInfo[_ctx->i].actorID, + ActorPalette(rsd->SavedMoverInfo[_ctx->i].actorID, rsd->SavedMoverInfo[_ctx->i].startColour, rsd->SavedMoverInfo[_ctx->i].paletteLength); if (rsd->SavedMoverInfo[_ctx->i].brightness != BOGUS_BRIGHTNESS) @@ -237,7 +237,7 @@ static void SortMAProcess(CORO_PARAM, const void *) { SetSysVar(ISV_DIVERT_ACTOR, _ctx->viaActor); bNotDoneYet = false; - + CORO_END_CODE; } @@ -311,7 +311,7 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) { case RS_COUNT: _vm->_sound->stopAllSamples(); ClearScreen(); - + // Master script only affected on restore game, not restore scene if (TinselV2 && (sd == &sgData)) { g_scheduler->killMatchingProcess(PID_MASTER_SCR); @@ -350,7 +350,7 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) { PlayfieldSetPos(FIELD_WORLD, sd->SavedLoffset, sd->SavedToffset); SetNoBlocking(sd->SavedNoBlocking); } - + RestoreNoScrollData(&sd->SavedNoScrollData); if (TinselV2) { @@ -422,7 +422,7 @@ void SaveGame(char *name, char *desc) { DoSaveScene(&sgData); RequestSaveGame(name, desc, &sgData, &savedSceneCount, ssData); - + // Actual saving is performed by ProcessSRQueue } diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index 8826d97099..b0aac5b605 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -245,7 +245,7 @@ static void LoadScene(SCNHANDLE scene, int entry) { // Music stuff char *cptr = (char *)FindChunk(scene, CHUNK_MUSIC_FILENAME); assert(cptr); - _vm->_pcmMusic->setMusicSceneDetails(FROM_LE_32(ss->hMusicScript), + _vm->_pcmMusic->setMusicSceneDetails(FROM_LE_32(ss->hMusicScript), FROM_LE_32(ss->hMusicSegment), cptr); } @@ -289,7 +289,7 @@ static void LoadScene(SCNHANDLE scene, int entry) { ++es; else es = (const ENTRANCE_STRUC *)((const byte *)es + 8); - + } if (i == FROM_LE_32(ss->numEntrance)) diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index 526ad3fcf6..8ced3ba9c0 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -69,17 +69,17 @@ Scheduler::Scheduler() { #endif pRCfunction = 0; - + active = new PROCESS; active->pPrevious = NULL; - + g_scheduler = this; // FIXME HACK } Scheduler::~Scheduler() { free(processList); processList = NULL; - + delete active; active = 0; } @@ -342,7 +342,7 @@ PROCESS *Scheduler::createProcess(int pid, CORO_ADDR coroAddr, const void *pPara if (pProc->pNext) pProc->pNext->pPrevious = pProc; active->pNext = pProc; - + } // set coroutine entry point @@ -377,7 +377,7 @@ PROCESS *Scheduler::createProcess(int pid, CORO_ADDR coroAddr, const void *pPara void Scheduler::killProcess(PROCESS *pKillProc) { // make sure a valid process pointer assert(pKillProc >= processList && pKillProc <= processList + NUM_PROCESS - 1); - + // can not kill the current process using killProcess ! assert(pCurrent != pKillProc); @@ -490,7 +490,7 @@ int Scheduler::killMatchingProcess(int pidKill, int pidMask) { /** * Set pointer to a function to be called by killProcess(). - * + * * May be called by a resource allocator, the function supplied is * called by killProcess() to allow the resource allocator to free * resources allocated to the dying process. @@ -603,7 +603,7 @@ void SceneProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait if (_ctx->pic == NULL) return; - _ctx->pProc = g_scheduler->createProcess(PID_PROCESS + i, ProcessTinselProcess, + _ctx->pProc = g_scheduler->createProcess(PID_PROCESS + i, ProcessTinselProcess, &_ctx->pic, sizeof(_ctx->pic)); AttachInterpret(_ctx->pic, _ctx->pProc); break; diff --git a/engines/tinsel/sched.h b/engines/tinsel/sched.h index 1e2d3f796e..67b11271cd 100644 --- a/engines/tinsel/sched.h +++ b/engines/tinsel/sched.h @@ -49,7 +49,7 @@ struct PROCESS { PROCESS *pPrevious; //!< pointer to previous process in active or free list CoroContext state; //!< the state of the coroutine - CORO_ADDR coroAddr; //!< the entry point of the coroutine + CORO_ADDR coroAddr; //!< the entry point of the coroutine int sleepTime; //!< number of scheduler cycles to sleep int pid; //!< process ID @@ -66,18 +66,18 @@ class Scheduler { public: /** Pointer to a function of the form "void function(PPROCESS)" */ typedef void (*VFPTRPP)(PROCESS *); - + private: - + /** list of all processes */ PROCESS *processList; - + /** active process list - also saves scheduler state */ PROCESS *active; - + /** pointer to free process list */ PROCESS *pFreeProcesses; - + /** the currently active process */ PROCESS *pCurrent; @@ -88,7 +88,7 @@ private: void CheckStack(); #endif - + /** * Called from killProcess() to enable other resources * a process may be allocated to be released. @@ -102,11 +102,11 @@ public: ~Scheduler(); void reset(); - + #ifdef DEBUG void printStats(); #endif - + void schedule(); void rescheduleAll(); void reschedule(PPROCESS pReSchedProc = NULL); @@ -114,12 +114,12 @@ public: PROCESS *createProcess(int pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam); void killProcess(PROCESS *pKillProc); - + PROCESS *getCurrentProcess(); int getCurrentPID() const; int killMatchingProcess(int pidKill, int pidMask = -1); - - + + void setResourceCallback(VFPTRPP pFunc); }; @@ -131,7 +131,7 @@ extern Scheduler *g_scheduler; // FIXME: Temporary global var, to be used until void SceneProcesses(uint32 numProcess, SCNHANDLE hProcess); void CallSceneProcess(uint32 procID); void KillSceneProcess(uint32 procID); -void SceneProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait, +void SceneProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait, int myEscape, bool *result = NULL); void RestoreSceneProcess(INT_CONTEXT *pic); diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 2825a90fe3..e0b4188b90 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -55,7 +55,7 @@ byte *FindChunk(SCNHANDLE handle, uint32 chunk) { // V0 chunk types can be found by substracting 2 from the // chunk type. Note that CHUNK_STRING and CHUNK_BITMAP are // the same in V0 and V1 - if (TinselVersion == TINSEL_V0 && + if (TinselVersion == TINSEL_V0 && chunk != CHUNK_STRING && chunk != CHUNK_BITMAP) chunk -= 0x2L; diff --git a/engines/tinsel/scroll.cpp b/engines/tinsel/scroll.cpp index 579775c91f..f31f596c43 100644 --- a/engines/tinsel/scroll.cpp +++ b/engines/tinsel/scroll.cpp @@ -58,11 +58,11 @@ static int oldx = 0, oldy = 0; /** Boundaries and numbers of boundaries */ static SCROLLDATA sd = { { - {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, + {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }, { - {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, + {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }, 0, @@ -415,9 +415,9 @@ void ScrollProcess(CORO_PARAM, const void *) { CORO_BEGIN_CODE(_ctx); - // In Tinsel v2, scenes may play movies, so the background may not always + // In Tinsel v2, scenes may play movies, so the background may not always // already be initialised like it is in v1 - while (!GetBgObject()) + while (!GetBgObject()) CORO_SLEEP(1); ImageH = BgHeight(); // Dimensions diff --git a/engines/tinsel/serializer.h b/engines/tinsel/serializer.h index 98ee398ef8..8984cb4757 100644 --- a/engines/tinsel/serializer.h +++ b/engines/tinsel/serializer.h @@ -45,7 +45,7 @@ namespace Tinsel { } \ _bytesSynced += SIZE; \ } - + // TODO: Write comment for this // TODO: Inspired by the SCUMM engine -- move to common/ code and use in more engines? @@ -58,9 +58,9 @@ public: bool isSaving() { return (_saveStream != 0); } bool isLoading() { return (_loadStream != 0); } - + uint bytesSynced() const { return _bytesSynced; } - + void syncBytes(byte *buf, uint16 size) { if (_loadStream) _loadStream->read(buf, size); @@ -90,7 +90,7 @@ protected: #undef SYNC_AS -// TODO: Make a subclass "VersionedSerializer", which makes it easy to support +// TODO: Make a subclass "VersionedSerializer", which makes it easy to support // multiple versions of a savegame format (again inspired by SCUMM). /* class VersionedSerializer : public Serializer { diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index 9d1996ca01..aec61b410e 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -88,7 +88,7 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound // get file offset for this sample uint32 dwSampleIndex = _sampleIndex[id]; - + // move to correct position in the sample file _sampleStream.seek(dwSampleIndex); if (_sampleStream.ioFailed() || (uint32)_sampleStream.pos() != dwSampleIndex) @@ -190,7 +190,7 @@ bool SoundManager::playSample(int id, int sub, bool bLooped, int x, int y, int p // get file offset for this sample uint32 dwSampleIndex = _sampleIndex[id]; - + if (dwSampleIndex == 0) { warning("Tinsel2 playSample, non-existant sample %d", id); return false; @@ -305,7 +305,7 @@ int8 SoundManager::getPan(int x) { if (x < 0) { if (x < (-SCREEN_WIDTH / 2)) return -127; - + x = (-x * 127) / (SCREEN_WIDTH / 2); return 0 - x; diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h index 9b980822dc..8b969a5f48 100644 --- a/engines/tinsel/sound.h +++ b/engines/tinsel/sound.h @@ -103,12 +103,12 @@ public: void stopAllSamples(void); // Stops any currently playing sample void stopSpecSample(int id, int sub = 0); // Stops a specific sample - + void setSFXVolumes(uint8 volume); bool sampleExists(int id); bool sampleIsPlaying(int id = -1); - + // TODO: Internal method, make this protected? void openSampleFiles(void); void closeSampleStream(void); diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index ad28c48334..2d963ae8bb 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -80,7 +80,7 @@ LANGUAGE textLanguage, sampleLanguage = TXT_ENGLISH; void ChangeLanguage(LANGUAGE newLang) { Common::File f; uint32 textLen = 0; // length of buffer - + textLanguage = newLang; sampleLanguage = newLang; @@ -98,8 +98,8 @@ void ChangeLanguage(LANGUAGE newLang) { error(CANNOT_FIND_FILE, _vm->getTextFile(newLang)); } - // Check whether the file is compressed or not - for compressed files the - // first long is the filelength and for uncompressed files it is the chunk + // Check whether the file is compressed or not - for compressed files the + // first long is the filelength and for uncompressed files it is the chunk // identifier textLen = f.readUint32LE(); if (f.ioFailed()) @@ -392,12 +392,12 @@ LANGUAGE NextLanguage(LANGUAGE thisOne) { int i; for (i = thisOne+1; i < NUM_LANGUAGES; i++) { - if (languages[i].bPresent) + if (languages[i].bPresent) return (LANGUAGE)i; } for (i = 0; i < thisOne; i++) { - if (languages[i].bPresent) + if (languages[i].bPresent) return (LANGUAGE)i; } @@ -409,12 +409,12 @@ LANGUAGE PrevLanguage(LANGUAGE thisOne) { int i; for (i = thisOne-1; i >= 0; i--) { - if (languages[i].bPresent) + if (languages[i].bPresent) return (LANGUAGE)i; } for (i = NUM_LANGUAGES-1; i > thisOne; i--) { - if (languages[i].bPresent) + if (languages[i].bPresent) return (LANGUAGE)i; } diff --git a/engines/tinsel/sysvar.h b/engines/tinsel/sysvar.h index 869a99caa3..8866558e62 100644 --- a/engines/tinsel/sysvar.h +++ b/engines/tinsel/sysvar.h @@ -86,7 +86,7 @@ typedef enum { SV_DEFAULT_INV, ISV_GHOST_ACTOR, ISV_GHOST_BASE, ISV_GHOST_COLOUR, - + SV_TOPVALID } SYSVARS; diff --git a/engines/tinsel/text.cpp b/engines/tinsel/text.cpp index 7e36e5236f..fbeee9b8ed 100644 --- a/engines/tinsel/text.cpp +++ b/engines/tinsel/text.cpp @@ -107,7 +107,7 @@ int JustifyText(char *szStr, int xPos, const FONT *pFont, int mode) { * @param mode Mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, +OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, 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 @@ -153,7 +153,7 @@ OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, } else { // printable character int aniX, aniY; // char image animation offsets - + OBJ_INIT oi; oi.hObjImg = FROM_LE_32(pFont->fontInit.hObjImg); oi.objFlags = FROM_LE_32(pFont->fontInit.objFlags); @@ -265,7 +265,7 @@ OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, */ bool IsCharImage(SCNHANDLE hFont, char c) { byte c2 = (byte)c; - + // Inventory save game name editor needs to be more clever for // multi-byte characters. This bodge will stop it erring. if (bMultiByte && (c2 & 0x80)) diff --git a/engines/tinsel/text.h b/engines/tinsel/text.h index 0fcc965ff9..29e1a08bfe 100644 --- a/engines/tinsel/text.h +++ b/engines/tinsel/text.h @@ -98,7 +98,7 @@ struct TEXTOUT { * @param mode mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, +OBJECT *ObjectTextOut(CORO_PARAM, OBJECT *pList, char *szStr, int colour, 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 92abf4c028..8446aad0fa 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -23,7 +23,7 @@ * * Handles timers. * - * Note: As part of the transition to ScummVM, the ticks field of a timer has been changed + * Note: As part of the transition to ScummVM, the ticks field of a timer has been changed * to a millisecond value, rather than ticks at 24Hz. Most places should be able to use * the timers without change, since the ONE_SECOND constant has been set to be in MILLISECONDS */ diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 788b999142..0a29a9fe82 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -150,7 +150,7 @@ enum MASTER_LIB_CODES { CLOSEINVENTORY, CONTROL, CONVERSATION, CONVTOPIC, CURSOR, CURSORXPOS, CURSORYPOS, CUTSCENE, DECCONVW, DECCSTRINGS, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW, DECLARELANGUAGE, DECLEAD, DECSCALE, DECTAGFONT, DECTALKFONT, DELICON, - DELINV, DELTOPIC, DIMMUSIC, DROP, DROPEVERYTHING, DROPOUT, EFFECTACTOR, ENABLEMENU, + DELINV, DELTOPIC, DIMMUSIC, DROP, DROPEVERYTHING, DROPOUT, EFFECTACTOR, ENABLEMENU, ENDACTOR, ESCAPE, ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEMIDI, FADEOUT, FRAMEGRAB, FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, GRABMOVIE, HAILSCENE, HASRESTARTED, HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH, @@ -164,8 +164,8 @@ enum MASTER_LIB_CODES { RESUMELASTGAME, RUNMODE, SAMPLEPLAYING, SAVESCENE, SAY, SAYAT, SCALINGREELS, SCANICON, SCREENXPOS, SCREENYPOS, SCROLL, SCROLLPARAMETERS, SENDACTOR, SENDGLOBALPROCESS, SENDOBJECT, SENDPROCESS, SENDTAG, SETACTOR, SETBLOCK, SETBRIGHTNESS, SETEXIT, SETINVLIMIT, - SETINVSIZE, SETLANGUAGE, SETPALETTE, SETSYSTEMREEL, SETSYSTEMSTRING, SETSYSTEMVAR, - SETTAG, SETTIMER, SHELL, SHOWACTOR, SHOWBLOCK, SHOWEFFECT, SHOWMENU, SHOWPATH, + SETINVSIZE, SETLANGUAGE, SETPALETTE, SETSYSTEMREEL, SETSYSTEMSTRING, SETSYSTEMVAR, + SETTAG, SETTIMER, SHELL, SHOWACTOR, SHOWBLOCK, SHOWEFFECT, SHOWMENU, SHOWPATH, SHOWPOS, SHOWREFER, SHOWSTRING, SHOWTAG, SPLAY, STAND, STANDTAG, STARTGLOBALPROCESS, STARTPROCESS, STARTTIMER, STOPMIDI, STOPSAMPLE, STOPWALK, SUBTITLES, SWALK, SWALKZ, SYSTEMVAR, TAGACTOR, TAGTAGXPOS, TAGTAGYPOS, TAGWALKXPOS, TAGWALKYPOS, TALK, TALKAT, @@ -223,14 +223,14 @@ const MASTER_LIB_CODES DW2_CODES[] = { ACTORREF, ACTORRGB, ACTORSCALE, ACTORXPOS, ACTORYPOS, ADDHIGHLIGHT, ADDINV, ADDINV1, ADDINV2, ADDOPENINV, ADDTOPIC, BACKGROUND, CALLACTOR, CALLGLOBALPROCESS, CALLOBJECT, - CALLPROCESS, CALLSCENE, CALLTAG, CAMERA, CDCHANGESCENE, + CALLPROCESS, CALLSCENE, CALLTAG, CAMERA, CDCHANGESCENE, CDDOCHANGE, CDLOAD, CDPLAY, CLEARHOOKSCENE, CLOSEINVENTORY, CONTROL, CONVERSATION, CURSOR, CURSORXPOS, CURSORYPOS, DECCONVW, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW, DECLEAD, DECSCALE, DECTAGFONT, DECTALKFONT, DELTOPIC, DIMMUSIC, DROP, DROPOUT, EFFECTACTOR, ENABLEMENU, ENDACTOR, ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEOUT, FRAMEGRAB, - FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, GRABMOVIE, + FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, GRABMOVIE, HASRESTARTED, HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH, HIDEREFER, HIDETAG, HOLD, HOOKSCENE, IDLETIME, INSTANTSCROLL, INVENTORY, INVPLAY, INWHICHINV, KILLACTOR, @@ -292,7 +292,7 @@ void Walk(CORO_PARAM, int actor, int x, int y, SCNHANDLE film, int hold, bool ig //----------------- SUPPORT FUNCTIONS -------------------- /** - * For Scroll() and Offset(), work out top left for a + * For Scroll() and Offset(), work out top left for a * given screen position. */ static void DecodeExtreme(EXTREME extreme, int *px, int *py) { @@ -582,7 +582,7 @@ static void AddTopic(int icon) { */ static void AddInv(int invno, int object) { // illegal inventory number - assert(invno == INV_1 || invno == INV_2 || invno == INV_OPEN || invno == INV_DEFAULT); + assert(invno == INV_1 || invno == INV_2 || invno == INV_OPEN || invno == INV_DEFAULT); AddToInventory(invno, object, false); } @@ -1160,13 +1160,13 @@ static int GetInvLimit(int invno) { */ static void Ghost(int actor, int tColour, int tPalOffset) { SetSysVar(ISV_GHOST_ACTOR, actor); - SetSysVar(ISV_GHOST_COLOUR, tColour); + SetSysVar(ISV_GHOST_COLOUR, tColour); SetSysVar(ISV_GHOST_BASE, tPalOffset); CreateGhostPalette(BgPal()); } /** - * + * */ static void HailScene(SCNHANDLE scene) { DoHailScene(scene); @@ -1463,7 +1463,7 @@ void Offset(EXTREME extreme, int x, int y) { if (TinselV2) DecodeExtreme(extreme, &x, &y); - + PlayfieldSetPos(FIELD_WORLD, x, y); } @@ -1798,7 +1798,7 @@ static void PostActor(CORO_PARAM, int actor, TINSEL_EVENT event, HPOLYGON hp, assert(hp == NOPOLY && taggedActor); assert(IsTaggedActor(actor)); } - + if (IsTaggedActor(actor)) { assert(actor); ActorEvent(coroParam, actor, event, false, myEscape); @@ -1895,7 +1895,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust if (time == 0) { // This is a 'talky' print _ctx->time = TextTime(TextBufferAddr()); - + // Cut short-able if sustain was not set _ctx->myleftEvent = bSustain ? 0 : GetLeftEvents(); } else { @@ -1923,7 +1923,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust int Loffset, Toffset; // Screen position PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset); _ctx->pText = ObjectTextOut(coroParam, GetPlayfieldList(FIELD_STATUS), TextBufferAddr(), - 0, x - Loffset, y - Toffset, + 0, x - Loffset, y - Toffset, TinselV2 ? GetTagFontHandle() : GetTalkFontHandle(), TXT_CENTRE); assert(_ctx->pText); // string produced NULL text if (IsTopWindow()) @@ -2197,7 +2197,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo, if (_ctx->bTookControl) ControlOn(); // Free control if we took it } - + } else { if (event == POINTED) { // FIXME: Is there ever an associated sound if in POINTED mode??? @@ -2341,7 +2341,7 @@ static void PrintObjNonPointed(CORO_PARAM, const SCNHANDLE text, const OBJECT *p static void PrintTag(HPOLYGON hp, SCNHANDLE text, int actor = 0, bool bCursor = false) { // printtag() may only be called from a polygon code block in Tinsel 1, or // additionally from a moving actor code block in Tinsel 2 - assert((hp != NOPOLY) || (TinselV2 && (actor != 0))); + assert((hp != NOPOLY) || (TinselV2 && (actor != 0))); if (hp != NOPOLY) { // Poly handling @@ -3264,7 +3264,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x } else if (_ctx->whatSort == IS_TALKAT) { _ctx->bTalkReel = false; - + } else if ((_ctx->whatSort == IS_SAY) || (_ctx->whatSort == IS_SAYAT)) { _ctx->bTalkReel = false; if (IsTaggedActor(_ctx->actor)) { @@ -3338,7 +3338,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x yshift = MultiHighest(_ctx->pText); if (yshift < 4) MultiMoveRelXY(_ctx->pText, 0, 4 - yshift); // Not off top - + /* * Don't go off the side of the screen */ @@ -3392,7 +3392,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x // Handle timeout decrementing and Escape presses if (TinselV2) { - if ((_ctx->escEvents && _ctx->escEvents != GetEscEvents()) || + if ((_ctx->escEvents && _ctx->escEvents != GetEscEvents()) || (!bSustain && LeftEventChange(_ctx->myLeftEvent)) || (--_ctx->timeout <= 0)) { // Left event only kills current sub-string @@ -3748,7 +3748,7 @@ static void WaitKey(CORO_PARAM, bool escOn, int myEscape) { if (!MenuActive()) return; - + do { CORO_SLEEP(1); } while (MenuActive()); @@ -3804,14 +3804,14 @@ static void WaitTime(CORO_PARAM, int time, bool frame, bool escOn, int myEscape) if (escOn && myEscape != GetEscEvents()) break; } while (_ctx->time--); - + CORO_END_CODE; } /** * Set a moving actor off on a walk. */ -void Walk(CORO_PARAM, int actor, int x, int y, SCNHANDLE hFilm, int hold, bool igPath, +void Walk(CORO_PARAM, int actor, int x, int y, SCNHANDLE hFilm, int hold, bool igPath, int zOverride, bool escOn, int myescEvent) { CORO_BEGIN_CONTEXT; int thisWalk; @@ -3933,7 +3933,7 @@ static void Walked(CORO_PARAM, int actor, int x, int y, SCNHANDLE film, bool esc } else { // Pause before starting the walk CORO_SLEEP(ONE_SECOND); - + assert(pMover->hCpath != NOPOLY); // moving actor not in path // Briefly aquire token to kill off any other normal walk @@ -4563,7 +4563,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi // DW2 only DimMusic(); return 0; - + case DROP: // DW2 only Drop(pp[0]); @@ -4603,7 +4603,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi case EVENT: // Common to both DW1 & DW2 - if (TinselVersion == TINSEL_V2) + if (TinselVersion == TINSEL_V2) pp[0] = pic->event; else pp[0] = TINSEL1_EVENT_MAP[pic->event]; @@ -4890,7 +4890,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi if (*pResumeState == RES_1 && IsCdPlayHandle(pp[0])) *pResumeState = RES_NOT; else { - Play(coroParam, pp[0], pp[1], pp[2], pp[3], pic->myEscape, false, + Play(coroParam, pp[0], pp[1], pp[2], pp[3], pic->myEscape, false, pic->event, pic->hPoly, pic->idActor); if (coroParam) @@ -5442,7 +5442,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi // DW2 only pp[0] = ThisObject(pic->pinvo); return 0; - + case THISTAG: // DW2 only pp[0] = ThisTag(pic->hPoly); diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index eab2844a4e..9341b0fe4e 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -161,7 +161,7 @@ void KeyboardProcess(CORO_PARAM, const void *) { keypresses.erase(keypresses.begin()); const Common::Point mousePos = _vm->getMousePosition(); - // Switch for special keys + // Switch for special keys switch (evt.kbd.keycode) { // Drag action case Common::KEYCODE_LALT: @@ -196,7 +196,7 @@ void KeyboardProcess(CORO_PARAM, const void *) { if (evt.type == Common::EVENT_KEYUP) continue; - if (_vm->_keyHandler != NULL) + if (_vm->_keyHandler != NULL) // Keyboard is hooked, so pass it on to that handler first if (!_vm->_keyHandler(evt.kbd)) continue; @@ -221,11 +221,11 @@ void KeyboardProcess(CORO_PARAM, const void *) { case Common::KEYCODE_ESCAPE: #if 0 if (!TinselV2) { - // WORKAROUND: For Discworld 1, check if any of the starting logo screens are + // WORKAROUND: For Discworld 1, check if any of the starting logo screens are // active, and if so manually skip to the title screen, allowing them to be bypassed int sceneOffset = (_vm->getFeatures() & GF_SCNFILES) ? 1 : 0; int sceneNumber = (GetSceneHandle() >> SCNHANDLE_SHIFT) - sceneOffset; - if ((g_language == TXT_GERMAN) && + if ((g_language == TXT_GERMAN) && ((sceneNumber >= 25 && sceneNumber <= 27) || (sceneNumber == 17))) { // Skip to title screen // It seems the German CD version uses scenes 25,26,27,17 for the intro, @@ -386,7 +386,7 @@ static void MouseProcess(CORO_PARAM, const void *) { } else { // Initial mouse down - either for a single click, or potentially // the start of a double-click action - + if (TinselV2) { PlayerEvent(PLR_DRAG1_START, mousePos); @@ -412,7 +412,7 @@ static void MouseProcess(CORO_PARAM, const void *) { if (_ctx->lastLWasDouble == false) { _ctx->lastLeftClick = DwGetCurrentTime(); - // If player control is enabled, start a process which, if it times out, + // If player control is enabled, start a process which, if it times out, // will activate a single button click if (TinselV2 && ControlIsOn()) { clickPos = mousePos; @@ -630,7 +630,7 @@ static void RestoredProcess(CORO_PARAM, const void *param) { _ctx->pic = RestoreInterpretContext(_ctx->pic); _ctx->bConverse = TinselV2 && (_ctx->pic->event == CONVERSE); - + CORO_INVOKE_1(Interpret, _ctx->pic); // Restore control after CallScene() from a conversation icon @@ -690,7 +690,7 @@ bool ChangeScene(bool bReset) { } else if (--CountOut == 0) { if (!TinselV2) ClearScreen(); - + StartNewScene(NextScene.scene, NextScene.entry); NextScene.scene = 0; @@ -745,7 +745,7 @@ void LoadBasicChunks(void) { numObjects = (cptr != NULL) ? READ_LE_UINT32(cptr) : 0; cptr = FindChunk(INV_OBJ_SCNHANDLE, CHUNK_OBJECTS); - + #ifdef SCUMM_BIG_ENDIAN //convert to native endianness INV_OBJECT *io = (INV_OBJECT *)cptr; @@ -756,7 +756,7 @@ void LoadBasicChunks(void) { io->attribute = FROM_LE_32(io->attribute); } #endif - + RegisterIcons(cptr, numObjects); cptr = FindChunk(MASTER_SCNHANDLE, CHUNK_TOTAL_POLY); @@ -837,7 +837,7 @@ const char *TinselEngine::_textFiles[][3] = { }; -TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) : +TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { _vm = this; @@ -861,7 +861,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) int cd_num = ConfMan.getInt("cdrom"); if (cd_num >= 0) _system->openCD(cd_num); - + int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); //bool adlib = (midiDriver == MD_ADLIB); @@ -876,7 +876,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) //_midiMusic->setAdlib(adlib); _musicVolume = ConfMan.getInt("music_volume"); - + _sound = new SoundManager(this); _mousePos.x = 0; @@ -922,7 +922,7 @@ Common::Error TinselEngine::init() { g_system->getEventManager()->registerRandomSource(_random, "tinsel"); _console = new Console(); - + _scheduler = new Scheduler(); InitSysVars(); @@ -1067,7 +1067,7 @@ void TinselEngine::NextGameCycle(void) { if (MoviePlaying()) CopyMovieToScreen(); - else + else // redraw background DrawBackgnd(); @@ -1078,8 +1078,8 @@ void TinselEngine::NextGameCycle(void) { bool TinselEngine::pollEvent() { Common::Event event; - - if (!g_system->getEventManager()->pollEvent(event)) + + if (!g_system->getEventManager()->pollEvent(event)) return false; // Handle the various kind of events @@ -1094,7 +1094,7 @@ bool TinselEngine::pollEvent() { case Common::EVENT_MOUSEMOVE: { - // This fragment takes care of Tinsel 2 when it's been compiled with + // This fragment takes care of Tinsel 2 when it's been compiled with // blank areas at the top and bottom of thes creen int ySize = (g_system->getHeight() - _vm->screen().h) / 2; if ((event.mouse.y >= ySize) && (event.mouse.y < (g_system->getHeight() - ySize))) @@ -1106,7 +1106,7 @@ bool TinselEngine::pollEvent() { case Common::EVENT_KEYUP: ProcessKeyEvent(event); break; - + default: break; } @@ -1176,8 +1176,8 @@ void TinselEngine::RestartDrivers(void) { _scheduler->reset(); // init the event handlers - pMouseProcess = _scheduler->createProcess(PID_MOUSE, MouseProcess, NULL, 0); - pKeyboardProcess = _scheduler->createProcess(PID_KEYBOARD, KeyboardProcess, NULL, 0); + pMouseProcess = _scheduler->createProcess(PID_MOUSE, MouseProcess, NULL, 0); + pKeyboardProcess = _scheduler->createProcess(PID_KEYBOARD, KeyboardProcess, NULL, 0); // open MIDI files OpenMidiFiles(); @@ -1254,7 +1254,7 @@ void TinselEngine::ProcessKeyEvent(const Common::Event &event) { return; } - // All other keypresses add to the queue for processing in KeyboardProcess + // All other keypresses add to the queue for processing in KeyboardProcess keypresses.push_back(event); } -- cgit v1.2.3