[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [422] trunk/fuse
Brought to you by:
fredm
|
From: <fr...@us...> - 2007-07-05 10:02:12
|
Revision: 422
http://svn.sourceforge.net/fuse-for-macosx/?rev=422&view=rev
Author: fredm
Date: 2007-07-05 03:02:14 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Rest of media check change, plus more locking around the emulator and display
threads.
Modified Paths:
--------------
trunk/fuse/TODO
trunk/fuse/fusepb/views/DisplayOpenGLView.h
trunk/fuse/fusepb/views/DisplayOpenGLView.m
trunk/fuse/ui/cocoa/cocoadisplay.m
Modified: trunk/fuse/TODO
===================================================================
--- trunk/fuse/TODO 2007-07-04 12:33:56 UTC (rev 421)
+++ trunk/fuse/TODO 2007-07-05 10:02:14 UTC (rev 422)
@@ -32,7 +32,7 @@
prevent thread sync problems
X Add .WAV loader using audiofile
X Figure out why minimise icon image is partially blanked when minimise starts
-* Quit keyhandling when command key is pressed
+X Quit keyhandling when command key is pressed
* Use sheets rather than modal dialogs (for Save As)
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
@@ -46,5 +46,6 @@
* Save ROM into szx when using a non-default one
* Randomise FRAMES sys var after autoload snapshot loaded in order to try and
get less deterministic program behaviour after load is complete
+* Allow zoom in fullscreen mode for widescreen displays
$Id: TODO 2026 2004-03-02 13:38:08Z pak21 $
Modified: trunk/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- trunk/fuse/fusepb/views/DisplayOpenGLView.h 2007-07-04 12:33:56 UTC (rev 421)
+++ trunk/fuse/fusepb/views/DisplayOpenGLView.h 2007-07-05 10:02:14 UTC (rev 422)
@@ -68,6 +68,8 @@
ui_statusbar_state tape_state;
BOOL statusbar_updated;
+ NSLock *view_lock;
+
NSWindow *fullscreenWindow;
NSWindow *windowedWindow;
@@ -124,6 +126,7 @@
-(void) reset;
-(void) hard_reset;
-(int) nmi;
+-(int) checkMediaChanged;
-(void) specplus3DiskInsert:(const char *)filename inDrive:(specplus3_drive_number)which;
-(void) specplus3DiskEject:(specplus3_drive_number)drive saveFirst:(int)write;
Modified: trunk/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- trunk/fuse/fusepb/views/DisplayOpenGLView.m 2007-07-04 12:33:56 UTC (rev 421)
+++ trunk/fuse/fusepb/views/DisplayOpenGLView.m 2007-07-05 10:02:14 UTC (rev 422)
@@ -142,10 +142,16 @@
[fullscreenWindow makeFirstResponder:self];
settings_current.full_screen = 1;
if( !ui_mouse_grabbed ) ui_mouse_grabbed = ui_mouse_grab( 0 );
+
+ [[self openGLContext] makeCurrentContext];
+
+ glClear( GL_COLOR_BUFFER_BIT );
}
}
+ [view_lock lock];
statusbar_updated = YES;
+ [view_lock unlock];
}
-(IBAction) zoom:(id)sender
@@ -268,6 +274,9 @@
/* keep the window in the standard aspect ratio if the user resizes */
[[self window] setContentAspectRatio:NSMakeSize(4.0,3.0)];
+ view_lock = [[NSLock alloc] init];
+ [view_lock retain];
+
CVReturn error = kCVReturnSuccess;
CGDirectDisplayID displayID = CGMainDisplayID();
@@ -314,6 +323,8 @@
glDeleteTextures(1, &greenDisk);
greenDisk = 0;
+ [buffered_screen_lock release];
+
[self release];
}
@@ -434,10 +445,12 @@
int i;
PIG_dirtytable *workdirty = NULL;
+ [view_lock lock];
[buffered_screen_lock lock];
if( NO == screenTexInitialised ||
( 0 == buffered_screen.dirty->count && NO == statusbar_updated ) ) {
[buffered_screen_lock unlock];
+ [view_lock unlock];
return;
}
@@ -464,8 +477,6 @@
[[self openGLContext] makeCurrentContext];
- glClear( GL_COLOR_BUFFER_BIT );
-
/* Bind, update and draw new image */
glBindTexture( GL_TEXTURE_RECTANGLE_EXT, screenTexId[currentScreenTex] );
@@ -497,6 +508,7 @@
statusbar_updated = NO;
[buffered_screen_lock unlock];
+ [view_lock unlock];
}
/* want to keep image in the original aspect ratio in the face of window resizing */
@@ -518,6 +530,7 @@
/* moved or resized */
-(void) update
{
+ [view_lock lock];
NSRect rect;
[super update];
@@ -536,11 +549,13 @@
glLoadIdentity();
statusbar_updated = YES;
+ [view_lock unlock];
}
/* scrolled, moved or resized */
-(void) reshape
{
+ [view_lock lock];
NSRect rect;
[super reshape];
@@ -559,28 +574,35 @@
glLoadIdentity();
statusbar_updated = YES;
+ [view_lock unlock];
}
-(void) destroyTexture
{
GLuint i;
- if( screenTexInitialised == NO) return;
+ [view_lock lock];
+ if( screenTexInitialised == NO) {
+ [view_lock unlock];
+ return;
+ }
glDeleteTextures( MAX_SCREEN_BUFFERS, screenTexId );
for(i = 0; i < MAX_SCREEN_BUFFERS; i++)
{
free( screenTex[i].pixels );
screenTex[i].pixels = NULL;
- if(screenTex[i].dirty)
+ if( screenTex[i].dirty )
pig_dirty_close( screenTex[i].dirty );
screenTex[i].dirty = NULL;
}
screenTexInitialised = NO;
+ [view_lock unlock];
}
-(void) createTexture:(Cocoa_Texture*)newScreen
{
+ [view_lock lock];
GLuint i;
[[self openGLContext] makeCurrentContext];
@@ -626,6 +648,7 @@
screenTex[i].pixels );
}
screenTexInitialised = YES;
+ [view_lock unlock];
}
-(void) uploadIconTexture:(GLuint*)textureName
@@ -726,6 +749,11 @@
return [proxy_emulator nmi];
}
+-(int) checkMediaChanged
+{
+ return [proxy_emulator checkMediaChanged];
+}
+
-(void) specplus3DiskInsert:(const char *)filename inDrive:(specplus3_drive_number)which
{
[proxy_emulator specplus3DiskInsert:filename inDrive:which];
@@ -969,21 +997,27 @@
-(void) setDiskState:(NSNumber*)state
{
disk_state = [state unsignedCharValue];
+ [view_lock lock];
statusbar_updated = YES;
+ [view_lock unlock];
[[FuseController singleton] setDiskState:state];
}
-(void) setTapeState:(NSNumber*)state
{
tape_state = [state unsignedCharValue];
+ [view_lock lock];
statusbar_updated = YES;
+ [view_lock unlock];
[[FuseController singleton] setTapeState:state];
}
-(void) setMdrState:(NSNumber*)state
{
mdr_state = [state unsignedCharValue];
+ [view_lock lock];
statusbar_updated = YES;
+ [view_lock unlock];
[[FuseController singleton] setMdrState:state];
}
Modified: trunk/fuse/ui/cocoa/cocoadisplay.m
===================================================================
--- trunk/fuse/ui/cocoa/cocoadisplay.m 2007-07-04 12:33:56 UTC (rev 421)
+++ trunk/fuse/ui/cocoa/cocoadisplay.m 2007-07-05 10:02:14 UTC (rev 422)
@@ -249,7 +249,9 @@
buffered_screen_lock = [[NSLock alloc] init];
[buffered_screen_lock retain];
+ [buffered_screen_lock lock];
cocoadisplay_load_gfx_mode();
+ [buffered_screen_lock unlock];
/* We can now output error messages to our output device */
display_ui_initialised = 1;
@@ -262,6 +264,9 @@
{
fuse_emulation_pause();
+ /* obtain lock for buffered screen */
+ [buffered_screen_lock lock];
+
/* Free the old surfaces */
free_screen( &unscaled_screen );
free_screen( &scaled_screen );
@@ -270,6 +275,8 @@
/* Setup the new GFX mode */
cocoadisplay_load_gfx_mode();
+ [buffered_screen_lock unlock];
+
fuse_emulation_unpause();
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|