Cocoa Port: Expose the new feature to change the GPU color depth in the UI. (Related to commit 3b37058.)

This commit is contained in:
rogerman 2017-07-18 20:57:55 -07:00
parent 3b37058cbc
commit c3bce87556
5 changed files with 484 additions and 64 deletions

View File

@ -708,6 +708,8 @@
<false/>
<key>Render3D_ScalingFactor</key>
<integer>1</integer>
<key>Render3D_ColorFormat</key>
<integer>536895878</integer>
<key>Render3D_HighPrecisionColorInterpolation</key>
<true/>
<key>Render3D_LineHack</key>

View File

@ -271,6 +271,19 @@ public:
- (void) setGpuColorFormat:(NSUInteger)colorFormat
{
// First check for a valid color format. Abort if the color format is invalid.
switch ((NDSColorFormat)colorFormat)
{
case NDSColorFormat_BGR555_Rev:
case NDSColorFormat_BGR666_Rev:
case NDSColorFormat_BGR888_Rev:
break;
default:
return;
}
// Change the color format.
[[self sharedData] finishAllDisplayViewsAtIndex:0];
[[self sharedData] finishAllDisplayViewsAtIndex:1];

View File

@ -977,6 +977,7 @@
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DTextureSmoothing] forKey:@"Render3D_TextureSmoothing"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DFragmentSamplingHack] forKey:@"Render3D_FragmentSamplingHack"];
[[NSUserDefaults standardUserDefaults] setInteger:[[cdsCore cdsGPU] gpuScale] forKey:@"Render3D_ScalingFactor"];
[[NSUserDefaults standardUserDefaults] setInteger:[[cdsCore cdsGPU] gpuColorFormat] forKey:@"Render3D_ColorFormat"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
@ -2235,6 +2236,7 @@
[[cdsCore cdsGPU] setRender3DTextureSmoothing:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_TextureSmoothing"]];
[[cdsCore cdsGPU] setRender3DFragmentSamplingHack:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_FragmentSamplingHack"]];
[[cdsCore cdsGPU] setGpuScale:(NSUInteger)[[NSUserDefaults standardUserDefaults] integerForKey:@"Render3D_ScalingFactor"]];
[[cdsCore cdsGPU] setGpuColorFormat:(NSUInteger)[[NSUserDefaults standardUserDefaults] integerForKey:@"Render3D_ColorFormat"]];
// Set the stylus options per user preferences.
[[cdsCore cdsController] setStylusPressure:[[NSUserDefaults standardUserDefaults] integerForKey:@"Emulation_StylusPressure"]];