From 97dd511971f00a2affaa8d17bb7d0d6c3e13f206 Mon Sep 17 00:00:00 2001 From: truelight Date: Wed, 12 Jan 2005 11:21:28 +0000 Subject: (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for dynamic arrays --- viewport.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'viewport.c') 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 && -- cgit v1.2.3-54-g00ecf