Skip to content

Commit

Permalink
TSAGE: Some renaming in StripManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Dec 19, 2013
1 parent 6647df4 commit ca7a5cb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 41 deletions.
48 changes: 24 additions & 24 deletions engines/tsage/converse.cpp
Expand Up @@ -648,11 +648,11 @@ void StripManager::reset() {
_delayFrames = 0;
_owner = NULL;
_endHandler = NULL;
_field2E6 = false;
_uselessFl = false;
_stripNum = -1;
_obj44Index = 0;
_field2E8 = 0;
_field20 = 0;
_obj44ListIndex = 0;
_currObj44Id = 0;
_useless = 0;
_activeSpeaker = NULL;
_textShown = false;
_callbackObject = NULL;
Expand Down Expand Up @@ -696,14 +696,14 @@ void StripManager::synchronize(Serializer &s) {
Action::synchronize(s);

s.syncAsSint32LE(_stripNum);
s.syncAsSint32LE(_obj44Index);
s.syncAsSint32LE(_field20);
s.syncAsSint32LE(_obj44ListIndex);
s.syncAsSint32LE(_useless);
s.syncAsSint32LE(_sceneNumber);
_sceneBounds.synchronize(s);
SYNC_POINTER(_activeSpeaker);
s.syncAsByte(_textShown);
s.syncAsByte(_field2E6);
s.syncAsSint32LE(_field2E8);
s.syncAsByte(_uselessFl);
s.syncAsSint32LE(_currObj44Id);
if (g_vm->getGameID() == GType_Ringworld2)
s.syncAsSint16LE(_exitMode);

Expand Down Expand Up @@ -785,14 +785,14 @@ void StripManager::signal() {
_textShown = false;
}

if (_obj44Index < 0) {
if (_obj44ListIndex < 0) {
EventHandler *owner = _endHandler;
int stripNum = ABS(_obj44Index);
int stripNum = ABS(_obj44ListIndex);
remove();

start(stripNum, owner);
return;
} else if (_obj44Index == 10000) {
} else if (_obj44ListIndex == 10000) {
// Reached end of strip
EventHandler *endHandler = _endHandler;
remove();
Expand All @@ -809,7 +809,7 @@ void StripManager::signal() {
// Load the data for the strip
load();

Obj44 &obj44 = _obj44List[_obj44Index];
Obj44 &obj44 = _obj44List[_obj44ListIndex];

if (g_vm->getGameID() == GType_Ringworld2) {
// Return to Ringworld specific handling
Expand All @@ -831,7 +831,7 @@ void StripManager::signal() {
}
}

_field2E8 = obj44._id;
_currObj44Id = obj44._id;
Common::StringArray choiceList;

// Build up a list of script entries
Expand Down Expand Up @@ -925,7 +925,7 @@ void StripManager::signal() {
// Get the user to select a conversation option
strIndex = _choiceDialog.execute(choiceList);

if ((delayFlag || choiceList.size() != 1) && !_field2E6)
if ((delayFlag || choiceList.size() != 1) && !_uselessFl)
_delayFrames = 1;
else {
Speaker *speakerP = getSpeaker((const char *)&_script[0] + obj44._speakerOffset);
Expand Down Expand Up @@ -978,10 +978,10 @@ void StripManager::signal() {
}
}

_obj44Index = getNewIndex(obj44._list[strIndex]._id);
if (_obj44Index == 10001) {
_obj44ListIndex = getNewIndex(obj44._list[strIndex]._id);
if (_obj44ListIndex == 10001) {
MessageDialog::show("Strip Failure: Node not found", OK_BTN_STRING);
_obj44Index = 0;
_obj44ListIndex = 0;
}
}

Expand All @@ -991,16 +991,16 @@ void StripManager::process(Event &event) {
return;

if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) {
if (_obj44Index != 10000) {
int currIndex = _obj44Index;
while (!_obj44List[_obj44Index]._list[1]._id) {
_obj44Index = getNewIndex(_obj44List[_obj44Index]._list[0]._id);
if ((_obj44Index < 0) || (_obj44Index == 10000))
if (_obj44ListIndex != 10000) {
int currIndex = _obj44ListIndex;
while (!_obj44List[_obj44ListIndex]._list[1]._id) {
_obj44ListIndex = getNewIndex(_obj44List[_obj44ListIndex]._list[0]._id);
if ((_obj44ListIndex < 0) || (_obj44ListIndex == 10000))
break;
currIndex = _obj44Index;
currIndex = _obj44ListIndex;
}

_field2E8 = _obj44List[currIndex]._id;
_currObj44Id = _obj44List[currIndex]._id;
}

// Signal the end of the strip
Expand Down
8 changes: 4 additions & 4 deletions engines/tsage/converse.h
Expand Up @@ -212,17 +212,17 @@ class StripManager : public Action {
int getNewIndex(int newId);
public:
int _stripNum;
int _obj44Index;
int _field20;
int _obj44ListIndex;
int _useless;
int _sceneNumber;
Rect _sceneBounds;
ConversationChoiceDialog _choiceDialog;
Common::Array<Speaker *> _speakerList;
StripCallback *_callbackObject;
Speaker *_activeSpeaker;
bool _textShown;
bool _field2E6;
int _field2E8;
bool _uselessFl;
int _currObj44Id;
int _exitMode;
Common::Array<Obj44> _obj44List;
Common::Array<byte> _script;
Expand Down
8 changes: 4 additions & 4 deletions engines/tsage/ringworld/ringworld_scenes1.cpp
Expand Up @@ -1623,7 +1623,7 @@ void Scene50::Action1::signal() {
scene->_stripManager.start(63, this);
break;
case 2:
if (scene->_stripManager._field2E8 != 107) {
if (scene->_stripManager._currObj44Id != 107) {
g_globals->_player.enableControl();
remove();
} else {
Expand Down Expand Up @@ -2498,7 +2498,7 @@ void Scene90::Action1::signal() {
case 5:
scene->_soundHandler2.play(58);

if (scene->_stripManager._field2E8 == 220)
if (scene->_stripManager._currObj44Id == 220)
scene->_stripManager.start(91, this, scene);
else {
scene->_stripManager.start(g_globals->getFlag(104) ? 93 : 92, this, scene);
Expand Down Expand Up @@ -2714,7 +2714,7 @@ void Scene90::signal() {
g_globals->_player.enableControl();
break;
case 97:
_stripManager._field2E8 = 0;
_stripManager._currObj44Id = 0;
_action1.setActionIndex(5);
_action1.setDelay(1);
break;
Expand Down Expand Up @@ -2939,7 +2939,7 @@ void Scene6100::Action3::signal() {
case 4:
g_globals->setFlag(76);
g_globals->_sceneManager.changeScene(
(scene->_stripManager._field2E8 == 135) ? 6100 : 2320);
(scene->_stripManager._currObj44Id == 135) ? 6100 : 2320);
remove();
break;
}
Expand Down
8 changes: 4 additions & 4 deletions engines/tsage/ringworld/ringworld_scenes3.cpp
Expand Up @@ -799,7 +799,7 @@ void Scene2100::Action9::signal() {
scene->_stripManager.start(6010, this);
break;
case 6:
if (scene->_stripManager._field2E8 != 165)
if (scene->_stripManager._currObj44Id != 165)
setAction(&scene->_action10);
else
setAction(&scene->_action11);
Expand Down Expand Up @@ -1010,7 +1010,7 @@ void Scene2100::Action12::signal() {
scene->_stripManager.start(6052, this);
break;
case 8:
if (scene->_stripManager._field2E8 == 320)
if (scene->_stripManager._currObj44Id == 320)
g_globals->setFlag(74);
setDelay(30);
break;
Expand Down Expand Up @@ -2352,11 +2352,11 @@ void Scene2150::Action2::signal() {
scene->_hotspot14.setStrip(6);
scene->_hotspot14.setPosition(Common::Point(59, 54));

if (scene->_stripManager._field2E8 == 15) {
if (scene->_stripManager._currObj44Id == 15) {
scene->_hotspot14.setFrame(5);
RING_INVENTORY._ale._sceneNumber = 1;
} else {
scene->_hotspot14.setFrame(scene->_stripManager._field2E8 - 5);
scene->_hotspot14.setFrame(scene->_stripManager._currObj44Id - 5);
}

g_globals->_player.setFrame(1);
Expand Down
4 changes: 2 additions & 2 deletions engines/tsage/ringworld/ringworld_scenes5.cpp
Expand Up @@ -462,7 +462,7 @@ void Scene4000::Action12::signal() {
break;
case 2:
g_globals->setFlag(32);
if (scene->_stripManager._field2E8 == 275) {
if (scene->_stripManager._currObj44Id == 275) {
g_globals->setFlag(82);
ADD_MOVER_NULL(scene->_guardRock, 292, 138);
ADD_PLAYER_MOVER(283, 147);
Expand All @@ -471,7 +471,7 @@ void Scene4000::Action12::signal() {
}
break;
case 3:
if (scene->_stripManager._field2E8 == 275) {
if (scene->_stripManager._currObj44Id == 275) {
g_globals->_sceneManager.changeScene(4100);
} else {
ADD_PLAYER_MOVER_THIS(scene->_guardRock, 300, 132);
Expand Down
4 changes: 2 additions & 2 deletions engines/tsage/ringworld2/ringworld2_scenes0.cpp
Expand Up @@ -1541,7 +1541,7 @@ void Scene180::postInit(SceneObjectList *OwnerList) {
}

void Scene180::remove() {
_stripManager._field2E8 = -1;
_stripManager._currObj44Id = -1;
// _stripManager._field2EA = -1;
SceneExt::remove();

Expand Down Expand Up @@ -3556,7 +3556,7 @@ void Scene300::signal() {
break;
}

_stripManager._field2E8 = 0;
_stripManager._currObj44Id = 0;
switch (_stripId) {
case 400:
R2_GLOBALS._player.disableControl();
Expand Down
2 changes: 1 addition & 1 deletion engines/tsage/ringworld2/ringworld2_scenes1.cpp
Expand Up @@ -10101,7 +10101,7 @@ void Scene1625::signal() {
break;
}
//_field412 = _stripManager._field2E8;
_stripManager._field2E8 = 0;
_stripManager._currObj44Id = 0;
break;
case 1625:
_tealHead.postInit();
Expand Down

0 comments on commit ca7a5cb

Please sign in to comment.