gpu - small refinements to BPP-setting interfaces

This commit is contained in:
zeromus 2017-07-23 21:29:24 -05:00
parent 18f02cb7d3
commit 71eb37f44e
2 changed files with 10 additions and 0 deletions

View File

@ -8125,6 +8125,10 @@ void GPUSubsystem::SetCustomFramebufferSize(size_t w, size_t h)
void GPUSubsystem::SetColorFormat(const NDSColorFormat outputFormat)
{
//check for no-op
if(this->_displayInfo.colorFormat == outputFormat)
return;
this->_displayInfo.colorFormat = outputFormat;
this->_displayInfo.pixelBytes = (outputFormat == NDSColorFormat_BGR555_Rev) ? sizeof(u16) : sizeof(FragmentColor);
@ -8136,6 +8140,11 @@ void GPUSubsystem::SetColorFormat(const NDSColorFormat outputFormat)
this->_AllocateFramebuffers(this->_displayInfo.colorFormat, this->_displayInfo.customWidth, this->_displayInfo.customHeight);
}
NDSColorFormat GPUSubsystem::GetColorFormat() const
{
return this->_displayInfo.colorFormat;
}
void GPUSubsystem::_AllocateFramebuffers(NDSColorFormat outputFormat, size_t w, size_t h)
{
void *oldMasterFramebuffer = this->_masterFramebuffer;

View File

@ -1716,6 +1716,7 @@ public:
size_t GetCustomFramebufferHeight() const;
void SetCustomFramebufferSize(size_t w, size_t h);
void SetColorFormat(const NDSColorFormat outputFormat);
NDSColorFormat GetColorFormat() const;
bool GetWillFrameSkip() const;
void SetWillFrameSkip(const bool willFrameSkip);