Permalink
Browse files

front: Add setting to disable polygon-offset hack.

  • Loading branch information...
littleguy77 committed Jan 11, 2015
1 parent d3eba6f commit 1a33142fb3a5cff60b5642976a7d4e7af279c156
View
@@ -192,6 +192,7 @@
<!-- Hardware Profile List -->
<string-array name="videoHardwareType_entries" translatable="false">
+ <item>@string/videoHardwareType_entryDisableHack</item>
<item>@string/videoHardwareType_entryAuto</item>
<item>@string/videoHardwareType_entryStandard</item>
<item>@string/videoHardwareType_entryI</item>
@@ -202,6 +203,7 @@
<item>@string/videoHardwareType_entryCustom</item>
</string-array>
<string-array name="videoHardwareType_values" translatable="false">
+ <item>-2</item>
<item>-1</item>
<item>0</item>
<item>4</item>
View
@@ -299,6 +299,7 @@
<string name="videoPlugin_entryGlide64">glide64\n<small>(adaptation of Glide64 Final (10th Anniversary))</small></string>
<string name="videoHardwareType_title">Flicker reduction</string>
+ <string name="videoHardwareType_entryDisableHack">Disable flicker reduction hack</string>
<string name="videoHardwareType_entryAuto">Auto-detect from phone/tablet model</string>
<string name="videoHardwareType_entryStandard">Standard profile</string>
<string name="videoHardwareType_entryI">I profile</string>
@@ -42,6 +42,7 @@ public static void syncConfigFiles( GamePrefs game, UserPrefs user, AppData appD
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "window height", String.valueOf( user.videoRenderHeight ) );
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "auto frameskip", boolToNum( game.isGln64AutoFrameskipEnabled ) );
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "max frameskip", String.valueOf( game.gln64MaxFrameskip ) );
+ gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "polygon offset hack", boolToNum( user.isPolygonOffsetHackEnabled ) );
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "polygon offset factor", String.valueOf( user.videoPolygonOffset ) );
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "polygon offset units", String.valueOf( user.videoPolygonOffset ) );
gln64_conf.put( ConfigFile.SECTIONLESS_NAME, "enable fog", boolToNum( game.isGln64FogEnabled ) );
@@ -115,13 +116,13 @@ public static void syncConfigFiles( GamePrefs game, UserPrefs user, AppData appD
mupen64plus_cfg.put( "Video-Glide64mk2", "vsync", "False" ); // Vertical sync
mupen64plus_cfg.put( "Video-Glide64mk2", "wrpAnisotropic", "False" ); // Wrapper Anisotropic Filtering
mupen64plus_cfg.put( "Video-Glide64mk2", "fb_read_always", "0" ); // Read framebuffer every frame (may be slow use only for effects that need it e.g. Banjo Kazooie, DK64 transitions)
- mupen64plus_cfg.put( "Video-Glide64mk2", "force_polygon_offset", "1" ); // If true, use polygon offset values specified below
+ mupen64plus_cfg.put( "Video-Glide64mk2", "force_polygon_offset", boolToNum( user.isPolygonOffsetHackEnabled ) ); // If true, use polygon offset values specified below
mupen64plus_cfg.put( "Video-Glide64mk2", "polygon_offset_factor", String.valueOf( user.videoPolygonOffset ) ); // Specifies a scale factor that is used to create a variable depth offset for each polygon
mupen64plus_cfg.put( "Video-Glide64mk2", "polygon_offset_units", String.valueOf( user.videoPolygonOffset ) ); // Is multiplied by an implementation-specific value to create a constant depth offset
mupen64plus_cfg.put( "Video-Glide64mk2", "autoframeskip", boolToNum( game.isGlide64AutoFrameskipEnabled ) );
mupen64plus_cfg.put( "Video-Glide64mk2", "maxframeskip", String.valueOf( game.glide64MaxFrameskip ) );
- mupen64plus_cfg.put( "Video-Rice", "ForcePolygonOffset", "True" ); // If true, use polygon offset values specified below
+ mupen64plus_cfg.put( "Video-Rice", "ForcePolygonOffset", boolToTF( user.isPolygonOffsetHackEnabled ) ); // If true, use polygon offset values specified below
mupen64plus_cfg.put( "Video-Rice", "PolygonOffsetFactor", String.valueOf( user.videoPolygonOffset ) ); // Specifies a scale factor that is used to create a variable depth offset for each polygon
mupen64plus_cfg.put( "Video-Rice", "PolygonOffsetUnits", String.valueOf( user.videoPolygonOffset ) ); // Is multiplied by an implementation-specific value to create a constant depth offset
mupen64plus_cfg.put( "Video-Rice", "ScreenUpdateSetting", game.riceScreenUpdateType ); // Control when the screen will be updated (0=ROM default, 1=VI origin update, 2=VI origin change, 3=CI change, 4=first CI change, 5=first primitive draw, 6=before screen clear, 7=after screen drawn)
@@ -192,6 +192,9 @@
/** True if framelimiter is used. */
public final boolean isFramelimiterEnabled;
+ /** True if Android polygon offset hack is enabled. **/
+ public final boolean isPolygonOffsetHackEnabled;
+
/** The manually-overridden hardware type, used for flicker reduction. */
public final int videoHardwareType;
@@ -319,6 +322,7 @@ public UserPrefs( Context context )
displayFpsRefresh = getSafeInt( mPreferences, "displayFpsRefresh", 0 );
isFpsEnabled = displayFpsRefresh > 0;
int selectedHardwareType = getSafeInt( mPreferences, "videoHardwareType", -1 );
+ isPolygonOffsetHackEnabled = selectedHardwareType > -2;
videoHardwareType = selectedHardwareType < 0 ? appData.hardwareInfo.hardwareType : selectedHardwareType;
switch( videoHardwareType )
{

0 comments on commit 1a33142

Please sign in to comment.