Commit e21dd50c authored by Brad Parker's avatar Brad Parker
Browse files

correct memory and GL errors, fixes #7

parent 6c2f07fe
......@@ -397,6 +397,12 @@ CFLAGS += -DINLINE="inline"
CXXFLAGS += -DINLINE="inline"
endif
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) $(CFLAGS)
CXXFLAGS := -fsanitize=$(SANITIZER) $(CXXFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
ifeq ($(DEBUG), 1)
CPUOPTS += -O0 -g
CPUOPTS += -DOPENGL_DEBUG
......
......@@ -40,7 +40,7 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
static bool fb_ready = false;
static bool init_program_now = false;
static bool init_program_now = true;
static void context_reset(void)
{
......
......@@ -467,7 +467,7 @@ static uintptr_t gen_wireframe_buffer(float x, float y, float z, float n)
static uintptr_t gen_water_buffer(float x, float y, float z, float n)
{
float data[108];
float data[120];
float ao[6][4] = {0};
float light[6][4] = {
{0.5, 0.5, 0.5, 0.5},
......@@ -483,7 +483,7 @@ static uintptr_t gen_water_buffer(float x, float y, float z, float n)
0, 0, 255, 0, 0, 0,
x, y - n, z, n);
make_cube_faces(
data + 54, ao, light,
data + 60, ao, light,
0, 0, 0, 1, 0, 0,
0, 0, 0, 255, 0, 0,
x, y + n, z, n);
......@@ -2668,7 +2668,7 @@ static void main_set_db_path(void)
const char *dir = NULL;
Model *g = (Model*)&model;
if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir)
if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir && *dir)
{
#ifdef _WIN32
char slash = '\\';
......
......@@ -433,7 +433,7 @@ void render_shader_program(struct shader_program_info *info)
glUniform1f(info->attrib->extra3, info->extra3.data);
if (info->extra4.enable)
glUniform1f(info->attrib->extra4, info->extra4.data);
glUniform1i(info->attrib->extra4, info->extra4.data);
if (info->timer.enable)
glUniform1f(info->attrib->timer, info->timer.data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment