Skip to content

Commit

Permalink
Moved rdp_frame_buffer to screen.h, renamed to frame_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ata4 committed Aug 25, 2018
1 parent e44fbf1 commit 37fc912
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/core/n64video.h
Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions src/core/screen.h
Expand Up @@ -5,10 +5,18 @@
#include <stdint.h>
#include <stdbool.h>

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);
Expand Down
4 changes: 2 additions & 2 deletions src/core/vi/vi.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/common/gl_screen.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/plugin/common/gl_screen.h
@@ -1,13 +1,14 @@
#pragma once

#include "core/n64video.h"
#include "core/screen.h"

#include <stdint.h>
#include <stdbool.h>

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);
2 changes: 1 addition & 1 deletion src/plugin/mupen64plus/gfx_m64p.c
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/mupen64plus/screen.c
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/zilmar/gfx_1.3.c
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/zilmar/screen.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 37fc912

Please sign in to comment.