/* values for sounds configuration */
-#define SND_BD_DIAMOND_COLLECTING 0
-#define SND_BD_DIAMOND_IMPACT 1
-#define SND_BD_ROCK_PUSHING 2
-#define SND_BD_ROCK_IMPACT 3
-#define SND_BD_MAGIC_WALL_ACTIVATING 4
-#define SND_BD_MAGIC_WALL_ACTIVE 5
-#define SND_BD_MAGIC_WALL_FILLING 6
-#define SND_BD_AMOEBA_WAITING 7
-#define SND_BD_AMOEBA_GROWING 8
-#define SND_BD_AMOEBA_TURNING_TO_GEM 9
-#define SND_BD_AMOEBA_TURNING_TO_ROCK 10
-#define SND_BD_BUTTERFLY_MOVING 11
-#define SND_BD_BUTTERFLY_WAITING 12
-#define SND_BD_FIREFLY_MOVING 13
-#define SND_BD_FIREFLY_WAITING 14
-#define SND_SP_BASE_DIGGING 15
-#define SND_SP_BUGGY_BASE_DIGGING 16
-#define SND_SP_BUGGY_BASE_ACTIVE 17
-#define SND_SP_INFOTRON_COLLECTING 18
-#define SND_SP_INFOTRON_IMPACT 19
-#define SND_SP_ZONK_PUSHING 20
-#define SND_SP_ZONK_IMPACT 21
-#define SND_SP_DISK_RED_COLLECTING 22
-#define SND_SP_DISK_ORANGE_PUSHING 23
-#define SND_SP_DISK_YELLOW_PUSHING 24
-#define SND_CLASS_SP_PORT_PASSING 25
-#define SND_CLASS_SP_EXIT_PASSING 26
-#define SND_CLASS_SP_EXIT_OPENING 27
-#define SND_SP_SNIKSNAK_MOVING 28
-#define SND_SP_SNIKSNAK_WAITING 29
-#define SND_SP_ELECTRON_MOVING 30
-#define SND_SP_ELECTRON_WAITING 31
-#define SND_SP_TERMINAL_ACTIVATING 32
-#define SND_SP_TERMINAL_ACTIVE 33
-#define SND_CLASS_SOKOBAN_PUSHING 34
-#define SND_CLASS_SOKOBAN_FILLING 35
-#define SND_CLASS_SOKOBAN_EMPTYING 36
-#define SND_EMPTY_SPACE_DIGGING 37
-#define SND_SAND_DIGGING 38
-#define SND_EMERALD_COLLECTING 39
-#define SND_EMERALD_IMPACT 40
-#define SND_DIAMOND_COLLECTING 41
-#define SND_DIAMOND_IMPACT 42
-#define SND_DIAMOND_BREAKING 43
-#define SND_ROCK_PUSHING 44
-#define SND_ROCK_IMPACT 45
-#define SND_BOMB_PUSHING 46
-#define SND_NUT_PUSHING 47
-#define SND_NUT_BREAKING 48
-#define SND_NUT_IMPACT 49
-#define SND_CLASS_DYNAMITE_COLLECTING 50
-#define SND_CLASS_DYNAMITE_DROPPING 51
-#define SND_CLASS_DYNAMITE_ACTIVE 52
-#define SND_CLASS_KEY_COLLECTING 53
-#define SND_CLASS_GATE_PASSING 54
-#define SND_BUG_MOVING 55
-#define SND_BUG_WAITING 56
-#define SND_SPACESHIP_MOVING 57
-#define SND_SPACESHIP_WAITING 58
-#define SND_YAMYAM_MOVING 59
-#define SND_YAMYAM_WAITING 60
-#define SND_YAMYAM_DIGGING 61
-#define SND_ROBOT_MOVING 62
-#define SND_ROBOT_WAITING 63
-#define SND_ROBOT_WHEEL_ACTIVATING 64
-#define SND_ROBOT_WHEEL_ACTIVE 65
-#define SND_MAGIC_WALL_ACTIVATING 66
-#define SND_MAGIC_WALL_ACTIVE 67
-#define SND_MAGIC_WALL_FILLING 68
-#define SND_CLASS_AMOEBA_WAITING 69
-#define SND_CLASS_AMOEBA_GROWING 70
-#define SND_CLASS_AMOEBA_DROPPING 71
-#define SND_ACID_SPLASHING 72
-#define SND_CLASS_QUICKSAND_FILLING 73
-#define SND_CLASS_QUICKSAND_EMPTYING 74
-#define SND_CLASS_EXIT_OPENING 75
-#define SND_CLASS_EXIT_PASSING 76
-#define SND_PENGUIN_PASSING 77
-#define SND_BALLOON_MOVING 78
-#define SND_BALLOON_WAITING 79
-#define SND_BALLOON_PUSHING 80
-#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 81
-#define SND_SPRING_MOVING 82
-#define SND_SPRING_PUSHING 83
-#define SND_SPRING_IMPACT 84
-#define SND_CLASS_WALL_GROWING 85
-#define SND_PEARL_COLLECTING 86
-#define SND_PEARL_BREAKING 87
-#define SND_PEARL_IMPACT 88
-#define SND_CRYSTAL_COLLECTING 89
-#define SND_CRYSTAL_IMPACT 90
-#define SND_ENVELOPE_COLLECTING 91
-#define SND_INVISIBLE_SAND_DIGGING 92
-#define SND_SHIELD_NORMAL_COLLECTING 93
-#define SND_SHIELD_NORMAL_ACTIVE 94
-#define SND_SHIELD_DEADLY_COLLECTING 95
-#define SND_SHIELD_DEADLY_ACTIVE 96
-#define SND_EXTRA_TIME_COLLECTING 97
-#define SND_MOLE_MOVING 98
-#define SND_MOLE_WAITING 99
-#define SND_MOLE_DIGGING 100
-#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 101
-#define SND_CLASS_SWITCHGATE_OPENING 102
-#define SND_CLASS_SWITCHGATE_CLOSING 103
-#define SND_CLASS_SWITCHGATE_PASSING 104
-#define SND_TIMEGATE_SWITCH_ACTIVATING 105
-#define SND_TIMEGATE_SWITCH_ACTIVE 106
-#define SND_TIMEGATE_SWITCH_DEACTIVATING 107
-#define SND_TIMEGATE_OPENING 108
-#define SND_CLASS_TIMEGATE_CLOSING 109
-#define SND_CLASS_TIMEGATE_PASSING 110
-#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 111
-#define SND_CLASS_CONVEYOR_BELT_ACTIVE 112
-#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 113
-#define SND_LIGHT_SWITCH_ACTIVATING 114
-#define SND_LIGHT_SWITCH_DEACTIVATING 115
-#define SND_DX_SUPABOMB_PUSHING 116
-#define SND_TRAP_DIGGING 117
-#define SND_TRAP_ACTIVATING 118
-#define SND_CLASS_TUBE_PASSING 119
-#define SND_AMOEBA_TURNING_TO_GEM 120
-#define SND_AMOEBA_TURNING_TO_ROCK 121
-#define SND_SPEED_PILL_COLLECTING 122
-#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 123
-#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 124
-#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 125
-#define SND_CLASS_DYNABOMB_DROPPING 126
-#define SND_CLASS_DYNABOMB_ACTIVE 127
-#define SND_SATELLITE_MOVING 128
-#define SND_SATELLITE_WAITING 129
-#define SND_SATELLITE_PUSHING 130
-#define SND_LAMP_ACTIVATING 131
-#define SND_LAMP_DEACTIVATING 132
-#define SND_TIME_ORB_FULL_COLLECTING 133
-#define SND_TIME_ORB_FULL_IMPACT 134
-#define SND_TIME_ORB_EMPTY_PUSHING 135
-#define SND_TIME_ORB_EMPTY_IMPACT 136
-#define SND_GAME_OF_LIFE_WAITING 137
-#define SND_GAME_OF_LIFE_GROWING 138
-#define SND_BIOMAZE_WAITING 139
-#define SND_BIOMAZE_GROWING 140
-#define SND_PACMAN_MOVING 141
-#define SND_PACMAN_WAITING 142
-#define SND_PACMAN_DIGGING 143
-#define SND_DARK_YAMYAM_MOVING 144
-#define SND_DARK_YAMYAM_WAITING 145
-#define SND_DARK_YAMYAM_DIGGING 146
-#define SND_PENGUIN_MOVING 147
-#define SND_PENGUIN_WAITING 148
-#define SND_PIG_MOVING 149
-#define SND_PIG_WAITING 150
-#define SND_PIG_DIGGING 151
-#define SND_DRAGON_MOVING 152
-#define SND_DRAGON_WAITING 153
-#define SND_DRAGON_ATTACKING 154
-#define SND_CLASS_PLAYER_DYING 155
-#define SND_ELEMENT_EXPLODING 156
-#define SND_SP_ELEMENT_EXPLODING 157
-#define SND_GAME_STARTING 158
-#define SND_GAME_RUNNING_OUT_OF_TIME 159
-#define SND_GAME_LEVELTIME_BONUS 160
-#define SND_GAME_LOSING 161
-#define SND_GAME_WINNING 162
-#define SND_GAME_SOKOBAN_SOLVING 163
-#define SND_DOOR_OPENING 164
-#define SND_DOOR_CLOSING 165
-#define SND_BACKGROUND_SCORES 166
-#define SND_BACKGROUND_INFO 167
+#define SND_CLASS_DEFAULT_DIGGING 0
+#define SND_CLASS_DEFAULT_COLLECTING 1
+#define SND_CLASS_DEFAULT_SNAPPING 2
+#define SND_CLASS_DEFAULT_PUSHING 3
+#define SND_CLASS_DEFAULT_IMPACT 4
+#define SND_CLASS_DEFAULT_PASSING 5
+#define SND_CLASS_DEFAULT_EXPLODING 6
+#define SND_BD_DIAMOND_COLLECTING 7
+#define SND_BD_DIAMOND_IMPACT 8
+#define SND_BD_ROCK_PUSHING 9
+#define SND_BD_ROCK_IMPACT 10
+#define SND_BD_MAGIC_WALL_ACTIVATING 11
+#define SND_BD_MAGIC_WALL_ACTIVE 12
+#define SND_BD_MAGIC_WALL_FILLING 13
+#define SND_BD_AMOEBA_WAITING 14
+#define SND_BD_AMOEBA_GROWING 15
+#define SND_BD_AMOEBA_TURNING_TO_GEM 16
+#define SND_BD_AMOEBA_TURNING_TO_ROCK 17
+#define SND_BD_BUTTERFLY_MOVING 18
+#define SND_BD_BUTTERFLY_WAITING 19
+#define SND_BD_FIREFLY_MOVING 20
+#define SND_BD_FIREFLY_WAITING 21
+#define SND_SP_BASE_DIGGING 22
+#define SND_SP_BUGGY_BASE_DIGGING 23
+#define SND_SP_BUGGY_BASE_ACTIVE 24
+#define SND_SP_INFOTRON_COLLECTING 25
+#define SND_SP_INFOTRON_IMPACT 26
+#define SND_SP_ZONK_PUSHING 27
+#define SND_SP_ZONK_IMPACT 28
+#define SND_SP_DISK_RED_COLLECTING 29
+#define SND_SP_DISK_ORANGE_PUSHING 30
+#define SND_SP_DISK_YELLOW_PUSHING 31
+#define SND_CLASS_SP_PORT_PASSING 32
+#define SND_CLASS_SP_EXIT_PASSING 33
+#define SND_CLASS_SP_EXIT_OPENING 34
+#define SND_SP_SNIKSNAK_MOVING 35
+#define SND_SP_SNIKSNAK_WAITING 36
+#define SND_SP_ELECTRON_MOVING 37
+#define SND_SP_ELECTRON_WAITING 38
+#define SND_SP_TERMINAL_ACTIVATING 39
+#define SND_SP_TERMINAL_ACTIVE 40
+#define SND_CLASS_SOKOBAN_PUSHING 41
+#define SND_CLASS_SOKOBAN_FILLING 42
+#define SND_CLASS_SOKOBAN_EMPTYING 43
+#define SND_EMPTY_SPACE_DIGGING 44
+#define SND_SAND_DIGGING 45
+#define SND_EMERALD_COLLECTING 46
+#define SND_EMERALD_IMPACT 47
+#define SND_DIAMOND_COLLECTING 48
+#define SND_DIAMOND_IMPACT 49
+#define SND_DIAMOND_BREAKING 50
+#define SND_ROCK_PUSHING 51
+#define SND_ROCK_IMPACT 52
+#define SND_BOMB_PUSHING 53
+#define SND_NUT_PUSHING 54
+#define SND_NUT_BREAKING 55
+#define SND_NUT_IMPACT 56
+#define SND_CLASS_DYNAMITE_COLLECTING 57
+#define SND_CLASS_DYNAMITE_DROPPING 58
+#define SND_CLASS_DYNAMITE_ACTIVE 59
+#define SND_CLASS_KEY_COLLECTING 60
+#define SND_CLASS_GATE_PASSING 61
+#define SND_BUG_MOVING 62
+#define SND_BUG_WAITING 63
+#define SND_SPACESHIP_MOVING 64
+#define SND_SPACESHIP_WAITING 65
+#define SND_YAMYAM_MOVING 66
+#define SND_YAMYAM_WAITING 67
+#define SND_YAMYAM_DIGGING 68
+#define SND_ROBOT_MOVING 69
+#define SND_ROBOT_WAITING 70
+#define SND_ROBOT_WHEEL_ACTIVATING 71
+#define SND_ROBOT_WHEEL_ACTIVE 72
+#define SND_MAGIC_WALL_ACTIVATING 73
+#define SND_MAGIC_WALL_ACTIVE 74
+#define SND_MAGIC_WALL_FILLING 75
+#define SND_CLASS_AMOEBA_WAITING 76
+#define SND_CLASS_AMOEBA_GROWING 77
+#define SND_CLASS_AMOEBA_DROPPING 78
+#define SND_ACID_SPLASHING 79
+#define SND_CLASS_QUICKSAND_FILLING 80
+#define SND_CLASS_QUICKSAND_EMPTYING 81
+#define SND_CLASS_EXIT_OPENING 82
+#define SND_CLASS_EXIT_PASSING 83
+#define SND_PENGUIN_PASSING 84
+#define SND_BALLOON_MOVING 85
+#define SND_BALLOON_WAITING 86
+#define SND_BALLOON_PUSHING 87
+#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 88
+#define SND_SPRING_MOVING 89
+#define SND_SPRING_PUSHING 90
+#define SND_SPRING_IMPACT 91
+#define SND_CLASS_WALL_GROWING 92
+#define SND_PEARL_COLLECTING 93
+#define SND_PEARL_BREAKING 94
+#define SND_PEARL_IMPACT 95
+#define SND_CRYSTAL_COLLECTING 96
+#define SND_CRYSTAL_IMPACT 97
+#define SND_ENVELOPE_COLLECTING 98
+#define SND_INVISIBLE_SAND_DIGGING 99
+#define SND_SHIELD_NORMAL_COLLECTING 100
+#define SND_SHIELD_NORMAL_ACTIVE 101
+#define SND_SHIELD_DEADLY_COLLECTING 102
+#define SND_SHIELD_DEADLY_ACTIVE 103
+#define SND_EXTRA_TIME_COLLECTING 104
+#define SND_MOLE_MOVING 105
+#define SND_MOLE_WAITING 106
+#define SND_MOLE_DIGGING 107
+#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 108
+#define SND_CLASS_SWITCHGATE_OPENING 109
+#define SND_CLASS_SWITCHGATE_CLOSING 110
+#define SND_CLASS_SWITCHGATE_PASSING 111
+#define SND_TIMEGATE_SWITCH_ACTIVATING 112
+#define SND_TIMEGATE_SWITCH_ACTIVE 113
+#define SND_TIMEGATE_SWITCH_DEACTIVATING 114
+#define SND_TIMEGATE_OPENING 115
+#define SND_CLASS_TIMEGATE_CLOSING 116
+#define SND_CLASS_TIMEGATE_PASSING 117
+#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 118
+#define SND_CLASS_CONVEYOR_BELT_ACTIVE 119
+#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 120
+#define SND_LIGHT_SWITCH_ACTIVATING 121
+#define SND_LIGHT_SWITCH_DEACTIVATING 122
+#define SND_DX_SUPABOMB_PUSHING 123
+#define SND_TRAP_DIGGING 124
+#define SND_TRAP_ACTIVATING 125
+#define SND_CLASS_TUBE_PASSING 126
+#define SND_AMOEBA_TURNING_TO_GEM 127
+#define SND_AMOEBA_TURNING_TO_ROCK 128
+#define SND_SPEED_PILL_COLLECTING 129
+#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 130
+#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 131
+#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 132
+#define SND_CLASS_DYNABOMB_DROPPING 133
+#define SND_CLASS_DYNABOMB_ACTIVE 134
+#define SND_SATELLITE_MOVING 135
+#define SND_SATELLITE_WAITING 136
+#define SND_SATELLITE_PUSHING 137
+#define SND_LAMP_ACTIVATING 138
+#define SND_LAMP_DEACTIVATING 139
+#define SND_TIME_ORB_FULL_COLLECTING 140
+#define SND_TIME_ORB_FULL_IMPACT 141
+#define SND_TIME_ORB_EMPTY_PUSHING 142
+#define SND_TIME_ORB_EMPTY_IMPACT 143
+#define SND_GAME_OF_LIFE_WAITING 144
+#define SND_GAME_OF_LIFE_GROWING 145
+#define SND_BIOMAZE_WAITING 146
+#define SND_BIOMAZE_GROWING 147
+#define SND_PACMAN_MOVING 148
+#define SND_PACMAN_WAITING 149
+#define SND_PACMAN_DIGGING 150
+#define SND_DARK_YAMYAM_MOVING 151
+#define SND_DARK_YAMYAM_WAITING 152
+#define SND_DARK_YAMYAM_DIGGING 153
+#define SND_PENGUIN_MOVING 154
+#define SND_PENGUIN_WAITING 155
+#define SND_PIG_MOVING 156
+#define SND_PIG_WAITING 157
+#define SND_PIG_DIGGING 158
+#define SND_DRAGON_MOVING 159
+#define SND_DRAGON_WAITING 160
+#define SND_DRAGON_ATTACKING 161
+#define SND_CLASS_PLAYER_DYING 162
+#define SND_ELEMENT_EXPLODING 163
+#define SND_SP_ELEMENT_EXPLODING 164
+#define SND_GAME_STARTING 165
+#define SND_GAME_RUNNING_OUT_OF_TIME 166
+#define SND_GAME_LEVELTIME_BONUS 167
+#define SND_GAME_LOSING 168
+#define SND_GAME_WINNING 169
+#define SND_GAME_SOKOBAN_SOLVING 170
+#define SND_DOOR_OPENING 171
+#define SND_DOOR_CLOSING 172
+#define SND_BACKGROUND_SCORES 173
+#define SND_BACKGROUND_INFO 174
-#define NUM_SOUND_FILES 168
+#define NUM_SOUND_FILES 175
#endif /* CONF_SND_H */
element_info[j].sound[action] = sound;
}
- /* initialize element/sound mapping from dynamic configuration */
+ /* initialize element class/sound mapping from dynamic configuration */
for (i=0; i < num_property_mappings; i++)
{
- int element = property_mapping[i].base_index;
- int action = property_mapping[i].ext1_index;
- int sound = property_mapping[i].artwork_index;
+ int element_class = property_mapping[i].base_index - MAX_NUM_ELEMENTS;
+ int action = property_mapping[i].ext1_index;
+ int sound = property_mapping[i].artwork_index;
- if (element >= MAX_NUM_ELEMENTS)
+ if (element_class < 0 || element_class >= MAX_NUM_ELEMENTS)
continue;
if (action < 0)
action = ACTION_DEFAULT;
- element_info[element].sound[action] = sound;
+ for (j=0; j < MAX_NUM_ELEMENTS; j++)
+ if (strcmp(element_info[j].class_name,
+ element_info[element_class].class_name) == 0)
+ element_info[j].sound[action] = sound;
}
- /* initialize element class/sound mapping from dynamic configuration */
+ /* initialize element/sound mapping from dynamic configuration */
for (i=0; i < num_property_mappings; i++)
{
- int element_class = property_mapping[i].base_index - MAX_NUM_ELEMENTS;
- int action = property_mapping[i].ext1_index;
- int sound = property_mapping[i].artwork_index;
+ int element = property_mapping[i].base_index;
+ int action = property_mapping[i].ext1_index;
+ int sound = property_mapping[i].artwork_index;
- if (element_class < 0 || element_class >= MAX_NUM_ELEMENTS)
+ if (element >= MAX_NUM_ELEMENTS)
continue;
if (action < 0)
action = ACTION_DEFAULT;
- for (j=0; j < MAX_NUM_ELEMENTS; j++)
- if (strcmp(element_info[j].class_name,
- element_info[element_class].class_name) == 0)
- element_info[j].sound[action] = sound;
+ element_info[element].sound[action] = sound;
}
/* now set all '-1' values to element specific default values */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
- int default_action_sound = element_info[i].sound[ACTION_DEFAULT];
-
for (act=0; act < NUM_ACTIONS; act++)
{
/* no sound for this specific action -- use default action sound */
if (element_info[i].sound[act] == -1)
- element_info[i].sound[act] = default_action_sound;
+ element_info[i].sound[act] =
+ (element_info[i].sound[ACTION_DEFAULT] != -1 ?
+ element_info[i].sound[ACTION_DEFAULT] :
+ element_info[EL_INTERNAL_DEFAULT_ELEMENT].sound[act]);
}
}
}
InitSoundInfo(); /* sound properties mapping */
InitElementSoundInfo(); /* element game sound mapping */
-#if 1
- InitElementSoundInfo(); /* element game sound mapping */
-#endif
-
InitPlaySoundLevel(); /* internal game sound settings */
}
LoadArtworkInfo();
}
+static char *get_string_in_brackets(char *string)
+{
+ char *string_in_brackets = checked_malloc(strlen(string) + 3);
+
+ sprintf(string_in_brackets, "[%s]", string);
+
+ return string_in_brackets;
+}
+
+#if 0
static char *get_element_class_token(int element)
{
char *element_class_name = element_info[element].class_name;
return element_class_token;
}
+static char *get_action_class_token(int action)
+{
+ char *action_class_name = &element_action_info[action].suffix[1];
+ char *action_class_token = checked_malloc(strlen(action_class_name) + 3);
+
+ sprintf(action_class_token, "[%s]", action_class_name);
+
+ return action_class_token;
+}
+#endif
+
static void InitArtworkConfig()
{
static char *image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS + 1];
- static char *sound_id_prefix[MAX_NUM_ELEMENTS + MAX_NUM_ELEMENTS + 1];
+ static char *sound_id_prefix[2 * MAX_NUM_ELEMENTS + 1];
static char *action_id_suffix[NUM_ACTIONS + 1];
static char *direction_id_suffix[NUM_DIRECTIONS + 1];
static char *special_id_suffix[NUM_SPECIAL_GFX_ARGS + 1];
for (i=0; i<MAX_NUM_ELEMENTS; i++)
sound_id_prefix[i] = element_info[i].token_name;
for (i=0; i<MAX_NUM_ELEMENTS; i++)
- sound_id_prefix[MAX_NUM_ELEMENTS + i] = get_element_class_token(i);
- sound_id_prefix[MAX_NUM_ELEMENTS + MAX_NUM_ELEMENTS] = NULL;
+ sound_id_prefix[MAX_NUM_ELEMENTS + i] =
+ get_string_in_brackets(element_info[i].class_name);
+ sound_id_prefix[2 * MAX_NUM_ELEMENTS] = NULL;
for (i=0; i<NUM_ACTIONS; i++)
action_id_suffix[i] = element_action_info[i].suffix;
game_status <= GAME_MODE_SETUP ? \
menu.draw_yoffset[game_status] : menu.draw_yoffset_default))
+#define NUM_MENU_ENTRIES_ON_SCREEN (menu.list_size[game_status] > 2 ? \
+ menu.list_size[game_status] : \
+ MAX_MENU_ENTRIES_ON_SCREEN)
+
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
#define NUM_SCROLLBAR_BITMAPS 2
static Bitmap *scrollbar_bitmap[NUM_SCROLLBAR_BITMAPS];
int num_page_entries;
int cl_first, cl_cursor;
- if (num_leveldirs <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_leveldirs <= NUM_MENU_ENTRIES_ON_SCREEN)
num_page_entries = num_leveldirs;
else
- num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN;
+ num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
cl_first = MAX(0, leveldir_pos - num_page_entries + 1);
cl_cursor = leveldir_pos - cl_first;
int items_max, items_visible, item_position;
items_max = numTreeInfoInGroup(ti);
- items_visible = MAX_MENU_ENTRIES_ON_SCREEN;
+ items_visible = NUM_MENU_ENTRIES_ON_SCREEN;
item_position = first_entry;
if (item_position > items_max - items_visible)
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
- if (num_entries <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
num_page_entries = num_entries;
else
- num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN;
+ num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
if (button == MB_MENU_INITIALIZE)
{
DrawText(mSX + 80, mSY + 8, "Hall Of Fame", FONT_TITLE_1);
DrawTextFCentered(46, FONT_TITLE_2, "HighScores of Level %d", level_nr);
- for(i=0; i<MAX_MENU_ENTRIES_ON_SCREEN; i++)
+ for(i=0; i<NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
int entry = first_entry + i;
boolean active = (entry == highlight_position);
}
if (ABS(dy) == SCROLL_PAGE) /* handle scrolling one page */
- step = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ step = NUM_MENU_ENTRIES_ON_SCREEN - 1;
if (dy < 0)
{
}
else if (dy > 0)
{
- if (first_entry + MAX_MENU_ENTRIES_ON_SCREEN < MAX_SCORE_ENTRIES)
+ if (first_entry + NUM_MENU_ENTRIES_ON_SCREEN < MAX_SCORE_ENTRIES)
{
first_entry += step;
- if (first_entry + MAX_MENU_ENTRIES_ON_SCREEN > MAX_SCORE_ENTRIES)
- first_entry = MAX(0, MAX_SCORE_ENTRIES - MAX_MENU_ENTRIES_ON_SCREEN);
+ if (first_entry + NUM_MENU_ENTRIES_ON_SCREEN > MAX_SCORE_ENTRIES)
+ first_entry = MAX(0, MAX_SCORE_ENTRIES - NUM_MENU_ENTRIES_ON_SCREEN);
drawHallOfFameList(first_entry, highlight_position);
return;
DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1);
num_setup_info = 0;
- for(i=0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++)
+ for(i=0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
void *value_ptr = setup_info[i].value;
int ypos = MENU_SCREEN_START_YPOS + i;
struct GadgetInfo *gi;
int items_max, items_visible, item_position;
unsigned long event_mask;
- int num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN;
+ int num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
int id = scrollbar_info[i].gadget_id;
items_max = num_page_entries;
int num_entries = numTreeInfoInGroup(ti);
int i;
- if (num_entries <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
return;
for (i=0; i<NUM_SCREEN_GADGETS; i++)