removed unused array for SDL key state
[rocksndiamonds.git] / src / tools.c
index 1fe6fccc6306529554ed1f797cee6f8c8cd8373e..7c81b8f7748ba8f67339e8d784d6898371729a8d 100644 (file)
@@ -7481,6 +7481,14 @@ bd_object_mapping_list[] =
     O_PLAYER_RIGHT,                            FALSE,
     EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_RIGHT
   },
+  {
+    O_PLAYER_UP,                               FALSE,
+    EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_UP
+  },
+  {
+    O_PLAYER_DOWN,                             FALSE,
+    EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_DOWN
+  },
   {
     O_PLAYER_BLINK,                            FALSE,
     EL_BD_PLAYER,                              ACTION_BORING_1, -1
@@ -7493,6 +7501,14 @@ bd_object_mapping_list[] =
     O_PLAYER_TAP_BLINK,                                FALSE,
     EL_BD_PLAYER,                              ACTION_BORING_3, -1
   },
+  {
+    O_PLAYER_PUSH_LEFT,                                FALSE,
+    EL_BD_PLAYER,                              ACTION_PUSHING, MV_BIT_LEFT
+  },
+  {
+    O_PLAYER_PUSH_RIGHT,                       FALSE,
+    EL_BD_PLAYER,                              ACTION_PUSHING, MV_BIT_RIGHT
+  },
   {
     O_CREATURE_SWITCH_ON,                      FALSE,
     EL_BD_CREATURE_SWITCH_ACTIVE,              -1, -1
@@ -11415,6 +11431,27 @@ void PlaySoundSelecting(void)
 #endif
 }
 
+void ToggleAudioSampleRateIfNeeded(void)
+{
+  int setup_audio_sample_rate = (setup.audio_sample_rate_44100 ? 44100 : 22050);
+
+  // if setup and audio sample rate are already matching, nothing do do
+  if ((setup_audio_sample_rate == audio.sample_rate) ||
+      !audio.sound_available)
+    return;
+
+#if 1
+  // apparently changing the audio output sample rate does not work at runtime,
+  // so currently the program has to be restarted to apply the new sample rate
+  Request("Please restart the program to change audio sample rate!", REQ_CONFIRM);
+#else
+  SDLReopenAudio();
+
+  // set setup value according to successfully changed audio sample rate
+  setup.audio_sample_rate_44100 = (audio.sample_rate == 44100);
+#endif
+}
+
 void ToggleFullscreenIfNeeded(void)
 {
   // if setup and video fullscreen state are already matching, nothing do do