+void DrawGameDoorValues()
+{
+ int i, j;
+
+ for (i=0; i<MAX_PLAYERS; i++)
+ for (j=0; j<4; j++)
+ if (stored_player[i].key[j])
+ DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS,
+ GFX_SCHLUESSEL1 + j);
+
+ DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
+ int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE,
+ int2str(local_player->dynamite, 3), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_SCORE, DY + YY_SCORE,
+ int2str(local_player->score, 5), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_TIME, DY + YY_TIME,
+ int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW);
+}
+
+void InitGameEngine()
+{
+ static int sound_effect_properties[NUM_SOUND_EFFECTS];
+ int i, j;
+
+#if 0
+ debug_print_timestamp(0, NULL);
+#endif
+
+ for (i=0; i<NUM_SND_ACTIONS; i++)
+ for (j=0; j<NUM_LEVEL_ELEMENTS; j++)
+ element_action_sound[j][i] = -1;
+
+ for (i=0; i<NUM_SOUND_EFFECTS; i++)
+ {
+ int len_effect_text = strlen(sound_effects[i].text);
+
+ sound_effect_properties[i] = SND_ACTION_UNKNOWN;
+ is_loop_sound[i] = FALSE;
+
+ /* determine all loop sounds and identify certain sound classes */
+
+ j = 0;
+ while (sound_action_properties[j].text)
+ {
+ int len_action_text = strlen(sound_action_properties[j].text);
+
+ if (len_action_text < len_effect_text &&
+ strcmp(&sound_effects[i].text[len_effect_text - len_action_text],
+ sound_action_properties[j].text) == 0)
+ {
+ sound_effect_properties[i] = sound_action_properties[j].value;
+
+ if (sound_action_properties[j].is_loop)
+ is_loop_sound[i] = TRUE;
+ }
+
+ j++;
+ }
+
+ /* associate elements and some selected sound actions */
+
+ for (j=0; j<NUM_LEVEL_ELEMENTS; j++)
+ {
+ if (element_info[j].sound_class_name)
+ {
+ int len_class_text = strlen(element_info[j].sound_class_name);
+
+ if (len_class_text + 1 < len_effect_text &&
+ strncmp(sound_effects[i].text,
+ element_info[j].sound_class_name, len_class_text) == 0 &&
+ sound_effects[i].text[len_class_text] == '.')
+ {
+ int sound_action_value = sound_effect_properties[i];
+
+ element_action_sound[j][sound_action_value] = i;
+ }
+ }
+ }
+ }
+
+#if 0
+ debug_print_timestamp(0, "InitGameEngine");
+#endif
+
+#if 0
+ /* TEST ONLY */
+ {
+ int element = EL_ERDREICH;
+ int sound_action = SND_ACTION_DIGGING;
+ int j = 0;
+
+ while (sound_action_properties[j].text)
+ {
+ if (sound_action_properties[j].value == sound_action)
+ printf("element %d, sound action '%s' == %d\n",
+ element, sound_action_properties[j].text,
+ element_action_sound[element][sound_action]);
+ j++;
+ }
+ }
+#endif
+}
+