diff options
Diffstat (limited to 'util.cpp')
-rw-r--r-- | util.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/util.cpp b/util.cpp index b021146..868161f 100644 --- a/util.cpp +++ b/util.cpp | |||
@@ -7,12 +7,14 @@ void wrap(int* x, int* y) | |||
7 | if (*x < 0) | 7 | if (*x < 0) |
8 | { | 8 | { |
9 | *x = WIDTH-(0-*x); | 9 | *x = WIDTH-(0-*x); |
10 | } else if (*y < 0) | ||
11 | { | ||
12 | *y = HEIGHT-(0-*y); | ||
13 | } else if (*x >= WIDTH) | 10 | } else if (*x >= WIDTH) |
14 | { | 11 | { |
15 | *x = *x-WIDTH; | 12 | *x = *x-WIDTH; |
13 | } | ||
14 | |||
15 | if (*y < 0) | ||
16 | { | ||
17 | *y = HEIGHT-(0-*y); | ||
16 | } else if (*y >= HEIGHT) | 18 | } else if (*y >= HEIGHT) |
17 | { | 19 | { |
18 | *y = *y-HEIGHT; | 20 | *y = *y-HEIGHT; |