X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=ee3bf6a51af02bb3a10806b04ef390516240c6df;hb=8da08295743b5a375f8cabe26cc1d48249c89b42;hp=0d4f45d868086ccbcfc26e8c2ba7a15d5695960c;hpb=1f5b7dda7fe53b3b0ec085a8e9c99d5ca82c8161;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 0d4f45d8..ee3bf6a5 100644 --- a/src/tools.c +++ b/src/tools.c @@ -23,8 +23,6 @@ #include "screens.h" -// select level set with EMC X11 graphics before activating EM GFX debugging -#define DEBUG_EM_GFX FALSE #define DEBUG_FRAME_TIME FALSE // tool button identifiers @@ -5746,11 +5744,11 @@ em_object_mapping_list[] = }, { - Xacid_splash_e, FALSE, FALSE, + Xsplash_e, FALSE, FALSE, EL_ACID_SPLASH_RIGHT, -1, -1 }, { - Xacid_splash_w, FALSE, FALSE, + Xsplash_w, FALSE, FALSE, EL_ACID_SPLASH_LEFT, -1, -1 }, @@ -7027,19 +7025,19 @@ em_object_mapping_list[] = }, { - Xslidewall_ns, TRUE, FALSE, + Xslide_ns, TRUE, FALSE, EL_EXPANDABLE_WALL_VERTICAL, -1, -1 }, { - Yslidewall_ns_blank, FALSE, FALSE, + Yslide_ns_blank, FALSE, FALSE, EL_EXPANDABLE_WALL_VERTICAL, ACTION_GROWING, -1 }, { - Xslidewall_ew, TRUE, FALSE, + Xslide_ew, TRUE, FALSE, EL_EXPANDABLE_WALL_HORIZONTAL, -1, -1 }, { - Yslidewall_ew_blank, FALSE, FALSE, + Yslide_ew_blank, FALSE, FALSE, EL_EXPANDABLE_WALL_HORIZONTAL, ACTION_GROWING, -1 }, @@ -7085,6 +7083,11 @@ em_object_mapping_list[] = EL_EM_EXIT_OPEN, -1, -1 }, + { + Xpause, FALSE, FALSE, + EL_EMPTY, -1, -1 + }, + { Xwall_1, TRUE, FALSE, EL_WALL, -1, -1 @@ -8216,21 +8219,6 @@ boolean getTeamMode_EM(void) return game.team_mode || network_playing; } -int getGameFrameDelay_EM(int native_em_game_frame_delay) -{ - int game_frame_delay_value; - - game_frame_delay_value = - (tape.playing && tape.fast_forward ? FfwdFrameDelay : - GameFrameDelay == GAME_FRAME_DELAY ? native_em_game_frame_delay : - GameFrameDelay); - - if (tape.playing && tape.warp_forward && !tape.pausing) - game_frame_delay_value = 0; - - return game_frame_delay_value; -} - unsigned int InitRND(int seed) { if (level.game_engine_type == GAME_ENGINE_TYPE_EM) @@ -8259,8 +8247,8 @@ static int get_effective_element_EM(int tile, int frame_em) { switch (tile) { - case Xacid_splash_e: - case Xacid_splash_w: + case Xsplash_e: + case Xsplash_w: return (frame_em > 5 ? EL_EMPTY : element); default: @@ -8271,8 +8259,8 @@ static int get_effective_element_EM(int tile, int frame_em) { switch (tile) { - case Xacid_splash_e: - case Xacid_splash_w: + case Xsplash_e: + case Xsplash_w: return EL_EMPTY; case Ynut_stone: @@ -8340,8 +8328,8 @@ static boolean check_linear_animation_EM(int tile) case Ytank_s_e: case Ytank_w_s: case Ytank_n_w: - case Xacid_splash_e: - case Xacid_splash_w: + case Xsplash_e: + case Xsplash_w: case Ynut_stone: return TRUE; } @@ -8588,19 +8576,6 @@ void InitGraphicInfo_EM(void) { int i, j, p; -#if DEBUG_EM_GFX - int num_em_gfx_errors = 0; - - if (graphic_info_em_object[0][0].bitmap == NULL) - { - // EM graphics not yet initialized in em_open_all() - - return; - } - - printf("::: [4 errors can be ignored (1 x 'bomb', 3 x 'em_dynamite']\n"); -#endif - // always start with reliable default values for (i = 0; i < TILE_MAX; i++) { @@ -8818,13 +8793,6 @@ void InitGraphicInfo_EM(void) special_animation && j == 4 ? 3 : effective_action != action ? 0 : j); - -#if DEBUG_EM_GFX - Bitmap *debug_bitmap = g_em->bitmap; - int debug_src_x = g_em->src_x; - int debug_src_y = g_em->src_y; -#endif - int frame = getAnimationFrame(g->anim_frames, g->anim_delay, g->anim_mode, @@ -8920,74 +8888,6 @@ void InitGraphicInfo_EM(void) bit 5 - 0 ( 6 bit): graphic height */ g_em->unique_identifier = (graphic << 16) | (frame << 12) | (g_em->width << 6) | g_em->height; - -#if DEBUG_EM_GFX - - // skip check for EMC elements not contained in original EMC artwork - if (element == EL_EMC_FAKE_ACID) - continue; - - if (g_em->bitmap != debug_bitmap || - g_em->src_x != debug_src_x || - g_em->src_y != debug_src_y || - g_em->src_offset_x != 0 || - g_em->src_offset_y != 0 || - g_em->dst_offset_x != 0 || - g_em->dst_offset_y != 0 || - g_em->width != TILEX || - g_em->height != TILEY) - { - static int last_i = -1; - - if (i != last_i) - { - printf("\n"); - last_i = i; - } - - printf("::: EMC GFX ERROR for element %d -> %d ('%s', '%s', %d)", - i, element, element_info[element].token_name, - element_action_info[effective_action].suffix, direction); - - if (element != effective_element) - printf(" [%d ('%s')]", - effective_element, - element_info[effective_element].token_name); - - printf("\n"); - - if (g_em->bitmap != debug_bitmap) - printf(" %d (%d): different bitmap! (0x%08x != 0x%08x)\n", - j, is_backside, (int)(g_em->bitmap), (int)(debug_bitmap)); - - if (g_em->src_x != debug_src_x || - g_em->src_y != debug_src_y) - printf(" frame %d (%c): %d,%d (%d,%d) should be %d,%d (%d,%d)\n", - j, (is_backside ? 'B' : 'F'), - g_em->src_x, g_em->src_y, - g_em->src_x / 32, g_em->src_y / 32, - debug_src_x, debug_src_y, - debug_src_x / 32, debug_src_y / 32); - - if (g_em->src_offset_x != 0 || - g_em->src_offset_y != 0 || - g_em->dst_offset_x != 0 || - g_em->dst_offset_y != 0) - printf(" %d (%d): offsets %d,%d and %d,%d should be all 0\n", - j, is_backside, - g_em->src_offset_x, g_em->src_offset_y, - g_em->dst_offset_x, g_em->dst_offset_y); - - if (g_em->width != TILEX || - g_em->height != TILEY) - printf(" %d (%d): size %d,%d should be %d,%d\n", - j, is_backside, - g_em->width, g_em->height, TILEX, TILEY); - - num_em_gfx_errors++; - } -#endif - } } @@ -9055,13 +8955,6 @@ void InitGraphicInfo_EM(void) Bitmap *src_bitmap; int src_x, src_y; int sync_frame = j; - -#if DEBUG_EM_GFX - Bitmap *debug_bitmap = g_em->bitmap; - int debug_src_x = g_em->src_x; - int debug_src_y = g_em->src_y; -#endif - int frame = getAnimationFrame(g->anim_frames, g->anim_delay, g->anim_mode, @@ -9079,64 +8972,9 @@ void InitGraphicInfo_EM(void) g_em->dst_offset_y = 0; g_em->width = TILEX; g_em->height = TILEY; - -#if DEBUG_EM_GFX - - // skip check for EMC elements not contained in original EMC artwork - if (element == EL_PLAYER_3 || - element == EL_PLAYER_4) - continue; - - if (g_em->bitmap != debug_bitmap || - g_em->src_x != debug_src_x || - g_em->src_y != debug_src_y) - { - static int last_i = -1; - - if (i != last_i) - { - printf("\n"); - last_i = i; - } - - printf("::: EMC GFX ERROR for p/a %d/%d -> %d ('%s', '%s', %d)", - p, i, element, element_info[element].token_name, - element_action_info[effective_action].suffix, direction); - - if (element != effective_element) - printf(" [%d ('%s')]", - effective_element, - element_info[effective_element].token_name); - - printf("\n"); - - if (g_em->bitmap != debug_bitmap) - printf(" %d: different bitmap! (0x%08x != 0x%08x)\n", - j, (int)(g_em->bitmap), (int)(debug_bitmap)); - - if (g_em->src_x != debug_src_x || - g_em->src_y != debug_src_y) - printf(" frame %d: %d,%d (%d,%d) should be %d,%d (%d,%d)\n", - j, - g_em->src_x, g_em->src_y, - g_em->src_x / 32, g_em->src_y / 32, - debug_src_x, debug_src_y, - debug_src_x / 32, debug_src_y / 32); - - num_em_gfx_errors++; - } -#endif - } } } - -#if DEBUG_EM_GFX - printf("\n"); - printf("::: [%d errors found]\n", num_em_gfx_errors); - - exit(0); -#endif } static void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame,