summaryrefslogtreecommitdiffhomepage
path: root/digital/ai
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-05 20:29:07 +0200
committerNicolas Schodet2012-05-06 02:06:20 +0200
commitcbb4b6951a9a8c06db7a1d795b5524c7fc885f35 (patch)
tree887e3f0784995ae188f9e5cfeffa976667d76183 /digital/ai
parent0fcdbb1904c2f1c32c80ebe4da367742ef6e00bc (diff)
digital/ai/src: add PG_MIRROR_X
Diffstat (limited to 'digital/ai')
-rw-r--r--digital/ai/src/common/playground.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/digital/ai/src/common/playground.h b/digital/ai/src/common/playground.h
index 4f225a50..b3682fbb 100644
--- a/digital/ai/src/common/playground.h
+++ b/digital/ai/src/common/playground.h
@@ -48,8 +48,11 @@
/** Distance to playground borders for general movements, mm. */
#define PG_BORDER_DISTANCE 250
+/** Return mirror X coordinate, using a horizontal symmetry. */
+#define PG_MIRROR_X(x) (PG_WIDTH - (x))
+
/** Return X coordinate, applying symmetry according to team color. */
-#define PG_X(x) (team_color ? (x) : PG_WIDTH - (x))
+#define PG_X(x) (team_color ? (x) : PG_MIRROR_X (x))
/** Same as PG_Y, but for Y coordinate. Actually nothing is done, there is no
* symmetry. */