From 37fc9126c45b18578c46eea869013447de418780 Mon Sep 17 00:00:00 2001 From: ata4 Date: Sat, 25 Aug 2018 17:13:43 +0200 Subject: [PATCH] Moved rdp_frame_buffer to screen.h, renamed to frame_buffer --- src/core/n64video.h | 8 -------- src/core/screen.h | 12 ++++++++++-- src/core/vi/vi.c | 4 ++-- src/plugin/common/gl_screen.c | 4 ++-- src/plugin/common/gl_screen.h | 5 +++-- src/plugin/mupen64plus/gfx_m64p.c | 2 +- src/plugin/mupen64plus/screen.c | 4 ++-- src/plugin/zilmar/gfx_1.3.c | 2 +- src/plugin/zilmar/screen.c | 4 ++-- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/core/n64video.h b/src/core/n64video.h index 5c48c17..05bc029 100644 --- a/src/core/n64video.h +++ b/src/core/n64video.h @@ -65,14 +65,6 @@ struct n64video_config uint32_t num_workers; }; -struct rdp_frame_buffer -{ - uint32_t* pixels; - uint32_t width; - uint32_t height; - uint32_t pitch; -}; - void n64video_config_defaults(struct n64video_config* config); void n64video_init(struct n64video_config* config); diff --git a/src/core/screen.h b/src/core/screen.h index 9d5e211..ba6cedc 100644 --- a/src/core/screen.h +++ b/src/core/screen.h @@ -5,10 +5,18 @@ #include #include +struct frame_buffer +{ + uint32_t* pixels; + uint32_t width; + uint32_t height; + uint32_t pitch; +}; + void screen_init(struct n64video_config* config); void screen_swap(bool blank); -void screen_write(struct rdp_frame_buffer* fb, int32_t output_height); -void screen_read(struct rdp_frame_buffer* fb, bool rgb); +void screen_write(struct frame_buffer* fb, int32_t output_height); +void screen_read(struct frame_buffer* fb, bool rgb); void screen_set_fullscreen(bool fullscreen); bool screen_get_fullscreen(void); void screen_toggle_fullscreen(void); diff --git a/src/core/vi/vi.c b/src/core/vi/vi.c index cce1d4d..04115cb 100644 --- a/src/core/vi/vi.c +++ b/src/core/vi/vi.c @@ -451,7 +451,7 @@ static bool vi_process_full(void) } // finish and send buffer to screen - struct rdp_frame_buffer fb; + struct frame_buffer fb; fb.pixels = prescale; fb.pitch = PRESCALE_WIDTH; @@ -583,7 +583,7 @@ static bool vi_process_fast(void) } // finish and send buffer to screen - struct rdp_frame_buffer fb; + struct frame_buffer fb; fb.pixels = prescale; fb.width = hres_raw; fb.height = vres_raw; diff --git a/src/plugin/common/gl_screen.c b/src/plugin/common/gl_screen.c index 2a67f03..4c5e730 100644 --- a/src/plugin/common/gl_screen.c +++ b/src/plugin/common/gl_screen.c @@ -176,7 +176,7 @@ void gl_screen_init(struct n64video_config* config) gl_check_errors(); } -bool gl_screen_write(struct rdp_frame_buffer* fb, int32_t output_height) +bool gl_screen_write(struct frame_buffer* fb, int32_t output_height) { bool buffer_size_changed = tex_width != fb->width || tex_height != fb->height; @@ -205,7 +205,7 @@ bool gl_screen_write(struct rdp_frame_buffer* fb, int32_t output_height) return buffer_size_changed; } -void gl_screen_read(struct rdp_frame_buffer* fb, bool alpha) +void gl_screen_read(struct frame_buffer* fb, bool alpha) { GLint vp[4]; glGetIntegerv(GL_VIEWPORT, vp); diff --git a/src/plugin/common/gl_screen.h b/src/plugin/common/gl_screen.h index f864b99..779f2cc 100644 --- a/src/plugin/common/gl_screen.h +++ b/src/plugin/common/gl_screen.h @@ -1,13 +1,14 @@ #pragma once #include "core/n64video.h" +#include "core/screen.h" #include #include void gl_screen_init(struct n64video_config* config); -bool gl_screen_write(struct rdp_frame_buffer* fb, int32_t output_height); -void gl_screen_read(struct rdp_frame_buffer* fb, bool alpha); +bool gl_screen_write(struct frame_buffer* fb, int32_t output_height); +void gl_screen_read(struct frame_buffer* fb, bool alpha); void gl_screen_render(int32_t win_width, int32_t win_height, int32_t win_x, int32_t win_y); void gl_screen_clear(void); void gl_screen_close(void); diff --git a/src/plugin/mupen64plus/gfx_m64p.c b/src/plugin/mupen64plus/gfx_m64p.c index 12f283a..f881c8c 100644 --- a/src/plugin/mupen64plus/gfx_m64p.c +++ b/src/plugin/mupen64plus/gfx_m64p.c @@ -223,7 +223,7 @@ EXPORT void CALL ChangeWindow(void) EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front) { - struct rdp_frame_buffer fb = { 0 }; + struct frame_buffer fb = { 0 }; screen_read(&fb, false); *width = fb.width; diff --git a/src/plugin/mupen64plus/screen.c b/src/plugin/mupen64plus/screen.c index 87c233b..619750c 100644 --- a/src/plugin/mupen64plus/screen.c +++ b/src/plugin/mupen64plus/screen.c @@ -82,12 +82,12 @@ void screen_swap(bool blank) CoreVideo_GL_SwapBuffers(); } -void screen_write(struct rdp_frame_buffer* buffer, int32_t output_height) +void screen_write(struct frame_buffer* buffer, int32_t output_height) { gl_screen_write(buffer, output_height); } -void screen_read(struct rdp_frame_buffer* buffer, bool alpha) +void screen_read(struct frame_buffer* buffer, bool alpha) { gl_screen_read(buffer, alpha); } diff --git a/src/plugin/zilmar/gfx_1.3.c b/src/plugin/zilmar/gfx_1.3.c index 33d6c01..d0ef401 100644 --- a/src/plugin/zilmar/gfx_1.3.c +++ b/src/plugin/zilmar/gfx_1.3.c @@ -18,7 +18,7 @@ GFX_INFO gfx; static void write_screenshot(char* path) { - struct rdp_frame_buffer fb = { 0 }; + struct frame_buffer fb = { 0 }; screen_read(&fb, true); // prepare bitmap headers diff --git a/src/plugin/zilmar/screen.c b/src/plugin/zilmar/screen.c index 552470a..7ae3914 100644 --- a/src/plugin/zilmar/screen.c +++ b/src/plugin/zilmar/screen.c @@ -148,12 +148,12 @@ void screen_init(struct n64video_config* config) gl_screen_init(config); } -void screen_write(struct rdp_frame_buffer* buffer, int32_t output_height) +void screen_write(struct frame_buffer* buffer, int32_t output_height) { gl_screen_write(buffer, output_height); } -void screen_read(struct rdp_frame_buffer* buffer, bool alpha) +void screen_read(struct frame_buffer* buffer, bool alpha) { gl_screen_read(buffer, alpha); }