From a602f4591fefa9e560a49395c9d4a7a6a126a4c5 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sun, 23 Sep 2012 21:28:57 +0000 Subject: Quieting a warning in OS X localization implementation. Fixing a few bugs on the OS X Software Shader support, and adding a quality selector. Changing the hacks type used in the Mac preference selector from unsigned long to unsigned int. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@79982 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- .../DFCdrom/macsrc/PluginConfigController.m | 2 +- macosx/plugins/DFInput/macsrc/PadController.m | 2 +- .../plugins/DFNet/macsrc/PluginConfigController.m | 2 +- macosx/plugins/DFSound/macsrc/PluginController.m | 6 +- .../English.lproj/NetSfPeopsSoftGPUConfig.xib | 232 ++++++++++++++++++--- .../DFXVideo/macsrc/PluginConfigController.h | 1 + .../DFXVideo/macsrc/PluginConfigController.m | 34 +-- macosx/plugins/DFXVideo/macsrc/PluginGLView.m | 6 +- macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h | 1 + .../NetSfPeopsOpenGLPluginConfigController.m | 16 +- 10 files changed, 247 insertions(+), 55 deletions(-) (limited to 'macosx/plugins') diff --git a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m index 4c741250..8fa790d6 100644 --- a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m @@ -157,7 +157,7 @@ void ReadConfig() @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]]; NSString *origString = nil, *transString = nil; diff --git a/macosx/plugins/DFInput/macsrc/PadController.m b/macosx/plugins/DFInput/macsrc/PadController.m index ab6e19d4..f359da38 100644 --- a/macosx/plugins/DFInput/macsrc/PadController.m +++ b/macosx/plugins/DFInput/macsrc/PadController.m @@ -137,7 +137,7 @@ long DoConfiguration() { @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PadController class]]; NSString *origString = nil, *transString = nil; diff --git a/macosx/plugins/DFNet/macsrc/PluginConfigController.m b/macosx/plugins/DFNet/macsrc/PluginConfigController.m index dbda2051..bc6ae94b 100644 --- a/macosx/plugins/DFNet/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFNet/macsrc/PluginConfigController.m @@ -134,7 +134,7 @@ void ReadConfig() @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]]; NSString *origString = nil, *transString = nil; diff --git a/macosx/plugins/DFSound/macsrc/PluginController.m b/macosx/plugins/DFSound/macsrc/PluginController.m index 915eb573..0d26982f 100644 --- a/macosx/plugins/DFSound/macsrc/PluginController.m +++ b/macosx/plugins/DFSound/macsrc/PluginController.m @@ -11,7 +11,7 @@ //If running under Mac OS X, use the Localizable.strings file instead. #elif defined(_MACOSX) #ifdef PCSXRCORE -extern char* Pcsxr_locale_text(char* toloc); +extern const char* Pcsxr_locale_text(char* toloc); #define _(String) Pcsxr_locale_text(String) #define N_(String) String #else @@ -24,7 +24,7 @@ extern char* Pcsxr_locale_text(char* toloc); #define PLUGLOC_x(x,y) x ## y #define PLUGLOC_y(x,y) PLUGLOC_x(x,y) #define PLUGLOC PLUGLOC_y(PCSXRPLUG,_locale_text) -extern char* PLUGLOC(char* toloc); +extern const char* PLUGLOC(char* toloc); #define _(String) PLUGLOC(String) #define N_(String) String #endif @@ -213,7 +213,7 @@ void ReadConfig(void) @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PluginController class]]; NSString *origString = nil, *transString = nil; diff --git a/macosx/plugins/DFXVideo/English.lproj/NetSfPeopsSoftGPUConfig.xib b/macosx/plugins/DFXVideo/English.lproj/NetSfPeopsSoftGPUConfig.xib index 0e8ab649..6e1e39a8 100644 --- a/macosx/plugins/DFXVideo/English.lproj/NetSfPeopsSoftGPUConfig.xib +++ b/macosx/plugins/DFXVideo/English.lproj/NetSfPeopsSoftGPUConfig.xib @@ -2,13 +2,13 @@ 1060 - 12B19 - 2549 - 1187 - 624.00 + 12C54 + 2840 + 1187.34 + 625.00 com.apple.InterfaceBuilder.CocoaPlugin - 2549 + 2840 NSBox @@ -44,7 +44,7 @@ 1 2 - {{411, 163}, {466, 492}} + {{411, 163}, {466, 516}} 1886912512 GPU Configuration NSWindow @@ -91,7 +91,6 @@ {{330, 13}, {122, 32}} - YES 67108864 @@ -451,7 +450,7 @@ A - {{17, 155}, {432, 192}} + {{17, 179}, {432, 192}} @@ -592,7 +591,7 @@ A - {{17, 351}, {211, 135}} + {{17, 375}, {211, 135}} @@ -732,7 +731,7 @@ A {{16, 36}, {131, 18}} - + YES 67108864 @@ -756,7 +755,7 @@ A {{16, 16}, {118, 18}} - + _NS:9 YES @@ -787,7 +786,7 @@ A - {{239, 351}, {210, 135}} + {{239, 375}, {210, 135}} @@ -820,7 +819,7 @@ A 268 - {{333, 40}, {89, 32}} + {{333, 64}, {89, 32}} @@ -846,7 +845,7 @@ A 268 - {{333, 7}, {89, 32}} + {{333, 31}, {89, 32}} @@ -872,7 +871,7 @@ A 268 - {{85, 49}, {249, 17}} + {{85, 73}, {249, 17}} @@ -893,10 +892,10 @@ A 268 - {{85, 19}, {249, 17}} + {{85, 43}, {249, 17}} - + _NS:1535 YES @@ -914,7 +913,7 @@ A 268 - {{15, 49}, {50, 17}} + {{15, 73}, {50, 17}} @@ -935,7 +934,7 @@ A 268 - {{15, 19}, {68, 17}} + {{15, 43}, {68, 17}} @@ -953,15 +952,116 @@ A NO + + + 268 + {{85, 11}, {100, 26}} + + + + _NS:9 + YES + + -2076180416 + 2048 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + YES + + OtherViews + + + + 1.0 + + 2147483647 + + + _popUpItemAction: + 1 + + + + + 2.0 + + 2147483647 + + + _popUpItemAction: + 2 + + + + + 3.0 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 4.0 + + 2147483647 + + + _popUpItemAction: + + + + + + -1 + 1 + YES + YES + 2 + + NO + + + + 268 + {{15, 17}, {53, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Quality: + + _NS:1535 + + + + + NO + - {{1, 1}, {430, 78}} + {{1, 1}, {430, 102}} - + _NS:11 - {{17, 57}, {432, 94}} + {{17, 57}, {432, 118}} @@ -985,7 +1085,7 @@ A NO - {466, 492} + {466, 516} @@ -1158,6 +1258,14 @@ A 206 + + + shaderQualitySelector + + + + 233 + delegate @@ -1453,6 +1561,8 @@ A + + @@ -1677,6 +1787,66 @@ A + + 219 + + + + + + + + 220 + + + + + + + + 221 + + + + + + + + + + + 222 + + + + + 223 + + + + + 224 + + + + + 225 + + + + + + + + 226 + + + + + 227 + + + @@ -1788,6 +1958,15 @@ A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1890,7 +2069,7 @@ A - 218 + 233 @@ -1940,6 +2119,7 @@ A NSControl NSControl NSView + NSPopUpButton NSControl NSView NSControl @@ -1979,6 +2159,10 @@ A hacksView NSView + + shaderQualitySelector + NSPopUpButton + shaders NSControl diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h index ec9c0203..a740ed67 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h @@ -19,6 +19,7 @@ IBOutlet NSControl *vertexChooser; IBOutlet NSControl *fragmentChooser; IBOutlet NSView *shadersView; + IBOutlet NSPopUpButton *shaderQualitySelector; NSURL *vertexPath; NSURL *fragmentPath; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m index b22167ca..4cb71fa9 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m @@ -13,7 +13,7 @@ //If running under Mac OS X, use the Localizable.strings file instead. #elif defined(_MACOSX) #ifdef PCSXRCORE -extern char* Pcsxr_locale_text(char* toloc); +extern const char* Pcsxr_locale_text(char* toloc); #define _(String) Pcsxr_locale_text(String) #define N_(String) String #else @@ -26,7 +26,7 @@ extern char* Pcsxr_locale_text(char* toloc); #define PLUGLOC_x(x,y) x ## y #define PLUGLOC_y(x,y) PLUGLOC_x(x,y) #define PLUGLOC PLUGLOC_y(PCSXRPLUG,_locale_text) -extern char* PLUGLOC(char* toloc); +extern const char* PLUGLOC(char* toloc); #define _(String) PLUGLOC(String) #define N_(String) String #endif @@ -111,6 +111,13 @@ NSURL *PSXFragmentShader() return [keyValues objectForKey:@"FragmentShader"]; } +float PSXShaderQuality() +{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSDictionary *keyValues = [defaults dictionaryForKey:PrefsKey]; + return (float)[[keyValues objectForKey:@"ShaderQuality"] intValue]; +} + void ReadConfig(void) { @@ -126,10 +133,11 @@ void ReadConfig(void) [NSNumber numberWithBool:NO], @"VSync", [NSNumber numberWithBool:NO], @"Enable Hacks", [NSNumber numberWithInt:1], @"Dither Mode", - [NSNumber numberWithLong:0], @"Hacks", + [NSNumber numberWithUnsignedInt:0], @"Hacks", [[selfBundle URLForResource:@"gpuPeteOGL2" withExtension:@"slv"] fileReferenceURL], @"VertexShader", [[selfBundle URLForResource:@"gpuPeteOGL2" withExtension:@"slf"] fileReferenceURL], @"FragmentShader", [NSNumber numberWithBool:NO], @"UseShader", + [NSNumber numberWithInt:4], @"ShaderQuality", nil], PrefsKey, nil]]; @@ -143,7 +151,7 @@ void ReadConfig(void) iUseFixes = [[keyValues objectForKey:@"Enable Hacks"] boolValue]; iUseDither = [[keyValues objectForKey:@"Dither Mode"] intValue]; - dwCfgFixes = [[keyValues objectForKey:@"Hacks"] longValue]; + dwCfgFixes = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; iResX = 640; iResY = 480; @@ -189,10 +197,10 @@ void ReadConfig(void) [writeDic setObject:[NSNumber numberWithInt:[vSync intValue]] forKey:@"VSync"]; [writeDic setObject:[NSNumber numberWithInt:[hackEnable intValue]] forKey:@"Enable Hacks"]; [writeDic setObject:[NSNumber numberWithInt:[shaders intValue]] forKey:@"UseShader"]; - + [writeDic setObject:[NSNumber numberWithInt:[shaderQualitySelector indexOfSelectedItem]] forKey:@"ShaderQuality"]; [writeDic setObject:[NSNumber numberWithInt:[ditherMode indexOfSelectedItem]] forKey:@"Dither Mode"]; - unsigned long hackValues = 0; + unsigned int hackValues = 0; NSArray *views = [hacksView subviews]; for (NSView *control in views) { if ([control isKindOfClass:[NSButton class]]) { @@ -254,17 +262,13 @@ void ReadConfig(void) [vertexPath release]; vertexPath = [[openPanel URL] copy]; [vertexShaderViewablePath setTitleWithMnemonic:[vertexPath path]]; - } else { [fragmentPath release]; fragmentPath = [[openPanel URL] copy]; [fragmentShaderViewablePath setTitleWithMnemonic:[fragmentPath path]]; - } } - - [openPanel release]; } @@ -283,14 +287,17 @@ void ReadConfig(void) [frameSkipping setIntValue:[[keyValues objectForKey:@"Frame Skipping"] intValue]]; [vSync setIntValue:[[keyValues objectForKey:@"VSync"] intValue]]; [hackEnable setIntValue:[[keyValues objectForKey:@"Enable Hacks"] intValue]]; + [shaders setIntValue:[[keyValues objectForKey:@"UseShader"] intValue]]; [ditherMode selectItemAtIndex:[[keyValues objectForKey:@"Dither Mode"] intValue]]; - + [shaderQualitySelector selectItemAtIndex:[[keyValues objectForKey:@"ShaderQuality"] intValue]]; + vertexPath = [[keyValues objectForKey:@"VertexShader"] copy]; fragmentPath = [[keyValues objectForKey:@"FragmentShader"] copy]; [vertexShaderViewablePath setTitleWithMnemonic:[vertexPath path]]; [fragmentShaderViewablePath setTitleWithMnemonic:[fragmentPath path]]; - unsigned long hackValues = [[keyValues objectForKey:@"Hacks"] longValue]; + unsigned int hackValues = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; + NSArray *views = [hacksView subviews]; for (NSView *control in views) { @@ -300,6 +307,7 @@ void ReadConfig(void) } [self hackToggle:hackEnable]; + [self toggleShader:shaders]; } - (void)awakeFromNib @@ -319,7 +327,7 @@ void ReadConfig(void) @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]]; NSString *origString = nil, *transString = nil; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index 2c79436b..1836ebcd 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -155,10 +155,8 @@ void BlitScreen16NS(unsigned char * surf,long x,long y) if(isShaderEnabled()){ // --- Params --- - shaderQuality = 4.0; - //vertexShader = LoadShader(GL_VERTEX_SHADER,"/Users/you/shader/gpuPeteOGL2.slv"); + shaderQuality = PSXShaderQuality(); vertexShader = [self loadShader:GL_VERTEX_SHADER location:PSXVertexShader()]; - //fragmentShader = LoadShader(GL_FRAGMENT_SHADER,"/Users/you/shader/gpuPeteOGL2.slf"); fragmentShader = [self loadShader:GL_FRAGMENT_SHADER location:PSXFragmentShader()]; //--- shader loading --- @@ -660,7 +658,7 @@ void BlitScreen16NS(unsigned char * surf,long x,long y) GLuint lu2 = *((GLuint *)pD+1); GLuint lu3 = *((GLuint *)pD+2); GLuint *dst = ((GLuint *)((surf)+(column*lPitch)+(row<<2))); -#ifdef __POWERPC__ +#ifdef __BIG_ENDIAN__ *(dst)= (((lu1>>24)&0xff)<<16)|(((lu1>>16)&0xff)<<8)|(((lu1>>8)&0xff)); *(dst+1)= diff --git a/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h b/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h index a4cb1054..27449a69 100644 --- a/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h +++ b/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h @@ -14,5 +14,6 @@ BOOL isShaderEnabled(); NSURL *PSXFragmentShader(); NSURL *PSXVertexShader(); +float PSXShaderQuality(); #endif diff --git a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m index b75258f7..d539ecd9 100644 --- a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m +++ b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m @@ -20,7 +20,7 @@ //If running under Mac OS X, use the Localizable.strings file instead. #elif defined(_MACOSX) #ifdef PCSXRCORE -extern char* Pcsxr_locale_text(char* toloc); +extern const char* Pcsxr_locale_text(char* toloc); #define _(String) Pcsxr_locale_text(String) #define N_(String) String #else @@ -33,7 +33,7 @@ extern char* Pcsxr_locale_text(char* toloc); #define PLUGLOC_x(x,y) x ## y #define PLUGLOC_y(x,y) PLUGLOC_x(x,y) #define PLUGLOC PLUGLOC_y(PCSXRPLUG,_locale_text) -extern char* PLUGLOC(char* toloc); +extern const char* PLUGLOC(char* toloc); #define _(String) PLUGLOC(String) #define N_(String) String #endif @@ -127,7 +127,7 @@ void PrepFactoryDefaultPreferences(void) [NSNumber numberWithBool:NO], @"VSync", [NSNumber numberWithBool:NO], @"Enable Hacks", [NSNumber numberWithInt:0], @"Dither Mode", - [NSNumber numberWithLong:0], @"Hacks", + [NSNumber numberWithUnsignedInt:0], @"Hacks", [NSNumber numberWithBool:YES], @"Proportional Resize", // [NSSize stringWithCString: @"default"], @"Fullscreen Resolution", @@ -187,7 +187,7 @@ void ReadConfig(void) bUseFrameSkip = [[keyValues objectForKey:@"Frame Skipping"] boolValue]; bUseFixes = [[keyValues objectForKey:@"Enable Hacks"] boolValue]; - dwCfgFixes = [[keyValues objectForKey:@"Hacks"] longValue]; + dwCfgFixes = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; // we always start out at 800x600 (at least until resizing the window is implemented) @@ -291,7 +291,7 @@ void ReadConfig(void) // treat hacks specially: - unsigned long hackValues = 0; + unsigned int hackValues = 0; NSArray *views = [hacksView subviews]; for (NSView *control in views) { @@ -303,7 +303,7 @@ void ReadConfig(void) keyValues = [NSMutableDictionary dictionaryWithDictionary: [[NSUserDefaults standardUserDefaults] dictionaryForKey:PrefsKey]]; NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues]; - [writeDic setObject:[NSNumber numberWithUnsignedLong:hackValues] forKey:@"Hacks"]; + [writeDic setObject:[NSNumber numberWithUnsignedInt:hackValues] forKey:@"Hacks"]; // write the preferences with Hacks adjustments [defaults setObject:writeDic forKey:PrefsKey]; @@ -352,7 +352,7 @@ void ReadConfig(void) /* load from preferences */ keyValues = [NSMutableDictionary dictionaryWithDictionary: [defaults dictionaryForKey:PrefsKey]]; - unsigned long hackValues = [[keyValues objectForKey:@"Hacks"] unsignedLongValue]; + unsigned int hackValues = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; // build refs to hacks checkboxes NSArray *views = [hacksView subviews]; @@ -373,7 +373,7 @@ void ReadConfig(void) @end -char* PLUGLOC(char *toloc) +const char* PLUGLOC(char *toloc) { NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]]; NSString *origString = nil, *transString = nil; -- cgit v1.2.3