From 840184da0cc9f9a82ceaf049eeb2fe70657ead2e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 7 Mar 2003 03:26:30 +0000 Subject: some cleanup svn-id: r6734 --- simon/simon.cpp | 18 +++++++++--------- simon/simon.h | 6 +++--- simon/vga.cpp | 21 ++++++++++----------- 3 files changed, 22 insertions(+), 23 deletions(-) (limited to 'simon') diff --git a/simon/simon.cpp b/simon/simon.cpp index 554a829fc9..066ebb2e7e 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -2623,7 +2623,7 @@ void SimonState::timer_vga_sprites_helper() { } 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 @@ void SimonState::o_vga_reset() { } } -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 @@ bool SimonState::vc_maybe_skip_proc_3(uint16 a) { 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 @@ void SimonState::dx_update_screen_and_palette() { } } - 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); diff --git a/simon/simon.h b/simon/simon.h index d8a9631064..acebd8d619 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -681,8 +681,8 @@ public: 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 @@ public: 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(); diff --git a/simon/vga.cpp b/simon/vga.cpp index bd923b36db..321e4d4dff 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -361,19 +361,19 @@ void SimonState::vc_5_skip_if_neq() { } 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 @@ static uint16 _video_windows[128] = { }; /* 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 @@ void SimonState::vc_10_helper_8(byte *dst, byte *src) { if (--w == 0) return; dst = ++dst_org; - h = _vga_var5; + h = height; } } while (--reps >= 0); } else { @@ -560,7 +560,7 @@ void SimonState::vc_10_helper_8(byte *dst, byte *src) { if (--w == 0) return; dst = ++dst_org; - h = _vga_var5; + h = height; } } while (++reps != 0); } @@ -638,12 +638,11 @@ void SimonState::vc_10_draw() { 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(); -- cgit v1.2.3