projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20040122-1-src
[rocksndiamonds.git]
/
src
/
init.c
diff --git
a/src/init.c
b/src/init.c
index 9871ed6cd8c3f0c5c0c4dc1ed5ad04a3edeb5837..7e4cdbc14775c133809dba4352dd9c1befff9733 100644
(file)
--- a/
src/init.c
+++ b/
src/init.c
@@
-413,6
+413,9
@@
void InitElementGraphicInfo()
int num_property_mappings = getImageListPropertyMappingSize();
int i, act, dir;
int num_property_mappings = getImageListPropertyMappingSize();
int i, act, dir;
+ if (graphic_info == NULL) /* still at startup phase */
+ return;
+
/* set values to -1 to identify later as "uninitialized" values */
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
/* set values to -1 to identify later as "uninitialized" values */
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
@@
-614,9
+617,9
@@
void InitElementGraphicInfo()
for (act = 0; act < NUM_ACTIONS; act++)
{
for (act = 0; act < NUM_ACTIONS; act++)
{
- boolean act_remove = (
act == ACTION_DIGGING
||
-
act == ACTION_SNAPPING
||
-
act == ACTION_COLLECTING
);
+ boolean act_remove = (
(IS_DIGGABLE(i) && act == ACTION_DIGGING)
||
+
(IS_SNAPPABLE(i) && act == ACTION_SNAPPING)
||
+
(IS_COLLECTIBLE(i) && act == ACTION_COLLECTING)
);
boolean act_turning = (act == ACTION_TURNING_FROM_LEFT ||
act == ACTION_TURNING_FROM_RIGHT ||
act == ACTION_TURNING_FROM_UP ||
boolean act_turning = (act == ACTION_TURNING_FROM_LEFT ||
act == ACTION_TURNING_FROM_RIGHT ||
act == ACTION_TURNING_FROM_UP ||
@@
-641,6
+644,15
@@
void InitElementGraphicInfo()
if (IS_SB_ELEMENT(i) && element_info[EL_SB_DEFAULT].crumbled[act] != -1)
default_action_crumbled = element_info[EL_SB_DEFAULT].crumbled[act];
if (IS_SB_ELEMENT(i) && element_info[EL_SB_DEFAULT].crumbled[act] != -1)
default_action_crumbled = element_info[EL_SB_DEFAULT].crumbled[act];
+#if 1
+ /* !!! make this better !!! */
+ if (i == EL_EMPTY_SPACE)
+ {
+ default_action_graphic = element_info[EL_DEFAULT].graphic[act];
+ default_action_crumbled = element_info[EL_DEFAULT].crumbled[act];
+ }
+#endif
+
if (default_action_graphic == -1)
default_action_graphic = default_graphic;
if (default_action_crumbled == -1)
if (default_action_graphic == -1)
default_action_graphic = default_graphic;
if (default_action_crumbled == -1)
@@
-1831,7
+1843,6
@@
void InitElementPropertiesStatic()
EL_SP_ELECTRON,
EL_BALLOON,
EL_SPRING,
EL_SP_ELECTRON,
EL_BALLOON,
EL_SPRING,
- EL_MAZE_RUNNER,
-1
};
-1
};
@@
-2068,6
+2079,11
@@
void InitElementPropertiesStatic()
-1
};
-1
};
+ static int ep_can_explode_dyna[] =
+ {
+ -1
+ };
+
static int ep_player[] =
{
EL_PLAYER_1,
static int ep_player[] =
{
EL_PLAYER_1,
@@
-2839,6
+2855,7
@@
void InitElementPropertiesStatic()
{ ep_droppable, EP_DROPPABLE },
{ ep_can_explode_1x1, EP_CAN_EXPLODE_1X1 },
{ ep_pushable, EP_PUSHABLE },
{ ep_droppable, EP_DROPPABLE },
{ ep_can_explode_1x1, EP_CAN_EXPLODE_1X1 },
{ ep_pushable, EP_PUSHABLE },
+ { ep_can_explode_dyna, EP_CAN_EXPLODE_DYNA },
{ ep_player, EP_PLAYER },
{ ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL },
{ ep_player, EP_PLAYER },
{ ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL },
@@
-3100,7
+3117,16
@@
void InitElementPropertiesEngine(int engine_version)
/* ---------- CAN_EXPLODE_3X3 ------------------------------------------ */
SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (CAN_EXPLODE(i) &&
/* ---------- CAN_EXPLODE_3X3 ------------------------------------------ */
SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (CAN_EXPLODE(i) &&
- !CAN_EXPLODE_1X1(i)));
+ !CAN_EXPLODE_1X1(i) &&
+ !CAN_EXPLODE_DYNA(i)));
+#if 0
+ if (i == EL_CUSTOM_START + 253)
+ printf("::: %d, %d, %d -> %d\n",
+ CAN_EXPLODE_1X1(i),
+ CAN_EXPLODE_3X3(i),
+ CAN_EXPLODE_DYNA(i),
+ CAN_EXPLODE(i));
+#endif
/* ---------- CAN_CHANGE ----------------------------------------------- */
SET_PROPERTY(i, EP_CAN_CHANGE, FALSE); /* default: cannot change */
/* ---------- CAN_CHANGE ----------------------------------------------- */
SET_PROPERTY(i, EP_CAN_CHANGE, FALSE); /* default: cannot change */
@@
-3180,6
+3206,9
@@
void InitElementPropertiesEngine(int engine_version)
element_info[element].push_delay_random = game.default_push_delay_random;
}
#endif
element_info[element].push_delay_random = game.default_push_delay_random;
}
#endif
+
+ /* this is needed because some graphics depend on element properties */
+ InitElementGraphicInfo();
}
static void InitGlobal()
}
static void InitGlobal()
@@
-3795,14
+3824,17
@@
static char *getNewArtworkIdentifier(int type)
return artwork_new_identifier;
}
return artwork_new_identifier;
}
-void ReloadCustomArtwork()
+void ReloadCustomArtwork(
int force_reload
)
{
char *gfx_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS);
char *snd_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS);
char *mus_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_MUSIC);
{
char *gfx_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS);
char *snd_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS);
char *mus_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_MUSIC);
+ boolean force_reload_gfx = (force_reload & (1 << ARTWORK_TYPE_GRAPHICS));
+ boolean force_reload_snd = (force_reload & (1 << ARTWORK_TYPE_SOUNDS));
+ boolean force_reload_mus = (force_reload & (1 << ARTWORK_TYPE_MUSIC));
boolean redraw_screen = FALSE;
boolean redraw_screen = FALSE;
- if (gfx_new_identifier != NULL)
+ if (gfx_new_identifier != NULL
|| force_reload_gfx
)
{
#if 0
printf("RELOADING GRAPHICS '%s' -> '%s' ['%s', '%s']\n",
{
#if 0
printf("RELOADING GRAPHICS '%s' -> '%s' ['%s', '%s']\n",
@@
-3827,7
+3859,7
@@
void ReloadCustomArtwork()
redraw_screen = TRUE;
}
redraw_screen = TRUE;
}
- if (snd_new_identifier != NULL)
+ if (snd_new_identifier != NULL
|| force_reload_snd
)
{
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
{
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
@@
-3836,7
+3868,7
@@
void ReloadCustomArtwork()
redraw_screen = TRUE;
}
redraw_screen = TRUE;
}
- if (mus_new_identifier != NULL)
+ if (mus_new_identifier != NULL
|| force_reload_mus
)
{
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
{
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);