diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 1dbc95c062..930cc8a180 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -504,18 +504,18 @@ namespace Reporting g_Config.sReportHost = "default"; } - Status GetStatus() + ReportStatus GetStatus() { if (!serverWorking) - return Status::FAILING; + return ReportStatus::FAILING; for (int pos = 0; pos < PAYLOAD_BUFFER_SIZE; ++pos) { if (payloadBuffer[pos].type != RequestType::NONE) - return Status::BUSY; + return ReportStatus::BUSY; } - return Status::WORKING; + return ReportStatus::WORKING; } int NextFreePos() diff --git a/Core/Reporting.h b/Core/Reporting.h index c58ae2bae0..08acc9d267 100644 --- a/Core/Reporting.h +++ b/Core/Reporting.h @@ -77,18 +77,18 @@ namespace Reporting // Returns true if that identifier has not been logged yet. bool ShouldLogOnce(const char *identifier); - enum class Status { + enum class ReportStatus { WORKING, BUSY, FAILING, }; // Whether server requests appear to be working. - Status GetStatus(); + ReportStatus GetStatus(); // Return the currently active host (or blank if not active.) std::string ServerHost(); // Return the current game id. std::string CurrentGameID(); -} \ No newline at end of file +} diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 868b313629..31aa6eeb97 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -96,7 +96,7 @@ struct TexCacheEntry { // After marking STATUS_UNRELIABLE, if it stays the same this many frames we'll trust it again. const static int FRAMES_REGAIN_TRUST = 1000; - enum Status { + enum TexStatus { STATUS_HASHING = 0x00, STATUS_RELIABLE = 0x01, // Don't bother rehashing. STATUS_UNRELIABLE = 0x02, // Always recheck hash. @@ -156,19 +156,19 @@ struct TexCacheEntry { bool sClamp; bool tClamp; - Status GetHashStatus() { - return Status(status & STATUS_MASK); + TexStatus GetHashStatus() { + return TexStatus(status & STATUS_MASK); } - void SetHashStatus(Status newStatus) { + void SetHashStatus(TexStatus newStatus) { status = (status & ~STATUS_MASK) | newStatus; } - Status GetAlphaStatus() { - return Status(status & STATUS_ALPHA_MASK); + TexStatus GetAlphaStatus() { + return TexStatus(status & STATUS_ALPHA_MASK); } - void SetAlphaStatus(Status newStatus) { + void SetAlphaStatus(TexStatus newStatus) { status = (status & ~STATUS_ALPHA_MASK) | newStatus; } - void SetAlphaStatus(Status newStatus, int level) { + void SetAlphaStatus(TexStatus newStatus, int level) { // For non-level zero, only set more restrictive. if (newStatus == STATUS_ALPHA_UNKNOWN || level == 0) { SetAlphaStatus(newStatus); diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index a687a5ea4f..0ba070800e 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -407,7 +407,7 @@ void TextureCacheD3D11::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFra const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, GetClutDestFormatD3D11(clutFormat), clutTotalColors, clutTotalColors, 1); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(clutBuf_, GetClutDestFormatD3D11(clutFormat), clutTotalColors, clutTotalColors, 1); gstate_c.SetTextureFullAlpha(alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL); } else { entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; @@ -557,7 +557,7 @@ void TextureCacheD3D11::BuildTexture(TexCacheEntry *const entry, bool replaceIma entry->status &= ~TexCacheEntry::STATUS_BAD_MIPS; } if (replaced.Valid()) { - entry->SetAlphaStatus(TexCacheEntry::Status(replaced.AlphaStatus())); + entry->SetAlphaStatus(TexCacheEntry::TexStatus(replaced.AlphaStatus())); } } @@ -602,7 +602,7 @@ DXGI_FORMAT TextureCacheD3D11::GetDestFormat(GETextureFormat format, GEPaletteFo } } -TexCacheEntry::Status TextureCacheD3D11::CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h) { +TexCacheEntry::TexStatus TextureCacheD3D11::CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h) { CheckAlphaResult res; switch (dstFmt) { case DXGI_FORMAT_B4G4R4A4_UNORM: @@ -620,7 +620,7 @@ TexCacheEntry::Status TextureCacheD3D11::CheckAlpha(const u32 *pixelData, u32 ds break; } - return (TexCacheEntry::Status)res; + return (TexCacheEntry::TexStatus)res; } ReplacedTextureFormat FromD3D11Format(u32 fmt) { @@ -721,7 +721,7 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture & // We check before scaling since scaling shouldn't invent alpha from a full alpha texture. if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { - TexCacheEntry::Status alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); entry.SetAlphaStatus(alphaStatus, level); } else { entry.SetAlphaStatus(TexCacheEntry::STATUS_ALPHA_UNKNOWN); diff --git a/GPU/D3D11/TextureCacheD3D11.h b/GPU/D3D11/TextureCacheD3D11.h index be4fdee859..c7fdc9899d 100644 --- a/GPU/D3D11/TextureCacheD3D11.h +++ b/GPU/D3D11/TextureCacheD3D11.h @@ -74,7 +74,7 @@ protected: private: void LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, int maxLevel, bool replaceImages, int scaleFactor, DXGI_FORMAT dstFmt); DXGI_FORMAT GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; - TexCacheEntry::Status CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h); + TexCacheEntry::TexStatus CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h); void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) override; diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 62d057ec1b..83173039ac 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -454,7 +454,7 @@ void TextureCacheDX9::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFrame const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); gstate_c.SetTextureFullAlpha(alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL); } else { entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; @@ -599,7 +599,7 @@ void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry, bool replaceImage entry->status &= ~TexCacheEntry::STATUS_BAD_MIPS; } if (replaced.Valid()) { - entry->SetAlphaStatus(TexCacheEntry::Status(replaced.AlphaStatus())); + entry->SetAlphaStatus(TexCacheEntry::TexStatus(replaced.AlphaStatus())); } } @@ -625,7 +625,7 @@ D3DFORMAT TextureCacheDX9::GetDestFormat(GETextureFormat format, GEPaletteFormat } } -TexCacheEntry::Status TextureCacheDX9::CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h) { +TexCacheEntry::TexStatus TextureCacheDX9::CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h) { CheckAlphaResult res; switch (dstFmt) { case D3DFMT_A4R4G4B4: @@ -643,7 +643,7 @@ TexCacheEntry::Status TextureCacheDX9::CheckAlpha(const u32 *pixelData, u32 dstF break; } - return (TexCacheEntry::Status)res; + return (TexCacheEntry::TexStatus)res; } ReplacedTextureFormat FromD3D9Format(u32 fmt) { @@ -736,7 +736,7 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &re // We check before scaling since scaling shouldn't invent alpha from a full alpha texture. if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { - TexCacheEntry::Status alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); entry.SetAlphaStatus(alphaStatus, level); } else { entry.SetAlphaStatus(TexCacheEntry::STATUS_ALPHA_UNKNOWN); diff --git a/GPU/Directx9/TextureCacheDX9.h b/GPU/Directx9/TextureCacheDX9.h index 8e4962bd3a..451cb922c5 100644 --- a/GPU/Directx9/TextureCacheDX9.h +++ b/GPU/Directx9/TextureCacheDX9.h @@ -68,7 +68,7 @@ private: void UpdateSamplingParams(TexCacheEntry &entry, bool force); void LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, int maxLevel, bool replaceImages, int scaleFactor, u32 dstFmt); D3DFORMAT GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; - TexCacheEntry::Status CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h); + TexCacheEntry::TexStatus CheckAlpha(const u32 *pixelData, u32 dstFmt, int stride, int w, int h); void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) override; diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 1e100f550d..f7c754e514 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -515,7 +515,7 @@ void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFram const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); gstate_c.SetTextureFullAlpha(alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL); } else { entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; @@ -737,7 +737,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry, bool replaceImag entry->status &= ~TexCacheEntry::STATUS_BAD_MIPS; } if (replaced.Valid()) { - entry->SetAlphaStatus(TexCacheEntry::Status(replaced.AlphaStatus())); + entry->SetAlphaStatus(TexCacheEntry::TexStatus(replaced.AlphaStatus())); } if (gstate_c.Supports(GPU_SUPPORTS_ANISOTROPY)) { @@ -813,7 +813,7 @@ void *TextureCacheGLES::DecodeTextureLevelOld(GETextureFormat format, GEPaletteF return tmpTexBufRearrange_.data(); } -TexCacheEntry::Status TextureCacheGLES::CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h) { +TexCacheEntry::TexStatus TextureCacheGLES::CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h) { CheckAlphaResult res; switch (dstFmt) { case GL_UNSIGNED_SHORT_4_4_4_4: @@ -831,7 +831,7 @@ TexCacheEntry::Status TextureCacheGLES::CheckAlpha(const u32 *pixelData, GLenum break; } - return (TexCacheEntry::Status)res; + return (TexCacheEntry::TexStatus)res; } void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, bool replaceImages, int scaleFactor, GLenum dstFmt) { @@ -880,7 +880,7 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r // We check before scaling since scaling shouldn't invent alpha from a full alpha texture. if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { - TexCacheEntry::Status alphaStatus = CheckAlpha(pixelData, dstFmt, useUnpack ? bufw : w, w, h); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(pixelData, dstFmt, useUnpack ? bufw : w, w, h); entry.SetAlphaStatus(alphaStatus, level); } else { entry.SetAlphaStatus(TexCacheEntry::STATUS_ALPHA_UNKNOWN); diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index 87018b7197..9e894e2476 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -81,7 +81,7 @@ private: void LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, bool replaceImages, int scaleFactor, GLenum dstFmt); GLenum GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; void *DecodeTextureLevelOld(GETextureFormat format, GEPaletteFormat clutformat, int level, GLenum dstFmt, int scaleFactor, int *bufw = 0); - TexCacheEntry::Status CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h); + TexCacheEntry::TexStatus CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h); void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) override; diff --git a/GPU/Vulkan/DrawEngineVulkan.h b/GPU/Vulkan/DrawEngineVulkan.h index e6dc71e8f1..c121bf297a 100644 --- a/GPU/Vulkan/DrawEngineVulkan.h +++ b/GPU/Vulkan/DrawEngineVulkan.h @@ -83,7 +83,7 @@ public: } // No destructor needed - we always fully wipe. - enum Status : uint8_t { + enum VAIStatus : uint8_t { VAI_NEW, VAI_HASHING, VAI_RELIABLE, // cache, don't hash @@ -104,7 +104,7 @@ public: u16 numVerts = 0; u16 maxIndex = 0; s8 prim = GE_PRIM_INVALID; - Status status = VAI_NEW; + VAIStatus status = VAI_NEW; // ID information int numDraws = 0; diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index a75a939ce6..a010ee15a0 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -414,7 +414,7 @@ void TextureCacheVulkan::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFr const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormatVulkan(clutFormat), clutTotalColors, clutTotalColors, 1); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(clutBuf_, getClutDestFormatVulkan(clutFormat), clutTotalColors, clutTotalColors, 1); gstate_c.SetTextureFullAlpha(alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL); framebufferManager_->RebindFramebuffer(); @@ -673,7 +673,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry, bool replaceIm entry->status &= ~TexCacheEntry::STATUS_BAD_MIPS; } if (replaced.Valid()) { - entry->SetAlphaStatus(TexCacheEntry::Status(replaced.AlphaStatus())); + entry->SetAlphaStatus(TexCacheEntry::TexStatus(replaced.AlphaStatus())); } entry->vkTex->texture_->EndCreate(cmdInit); } @@ -703,7 +703,7 @@ VkFormat TextureCacheVulkan::GetDestFormat(GETextureFormat format, GEPaletteForm } } -TexCacheEntry::Status TextureCacheVulkan::CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int stride, int w, int h) { +TexCacheEntry::TexStatus TextureCacheVulkan::CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int stride, int w, int h) { CheckAlphaResult res; switch (dstFmt) { case VULKAN_4444_FORMAT: @@ -721,7 +721,7 @@ TexCacheEntry::Status TextureCacheVulkan::CheckAlpha(const u32 *pixelData, VkFor break; } - return (TexCacheEntry::Status)res; + return (TexCacheEntry::TexStatus)res; } void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt) { @@ -754,7 +754,7 @@ void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePt if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { // TODO: When we decode directly, this can be more expensive (maybe not on mobile?) // This does allow us to skip alpha testing, though. - TexCacheEntry::Status alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); + TexCacheEntry::TexStatus alphaStatus = CheckAlpha(pixelData, dstFmt, decPitch / bpp, w, h); entry.SetAlphaStatus(alphaStatus, level); } else { entry.SetAlphaStatus(TexCacheEntry::STATUS_ALPHA_UNKNOWN); @@ -854,4 +854,4 @@ std::vector TextureCacheVulkan::DebugGetSamplerIDs() const { std::string TextureCacheVulkan::DebugGetSamplerString(std::string id, DebugShaderStringType stringType) { return samplerCache_.DebugGetSamplerString(id, stringType); -} \ No newline at end of file +} diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index 23d17351f2..ddf3ec9362 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -125,7 +125,7 @@ protected: private: void LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt); VkFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; - TexCacheEntry::Status CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int stride, int w, int h); + TexCacheEntry::TexStatus CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int stride, int w, int h); void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) override; diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index 697a86751d..60003b25ad 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -364,17 +364,17 @@ void ReportFinishScreen::update() { I18NCategory *rp = GetI18NCategory("Reporting"); if (!setStatus_) { - Reporting::Status status = Reporting::GetStatus(); + Reporting::ReportStatus status = Reporting::GetStatus(); switch (status) { - case Reporting::Status::WORKING: + case Reporting::ReportStatus::WORKING: resultNotice_->SetText(rp->T("FeedbackSubmitDone", "Your data has been submitted.")); break; - case Reporting::Status::FAILING: + case Reporting::ReportStatus::FAILING: resultNotice_->SetText(rp->T("FeedbackSubmitFail", "Could not submit data to server. Try updating PPSSPP.")); break; - case Reporting::Status::BUSY: + case Reporting::ReportStatus::BUSY: default: // Can't update yet. break;