diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-10-10 00:54:20 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-10-10 00:54:20 +0000 |
| commit | 18fe428c13eca2fe18d7dc226ab5de9c08b02d2a (patch) | |
| tree | 58d0e4593adc11f69ab6cd233fe554b2256857cf /macosx/plugins/DFXVideo/macsrc | |
| parent | 7a613cfccd715ef0b9daa7e49fee51349367b9c8 (diff) | |
| download | pcsxr-18fe428c13eca2fe18d7dc226ab5de9c08b02d2a.tar.gz | |
Added some sanity checking so we don't try to use nil objects in the SoftGL Mac driver.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@80324 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFXVideo/macsrc')
| -rw-r--r-- | macosx/plugins/DFXVideo/macsrc/PluginConfigController.m | 22 | ||||
| -rw-r--r-- | macosx/plugins/DFXVideo/macsrc/PluginGLView.m | 3 |
2 files changed, 23 insertions, 2 deletions
diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m index 500f1c55..86355a06 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m @@ -284,6 +284,26 @@ void ReadConfig(void) [keyValues release]; keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy]; + { + BOOL resetPrefs = NO; + vertexPath = [NSURL URLByResolvingBookmarkData:[keyValues objectForKey:@"VertexShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]; + if (vertexPath) { + [vertexPath retain]; + } else { + resetPrefs = YES; + } + fragmentPath = [NSURL URLByResolvingBookmarkData:[keyValues objectForKey:@"FragmentShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]; + if (fragmentPath) { + [fragmentPath retain]; + } else { + resetPrefs = YES; + } + if (resetPrefs) { + NSBundle *selfBundle = [NSBundle bundleWithIdentifier:APP_ID]; + vertexPath = [[selfBundle URLForResource:@"gpuPeteOGL2" withExtension:@"slv"] retain]; + fragmentPath = [[selfBundle URLForResource:@"gpuPeteOGL2" withExtension:@"slf"] retain]; + } + } [fpsCounter setIntValue:[[keyValues objectForKey:@"FPS Counter"] intValue]]; [autoFullScreen setIntValue:[[keyValues objectForKey:@"Auto Full Screen"] intValue]]; [frameSkipping setIntValue:[[keyValues objectForKey:@"Frame Skipping"] intValue]]; @@ -294,8 +314,6 @@ void ReadConfig(void) [ditherMode selectItemAtIndex:[[keyValues objectForKey:@"Dither Mode"] intValue]]; [shaderQualitySelector selectItemAtIndex:[[keyValues objectForKey:@"ShaderQuality"] intValue]]; - vertexPath = [[NSURL URLByResolvingBookmarkData:[keyValues objectForKey:@"VertexShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil] retain]; - fragmentPath = [[NSURL URLByResolvingBookmarkData:[keyValues objectForKey:@"FragmentShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil] retain]; [vertexShaderViewablePath setTitleWithMnemonic:[vertexPath path]]; [fragmentShaderViewablePath setTitleWithMnemonic:[fragmentPath path]]; unsigned int hackValues = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index 662b8ebc..e33e2644 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -881,6 +881,9 @@ void BlitScreen16NS(unsigned char * surf,long x,long y) return src;*/ //NSURL *actualFile = [filename filePathURL]; //Since we're passing Cocoa NSURLs, let's use Cocoa's methods + if (filename == nil) { + return NULL; + } NSNumber *filesizeAsNS = nil; long long filesize = 0; [filename getResourceValue:&filesizeAsNS forKey:NSURLFileSizeKey error:nil]; |
