diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.h b/Common/GPU/Vulkan/VulkanQueueRunner.h index da40ad300b..bef9ec7ec3 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.h +++ b/Common/GPU/Vulkan/VulkanQueueRunner.h @@ -286,9 +286,9 @@ private: void ResizeReadbackBuffer(CachedReadback *readback, VkDeviceSize requiredSize); - void ApplyMGSHack(std::vector &steps); - void ApplySonicHack(std::vector &steps); - void ApplyRenderPassMerge(std::vector &steps); + static void ApplyMGSHack(std::vector &steps); + static void ApplySonicHack(std::vector &steps); + static void ApplyRenderPassMerge(std::vector &steps); static void SetupTransferDstWriteAfterWrite(VKRImage &img, VkImageAspectFlags aspect, VulkanBarrierBatch *recordBarrier); diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index b1a9f94487..0c7898cbd0 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -450,9 +450,9 @@ public: class Framebuffer : public RefCountedObject { public: Framebuffer() : RefCountedObject("Framebuffer") {} - int Width() { return width_; } - int Height() { return height_; } - int Layers() { return layers_; } + int Width() const { return width_; } + int Height() const { return height_; } + int Layers() const { return layers_; } int MultiSampleLevel() { return multiSampleLevel_; } virtual void UpdateTag(const char *tag) {} diff --git a/Common/Input/InputState.h b/Common/Input/InputState.h index 2e74836de9..b4e0d8e074 100644 --- a/Common/Input/InputState.h +++ b/Common/Input/InputState.h @@ -66,7 +66,7 @@ inline int TranslateKeyCodeToAxis(int keyCode, int *direction) { class InputMapping { private: - inline int TranslateKeyCodeFromAxis(int axisId, int direction) { + static inline int TranslateKeyCodeFromAxis(int axisId, int direction) { return AXIS_BIND_NKCODE_START + axisId * 2 + (direction < 0 ? 1 : 0); } public: diff --git a/Common/MipsEmitter.cpp b/Common/MipsEmitter.cpp index 54c22bbebf..5d34e2ac8f 100644 --- a/Common/MipsEmitter.cpp +++ b/Common/MipsEmitter.cpp @@ -253,7 +253,7 @@ void MIPSEmitter::QuickCallFunction(MIPSReg scratchreg, const void *func) { } } -FixupBranch MIPSEmitter::MakeFixupBranch(FixupBranchType type) { +FixupBranch MIPSEmitter::MakeFixupBranch(FixupBranchType type) const { FixupBranch b; b.ptr = code_; b.type = type; diff --git a/Common/MipsEmitter.h b/Common/MipsEmitter.h index 77ffd5f41e..b178918707 100644 --- a/Common/MipsEmitter.h +++ b/Common/MipsEmitter.h @@ -258,7 +258,7 @@ protected: static void SetJumpTarget(const FixupBranch &branch, const void *dst); static bool BInRange(const void *src, const void *dst); static bool JInRange(const void *src, const void *dst); - FixupBranch MakeFixupBranch(FixupBranchType type); + FixupBranch MakeFixupBranch(FixupBranchType type) const; void ApplyDelaySlot(std::function delaySlot); private: diff --git a/Common/Net/HTTPRequest.h b/Common/Net/HTTPRequest.h index b6bfda2701..77b718a966 100644 --- a/Common/Net/HTTPRequest.h +++ b/Common/Net/HTTPRequest.h @@ -114,7 +114,7 @@ public: } private: - bool IsHttpsUrl(const std::string &url); + static bool IsHttpsUrl(const std::string &url); std::vector> downloads_; // These get copied to downloads_ in Update(). It's so that callbacks can add new downloads diff --git a/Common/Render/Text/draw_text.cpp b/Common/Render/Text/draw_text.cpp index 020d777d47..e70d4d6a81 100644 --- a/Common/Render/Text/draw_text.cpp +++ b/Common/Render/Text/draw_text.cpp @@ -37,7 +37,7 @@ void TextDrawer::SetFontScale(float xscale, float yscale) { fontScaleY_ = yscale; } -float TextDrawer::CalculateDPIScale() { +float TextDrawer::CalculateDPIScale() const { if (ignoreGlobalDpi_) return dpiScale_; float scale = g_display.dpi_scale_y; diff --git a/Common/Render/Text/draw_text.h b/Common/Render/Text/draw_text.h index 9f8f7c08e6..3392c92e53 100644 --- a/Common/Render/Text/draw_text.h +++ b/Common/Render/Text/draw_text.h @@ -58,7 +58,7 @@ public: // Use for housekeeping like throwing out old strings. void OncePerFrame(); - float CalculateDPIScale(); + float CalculateDPIScale() const; void SetForcedDPIScale(float dpi) { dpiScale_ = dpi; ignoreGlobalDpi_ = true; diff --git a/Common/Render/TextureAtlas.h b/Common/Render/TextureAtlas.h index 4c73e0a120..fe2a851e36 100644 --- a/Common/Render/TextureAtlas.h +++ b/Common/Render/TextureAtlas.h @@ -129,7 +129,7 @@ struct AtlasHeader { struct Atlas { ~Atlas(); bool Load(const uint8_t *data, size_t data_size); - bool IsMetadataLoaded() { + bool IsMetadataLoaded() const { return images != nullptr; } diff --git a/Common/VR/VRMath.cpp b/Common/VR/VRMath.cpp index d65f13a1a7..5fd187b53b 100644 --- a/Common/VR/VRMath.cpp +++ b/Common/VR/VRMath.cpp @@ -13,10 +13,10 @@ float ToRadians(float deg) { return (float)(deg * M_PI / 180.0f); } -bool IsMatrixIdentity(float* matrix) { +bool IsMatrixIdentity(const float *matrix4x4) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { - float value = matrix[i * 4 + j]; + float value = matrix4x4[i * 4 + j]; // Other number than zero on non-diagonale if ((i != j) && (fabs(value) > EPSILON)) return false; diff --git a/Common/VR/VRMath.h b/Common/VR/VRMath.h index 5321ca8cc6..9ce83997a0 100644 --- a/Common/VR/VRMath.h +++ b/Common/VR/VRMath.h @@ -9,7 +9,7 @@ float ToDegrees(float rad); float ToRadians(float deg); -bool IsMatrixIdentity(float* matrix); +bool IsMatrixIdentity(const float *matrix4x4); // XrPosef XrPosef XrPosef_Identity(); diff --git a/Core/Dialog/PSPDialog.cpp b/Core/Dialog/PSPDialog.cpp index 8697e71b13..28e656d966 100644 --- a/Core/Dialog/PSPDialog.cpp +++ b/Core/Dialog/PSPDialog.cpp @@ -205,8 +205,7 @@ void PSPDialog::FinishFadeOut() { ChangeStatus(SCE_UTILITY_STATUS_FINISHED, 0); } -u32 PSPDialog::CalcFadedColor(u32 inColor) -{ +u32 PSPDialog::CalcFadedColor(u32 inColor) const { u32 alpha = inColor >> 24; alpha = alpha * fadeValue / 255; return (inColor & 0x00FFFFFF) | (alpha << 24); diff --git a/Core/Dialog/PSPDialog.h b/Core/Dialog/PSPDialog.h index 8e254f401f..86107b5385 100644 --- a/Core/Dialog/PSPDialog.h +++ b/Core/Dialog/PSPDialog.h @@ -114,7 +114,7 @@ protected: void StartFade(bool fadeIn_); void UpdateFade(int animSpeed); virtual void FinishFadeOut(); - u32 CalcFadedColor(u32 inColor); + u32 CalcFadedColor(u32 inColor) const; DialogStatus pendingStatus = SCE_UTILITY_STATUS_NONE; u64 pendingStatusTicks = 0; diff --git a/Core/Dialog/PSPOskDialog.h b/Core/Dialog/PSPOskDialog.h index 2f491e4d4b..0639c6226a 100644 --- a/Core/Dialog/PSPOskDialog.h +++ b/Core/Dialog/PSPOskDialog.h @@ -227,8 +227,8 @@ protected: } private: - void ConvertUCS2ToUTF8(std::string& _string, const PSPPointer& em_address); - void ConvertUCS2ToUTF8(std::string& _string, const char16_t *input); + static void ConvertUCS2ToUTF8(std::string& _string, const PSPPointer& em_address); + static void ConvertUCS2ToUTF8(std::string& _string, const char16_t *input); void RenderKeyboard(); int NativeKeyboard();