diff options
author | Max Horn | 2009-02-24 20:50:09 +0000 |
---|---|---|
committer | Max Horn | 2009-02-24 20:50:09 +0000 |
commit | 7d2a2ece38b91292d811c355d4cf1d3214087891 (patch) | |
tree | a6e4461517883a8b21c3ebcb2ba069e9c2f89891 /engines/sci/gfx | |
parent | 7d5e45fa8383070944ba9981e7b82c8dc3799fab (diff) | |
download | scummvm-rg350-7d2a2ece38b91292d811c355d4cf1d3214087891.tar.gz scummvm-rg350-7d2a2ece38b91292d811c355d4cf1d3214087891.tar.bz2 scummvm-rg350-7d2a2ece38b91292d811c355d4cf1d3214087891.zip |
SCI: Replaced gfxop_usleep by gfxop_sleep (taking millisecs instead of microsecs)
svn-id: r38854
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r-- | engines/sci/gfx/gfx_test.cpp | 16 | ||||
-rw-r--r-- | engines/sci/gfx/operations.cpp | 6 | ||||
-rw-r--r-- | engines/sci/gfx/operations.h | 6 |
3 files changed, 13 insertions, 15 deletions
diff --git a/engines/sci/gfx/gfx_test.cpp b/engines/sci/gfx/gfx_test.cpp index 2987aab47e..bca8d56748 100644 --- a/engines/sci/gfx/gfx_test.cpp +++ b/engines/sci/gfx/gfx_test.cpp @@ -580,7 +580,7 @@ waitkey(void) { if (event.type) return 0; - gfxop_usleep(state, 1000); + gfxop_sleep(state, 1); } return 1; } @@ -597,7 +597,7 @@ wait_specific_key(int key) { && event.data == key) return 0; - gfxop_usleep(state, 1000); + gfxop_sleep(state, 1); } return 1; } @@ -800,7 +800,7 @@ test_c(void) { for (i = 0; i <= 40; i++) { gfxop_update_box(state, gfx_rect(i*4, 0 , 4, 150)); gfxop_update_box(state, gfx_rect(317 - i*4, 0 , 4, 150)); - gfxop_usleep(state, 4000); + gfxop_sleep(state, 4); } gfxop_disable_dirty_frames(state); @@ -814,7 +814,7 @@ test_c(void) { for (i = 159; i >= 0; i--) { gfxop_update_box(state, gfx_rect(i, 0 , 1, 150)); gfxop_update_box(state, gfx_rect(319 - i, 0 , 1, 150)); - gfxop_usleep(state, 1000); + gfxop_sleep(state, 1); } clear(); @@ -887,7 +887,7 @@ test_d(void) { gfxop_update_box(state, line); } - gfxop_usleep(state, 1000); + gfxop_sleep(state, 1); } event.type = 0; @@ -929,7 +929,7 @@ test_e(void) { clear_buffer(); gfxop_draw_cel(state, 0, 0, 0, gfx_point(x, 40), white, 0); update(); - gfxop_usleep(state, 10000); + gfxop_sleep(state, 10); } MESSAGE("E.2: Pic views\nFour pic views will now be added to\nthe static buffer"); @@ -957,7 +957,7 @@ test_e(void) { gfxop_draw_cel(state, 0, 0, 2, gfx_point(x, 20), white8, 0); gfxop_draw_cel(state, 0, 0, 2, gfx_point(x, 100), white16, 0); update(); - gfxop_usleep(state, 10000); + gfxop_sleep(state, 10); } gfxop_add_to_pic(state, 1, 0, 0); @@ -975,7 +975,7 @@ test_e(void) { gfxop_update(state); /* gfxop_update_box(state, gfx_rect(x-1, 40, 17, 16)); */ /* gfxop_update_box(state, gfx_rect(x-1, 70, 17, 16)); */ - gfxop_usleep(state, 10000); + gfxop_sleep(state, 10); } waitkey(); } diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index bcdc12223e..f29aeb395c 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -30,8 +30,6 @@ #include "common/system.h" -#include <ctype.h> - namespace Sci { #define PRECISE_PRIORITY_MAP // Duplicate all operations on the local priority map as appropriate @@ -1362,11 +1360,11 @@ static int _gfxop_full_pointer_refresh(gfx_state_t *state) { return 0; } -int gfxop_usleep(gfx_state_t *state, long usecs) { +int gfxop_sleep(gfx_state_t *state, uint32 msecs) { BASIC_CHECKS(GFX_FATAL); uint32 time; - const uint32 wakeup_time = g_system->getMillis() + usecs / 1000; + const uint32 wakeup_time = g_system->getMillis() + msecs; while (true) { GFXOP_FULL_POINTER_REFRESH; diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h index d3cdedceac..5eee47e79c 100644 --- a/engines/sci/gfx/operations.h +++ b/engines/sci/gfx/operations.h @@ -371,10 +371,10 @@ int gfxop_free_color(gfx_state_t *state, gfx_color_t *color); /* Pointer and IO ops */ /**********************/ -int gfxop_usleep(gfx_state_t *state, long usecs); -/* Suspends program execution for the specified amount of microseconds +int gfxop_sleep(gfx_state_t *state, uint32 msecs); +/* Suspends program execution for the specified amount of milliseconds ** Parameters: (gfx_state_t *) state: The state affected -** (long) usecs: The amount of microseconds to wait +** (uint32) usecs: The amount of milliseconds to wait ** Returns : (int) GFX_OK or GFX_ERROR ** The mouse pointer will be redrawn continually, if applicable */ |