From 6386a308a710196b573e16a6a28ca8d08d2a40c0 Mon Sep 17 00:00:00 2001 From: "Michael J. Manley" Date: Sat, 30 Nov 2024 18:20:01 -0800 Subject: [PATCH] Renamed BITMAP to VIDEO_BITMAP to hopefully fix Windows Building. --- includes/private/video/video.h | 12 ++++++------ includes/private/wx-ui/wx-sdl2-video.h | 2 +- src/video/video.c | 2 +- src/wx-ui/wx-sdl2-video-gl3.c | 2 +- src/wx-ui/wx-sdl2-video-renderer.c | 2 +- src/wx-ui/wx-sdl2-video.c | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/includes/private/video/video.h b/includes/private/video/video.h index 01bd5f8f..bc0dd8ac 100644 --- a/includes/private/video/video.h +++ b/includes/private/video/video.h @@ -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; @@ -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); @@ -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]; diff --git a/includes/private/wx-ui/wx-sdl2-video.h b/includes/private/wx-ui/wx-sdl2-video.h index 7c2dd7b9..c6f20539 100644 --- a/includes/private/wx-ui/wx-sdl2-video.h +++ b/includes/private/wx-ui/wx-sdl2-video.h @@ -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; diff --git a/src/video/video.c b/src/video/video.c index 920d04ed..823f66bf 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -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]; diff --git a/src/wx-ui/wx-sdl2-video-gl3.c b/src/wx-ui/wx-sdl2-video-gl3.c index 836e78fb..55233586 100644 --- a/src/wx-ui/wx-sdl2-video-gl3.c +++ b/src/wx-ui/wx-sdl2-video-gl3.c @@ -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); diff --git a/src/wx-ui/wx-sdl2-video-renderer.c b/src/wx-ui/wx-sdl2-video-renderer.c index 9b6aa466..02bb281e 100644 --- a/src/wx-ui/wx-sdl2-video-renderer.c +++ b/src/wx-ui/wx-sdl2-video-renderer.c @@ -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); } diff --git a/src/wx-ui/wx-sdl2-video.c b/src/wx-ui/wx-sdl2-video.c index 6f192da4..c13333a1 100644 --- a/src/wx-ui/wx-sdl2-video.c +++ b/src/wx-ui/wx-sdl2-video.c @@ -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; @@ -45,7 +45,7 @@ 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; @@ -53,10 +53,10 @@ void hline(BITMAP *b, int x1, int y, int x2, int col) { ((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++) {