Cocoa Port: Add new HUD item, “Show Execution Speed”, which displays the emulator’s execution speed as a percentage.
This commit is contained in:
parent
87335dd57a
commit
b48666ea9c
|
@ -81,6 +81,7 @@ void ClientDisplayPresenter::__InstanceInit(const ClientDisplayPresenterProperti
|
|||
|
||||
_hudObjectScale = 1.0;
|
||||
_isHUDVisible = false;
|
||||
_showExecutionSpeed = false;
|
||||
_showVideoFPS = true;
|
||||
_showRender3DFPS = false;
|
||||
_showFrameIndex = false;
|
||||
|
@ -89,6 +90,7 @@ void ClientDisplayPresenter::__InstanceInit(const ClientDisplayPresenterProperti
|
|||
_showRTC = false;
|
||||
_showInputs = false;
|
||||
|
||||
_hudColorExecutionSpeed = LE_TO_LOCAL_32(0xFFFFFFFF);
|
||||
_hudColorVideoFPS = LE_TO_LOCAL_32(0xFFFFFFFF);
|
||||
_hudColorRender3DFPS = LE_TO_LOCAL_32(0xFFFFFFFF);
|
||||
_hudColorFrameIndex = LE_TO_LOCAL_32(0xFFFFFFFF);
|
||||
|
@ -149,6 +151,22 @@ void ClientDisplayPresenter::_UpdateHUDString()
|
|||
std::ostringstream ss;
|
||||
ss << "\x01"; // This represents the text box. It must always be the first character.
|
||||
|
||||
if (this->_showExecutionSpeed)
|
||||
{
|
||||
if (this->_ndsFrameInfo.executionSpeed < 0.0001)
|
||||
{
|
||||
ss << "Execution Speed: -----%\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[48];
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
snprintf(buffer, 47, "Execution Speed: %3.01f%%\n", this->_ndsFrameInfo.executionSpeed);
|
||||
|
||||
ss << buffer;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->_showVideoFPS)
|
||||
{
|
||||
ss << "Video FPS: " << this->_clientFrameInfo.videoFPS << "\n";
|
||||
|
@ -516,6 +534,17 @@ void ClientDisplayPresenter::SetHUDVisibility(const bool visibleState)
|
|||
this->UpdateLayout();
|
||||
}
|
||||
|
||||
bool ClientDisplayPresenter::GetHUDShowExecutionSpeed() const
|
||||
{
|
||||
return this->_showExecutionSpeed;
|
||||
}
|
||||
|
||||
void ClientDisplayPresenter::SetHUDShowExecutionSpeed(const bool visibleState)
|
||||
{
|
||||
this->_SetHUDShowInfoItem(this->_showExecutionSpeed, visibleState);
|
||||
this->UpdateLayout();
|
||||
}
|
||||
|
||||
bool ClientDisplayPresenter::GetHUDShowVideoFPS() const
|
||||
{
|
||||
return this->_showVideoFPS;
|
||||
|
@ -593,6 +622,22 @@ void ClientDisplayPresenter::SetHUDShowInput(const bool visibleState)
|
|||
this->UpdateLayout();
|
||||
}
|
||||
|
||||
uint32_t ClientDisplayPresenter::GetHUDColorExecutionSpeed() const
|
||||
{
|
||||
return this->_hudColorExecutionSpeed;
|
||||
}
|
||||
|
||||
void ClientDisplayPresenter::SetHUDColorExecutionSpeed(uint32_t color32)
|
||||
{
|
||||
this->_hudColorExecutionSpeed = color32;
|
||||
|
||||
pthread_mutex_lock(&this->_mutexHUDString);
|
||||
this->_hudNeedsUpdate = true;
|
||||
pthread_mutex_unlock(&this->_mutexHUDString);
|
||||
|
||||
this->UpdateLayout();
|
||||
}
|
||||
|
||||
uint32_t ClientDisplayPresenter::GetHUDColorVideoFPS() const
|
||||
{
|
||||
return this->_hudColorVideoFPS;
|
||||
|
@ -1790,6 +1835,7 @@ void ClientDisplay3DPresenter::SetHUDColorVertices(uint32_t *vtxColorBufferPtr)
|
|||
vtxColorBufferPtr[3] = currentColor;
|
||||
|
||||
// Calculate the colors of the remaining characters in the string.
|
||||
bool alreadyColoredExecutionSpeed = false;
|
||||
bool alreadyColoredVideoFPS = false;
|
||||
bool alreadyColoredRender3DFPS = false;
|
||||
bool alreadyColoredFrameIndex = false;
|
||||
|
@ -1797,7 +1843,12 @@ void ClientDisplay3DPresenter::SetHUDColorVertices(uint32_t *vtxColorBufferPtr)
|
|||
bool alreadyColoredCPULoadAverage = false;
|
||||
bool alreadyColoredRTC = false;
|
||||
|
||||
if (this->_showVideoFPS)
|
||||
if (this->_showExecutionSpeed)
|
||||
{
|
||||
currentColor = this->_hudColorExecutionSpeed;
|
||||
alreadyColoredExecutionSpeed = true;
|
||||
}
|
||||
else if (this->_showVideoFPS)
|
||||
{
|
||||
currentColor = this->_hudColorVideoFPS;
|
||||
alreadyColoredVideoFPS = true;
|
||||
|
@ -1837,7 +1888,12 @@ void ClientDisplay3DPresenter::SetHUDColorVertices(uint32_t *vtxColorBufferPtr)
|
|||
|
||||
if (c == '\n')
|
||||
{
|
||||
if (this->_showVideoFPS && !alreadyColoredVideoFPS)
|
||||
if (this->_showExecutionSpeed && !alreadyColoredExecutionSpeed)
|
||||
{
|
||||
currentColor = this->_hudColorExecutionSpeed;
|
||||
alreadyColoredExecutionSpeed = true;
|
||||
}
|
||||
else if (this->_showVideoFPS && !alreadyColoredVideoFPS)
|
||||
{
|
||||
currentColor = this->_hudColorVideoFPS;
|
||||
alreadyColoredVideoFPS = true;
|
||||
|
|
|
@ -155,6 +155,7 @@ protected:
|
|||
|
||||
double _hudObjectScale;
|
||||
bool _isHUDVisible;
|
||||
bool _showExecutionSpeed;
|
||||
bool _showVideoFPS;
|
||||
bool _showRender3DFPS;
|
||||
bool _showFrameIndex;
|
||||
|
@ -163,6 +164,7 @@ protected:
|
|||
bool _showRTC;
|
||||
bool _showInputs;
|
||||
|
||||
uint32_t _hudColorExecutionSpeed;
|
||||
uint32_t _hudColorVideoFPS;
|
||||
uint32_t _hudColorRender3DFPS;
|
||||
uint32_t _hudColorFrameIndex;
|
||||
|
@ -258,6 +260,8 @@ public:
|
|||
|
||||
bool GetHUDVisibility() const;
|
||||
virtual void SetHUDVisibility(const bool visibleState);
|
||||
bool GetHUDShowExecutionSpeed() const;
|
||||
virtual void SetHUDShowExecutionSpeed(const bool visibleState);
|
||||
bool GetHUDShowVideoFPS() const;
|
||||
virtual void SetHUDShowVideoFPS(const bool visibleState);
|
||||
bool GetHUDShowRender3DFPS() const;
|
||||
|
@ -272,6 +276,8 @@ public:
|
|||
virtual void SetHUDShowRTC(const bool visibleState);
|
||||
bool GetHUDShowInput() const;
|
||||
virtual void SetHUDShowInput(const bool visibleState);
|
||||
uint32_t GetHUDColorExecutionSpeed() const;
|
||||
virtual void SetHUDColorExecutionSpeed(uint32_t color32);
|
||||
uint32_t GetHUDColorVideoFPS() const;
|
||||
virtual void SetHUDColorVideoFPS(uint32_t color32);
|
||||
uint32_t GetHUDColorRender3DFPS() const;
|
||||
|
|
|
@ -963,6 +963,11 @@ const NDSFrameInfo& ClientExecutionControl::GetNDSFrameInfo()
|
|||
return this->_ndsFrameInfo;
|
||||
}
|
||||
|
||||
void ClientExecutionControl::SetFrameInfoExecutionSpeed(double executionSpeed)
|
||||
{
|
||||
this->_ndsFrameInfo.executionSpeed = executionSpeed;
|
||||
}
|
||||
|
||||
uint64_t ClientExecutionControl::GetFrameIndex()
|
||||
{
|
||||
pthread_mutex_lock(&this->_mutexOutputPostNDSExec);
|
||||
|
|
|
@ -111,6 +111,7 @@ struct NDSFrameInfo
|
|||
uint32_t lagFrameCount;
|
||||
uint32_t cpuLoadAvgARM9;
|
||||
uint32_t cpuLoadAvgARM7;
|
||||
double executionSpeed;
|
||||
|
||||
NDSInputState inputStatesPending;
|
||||
uint8_t touchLocXPending;
|
||||
|
@ -137,6 +138,7 @@ struct NDSFrameInfo
|
|||
this->lagFrameCount = 0;
|
||||
this->cpuLoadAvgARM9 = 0;
|
||||
this->cpuLoadAvgARM7 = 0;
|
||||
this->executionSpeed = 0.0;
|
||||
|
||||
this->inputStatesPending.value = INPUT_STATES_CLEAR_VALUE;
|
||||
this->touchLocXPending = 0;
|
||||
|
@ -164,6 +166,7 @@ struct NDSFrameInfo
|
|||
this->lagFrameCount = fromObject.lagFrameCount;
|
||||
this->cpuLoadAvgARM9 = fromObject.cpuLoadAvgARM9;
|
||||
this->cpuLoadAvgARM7 = fromObject.cpuLoadAvgARM7;
|
||||
this->executionSpeed = fromObject.executionSpeed;
|
||||
|
||||
this->inputStatesPending = fromObject.inputStatesPending;
|
||||
this->touchLocXPending = fromObject.touchLocXPending;
|
||||
|
@ -308,6 +311,7 @@ public:
|
|||
|
||||
void FetchOutputPostNDSExec();
|
||||
const NDSFrameInfo& GetNDSFrameInfo();
|
||||
void SetFrameInfoExecutionSpeed(double executionSpeed);
|
||||
uint64_t GetFrameIndex();
|
||||
|
||||
double GetFrameTime();
|
||||
|
|
|
@ -104,6 +104,8 @@
|
|||
<true/>
|
||||
<key>General_WillRestoreDisplayWindows</key>
|
||||
<true/>
|
||||
<key>HUD_ShowExecutionSpeed</key>
|
||||
<false/>
|
||||
<key>HUD_ShowVideoFPS</key>
|
||||
<true/>
|
||||
<key>HUD_ShowRender3DFPS</key>
|
||||
|
@ -118,6 +120,8 @@
|
|||
<false/>
|
||||
<key>HUD_ShowInput</key>
|
||||
<false/>
|
||||
<key>HUD_Color_ExecutionSpeed</key>
|
||||
<integer>4294967295</integer>
|
||||
<key>HUD_Color_VideoFPS</key>
|
||||
<integer>4294967295</integer>
|
||||
<key>HUD_Color_Render3DFPS</key>
|
||||
|
|
|
@ -1118,6 +1118,10 @@ static void* RunCoreThread(void *arg)
|
|||
double startTime = 0;
|
||||
double frameTime = 0; // The amount of time that is expected for the frame to run.
|
||||
|
||||
const double standardNDSFrameTime = execControl->CalculateFrameAbsoluteTime(1.0);
|
||||
double executionSpeedAverage = 0.0;
|
||||
double executionSpeedAverageFramesCollected = 0.0;
|
||||
|
||||
ExecutionBehavior behavior = ExecutionBehavior_Pause;
|
||||
uint64_t frameJumpTarget = 0;
|
||||
|
||||
|
@ -1176,6 +1180,26 @@ static void* RunCoreThread(void *arg)
|
|||
|
||||
const uint8_t framesToSkip = execControl->GetFramesToSkip();
|
||||
|
||||
if ( (behavior == ExecutionBehavior_Run) || (behavior == ExecutionBehavior_FrameJump) )
|
||||
{
|
||||
if ((ndsFrameInfo.frameIndex & 0x1F) == 0x1F)
|
||||
{
|
||||
if (executionSpeedAverageFramesCollected > 0.0001)
|
||||
{
|
||||
execControl->SetFrameInfoExecutionSpeed((executionSpeedAverage / executionSpeedAverageFramesCollected) * 100.0);
|
||||
}
|
||||
|
||||
executionSpeedAverage = 0.0;
|
||||
executionSpeedAverageFramesCollected = 0.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
execControl->SetFrameInfoExecutionSpeed(0.0);
|
||||
executionSpeedAverage = 0.0;
|
||||
executionSpeedAverageFramesCollected = 0.0;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(¶m->mutexOutputList);
|
||||
|
||||
switch (behavior)
|
||||
|
@ -1267,6 +1291,10 @@ static void* RunCoreThread(void *arg)
|
|||
execControl->WaitUntilAbsoluteTime(startTime + frameTime);
|
||||
}
|
||||
|
||||
const double currentExecutionSpeed = standardNDSFrameTime / (execControl->GetCurrentAbsoluteTime() - startTime);
|
||||
executionSpeedAverage += currentExecutionSpeed;
|
||||
executionSpeedAverageFramesCollected += 1.0;
|
||||
|
||||
} while(true);
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
@property (readonly, nonatomic) BOOL canFilterOnGPU;
|
||||
@property (readonly, nonatomic) BOOL willFilterOnGPU;
|
||||
@property (assign) BOOL isHUDVisible;
|
||||
@property (assign) BOOL isHUDExecutionSpeedVisible;
|
||||
@property (assign) BOOL isHUDVideoFPSVisible;
|
||||
@property (assign) BOOL isHUDRender3DFPSVisible;
|
||||
@property (assign) BOOL isHUDFrameIndexVisible;
|
||||
|
@ -140,6 +141,7 @@
|
|||
@property (assign) BOOL isHUDCPULoadAverageVisible;
|
||||
@property (assign) BOOL isHUDRealTimeClockVisible;
|
||||
@property (assign) BOOL isHUDInputVisible;
|
||||
@property (assign) uint32_t hudColorExecutionSpeed;
|
||||
@property (assign) uint32_t hudColorVideoFPS;
|
||||
@property (assign) uint32_t hudColorRender3DFPS;
|
||||
@property (assign) uint32_t hudColorFrameIndex;
|
||||
|
|
|
@ -574,6 +574,7 @@
|
|||
@dynamic canFilterOnGPU;
|
||||
@dynamic willFilterOnGPU;
|
||||
@dynamic isHUDVisible;
|
||||
@dynamic isHUDExecutionSpeedVisible;
|
||||
@dynamic isHUDVideoFPSVisible;
|
||||
@dynamic isHUDRender3DFPSVisible;
|
||||
@dynamic isHUDFrameIndexVisible;
|
||||
|
@ -581,6 +582,7 @@
|
|||
@dynamic isHUDCPULoadAverageVisible;
|
||||
@dynamic isHUDRealTimeClockVisible;
|
||||
@dynamic isHUDInputVisible;
|
||||
@dynamic hudColorExecutionSpeed;
|
||||
@dynamic hudColorVideoFPS;
|
||||
@dynamic hudColorRender3DFPS;
|
||||
@dynamic hudColorFrameIndex;
|
||||
|
@ -664,6 +666,24 @@
|
|||
return theState;
|
||||
}
|
||||
|
||||
- (void) setIsHUDExecutionSpeedVisible:(BOOL)theState
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
_cdv->Get3DPresenter()->SetHUDShowExecutionSpeed((theState) ? true : false);
|
||||
OSSpinLockUnlock(&spinlockIsHUDVisible);
|
||||
|
||||
_cdv->SetViewNeedsFlush();
|
||||
}
|
||||
|
||||
- (BOOL) isHUDExecutionSpeedVisible
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
const BOOL theState = (_cdv->Get3DPresenter()->GetHUDShowExecutionSpeed()) ? YES : NO;
|
||||
OSSpinLockUnlock(&spinlockIsHUDVisible);
|
||||
|
||||
return theState;
|
||||
}
|
||||
|
||||
- (void) setIsHUDVideoFPSVisible:(BOOL)theState
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
|
@ -790,6 +810,24 @@
|
|||
return theState;
|
||||
}
|
||||
|
||||
- (void) setHudColorExecutionSpeed:(uint32_t)theColor
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
_cdv->Get3DPresenter()->SetHUDColorExecutionSpeed(theColor);
|
||||
OSSpinLockUnlock(&spinlockIsHUDVisible);
|
||||
|
||||
_cdv->SetViewNeedsFlush();
|
||||
}
|
||||
|
||||
- (uint32_t) hudColorExecutionSpeed
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
const uint32_t color32 = _cdv->Get3DPresenter()->GetHUDColorExecutionSpeed();
|
||||
OSSpinLockUnlock(&spinlockIsHUDVisible);
|
||||
|
||||
return color32;
|
||||
}
|
||||
|
||||
- (void) setHudColorVideoFPS:(uint32_t)theColor
|
||||
{
|
||||
OSSpinLockLock(&spinlockIsHUDVisible);
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,7 @@ class MacDisplayLayeredView;
|
|||
@property (readonly) BOOL canUseShaderBasedFilters;
|
||||
@property (assign, nonatomic) BOOL allowViewUpdates;
|
||||
@property (assign) BOOL isHUDVisible;
|
||||
@property (assign) BOOL isHUDExecutionSpeedVisible;
|
||||
@property (assign) BOOL isHUDVideoFPSVisible;
|
||||
@property (assign) BOOL isHUDRender3DFPSVisible;
|
||||
@property (assign) BOOL isHUDFrameIndexVisible;
|
||||
|
@ -52,6 +53,7 @@ class MacDisplayLayeredView;
|
|||
@property (assign) BOOL isHUDCPULoadAverageVisible;
|
||||
@property (assign) BOOL isHUDRealTimeClockVisible;
|
||||
@property (assign) BOOL isHUDInputVisible;
|
||||
@property (assign) NSColor *hudColorExecutionSpeed;
|
||||
@property (assign) NSColor *hudColorVideoFPS;
|
||||
@property (assign) NSColor *hudColorRender3DFPS;
|
||||
@property (assign) NSColor *hudColorFrameIndex;
|
||||
|
|
|
@ -160,6 +160,7 @@ class OGLVideoOutput;
|
|||
- (IBAction) changeVideoOutputFilter:(id)sender;
|
||||
- (IBAction) changeVideoPixelScaler:(id)sender;
|
||||
- (IBAction) toggleHUDVisibility:(id)sender;
|
||||
- (IBAction) toggleShowHUDExecutionSpeed:(id)sender;
|
||||
- (IBAction) toggleShowHUDVideoFPS:(id)sender;
|
||||
- (IBAction) toggleShowHUDRender3DFPS:(id)sender;
|
||||
- (IBAction) toggleShowHUDFrameIndex:(id)sender;
|
||||
|
|
|
@ -485,6 +485,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
pixelScaler:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_VideoFilter"]];
|
||||
|
||||
[[self view] setIsHUDVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_EnableHUD"]];
|
||||
[[self view] setIsHUDExecutionSpeedVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowExecutionSpeed"]];
|
||||
[[self view] setIsHUDVideoFPSVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowVideoFPS"]];
|
||||
[[self view] setIsHUDRender3DFPSVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowRender3DFPS"]];
|
||||
[[self view] setIsHUDFrameIndexVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowFrameIndex"]];
|
||||
|
@ -493,6 +494,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
[[self view] setIsHUDRealTimeClockVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowRTC"]];
|
||||
[[self view] setIsHUDInputVisible:[[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowInput"]];
|
||||
|
||||
[[self view] setHudColorExecutionSpeed:[CocoaDSUtil NSColorFromRGBA8888:LE_TO_LOCAL_32([[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_ExecutionSpeed"])]];
|
||||
[[self view] setHudColorVideoFPS:[CocoaDSUtil NSColorFromRGBA8888:LE_TO_LOCAL_32([[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_VideoFPS"])]];
|
||||
[[self view] setHudColorRender3DFPS:[CocoaDSUtil NSColorFromRGBA8888:LE_TO_LOCAL_32([[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_Render3DFPS"])]];
|
||||
[[self view] setHudColorFrameIndex:[CocoaDSUtil NSColorFromRGBA8888:LE_TO_LOCAL_32([[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_FrameIndex"])]];
|
||||
|
@ -719,6 +721,11 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
[[self view] setIsHUDVisible:![[self view] isHUDVisible]];
|
||||
}
|
||||
|
||||
- (IBAction) toggleShowHUDExecutionSpeed:(id)sender
|
||||
{
|
||||
[[self view] setIsHUDExecutionSpeedVisible:![[self view] isHUDExecutionSpeedVisible]];
|
||||
}
|
||||
|
||||
- (IBAction) toggleShowHUDVideoFPS:(id)sender
|
||||
{
|
||||
[[self view] setIsHUDVideoFPSVisible:![[self view] isHUDVideoFPSVisible]];
|
||||
|
@ -962,6 +969,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
- (IBAction) writeDefaultsHUDSettings:(id)sender
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDVisible] forKey:@"DisplayView_EnableHUD"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDExecutionSpeedVisible] forKey:@"HUD_ShowExecutionSpeed"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDVideoFPSVisible] forKey:@"HUD_ShowVideoFPS"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDRender3DFPSVisible] forKey:@"HUD_ShowRender3DFPS"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDFrameIndexVisible] forKey:@"HUD_ShowFrameIndex"];
|
||||
|
@ -970,6 +978,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDRealTimeClockVisible] forKey:@"HUD_ShowRTC"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[[self view] isHUDInputVisible] forKey:@"HUD_ShowInput"];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[CocoaDSUtil RGBA8888FromNSColor:[[self view] hudColorExecutionSpeed]] forKey:@"HUD_Color_ExecutionSpeed"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[CocoaDSUtil RGBA8888FromNSColor:[[self view] hudColorVideoFPS]] forKey:@"HUD_Color_VideoFPS"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[CocoaDSUtil RGBA8888FromNSColor:[[self view] hudColorRender3DFPS]] forKey:@"HUD_Color_Render3DFPS"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[CocoaDSUtil RGBA8888FromNSColor:[[self view] hudColorFrameIndex]] forKey:@"HUD_Color_FrameIndex"];
|
||||
|
@ -1144,6 +1153,13 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
[(NSMenuItem *)theItem setState:([[self view] isHUDVisible]) ? NSOnState : NSOffState];
|
||||
}
|
||||
}
|
||||
else if (theAction == @selector(toggleShowHUDExecutionSpeed:))
|
||||
{
|
||||
if ([(id)theItem isMemberOfClass:[NSMenuItem class]])
|
||||
{
|
||||
[(NSMenuItem *)theItem setState:([[self view] isHUDExecutionSpeedVisible]) ? NSOnState : NSOffState];
|
||||
}
|
||||
}
|
||||
else if (theAction == @selector(toggleShowHUDVideoFPS:))
|
||||
{
|
||||
if ([(id)theItem isMemberOfClass:[NSMenuItem class]])
|
||||
|
@ -1595,6 +1611,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
@dynamic canUseShaderBasedFilters;
|
||||
@dynamic allowViewUpdates;
|
||||
@dynamic isHUDVisible;
|
||||
@dynamic isHUDExecutionSpeedVisible;
|
||||
@dynamic isHUDVideoFPSVisible;
|
||||
@dynamic isHUDRender3DFPSVisible;
|
||||
@dynamic isHUDFrameIndexVisible;
|
||||
|
@ -1602,6 +1619,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
@dynamic isHUDCPULoadAverageVisible;
|
||||
@dynamic isHUDRealTimeClockVisible;
|
||||
@dynamic isHUDInputVisible;
|
||||
@dynamic hudColorExecutionSpeed;
|
||||
@dynamic hudColorVideoFPS;
|
||||
@dynamic hudColorRender3DFPS;
|
||||
@dynamic hudColorFrameIndex;
|
||||
|
@ -1745,6 +1763,16 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
return [[self cdsVideoOutput] isHUDVisible];
|
||||
}
|
||||
|
||||
- (void) setIsHUDExecutionSpeedVisible:(BOOL)theState
|
||||
{
|
||||
[[self cdsVideoOutput] setIsHUDExecutionSpeedVisible:theState];
|
||||
}
|
||||
|
||||
- (BOOL) isHUDExecutionSpeedVisible
|
||||
{
|
||||
return [[self cdsVideoOutput] isHUDExecutionSpeedVisible];
|
||||
}
|
||||
|
||||
- (void) setIsHUDVideoFPSVisible:(BOOL)theState
|
||||
{
|
||||
[[self cdsVideoOutput] setIsHUDVideoFPSVisible:theState];
|
||||
|
@ -1815,6 +1843,16 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
|||
return [[self cdsVideoOutput] isHUDInputVisible];
|
||||
}
|
||||
|
||||
- (void) setHudColorExecutionSpeed:(NSColor *)theColor
|
||||
{
|
||||
[[self cdsVideoOutput] setHudColorExecutionSpeed:[CocoaDSUtil RGBA8888FromNSColor:theColor]];
|
||||
}
|
||||
|
||||
- (NSColor *) hudColorExecutionSpeed
|
||||
{
|
||||
return [CocoaDSUtil NSColorFromRGBA8888:[[self cdsVideoOutput] hudColorExecutionSpeed]];
|
||||
}
|
||||
|
||||
- (void) setHudColorVideoFPS:(NSColor *)theColor
|
||||
{
|
||||
[[self cdsVideoOutput] setHudColorVideoFPS:[CocoaDSUtil RGBA8888FromNSColor:theColor]];
|
||||
|
|
|
@ -2313,6 +2313,7 @@
|
|||
const NSInteger videoOutputFilter = ([windowProperties objectForKey:@"videoOutputFilter"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"videoOutputFilter"] integerValue] : [[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_OutputFilter"];
|
||||
|
||||
const BOOL hudEnable = ([windowProperties objectForKey:@"hudEnable"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudEnable"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_EnableHUD"];
|
||||
const BOOL hudShowExecutionSpeed = ([windowProperties objectForKey:@"hudShowExecutionSpeed"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowExecutionSpeed"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowExecutionSpeed"];
|
||||
const BOOL hudShowVideoFPS = ([windowProperties objectForKey:@"hudShowVideoFPS"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowVideoFPS"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowVideoFPS"];
|
||||
const BOOL hudShowRender3DFPS = ([windowProperties objectForKey:@"hudShowRender3DFPS"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowRender3DFPS"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowRender3DFPS"];
|
||||
const BOOL hudShowFrameIndex = ([windowProperties objectForKey:@"hudShowFrameIndex"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowFrameIndex"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowFrameIndex"];
|
||||
|
@ -2321,6 +2322,7 @@
|
|||
const BOOL hudShowRTC = ([windowProperties objectForKey:@"hudShowRTC"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowRTC"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowRTC"];
|
||||
const BOOL hudShowInput = ([windowProperties objectForKey:@"hudShowInput"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudShowInput"] boolValue] : [[NSUserDefaults standardUserDefaults] boolForKey:@"HUD_ShowInput"];
|
||||
|
||||
const NSUInteger hudColorExecutionSpeed = ([windowProperties objectForKey:@"hudColorExecutionSpeed"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudColorExecutionSpeed"] unsignedIntegerValue] : [[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_ExecutionSpeed"];
|
||||
const NSUInteger hudColorVideoFPS = ([windowProperties objectForKey:@"hudColorVideoFPS"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudColorVideoFPS"] unsignedIntegerValue] : [[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_VideoFPS"];
|
||||
const NSUInteger hudColorRender3DFPS = ([windowProperties objectForKey:@"hudColorRender3DFPS"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudColorRender3DFPS"] unsignedIntegerValue] : [[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_Render3DFPS"];
|
||||
const NSUInteger hudColorFrameIndex = ([windowProperties objectForKey:@"hudColorFrameIndex"] != nil) ? [(NSNumber *)[windowProperties valueForKey:@"hudColorFrameIndex"] unsignedIntegerValue] : [[NSUserDefaults standardUserDefaults] integerForKey:@"HUD_Color_FrameIndex"];
|
||||
|
@ -2367,6 +2369,7 @@
|
|||
|
||||
[[windowController view] setUseVerticalSync:useVerticalSync];
|
||||
[[windowController view] setIsHUDVisible:hudEnable];
|
||||
[[windowController view] setIsHUDExecutionSpeedVisible:hudShowExecutionSpeed];
|
||||
[[windowController view] setIsHUDVideoFPSVisible:hudShowVideoFPS];
|
||||
[[windowController view] setIsHUDRender3DFPSVisible:hudShowRender3DFPS];
|
||||
[[windowController view] setIsHUDFrameIndexVisible:hudShowFrameIndex];
|
||||
|
@ -2375,6 +2378,7 @@
|
|||
[[windowController view] setIsHUDRealTimeClockVisible:hudShowRTC];
|
||||
[[windowController view] setIsHUDInputVisible:hudShowInput];
|
||||
|
||||
[[windowController view] setHudColorExecutionSpeed:[CocoaDSUtil NSColorFromRGBA8888:(uint32_t)hudColorExecutionSpeed]];
|
||||
[[windowController view] setHudColorVideoFPS:[CocoaDSUtil NSColorFromRGBA8888:(uint32_t)hudColorVideoFPS]];
|
||||
[[windowController view] setHudColorRender3DFPS:[CocoaDSUtil NSColorFromRGBA8888:(uint32_t)hudColorRender3DFPS]];
|
||||
[[windowController view] setHudColorFrameIndex:[CocoaDSUtil NSColorFromRGBA8888:(uint32_t)hudColorFrameIndex]];
|
||||
|
@ -2447,6 +2451,7 @@
|
|||
[NSNumber numberWithBool:[[windowController view] sourceDeposterize]], @"videoSourceDeposterize",
|
||||
[NSNumber numberWithBool:[[windowController view] useVerticalSync]], @"useVerticalSync",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDVisible]], @"hudEnable",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDExecutionSpeedVisible]], @"hudShowExecutionSpeed",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDVideoFPSVisible]], @"hudShowVideoFPS",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDRender3DFPSVisible]], @"hudShowRender3DFPS",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDFrameIndexVisible]], @"hudShowFrameIndex",
|
||||
|
@ -2454,6 +2459,7 @@
|
|||
[NSNumber numberWithBool:[[windowController view] isHUDCPULoadAverageVisible]], @"hudShowCPULoadAverage",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDRealTimeClockVisible]], @"hudShowRTC",
|
||||
[NSNumber numberWithBool:[[windowController view] isHUDInputVisible]], @"hudShowInput",
|
||||
[NSNumber numberWithUnsignedInteger:[CocoaDSUtil RGBA8888FromNSColor:[[windowController view] hudColorExecutionSpeed]]], @"hudColorExecutionSpeed",
|
||||
[NSNumber numberWithUnsignedInteger:[CocoaDSUtil RGBA8888FromNSColor:[[windowController view] hudColorVideoFPS]]], @"hudColorVideoFPS",
|
||||
[NSNumber numberWithUnsignedInteger:[CocoaDSUtil RGBA8888FromNSColor:[[windowController view] hudColorRender3DFPS]]], @"hudColorRender3DFPS",
|
||||
[NSNumber numberWithUnsignedInteger:[CocoaDSUtil RGBA8888FromNSColor:[[windowController view] hudColorFrameIndex]]], @"hudColorFrameIndex",
|
||||
|
|
Loading…
Reference in New Issue