TSAGE: Expanded a lot of game Id checks for Blue Force to include Ringworld 2 as well

This commit is contained in:
Paul Gilbert 2011-10-25 21:00:41 +11:00
parent 9ccb2eea32
commit e93c847df7
3 changed files with 12 additions and 11 deletions

View file

@ -2810,7 +2810,7 @@ void SceneText::synchronize(Serializer &s) {
void SceneText::updateScreen() { void SceneText::updateScreen() {
// FIXME: Hack for Blue Force to handle not refreshing the screen if the user interface // FIXME: Hack for Blue Force to handle not refreshing the screen if the user interface
// has been re-activated after showing some scene text // has been re-activated after showing some scene text
if ((g_vm->getGameID() != GType_BlueForce) || (_bounds.top < UI_INTERFACE_Y) || if ((g_vm->getGameID() == GType_Ringworld) || (_bounds.top < UI_INTERFACE_Y) ||
!T2_GLOBALS._uiElements._visible) !T2_GLOBALS._uiElements._visible)
SceneObject::updateScreen(); SceneObject::updateScreen();
} }
@ -2944,7 +2944,7 @@ void Player::disableControl() {
g_globals->_events.setCursor(CURSOR_NONE); g_globals->_events.setCursor(CURSOR_NONE);
_enabled = false; _enabled = false;
if ((g_vm->getGameID() == GType_BlueForce) && T2_GLOBALS._uiElements._active) if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active)
T2_GLOBALS._uiElements.hide(); T2_GLOBALS._uiElements.hide();
} }
@ -2992,7 +2992,7 @@ void Player::process(Event &event) {
(g_globals->_events.getCursor() == CURSOR_WALK) && g_globals->_player._canWalk && (g_globals->_events.getCursor() == CURSOR_WALK) && g_globals->_player._canWalk &&
(_position != event.mousePos) && g_globals->_sceneObjects->contains(this)) { (_position != event.mousePos) && g_globals->_sceneObjects->contains(this)) {
if ((g_vm->getGameID() == GType_BlueForce) && !BF_GLOBALS._player._enabled) if ((g_vm->getGameID() != GType_Ringworld) && !BF_GLOBALS._player._enabled)
return; return;
PlayerMover *newMover = new PlayerMover(); PlayerMover *newMover = new PlayerMover();
@ -3011,7 +3011,7 @@ void Player::synchronize(Serializer &s) {
s.syncAsByte(_uiEnabled); s.syncAsByte(_uiEnabled);
s.syncAsSint16LE(_field8C); s.syncAsSint16LE(_field8C);
if (g_vm->getGameID() == GType_BlueForce) if (g_vm->getGameID() != GType_Ringworld)
s.syncAsByte(_enabled); s.syncAsByte(_enabled);
} }
@ -3829,7 +3829,7 @@ void SceneHandler::process(Event &event) {
} }
// Mouse press handling // Mouse press handling
bool enabled = (g_vm->getGameID() == GType_BlueForce) ? g_globals->_player._enabled : bool enabled = (g_vm->getGameID() != GType_Ringworld) ? g_globals->_player._enabled :
g_globals->_player._uiEnabled; g_globals->_player._uiEnabled;
if (enabled && (event.eventType == EVENT_BUTTON_DOWN) && !g_globals->_sceneItems.empty()) { if (enabled && (event.eventType == EVENT_BUTTON_DOWN) && !g_globals->_sceneItems.empty()) {
// Check if the mouse is on the player // Check if the mouse is on the player
@ -3861,7 +3861,7 @@ void SceneHandler::process(Event &event) {
g_globals->_events.setCursor(CURSOR_USE); g_globals->_events.setCursor(CURSOR_USE);
} }
if (g_vm->getGameID() == GType_BlueForce) if (g_vm->getGameID() != GType_Ringworld)
event.handled = true; event.handled = true;
} else if (g_vm->getGameID() != GType_Ringworld) { } else if (g_vm->getGameID() != GType_Ringworld) {
event.handled = true; event.handled = true;
@ -3917,7 +3917,7 @@ void SceneHandler::dispatch() {
do { do {
process(event); process(event);
} while (g_globals->_events.getEvent(event)); } while (g_globals->_events.getEvent(event));
} else if (g_vm->getGameID() == GType_BlueForce) { } else if (g_vm->getGameID() != GType_Ringworld) {
// For Blue Force, 'none' events need to be generated in the absence of any // For Blue Force, 'none' events need to be generated in the absence of any
event.eventType = EVENT_NONE; event.eventType = EVENT_NONE;
event.mousePos = g_globals->_events._mousePos; event.mousePos = g_globals->_events._mousePos;

View file

@ -251,8 +251,8 @@ void EventsClass::setCursor(CursorType cursorType) {
if (delFlag) if (delFlag)
DEALLOCATE(cursor); DEALLOCATE(cursor);
// For Blue Force, enable the question button when an inventory icon is selected // For Blue Force and Return to Ringworld, enable the question button when an inventory icon is selected
if (g_vm->getGameID() == GType_BlueForce) if (g_vm->getGameID() != GType_Ringworld)
T2_GLOBALS._uiElements._question.setEnabled(questionEnabled); T2_GLOBALS._uiElements._question.setEnabled(questionEnabled);
} }

View file

@ -456,8 +456,9 @@ void Scene::refreshBackground(int xAmount, int yAmount) {
(xSectionSrc + 1) * 160, (ySectionSrc + 1) * 100); (xSectionSrc + 1) * 160, (ySectionSrc + 1) * 100);
Rect destBounds(xSectionDest * 160, ySectionDest * 100, Rect destBounds(xSectionDest * 160, ySectionDest * 100,
(xSectionDest + 1) * 160, (ySectionDest + 1) * 100); (xSectionDest + 1) * 160, (ySectionDest + 1) * 100);
if (g_vm->getGameID() == GType_BlueForce) { if (g_vm->getGameID() != GType_Ringworld) {
// For Blue Force, if the scene has an interface area, exclude it from the copy // For Blue Force and Return to Ringworld, if the scene has an interface area,
// exclude it from the copy
srcBounds.bottom = MIN<int16>(srcBounds.bottom, BF_GLOBALS._interfaceY); srcBounds.bottom = MIN<int16>(srcBounds.bottom, BF_GLOBALS._interfaceY);
destBounds.bottom = MIN<int16>(destBounds.bottom, BF_GLOBALS._interfaceY); destBounds.bottom = MIN<int16>(destBounds.bottom, BF_GLOBALS._interfaceY);
} }