From cbb4b6951a9a8c06db7a1d795b5524c7fc885f35 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 5 May 2012 20:29:07 +0200 Subject: digital/ai/src: add PG_MIRROR_X --- digital/ai/src/common/playground.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'digital') 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. */ -- cgit v1.2.3