special_suffix[i] = special_suffix_info[i].suffix;
InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
- element_prefix, action_suffix,direction_suffix, special_suffix,
+ element_prefix, action_suffix, direction_suffix,special_suffix,
ignore_image_tokens);
InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
sound_class_prefix, action_suffix, dummy, dummy, dummy);
}
}
-static void InitElementSoundInfo()
-{
- /* !!! soon to come !!! */
-}
-
static void set_graphic_parameters(int graphic, char **parameter_raw)
{
Bitmap *src_bitmap = getBitmapFromImageID(graphic);
static void InitGraphicInfo()
{
- static boolean clipmasks_initialized = FALSE;
int fallback_graphic = IMG_CHAR_EXCLAM;
struct FileInfo *fallback_image = getImageListEntry(fallback_graphic);
Bitmap *fallback_bitmap = getBitmapFromImageID(fallback_graphic);
int num_images = getImageListSize();
int i;
+
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
+ static boolean clipmasks_initialized = FALSE;
Pixmap src_pixmap;
XGCValues clip_gc_values;
unsigned long clip_gc_valuemask;
clip_gc_values.graphics_exposures = False;
clip_gc_values.clip_mask = graphic_info[i].clip_mask;
clip_gc_valuemask = GCGraphicsExposures | GCClipMask;
+
graphic_info[i].clip_gc =
XCreateGC(display, window->drawable, clip_gc_valuemask, &clip_gc_values);
#endif
#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)
static void InitSoundInfo()
{
+ struct PropertyMapping *property_mapping = getSoundListPropertyMapping();
+ int num_property_mappings = getSoundListPropertyMappingSize();
int *sound_effect_properties;
int num_sounds = getSoundListSize();
int i, j;
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 */
{
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++;
}
}