X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=862365fa1259bf46ec62d09a9f8971d969efd2fe;hb=0548cd8fd0353c19608df8a7079fc2c39cc4ce27;hp=0e208dbb66e676ea16db2512c0d279cb3f74532a;hpb=939a6fd558cffde54d72f9f562e504bbeffc638c;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 0e208dbb..862365fa 100644 --- a/src/init.c +++ b/src/init.c @@ -167,6 +167,14 @@ static void InitArtworkConfig() static char *direction_suffix[NUM_DIRECTIONS + 1]; static char *special_suffix[NUM_SPECIAL_GFX_ARGS + 1]; static char *dummy[1] = { NULL }; + static char *ignore_image_tokens[] = + { + "name", + "sort_priority", + "menu.main.hide_static_text", + "global.num_toons", + NULL + }; int i; for (i=0; idrawable, clip_gc_valuemask, &clip_gc_values); #endif @@ -1112,9 +1115,14 @@ static void InitGraphicInfo() #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) if (copy_clipmask_gc) XFreeGC(display, copy_clipmask_gc); -#endif clipmasks_initialized = TRUE; +#endif +} + +static void InitElementSoundInfo() +{ + /* !!! soon to come !!! */ } static void set_sound_parameters(int sound, char **parameter_raw) @@ -1134,6 +1142,8 @@ static void set_sound_parameters(int sound, char **parameter_raw) static void InitSoundInfo() { + struct PropertyMapping *property_mapping = getSoundListPropertyMapping(); + int num_property_mappings = getSoundListPropertyMappingSize(); int *sound_effect_properties; int num_sounds = getSoundListSize(); int i, j; @@ -1199,6 +1209,37 @@ static void InitSoundInfo() free(sound_effect_properties); + /* initialize element/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; + + if (action < 0) + action = ACTION_DEFAULT; + + element_info[element].sound[action] = sound; + } + +#if 0 + /* TEST ONLY */ + { + int element = EL_CUSTOM_11; + int j = 0; + + while (element_action_info[j].suffix) + { + printf("element %d, sound action '%s' == %d\n", + element, element_action_info[j].suffix, + element_info[element].sound[j]); + j++; + } + } + + PlaySoundLevelElementAction(0,0, EL_CUSTOM_11, ACTION_PUSHING); +#endif + #if 0 /* TEST ONLY */ { @@ -1211,7 +1252,7 @@ static void InitSoundInfo() if (element_action_info[j].value == sound_action) printf("element %d, sound action '%s' == %d\n", element, element_action_info[j].suffix, - element_info_[element].sound[sound_action]); + element_info[element].sound[sound_action]); j++; } } @@ -1695,14 +1736,6 @@ void InitElementProperties() EL_EMERALD_RED, EL_EMERALD_PURPLE, EL_DIAMOND, - EL_KEY1, - EL_KEY2, - EL_KEY3, - EL_KEY4, - EL_EM_KEY1, - EL_EM_KEY2, - EL_EM_KEY3, - EL_EM_KEY4, EL_BOMB, EL_NUT, EL_AMOEBA_DROP,