diff options
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]; |
