summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-12 11:21:28 +0000
committertruelight <truelight@openttd.org>2005-01-12 11:21:28 +0000
commit97dd511971f00a2affaa8d17bb7d0d6c3e13f206 (patch)
tree23a6d3557feb58903656bb5447653052cda86af7 /viewport.c
parent38b0a06d85d534516d6252119e967f1ec1142baf (diff)
downloadopenttd-97dd511971f00a2affaa8d17bb7d0d6c3e13f206.tar.xz
(svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
dynamic arrays
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/viewport.c b/viewport.c
index a7f9ef776..005379ef1 100644
--- a/viewport.c
+++ b/viewport.c
@@ -8,6 +8,7 @@
#include "station.h"
#include "gfx.h"
#include "town.h"
+#include "signs.h"
#define VIEWPORT_DRAW_MEM (65536 * 2)
@@ -885,7 +886,7 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
bottom = top + dpi->height;
if (dpi->zoom < 1) {
- for(ss=_sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
bottom > ss->sign.top &&
top < ss->sign.top + 12 &&
@@ -902,7 +903,7 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
} else if (dpi->zoom == 1) {
right += 2;
bottom += 2;
- for(ss=_sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
bottom > ss->sign.top &&
top < ss->sign.top + 24 &&
@@ -920,7 +921,7 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
right += 4;
bottom += 5;
- for(ss=_sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
bottom > ss->sign.top &&
top < ss->sign.top + 24 &&
@@ -1541,7 +1542,7 @@ static bool CheckClickOnSign(ViewPort *vp, int x, int y)
x = x - vp->left + vp->virtual_left;
y = y - vp->top + vp->virtual_top;
- for(ss = _sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
y >= ss->sign.top &&
y < ss->sign.top + 12 &&
@@ -1554,7 +1555,7 @@ static bool CheckClickOnSign(ViewPort *vp, int x, int y)
} else if (vp->zoom == 1) {
x = (x - vp->left + 1) * 2 + vp->virtual_left;
y = (y - vp->top + 1) * 2 + vp->virtual_top;
- for(ss = _sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
y >= ss->sign.top &&
y < ss->sign.top + 24 &&
@@ -1567,7 +1568,7 @@ static bool CheckClickOnSign(ViewPort *vp, int x, int y)
} else {
x = (x - vp->left + 3) * 4 + vp->virtual_left;
y = (y - vp->top + 3) * 4 + vp->virtual_top;
- for(ss = _sign_list; ss != endof(_sign_list); ss++) {
+ FOR_ALL_SIGNS(ss) {
if (ss->str &&
y >= ss->sign.top &&
y < ss->sign.top + 24 &&