diff --git a/macosx/mac-cart.mm b/macosx/mac-cart.mm index 587127a9..d7d06ec8 100755 --- a/macosx/mac-cart.mm +++ b/macosx/mac-cart.mm @@ -213,6 +213,7 @@ #import #import +#import #import "mac-cocoatools.h" #import "mac-prefix.h" @@ -293,6 +294,26 @@ static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData) @end +@interface NSView (HICocoaViewDummy) +- (void) setNeedsDisplayOnHICocoaViewDummy; +@end + +@implementation NSView (HICocoaViewDummy) ++ (void) initialize +{ + /* Add a dummy instance method to make compatible with 10.10 or later */ + if (self == [NSView self]) { + SEL sel = @selector(setNeedsDisplayOnHICocoaView); + if (![NSView instancesRespondToSelector:sel]) { + Method m = class_getInstanceMethod([NSView class], @selector(setNeedsDisplayOnHICocoaViewDummy)); + IMP imp = method_getImplementation(m); + class_addMethod([NSView class], sel, imp, "v@"); + } + } +} +- (void) setNeedsDisplayOnHICocoaViewDummy{} +@end + bool8 NavOpenROMImage (FSRef *ref) {