projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
separated graphic and control definitions for global animations
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 7a15c03e81b4973bbf5d29a533252ade5b43d30d..e2352d185703d22585a66931c5e3a5ab07b199ac 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-173,6
+173,9
@@
static int el_act2crm(int, int);
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
+static unsigned int sync_frame_delay = 0;
+static unsigned int sync_frame_delay_value = GAME_FRAME_DELAY;
+
static char *print_if_not_empty(int element)
{
static char *s = NULL;
static char *print_if_not_empty(int element)
{
static char *s = NULL;
@@
-1239,13
+1242,12
@@
void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic,
void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y,
int graphic, int frame)
{
void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y,
int graphic, int frame)
{
- struct GraphicInfo *g = &graphic_info[graphic];
Bitmap *src_bitmap;
int src_x, src_y;
getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
Bitmap *src_bitmap;
int src_x, src_y;
getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
- BlitBitmapMasked(src_bitmap, d, src_x, src_y,
g->width, g->height
,
+ BlitBitmapMasked(src_bitmap, d, src_x, src_y,
TILEX, TILEY
,
dst_x, dst_y);
}
dst_x, dst_y);
}
@@
-2392,13
+2394,6
@@
void AnimateEnvelopeRequest(int anim_mode, int action)
ystart = yend;
end = 0;
}
ystart = yend;
end = 0;
}
- else
- {
- if (action == ACTION_OPENING)
- PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE);
- else if (action == ACTION_CLOSING)
- PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE);
- }
for (i = start; i <= end; i++)
{
for (i = start; i <= end; i++)
{
@@
-3404,8
+3399,7
@@
void WaitForEventToContinue()
DoAnimation();
DoAnimation();
- /* don't eat all CPU time */
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
}
}
}
@@
-3576,12
+3570,11
@@
static int RequestHandleEvents(unsigned int req_state)
else
{
DoAnimation();
else
{
DoAnimation();
-
- if (!PendingEvent()) /* delay only if no pending events */
- Delay(10);
}
BackToFront();
}
BackToFront();
+
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
return result;
}
return result;