+/* play sound of given element being pushed. */
+static void play_sound_of_element_pushing(GdCave *cave, GdElement element, int x, int y)
+{
+ switch (element)
+ {
+ case O_NUT:
+ gd_sound_play(cave, GD_S_NUT_PUSHING, element, x, y);
+ break;
+
+ case O_STONE:
+ gd_sound_play(cave, GD_S_STONE_PUSHING, element, x, y);
+ break;
+
+ case O_FLYING_STONE:
+ gd_sound_play(cave, GD_S_FLYING_STONE_PUSHING, element, x, y);
+ break;
+
+ case O_MEGA_STONE:
+ gd_sound_play(cave, GD_S_MEGA_STONE_PUSHING, element, x, y);
+ break;
+
+ case O_WAITING_STONE:
+ gd_sound_play(cave, GD_S_WAITING_STONE_PUSHING, element, x, y);
+ break;
+
+ case O_CHASING_STONE:
+ gd_sound_play(cave, GD_S_CHASING_STONE_PUSHING, element, x, y);
+ break;
+
+ case O_NITRO_PACK:
+ gd_sound_play(cave, GD_S_NITRO_PACK_PUSHING, element, x, y);
+ break;
+
+ case O_BLADDER:
+ gd_sound_play(cave, GD_S_BLADDER_PUSHING, element, x, y);
+ break;
+
+ default:
+ /* do nothing. */
+ break;
+ }
+}
+
+static inline int getx(const GdCave *cave, const int x, const int y)
+{
+ return cave->getx(cave, x, y);
+}
+
+static inline int gety(const GdCave *cave, const int x, const int y)
+{
+ return cave->gety(cave, x, y);
+}
+
+/* perfect (non-lineshifting) GET x/y functions; returns range corrected x/y position */
+static inline int getx_perfect(const GdCave *cave, const int x, const int y)
+{
+ return (x + cave->w) % cave->w;
+}
+
+static inline int gety_perfect(const GdCave *cave, const int x, const int y)
+{
+ return (y + cave->h) % cave->h;
+}
+
+/* line shifting GET x/y function; returns range corrected x/y position */
+static inline int getx_shift(const GdCave *cave, int x, int y)
+{
+ return (x + cave->w) % cave->w;
+}
+
+static inline int gety_shift(const GdCave *cave, int x, int y)
+{
+ return ((x < 0 ? y - 1 : x >= cave->w ? y + 1 : y) + cave->h) % cave->h;
+}
+