TSAGE: R2R - Reduce the scope of scene variables in logic group 1

This commit is contained in:
Strangerke 2013-11-11 20:57:22 +01:00
parent 917bf58b75
commit 1abab591d9

View file

@ -677,11 +677,11 @@ void Scene1100::synchronize(Serializer &s) {
} }
bool Scene1100::Seeker::startAction(CursorType action, Event &event) { bool Scene1100::Seeker::startAction(CursorType action, Event &event) {
Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene;
if (action != CURSOR_TALK) if (action != CURSOR_TALK)
return SceneActor::startAction(action, event); return SceneActor::startAction(action, event);
Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene;
if (R2_GLOBALS.getFlag(52)) { if (R2_GLOBALS.getFlag(52)) {
R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.disableControl();
if (R2_GLOBALS._player._characterIndex == R2_QUINN) if (R2_GLOBALS._player._characterIndex == R2_QUINN)
@ -757,9 +757,9 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) {
} }
bool Scene1100::Chief::startAction(CursorType action, Event &event) { bool Scene1100::Chief::startAction(CursorType action, Event &event) {
if ((action == CURSOR_TALK) && (!R2_GLOBALS.getFlag(54)) && (R2_GLOBALS.getFlag(52))) {
Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene;
if ((action == CURSOR_TALK) && (!R2_GLOBALS.getFlag(54)) && (R2_GLOBALS.getFlag(52))) {
scene->_nextStripNum = 0; scene->_nextStripNum = 0;
R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.disableControl();
scene->_sceneMode = 53; scene->_sceneMode = 53;
@ -7450,10 +7450,11 @@ void Scene1550::DishControlsWindow::DishControl::synchronize(Serializer &s) {
} }
bool Scene1550::DishControlsWindow::DishControl::startAction(CursorType action, Event &event) { bool Scene1550::DishControlsWindow::DishControl::startAction(CursorType action, Event &event) {
Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene;
if (action != CURSOR_USE) if (action != CURSOR_USE)
return SceneActor::startAction(action, event); return SceneActor::startAction(action, event);
Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene;
switch (_controlId) { switch (_controlId) {
case 1: case 1:
// Button control // Button control
@ -9665,9 +9666,9 @@ void Scene1580::synchronize(Serializer &s) {
} }
bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) { bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) {
if (action == R2_JOYSTICK) {
Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene;
if (action == R2_JOYSTICK) {
R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1580); R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1580);
R2_GLOBALS._sceneItems.remove(&scene->_joystickPlug); R2_GLOBALS._sceneItems.remove(&scene->_joystickPlug);
scene->_joystick.postInit(); scene->_joystick.postInit();
@ -9684,9 +9685,9 @@ bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) {
} }
bool Scene1580::ScreenSlot::startAction(CursorType action, Event &event) { bool Scene1580::ScreenSlot::startAction(CursorType action, Event &event) {
if (action == R2_DIAGNOSTICS_DISPLAY) {
Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene;
if (action == R2_DIAGNOSTICS_DISPLAY) {
R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1580); R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1580);
R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.disableControl();
R2_GLOBALS._sceneItems.remove(&scene->_screenSlot); R2_GLOBALS._sceneItems.remove(&scene->_screenSlot);
@ -11757,13 +11758,13 @@ bool Scene1850::Door::startAction(CursorType action, Event &event) {
if (action != CURSOR_USE) if (action != CURSOR_USE)
return SceneHotspot::startAction(action, event); return SceneHotspot::startAction(action, event);
Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene;
if (R2_GLOBALS.getFlag(32)) { if (R2_GLOBALS.getFlag(32)) {
SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END);
return true; return true;
} }
Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene;
R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.disableControl();
if (scene->_sceneMode == 1851) if (scene->_sceneMode == 1851)
R2_GLOBALS._player._effect = EFFECT_SHADED; R2_GLOBALS._player._effect = EFFECT_SHADED;
@ -12644,8 +12645,6 @@ void Scene1875::process(Event &event) {
*--------------------------------------------------------------------------*/ *--------------------------------------------------------------------------*/
bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) {
Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene;
if (action != CURSOR_USE) if (action != CURSOR_USE)
return SceneActor::startAction(action, event); return SceneActor::startAction(action, event);
@ -12656,6 +12655,8 @@ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) {
return true; return true;
} }
Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene;
R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player.enableControl(CURSOR_USE);
if (_position.x >= 160) { if (_position.x >= 160) {
@ -12912,14 +12913,14 @@ void Scene1925::synchronize(Serializer &s) {
} }
bool Scene1925::Button::startAction(CursorType action, Event &event) { bool Scene1925::Button::startAction(CursorType action, Event &event) {
Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene;
if (action != CURSOR_USE) if (action != CURSOR_USE)
return SceneHotspot::startAction(action, event); return SceneHotspot::startAction(action, event);
if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100))
return SceneHotspot::startAction(action, event); return SceneHotspot::startAction(action, event);
Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene;
if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 20)) if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 20))
scene->_sceneMode = 1928; scene->_sceneMode = 1928;
else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 200)) else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 200))
@ -13278,11 +13279,11 @@ bool Scene1945::Ice::startAction(CursorType action, Event &event) {
} }
bool Scene1945::Ladder::startAction(CursorType action, Event &event) { bool Scene1945::Ladder::startAction(CursorType action, Event &event) {
Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene;
if (action != CURSOR_USE) if (action != CURSOR_USE)
return SceneHotspot::startAction(action, event); return SceneHotspot::startAction(action, event);
Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene;
R2_GLOBALS._player.disableControl(CURSOR_USE); R2_GLOBALS._player.disableControl(CURSOR_USE);
scene->_sceneMode = 0; scene->_sceneMode = 0;