Merge branch 'gfx_unstable'

This commit is contained in:
IntelOrca 2014-06-10 23:08:07 +01:00
commit f83ca084cf
6 changed files with 1514 additions and 74 deletions

View File

@ -249,6 +249,7 @@
#define RCT2_ADDRESS_NEWS_ITEM_LIST 0x013CA754
#define RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE 0x013CE950
#define RCT2_ADDRESS_CURRENT_FONT_FLAGS 0x013CE9A2
#define RCT2_ADDRESS_TILE_MAP_ELEMENT_POINTERS 0x013CE9A4
#define RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT 0x0141E9AC
@ -257,6 +258,8 @@
#define RCT2_ADDRESS_GAME_COMMAND_ERROR_STRING_ID 0x0141E9AE
#define RCT2_ADDRESS_CURRENT_ROTATION 0x0141E9E0
#define RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER 0x0141ED68
#define RCT2_ADDRESS_WATER_RAISE_COST 0x0141F738
#define RCT2_ADDRESS_WATER_LOWER_COST 0x0141F73C
@ -357,6 +360,24 @@ static void RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _edx,
#endif
}
static void RCT2_CALLPROC_X_EBPSAFE(int address, int _eax, int _ebx, int _ecx, int _edx, int _esi, int _edi, int _ebp)
{
__asm {
push ebp
push address
mov eax, _eax
mov ebx, _ebx
mov ecx, _ecx
mov edx, _edx
mov esi, _esi
mov edi, _edi
mov ebp, _ebp
call[esp]
add esp, 4
pop ebp
}
}
static void RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, int *_edx, int *_esi, int *_edi, int *_ebp)
{
#ifdef _MSC_VER

1532
src/gfx.c

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,18 @@ typedef struct {
sint16 unused; // 0x0E
} rct_g1_element;
enum{
G1_FLAG_BMP = (1 << 0), //No invisible sections
G1_FLAG_RLE_COMPRESSION = (1<<2),
};
enum{
IMAGE_TYPE_NO_BACKGROUND = 0,
IMAGE_TYPE_USE_PALETTE= (1 << 1),
IMAGE_TYPE_MIX_BACKGROUND = (1<<2),
IMAGE_TYPE_UNKNOWN = (1<<3)
};
extern int gLastDrawStringX;
extern int gLastDrawStringY;

View File

@ -40,7 +40,7 @@ unsigned int gLastKeyPressed;
static void osinterface_create_window();
static void osinterface_close_window();
static void osinterface_resize(int width, int height);
static void osinterface_update_palette(char* colours, int start_index, int num_colours);
static SDL_Window *_window;
static SDL_Surface *_surface;
@ -167,7 +167,7 @@ static void osinterface_resize(int width, int height)
gfx_invalidate_screen();
}
static void osinterface_update_palette(char* colours, int start_index, int num_colours)
void osinterface_update_palette(char* colours, int start_index, int num_colours)
{
SDL_Color base[256];
SDL_Surface *surface;
@ -476,4 +476,4 @@ int osinterface_ensure_directory_exists(const char *path)
char osinterface_get_path_separator()
{
return '\\';
}
}

View File

@ -45,6 +45,7 @@ void osinterface_init();
void osinterface_process_messages();
void osinterface_draw();
void osinterface_free();
void osinterface_update_palette(char* colours, int start_index, int num_colours);
int osinterface_open_common_file_dialog(int type, char *title, char *filename, char *filterPattern, char *filterName);
void osinterface_show_messagebox(char* message);

View File

@ -156,6 +156,8 @@ void widget_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
widget_scroll_draw(dpi, w, widgetIndex);
break;
case WWT_CHECKBOX:
widget_checkbox_draw(dpi, w, widgetIndex);
break;
case WWT_24:
widget_checkbox_draw(dpi, w, widgetIndex);
break;
@ -715,7 +717,7 @@ static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widg
}
/**
*
*
* rct2: 0x006EBAD9
*/
static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
@ -736,14 +738,12 @@ static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widg
colour = w->colours[widget->colour];
// checkbox
if (widget->type != WWT_24) {
gfx_fill_rect_inset(dpi, l, t, l + 9, b - 1, colour, 0x60);
gfx_fill_rect_inset(dpi, l, t, l + 9, b - 1, colour, 0x60);
// fill it when checkbox is pressed
if (widget_is_pressed(w, widgetIndex)) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
gfx_draw_string(dpi, (char*)0x009DED72, colour & 0x7F, l, t);
}
// fill it when checkbox is pressed
if (widget_is_pressed(w, widgetIndex)) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
gfx_draw_string(dpi, (char*)0x009DED72, colour & 0x7F, l, t);
}
// draw the text