From 4d55a8b8254dff61fdc7b1959f6aef7eafbd9439 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Wed, 9 Nov 2011 20:49:54 +0000 Subject: Patch 10767 (Durandal_1707). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72138 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/PeopsXgl/macsrc/PluginGLView.h | 1 + macosx/plugins/PeopsXgl/macsrc/PluginGLView.m | 14 +++++++++++++- macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m | 3 ++- macosx/plugins/PeopsXgl/macsrc/drawgl.m | 13 +++++++++---- 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'macosx/plugins/PeopsXgl/macsrc') diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h index da780293..657ac2ad 100644 --- a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h +++ b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h @@ -36,6 +36,7 @@ - (void)swapBuffer; // I wonder what this does ;-) +- (void)clearBuffer:(BOOL)display; // overrides: - (id) initWithCoder: (NSCoder *) coder; diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m index feb483a9..483a72d3 100644 --- a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m +++ b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m @@ -129,7 +129,19 @@ // actually not much to do here. [[self openGLContext] flushBuffer]; return; - } +} +// don't know what this does, pasted it in from PeopsSoftGPU's PluginGLView because something was calling it +- (void)clearBuffer:(BOOL)display +{ + if (display == NO) { + //[[self openGLContext] makeCurrentContext]; + //glClear(GL_COLOR_BUFFER_BIT); + //[self loadTextures:NO]; + } else { + noDisplay = YES; + // [self setNeedsDisplay:true]; + } +} @end diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m b/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m index 0636490a..5f3ee7dd 100644 --- a/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m +++ b/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m @@ -24,6 +24,7 @@ #import "Carbon/Carbon.h" #include // OpenGL needed for "externals.h" #include "externals.h" +#include "draw.h" // for CreateScanLines() #undef BOOL // not sure why these aren't class or instance variables... @@ -425,5 +426,5 @@ NSRect FitRectInRect(NSRect source, NSRect destination) void ChangeWindowMode(void) { // glue from PSX thread. Globals are already set - [ gameController performFullscreenSwap]; + [ gameController performFullscreenSwap]; } diff --git a/macosx/plugins/PeopsXgl/macsrc/drawgl.m b/macosx/plugins/PeopsXgl/macsrc/drawgl.m index 91c7ecbf..dcc40ee2 100644 --- a/macosx/plugins/PeopsXgl/macsrc/drawgl.m +++ b/macosx/plugins/PeopsXgl/macsrc/drawgl.m @@ -149,10 +149,15 @@ unsigned long ulInitDisplay(void) // OPEN GAME WINDOW BuildDispMenu(0); } - PluginWindowController *windowController = [PluginWindowController openGameView]; - glView = [windowController getOpenGLView]; + __block PluginWindowController *windowController; + + // this causes a runtime error if it's done on a thread other than the main thread + dispatch_sync(dispatch_get_main_queue(), ^{ + windowController = [PluginWindowController openGameView]; + glView = [windowController getOpenGLView]; - [[windowController window] setTitle:[NSString stringWithCString:pCaptionText]]; + [[windowController window] setTitle:[NSString stringWithCString:pCaptionText encoding:NSUTF8StringEncoding]]; + }); return (unsigned long)[windowController window]; } @@ -182,7 +187,7 @@ void SendContextBack(void) void SetVSync(long myValue) { - long DoItMyFriend = myValue; + GLint DoItMyFriend = myValue; [[glView openGLContext] setValues: &DoItMyFriend forParameter: NSOpenGLCPSwapInterval]; } -- cgit v1.2.3