diff --git a/desmume/src/frontend/cocoa/cocoa_GPU.mm b/desmume/src/frontend/cocoa/cocoa_GPU.mm index 0158f64f2..f4e206835 100644 --- a/desmume/src/frontend/cocoa/cocoa_GPU.mm +++ b/desmume/src/frontend/cocoa/cocoa_GPU.mm @@ -1146,7 +1146,7 @@ public: for (size_t i = 0; i < [screenList count]; i++) { NSScreen *screen = [screenList objectAtIndex:i]; - NSDictionary *deviceDescription = [screen deviceDescription]; + NSDictionary *deviceDescription = [screen deviceDescription]; NSNumber *idNumber = (NSNumber *)[deviceDescription valueForKey:@"NSScreenNumber"]; CGDirectDisplayID displayID = [idNumber unsignedIntValue]; diff --git a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib index a52ba3789..ae978c1f5 100644 --- a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib @@ -12,8 +12,6 @@ YES - - YES @@ -20742,7 +20740,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {1.7976931348623157e+308, 1.7976931348623157e+308} - + 256 YES @@ -21601,7 +21599,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {254, 242} - _NS:103 {{0, 0}, {1920, 1177}} @@ -30874,15 +30871,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 currentRom mainWindow mainWindow.displayRotation - mainWindow.videoFilterType - mainWindow.useBilinearOutput - mainWindow.useVerticalSync mainWindow.screenshotFileFormat selectedExportRomSaveID mainWindow.displayGap - mainWindow.outputFilter - mainWindow.videoSourceDeposterize - mainWindow.videoFiltersPreferGPU mainWindow.view.videoSourceDeposterize mainWindow.view.outputFilter mainWindow.view.sourceDeposterize @@ -30891,8 +30882,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 mainWindow.view.pixelScaler mainWindow.view.videoFiltersPreferGPU mainWindow.view.useVerticalSync - mainWindow.videoOutputFilter - mainWindow.videoPixelScaler mainWindow.view.canUseShaderBasedFilters mainWindow.view.isHUDVisible mainWindow.view.isHUDVideoFPSVisible @@ -41222,70 +41211,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 9298 - - - value: selection.mainWindow.videoSourceDeposterize - - - - - - value: selection.mainWindow.videoSourceDeposterize - value - selection.mainWindow.videoSourceDeposterize - 2 - - - 9319 - - - - selectedTag: selection.mainWindow.videoOutputFilter - - - - - - selectedTag: selection.mainWindow.videoOutputFilter - selectedTag - selection.mainWindow.videoOutputFilter - 2 - - - 9320 - - - - selectedTag: selection.mainWindow.videoPixelScaler - - - - - - selectedTag: selection.mainWindow.videoPixelScaler - selectedTag - selection.mainWindow.videoPixelScaler - 2 - - - 9321 - - - - value: selection.mainWindow.videoFiltersPreferGPU - - - - - - value: selection.mainWindow.videoFiltersPreferGPU - value - selection.mainWindow.videoFiltersPreferGPU - 2 - - - 9322 - selectedTag: values.DisplayView_OutputFilter @@ -44549,6 +44474,70 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 10516 + + + value: selection.mainWindow.view.videoFiltersPreferGPU + + + + + + value: selection.mainWindow.view.videoFiltersPreferGPU + value + selection.mainWindow.view.videoFiltersPreferGPU + 2 + + + 10517 + + + + value: selection.mainWindow.view.sourceDeposterize + + + + + + value: selection.mainWindow.view.sourceDeposterize + value + selection.mainWindow.view.sourceDeposterize + 2 + + + 10518 + + + + selectedTag: selection.mainWindow.view.outputFilter + + + + + + selectedTag: selection.mainWindow.view.outputFilter + selectedTag + selection.mainWindow.view.outputFilter + 2 + + + 10519 + + + + selectedTag: selection.mainWindow.view.pixelScaler + + + + + + selectedTag: selection.mainWindow.view.pixelScaler + selectedTag + selection.mainWindow.view.pixelScaler + 2 + + + 10520 + @@ -67301,7 +67290,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - 10516 + 10520 @@ -67794,14 +67783,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 userinterface/preferencesWindowDelegate.h - - DisplayView - NSView - - IBProjectSource - userinterface/DisplayWindowController.h - - DisplayWindowController NSWindowController @@ -68100,7 +68081,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 outputVolumeControlView outputVolumeMenuItem saveScreenshotPanelAccessoryView - view YES @@ -68111,7 +68091,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSView NSMenuItem NSView - DisplayView @@ -68125,7 +68104,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 outputVolumeControlView outputVolumeMenuItem saveScreenshotPanelAccessoryView - view YES @@ -68157,13 +68135,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 saveScreenshotPanelAccessoryView NSView - - view - DisplayView - - + + IBProjectSource + userinterface/DisplayWindowController.h + EmuControllerDelegate diff --git a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h index d745ed110..3b42e4d08 100644 --- a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h +++ b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h @@ -70,7 +70,6 @@ class OGLVideoOutput; NSView *view; EmuControllerDelegate *emuControl; - CocoaDSDisplayVideo *cdsVideoOutput; NSScreen *assignedScreen; NSWindow *masterWindow; @@ -100,7 +99,6 @@ class OGLVideoOutput; @property (retain) NSView *view; @property (retain) EmuControllerDelegate *emuControl; -@property (retain) CocoaDSDisplayVideo *cdsVideoOutput; @property (assign) NSScreen *assignedScreen; @property (retain) NSWindow *masterWindow; @@ -111,12 +109,6 @@ class OGLVideoOutput; @property (assign, nonatomic) double displayGap; @property (assign, nonatomic) double displayScale; @property (assign, nonatomic) double displayRotation; -@property (assign, nonatomic) NSInteger displayMainVideoSource; -@property (assign, nonatomic) NSInteger displayTouchVideoSource; -@property (assign) BOOL videoFiltersPreferGPU; -@property (assign) BOOL videoSourceDeposterize; -@property (assign) NSInteger videoOutputFilter; -@property (assign) NSInteger videoPixelScaler; @property (assign) NSInteger screenshotFileFormat; @property (assign) BOOL isMinSizeNormal; @property (assign) BOOL isShowingStatusBar; diff --git a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm index 9866b2af7..fbe146b0a 100644 --- a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm +++ b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm @@ -49,7 +49,6 @@ @synthesize dummyObject; @synthesize emuControl; -@synthesize cdsVideoOutput; @synthesize assignedScreen; @synthesize masterWindow; @synthesize view; @@ -64,12 +63,6 @@ @dynamic isFullScreen; @dynamic displayScale; @dynamic displayRotation; -@dynamic displayMainVideoSource; -@dynamic displayTouchVideoSource; -@dynamic videoFiltersPreferGPU; -@dynamic videoSourceDeposterize; -@dynamic videoOutputFilter; -@dynamic videoPixelScaler; @dynamic displayMode; @dynamic displayOrientation; @dynamic displayOrder; @@ -97,7 +90,6 @@ static std::unordered_map _screenMap; // view = nil; emuControl = [theEmuController retain]; - cdsVideoOutput = nil; assignedScreen = nil; masterWindow = nil; screenshotFileFormat = NSTIFFFileType; @@ -146,7 +138,6 @@ static std::unordered_map _screenMap; // [self setAssignedScreen:nil]; [self setView:nil]; [self setMasterWindow:nil]; - [self setCdsVideoOutput:nil]; [super dealloc]; } @@ -201,7 +192,7 @@ static std::unordered_map _screenMap; // if ([self isFullScreen]) { - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } else { @@ -216,7 +207,7 @@ static std::unordered_map _screenMap; // // display view to update itself. if (oldBounds.width == newBounds.width && oldBounds.height == newBounds.height) { - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } } } @@ -226,28 +217,6 @@ static std::unordered_map _screenMap; // return _localRotation; } -- (void) setDisplayMainVideoSource:(NSInteger)displaySourceID -{ - [[self view] setDisplayMainVideoSource:displaySourceID]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; -} - -- (NSInteger) displayMainVideoSource -{ - return [[self view] displayMainVideoSource]; -} - -- (void) setDisplayTouchVideoSource:(NSInteger)displaySourceID -{ - [[self view] setDisplayTouchVideoSource:displaySourceID]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; -} - -- (NSInteger) displayTouchVideoSource -{ - return [[self view] displayTouchVideoSource]; -} - - (void) setDisplayMode:(NSInteger)displayModeID { const BOOL willModeChangeSize = ( ((displayModeID == ClientDisplayMode_Main) || (displayModeID == ClientDisplayMode_Touch)) && (_localViewProps.mode == ClientDisplayMode_Dual) ) || @@ -263,7 +232,7 @@ static std::unordered_map _screenMap; // } else { - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } } @@ -283,7 +252,7 @@ static std::unordered_map _screenMap; // { if ([self isFullScreen]) { - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } else { @@ -300,7 +269,7 @@ static std::unordered_map _screenMap; // - (void) setDisplayOrder:(NSInteger)theOrder { _localViewProps.order = (ClientDisplayOrder)theOrder; - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } - (NSInteger) displayOrder @@ -327,7 +296,7 @@ static std::unordered_map _screenMap; // case ClientDisplayLayout_Hybrid_16_9: case ClientDisplayLayout_Hybrid_16_10: default: - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; break; } } @@ -337,7 +306,7 @@ static std::unordered_map _screenMap; // { case ClientDisplayLayout_Hybrid_16_9: case ClientDisplayLayout_Hybrid_16_10: - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; break; case ClientDisplayLayout_Horizontal: @@ -357,50 +326,6 @@ static std::unordered_map _screenMap; // return _localViewProps.gapScale; } -- (void) setVideoFiltersPreferGPU:(BOOL)theState -{ - [[self view] setVideoFiltersPreferGPU:theState]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; -} - -- (BOOL) videoFiltersPreferGPU -{ - return [[self view] videoFiltersPreferGPU]; -} - -- (void) setVideoSourceDeposterize:(BOOL)theState -{ - [[self view] setSourceDeposterize:theState]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; -} - -- (BOOL) videoSourceDeposterize -{ - return [[self view] sourceDeposterize]; -} - -- (void) setVideoOutputFilter:(NSInteger)filterID -{ - [[self view] setOutputFilter:filterID]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_REDRAW_VIEW]; -} - -- (NSInteger) videoOutputFilter -{ - return [[self view] outputFilter]; -} - -- (void) setVideoPixelScaler:(NSInteger)filterID -{ - [[self view] setPixelScaler:filterID]; - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; -} - -- (NSInteger) videoPixelScaler -{ - return [[self view] pixelScaler]; -} - - (void) setIsMinSizeNormal:(BOOL)theState { _isMinSizeNormal = theState; @@ -533,7 +458,7 @@ static std::unordered_map _screenMap; // // window size changed or not. if (oldBounds.width == newBounds.width && oldBounds.height == newBounds.height) { - [[self cdsVideoOutput] commitViewProperties:_localViewProps]; + [[[self view] cdsVideoOutput] commitViewProperties:_localViewProps]; } } @@ -559,8 +484,8 @@ static std::unordered_map _screenMap; // isMinSizeNormal:[self isMinSizeNormal] isShowingStatusBar:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_ShowStatusBar"]]; - [self setDisplayMainVideoSource:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_DisplayMainVideoSource"]]; - [self setDisplayTouchVideoSource:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_DisplayTouchVideoSource"]]; + [[self view] setDisplayMainVideoSource:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_DisplayMainVideoSource"]]; + [[self view] setDisplayTouchVideoSource:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_DisplayTouchVideoSource"]]; [self setVideoPropertiesWithoutUpdateUsingPreferGPU:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_FiltersPreferGPU"] sourceDeposterize:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_Deposterize"] @@ -751,7 +676,7 @@ static std::unordered_map _screenMap; // - (void) updateDisplayID { NSScreen *screen = [[self window] screen]; - NSDictionary *deviceDescription = [screen deviceDescription]; + NSDictionary *deviceDescription = [screen deviceDescription]; NSNumber *idNumber = (NSNumber *)[deviceDescription valueForKey:@"NSScreenNumber"]; CGDirectDisplayID displayID = [idNumber unsignedIntValue]; @@ -800,7 +725,7 @@ static std::unordered_map _screenMap; // - (IBAction) copy:(id)sender { - [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_COPY_TO_PASTEBOARD]; + [CocoaDSUtil messageSendOneWay:[[[self view] cdsVideoOutput] receivePort] msgID:MESSAGE_COPY_TO_PASTEBOARD]; } - (IBAction) changeHardwareMicGain:(id)sender @@ -1028,42 +953,42 @@ static std::unordered_map _screenMap; // if (tag >= DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE) { - if ((tag-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE) == [self displayTouchVideoSource]) + if ((tag-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE) == [[self view] displayTouchVideoSource]) { return; } - [self setDisplayTouchVideoSource:tag-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE]; + [[self view] setDisplayTouchVideoSource:tag-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE]; } else { - if ((tag-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE) == [self displayMainVideoSource]) + if ((tag-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE) == [[self view] displayMainVideoSource]) { return; } - [self setDisplayMainVideoSource:tag-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE]; + [[self view] setDisplayMainVideoSource:tag-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE]; } } - (IBAction) toggleVideoFiltersPreferGPU:(id)sender { - [self setVideoFiltersPreferGPU:![self videoFiltersPreferGPU]]; + [[self view] setVideoFiltersPreferGPU:![[self view] videoFiltersPreferGPU]]; } - (IBAction) toggleVideoSourceDeposterize:(id)sender { - [self setVideoSourceDeposterize:![self videoSourceDeposterize]]; + [[self view] setSourceDeposterize:![[self view] sourceDeposterize]]; } - (IBAction) changeVideoOutputFilter:(id)sender { - [self setVideoOutputFilter:[CocoaDSUtil getIBActionSenderTag:sender]]; + [[self view] setOutputFilter:[CocoaDSUtil getIBActionSenderTag:sender]]; } - (IBAction) changeVideoPixelScaler:(id)sender { - [self setVideoPixelScaler:[CocoaDSUtil getIBActionSenderTag:sender]]; + [[self view] setPixelScaler:[CocoaDSUtil getIBActionSenderTag:sender]]; } - (IBAction) toggleNDSDisplays:(id)sender @@ -1109,10 +1034,10 @@ static std::unordered_map _screenMap; // - (IBAction) writeDefaultsDisplayVideoSettings:(id)sender { - [[NSUserDefaults standardUserDefaults] setBool:[self videoFiltersPreferGPU] forKey:@"DisplayView_FiltersPreferGPU"]; - [[NSUserDefaults standardUserDefaults] setBool:[self videoSourceDeposterize] forKey:@"DisplayView_Deposterize"]; - [[NSUserDefaults standardUserDefaults] setInteger:[self videoOutputFilter] forKey:@"DisplayView_OutputFilter"]; - [[NSUserDefaults standardUserDefaults] setInteger:[self videoPixelScaler] forKey:@"DisplayView_VideoFilter"]; + [[NSUserDefaults standardUserDefaults] setBool:[[self view] videoFiltersPreferGPU] forKey:@"DisplayView_FiltersPreferGPU"]; + [[NSUserDefaults standardUserDefaults] setBool:[[self view] sourceDeposterize] forKey:@"DisplayView_Deposterize"]; + [[NSUserDefaults standardUserDefaults] setInteger:[[self view] outputFilter] forKey:@"DisplayView_OutputFilter"]; + [[NSUserDefaults standardUserDefaults] setInteger:[[self view] pixelScaler] forKey:@"DisplayView_VideoFilter"]; [[NSUserDefaults standardUserDefaults] synchronize]; } @@ -1216,11 +1141,11 @@ static std::unordered_map _screenMap; // { if ([theItem tag] >= DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE) { - [(NSMenuItem *)theItem setState:([self displayTouchVideoSource] == ([theItem tag]-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE)) ? NSOnState : NSOffState]; + [(NSMenuItem *)theItem setState:([[self view] displayTouchVideoSource] == ([theItem tag]-DISPLAY_VIDEO_SOURCE_TOUCH_TAG_BASE)) ? NSOnState : NSOffState]; } else { - [(NSMenuItem *)theItem setState:([self displayMainVideoSource] == ([theItem tag]-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE)) ? NSOnState : NSOffState]; + [(NSMenuItem *)theItem setState:([[self view] displayMainVideoSource] == ([theItem tag]-DISPLAY_VIDEO_SOURCE_MAIN_TAG_BASE)) ? NSOnState : NSOffState]; } } } @@ -1228,7 +1153,7 @@ static std::unordered_map _screenMap; // { if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) { - [(NSMenuItem *)theItem setState:([self videoOutputFilter] == [theItem tag]) ? NSOnState : NSOffState]; + [(NSMenuItem *)theItem setState:([[self view] outputFilter] == [theItem tag]) ? NSOnState : NSOffState]; enable = ([theItem tag] == OutputFilterTypeID_NearestNeighbor || [theItem tag] == OutputFilterTypeID_Bilinear) || [[self view] canUseShaderBasedFilters]; } } @@ -1236,7 +1161,7 @@ static std::unordered_map _screenMap; // { if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) { - [(NSMenuItem *)theItem setState:([self videoSourceDeposterize]) ? NSOnState : NSOffState]; + [(NSMenuItem *)theItem setState:([[self view] sourceDeposterize]) ? NSOnState : NSOffState]; } enable = [[self view] canUseShaderBasedFilters]; @@ -1252,7 +1177,7 @@ static std::unordered_map _screenMap; // { if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) { - [(NSMenuItem *)theItem setState:([self videoPixelScaler] == [theItem tag]) ? NSOnState : NSOffState]; + [(NSMenuItem *)theItem setState:([[self view] pixelScaler] == [theItem tag]) ? NSOnState : NSOffState]; bool isSupportingCPU = false; bool isSupportingShader = false; @@ -1397,7 +1322,7 @@ static std::unordered_map _screenMap; // [outputVolumeMenuItem setView:outputVolumeControlView]; // Set up the video output thread. - CocoaDSDisplayVideo *newDisplayOutput = [[CocoaDSDisplayVideo alloc] init]; + CocoaDSDisplayVideo *newDisplayOutput = [[[CocoaDSDisplayVideo alloc] init] autorelease]; [newDisplayOutput setClientDisplayView:[view clientDisplay3DView]]; ClientDisplayView *cdv = [newDisplayOutput clientDisplayView]; @@ -1413,7 +1338,6 @@ static std::unordered_map _screenMap; // cdv->LoadHUDFont(); } - [self setCdsVideoOutput:newDisplayOutput]; [newView setCdsVideoOutput:newDisplayOutput]; // Add the video thread to the output list. @@ -1543,10 +1467,8 @@ static std::unordered_map _screenMap; // - (void)windowWillClose:(NSNotification *)notification { - [emuControl removeOutputFromCore:[self cdsVideoOutput]]; - [[self cdsVideoOutput] forceThreadExit]; - [[self cdsVideoOutput] release]; - [self setCdsVideoOutput:nil]; + [emuControl removeOutputFromCore:[[self view] cdsVideoOutput]]; + [[[self view] cdsVideoOutput] forceThreadExit]; [[emuControl windowList] removeObject:self]; @@ -1568,7 +1490,7 @@ static std::unordered_map _screenMap; // - (void)windowDidChangeScreen:(NSNotification *)notification { [self updateDisplayID]; - [[view cdsVideoOutput] clientDisplayView]->UpdateView(); + [[[self view] cdsVideoOutput] clientDisplayView]->UpdateView(); } #if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) @@ -2065,6 +1987,8 @@ static std::unordered_map _screenMap; // { [macSharedData decrementViewsUsingDirectToCPUFiltering]; } + + [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } } @@ -2094,6 +2018,8 @@ static std::unordered_map _screenMap; // { [macSharedData decrementViewsUsingDirectToCPUFiltering]; } + + [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } } @@ -2105,6 +2031,7 @@ static std::unordered_map _screenMap; // - (void) setOutputFilter:(NSInteger)filterID { [[self cdsVideoOutput] setOutputFilter:filterID]; + [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_REDRAW_VIEW]; } - (NSInteger) outputFilter @@ -2133,6 +2060,8 @@ static std::unordered_map _screenMap; // { [macSharedData decrementViewsUsingDirectToCPUFiltering]; } + + [CocoaDSUtil messageSendOneWay:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } } diff --git a/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm index 88f2337e8..7c3351768 100644 --- a/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm @@ -321,7 +321,7 @@ const BOOL useVerticalSync = ([[newWindowController view] layer] != nil) || [cdsCore isFrameSkipEnabled] || (([cdsCore speedScalar] < 1.03f) && [cdsCore isSpeedLimitEnabled]); [[newWindowController view] setUseVerticalSync:useVerticalSync]; - [[newWindowController cdsVideoOutput] handleReloadReprocessRedraw]; + [[[newWindowController view] cdsVideoOutput] handleReloadReprocessRedraw]; [[newWindowController window] makeKeyAndOrderFront:self]; [[newWindowController window] makeMainWindow]; } @@ -1495,7 +1495,7 @@ for (DisplayWindowController *windowController in windowList) { - [CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; + [CocoaDSUtil messageSendOneWay:[[[windowController view] cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } [self setStatusText:NSSTRING_STATUS_EMULATOR_RESET]; @@ -1798,7 +1798,7 @@ for (DisplayWindowController *windowController in windowList) { - [CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; + [CocoaDSUtil messageSendOneWay:[[[windowController view] cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } [self setStatusText:NSSTRING_STATUS_ROM_LOADED]; @@ -1877,7 +1877,7 @@ [[cdsCore cdsGPU] clearWithColor:0x8000]; for (DisplayWindowController *windowController in windowList) { - [CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; + [CocoaDSUtil messageSendOneWay:[[[windowController view] cdsVideoOutput] receivePort] msgID:MESSAGE_RELOAD_REPROCESS_REDRAW]; } [self setStatusText:NSSTRING_STATUS_ROM_UNLOADED]; diff --git a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm index cc5f0ec19..f706c3706 100644 --- a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm +++ b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm @@ -645,8 +645,8 @@ isMinSizeNormal:isMinSizeNormal isShowingStatusBar:isShowingStatusBar]; - [windowController setDisplayMainVideoSource:displayMainSource]; - [windowController setDisplayTouchVideoSource:displayTouchSource]; + [[windowController view] setDisplayMainVideoSource:displayMainSource]; + [[windowController view] setDisplayTouchVideoSource:displayTouchSource]; [windowController setVideoPropertiesWithoutUpdateUsingPreferGPU:videoFiltersPreferGPU sourceDeposterize:videoSourceDeposterize @@ -680,7 +680,7 @@ // Otherwise, just order the window to the front so that the windows will // stack in a deterministic order. [[windowController view] setAllowViewUpdates:YES]; - [[windowController cdsVideoOutput] handleReloadReprocessRedraw]; + [[[windowController view] cdsVideoOutput] handleReloadReprocessRedraw]; if (windowProperties == [windowPropertiesList lastObject]) { @@ -727,16 +727,16 @@ [NSNumber numberWithInteger:[windowController displayMode]], @"displayMode", [NSNumber numberWithDouble:[windowController masterWindowScale]], @"displayScale", [NSNumber numberWithDouble:[windowController displayRotation]], @"displayRotation", - [NSNumber numberWithInteger:[windowController displayMainVideoSource]], @"displayMainVideoSource", - [NSNumber numberWithInteger:[windowController displayTouchVideoSource]], @"displayTouchVideoSource", + [NSNumber numberWithInteger:[[windowController view] displayMainVideoSource]], @"displayMainVideoSource", + [NSNumber numberWithInteger:[[windowController view] displayTouchVideoSource]], @"displayTouchVideoSource", [NSNumber numberWithInteger:[windowController displayOrientation]], @"displayOrientation", [NSNumber numberWithInteger:[windowController displayOrder]], @"displayOrder", [NSNumber numberWithDouble:[windowController displayGap]], @"displayGap", - [NSNumber numberWithBool:[windowController videoFiltersPreferGPU]], @"videoFiltersPreferGPU", - [NSNumber numberWithInteger:[windowController videoPixelScaler]], @"videoFilterType", + [NSNumber numberWithBool:[[windowController view] videoFiltersPreferGPU]], @"videoFiltersPreferGPU", + [NSNumber numberWithInteger:[[windowController view] pixelScaler]], @"videoFilterType", [NSNumber numberWithInteger:[windowController screenshotFileFormat]], @"screenshotFileFormat", - [NSNumber numberWithInteger:[windowController videoOutputFilter]], @"videoOutputFilter", - [NSNumber numberWithBool:[windowController videoSourceDeposterize]], @"videoSourceDeposterize", + [NSNumber numberWithInteger:[[windowController view] outputFilter]], @"videoOutputFilter", + [NSNumber numberWithBool:[[windowController view] sourceDeposterize]], @"videoSourceDeposterize", [NSNumber numberWithBool:[[windowController view] useVerticalSync]], @"useVerticalSync", [NSNumber numberWithBool:[[windowController view] isHUDVisible]], @"hudEnable", [NSNumber numberWithBool:[[windowController view] isHUDVideoFPSVisible]], @"hudShowVideoFPS",