[Scummvm-cvs-logs] CVS: scummvm/simon items.cpp,1.111,1.112 simon.cpp,1.426,1.427 simon.h,1.123,1.124
Oliver Kiehl
olki at users.sourceforge.net
Sun Mar 14 10:00:00 CET 2004
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14141
Modified Files:
items.cpp simon.cpp simon.h
Log Message:
cleanup
Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- items.cpp 24 Feb 2004 22:39:39 -0000 1.111
+++ items.cpp 14 Mar 2004 17:50:36 -0000 1.112
@@ -888,11 +888,11 @@
break;
case 161:{ /* setup text */
- ThreeValues *tv = getThreeValues(getVarOrByte());
+ TextLocation *tl = getTextLocation(getVarOrByte());
- tv->a = getVarOrWord();
- tv->b = getVarOrByte();
- tv->c = getVarOrWord();
+ tl->x = getVarOrWord();
+ tl->y = getVarOrByte();
+ tl->width = getVarOrWord();
}
break;
@@ -974,14 +974,14 @@
uint speech_id = 0;
const char *string_ptr = (const char *)getStringPtrByID(_stringid_array_3[string_id]);
- ThreeValues *tv = getThreeValues(vga_sprite_id);
+ TextLocation *tl = getTextLocation(vga_sprite_id);
if (_game & GF_TALKIE)
speech_id = _speechid_array_4[string_id];
if (_speech && speech_id != 0)
talk_with_speech(speech_id, vga_sprite_id);
if (string_ptr != NULL && _subtitles)
- talk_with_text(vga_sprite_id, color, string_ptr, tv->a, tv->b, tv->c);
+ talk_with_text(vga_sprite_id, color, string_ptr, tl->x, tl->y, tl->width);
}
break;
@@ -1211,13 +1211,13 @@
uint vga_sprite_id = getVarOrByte();
uint color = getVarOrByte();
const char *string_ptr = NULL;
- ThreeValues *tv = NULL;
+ TextLocation *tl = NULL;
char buf[256];
Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
if (child != NULL && child->avail_props & 1) {
string_ptr = (const char *)getStringPtrByID(child->array[0]);
- tv = getThreeValues(vga_sprite_id);
+ tl = getTextLocation(vga_sprite_id);
}
if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) {
@@ -1288,7 +1288,7 @@
string_ptr = buf;
}
if (string_ptr != NULL)
- talk_with_text(vga_sprite_id, color, string_ptr, tv->a, tv->b, tv->c);
+ talk_with_text(vga_sprite_id, color, string_ptr, tl->x, tl->y, tl->width);
}
}
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.426
retrieving revision 1.427
diff -u -d -r1.426 -r1.427
--- simon.cpp 28 Feb 2004 12:58:11 -0000 1.426
+++ simon.cpp 14 Mar 2004 17:50:36 -0000 1.427
@@ -2157,18 +2157,16 @@
startUp_helper_2();
}
-ThreeValues *SimonEngine::getThreeValues(uint a) {
+TextLocation *SimonEngine::getTextLocation(uint a) {
switch (a) {
case 1:
- return &_threevalues_1;
+ return &_textlocation_1;
case 2:
- return &_threevalues_2;
+ return &_textlocation_2;
case 101:
- return &_threevalues_3;
- break;
+ return &_textlocation_3;
case 102:
- return &_threevalues_4;
- break;
+ return &_textlocation_4;
default:
error("text, invalid value %d", a);
}
@@ -2180,7 +2178,7 @@
uint string_id = getNextStringID();
const byte *string_ptr = NULL;
uint speech_id = 0;
- ThreeValues *tv;
+ TextLocation *tl;
if (string_id != 0xFFFF)
string_ptr = getStringPtrByID(string_id);
@@ -2188,7 +2186,7 @@
if (_game & GF_TALKIE)
speech_id = (uint16)getNextWord();
- tv = getThreeValues(vga_sprite_id);
+ tl = getTextLocation(vga_sprite_id);
if (_speech && speech_id != 0)
talk_with_speech(speech_id, vga_sprite_id);
@@ -2196,7 +2194,7 @@
o_kill_sprite_simon2(2, vga_sprite_id + 2);
if (string_ptr != NULL && (speech_id == 0 || _subtitles))
- talk_with_text(vga_sprite_id, color, (const char *)string_ptr, tv->a, tv->b, tv->c);
+ talk_with_text(vga_sprite_id, color, (const char *)string_ptr, tl->x, tl->y, tl->width);
}
@@ -3001,6 +2999,7 @@
}
vsp = _vga_sprites;
+
while (vsp->id != 0) {
vsp->unk6 &= 0x7FFF;
@@ -4073,7 +4072,7 @@
}
}
-void SimonEngine::talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, uint threeval_a, int threeval_b, uint width) {
+void SimonEngine::talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width) {
char print_str_buf[0x140];
char *char_buf;
const char *string_ptr_2, *string_ptr_3;
@@ -4127,7 +4126,7 @@
*char_buf++ = 10;
height += 10;
- threeval_b -= 10;
+ y -= 10;
j = -1;
} else {
// else_1
@@ -4182,7 +4181,7 @@
char_buf += m;
*char_buf++ = 10;
height += 20;
- threeval_b -= 20;
+ y -= 20;
j = -1;
} else {
// else_6
@@ -4255,7 +4254,7 @@
char_buf += m;
*char_buf++ = '\n';
height += 30;
- threeval_b -= 30;
+ y -= 30;
j = -1;
} else {
// else_15
@@ -4297,7 +4296,7 @@
char_buf += m;
*char_buf++ = 10;
height += 10;
- threeval_b -= 10;
+ y -= 10;
string_ptr = string_ptr_2;
}
}
@@ -4322,17 +4321,19 @@
render_string(vga_sprite_id, color, width, height, print_str_buf);
- num_of_rows = 4;
- if (!(_bit_array[8] & 0x20))
- num_of_rows = 3;
+ uint b;
+ if (_bit_array[8] & 0x20)
+ b = 4;
+ else
+ b = 3;
- if (threeval_b < 2)
- threeval_b = 2;
+ if (y < 2)
+ y = 2;
if (!(_game & GF_SIMON2)) {
- start_vga_code(num_of_rows, 2, 199 + vga_sprite_id, threeval_a >> 3, threeval_b, 12);
+ start_vga_code(b, 2, 199 + vga_sprite_id, x >> 3, y, 12);
} else {
- start_vga_code(num_of_rows, 2, vga_sprite_id, threeval_a >> 3, threeval_b, 12);
+ start_vga_code(b, 2, vga_sprite_id, x >> 3, y, 12);
}
}
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- simon.h 30 Jan 2004 03:26:47 -0000 1.123
+++ simon.h 14 Mar 2004 17:50:40 -0000 1.124
@@ -50,9 +50,9 @@
struct SubroutineLine;
struct TimeEvent;
-struct ThreeValues {
- int16 a, b, c;
- ThreeValues() { memset(this, 0, sizeof(*this)); }
+struct TextLocation {
+ int16 x, y, width;
+ TextLocation() { memset(this, 0, sizeof(*this)); }
};
struct HitArea {
@@ -311,7 +311,7 @@
byte _fcs_data_1[8];
bool _fcs_data_2[8];
- ThreeValues _threevalues_1, _threevalues_2, _threevalues_3, _threevalues_4;
+ TextLocation _textlocation_1, _textlocation_2, _textlocation_3, _textlocation_4;
int _free_string_slot;
@@ -509,7 +509,7 @@
void o_unk_186();
void o_fade_to_black();
- ThreeValues *getThreeValues(uint a);
+ TextLocation *getTextLocation(uint a);
void o_print_str();
void o_setup_cond_c();
void setup_cond_c_helper();
@@ -597,7 +597,7 @@
void start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint x, uint y, uint base_color);
void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
void talk_with_speech(uint speech_id, uint vga_sprite_id);
- void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, uint threeval_a, int threeval_b, uint width);
+ void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);
FillOrCopyStruct *fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint unk4);
void render_string_amiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
More information about the Scummvm-git-logs
mailing list