diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-03-03 19:50:59 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-03-03 19:50:59 +0000 |
| commit | 5660e3f37355999b2877ffbdde86794f2ea2e33d (patch) | |
| tree | 33764b49f92b35b2111895d3cb30b997cdfe3306 /macosx/plugins/DFXVideo | |
| parent | bc21097f4380f1b62ace949f1f766ceacbcc7c59 (diff) | |
OS X fiddling
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89254 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFXVideo')
| -rw-r--r-- | macosx/plugins/DFXVideo/macsrc/GL2Code.m | 4 | ||||
| -rw-r--r-- | macosx/plugins/DFXVideo/macsrc/GL3Code.m | 2 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/PluginGLView.h | 2 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/PluginGLView.m | 15 |
4 files changed, 13 insertions, 10 deletions
diff --git a/macosx/plugins/DFXVideo/macsrc/GL2Code.m b/macosx/plugins/DFXVideo/macsrc/GL2Code.m index 427575c0..729af742 100644 --- a/macosx/plugins/DFXVideo/macsrc/GL2Code.m +++ b/macosx/plugins/DFXVideo/macsrc/GL2Code.m @@ -156,10 +156,6 @@ static int mylog2(int val) [NSOpenGLContext clearCurrentContext]; [glLock unlock]; - - if (image_base) - free(image_base); - } - (void)reshapeGL2 diff --git a/macosx/plugins/DFXVideo/macsrc/GL3Code.m b/macosx/plugins/DFXVideo/macsrc/GL3Code.m index 0e8ec435..039de9a0 100644 --- a/macosx/plugins/DFXVideo/macsrc/GL3Code.m +++ b/macosx/plugins/DFXVideo/macsrc/GL3Code.m @@ -117,7 +117,7 @@ static int mylog2(int val) } /* chargement du code source */ - src = [self loadSource:filename]; + src = [PluginGLView loadSource:filename]; if(src == NULL) { /* theoriquement, la fonction LoadSource a deja affiche un message diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h index 4400c2c8..a8667b11 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h @@ -75,7 +75,7 @@ static inline void RunOnMainThreadSync(dispatch_block_t block) - (void)swapBuffer; - (void)clearBuffer:(BOOL)display; - (void)loadTextures:(GLboolean)first; -- (char*)loadSource:(NSURL *)filename; ++ (char*)loadSource:(NSURL *)filename; void printProgramInfoLog(GLuint obj); @end diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index c157e499..a3dda640 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -57,6 +57,10 @@ extern time_t tStart; } else if (oglProfile == NSOpenGLProfileVersion3_2Core) { [self cleanupGL3]; } + + if (image_base) { + free(image_base); + } } - (BOOL)isOpaque @@ -174,16 +178,19 @@ extern time_t tStart; } } -- (char*)loadSource:(NSURL *)filename ++ (char*)loadSource:(NSURL *)filename { //Since we're passing Cocoa NSURLs, let's use Cocoa's methods if (filename == nil) { return NULL; } - NSMutableData *shaderData = [NSMutableData dataWithContentsOfURL:filename]; + + NSUInteger len; + NSMutableData *shaderData = [[NSMutableData alloc] initWithContentsOfURL:filename]; [shaderData appendBytes:"\0" length:1]; - char *shaderText = malloc([shaderData length]); - [shaderData getBytes:shaderText length:[shaderData length]]; + len = [shaderData length]; + char *shaderText = malloc(len); + [shaderData getBytes:shaderText length:len]; return shaderText; } |
