/* !!! TEMPORARILY STORED HERE -- PROBABLY TO BE CHANGED !!! */
/* (for testing, change filename back to "emc_object dot pcx") */
- { "emc_object", "RocksEMC.pcx" },
+ { "emc_object", "emc_object.pcx" },
#if 0
{ "emc_object.scale_up_factor", "2" },
#endif
/* (for testing, change filename back to "emc_sprite dot pcx") */
- { "emc_sprite", "RocksEMC.pcx" },
+ { "emc_sprite", "emc_sprite.pcx" },
#if 0
{ "emc_sprite.scale_up_factor", "2" },
#endif
-#define COMPILE_DATE_STRING "[2006-01-20 03:45]"
+#define COMPILE_DATE_STRING "[2006-01-21 16:50]"
i_to_a(element_action_info[i].value));
/* do not store direction index (bit) here, but direction value! */
- for (i = 0; i < NUM_DIRECTIONS; i++)
+ for (i = 0; i < NUM_DIRECTIONS_FULL; i++)
setHashEntry(direction_hash, element_direction_info[i].suffix,
i_to_a(1 << element_direction_info[i].value));
int start_pos = check_pos[MovDir[x][y] & 0x0f];
int i;
- MovDelay[x][y] = level.android_move_time;
+ MovDelay[x][y] = level.android_move_time * 8 + 1;
if (start_pos < 0) /* (should never happen) */
return;
GfxFrame[x][y] = 0;
if (MovDelay[x][y])
- GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_BIT(direction);
+ GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_TO_BIT(direction);
}
static boolean JustBeingPushed(int x, int y)
static void setFieldForSnapping(int x, int y, int element, int direction)
{
struct ElementInfo *ei = &element_info[element];
- int direction_bit = MV_DIR_BIT(direction);
+ int direction_bit = MV_DIR_TO_BIT(direction);
int graphic_snapping = ei->direction_graphic[ACTION_SNAPPING][direction_bit];
int action = (graphic_snapping != IMG_EMPTY_SPACE ? ACTION_SNAPPING :
IS_DIGGABLE(element) ? ACTION_DIGGING : ACTION_COLLECTING);
element_info[i].graphic[act] = -1;
element_info[i].crumbled[act] = -1;
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
element_info[i].direction_graphic[act][dir] = -1;
element_info[i].direction_crumbled[act][dir] = -1;
if (crumbled)
{
if (direction < 0)
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
element_info[element].direction_crumbled[action][dir] = -1;
if (direction > -1)
else
{
if (direction < 0)
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
element_info[element].direction_graphic[action][dir] = -1;
if (direction > -1)
element_info[i].crumbled[act] =
element_info[crumbled_like].crumbled[act];
for (act = 0; act < NUM_ACTIONS; act++)
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
element_info[i].direction_crumbled[act][dir] =
element_info[crumbled_like].direction_crumbled[act][dir];
}
{
element_info[i].graphic[ACTION_DIGGING] =
element_info[diggable_like].graphic[ACTION_DIGGING];
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
element_info[i].direction_graphic[ACTION_DIGGING][dir] =
element_info[diggable_like].direction_graphic[ACTION_DIGGING][dir];
}
if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
element_info[i].crumbled[act] = -1;
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
graphic = element_info[i].direction_graphic[act][dir];
if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
{
for (act = 0; act < NUM_ACTIONS; act++)
{
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
int graphic = element_info[i].direction_graphic[act][dir];
int move_dir = (act == ACTION_FALLING ? MV_BIT_DOWN : dir);
{
int default_graphic = element_info[i].graphic[ACTION_DEFAULT];
int default_crumbled = element_info[i].crumbled[ACTION_DEFAULT];
- int default_direction_graphic[NUM_DIRECTIONS];
- int default_direction_crumbled[NUM_DIRECTIONS];
+ int default_direction_graphic[NUM_DIRECTIONS_FULL];
+ int default_direction_crumbled[NUM_DIRECTIONS_FULL];
if (default_graphic == -1)
default_graphic = IMG_UNKNOWN;
default_crumbled = IMG_EMPTY;
#endif
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
default_direction_graphic[dir] =
element_info[i].direction_graphic[ACTION_DEFAULT][dir];
default_action_crumbled = default_crumbled;
#endif
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
/* use action graphic as the default direction graphic, if undefined */
int default_action_direction_graphic = element_info[i].graphic[act];
if (graphic_info[crumbled].anim_frames == 1)
graphic_info[crumbled].anim_mode = ANIM_NONE;
- for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
{
graphic = element_info[i].direction_graphic[act][dir];
crumbled = element_info[i].direction_crumbled[act][dir];
static char *sound_id_prefix[2 * MAX_NUM_ELEMENTS + 1];
static char *music_id_prefix[NUM_MUSIC_PREFIXES + 1];
static char *action_id_suffix[NUM_ACTIONS + 1];
- static char *direction_id_suffix[NUM_DIRECTIONS + 1];
+ static char *direction_id_suffix[NUM_DIRECTIONS_FULL + 1];
static char *special_id_suffix[NUM_SPECIAL_GFX_ARGS + 1];
static char *level_id_suffix[MAX_LEVELS + 1];
static char *dummy[1] = { NULL };
action_id_suffix[i] = element_action_info[i].suffix;
action_id_suffix[NUM_ACTIONS] = NULL;
- for (i = 0; i < NUM_DIRECTIONS; i++)
+ for (i = 0; i < NUM_DIRECTIONS_FULL; i++)
direction_id_suffix[i] = element_direction_info[i].suffix;
- direction_id_suffix[NUM_DIRECTIONS] = NULL;
+ direction_id_suffix[NUM_DIRECTIONS_FULL] = NULL;
for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
special_id_suffix[i] = special_suffix_info[i].suffix;
#define NUM_DIRECTIONS 4
+/* diagonal movement directions are used in a different contect than buttons */
+#define MV_BIT_UPLEFT 4
+#define MV_BIT_UPRIGHT 5
+#define MV_BIT_DOWNLEFT 6
+#define MV_BIT_DOWNRIGHT 7
+
+#define NUM_DIRECTIONS_FULL 8
+
/* values for special "button" bitmasks */
#define BUTTON_1 4
#define BUTTON_2 5
#define MV_UP (1 << MV_BIT_UP)
#define MV_DOWN (1 << MV_BIT_DOWN)
+#define MV_UPLEFT (MV_UP | MV_LEFT)
+#define MV_UPRIGHT (MV_UP | MV_RIGHT)
+#define MV_DOWNLEFT (MV_DOWN | MV_LEFT)
+#define MV_DOWNRIGHT (MV_DOWN | MV_RIGHT)
+
#define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
#define MV_VERTICAL (MV_UP | MV_DOWN)
#define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
#define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2)
#define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
-#define MV_DIR_BIT(x) ((x) == MV_LEFT ? MV_BIT_LEFT : \
- (x) == MV_RIGHT ? MV_BIT_RIGHT : \
- (x) == MV_UP ? MV_BIT_UP : MV_BIT_DOWN)
-
-#define MV_DIR_OPPOSITE(x) ((x) == MV_LEFT ? MV_RIGHT : \
- (x) == MV_RIGHT ? MV_LEFT : \
- (x) == MV_UP ? MV_DOWN : \
- (x) == MV_DOWN ? MV_UP : MV_NONE)
-
+#define MV_DIR_FROM_BIT(x) ((x) < NUM_DIRECTIONS ? 1 << (x) : \
+ (x) == MV_BIT_UPLEFT ? MV_UPLEFT : \
+ (x) == MV_BIT_UPRIGHT ? MV_UPRIGHT : \
+ (x) == MV_BIT_DOWNLEFT ? MV_DOWNLEFT : \
+ (x) == MV_BIT_DOWNRIGHT ? MV_DOWNRIGHT : \
+ MV_NONE)
+
+#define MV_DIR_TO_BIT(x) ((x) == MV_LEFT ? MV_BIT_LEFT : \
+ (x) == MV_RIGHT ? MV_BIT_RIGHT : \
+ (x) == MV_UP ? MV_BIT_UP : \
+ (x) == MV_DOWN ? MV_BIT_DOWN : \
+ (x) == MV_UPLEFT ? MV_BIT_UPLEFT : \
+ (x) == MV_UPRIGHT ? MV_BIT_UPRIGHT : \
+ (x) == MV_DOWNLEFT ? MV_BIT_DOWNLEFT : \
+ (x) == MV_DOWNRIGHT ? MV_BIT_DOWNRIGHT : \
+ MV_BIT_DOWN)
+
+#define MV_DIR_OPPOSITE(x) ((x) == MV_LEFT ? MV_RIGHT : \
+ (x) == MV_RIGHT ? MV_LEFT : \
+ (x) == MV_UP ? MV_DOWN : \
+ (x) == MV_DOWN ? MV_UP : \
+ (x) == MV_UPLEFT ? MV_DOWNRIGHT : \
+ (x) == MV_UPRIGHT ? MV_DOWNLEFT : \
+ (x) == MV_DOWNLEFT ? MV_UPRIGHT : \
+ (x) == MV_DOWNRIGHT ? MV_UPLEFT : \
+ MV_NONE)
/* values for animation mode (frame order and direction) */
#define ANIM_NONE 0
{ NULL, 0, 0 }
};
-struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
+struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
{
{ ".left", MV_BIT_LEFT },
{ ".right", MV_BIT_RIGHT },
{ ".up", MV_BIT_UP },
{ ".down", MV_BIT_DOWN },
+ { ".upleft", MV_BIT_UP },
+ { ".upright", MV_BIT_RIGHT },
+ { ".downleft", MV_BIT_LEFT },
+ { ".downright", MV_BIT_DOWN },
{ NULL, 0 }
};
/* ---------- graphic and sound definitions ---------- */
int graphic[NUM_ACTIONS]; /* default graphics for several actions */
- int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
+ int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
/* special graphics for left/right/up/down */
int crumbled[NUM_ACTIONS]; /* crumbled graphics for several actions */
- int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS];
+ int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
/* crumbled graphics for left/right/up/down */
int special_graphic[NUM_SPECIAL_GFX_ARGS];
strcat(token, element_action_info[action].suffix);
if (direction != -1)
- strcat(token, element_direction_info[MV_DIR_BIT(direction)].suffix);
+ strcat(token, element_direction_info[MV_DIR_TO_BIT(direction)].suffix);
return getHashEntry(helptext_info, token);
}
},
{
Yandroid_ne, FALSE, FALSE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_UP, MV_BIT_RIGHT
+ EL_EMC_ANDROID, ACTION_GROWING, MV_BIT_UPRIGHT
},
{
Yandroid_neB, FALSE, TRUE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_UP, MV_BIT_RIGHT
+ EL_EMC_ANDROID, ACTION_SHRINKING, MV_BIT_UPRIGHT
},
{
Yandroid_e, FALSE, FALSE,
},
{
Yandroid_se, FALSE, FALSE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_DOWN, MV_BIT_RIGHT
+ EL_EMC_ANDROID, ACTION_GROWING, MV_BIT_DOWNRIGHT
},
{
Yandroid_seB, FALSE, TRUE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_DOWN, MV_BIT_RIGHT
+ EL_EMC_ANDROID, ACTION_SHRINKING, MV_BIT_DOWNRIGHT
},
{
Yandroid_s, FALSE, FALSE,
},
{
Yandroid_sw, FALSE, FALSE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_DOWN, MV_BIT_LEFT
+ EL_EMC_ANDROID, ACTION_GROWING, MV_BIT_DOWNLEFT
},
{
Yandroid_swB, FALSE, TRUE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_DOWN, MV_BIT_LEFT
+ EL_EMC_ANDROID, ACTION_SHRINKING, MV_BIT_DOWNLEFT
},
{
Yandroid_w, FALSE, FALSE,
},
{
Yandroid_nw, FALSE, FALSE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_UP, MV_BIT_LEFT
+ EL_EMC_ANDROID, ACTION_GROWING, MV_BIT_UPLEFT
},
{
Yandroid_nwB, FALSE, TRUE,
- EL_EMC_ANDROID, ACTION_TURNING_FROM_UP, MV_BIT_LEFT
+ EL_EMC_ANDROID, ACTION_SHRINKING, MV_BIT_UPLEFT
},
{
Xspring, TRUE, FALSE,
if (direction == MV_NONE)
return element_info[element].graphic[action];
- direction = MV_DIR_BIT(direction);
+ direction = MV_DIR_TO_BIT(direction);
return element_info[element].direction_graphic[action][direction];
}
int el_act_dir2img(int element, int action, int direction)
{
element = GFX_ELEMENT(element);
- direction = MV_DIR_BIT(direction); /* default: MV_NONE => MV_DOWN */
+ direction = MV_DIR_TO_BIT(direction); /* default: MV_NONE => MV_DOWN */
/* direction_graphic[][] == graphic[] for undefined direction graphics */
return element_info[element].direction_graphic[action][direction];
if (direction == MV_NONE)
return element_info[element].crumbled[action];
- direction = MV_DIR_BIT(direction);
+ direction = MV_DIR_TO_BIT(direction);
return element_info[element].direction_crumbled[action][direction];
}
static int el_act_dir2crm(int element, int action, int direction)
{
element = GFX_ELEMENT(element);
- direction = MV_DIR_BIT(direction); /* default: MV_NONE => MV_DOWN */
+ direction = MV_DIR_TO_BIT(direction); /* default: MV_NONE => MV_DOWN */
/* direction_graphic[][] == graphic[] for undefined direction graphics */
return element_info[element].direction_crumbled[action][direction];
object_mapping[e].action = em_object_mapping_list[i].action;
if (em_object_mapping_list[i].direction != -1)
- object_mapping[e].direction = (1 << em_object_mapping_list[i].direction);
+ object_mapping[e].direction =
+ MV_DIR_FROM_BIT(em_object_mapping_list[i].direction);
}
for (i = 0; em_player_mapping_list[i].action_em != -1; i++)
if (em_player_mapping_list[i].direction != -1)
player_mapping[p][a].direction =
- (1 << em_player_mapping_list[i].direction);
+ MV_DIR_FROM_BIT(em_player_mapping_list[i].direction);
}
for (i = 0; i < TILE_MAX; i++)
(i << 16) | (j << 12) | (g_em->width << 6) | g_em->height;
#if DEBUG_EM_GFX
+
+#if 1
+ /* skip check for EMC elements not contained in original EMC artwork */
+ if (element == EL_EMC_FAKE_ACID)
+ continue;
+#endif
+
if (g_em->bitmap != debug_bitmap ||
g_em->src_x != debug_src_x ||
g_em->src_y != debug_src_y ||