119 for (i = 0; i < MAX_CHAT_MESSAGES; i++) { |
122 for (i = 0; i < MAX_CHAT_MESSAGES; i++) { |
120 _textmsg_list[i].message[0] = '\0'; |
123 _textmsg_list[i].message[0] = '\0'; |
121 } |
124 } |
122 } |
125 } |
123 |
126 |
124 /* Hide the textbox */ |
127 /** Hide the textbox */ |
125 void UndrawTextMessage() |
128 void UndrawTextMessage() |
126 { |
129 { |
127 if (_textmessage_visible) { |
130 if (_textmessage_visible) { |
128 /* Sometimes we also need to hide the cursor |
131 /* Sometimes we also need to hide the cursor |
129 * This is because both textmessage and the cursor take a shot of the |
132 * This is because both textmessage and the cursor take a shot of the |
241 ); |
244 ); |
242 |
245 |
243 /* Paint the messages starting with the lowest at the bottom */ |
246 /* Paint the messages starting with the lowest at the bottom */ |
244 for (uint y = 13; count-- != 0; y += 13) { |
247 for (uint y = 13; count-- != 0; y += 13) { |
245 DoDrawString(_textmsg_list[count].message, _textmsg_box.x + 3, _screen.height - _textmsg_box.y - y + 1, _textmsg_list[count].color); |
248 DoDrawString(_textmsg_list[count].message, _textmsg_box.x + 3, _screen.height - _textmsg_box.y - y + 1, _textmsg_list[count].color); |
246 } |
249 } |
247 |
250 |
248 /* Make sure the data is updated next flush */ |
251 /* Make sure the data is updated next flush */ |
249 _video_driver->make_dirty(x, y, width, height); |
252 _video_driver->make_dirty(x, y, width, height); |
250 |
253 |
251 _textmessage_visible = true; |
254 _textmessage_visible = true; |
322 void DrawTextEffects(DrawPixelInfo *dpi) |
325 void DrawTextEffects(DrawPixelInfo *dpi) |
323 { |
326 { |
324 const TextEffect* te; |
327 const TextEffect* te; |
325 |
328 |
326 switch (dpi->zoom) { |
329 switch (dpi->zoom) { |
327 case 0: |
330 case ZOOM_LVL_NORMAL: |
328 for (te = _text_effect_list; te != endof(_text_effect_list); te++) { |
331 for (te = _text_effect_list; te != endof(_text_effect_list); te++) { |
329 if (te->string_id != INVALID_STRING_ID && |
332 if (te->string_id != INVALID_STRING_ID && |
330 dpi->left <= te->right && |
333 dpi->left <= te->right && |
331 dpi->top <= te->bottom && |
334 dpi->top <= te->bottom && |
332 dpi->left + dpi->width > te->x && |
335 dpi->left + dpi->width > te->x && |
334 AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2); |
337 AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2); |
335 } |
338 } |
336 } |
339 } |
337 break; |
340 break; |
338 |
341 |
339 case 1: |
342 case ZOOM_LVL_OUT_2X: |
340 for (te = _text_effect_list; te != endof(_text_effect_list); te++) { |
343 for (te = _text_effect_list; te != endof(_text_effect_list); te++) { |
341 if (te->string_id != INVALID_STRING_ID && |
344 if (te->string_id != INVALID_STRING_ID && |
342 dpi->left <= te->right * 2 - te->x && |
345 dpi->left <= te->right * 2 - te->x && |
343 dpi->top <= te->bottom * 2 - te->y && |
346 dpi->top <= te->bottom * 2 - te->y && |
344 dpi->left + dpi->width > te->x && |
347 dpi->left + dpi->width > te->x && |
345 dpi->top + dpi->height > te->y) { |
348 dpi->top + dpi->height > te->y) { |
346 AddStringToDraw(te->x, te->y, (StringID)(te->string_id-1), te->params_1, te->params_2); |
349 AddStringToDraw(te->x, te->y, (StringID)(te->string_id-1), te->params_1, te->params_2); |
347 } |
350 } |
348 } |
351 } |
349 break; |
352 break; |
|
353 |
|
354 case ZOOM_LVL_OUT_4X: |
|
355 case ZOOM_LVL_OUT_8X: |
|
356 case ZOOM_LVL_OUT_16X: |
|
357 break; |
|
358 |
|
359 default: NOT_REACHED(); |
350 } |
360 } |
351 } |
361 } |
352 |
362 |
353 void DeleteAnimatedTile(TileIndex tile) |
363 void DeleteAnimatedTile(TileIndex tile) |
354 { |
364 { |