+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;
+}
+