[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.160,1.161 simon.h,1.50,1.51 vga.cpp,1.35,1.36
Max Horn
fingolfin at users.sourceforge.net
Thu Mar 6 19:27:03 CET 2003
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv19205a
Modified Files:
simon.cpp simon.h vga.cpp
Log Message:
some cleanup
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- simon.cpp 6 Mar 2003 21:46:50 -0000 1.160
+++ simon.cpp 7 Mar 2003 03:26:30 -0000 1.161
@@ -2623,7 +2623,7 @@
}
src = _vga_var7 + x * 4;
- vc_10_helper_8(dst, src + READ_BE_UINT32_UNALIGNED(&*((uint32 *)src)));
+ decodeStripA(dst, src + READ_BE_UINT32_UNALIGNED(&*((uint32 *)src)), _vga_var5);
dx_unlock_2();
@@ -2789,7 +2789,7 @@
}
}
-bool SimonState::vc_maybe_skip_proc_3(uint16 a) {
+bool SimonState::itemIsSiblingOf(uint16 a) {
Item *item;
CHECK_BOUNDS(a, _vc_item_array);
@@ -2801,7 +2801,7 @@
return getItem1Ptr()->parent == item->parent;
}
-bool SimonState::vc_maybe_skip_proc_2(uint16 a, uint16 b) {
+bool SimonState::itemIsParentOf(uint16 a, uint16 b) {
Item *item_a, *item_b;
CHECK_BOUNDS(a, _vc_item_array);
@@ -4515,12 +4515,12 @@
}
}
- if (_mouse_pos_changed) {
- _mouse_pos_changed = false;
- _system->set_mouse_pos(_sdl_mouse_x, _sdl_mouse_y);
- }
- _system->copy_rect(_sdl_buf_attached, 320, 0, 0, 320, 200);
- _system->update_screen();
+ if (_mouse_pos_changed) {
+ _mouse_pos_changed = false;
+ _system->set_mouse_pos(_sdl_mouse_x, _sdl_mouse_y);
+ }
+ _system->copy_rect(_sdl_buf_attached, 320, 0, 0, 320, 200);
+ _system->update_screen();
memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- simon.h 6 Mar 2003 21:46:52 -0000 1.50
+++ simon.h 7 Mar 2003 03:26:30 -0000 1.51
@@ -681,8 +681,8 @@
void vc_write_var(uint var, int16 value);
void vc_skip_next_instruction();
- bool vc_maybe_skip_proc_3(uint16 val);
- bool vc_maybe_skip_proc_2(uint16 a, uint16 b);
+ bool itemIsSiblingOf(uint16 val);
+ bool itemIsParentOf(uint16 a, uint16 b);
bool vc_maybe_skip_proc_1(uint16 a, int16 b);
void add_vga_timer(uint num, byte *code_ptr, uint cur_sprite, uint cur_file);
@@ -773,7 +773,7 @@
void vc_58();
void timer_vga_sprites_helper();
- void vc_10_helper_8(byte *dst, byte *src);
+ void decodeStripA(byte *dst, byte *src, int height);
void scroll_timeout();
void hitarea_stuff_helper_2();
void realizePalette();
Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- vga.cpp 6 Mar 2003 21:46:53 -0000 1.35
+++ vga.cpp 7 Mar 2003 03:26:30 -0000 1.36
@@ -361,19 +361,19 @@
}
void SimonState::vc_6_skip_ifn_sib_with_a() { // vc_6_maybe_skip_3_inv
- if (!vc_maybe_skip_proc_3(vc_read_next_word()))
+ if (!itemIsSiblingOf(vc_read_next_word()))
vc_skip_next_instruction();
}
void SimonState::vc_7_skip_if_sib_with_a() { // vc_7_maybe_skip_3
- if (vc_maybe_skip_proc_3(vc_read_next_word()))
+ if (itemIsSiblingOf(vc_read_next_word()))
vc_skip_next_instruction();
}
void SimonState::vc_8_skip_if_parent_is() { // vc_8_maybe_skip_2
uint a = vc_read_next_word();
uint b = vc_read_next_word();
- if (!vc_maybe_skip_proc_2(a, b))
+ if (!itemIsParentOf(a, b))
vc_skip_next_instruction();
}
@@ -523,12 +523,12 @@
};
/* simon2 specific */
-void SimonState::vc_10_helper_8(byte *dst, byte *src) {
+void SimonState::decodeStripA(byte *dst, byte *src, int height) {
const uint pitch = _dx_surface_pitch;
int8 reps = (int8)0x80;
byte color;
byte *dst_org = dst;
- uint h = _vga_var5, w = 8;
+ uint h = height, w = 8;
for (;;) {
reps = *src++;
@@ -545,7 +545,7 @@
if (--w == 0)
return;
dst = ++dst_org;
- h = _vga_var5;
+ h = height;
}
} while (--reps >= 0);
} else {
@@ -560,7 +560,7 @@
if (--w == 0)
return;
dst = ++dst_org;
- h = _vga_var5;
+ h = height;
}
} while (++reps != 0);
}
@@ -638,12 +638,11 @@
dst = dx_lock_attached();
src = state.depack_src + _x_scroll * 4;
- w = 40;
- do {
- vc_10_helper_8(dst, src + READ_BE_UINT32_UNALIGNED(&*(uint32 *)src));
+ for (w = 0; w < 40; w++) {
+ decodeStripA(dst, src + READ_BE_UINT32_UNALIGNED(&*(uint32 *)src), height);
dst += 8;
src += 4;
- } while (--w);
+ }
dx_unlock_attached();
More information about the Scummvm-git-logs
mailing list