Trying to use the gfx wrap functions.

This commit is contained in:
Duncan Frost 2014-07-09 18:05:34 +01:00
parent 5b02dd09a7
commit 5232fc378b
3 changed files with 10 additions and 1 deletions

View File

@ -64,6 +64,7 @@ extern int gLastDrawStringY;
int gfx_load_g1();
void gfx_load_character_widths();
int gfx_wrap_string(char* buffer, int width, int* num_lines, int* font_height);
void gfx_clear(rct_drawpixelinfo *dpi, int colour);
void gfx_draw_pixel(rct_drawpixelinfo *dpi, int x, int y, int colour);
void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int colour);

View File

@ -250,6 +250,12 @@ static void window_game_bottom_toolbar_tooltip()
tool_tip_index = 0;
break;
}
#ifdef _MSC_VER
__asm mov ax, tool_tip_index
#else
__asm__("mov ax, %[tool_tip_index] " :[tool_tip_index] "+m" (tool_tip_index));
#endif
}
/**

View File

@ -24,6 +24,7 @@
#include "string_ids.h"
#include "widget.h"
#include "window.h"
#include "gfx.h"
enum {
WIDX_BACKGROUND
@ -127,7 +128,8 @@ void window_tooltip_open(rct_window *widgetWindow, int widgetIndex, int x, int y
esi = 0x0141ED68;
edi = ecx + 1;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
RCT2_CALLFUNC_X(0x006C21E2, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
ecx = gfx_wrap_string((char*) 0x0141ED68, ecx + 1, &edi, &ebx);
//RCT2_CALLFUNC_X(0x006C21E2, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
ecx &= 0xFFFF;
edi &= 0xFFFF;