From cb4184738808ab97f28531a0b4ebf384c7cda98b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Oct 2013 10:32:53 -0400 Subject: TSAGE: Fix for correctly setting up playing voice number --- engines/tsage/core.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 3332b12cf6..3021134b46 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1783,6 +1783,9 @@ void SceneItem::display(int resNum, int lineNum, ...) { if (!playList.empty()) { R2_GLOBALS._playStream.play(*playList.begin(), NULL); playList.pop_front(); + } else if (!(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { + // If not showing text, don't both waiting for a click to end + break; } } } -- cgit v1.2.3 From b6bace0fa070985f5301480c36318043ef7b025e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Oct 2013 13:47:06 -0400 Subject: TSAGE: Further R2R fixes for voice playback looking at hotspots --- engines/tsage/core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 3021134b46..8021160514 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1619,7 +1619,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { Common::String msg = (!resNum || (resNum == -1)) ? Common::String() : g_resourceManager->getMessage(resNum, lineNum); - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) T2_GLOBALS._uiElements.hide(); if (g_globals->_sceneObjects->contains(&g_globals->_sceneText)) { @@ -1797,7 +1798,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { g_globals->_sceneText.remove(); } - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) { + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) { // Show user interface T2_GLOBALS._uiElements.show(); -- cgit v1.2.3 From c00ff935de452fa32feaab89b5c1c584e5722044 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 29 Oct 2013 08:18:36 +0100 Subject: TSAGE: Fix CID 1003170 --- engines/tsage/core.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 8021160514..424df164b2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -860,6 +860,8 @@ void PlayerMover::doStepsOfNpcMovement(const Common::Point &srcPos, const Common int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute) { // Make a copy of the provided route. The first entry is the size. int tempList[REGION_LIST_SIZE + 1]; + memset(tempList, 0, REGION_LIST_SIZE + 1); + foundRoute = false; for (int idx = 0; idx <= *routeList; ++idx) tempList[idx] = routeList[idx]; -- cgit v1.2.3 From a3c937c556ce28a403b4fa10d58be129dae6aa73 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 30 Oct 2013 21:40:54 +0100 Subject: TSAGE: Fix a bug pointed by wjp --- engines/tsage/core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 424df164b2..e703b714b2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -860,7 +860,7 @@ void PlayerMover::doStepsOfNpcMovement(const Common::Point &srcPos, const Common int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute) { // Make a copy of the provided route. The first entry is the size. int tempList[REGION_LIST_SIZE + 1]; - memset(tempList, 0, REGION_LIST_SIZE + 1); + memset(tempList, 0, sizeof(tempList)); foundRoute = false; for (int idx = 0; idx <= *routeList; ++idx) -- cgit v1.2.3 From 1d6ed07723f57f27fb4f2a08c0d91835291a05bd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 4 Nov 2013 21:17:23 -0500 Subject: TSAGE: Renamings for effects and shadow palette map --- engines/tsage/core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index e703b714b2..553c3216e6 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2106,7 +2106,7 @@ SceneObject::SceneObject() : SceneHotspot() { _endFrame = 0; _field68 = 0; _regionIndex = 0; - _field9C = NULL; + _shadowMap = NULL; } SceneObject::SceneObject(const SceneObject &so) : SceneHotspot() { -- cgit v1.2.3 From 974348c77130867151a7443aad53ec18ba82fd00 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 5 Nov 2013 08:19:02 -0500 Subject: TSAGE: Implemented R2R shadowing effect --- engines/tsage/core.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 553c3216e6..fd36d4fb01 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2735,9 +2735,24 @@ void SceneObject::draw() { Rect destRect = _bounds; destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, -g_globals->_sceneManager._scene->_sceneBounds.top); - Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); GfxSurface frame = getFrame(); - g_globals->gfxManager().copyFrom(frame, destRect, priorityRegion); + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); + + if (g_vm->getGameID() == GType_Ringworld2) { + switch (_effect) { + case EFFECT_SHADOW_MAP: { + assert(_shadowMap); + + GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), + destRect, priorityRegion, _shadowMap); + return; + } + default: + break; + } + } + + GLOBALS.gfxManager().copyFrom(frame, destRect, priorityRegion); } /** -- cgit v1.2.3 From 784796779893f5fa280f634139aceff7324514df Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 10 Nov 2013 23:00:15 +0100 Subject: TSAGE: Janitorial - Remove trailing spaces and tabs --- engines/tsage/core.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index fd36d4fb01..877d866c3c 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1800,7 +1800,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { g_globals->_sceneText.remove(); } - if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) && T2_GLOBALS._uiElements._active) { // Show user interface T2_GLOBALS._uiElements.show(); @@ -2511,7 +2511,7 @@ void SceneObject::postInit(SceneObjectList *OwnerList) { if (!OwnerList) OwnerList = g_globals->_sceneObjects; - bool isExisting = OwnerList->contains(this); + bool isExisting = OwnerList->contains(this); if (!isExisting || ((_flags & OBJFLAG_REMOVE) != 0)) { _percent = 100; _priority = 255; @@ -2708,7 +2708,7 @@ GfxSurface SceneObject::getFrame() { Graphics::Surface s = frame.lockSurface(); byte *p = (byte *)s.getPixels(); byte *endP = p + s.w * s.h; - + while (p < endP) { if (*p != frame._transColor) *p = R2_GLOBALS._fadePaletteMap[_shade - 1][*p]; @@ -2742,8 +2742,8 @@ void SceneObject::draw() { switch (_effect) { case EFFECT_SHADOW_MAP: { assert(_shadowMap); - - GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), + + GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), destRect, priorityRegion, _shadowMap); return; } @@ -2859,7 +2859,7 @@ void BackgroundSceneObject::setup2(int visage, int stripFrameNum, int frameNum, void BackgroundSceneObject::copySceneToBackground() { GLOBALS._sceneManager._scene->_backSurface.copyFrom(g_globals->gfxManager().getSurface(), 0, 0); - // WORKAROUND: Since savegames don't store the active screen data, once we copy the + // WORKAROUND: Since savegames don't store the active screen data, once we copy the // foreground objects to the background, we have to prevent the scene being saved. if (g_vm->getGameID() == GType_Ringworld2) ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->_preventSaving = true; @@ -4346,7 +4346,7 @@ void SceneHandler::process(Event &event) { // Scan the item list to find one the mouse is within SynchronizedList::iterator i; for (i = g_globals->_sceneItems.begin(); i != g_globals->_sceneItems.end(); ++i) { - SceneItem *item = *i; + SceneItem *item = *i; if (item->contains(event.mousePos)) { // Pass the action to the item bool handled = item->startAction(g_globals->_events.getCursor(), event); -- cgit v1.2.3 From ab3cf625d59430d9b7496b0437d6a08e33698d58 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 12 Nov 2013 20:16:55 -0500 Subject: TSAGE: Fix for positioning R2R text to account for screen boundary --- engines/tsage/core.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 877d866c3c..f2744d5bf8 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1732,9 +1732,13 @@ void SceneItem::display(int resNum, int lineNum, ...) { font.setFontNumber(g_globals->_sceneText._fontNumber); font.getStringBounds(msg.c_str(), textRect, maxWidth); + Rect screenBounds = g_globals->gfxManager()._bounds; + if (g_vm->getGameID() == GType_Ringworld2) + screenBounds.collapse(20, 15); + // Center the text at the specified position, and then constrain it to be- textRect.center(pos.x, pos.y); - textRect.contain(g_globals->gfxManager()._bounds); + textRect.contain(screenBounds); if (centerText) { g_globals->_sceneText._color1 = g_globals->_sceneText._color2; -- cgit v1.2.3 From 4f7913c3553a0294675b46a9ccbbee19fceecb8d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 12 Nov 2013 21:50:52 -0500 Subject: TSAGE: R2R Fix for restoriong scenes with objects using a shadow map --- engines/tsage/core.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index f2744d5bf8..040dbc8c25 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2737,15 +2737,16 @@ void SceneObject::reposition() { */ void SceneObject::draw() { Rect destRect = _bounds; - destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, - -g_globals->_sceneManager._scene->_sceneBounds.top); + Scene *scene = g_globals->_sceneManager._scene; + destRect.translate(-scene->_sceneBounds.left, -scene->_sceneBounds.top); GfxSurface frame = getFrame(); - Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); + Region *priorityRegion = scene->_priorities.find(_priority); if (g_vm->getGameID() == GType_Ringworld2) { switch (_effect) { case EFFECT_SHADOW_MAP: { - assert(_shadowMap); + if (!_shadowMap) + _shadowMap = static_cast(scene)->_shadowPaletteMap; GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), destRect, priorityRegion, _shadowMap); -- cgit v1.2.3 From 74bb0a8b3c7f6e3430f4693ead42b9e9a88c5de9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 12:18:52 -0500 Subject: TSAGE: In progress work and bugfixes for R2R centroid handling --- engines/tsage/core.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 040dbc8c25..a281354f0d 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2707,6 +2707,9 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); + // Reset any centroid adjustment flags + _visageImages.getFrameFlags(_frame) &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + // If shading is needed, post apply the shadiing onto the frame if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { Graphics::Surface s = frame.lockSurface(); @@ -2727,6 +2730,7 @@ GfxSurface SceneObject::getFrame() { void SceneObject::reposition() { GfxSurface frame = getFrame(); + _bounds.resize(frame, _position.x, _position.y - _yDiff, _percent); _xs = _bounds.left; _xe = _bounds.right; @@ -3296,6 +3300,20 @@ GfxSurface Visage::getFrame(int frameNum) { return result; } +byte &Visage::getFrameFlags(int frameNum) { + int numFrames = READ_LE_UINT16(_data); + if (frameNum > numFrames) + frameNum = numFrames; + if (frameNum > 0) + --frameNum; + + int offset = READ_LE_UINT32(_data + 2 + frameNum * 4); + byte *frameData = _data + offset; + + return *(frameData + 9); +} + + int Visage::getFrameCount() const { return READ_LE_UINT16(_data); } -- cgit v1.2.3 From d0c2493be50c3c28c57be5317061af413c699062 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 17:09:35 -0500 Subject: TSAGE: Further fixes for object centroid handling --- engines/tsage/core.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index a281354f0d..320d3ddd2c 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2707,8 +2707,16 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); - // Reset any centroid adjustment flags - _visageImages.getFrameFlags(_frame) &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + // Reset any centroid adjustment flags, in + frame._flags &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + + // For later games, check whether the appropriate object flags are set for flipping + if (g_vm->getGameID() != GType_Ringworld) { + if ((_flags & OBJFLAG_FLIP_CENTROID_X) || _visageImages._flipHoriz) + frame._flags |= FRAME_FLIP_CENTROID_X; + if ((_flags & OBJFLAG_FLIP_CENTROID_Y) || _visageImages._flipVert) + frame._flags |= FRAME_FLIP_CENTROID_Y; + } // If shading is needed, post apply the shadiing onto the frame if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { @@ -3300,20 +3308,6 @@ GfxSurface Visage::getFrame(int frameNum) { return result; } -byte &Visage::getFrameFlags(int frameNum) { - int numFrames = READ_LE_UINT16(_data); - if (frameNum > numFrames) - frameNum = numFrames; - if (frameNum > 0) - --frameNum; - - int offset = READ_LE_UINT32(_data + 2 + frameNum * 4); - byte *frameData = _data + offset; - - return *(frameData + 9); -} - - int Visage::getFrameCount() const { return READ_LE_UINT16(_data); } -- cgit v1.2.3 From 1aa0d0bd9b78ac008961730644efdd5d3f8a2a12 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 23:23:43 -0500 Subject: TSAGE: Added new palette rotation code, to fix R2R rimwall vechile scene --- engines/tsage/core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 320d3ddd2c..a519ffbd10 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1153,6 +1153,13 @@ void PaletteRotation::signal() { if (flag) _currIndex = _start; } + + // Added in Return to Ringworld + if (_currIndex < _start) { + flag = decDuration(); + if (flag) + _currIndex = _end; + } break; case 2: _currIndex += _idxChange; -- cgit v1.2.3 From f4d582f6406bbce2c2c19103944bf2fbac14da72 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 22:29:49 +0100 Subject: TSAGE: R2R - rename _actorDestPos --- engines/tsage/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index a519ffbd10..6c47cac1ef 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2110,7 +2110,7 @@ SceneObject::SceneObject() : SceneHotspot() { _shade = _oldShade = 0; _linkedActor = NULL; - _field8A = Common::Point(0, 0); + _actorDestPos = Common::Point(0, 0); _angle = 0; _xs = 0; _xe = 0; @@ -2504,8 +2504,8 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsSint16LE(_moveDiff.x); s.syncAsSint16LE(_moveDiff.y); s.syncAsSint32LE(_moveRate); if (g_vm->getGameID() == GType_Ringworld2) { - s.syncAsSint16LE(_field8A.x); - s.syncAsSint16LE(_field8A.y); + s.syncAsSint16LE(_actorDestPos.x); + s.syncAsSint16LE(_actorDestPos.y); } SYNC_POINTER(_endAction); s.syncAsUint32LE(_regionBitList); -- cgit v1.2.3 From c211cede06224a2d7fab1f94ce94f723a3022ebb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 07:59:12 +0100 Subject: TSAGE: BF - Remove some useless variables, some renaming --- engines/tsage/core.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 6c47cac1ef..88f2c85ffd 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1545,7 +1545,11 @@ void ScenePalette::synchronize(Serializer &s) { s.syncAsSint32LE(_colors.foreground); s.syncAsSint32LE(_colors.background); - s.syncAsSint32LE(_field412); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint16LE(useless); + } + s.syncAsByte(_redColor); s.syncAsByte(_greenColor); s.syncAsByte(_blueColor); -- cgit v1.2.3 From 8ac319365a7fd68bf09ed0edacddaa3e5f1dda09 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 28 Nov 2013 01:31:42 +0100 Subject: TSAGE: Fix savegame issue --- engines/tsage/core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 88f2c85ffd..0c17bf92d7 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1547,7 +1547,7 @@ void ScenePalette::synchronize(Serializer &s) { if (s.getVersion() < 12) { int useless = 0; - s.syncAsSint16LE(useless); + s.syncAsSint32LE(useless); } s.syncAsByte(_redColor); -- cgit v1.2.3 From 6b61eb62ab8f672be35ced69aa18e9793eb27772 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 28 Nov 2013 15:00:44 -0500 Subject: TSAGE: R2R fix for zoomed speaking characters appearing correctly --- engines/tsage/core.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 0c17bf92d7..596f056bfe 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2748,6 +2748,12 @@ GfxSurface SceneObject::getFrame() { } void SceneObject::reposition() { + if (g_vm->getGameID() == GType_Ringworld2) { + if (!(_flags & OBJFLAG_ZOOMED)) { + setZoom(g_globals->_sceneManager._scene->_zoomPercents[MIN(_position.y, (int16)255)]); + } + } + GfxSurface frame = getFrame(); _bounds.resize(frame, _position.x, _position.y - _yDiff, _percent); -- cgit v1.2.3 From 76802b1057cfe2f6679dab8d9a85ac13fc7b03e8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 6 Dec 2013 07:53:55 +0100 Subject: TSAGE: R2R - Add _effect initialization in BackgroundSceneObject::setup2() --- engines/tsage/core.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 596f056bfe..0b3eb53268 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2888,6 +2888,8 @@ void BackgroundSceneObject::setup2(int visage, int stripFrameNum, int frameNum, setFrame(frameNum); setPosition(Common::Point(posX, posY)); fixPriority(priority); + + _effect = effect; } void BackgroundSceneObject::copySceneToBackground() { -- cgit v1.2.3 From 5e35729ee8492b26b9ef77fe7b74987ea62d097e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 20 Dec 2013 07:11:09 +0100 Subject: TSAGE: Some renaming, remove some useless variables from Core, increase savegame version --- engines/tsage/core.cpp | 52 +++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 0b3eb53268..7f27c43a22 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1301,7 +1301,6 @@ ScenePalette::ScenePalette() { *palData++ = idx; } - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1313,7 +1312,6 @@ ScenePalette::~ScenePalette() { } ScenePalette::ScenePalette(int paletteNum) { - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1565,8 +1563,13 @@ void SceneItem::synchronize(Serializer &s) { _bounds.synchronize(s); s.syncString(_msg); - s.syncAsSint32LE(_fieldE); - s.syncAsSint32LE(_field10); + + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint32LE(useless); + s.syncAsSint32LE(useless); + } + s.syncAsSint16LE(_position.x); s.syncAsSint32LE(_position.y); s.syncAsSint16LE(_yDiff); s.syncAsSint32LE(_sceneRegionId); @@ -2119,7 +2122,7 @@ SceneObject::SceneObject() : SceneHotspot() { _xs = 0; _xe = 0; _endFrame = 0; - _field68 = 0; + _loopCount = 0; _regionIndex = 0; _shadowMap = NULL; } @@ -2368,7 +2371,7 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_1: _frameChange = 1; - _field2E = _position; + _oldPosition = _position; _endAction = 0; break; @@ -2416,9 +2419,9 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_9: if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) { _frameChange = -1; - _field2E = _position; + _oldPosition = _position; } else { - _field68 = va_arg(va, int); + _loopCount = va_arg(va, int); _endAction = va_arg(va, Action *); _frameChange = 1; _endFrame = getFrameCount(); @@ -2485,7 +2488,7 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsUint32LE(_updateStartFrame); s.syncAsUint32LE(_walkStartFrame); - s.syncAsSint16LE(_field2E.x); s.syncAsSint16LE(_field2E.y); + s.syncAsSint16LE(_oldPosition.x); s.syncAsSint16LE(_oldPosition.y); s.syncAsSint16LE(_percent); s.syncAsSint16LE(_priority); s.syncAsSint16LE(_angle); @@ -2500,7 +2503,7 @@ void SceneObject::synchronize(Serializer &s) { SYNC_ENUM(_animateMode, AnimateMode); s.syncAsSint32LE(_frame); s.syncAsSint32LE(_endFrame); - s.syncAsSint32LE(_field68); + s.syncAsSint32LE(_loopCount); s.syncAsSint32LE(_frameChange); s.syncAsSint32LE(_numFrames); s.syncAsSint32LE(_regionIndex); @@ -2587,9 +2590,9 @@ void SceneObject::dispatch() { case ANIM_MODE_1: if (isNoMover()) setFrame(1); - else if ((_field2E.x != _position.x) || (_field2E.y != _position.y)) { + else if ((_oldPosition.x != _position.x) || (_oldPosition.y != _position.y)) { setFrame(changeFrame()); - _field2E = _position; + _oldPosition = _position; } break; @@ -2632,7 +2635,7 @@ void SceneObject::dispatch() { _endFrame = 1; setFrame(changeFrame()); - } else if (!_field68 || (--_field68 > 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -2651,7 +2654,7 @@ void SceneObject::dispatch() { _frameChange = -1; _strip = ((_strip - 1) ^ 1) + 1; _endFrame = 1; - } else if ((_field68 == 0) || (--_field68 != 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -3365,7 +3368,6 @@ Player::Player(): SceneObject() { _canWalk = false; _enabled = false; _uiEnabled = false; - _field8C = 0; // Return to Ringworld specific fields _characterIndex = R2_NONE; @@ -3384,15 +3386,11 @@ void Player::postInit(SceneObjectList *OwnerList) { _canWalk = true; _uiEnabled = true; _percent = 100; - _field8C = 10; - if (g_vm->getGameID() != GType_Ringworld2) - { + if (g_vm->getGameID() != GType_Ringworld2) { _moveDiff.x = 4; _moveDiff.y = 2; - } - else - { + } else { _moveDiff.x = 3; _moveDiff.y = 2; _effect = EFFECT_SHADED; @@ -3500,7 +3498,10 @@ void Player::synchronize(Serializer &s) { s.syncAsByte(_canWalk); s.syncAsByte(_uiEnabled); - s.syncAsSint16LE(_field8C); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } if (g_vm->getGameID() != GType_Ringworld) s.syncAsByte(_enabled); @@ -4248,7 +4249,6 @@ double FloatSet::sqrt(FloatSet &floatSet) { GameHandler::GameHandler() : EventHandler() { _nextWaitCtr = 1; _waitCtr.setCtr(1); - _field14 = 10; } GameHandler::~GameHandler() { @@ -4270,7 +4270,11 @@ void GameHandler::synchronize(Serializer &s) { _lockCtr.synchronize(s); _waitCtr.synchronize(s); s.syncAsSint16LE(_nextWaitCtr); - s.syncAsSint16LE(_field14); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + } } /*--------------------------------------------------------------------------*/ -- cgit v1.2.3 From ea52bcd28218cf8d9e3e81c4d7993372e4644aeb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 3 Jan 2014 07:56:18 +0100 Subject: TSAGE: Fix CID 1004060 - Logically dead code --- engines/tsage/core.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 7f27c43a22..16fe45044b 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2964,8 +2964,9 @@ void SceneObjectList::draw() { g_globals->_sceneManager._sceneBgOffset.y); } - // Set up the flag mask - uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; + // Set up the flag mask. Currently, paneNum is always set to 0, so the check is meaningless + // uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; + uint32 flagMask = OBJFLAG_PANE_0; // Initial loop to set up object list and update object position, priority, and flags for (SynchronizedList::iterator i = g_globals->_sceneObjects->begin(); -- cgit v1.2.3 From 074c11f7e1423ba6541fe86e8302b7ae52a369f8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 8 Feb 2014 19:05:01 +0100 Subject: TSAGE: Silent some CppCheck warnings --- engines/tsage/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 16fe45044b..ba14830add 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1593,12 +1593,12 @@ bool SceneItem::startAction(CursorType action, Event &event) { } void SceneItem::doAction(int action) { - const char *msg = NULL; - if (g_vm->getGameID() == GType_Ringworld2) { Event dummyEvent; ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->display((CursorType)action, dummyEvent); } else { + const char *msg = NULL; + switch ((int)action) { case CURSOR_LOOK: msg = LOOK_SCENE_HOTSPOT; @@ -2909,7 +2909,6 @@ void BackgroundSceneObject::copySceneToBackground() { void SceneObjectList::draw() { Common::Array objList; int paneNum = 0; - int xAmount = 0, yAmount = 0; if (_objList.size() == 0) { // Alternate draw mode @@ -2936,6 +2935,7 @@ void SceneObjectList::draw() { g_globals->_scrollFollower->_position.x - g_globals->_sceneManager._scene->_sceneBounds.left, g_globals->_scrollFollower->_position.y - g_globals->_sceneManager._scene->_sceneBounds.top); int loadCount = 0; + int xAmount = 0, yAmount = 0; if (objPos.x >= scrollerRect.right) { xAmount = 8; -- cgit v1.2.3 From 0261045ead709702b92b22530b59e8267b8da5db Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 16 Feb 2014 18:32:36 +0100 Subject: TSAGE: Janitorial - Remove trailing spaces --- engines/tsage/core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index ba14830add..25570b3272 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2721,7 +2721,7 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); - // Reset any centroid adjustment flags, in + // Reset any centroid adjustment flags, in frame._flags &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); // For later games, check whether the appropriate object flags are set for flipping -- cgit v1.2.3 From 6e715e186a857e8ed35c7e49f80ce951d8897e35 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:26 +0100 Subject: TSAGE: Make GPL headers consistent with themselves. --- engines/tsage/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 25570b3272..f35aa583e2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3