Skip to content

Commit

Permalink
Reintroduce CGP refactor.
Browse files Browse the repository at this point in the history
Fix several issues that caused crashes.
  • Loading branch information
Themaister committed Apr 6, 2013
1 parent c3ac302 commit e649db2
Show file tree
Hide file tree
Showing 15 changed files with 733 additions and 505 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -23,6 +23,7 @@ OBJ = frontend/frontend.o \
conf/config_file.o \
screenshot.o \
gfx/scaler/scaler.o \
gfx/shader_parse.o \
gfx/scaler/pixconv.o \
gfx/scaler/scaler_int.o \
gfx/scaler/filter.o \
Expand Down
1 change: 1 addition & 0 deletions Makefile.win
Expand Up @@ -29,6 +29,7 @@ OBJ = frontend/frontend.o \
gfx/scaler/scaler_int.o \
gfx/scaler/filter.o \
gfx/state_tracker.o \
gfx/shader_parse.o \
gfx/fonts/fonts.o \
gfx/fonts/bitmapfont.o \
gfx/image.o \
Expand Down
7 changes: 7 additions & 0 deletions conf/config_file.c
Expand Up @@ -696,6 +696,13 @@ void config_set_int(config_file_t *conf, const char *key, int val)
config_set_string(conf, key, buf);
}

void config_set_hex(config_file_t *conf, const char *key, unsigned val)
{
char buf[128];
snprintf(buf, sizeof(buf), "%x", val);
config_set_string(conf, key, buf);
}

void config_set_uint64(config_file_t *conf, const char *key, uint64_t val)
{
char buf[128];
Expand Down
1 change: 1 addition & 0 deletions conf/config_file.h
Expand Up @@ -92,6 +92,7 @@ bool config_get_bool(config_file_t *conf, const char *entry, bool *in);
void config_set_double(config_file_t *conf, const char *entry, double value);
void config_set_float(config_file_t *conf, const char *entry, float value);
void config_set_int(config_file_t *conf, const char *entry, int val);
void config_set_hex(config_file_t *conf, const char *entry, unsigned val);
void config_set_uint64(config_file_t *conf, const char *entry, uint64_t val);
void config_set_char(config_file_t *conf, const char *entry, char val);
void config_set_string(config_file_t *conf, const char *entry, const char *val);
Expand Down
4 changes: 2 additions & 2 deletions gfx/gl.c
Expand Up @@ -439,7 +439,7 @@ static bool gl_shader_filter_type(void *data, unsigned index, bool *smooth)
}

#ifdef HAVE_FBO
static void gl_shader_scale(void *data, unsigned index, struct gl_fbo_scale *scale)
static void gl_shader_scale(void *data, unsigned index, struct gfx_fbo_scale *scale)
{
gl_t *gl = (gl_t*)data;

Expand Down Expand Up @@ -674,7 +674,7 @@ void gl_init_fbo(void *data, unsigned width, unsigned height)
return;
#endif

struct gl_fbo_scale scale, scale_last;
struct gfx_fbo_scale scale, scale_last;
gl_shader_scale(gl, 1, &scale);
gl_shader_scale(gl, gl_shader_num_func(gl), &scale_last);

Expand Down
22 changes: 2 additions & 20 deletions gfx/gl_common.h
Expand Up @@ -22,6 +22,7 @@
#include "gfx_context.h"
#include "scaler/scaler.h"
#include "fonts/gl_font.h"
#include "shader_parse.h"

#ifdef HAVE_CONFIG_H
#include "../config.h"
Expand Down Expand Up @@ -160,25 +161,6 @@ struct gl_fbo_rect
unsigned height;
};

enum gl_scale_type
{
RARCH_SCALE_ABSOLUTE,
RARCH_SCALE_INPUT,
RARCH_SCALE_VIEWPORT
};

struct gl_fbo_scale
{
bool fp_fbo;
enum gl_scale_type type_x;
enum gl_scale_type type_y;
float scale_x;
float scale_y;
unsigned abs_x;
unsigned abs_y;
bool valid;
};

struct gl_ortho
{
GLfloat left;
Expand Down Expand Up @@ -239,7 +221,7 @@ typedef struct gl
GLuint fbo[MAX_SHADERS];
GLuint fbo_texture[MAX_SHADERS];
struct gl_fbo_rect fbo_rect[MAX_SHADERS];
struct gl_fbo_scale fbo_scale[MAX_SHADERS];
struct gfx_fbo_scale fbo_scale[MAX_SHADERS];
int fbo_pass;
bool fbo_inited;

Expand Down

0 comments on commit e649db2

Please sign in to comment.