mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Add config option to change polygon offset values
This commit is contained in:
parent
cbbd5d17de
commit
ef46331c39
|
@ -35,6 +35,11 @@ void Config::resetToDefaults()
|
||||||
generalEmulation.enableHWLighting = 0;
|
generalEmulation.enableHWLighting = 0;
|
||||||
generalEmulation.enableCustomSettings = 1;
|
generalEmulation.enableCustomSettings = 1;
|
||||||
generalEmulation.hacks = 0;
|
generalEmulation.hacks = 0;
|
||||||
|
#ifdef ANDROID
|
||||||
|
generalEmulation.forcePolygonOffset = 0;
|
||||||
|
generalEmulation.polygonOffsetFactor = 0.0f;
|
||||||
|
generalEmulation.polygonOffsetUnits = 0.0f;
|
||||||
|
#endif
|
||||||
|
|
||||||
frameBufferEmulation.enable = 1;
|
frameBufferEmulation.enable = 1;
|
||||||
frameBufferEmulation.copyDepthToRDRAM = 1;
|
frameBufferEmulation.copyDepthToRDRAM = 1;
|
||||||
|
|
|
@ -45,6 +45,11 @@ struct Config
|
||||||
u32 enableHWLighting;
|
u32 enableHWLighting;
|
||||||
u32 enableCustomSettings;
|
u32 enableCustomSettings;
|
||||||
u32 hacks;
|
u32 hacks;
|
||||||
|
#ifdef ANDROID
|
||||||
|
u32 forcePolygonOffset;
|
||||||
|
f32 polygonOffsetFactor;
|
||||||
|
f32 polygonOffsetUnits;
|
||||||
|
#endif
|
||||||
} generalEmulation;
|
} generalEmulation;
|
||||||
|
|
||||||
enum Aspect {
|
enum Aspect {
|
||||||
|
|
|
@ -1298,8 +1298,14 @@ void OGLRender::_initStates()
|
||||||
glDisable( GL_POLYGON_OFFSET_FILL );
|
glDisable( GL_POLYGON_OFFSET_FILL );
|
||||||
glDepthFunc( GL_ALWAYS );
|
glDepthFunc( GL_ALWAYS );
|
||||||
glDepthMask( FALSE );
|
glDepthMask( FALSE );
|
||||||
} else
|
} else {
|
||||||
glPolygonOffset( -3.0f, -3.0f );
|
#ifdef ANDROID
|
||||||
|
if(config.generalEmulation.forcePolygonOffset != 0)
|
||||||
|
glPolygonOffset(config.generalEmulation.polygonOffsetFactor, config.generalEmulation.polygonOffsetUnits);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
glPolygonOffset(-3.0f, -3.0f);
|
||||||
|
}
|
||||||
|
|
||||||
OGLVideo & ogl = video();
|
OGLVideo & ogl = video();
|
||||||
glViewport(0, ogl.getHeightOffset(), ogl.getScreenWidth(), ogl.getScreenHeight());
|
glViewport(0, ogl.getHeightOffset(), ogl.getScreenWidth(), ogl.getScreenHeight());
|
||||||
|
|
|
@ -66,6 +66,14 @@ bool Config_SetDefault()
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableHWLighting", config.generalEmulation.enableHWLighting, "Enable hardware per-pixel lighting.");
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableHWLighting", config.generalEmulation.enableHWLighting, "Enable hardware per-pixel lighting.");
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
#ifdef ANDROID
|
||||||
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "ForcePolygonOffset", config.generalEmulation.forcePolygonOffset, "If true, use polygon offset values specified below");
|
||||||
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
res = ConfigSetDefaultFloat(g_configVideoGliden64, "PolygonOffsetFactor", config.generalEmulation.polygonOffsetFactor, "Specifies a scale factor that is used to create a variable depth offset for each polygon");
|
||||||
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
res = ConfigSetDefaultFloat(g_configVideoGliden64, "PolygonOffsetUnits", config.generalEmulation.polygonOffsetUnits, "Is multiplied by an implementation-specific value to create a constant depth offset");
|
||||||
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
#endif
|
||||||
//#Frame Buffer Settings:"
|
//#Frame Buffer Settings:"
|
||||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFBEmulation", config.frameBufferEmulation.enable, "Enable frame and|or depth buffer emulation.");
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFBEmulation", config.frameBufferEmulation.enable, "Enable frame and|or depth buffer emulation.");
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
@ -173,6 +181,11 @@ void Config_LoadConfig()
|
||||||
config.generalEmulation.enableNoise = ConfigGetParamBool(g_configVideoGliden64, "EnableNoise");
|
config.generalEmulation.enableNoise = ConfigGetParamBool(g_configVideoGliden64, "EnableNoise");
|
||||||
config.generalEmulation.enableLOD = ConfigGetParamBool(g_configVideoGliden64, "EnableLOD");
|
config.generalEmulation.enableLOD = ConfigGetParamBool(g_configVideoGliden64, "EnableLOD");
|
||||||
config.generalEmulation.enableHWLighting = ConfigGetParamBool(g_configVideoGliden64, "EnableHWLighting");
|
config.generalEmulation.enableHWLighting = ConfigGetParamBool(g_configVideoGliden64, "EnableHWLighting");
|
||||||
|
#ifdef ANDROID
|
||||||
|
config.generalEmulation.forcePolygonOffset = ConfigGetParamBool(g_configVideoGliden64, "ForcePolygonOffset");
|
||||||
|
config.generalEmulation.polygonOffsetFactor = ConfigGetParamFloat(g_configVideoGliden64, "PolygonOffsetFactor");
|
||||||
|
config.generalEmulation.polygonOffsetUnits = ConfigGetParamFloat(g_configVideoGliden64, "PolygonOffsetUnits");
|
||||||
|
#endif
|
||||||
//#Frame Buffer Settings:"
|
//#Frame Buffer Settings:"
|
||||||
config.frameBufferEmulation.enable = ConfigGetParamBool(g_configVideoGliden64, "EnableFBEmulation");
|
config.frameBufferEmulation.enable = ConfigGetParamBool(g_configVideoGliden64, "EnableFBEmulation");
|
||||||
config.frameBufferEmulation.copyToRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyColorToRDRAM");
|
config.frameBufferEmulation.copyToRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyColorToRDRAM");
|
||||||
|
|
|
@ -18,9 +18,11 @@ ptr_ConfigDeleteSection ConfigDeleteSection = NULL;
|
||||||
ptr_ConfigSaveSection ConfigSaveSection = NULL;
|
ptr_ConfigSaveSection ConfigSaveSection = NULL;
|
||||||
ptr_ConfigSaveFile ConfigSaveFile = NULL;
|
ptr_ConfigSaveFile ConfigSaveFile = NULL;
|
||||||
ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL;
|
ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL;
|
||||||
|
ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL;
|
||||||
ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL;
|
ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL;
|
||||||
ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL;
|
ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL;
|
||||||
ptr_ConfigGetParamInt ConfigGetParamInt = NULL;
|
ptr_ConfigGetParamInt ConfigGetParamInt = NULL;
|
||||||
|
ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL;
|
||||||
ptr_ConfigGetParamBool ConfigGetParamBool = NULL;
|
ptr_ConfigGetParamBool ConfigGetParamBool = NULL;
|
||||||
ptr_ConfigGetParamString ConfigGetParamString = NULL;
|
ptr_ConfigGetParamString ConfigGetParamString = NULL;
|
||||||
|
|
||||||
|
@ -51,9 +53,11 @@ m64p_error PluginAPI::PluginStartup(m64p_dynlib_handle _CoreLibHandle)
|
||||||
ConfigSaveSection = (ptr_ConfigSaveSection)DLSYM(_CoreLibHandle, "ConfigSaveSection");
|
ConfigSaveSection = (ptr_ConfigSaveSection)DLSYM(_CoreLibHandle, "ConfigSaveSection");
|
||||||
ConfigSaveFile = (ptr_ConfigSaveFile)DLSYM(_CoreLibHandle, "ConfigSaveFile");
|
ConfigSaveFile = (ptr_ConfigSaveFile)DLSYM(_CoreLibHandle, "ConfigSaveFile");
|
||||||
ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt)DLSYM(_CoreLibHandle, "ConfigSetDefaultInt");
|
ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt)DLSYM(_CoreLibHandle, "ConfigSetDefaultInt");
|
||||||
|
ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat)DLSYM(_CoreLibHandle, "ConfigSetDefaultFloat");
|
||||||
ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool)DLSYM(_CoreLibHandle, "ConfigSetDefaultBool");
|
ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool)DLSYM(_CoreLibHandle, "ConfigSetDefaultBool");
|
||||||
ConfigSetDefaultString = (ptr_ConfigSetDefaultString)DLSYM(_CoreLibHandle, "ConfigSetDefaultString");
|
ConfigSetDefaultString = (ptr_ConfigSetDefaultString)DLSYM(_CoreLibHandle, "ConfigSetDefaultString");
|
||||||
ConfigGetParamInt = (ptr_ConfigGetParamInt)DLSYM(_CoreLibHandle, "ConfigGetParamInt");
|
ConfigGetParamInt = (ptr_ConfigGetParamInt)DLSYM(_CoreLibHandle, "ConfigGetParamInt");
|
||||||
|
ConfigGetParamFloat = (ptr_ConfigGetParamFloat)DLSYM(_CoreLibHandle, "ConfigGetParamFloat");
|
||||||
ConfigGetParamBool = (ptr_ConfigGetParamBool)DLSYM(_CoreLibHandle, "ConfigGetParamBool");
|
ConfigGetParamBool = (ptr_ConfigGetParamBool)DLSYM(_CoreLibHandle, "ConfigGetParamBool");
|
||||||
ConfigGetParamString = (ptr_ConfigGetParamString)DLSYM(_CoreLibHandle, "ConfigGetParamString");
|
ConfigGetParamString = (ptr_ConfigGetParamString)DLSYM(_CoreLibHandle, "ConfigGetParamString");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user