projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added "multiple_actions" option for clickable global animations
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 903818a414b6b5ea5ca0a23ec70640b7d57a1b22..24fecfb31d478829d2f89bf2e59fa93a93a8e812 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1574,6
+1574,10
@@
void getSizedGraphicSourceExt(int graphic, int frame, int tilesize,
{
struct GraphicInfo *g = &graphic_info[graphic];
{
struct GraphicInfo *g = &graphic_info[graphic];
+ // if no graphics defined at all, use fallback graphics
+ if (g->bitmaps == NULL)
+ *g = graphic_info[IMG_CHAR_EXCLAM];
+
// if no in-game graphics defined, always use standard graphic size
if (g->bitmaps[IMG_BITMAP_GAME] == NULL)
tilesize = TILESIZE;
// if no in-game graphics defined, always use standard graphic size
if (g->bitmaps[IMG_BITMAP_GAME] == NULL)
tilesize = TILESIZE;
@@
-4182,8
+4186,8
@@
static int RequestHandleEvents(unsigned int req_state)
case KSYM_Return:
case KSYM_y:
case KSYM_Return:
case KSYM_y:
- case KSYM_Y:
#if defined(TARGET_SDL2)
#if defined(TARGET_SDL2)
+ case KSYM_Y:
case KSYM_Select:
case KSYM_Menu:
#if defined(KSYM_Rewind)
case KSYM_Select:
case KSYM_Menu:
#if defined(KSYM_Rewind)
@@
-4195,8
+4199,8
@@
static int RequestHandleEvents(unsigned int req_state)
case KSYM_Escape:
case KSYM_n:
case KSYM_Escape:
case KSYM_n:
- case KSYM_N:
#if defined(TARGET_SDL2)
#if defined(TARGET_SDL2)
+ case KSYM_N:
case KSYM_Back:
#if defined(KSYM_FastForward)
case KSYM_FastForward: /* for Amazon Fire TV remote */
case KSYM_Back:
#if defined(KSYM_FastForward)
case KSYM_FastForward: /* for Amazon Fire TV remote */
@@
-5150,11
+5154,14
@@
unsigned int MoveDoor(unsigned int door_state)
{
/* wait for specified door action post delay */
if (door_state & DOOR_ACTION_1 && door_state & DOOR_ACTION_2)
{
/* wait for specified door action post delay */
if (door_state & DOOR_ACTION_1 && door_state & DOOR_ACTION_2)
-
Delay(MAX(door_1.post_delay, door_2.post_delay)
);
+
door_delay_value = MAX(door_1.post_delay, door_2.post_delay
);
else if (door_state & DOOR_ACTION_1)
else if (door_state & DOOR_ACTION_1)
-
Delay(door_1.post_delay)
;
+
door_delay_value = door_1.post_delay
;
else if (door_state & DOOR_ACTION_2)
else if (door_state & DOOR_ACTION_2)
- Delay(door_2.post_delay);
+ door_delay_value = door_2.post_delay;
+
+ while (!DelayReached(&door_delay, door_delay_value))
+ BackToFront();
}
}
}
}
@@
-5297,7
+5304,8
@@
void CreateToolButtons()
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
{
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
{
- struct GraphicInfo *gfx = &graphic_info[toolbutton_info[i].graphic];
+ int graphic = toolbutton_info[i].graphic;
+ struct GraphicInfo *gfx = &graphic_info[graphic];
struct TextPosInfo *pos = toolbutton_info[i].pos;
struct GadgetInfo *gi;
Bitmap *deco_bitmap = None;
struct TextPosInfo *pos = toolbutton_info[i].pos;
struct GadgetInfo *gi;
Bitmap *deco_bitmap = None;
@@
-5363,6
+5371,7
@@
void CreateToolButtons()
}
gi = CreateGadget(GDI_CUSTOM_ID, id,
}
gi = CreateGadget(GDI_CUSTOM_ID, id,
+ GDI_IMAGE_ID, graphic,
GDI_INFO_TEXT, toolbutton_info[i].infotext,
GDI_X, dx + x,
GDI_Y, dy + y,
GDI_INFO_TEXT, toolbutton_info[i].infotext,
GDI_X, dx + x,
GDI_Y, dy + y,