[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[587] branches/Release-0_10_0-branch/fuse/ fu
Brought to you by:
fredm
From: <fr...@us...> - 2009-01-09 23:20:33
|
Revision: 587 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=587&view=rev Author: fredm Date: 2009-01-09 23:20:25 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Merge r577: also update the statusbar if nothing has changed on the Speccy screen. Modified Paths: -------------- branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.h branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.m Modified: branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.h =================================================================== --- branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.h 2009-01-09 23:16:34 UTC (rev 586) +++ branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.h 2009-01-09 23:20:25 UTC (rev 587) @@ -61,6 +61,7 @@ ui_statusbar_state disk_state; ui_statusbar_state mdr_state; ui_statusbar_state tape_state; + BOOL statusbar_updated; NSLock *view_lock; Modified: branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.m =================================================================== --- branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.m 2009-01-09 23:16:34 UTC (rev 586) +++ branches/Release-0_10_0-branch/fuse/fusepb/views/DisplayOpenGLView.m 2009-01-09 23:20:25 UTC (rev 587) @@ -119,6 +119,9 @@ [self displayLinkStart]; + [view_lock lock]; + statusbar_updated = YES; + [view_lock unlock]; [[FuseController singleton] releaseCmdKeys:@"f":QZ_f]; } @@ -248,6 +251,8 @@ currentScreenTex = 0; + statusbar_updated = NO; + return self; } @@ -484,6 +489,8 @@ /* Swap buffer to screen */ [[self openGLContext] flushBuffer]; + statusbar_updated = NO; + [view_lock unlock]; } @@ -528,6 +535,8 @@ glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); + statusbar_updated = YES; + [view_lock unlock]; } @@ -960,18 +969,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]; } @@ -1206,43 +1224,47 @@ PIG_dirtytable *workdirty = NULL; [buffered_screen_lock lock]; - if( buffered_screen.dirty->count == 0 ) { + if( buffered_screen.dirty->count == 0 && !statusbar_updated ) { [buffered_screen_lock unlock]; return kCVReturnSuccess; } - if (screenTex[currentScreenTex].dirty) - pig_dirty_copy( &workdirty, screenTex[currentScreenTex].dirty ); - - currentScreenTex = !currentScreenTex; - - pig_dirty_copy( &screenTex[currentScreenTex].dirty, buffered_screen.dirty ); - - if( workdirty ) - pig_dirty_merge(workdirty, screenTex[currentScreenTex].dirty); - else - pig_dirty_copy(&workdirty, screenTex[currentScreenTex].dirty); - - /* Draw texture to screen */ - for(i = 0; i < workdirty->count; ++i) - copy_area( &screenTex[currentScreenTex], &buffered_screen, - workdirty->rects + i ); - - buffered_screen.dirty->count = 0; - - pig_dirty_close( workdirty ); - - [[self openGLContext] makeCurrentContext]; - - /* Bind, update and draw new image */ - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, screenTexId[currentScreenTex] ); - - glTexSubImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, - screenTex[currentScreenTex].full_width, - screenTex[currentScreenTex].full_height, GL_BGRA, - GL_UNSIGNED_SHORT_1_5_5_5_REV, - screenTex[currentScreenTex].pixels ); + if( buffered_screen.dirty->count > 0 ) { + if (screenTex[currentScreenTex].dirty) + pig_dirty_copy( &workdirty, screenTex[currentScreenTex].dirty ); + + currentScreenTex = !currentScreenTex; + + pig_dirty_copy( &screenTex[currentScreenTex].dirty, buffered_screen.dirty ); + + if( workdirty ) + pig_dirty_merge(workdirty, screenTex[currentScreenTex].dirty); + else + pig_dirty_copy(&workdirty, screenTex[currentScreenTex].dirty); + + /* Draw texture to screen */ + for(i = 0; i < workdirty->count; ++i) + copy_area( &screenTex[currentScreenTex], &buffered_screen, + workdirty->rects + i ); + + buffered_screen.dirty->count = 0; + + pig_dirty_close( workdirty ); + + [[self openGLContext] makeCurrentContext]; + + /* Bind, update and draw new image */ + glBindTexture( GL_TEXTURE_RECTANGLE_ARB, screenTexId[currentScreenTex] ); + + glTexSubImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, + screenTex[currentScreenTex].full_width, + screenTex[currentScreenTex].full_height, GL_BGRA, + GL_UNSIGNED_SHORT_1_5_5_5_REV, + screenTex[currentScreenTex].pixels ); + + } + [buffered_screen_lock unlock]; NSAutoreleasePool *pool = [NSAutoreleasePool new]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |