1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Widgets now use draw_sprite

This commit is contained in:
Duncan Frost
2014-06-21 16:20:05 +01:00
parent 79e52e823a
commit 8bd4e85764
2 changed files with 12 additions and 8 deletions

View File

@@ -70,6 +70,7 @@ void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int c
void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bottom, int colour);
void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, short left, short top, short right, short bottom, int colour, short _si);
void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y);
void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint8* palette_pointer, uint8* unknown_pointer);
void gfx_draw_string(rct_drawpixelinfo *dpi, char *format, int colour, int x, int y);
void gfx_transpose_palette(int pal, unsigned char product);

View File

@@ -22,6 +22,7 @@
#include <memory.h>
#include <stdlib.h>
#include "addresses.h"
#include "gfx.h"
#include "sprites.h"
#include "widget.h"
#include "window.h"
@@ -914,21 +915,23 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
// Draw greyed out (light border bottom right shadow)
colour = w->colours[widget->colour];
colour = RCT2_ADDRESS(0x00141FC4A, uint8)[(colour & 0x7F) * 8] & 0xFF;
RCT2_GLOBAL(0x009ABDA4, uint32) = 0x009DED74;
memset((void*)0x009DED74, colour, 256);
RCT2_GLOBAL(0x009DED74, uint8) = 0;
uint8 palette[256];
memset(palette, colour, 256);
palette[0] = 0;
RCT2_GLOBAL(0x00EDF81C, uint32) = 0x20000000;
image &= 0x7FFFF;
RCT2_CALLPROC_X(0x0067A46E, 0, image, l + 1, t + 1, 0, (int)dpi, 0);
gfx_draw_sprite_palette_set(dpi, image | 0x20000000, l + 1, t + 1, palette, NULL);
// Draw greyed out (dark)
colour = w->colours[widget->colour];
colour = RCT2_ADDRESS(0x00141FC48, uint8)[(colour & 0x7F) * 8] & 0xFF;
RCT2_GLOBAL(0x009ABDA4, uint32) = 0x009DED74;
memset((void*)0x009DED74, colour, 256);
RCT2_GLOBAL(0x009DED74, uint8) = 0;
memset(palette, colour, 256);
palette[0] = 0;
RCT2_GLOBAL(0x00EDF81C, uint32) = 0x20000000;
RCT2_CALLPROC_X(0x0067A46E, 0, image, l, t, 0, (int)dpi, 0);
gfx_draw_sprite_palette_set(dpi, image | 0x20000000, l, t, palette, NULL);
} else {
if (image & 0x80000000) {
// ?