aboutsummaryrefslogtreecommitdiff
path: root/simon/items.cpp
diff options
context:
space:
mode:
authorTravis Howell2002-12-12 11:07:01 +0000
committerTravis Howell2002-12-12 11:07:01 +0000
commita454add929ed73f5286492b9e1153c97f7b23054 (patch)
tree76b986f06601a0bb41e9651f271ee2d2ecf69cdf /simon/items.cpp
parent6c20dc48c7b974ad119a37adfd1f992102ac6027 (diff)
downloadscummvm-rg350-a454add929ed73f5286492b9e1153c97f7b23054.tar.gz
scummvm-rg350-a454add929ed73f5286492b9e1153c97f7b23054.tar.bz2
scummvm-rg350-a454add929ed73f5286492b9e1153c97f7b23054.zip
Small code cleanup
svn-id: r5912
Diffstat (limited to 'simon/items.cpp')
-rw-r--r--simon/items.cpp50
1 files changed, 7 insertions, 43 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index 655e0af00b..a7aa823385 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -989,7 +989,7 @@ int SimonState::runScript()
uint d = _array_4[a];
if (d != 0)
talk_with_speech(d, b);
- } else if (_game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) {
+ } else if (_game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS || _game == GAME_SIMON2DOS) {
const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]);
ThreeValues *tv = getThreeValues(b);
@@ -1001,14 +1001,7 @@ int SimonState::runScript()
if (d != 0 && !_vk_t_toggle)
talk_with_speech(d, b);
-
- if (s != NULL && _vk_t_toggle)
- talk_with_text(b, c, s, tv->a, tv->b, tv->c);
- } else if (_game == GAME_SIMON2DOS) {
- const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]);
- ThreeValues *tv = getThreeValues(b);
-
- if (s != NULL)
+ else
talk_with_text(b, c, s, tv->a, tv->b, tv->c);
}
}
@@ -1237,11 +1230,11 @@ bool SimonState::o_unk_23(uint a)
void SimonState::o_177()
{
+ uint a = getVarOrByte();
+ uint b = getVarOrByte();
+ Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
- uint a = getVarOrByte();
- /*uint b = */ getVarOrByte();
uint offs;
- Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
if (child != NULL && child->avail_props & 0x200) {
offs = getOffsetOfChild2Param(child, 0x200);
talk_with_speech(child->array[offs], a);
@@ -1249,10 +1242,7 @@ void SimonState::o_177()
offs = getOffsetOfChild2Param(child, 0x100);
talk_with_speech(child->array[offs] + 3550, a);
}
- } else if ((_game == GAME_SIMON1DEMO) || (_game == GAME_SIMON1DOS)) {
- uint a = getVarOrByte();
- uint b = getVarOrByte();
- Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
+ } else if (_game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS || _game == _game == GAME_SIMON2DOS) {
if (child != NULL && child->avail_props & 1) {
const char *s = (const char *)getStringPtrByID(child->array[0]);
char buf[256];
@@ -1260,17 +1250,13 @@ void SimonState::o_177()
ThreeValues *tv = getThreeValues(a);
if (child->avail_props & 0x100) {
- uint x = getOffsetOfChild2Param(child, 0x100);
- sprintf(buf, "%d%s", child->array[x], s);
+ sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], s);
s = buf;
}
talk_with_text(a, b, s, tv->a, tv->b, tv->c);
}
} else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) {
- uint a = getVarOrByte();
- uint b = getVarOrByte();
- Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
const char *s = NULL;
ThreeValues *tv = NULL;
char buf[256];
@@ -1343,28 +1329,6 @@ void SimonState::o_177()
}
talk_with_text(a, b, s, tv->a, tv->b, tv->c);
- } else if (_game == GAME_SIMON2DOS) {
- uint a = getVarOrByte();
- uint b = getVarOrByte();
- Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
- const char *s = NULL;
- ThreeValues *tv = NULL;
- char buf[256];
-
- if (child != NULL && child->avail_props & 1) {
- s = (const char *)getStringPtrByID(child->array[0]);
- tv = getThreeValues(a);
- }
-
- if (child == NULL || !(child->avail_props & 1))
- return;
-
- if (child->avail_props & 0x100) {
- sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], s);
- s = buf;
- }
-
- talk_with_text(a, b, s, tv->a, tv->b, tv->c);
}
}