Cocoa Port:
- Oops! Missed some files that should've been committed in r5083. (Regression from r5083.)
This commit is contained in:
parent
d880c58f75
commit
81772f1906
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2013 DeSmuME team
|
||||
Copyright (C) 2013-2015 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -65,8 +65,6 @@ class OGLVideoOutput;
|
|||
- (NSPoint) convertPointToDS:(NSPoint)clickLoc;
|
||||
- (BOOL) handleKeyPress:(NSEvent *)theEvent keyPressed:(BOOL)keyPressed;
|
||||
- (BOOL) handleMouseButton:(NSEvent *)theEvent buttonPressed:(BOOL)buttonPressed;
|
||||
- (void) clearToBlack;
|
||||
- (void) clearToWhite;
|
||||
- (void) requestScreenshot:(NSURL *)fileURL fileType:(NSBitmapImageFileType)fileType;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2013-2014 DeSmuME team
|
||||
Copyright (C) 2013-2015 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -1079,6 +1079,9 @@ static std::tr1::unordered_map<NSScreen *, DisplayWindowController *> _screenMap
|
|||
cdsVideoOutput = [[CocoaDSDisplayVideo alloc] init];
|
||||
[cdsVideoOutput setDelegate:view];
|
||||
|
||||
// Add the video thread to the output list.
|
||||
[emuControl addOutputToCore:cdsVideoOutput];
|
||||
|
||||
[NSThread detachNewThreadSelector:@selector(runThread:) toTarget:cdsVideoOutput withObject:nil];
|
||||
while ([cdsVideoOutput thread] == nil)
|
||||
{
|
||||
|
@ -1087,9 +1090,6 @@ static std::tr1::unordered_map<NSScreen *, DisplayWindowController *> _screenMap
|
|||
|
||||
// Setup default values per user preferences.
|
||||
[self setupUserDefaults];
|
||||
|
||||
// Add the video thread to the output list.
|
||||
[emuControl addOutputToCore:cdsVideoOutput];
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeMain:(NSNotification *)notification
|
||||
|
@ -1598,18 +1598,6 @@ static std::tr1::unordered_map<NSScreen *, DisplayWindowController *> _screenMap
|
|||
return isHandled;
|
||||
}
|
||||
|
||||
- (void) clearToBlack
|
||||
{
|
||||
DisplayWindowController *windowController = (DisplayWindowController *)[[self window] delegate];
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_SET_VIEW_TO_BLACK];
|
||||
}
|
||||
|
||||
- (void) clearToWhite
|
||||
{
|
||||
DisplayWindowController *windowController = (DisplayWindowController *)[[self window] delegate];
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_SET_VIEW_TO_WHITE];
|
||||
}
|
||||
|
||||
- (void) requestScreenshot:(NSURL *)fileURL fileType:(NSBitmapImageFileType)fileType
|
||||
{
|
||||
NSString *fileURLString = [fileURL absoluteString];
|
||||
|
@ -1771,7 +1759,7 @@ static std::tr1::unordered_map<NSScreen *, DisplayWindowController *> _screenMap
|
|||
// No init needed, so do nothing.
|
||||
}
|
||||
|
||||
- (void)doProcessVideoFrame:(const void *)videoFrameData displayMode:(const NSInteger)frameDisplayMode width:(const NSInteger)frameWidth height:(const NSInteger)frameHeight
|
||||
- (void)doLoadVideoFrame:(const void *)videoFrameData displayMode:(const NSInteger)frameDisplayMode width:(const NSInteger)frameWidth height:(const NSInteger)frameHeight
|
||||
{
|
||||
OGLDisplayLayer *display = oglv->GetDisplayLayer();
|
||||
|
||||
|
@ -1782,7 +1770,15 @@ static std::tr1::unordered_map<NSScreen *, DisplayWindowController *> _screenMap
|
|||
|
||||
CGLLockContext(cglDisplayContext);
|
||||
CGLSetCurrentContext(cglDisplayContext);
|
||||
oglv->ProcessOGL((uint16_t *)videoFrameData, frameWidth, frameHeight);
|
||||
display->LoadFrameOGL((uint16_t *)videoFrameData, frameWidth, frameHeight);
|
||||
CGLUnlockContext(cglDisplayContext);
|
||||
}
|
||||
|
||||
- (void)doProcessVideoFrame
|
||||
{
|
||||
CGLLockContext(cglDisplayContext);
|
||||
CGLSetCurrentContext(cglDisplayContext);
|
||||
oglv->ProcessOGL();
|
||||
[self drawVideoFrame];
|
||||
CGLUnlockContext(cglDisplayContext);
|
||||
}
|
||||
|
|
|
@ -314,14 +314,7 @@
|
|||
{
|
||||
DisplayWindowController *newWindowController = [[DisplayWindowController alloc] initWithWindowNibName:@"DisplayWindow" emuControlDelegate:self];
|
||||
|
||||
if ([self currentRom] == nil)
|
||||
{
|
||||
[[newWindowController view] clearToBlack];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[newWindowController view] setNeedsDisplay:YES];
|
||||
}
|
||||
[CocoaDSUtil messageSendOneWay:[[newWindowController cdsVideoOutput] receivePort] msgID:MESSAGE_REPROCESS_AND_REDRAW];
|
||||
|
||||
[[newWindowController window] makeKeyAndOrderFront:self];
|
||||
[[newWindowController window] makeMainWindow];
|
||||
|
@ -1441,12 +1434,10 @@
|
|||
}
|
||||
|
||||
[cdsCore reset];
|
||||
if ([cdsCore coreState] == CORESTATE_PAUSE)
|
||||
{
|
||||
|
||||
for (DisplayWindowController *windowController in windowList)
|
||||
{
|
||||
[[windowController view] clearToWhite];
|
||||
}
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_REPROCESS_AND_REDRAW];
|
||||
}
|
||||
|
||||
[self setStatusText:NSSTRING_STATUS_EMULATOR_RESET];
|
||||
|
@ -1747,9 +1738,10 @@
|
|||
// Update the UI to indicate that a ROM has indeed been loaded.
|
||||
[self updateAllWindowTitles];
|
||||
|
||||
GPU_FillScreenWithBGRA5551(0xFFFF);
|
||||
for (DisplayWindowController *windowController in windowList)
|
||||
{
|
||||
[[windowController view] clearToWhite];
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_REPROCESS_AND_REDRAW];
|
||||
}
|
||||
|
||||
[self setStatusText:NSSTRING_STATUS_ROM_LOADED];
|
||||
|
@ -1824,9 +1816,10 @@
|
|||
// Update the UI to indicate that the ROM has finished unloading.
|
||||
[self updateAllWindowTitles];
|
||||
|
||||
GPU_FillScreenWithBGRA5551(0x8000);
|
||||
for (DisplayWindowController *windowController in windowList)
|
||||
{
|
||||
[[windowController view] clearToBlack];
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_REPROCESS_AND_REDRAW];
|
||||
}
|
||||
|
||||
[self setStatusText:NSSTRING_STATUS_ROM_UNLOADED];
|
||||
|
|
|
@ -683,14 +683,7 @@
|
|||
}
|
||||
|
||||
// Draw the display view now so that we guarantee that its drawn at least once.
|
||||
if ([emuControl currentRom] == nil)
|
||||
{
|
||||
[[windowController view] clearToBlack];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[windowController view] setNeedsDisplay:YES];
|
||||
}
|
||||
[CocoaDSUtil messageSendOneWay:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_REPROCESS_AND_REDRAW];
|
||||
|
||||
// If this window is set to full screen mode, its associated screen index must
|
||||
// exist. If not, this window will not enter full screen mode. This is necessary,
|
||||
|
|
Loading…
Reference in New Issue