Changeset - r3082:12642bff9b64
[Not reviewed]
master
0 1 0
bjarni - 19 years ago 2006-02-24 22:12:11
bjarni@openttd.org
(svn r3671) -Code cleanup: fixed style and removed commented out code in video/cocoa_v.m
1 file changed with 1 insertions and 11 deletions:
0 comments (0 inline, 0 general)
video/cocoa_v.m
Show inline comments
 
@@ -879,13 +879,12 @@ static void QZ_SetPortAlphaOpaque(void)
 
	_cocoa_video_data.num_dirty_rects = MAX_DIRTY_RECTS;
 
}
 

	
 
- (void)appDidHide:(NSNotification*)note
 
{
 
	_cocoa_video_data.active = false;
 
//	DEBUG(driver, 1)("cocoa_v: appDidHide");
 
}
 

	
 

	
 
- (void)appWillUnhide:(NSNotification*)note
 
{
 
	QZ_SetPortAlphaOpaque ();
 
@@ -897,13 +896,12 @@ static void QZ_SetPortAlphaOpaque(void)
 
- (void)appDidUnhide:(NSNotification*)note
 
{
 
	/* restore cached image, since it may not be current, post expose event too */
 
	[ self restoreCachedImage ];
 

	
 
	_cocoa_video_data.active = true;
 
//	DEBUG(driver, 1)("cocoa_v: appDidUnhide");
 
}
 

	
 

	
 
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag
 
{
 
	/* Make our window subclass receive these application notifications */
 
@@ -929,31 +927,27 @@ static void QZ_SetPortAlphaOpaque(void)
 
	return NO;
 
}
 

	
 
- (void)windowDidBecomeKey:(NSNotification*)aNotification
 
{
 
	_cocoa_video_data.active = true;
 
//	DEBUG(driver, 1)("cocoa_v: windowDidBecomeKey");
 
}
 

	
 
- (void)windowDidResignKey:(NSNotification*)aNotification
 
{
 
	_cocoa_video_data.active = false;
 
//	DEBUG(driver, 1)("cocoa_v: windowDidResignKey");
 
}
 

	
 
- (void)windowDidBecomeMain:(NSNotification*)aNotification
 
{
 
	_cocoa_video_data.active = true;
 
//	DEBUG(driver, 1)("cocoa_v: windowDidBecomeMain");
 
}
 

	
 
- (void)windowDidResignMain:(NSNotification*)aNotification
 
{
 
	_cocoa_video_data.active = false;
 
//	DEBUG(driver, 1)("cocoa_v: windowDidResignMain");
 
}
 

	
 
@end
 

	
 

	
 
static void QZ_UpdateWindowPalette(uint start, uint count)
 
@@ -1480,15 +1474,13 @@ static void QZ_DrawScreen(void)
 
	height = _cocoa_video_data.height;
 
	width  = _cocoa_video_data.width;
 
	pitch  = _cocoa_video_data.pitch;
 
	num_dirty_rects = _cocoa_video_data.num_dirty_rects;
 

	
 
	/* Check if we need to do anything */
 
	if (_cocoa_video_data.num_dirty_rects == 0 ) {
 
		return;
 
	}
 
	if (_cocoa_video_data.num_dirty_rects == 0 ) return;
 

	
 
	if (num_dirty_rects >= MAX_DIRTY_RECTS) {
 
		num_dirty_rects = 1;
 
		_cocoa_video_data.dirty_rects[0].left = 0;
 
		_cocoa_video_data.dirty_rects[0].top = 0;
 
		_cocoa_video_data.dirty_rects[0].right = _cocoa_video_data.width;
 
@@ -1804,13 +1796,12 @@ static void QZ_WarpCursor(int x, int y)
 
	/* this is the magic call that fixes cursor "freezing" after warp */
 
	CGSetLocalEventsSuppressionInterval(0.0);
 
	/* Do the actual warp */
 
	CGWarpMouseCursorPosition(cgp);
 

	
 
	/* Generate the mouse moved event */
 
//	SDL_PrivateMouseMotion(0, 0, x, y);
 
}
 

	
 
static void QZ_ShowMouse(void)
 
{
 
	if (!_cocoa_video_data.cursor_visible) {
 
		[ NSCursor unhide ];
 
@@ -1845,13 +1836,12 @@ static void QZ_HideMouse(void)
 
	[ NSApp stop:_ottd_main ];
 
}
 

	
 
/* Display the in game quit confirmation dialog */
 
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*) sender
 
{
 
//	DEBUG(driver, 1)("cocoa_v: applicationShouldTerminate");
 

	
 
	QZ_AskQuit();
 

	
 
	return NSTerminateCancel;		// NSTerminateLater ?
 
}
 
@end
0 comments (0 inline, 0 general)