Changeset - r12266:094a74dc3a85
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-06-29 09:32:58
rubidium@openttd.org
(svn r16691) -Codechange: what's the point of getting the fifth dparam and then using that as the second dparam later on? Especially when the fifth dparam is never set and the second dparam is never used.
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/texteff.cpp
Show inline comments
 
@@ -23,13 +23,12 @@ struct TextEffect {
 
	int32 x;
 
	int32 y;
 
	int32 right;
 
	int32 bottom;
 
	uint16 duration;
 
	uint64 params_1;
 
	uint64 params_2;
 
	TextEffectMode mode;
 
};
 

	
 
/* used for text effects */
 
static TextEffect *_text_effect_list = NULL;
 
static uint16 _num_text_effects = INIT_NUM_TEXT_EFFECTS;
 
@@ -81,13 +80,12 @@ TextEffectID AddTextEffect(StringID msg,
 
	/* Start defining this object */
 
	te->string_id = msg;
 
	te->duration = duration;
 
	te->y = y - 5;
 
	te->bottom = y + 5;
 
	te->params_1 = GetDParam(0);
 
	te->params_2 = GetDParam(4);
 
	te->mode = mode;
 

	
 
	GetString(buffer, msg, lastof(buffer));
 
	w = GetStringBoundingBox(buffer).width;
 

	
 
	te->x = x - (w >> 1);
 
@@ -103,13 +101,12 @@ void UpdateTextEffect(TextEffectID te_id
 
	TextEffect *te;
 

	
 
	/* Update details */
 
	te = &_text_effect_list[te_id];
 
	te->string_id = msg;
 
	te->params_1 = GetDParam(0);
 
	te->params_2 = GetDParam(4);
 

	
 
	/* Update width of text effect */
 
	char buffer[100];
 
	GetString(buffer, msg, lastof(buffer));
 
	int w = GetStringBoundingBox(buffer).width;
 

	
 
@@ -168,13 +165,13 @@ void DrawTextEffects(DrawPixelInfo *dpi)
 
				if (te->string_id != INVALID_STRING_ID &&
 
						dpi->left <= te->right &&
 
						dpi->top  <= te->bottom &&
 
						dpi->left + dpi->width  > te->x &&
 
						dpi->top  + dpi->height > te->y) {
 
					if (te->mode == TE_RISING || (_settings_client.gui.loading_indicators && !IsTransparencySet(TO_LOADING))) {
 
						AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2);
 
						AddStringToDraw(te->x, te->y, te->string_id, te->params_1, INVALID_STRING_ID);
 
					}
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_2X:
 
@@ -183,13 +180,13 @@ void DrawTextEffects(DrawPixelInfo *dpi)
 
				if (te->string_id != INVALID_STRING_ID &&
 
						dpi->left <= te->right  * 2 - te->x &&
 
						dpi->top  <= te->bottom * 2 - te->y &&
 
						dpi->left + dpi->width  > te->x &&
 
						dpi->top  + dpi->height > te->y) {
 
					if (te->mode == TE_RISING || (_settings_client.gui.loading_indicators && !IsTransparencySet(TO_LOADING))) {
 
						AddStringToDraw(te->x, te->y, (StringID)(te->string_id - 1), te->params_1, te->params_2);
 
						AddStringToDraw(te->x, te->y, (StringID)(te->string_id - 1), te->params_1, INVALID_STRING_ID);
 
					}
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_4X:
0 comments (0 inline, 0 general)