[Glide64] Reset more variables in free_combiners
This commit is contained in:
parent
a0d5ef0cda
commit
32b55761e8
|
@ -60,7 +60,6 @@ float lambda_color[2][4];
|
|||
int need_to_compile;
|
||||
|
||||
static GLuint g_program_object_default = 0;
|
||||
static GLuint rotation_matrix_location;
|
||||
static int constant_color_location;
|
||||
static int ccolor0_location;
|
||||
static int ccolor1_location;
|
||||
|
@ -314,7 +313,6 @@ void init_combiner()
|
|||
|
||||
int texture0_location;
|
||||
int texture1_location;
|
||||
int log_length;
|
||||
|
||||
// default shader
|
||||
std::string fragment_shader = g_fragment_shader_header;
|
||||
|
@ -490,7 +488,7 @@ void compile_shader()
|
|||
{
|
||||
need_to_compile = 0;
|
||||
|
||||
for (int i = 0; i < g_shader_programs.size(); i++)
|
||||
for (size_t i = 0; i < g_shader_programs.size(); i++)
|
||||
{
|
||||
shader_program_key & prog = g_shader_programs[i];
|
||||
if (prog.color_combiner == color_combiner_key &&
|
||||
|
@ -604,12 +602,57 @@ void free_combiners()
|
|||
glDeleteProgram(g_program_object_default);
|
||||
g_program_object_default = 0;
|
||||
}
|
||||
for (int i = 0; i < g_shader_programs.size(); i++)
|
||||
for (size_t i = 0; i < g_shader_programs.size(); i++)
|
||||
{
|
||||
glDeleteProgram(g_shader_programs[i].program_object);
|
||||
g_shader_programs[i].program_object = 0;
|
||||
}
|
||||
g_shader_programs.clear();
|
||||
|
||||
g_alpha_ref = 0;
|
||||
g_alpha_func = 0;
|
||||
g_alpha_test = 0;
|
||||
|
||||
memset(g_texture_env_color, 0, sizeof(g_texture_env_color));
|
||||
memset(g_ccolor0, 0, sizeof(g_ccolor0));
|
||||
memset(g_ccolor1, 0, sizeof(g_ccolor1));
|
||||
memset(g_chroma_color, 0, sizeof(g_chroma_color));
|
||||
g_fog_enabled = 0;
|
||||
g_chroma_enabled = false;
|
||||
chroma_other_color = 0;
|
||||
chroma_other_alpha = 0;
|
||||
dither_enabled = 0;
|
||||
blackandwhite0 = 0;
|
||||
blackandwhite1 = 0;
|
||||
|
||||
fogStart = 0.0f;
|
||||
fogEnd = 0.0f;
|
||||
for (int i = 0; i < (sizeof(fogColor) / sizeof(fogColor[0])); i++)
|
||||
{
|
||||
fogColor[i] = 0.0f;
|
||||
}
|
||||
memset(need_lambda, 0, sizeof(need_lambda));
|
||||
for (int i = 0; i < (sizeof(lambda_color) / sizeof(lambda_color[0])); i++)
|
||||
{
|
||||
for (int z = 0; z < (sizeof(lambda_color[i]) / sizeof(lambda_color[i][0])); z++)
|
||||
{
|
||||
lambda_color[i][z] = 0.0f;
|
||||
}
|
||||
}
|
||||
need_to_compile = 0;
|
||||
|
||||
g_program_object_default = 0;
|
||||
constant_color_location = 0;
|
||||
ccolor0_location = 0;
|
||||
ccolor1_location = 0;
|
||||
first_color = 1;
|
||||
first_alpha = 1;
|
||||
first_texture0 = 1;
|
||||
first_texture1 = 1;
|
||||
tex0_combiner_ext = 0;
|
||||
tex1_combiner_ext = 0;
|
||||
c_combiner_ext = 0;
|
||||
a_combiner_ext = 0;
|
||||
}
|
||||
|
||||
void set_copy_shader()
|
||||
|
@ -1516,12 +1559,6 @@ GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
|
|||
}
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
||||
/*
|
||||
if (blend_func_separate_support)
|
||||
glBlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
||||
else
|
||||
glBlendFunc(sfactorRGB, dfactorRGB);
|
||||
*/
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
|
|
|
@ -57,10 +57,6 @@ static int vertex_buffer_count = 0;
|
|||
static GLenum vertex_draw_mode;
|
||||
static bool vertex_buffer_enabled = false;
|
||||
|
||||
void vbo_init()
|
||||
{
|
||||
}
|
||||
|
||||
void vbo_draw()
|
||||
{
|
||||
if (vertex_buffer_count)
|
||||
|
@ -152,8 +148,6 @@ void init_geometry()
|
|||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
vbo_init();
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
|
@ -324,47 +318,6 @@ grDepthMask(FxBool mask)
|
|||
glDepthMask(mask);
|
||||
}
|
||||
float biasFactor = 0;
|
||||
#if 0
|
||||
void FindBestDepthBias()
|
||||
{
|
||||
float f, bestz = 0.25f;
|
||||
int x;
|
||||
if (biasFactor) return;
|
||||
biasFactor = 64.0f; // default value
|
||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
glDrawBuffer(GL_BACK);
|
||||
glReadBuffer(GL_BACK);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glColor4ub(255, 255, 255, 255);
|
||||
glDepthMask(GL_TRUE);
|
||||
for (x = 0, f = 1.0f; f <= 65536.0f; x += 4, f *= 2.0f) {
|
||||
float z;
|
||||
glPolygonOffset(0, f);
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glVertex3f(float(x + 4 - widtho) / (width / 2), float(0 - heighto) / (height / 2), 0.5);
|
||||
glVertex3f(float(x - widtho) / (width / 2), float(0 - heighto) / (height / 2), 0.5);
|
||||
glVertex3f(float(x + 4 - widtho) / (width / 2), float(4 - heighto) / (height / 2), 0.5);
|
||||
glVertex3f(float(x - widtho) / (width / 2), float(4 - heighto) / (height / 2), 0.5);
|
||||
glEnd();
|
||||
glReadPixels(x + 2, 2 + g_viewport_offset, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z);
|
||||
z -= 0.75f + 8e-6f;
|
||||
if (z < 0.0f) z = -z;
|
||||
if (z > 0.01f) continue;
|
||||
if (z < bestz) {
|
||||
bestz = z;
|
||||
biasFactor = f;
|
||||
}
|
||||
//printf("f %g z %g\n", f, z);
|
||||
}
|
||||
//printf(" --> bias factor %g\n", biasFactor);
|
||||
glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grDepthBiasLevel(FxI32 level)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue