From 4e46f51bcf8d47fec91e80ededb618b5e220a516 Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 1 Nov 2010 23:56:06 -0400 Subject: [PATCH] changed moving sign code so it doesn't modify the sign itself. --- includes/defines.h | 3 ++- src/graphics.c | 2 +- src/interface.c | 8 ++++---- src/main.c | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 8ffa44941..df1fa0aef 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -90,7 +90,7 @@ extern int death; struct sign { - int x,y,ju,m; + int x,y,ju; char text[256]; }; typedef struct sign sign; @@ -103,6 +103,7 @@ struct stamp }; typedef struct stamp stamp; +int MSIGN; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/src/graphics.c b/src/graphics.c index 39f95953b..b403fe36f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2237,7 +2237,7 @@ void render_signs(pixel *vid_buf) x+=dx; y+=dy; } - if(signs[i].m==1) + if(MSIGN==i) { bq = b; b = SDL_GetMouseState(&mx, &my); diff --git a/src/interface.c b/src/interface.c index 2161bcb1c..e56186845 100644 --- a/src/interface.c +++ b/src/interface.c @@ -97,7 +97,7 @@ void get_sign_pos(int i, int *x0, int *y0, int *w, int *h) void add_sign_ui(pixel *vid_buf, int mx, int my) { - int i, w, h, x, y, nm=0, ju,movesign = 0; + int i, w, h, x, y, nm=0, ju; int x0=(XRES-192)/2,y0=(YRES-80)/2,b=1,bq; ui_edit ed; @@ -105,9 +105,9 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) for(i=0; i=x0+104 && mx<=x0+130 && my>=y0+42 && my<=y0+59) { - signs[i].m = 1; + MSIGN = i; break; } if(b && !bq && mx>=x0+9 && mx=y0+22 && my