aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-04-10 16:50:10 +1000
committerPaul Gilbert2011-04-10 16:50:10 +1000
commit0a1a8810ae641ee441cde08608aaf99a52c87b7c (patch)
treef8d02bb213d8045ebb9a127475d4667ad0f3d1c2
parent2c41aaa17bb050d2e624006cc57e4b507b645674 (diff)
downloadscummvm-rg350-0a1a8810ae641ee441cde08608aaf99a52c87b7c.tar.gz
scummvm-rg350-0a1a8810ae641ee441cde08608aaf99a52c87b7c.tar.bz2
scummvm-rg350-0a1a8810ae641ee441cde08608aaf99a52c87b7c.zip
TSAGE: Lots more bugfixes for Scene #6100
-rw-r--r--engines/tsage/core.cpp2
-rw-r--r--engines/tsage/graphics.cpp2
-rw-r--r--engines/tsage/ringworld_scenes1.cpp50
-rw-r--r--engines/tsage/ringworld_scenes1.h8
4 files changed, 40 insertions, 22 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 4ce7513e12..72f75190ca 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2527,7 +2527,6 @@ void SceneText::setup(const Common::String &msg) {
gfxMan._font._colours2.foreground = _colour3;
gfxMan.getStringBounds(msg.c_str(), textRect, _width);
- _bounds = textRect;
// Set up a new blank surface to hold the text
_textSurface.create(textRect.width(), textRect.height());
@@ -2535,6 +2534,7 @@ void SceneText::setup(const Common::String &msg) {
_textSurface.fillRect(textRect, _textSurface._transColour);
// Write the text to the surface
+ gfxMan._bounds = textRect;
gfxMan._font.writeLines(msg.c_str(), textRect, _textMode);
// Do post-init, which adds this SceneText object to the scene
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 0e800a8c0d..9a13abcf59 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -331,7 +331,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) {
if (_customSurface) {
// Surface owns the internal data, so replicate it so new surface owns it's own
_customSurface = new Graphics::Surface();
- _customSurface->create(_bounds.width(), _bounds.height(), 1);
+ _customSurface->create(s._customSurface->w, s._customSurface->h, 1);
const byte *srcP = (const byte *)s._customSurface->getBasePtr(0, 0);
byte *destP = (byte *)_customSurface->getBasePtr(0, 0);
diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp
index fc633bf40f..e7b2a3f92e 100644
--- a/engines/tsage/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld_scenes1.cpp
@@ -2929,11 +2929,11 @@ void Scene6100::Action5::dispatch() {
double sqrtVal = tempSet.sqrt(zeroSet);
if (sqrtVal != 0.0) {
- scene->_objList[idx]->_position.y = static_cast<int>(sqrtVal / 13800.0 + 62.0);
+ scene->_objList[idx]->_position.y = static_cast<int>(13800.0 / sqrtVal + 62.0);
}
scene->_objList[idx]->_position.x = static_cast<int>(
- 160.0 - ((tempSet._float2 + 330.0) / 330.0 * tempSet._float1));
+ 160.0 - (330.0 / (tempSet._float2 + 330.0) * tempSet._float1));
if (tempSet._float2 < 0) {
scene->_objList[idx]->_position.y = 300;
@@ -2953,17 +2953,14 @@ void Scene6100::Action5::dispatch() {
}
if (idx == 3) {
- if (((int)tempSet._float1 >= 100) || (tempSet._float2 > 0))
- scene->_field_314 = 0;
- else
- scene->_field_314 = 1;
+ scene->_rocksCheck = (ABS((int)tempSet._float1) < 100) && (tempSet._float2 > 0);
}
scene->_objList[idx]->_flags |= OBJFLAG_PANES;
/*
if ((idx != 3) && (scene->_fadePercent == 100) &&
(tempSet.sqrt(floatSet) < 150.0)) {
- switch (scene->_field_312++) {
+ switch (scene->_hitCount++) {
case 1:
scene->_soundHandler.startSound(233);
scene->showMessage(0, NULL, 0);
@@ -2996,7 +2993,7 @@ void Scene6100::Action5::dispatch() {
}
}
-void Scene6100::Action6::signal() {
+void Scene6100::GetBoxAction::signal() {
Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -3034,6 +3031,26 @@ void Scene6100::Action6::signal() {
}
}
+void Scene6100::GetBoxAction::dispatch() {
+ Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene;
+ Action::dispatch();
+
+ if (scene->_speed > 0) {
+ scene->_action5.dispatch();
+ scene->_speed = (scene->_speed * 4) / 5;
+
+ if (scene->_speed == 0)
+ setDelay(2);
+ }
+
+ if (scene->_speed == 0) {
+ if (scene->_probe._percent > 4)
+ // Handle the probe disappearing into the rocks
+ scene->_probe._percent = scene->_probe._percent * 7 / 8;
+ scene->_probe._flags |= OBJFLAG_PANES;
+ }
+}
+
void Scene6100::Action7::signal() {
switch (_actionIndex++) {
case 0:
@@ -3136,8 +3153,8 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
_speed = 30;
_fadePercent = 100;
- _field_314 = 0;
- _field_312 = 0;
+ _rocksCheck = false;
+ _hitCount = 0;
_turnAmount = 0;
_angle = 0;
_msgActive = false;
@@ -3205,13 +3222,12 @@ void Scene6100::dispatch() {
_sceneText.setup(s);
}
- if (_field_314) {
- if (_action == &_action5) {
- double distance = _probe._floats.sqrt(_rocks._floats);
-
- if ((distance >= 300.0) && (distance <= 500.0))
- setAction(&_action6);
- }
+ if (_rocksCheck && (_action == &_action5)) {
+ // Check whether the probe is close enough to the rocks
+ double distance = _probe._floats.sqrt(_rocks._floats);
+
+ if ((distance >= 300.0) && (distance <= 500.0))
+ setAction(&_getBoxAction);
}
}
diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h
index 21f9d6360a..01d8ad713f 100644
--- a/engines/tsage/ringworld_scenes1.h
+++ b/engines/tsage/ringworld_scenes1.h
@@ -494,9 +494,10 @@ class Scene6100: public Scene {
public:
virtual void dispatch();
};
- class Action6: public Action {
+ class GetBoxAction: public Action {
public:
virtual void signal();
+ virtual void dispatch();
};
class Action7: public Action {
public:
@@ -521,7 +522,7 @@ public:
Action3 _action3;
Action4 _action4;
Action5 _action5;
- Action6 _action6;
+ GetBoxAction _getBoxAction;
Action7 _action7;
SoundHandler _soundHandler;
Speaker _speaker1;
@@ -534,7 +535,8 @@ public:
SceneItem _item1;
int _turnAmount, _angle, _speed, _fadePercent;
- int _field_312, _field_314;
+ int _hitCount;
+ bool _rocksCheck;
Object *_objList[4];
bool _msgActive;