Skip to content

Commit

Permalink
Renamed BITMAP to VIDEO_BITMAP to hopefully fix Windows Building.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-manley committed Dec 1, 2024
1 parent f31af14 commit 6386a30
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions includes/private/video/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ typedef struct {
int w, h;
uint8_t *dat;
uint8_t *line[0];
} BITMAP;
} VIDEO_BITMAP;

extern BITMAP *screen;
extern VIDEO_BITMAP *screen;

BITMAP *create_bitmap(int w, int h);
VIDEO_BITMAP *create_bitmap(int w, int h);

typedef struct {
uint8_t r, g, b;
Expand All @@ -20,7 +20,7 @@ typedef RGB PALETTE[256];
#define makecol(r, g, b) ((b) | ((g) << 8) | ((r) << 16))
#define makecol32(r, g, b) ((b) | ((g) << 8) | ((r) << 16))

extern BITMAP *buffer32;
extern VIDEO_BITMAP *buffer32;

int video_card_available(int card);
char *video_card_getname(int card);
Expand Down Expand Up @@ -99,9 +99,9 @@ void closevideo();

void video_updatetiming();

void hline(BITMAP *b, int x1, int y, int x2, int col);
void hline(VIDEO_BITMAP *b, int x1, int y, int x2, int col);

void destroy_bitmap(BITMAP *b);
void destroy_bitmap(VIDEO_BITMAP *b);

extern uint32_t cgapal[16];

Expand Down
2 changes: 1 addition & 1 deletion includes/private/wx-ui/wx-sdl2-video.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct sdl_render_driver;
typedef struct sdl_renderer_t {
int (*init)(SDL_Window *window, struct sdl_render_driver driver, SDL_Rect screen);
void (*close)();
void (*update)(SDL_Window *window, SDL_Rect updated_rect, BITMAP *screen);
void (*update)(SDL_Window *window, SDL_Rect updated_rect, VIDEO_BITMAP *screen);
void (*present)(SDL_Window *window, SDL_Rect texture_rect, SDL_Rect window_rect, SDL_Rect screen);
int always_update;
} sdl_renderer_t;
Expand Down
2 changes: 1 addition & 1 deletion src/video/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ void video_init() {
device_add(video_cards[video_old_to_new(gfxcard)]->device);
}

BITMAP *buffer32;
VIDEO_BITMAP *buffer32;

uint8_t fontdat[2048][8];
uint8_t fontdatm[2048][16];
Expand Down
2 changes: 1 addition & 1 deletion src/wx-ui/wx-sdl2-video-gl3.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ void gl3_close() {
glw_free(glw);
}

void gl3_update(SDL_Window *window, SDL_Rect updated_rect, BITMAP *screen) {
void gl3_update(SDL_Window *window, SDL_Rect updated_rect, VIDEO_BITMAP *screen) {
if (!context)
return;
glBindTexture(GL_TEXTURE_2D, scene_texture.id);
Expand Down
2 changes: 1 addition & 1 deletion src/wx-ui/wx-sdl2-video-renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void sdl_video_renderer_close() {
}
}

void sdl_video_renderer_update(SDL_Window *window, SDL_Rect updated_rect, BITMAP *screen) {
void sdl_video_renderer_update(SDL_Window *window, SDL_Rect updated_rect, VIDEO_BITMAP *screen) {
SDL_UpdateTexture(texture, &updated_rect, &((uint32_t *)screen->dat)[updated_rect.y * screen->w + updated_rect.x],
screen->w * 4);
}
Expand Down
12 changes: 6 additions & 6 deletions src/wx-ui/wx-sdl2-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

void video_blit_complete();

BITMAP *screen;
static BITMAP *screen_copy = NULL;
VIDEO_BITMAP *screen;
static VIDEO_BITMAP *screen_copy = NULL;
static SDL_Rect screen_rect;
static SDL_Rect updated_rect;
static SDL_Rect updated_rect_copy;
Expand Down Expand Up @@ -45,18 +45,18 @@ sdl_render_driver requested_render_driver;
char current_render_driver_name[50];
static sdl_renderer_t *renderer = NULL;

void hline(BITMAP *b, int x1, int y, int x2, int col) {
void hline(VIDEO_BITMAP *b, int x1, int y, int x2, int col) {
if (y < 0 || y >= buffer32->h)
return;

for (; x1 < x2; x1++)
((uint32_t *)b->line[y])[x1] = col;
}

void destroy_bitmap(BITMAP *b) { free(b); }
void destroy_bitmap(VIDEO_BITMAP *b) { free(b); }

BITMAP *create_bitmap(int x, int y) {
BITMAP *b = malloc(sizeof(BITMAP) + (y * sizeof(uint8_t *)));
VIDEO_BITMAP *create_bitmap(int x, int y) {
VIDEO_BITMAP *b = malloc(sizeof(VIDEO_BITMAP) + (y * sizeof(uint8_t *)));
int c;
b->dat = malloc(x * y * 4);
for (c = 0; c < y; c++) {
Expand Down

0 comments on commit 6386a30

Please sign in to comment.