From e38f96d60910846cdfed516f80282789bdb685f5 Mon Sep 17 00:00:00 2001 From: planetmaker Date: Tue, 21 Dec 2010 16:00:42 +0000 Subject: (svn r21576) -Codechange: [OSX] Deduplicate code by moving the handling of the view for windowed screen drivers to a common class --- src/video/cocoa/cocoa_v.mm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/video/cocoa/cocoa_v.mm') diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 756c86bfb..3abeaad9f 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -407,6 +407,36 @@ void cocoaReleaseAutoreleasePool() [ _ottd_autorelease_pool release ]; } + + +@implementation OTTD_CocoaView +/** + * Initialize the driver + */ +- (void)setDriver:(CocoaSubdriver*)drv +{ + driver = drv; +} +/** + * Define the opaqueness of the window / screen + * @return opaqueness of window / screen + */ +- (BOOL)isOpaque +{ + return YES; +} +/** + * Draws a rectangle on the screen. + * It's overwritten by the individual drivers but must be defined + */ +- (void)drawRect:(NSRect)invalidRect +{ + return; +} +@end + + + @implementation OTTD_CocoaWindowDelegate /** Initialize the video driver */ - (void)setDriver:(CocoaSubdriver*)drv -- cgit v1.2.3-54-g00ecf