extern void PlayLevelSound_EM(int, int, int, int);
extern void InitGraphicInfo_EM(void);
-void SetGfxAnimation_EM(int, int, int, int);
+void SetGfxAnimation_EM(struct GraphicInfo_EM *, int, int, int, int);
void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *, int, int, int, int);
void getGraphicSourcePlayerExt_EM(struct GraphicInfo_EM *, int, int, int);
if (!game.use_native_emc_graphics_engine)
for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++)
for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++)
- SetGfxAnimation_EM(Draw[y][x], 7 - frame, x - 2, y - 2);
+ SetGfxAnimation_EM(&graphic_info_em_object[Draw[y][x]][frame],
+ Draw[y][x], 7 - frame, x - 2, y - 2);
for (y = top; y < top + MAX_BUF_YSIZE; y++)
{
redraw_screen_tile = (screentiles[sy][sx] != obj ||
crumbled_state[sy][sx] != crm);
+#if 0
/* !!! TEST ONLY -- CHANGE THIS !!! */
if (!game.use_native_emc_graphics_engine)
redraw_screen_tile = TRUE;
+#endif
/* only redraw screen tiles if they (or their crumbled state) changed */
if (redraw_screen_tile)
GfxFrame[x][y] = 0;
}
-void SetGfxAnimation_EM(int tile, int frame_em, int x, int y)
+void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em,
+ int tile, int frame_em, int x, int y)
{
int action = object_mapping[tile].action;
+#if 1
+ int direction = object_mapping[tile].direction;
+ int effective_element = get_effective_element_EM(tile, frame_em);
+ int graphic = (direction == MV_NONE ?
+ el_act2img(effective_element, action) :
+ el_act_dir2img(effective_element, action, direction));
+ struct GraphicInfo *g = &graphic_info[graphic];
+ int sync_frame;
+#endif
boolean action_removing = (action == ACTION_DIGGING ||
action == ACTION_SNAPPING ||
action == ACTION_COLLECTING);
{
GfxFrame[x][y]++;
}
+
+#if 1
+ if (graphic_info[graphic].anim_global_sync)
+ sync_frame = FrameCounter;
+ else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY))
+ sync_frame = GfxFrame[x][y];
+ else
+ sync_frame = 0; /* playfield border (pseudo steel) */
+
+ SetRandomAnimationValue(x, y);
+
+ int frame = getAnimationFrame(g->anim_frames,
+ g->anim_delay,
+ g->anim_mode,
+ g->anim_start_frame,
+ sync_frame);
+
+ g_em->unique_identifier =
+ (graphic << 16) | ((frame % 8) << 12) | (g_em->width << 6) | g_em->height;
+#endif
}
void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *g_em,
int tile, int frame_em, int x, int y)
{
- int action = object_mapping[tile].action;
- int direction = object_mapping[tile].direction;
+ int action = object_mapping[tile].action;
+ int direction = object_mapping[tile].direction;
int effective_element = get_effective_element_EM(tile, frame_em);
int graphic = (direction == MV_NONE ?
el_act2img(effective_element, action) :