diff options
author | truelight <truelight@openttd.org> | 2005-01-12 11:21:28 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-01-12 11:21:28 +0000 |
commit | a243285af4aa15923c5f2905a01a101603f72517 (patch) | |
tree | 23a6d3557feb58903656bb5447653052cda86af7 /viewport.c | |
parent | ff23795f5be95d273c2168d71cbc25fa7fff1c3e (diff) | |
download | openttd-a243285af4aa15923c5f2905a01a101603f72517.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.c | 13 |
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 && |