1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00

add global macro for gCurrentFontSpriteBase and gCurrentFontFlags

This commit is contained in:
Ted John
2016-04-25 23:00:58 +01:00
parent b1f704dac4
commit 489ea66cc9
21 changed files with 83 additions and 83 deletions

View File

@@ -73,8 +73,8 @@ void chat_draw()
char* lineCh = lineBuffer;
int x = _chatLeft;
int y = _chatBottom - (15 * 2);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_FLAGS, uint16) = 0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
gCurrentFontFlags = 0;
for (int i = 0; i < CHAT_HISTORY_SIZE; i++, y -= 15) {
if (!gChatOpen && SDL_TICKS_PASSED(SDL_GetTicks(), chat_history_get_time(i) + 10000)) {
break;

View File

@@ -139,9 +139,9 @@ void console_draw(rct_drawpixelinfo *dpi)
return;
// Set font
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = (gConfigInterface.console_small_font ? FONT_SPRITE_BASE_SMALL : FONT_SPRITE_BASE_MEDIUM);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_FLAGS, uint16) = 0;
int lineHeight = font_get_line_height(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16));
gCurrentFontSpriteBase = (gConfigInterface.console_small_font ? FONT_SPRITE_BASE_SMALL : FONT_SPRITE_BASE_MEDIUM);
gCurrentFontFlags = 0;
int lineHeight = font_get_line_height(gCurrentFontSpriteBase);
int lines = 0;
int maxLines = ((_consoleBottom - 22 - _consoleTop) / lineHeight) - 1;

View File

@@ -1467,7 +1467,7 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma
format_string(entrance_string, string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void));
}
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 0x1C0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16 string_width = gfx_get_string_width(entrance_string);
uint16 scroll = (gCurrentTicks / 2) % string_width;
@@ -1555,7 +1555,7 @@ void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_ele
format_string(park_name, park_text_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void));
}
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 0x1C0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16 string_width = gfx_get_string_width(park_name);
uint16 scroll = (gCurrentTicks / 2) % string_width;
@@ -1814,7 +1814,7 @@ void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* m
format_string(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void));
}
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 0x1C0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16 string_width = gfx_get_string_width(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char));
uint16 scroll = (gCurrentTicks / 2) % string_width;
@@ -2349,7 +2349,7 @@ static void viewport_draw_money_effects()
do {
format_string(buffer, ps->string_id, &ps->args);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = FONT_SPRITE_BASE_MEDIUM;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
bool forceSpriteFont = false;
const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format];

View File

@@ -754,7 +754,7 @@ static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widg
// fill it when checkbox is pressed
if (widget_is_pressed(w, widgetIndex)) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
gfx_draw_string(dpi, (char*)CheckBoxMarkString, colour & 0x7F, l, yMid - 5);
}
}
@@ -807,7 +807,7 @@ static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, int widget
r--;
b--;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, sint16) = 0xE0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
// Horizontal scrollbar
if (scroll->flags & HSCROLLBAR_VISIBLE)
@@ -1163,8 +1163,8 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, int widg
//gfx_fill_rect_inset(dpi, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00));
gfx_fill_rect_inset(dpi, l, t, r, b, colour, 0x60);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_FLAGS, uint16) = 0;
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
gCurrentFontFlags = 0;
if (!active) {