From: Holger Schemel Date: Fri, 26 Apr 2024 10:33:51 +0000 (+0200) Subject: renamed preprocessor constant X-Git-Tag: 4.4.0.0-test-1~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=929b071507a0fc9dfd5b667ca563137f65062dd7;p=rocksndiamonds.git renamed preprocessor constant --- diff --git a/src/files.c b/src/files.c index 587e71b9..7869cb4b 100644 --- a/src/files.c +++ b/src/files.c @@ -11652,10 +11652,10 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->bd_skip_hatching = FALSE; si->bd_scroll_delay = TRUE; si->bd_show_invisible_outbox = FALSE; - si->bd_smooth_movements = AUTO; + si->bd_smooth_movements = MODE_AUTO; si->bd_pushing_graphics = TRUE; si->bd_up_down_graphics = TRUE; - si->bd_skip_falling_sounds = AUTO; + si->bd_skip_falling_sounds = MODE_AUTO; si->bd_palette_c64 = GD_DEFAULT_PALETTE_C64; si->bd_palette_c64dtv = GD_DEFAULT_PALETTE_C64DTV; si->bd_palette_atari = GD_DEFAULT_PALETTE_ATARI; @@ -11883,7 +11883,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->debug.show_frames_per_second = FALSE; - si->debug.xsn_mode = AUTO; + si->debug.xsn_mode = MODE_AUTO; si->debug.xsn_percent = 0; si->options.verbose = FALSE; @@ -12451,7 +12451,7 @@ void SaveSetup_Default(void) fprintf(file, "\n"); for (i = 0; i < ARRAY_SIZE(debug_setup_tokens); i++) if (!strPrefix(debug_setup_tokens[i].text, "debug.xsn_") || - setup.debug.xsn_mode != AUTO) + setup.debug.xsn_mode != MODE_AUTO) fprintf(file, "%s\n", getSetupLine(debug_setup_tokens, "", i)); fprintf(file, "\n"); diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index 2d742bee..a35f3873 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -443,28 +443,28 @@ boolean use_native_bd_graphics_engine(void) boolean use_bd_smooth_movements(void) { return ((setup.bd_smooth_movements == TRUE) || - (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine())); + (setup.bd_smooth_movements == MODE_AUTO && !use_native_bd_graphics_engine())); } // check if player pushing graphics selected in setup menu boolean use_bd_pushing_graphics(void) { return ((setup.bd_pushing_graphics == TRUE) || - (setup.bd_pushing_graphics == AUTO && !use_native_bd_graphics_engine())); + (setup.bd_pushing_graphics == MODE_AUTO && !use_native_bd_graphics_engine())); } // check if player up/down graphics selected in setup menu boolean use_bd_up_down_graphics(void) { return ((setup.bd_up_down_graphics == TRUE) || - (setup.bd_up_down_graphics == AUTO && !use_native_bd_graphics_engine())); + (setup.bd_up_down_graphics == MODE_AUTO && !use_native_bd_graphics_engine())); } // check if skipping falling sounds selected in setup menu boolean skip_bd_falling_sounds(void) { return ((setup.bd_skip_falling_sounds == TRUE) || - (setup.bd_skip_falling_sounds == AUTO && !game.use_native_bd_sound_engine)); + (setup.bd_skip_falling_sounds == MODE_AUTO && !game.use_native_bd_sound_engine)); } Bitmap **GetTitleScreenBitmaps_BD(void) diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 3deac033..331d85d4 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -845,14 +845,14 @@ static void DrawTileCursor_Xsn(int draw_target) if (debug) setup.debug.xsn_percent = percent; - if (setup.debug.xsn_mode != AUTO) + if (setup.debug.xsn_mode != MODE_AUTO) percent = setup.debug.xsn_percent; setup.debug.xsn_percent = percent; active = (percent > 0); - if ((active && !active_last) || setup.debug.xsn_mode != AUTO) + if ((active && !active_last) || setup.debug.xsn_mode != MODE_AUTO) removeHideSetupEntry(&setup.debug.xsn_mode); else if (!active && active_last) setHideSetupEntry(&setup.debug.xsn_mode); diff --git a/src/init.c b/src/init.c index 975f1cbc..c2a19781 100644 --- a/src/init.c +++ b/src/init.c @@ -6270,9 +6270,9 @@ static void InitOverrideArtwork(void) gfx.override_level_music = FALSE; // now check if this level set has definitions for custom elements - if (setup.override_level_graphics == AUTO || - setup.override_level_sounds == AUTO || - setup.override_level_music == AUTO) + if (setup.override_level_graphics == MODE_AUTO || + setup.override_level_sounds == MODE_AUTO || + setup.override_level_music == MODE_AUTO) redefined_ce_found = (CheckArtworkTypeForRedefinedCustomElements(ARTWORK_TYPE_GRAPHICS) | CheckArtworkTypeForRedefinedCustomElements(ARTWORK_TYPE_SOUNDS) | @@ -6285,14 +6285,14 @@ static void InitOverrideArtwork(void) if (redefined_ce_found) { - // this level set has CE definitions: change "AUTO" to "FALSE" + // this level set has CE definitions: change "MODE_AUTO" to "FALSE" gfx.override_level_graphics = (setup.override_level_graphics == TRUE); gfx.override_level_sounds = (setup.override_level_sounds == TRUE); gfx.override_level_music = (setup.override_level_music == TRUE); } else { - // this level set has no CE definitions: change "AUTO" to "TRUE" + // this level set has no CE definitions: change "MODE_AUTO" to "TRUE" gfx.override_level_graphics = (setup.override_level_graphics != FALSE); gfx.override_level_sounds = (setup.override_level_sounds != FALSE); gfx.override_level_music = (setup.override_level_music != FALSE); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 6c9790b3..c953e1b0 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2966,7 +2966,7 @@ int get_switch3_from_string(char *s) get_integer_from_string(s) == 1) result = TRUE; else if (strEqual(s_lower, "auto")) - result = AUTO; + result = MODE_AUTO; free(s_lower); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index cdf1eea9..76eea135 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -4862,7 +4862,7 @@ char *getSetupValue(int type, void *value) break; case TYPE_SWITCH3: - strcpy(value_string, (*(int *)value == AUTO ? "auto" : + strcpy(value_string, (*(int *)value == MODE_AUTO ? "auto" : *(int *)value == FALSE ? "off" : "on")); break; @@ -4871,7 +4871,7 @@ char *getSetupValue(int type, void *value) break; case TYPE_YES_NO_AUTO: - strcpy(value_string, (*(int *)value == AUTO ? "auto" : + strcpy(value_string, (*(int *)value == MODE_AUTO ? "auto" : *(int *)value == FALSE ? "no" : "yes")); break; diff --git a/src/libgame/system.h b/src/libgame/system.h index 162ca489..9cfab170 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1524,10 +1524,10 @@ struct SetupInfo boolean bd_skip_hatching; boolean bd_scroll_delay; boolean bd_show_invisible_outbox; - int bd_smooth_movements; // not boolean -- can also be "AUTO" - int bd_pushing_graphics; // not boolean -- can also be "AUTO" - int bd_up_down_graphics; // not boolean -- can also be "AUTO" - int bd_skip_falling_sounds; // not boolean -- can also be "AUTO" + int bd_smooth_movements; // not boolean -- can also be "MODE_AUTO" + int bd_pushing_graphics; // not boolean -- can also be "MODE_AUTO" + int bd_up_down_graphics; // not boolean -- can also be "MODE_AUTO" + int bd_skip_falling_sounds; // not boolean -- can also be "MODE_AUTO" int bd_palette_c64; int bd_palette_c64dtv; int bd_palette_atari; @@ -1542,9 +1542,9 @@ struct SetupInfo char *graphics_set; char *sounds_set; char *music_set; - int override_level_graphics; // not boolean -- can also be "AUTO" - int override_level_sounds; // not boolean -- can also be "AUTO" - int override_level_music; // not boolean -- can also be "AUTO" + int override_level_graphics; // not boolean -- can also be "MODE_AUTO" + int override_level_sounds; // not boolean -- can also be "MODE_AUTO" + int override_level_music; // not boolean -- can also be "MODE_AUTO" int volume_simple; int volume_loops; diff --git a/src/libgame/types.h b/src/libgame/types.h index 15b25ce8..bbe46f55 100644 --- a/src/libgame/types.h +++ b/src/libgame/types.h @@ -32,13 +32,14 @@ typedef unsigned char byte; #undef FALSE #endif -#ifdef AUTO -#undef AUTO +#ifdef MODE_AUTO +#undef MODE_AUTO #endif #define TRUE 1 #define FALSE 0 -#define AUTO -1 + +#define MODE_AUTO -1 #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) diff --git a/src/screens.c b/src/screens.c index 14a2adf4..1c4e14a1 100644 --- a/src/screens.c +++ b/src/screens.c @@ -8379,7 +8379,7 @@ static int getSetupValueFont(int type, void *value) else if (type & TYPE_BOOLEAN_STYLE) return (*(boolean *)value ? FONT_OPTION_ON : FONT_OPTION_OFF); else if (type & TYPE_YES_NO_AUTO) - return (*(int *)value == AUTO ? FONT_OPTION_ON : + return (*(int *)value == MODE_AUTO ? FONT_OPTION_ON : *(int *)value == FALSE ? FONT_OPTION_OFF : FONT_OPTION_ON); else if (type & TYPE_PLAYER) return FONT_VALUE_1; @@ -8524,10 +8524,10 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx) { *(int *)si->value = (dx == -1 ? - (*(int *)si->value == AUTO ? TRUE : - *(int *)si->value == TRUE ? FALSE : AUTO) : - (*(int *)si->value == TRUE ? AUTO : - *(int *)si->value == AUTO ? FALSE : TRUE)); + (*(int *)si->value == MODE_AUTO ? TRUE : + *(int *)si->value == TRUE ? FALSE : MODE_AUTO) : + (*(int *)si->value == TRUE ? MODE_AUTO : + *(int *)si->value == MODE_AUTO ? FALSE : TRUE)); } else if (si->type & TYPE_KEY) {