aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorStrangerke2013-12-01 01:46:58 +0100
committerStrangerke2013-12-01 01:47:55 +0100
commita6458abb29838d3a461bbb3f98ea58cdff47da4f (patch)
tree0d80fd8486992bd9d00844caf50ccfcb0e23f5c7 /engines/tsage
parent3e859768770a0b385e21c4528cd546b33ed9a55d (diff)
downloadscummvm-rg350-a6458abb29838d3a461bbb3f98ea58cdff47da4f.tar.gz
scummvm-rg350-a6458abb29838d3a461bbb3f98ea58cdff47da4f.tar.bz2
scummvm-rg350-a6458abb29838d3a461bbb3f98ea58cdff47da4f.zip
TSAGE: R2R - WIP work on cursor behavior in scene 1337
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp49
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h3
2 files changed, 35 insertions, 17 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 5ed45efbbe..945457eccc 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -2256,6 +2256,10 @@ Scene1337::Scene1337() {
_field3EF0 = nullptr;
_field3EF4 = nullptr;
_field3EF8 = nullptr;
+
+ _cursorCurRes = 0;
+ _cursorCurStrip = 0;
+ _cursorCurFrame = 0;
}
void Scene1337::synchronize(Serializer &s) {
@@ -4482,6 +4486,12 @@ void Scene1337::dispatch() {
suggestInstructions();
}
}
+
+ // The following code is in the original in sceneHandler::process(),
+ // which is terrible as it's checked in every scene of the game.
+ setCursorData(5, _cursorCurStrip, _cursorCurFrame);
+ //
+
Scene::dispatch();
}
@@ -5262,11 +5272,10 @@ void Scene1337::subC4CD2() {
}
void Scene1337::subC4CEC() {
- if (R2_GLOBALS._v57709 != 0)
- return;
-
- subD18F5();
- subD1940(true);
+ if (R2_GLOBALS._v57709 == 0) {
+ subD18F5();
+ subD1940(true);
+ }
}
void Scene1337::subC51A0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
@@ -6830,22 +6839,28 @@ void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
if (!frameNum)
return;
- uint size;
- byte *cursor = g_resourceManager->getSubResource(resNum, rlbNum, frameNum, &size);
- // Decode the cursor
- GfxSurface s = surfaceFromRes(cursor);
+ _cursorCurRes = resNum;
+ _cursorCurStrip = rlbNum;
+ _cursorCurFrame = frameNum;
+
+ if (!frameNum) {
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
+ } else {
+ uint size;
+ byte *cursor = g_resourceManager->getSubResource(resNum, rlbNum, frameNum, &size);
+ // Decode the cursor
+ GfxSurface s = surfaceFromRes(cursor);
- Graphics::Surface surface = s.lockSurface();
- const byte *cursorData = (const byte *)surface.getPixels();
- CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
- s.unlockSurface();
+ Graphics::Surface surface = s.lockSurface();
+ const byte *cursorData = (const byte *)surface.getPixels();
+ CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
+ s.unlockSurface();
+ }
}
void Scene1337::subD18F5() {
if (R2_GLOBALS._v57709 == 0)
- // The cursor looks... very dummy
- // To be checked
- warning("TODO: CursorManager.setData(R2_GLOBALS.off_57705)");
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
++R2_GLOBALS._v57709;
}
@@ -6854,7 +6869,7 @@ void Scene1337::subD1917() {
if (R2_GLOBALS._v57709 != 0) {
R2_GLOBALS._v57709--;
if (R2_GLOBALS._v57709 != 0)
- warning("FIXME: subD195F(_width, _data);");
+ subD195F(_cursorCurStrip, _cursorCurFrame);
}
}
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index 28b82b4045..2b95bc2bd6 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -316,6 +316,9 @@ public:
int _field424A;
int _instructionsDisplayedFl;
int _instructionsWaitCount;
+ int _cursorCurRes;
+ int _cursorCurStrip;
+ int _cursorCurFrame;
SceneObject _upperDisplayCard[8];
SceneObject _lowerDisplayCard[8];