aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorStrangerke2013-11-27 08:43:27 +0100
committerStrangerke2013-11-27 08:43:27 +0100
commit960523e25202ae9370da728daa06c1e588551f4e (patch)
treecce2d67ddd6e9cbfcaaeb1c21be92510c84fa2d0 /engines/tsage
parenta6ae7d485622b5332914b077a1100cf299f8358d (diff)
downloadscummvm-rg350-960523e25202ae9370da728daa06c1e588551f4e.tar.gz
scummvm-rg350-960523e25202ae9370da728daa06c1e588551f4e.tar.bz2
scummvm-rg350-960523e25202ae9370da728daa06c1e588551f4e.zip
TSAGE: R2R - Remove dead code, implement subD18B5()
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp41
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h3
2 files changed, 26 insertions, 18 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 87639b5715..bc2112b5d7 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "graphics/cursorman.h"
+
#include "tsage/scenes.h"
#include "tsage/tsage.h"
#include "tsage/staticres.h"
@@ -2260,10 +2262,6 @@ void Scene1337::synchronize(Serializer &s) {
warning("STUBBED: Scene1337::synchronize()");
}
-void Scene1337::Action1337::subD18B5(int resNum, int stripNum, int frameNum) {
- warning("STUBBED: Action1337::subD18B5()");
-}
-
void Scene1337::Action1337::waitFrames(int32 frameCount) {
uint32 firstFrameNumber = g_globals->_events.getFrameNumber();
uint32 curFrame = firstFrameNumber;
@@ -3542,7 +3540,7 @@ void Scene1337::Action5::signal() {
scene->_field3EF0->_object1.remove();
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
@@ -3590,7 +3588,7 @@ void Scene1337::Action6::signal() {
scene->setAnimationInfo(scene->_field3EF4);
scene->_aSound1.play(59);
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
scene->subC20F9();
@@ -3618,7 +3616,7 @@ void Scene1337::Action7::signal() {
break;
case 1:
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
scene->setAnimationInfo(scene->_field3EF4);
@@ -3659,7 +3657,7 @@ void Scene1337::Action8::signal() {
scene->_item2._object1.hide();
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
scene->setAnimationInfo(scene->_field3EF4);
@@ -3699,7 +3697,7 @@ void Scene1337::Action9::signal() {
scene->_aSound1.play(57);
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
@@ -3726,7 +3724,7 @@ void Scene1337::Action10::signal() {
scene->_field3EF0->_object1.remove();
if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
@@ -3894,7 +3892,7 @@ void Scene1337::Action11::signal() {
if (scene->_field4240 == 2) {
scene->_item2._object1.setPosition(scene->_field3EF4->_field36, 0);
- subD18B5(5, 1, 4);
+ scene->setCursorData(5, 1, 4);
} else {
scene->_field3EF0->_field34 = 0;
scene->_field3EF0->_object1.remove();
@@ -6469,7 +6467,7 @@ void Scene1337::subD02CA() {
}
// That continues the block when R2_GLOBALS._v57810 == 200 and di != 4
- subD18B5(1332, _item6._object1._strip, _item6._object1._frame);
+ setCursorData(1332, _item6._object1._strip, _item6._object1._frame);
R2_GLOBALS._sceneObjects->draw();
Event event;
bool found = false;
@@ -6490,7 +6488,7 @@ void Scene1337::subD02CA() {
_arrunkObj1337[2]._arr1[i]._object1.setPosition(_arrunkObj1337[2]._arr1[i]._field36, 0);
_arrunkObj1337[2]._arr1[i]._object1.fixPriority(170);
setAnimationInfo(&_arrunkObj1337[2]._arr1[i]);
- subD18B5(5, 1, 4);
+ setCursorData(5, 1, 4);
found = true;
_field423E--;
_field4244 = 0;
@@ -6830,9 +6828,20 @@ void Scene1337::subD183F(int arg1, int arg2) {
}
}
-void Scene1337::subD18B5(int resNum, int rlbNum, int frameNum) {
+void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
// Change the mouse cursor and set it to the desired frame (if different than 0)
- warning("STUBBED lvl3 Scene1337::subD18B5()");
+ if (!frameNum)
+ return;
+
+ 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();
}
int Scene1337::subD18F5() {
@@ -6866,7 +6875,7 @@ int Scene1337::subD1940(bool flag) {
}
void Scene1337::subD195F(int arg1, int arg2) {
- subD18B5(5, arg1, arg2);
+ setCursorData(5, arg1, arg2);
}
void Scene1337::subD1975(int arg1, int arg2) {
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index ed66f98921..09c674f9f3 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -213,7 +213,6 @@ class Scene1337 : public SceneExt {
class Action1337: public Action {
public:
- void subD18B5(int resNum, int stripNum, int frameNum);
void waitFrames(int32 frameCount);
};
@@ -370,7 +369,7 @@ public:
void subD0281();
void subD02CA();
void subD183F(int arg1, int arg2);
- void subD18B5(int resNum, int rlbNum, int frameNum);
+ void setCursorData(int resNum, int rlbNum, int frameNum);
int subD18F5();
int subD1917();
int subD1940(bool flag);