diff --git a/Common/Arm64Emitter.cpp b/Common/Arm64Emitter.cpp index 7b8a6fd4a4..3113aa8ed5 100644 --- a/Common/Arm64Emitter.cpp +++ b/Common/Arm64Emitter.cpp @@ -783,7 +783,7 @@ void ARM64XEmitter::EncodeLoadStorePair(u32 op, u32 load, IndexType type, ARM64R imm >>= 2; } - _assert_msg_(JIT, imm >= -64 && imm <= 63, "%s recieved too large imm: %d", imm); + _assert_msg_(JIT, imm >= -64 && imm <= 63, "%s recieved too large imm: %d", __FUNCTION__, imm); Rt = DecodeReg(Rt); Rt2 = DecodeReg(Rt2); @@ -867,11 +867,11 @@ void ARM64XEmitter::SetJumpTarget(FixupBranch const& branch) } break; case 5: // B (uncoditional) - _assert_msg_(DYNA_REC, IsInRangeImm26(distance), "%s(%d): Received too large distance: %lx", __FUNCTION__, branch.type, distance); + _assert_msg_(DYNA_REC, IsInRangeImm26(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance); inst = (0x5 << 26) | MaskImm26(distance); break; case 6: // BL (unconditional) - _assert_msg_(DYNA_REC, IsInRangeImm26(distance), "%s(%d): Received too large distance: %lx", __FUNCTION__, branch.type, distance); + _assert_msg_(DYNA_REC, IsInRangeImm26(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance); inst = (0x25 << 26) | MaskImm26(distance); break; } @@ -959,7 +959,7 @@ void ARM64XEmitter::B(CCFlags cond, const void* ptr) distance >>= 2; - _assert_msg_(DYNA_REC, IsInRangeImm19(distance), "%s: Received too large distance: %p->%p %ld %lx", __FUNCTION__, m_code, ptr, distance, distance); + _assert_msg_(DYNA_REC, IsInRangeImm19(distance), "%s: Received too large distance: %p->%p %lld %llx", __FUNCTION__, m_code, ptr, distance, distance); Write32((0x54 << 24) | (MaskImm19(distance) << 5) | cond); } diff --git a/Core/Dialog/PSPMsgDialog.h b/Core/Dialog/PSPMsgDialog.h index 4d1ce44ce7..ffebcaf635 100644 --- a/Core/Dialog/PSPMsgDialog.h +++ b/Core/Dialog/PSPMsgDialog.h @@ -68,7 +68,7 @@ public: int Abort(); protected: - virtual bool UseAutoStatus() { + virtual bool UseAutoStatus() override { return false; } diff --git a/Core/Dialog/PSPOskDialog.h b/Core/Dialog/PSPOskDialog.h index fa0ce88a6a..cac1358f71 100644 --- a/Core/Dialog/PSPOskDialog.h +++ b/Core/Dialog/PSPOskDialog.h @@ -17,6 +17,8 @@ #pragma once +#include + #include "Core/Dialog/PSPDialog.h" #include "Core/MemMap.h" #include "Common/CommonTypes.h" @@ -177,9 +179,9 @@ enum OskKeyboardLanguage // Internal enum, not from PSP. enum -{ - LOWERCASE, - UPPERCASE +{ + LOWERCASE, + UPPERCASE }; const OskKeyboardDisplay OskKeyboardCases[OSK_LANGUAGE_COUNT][2] = @@ -212,7 +214,7 @@ public: virtual pspUtilityDialogCommon *GetCommonParam() override; protected: - virtual bool UseAutoStatus() { + virtual bool UseAutoStatus() override { return false; } @@ -227,7 +229,7 @@ private: std::wstring CombinationString(bool isInput); // for Japanese, Korean std::wstring CombinationKorean(bool isInput); // for Korea void RemoveKorean(); // for Korean character removal - + u32 FieldMaxLength(); int GetIndex(const wchar_t* src, wchar_t ch); diff --git a/Core/Dialog/PSPSaveDialog.h b/Core/Dialog/PSPSaveDialog.h index 94a6d229f5..c792a2da31 100644 --- a/Core/Dialog/PSPSaveDialog.h +++ b/Core/Dialog/PSPSaveDialog.h @@ -81,7 +81,7 @@ public: void ExecuteIOAction(); protected: - virtual bool UseAutoStatus() { + virtual bool UseAutoStatus() override { return false; } diff --git a/Core/FileSystems/FileSystem.h b/Core/FileSystems/FileSystem.h index c9f6b5290a..a616d4bb56 100644 --- a/Core/FileSystems/FileSystem.h +++ b/Core/FileSystems/FileSystem.h @@ -18,10 +18,11 @@ #pragma once #include +#include + #include "Core/HLE/sceKernel.h" -enum FileAccess -{ +enum FileAccess { FILEACCESS_NONE = 0, FILEACCESS_READ = 1, FILEACCESS_WRITE = 2, @@ -30,28 +31,24 @@ enum FileAccess FILEACCESS_TRUNCATE = 16, }; -enum FileMove -{ +enum FileMove { FILEMOVE_BEGIN = 0, FILEMOVE_CURRENT = 1, FILEMOVE_END = 2 }; -enum FileType -{ +enum FileType { FILETYPE_NORMAL = 1, FILETYPE_DIRECTORY = 2 }; -enum DevType -{ +enum DevType { PSP_DEV_TYPE_BLOCK = 0x04, PSP_DEV_TYPE_FILE = 0x10, PSP_DEV_TYPE_ALIAS = 0x20, }; -enum FileSystemFlags -{ +enum FileSystemFlags { FILESYSTEM_SIMULATE_FAT32 = 1, }; @@ -65,20 +62,19 @@ public: class SequentialHandleAllocator : public IHandleAllocator { public: SequentialHandleAllocator() : handle_(1) {} - virtual u32 GetNewHandle() { + virtual u32 GetNewHandle() override { u32 res = handle_++; if (handle_ < 0) { handle_ = 0; } return res; } - virtual void FreeHandle(u32 handle) {} + virtual void FreeHandle(u32 handle) override {} private: int handle_; }; -struct PSPFileInfo -{ +struct PSPFileInfo { PSPFileInfo() : size(0), access(0), exists(false), type(FILETYPE_NORMAL), isOnSectorSystem(false), startSector(0), numSectors(0) {} @@ -101,14 +97,13 @@ struct PSPFileInfo }; -class IFileSystem -{ +class IFileSystem { public: virtual ~IFileSystem() {} virtual void DoState(PointerWrap &p) = 0; virtual std::vector GetDirListing(std::string path) = 0; - virtual u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL) = 0; + virtual u32 OpenFile(std::string filename, FileAccess access, const char *devicename=nullptr) = 0; virtual void CloseFile(u32 handle) = 0; virtual size_t ReadFile(u32 handle, u8 *pointer, s64 size) = 0; virtual size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) = 0; @@ -132,25 +127,25 @@ public: class EmptyFileSystem : public IFileSystem { public: - virtual void DoState(PointerWrap &p) {} - std::vector GetDirListing(std::string path) {std::vector vec; return vec;} - u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL) {return 0;} - void CloseFile(u32 handle) {} - size_t ReadFile(u32 handle, u8 *pointer, s64 size) {return 0;} - size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) {return 0;} - size_t WriteFile(u32 handle, const u8 *pointer, s64 size) {return 0;} - size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) {return 0;} - size_t SeekFile(u32 handle, s32 position, FileMove type) {return 0;} - PSPFileInfo GetFileInfo(std::string filename) {PSPFileInfo f; return f;} - bool OwnsHandle(u32 handle) {return false;} - virtual bool MkDir(const std::string &dirname) {return false;} - virtual bool RmDir(const std::string &dirname) {return false;} - virtual int RenameFile(const std::string &from, const std::string &to) {return -1;} - virtual bool RemoveFile(const std::string &filename) {return false;} - virtual bool GetHostPath(const std::string &inpath, std::string &outpath) {return false;} - virtual int Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 outlen, int &usec) {return SCE_KERNEL_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED; } - virtual int DevType(u32 handle) { return 0; } - virtual int Flags() { return 0; } + virtual void DoState(PointerWrap &p) override {} + std::vector GetDirListing(std::string path) override {std::vector vec; return vec;} + u32 OpenFile(std::string filename, FileAccess access, const char *devicename=nullptr) override {return 0;} + void CloseFile(u32 handle) override {} + size_t ReadFile(u32 handle, u8 *pointer, s64 size) override {return 0;} + size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) override {return 0;} + size_t WriteFile(u32 handle, const u8 *pointer, s64 size) override {return 0;} + size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) override {return 0;} + size_t SeekFile(u32 handle, s32 position, FileMove type) override {return 0;} + PSPFileInfo GetFileInfo(std::string filename) override {PSPFileInfo f; return f;} + bool OwnsHandle(u32 handle) override {return false;} + virtual bool MkDir(const std::string &dirname) override {return false;} + virtual bool RmDir(const std::string &dirname) override {return false;} + virtual int RenameFile(const std::string &from, const std::string &to) override {return -1;} + virtual bool RemoveFile(const std::string &filename) override {return false;} + virtual bool GetHostPath(const std::string &inpath, std::string &outpath) override {return false;} + virtual int Ioctl(u32 handle, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 outlen, int &usec) override {return SCE_KERNEL_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED; } + virtual int DevType(u32 handle) override { return 0; } + virtual int Flags() override { return 0; } virtual u64 FreeSpace(const std::string &path) override { return 0; } }; diff --git a/Core/FileSystems/ISOFileSystem.h b/Core/FileSystems/ISOFileSystem.h index 5e46436ff1..85721c1304 100644 --- a/Core/FileSystems/ISOFileSystem.h +++ b/Core/FileSystems/ISOFileSystem.h @@ -26,8 +26,7 @@ bool parseLBN(std::string filename, u32 *sectorStart, u32 *readSize); -class ISOFileSystem : public IFileSystem -{ +class ISOFileSystem : public IFileSystem { public: ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice, std::string _restrictPath = ""); ~ISOFileSystem(); @@ -49,15 +48,14 @@ public: size_t WriteFile(u32 handle, const u8 *pointer, s64 size) override; size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) override; - bool GetHostPath(const std::string &inpath, std::string &outpath) {return false;} + bool GetHostPath(const std::string &inpath, std::string &outpath) override {return false;} bool MkDir(const std::string &dirname) override {return false;} bool RmDir(const std::string &dirname) override { return false; } int RenameFile(const std::string &from, const std::string &to) override { return -1; } bool RemoveFile(const std::string &filename) override { return false; } private: - struct TreeEntry - { + struct TreeEntry { TreeEntry(){} ~TreeEntry(); @@ -71,8 +69,7 @@ private: std::vector children; }; - struct OpenFileEntry - { + struct OpenFileEntry { TreeEntry *file; unsigned int seekPos; // TODO: Make 64-bit? bool isRawSector; // "/sce_lbn" mode @@ -80,7 +77,7 @@ private: u32 sectorStart; u32 openSize; }; - + typedef std::map EntryMap; EntryMap entries; IHandleAllocator *hAlloc; @@ -147,7 +144,7 @@ public: size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) override { return isoFileSystem_->WriteFile(handle, pointer, size, usec); } - bool GetHostPath(const std::string &inpath, std::string &outpath) { return false; } + bool GetHostPath(const std::string &inpath, std::string &outpath) override { return false; } bool MkDir(const std::string &dirname) override { return false; } bool RmDir(const std::string &dirname) override { return false; } int RenameFile(const std::string &from, const std::string &to) override { return -1; } diff --git a/Core/FileSystems/MetaFileSystem.h b/Core/FileSystems/MetaFileSystem.h index b534a1d697..91bafa396d 100644 --- a/Core/FileSystems/MetaFileSystem.h +++ b/Core/FileSystems/MetaFileSystem.h @@ -17,23 +17,24 @@ #pragma once +#include +#include + #include "base/mutex.h" #include "Core/FileSystems/FileSystem.h" -class MetaFileSystem : public IHandleAllocator, public IFileSystem -{ +class MetaFileSystem : public IHandleAllocator, public IFileSystem { private: s32 current; - struct MountPoint - { + struct MountPoint { std::string prefix; IFileSystem *system; - bool operator == (const MountPoint &other) const - { + bool operator == (const MountPoint &other) const { return prefix == other.prefix && system == other.system; } }; + std::vector fileSystems; typedef std::map currentDir_t; @@ -44,8 +45,7 @@ private: recursive_mutex lock; public: - MetaFileSystem() - { + MetaFileSystem() { current = 6; // what? } @@ -60,7 +60,7 @@ public: void Shutdown(); - u32 GetNewHandle() { + u32 GetNewHandle() override { u32 res = current++; if (current < 0) { current = 0; @@ -74,11 +74,9 @@ public: IFileSystem *GetHandleOwner(u32 handle); bool MapFilePath(const std::string &inpath, std::string &outpath, MountPoint **system); - inline bool MapFilePath(const std::string &_inpath, std::string &outpath, IFileSystem **system) - { + inline bool MapFilePath(const std::string &_inpath, std::string &outpath, IFileSystem **system) { MountPoint *mountPoint; - if (MapFilePath(_inpath, outpath, &mountPoint)) - { + if (MapFilePath(_inpath, outpath, &mountPoint)) { *system = mountPoint->system; return true; } @@ -90,7 +88,7 @@ public: // Only possible if a file system is a DirectoryFileSystem or similar. bool GetHostPath(const std::string &inpath, std::string &outpath) override; - + std::vector GetDirListing(std::string path) override; u32 OpenFile(std::string filename, FileAccess access, const char *devicename = NULL) override; u32 OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename = NULL); diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index 3ba92cd577..719242dbe0 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -75,9 +75,9 @@ public: transformDraw_ = td; } - virtual void MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override; - virtual void DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override; - virtual void DrawFramebuffer(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override; + void MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override; + void DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override; + void DrawFramebuffer(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override; // If texture != 0, will bind it. // x,y,w,h are relative to destW, destH which fill out the target completely. @@ -105,10 +105,10 @@ public: std::vector GetFramebufferList(); - bool NotifyStencilUpload(u32 addr, int size, bool skipZero = false); + bool NotifyStencilUpload(u32 addr, int size, bool skipZero = false) override; - void DestroyFramebuf(VirtualFramebuffer *vfb); - void ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force = false); + void DestroyFramebuf(VirtualFramebuffer *vfb) override; + void ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force = false) override; bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer); bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer); diff --git a/GPU/GLES/GLES_GPU.h b/GPU/GLES/GLES_GPU.h index f71df08d88..ec41984c2b 100644 --- a/GPU/GLES/GLES_GPU.h +++ b/GPU/GLES/GLES_GPU.h @@ -76,14 +76,14 @@ public: primaryInfo = reportingPrimaryInfo_; fullInfo = reportingFullInfo_; } - std::vector GetFramebufferList(); + std::vector GetFramebufferList() override; - bool GetCurrentFramebuffer(GPUDebugBuffer &buffer); - bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); - bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); - bool GetCurrentTexture(GPUDebugBuffer &buffer, int level); + bool GetCurrentFramebuffer(GPUDebugBuffer &buffer) override; + bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override; + bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override; + bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override; static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); - bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices); + bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) override; bool DescribeCodePtr(const u8 *ptr, std::string &name) override; diff --git a/GPU/GLES/TransformPipeline.h b/GPU/GLES/TransformPipeline.h index a6fa13534f..1571e4a159 100644 --- a/GPU/GLES/TransformPipeline.h +++ b/GPU/GLES/TransformPipeline.h @@ -128,7 +128,7 @@ public: } void InitDeviceObjects(); void DestroyDeviceObjects(); - void GLLost(); + void GLLost() override; void Resized(); void DecimateTrackedVertexArrays(); diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index 46eef2336c..afd375abc6 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -84,7 +84,7 @@ public: bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override; - bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices); + bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) override; protected: void FastRunLoop(DisplayList &list) override; diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 60a94780f0..b98378ae9c 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -356,13 +356,13 @@ class JoystickHistoryView : public UI::InertView { public: JoystickHistoryView(int xAxis, int xDevice, int yAxis, int yDevice, UI::LayoutParams *layoutParams = nullptr) : UI::InertView(layoutParams), - xAxis_(xAxis), xDevice_(xDevice), - yAxis_(yAxis), yDevice_(yDevice), + xAxis_(xAxis), xDevice_(xDevice), + yAxis_(yAxis), yDevice_(yDevice), curX_(0.0f), curY_(0.0f), maxCount_(500) {} void Draw(UIContext &dc) override; void Update(const InputState &input_state) override; - void Axis(const AxisInput &input) { + void Axis(const AxisInput &input) override{ if (input.axisId == xAxis_) { curX_ = input.value; } else if (input.axisId == yAxis_) { @@ -379,8 +379,8 @@ private: }; int xAxis_; - int yAxis_; int xDevice_; + int yAxis_; int yDevice_; float curX_; diff --git a/UI/DevScreens.h b/UI/DevScreens.h index 3e150f6260..c19f83522b 100644 --- a/UI/DevScreens.h +++ b/UI/DevScreens.h @@ -97,7 +97,7 @@ public: protected: virtual void CreatePopupContents(UI::ViewGroup *parent) override; - virtual void OnCompleted(DialogResult result); + virtual void OnCompleted(DialogResult result) override; UI::EventReturn OnDigitButton(UI::EventParams &e); UI::EventReturn OnBackspace(UI::EventParams &e); @@ -114,7 +114,7 @@ private: class JitCompareScreen : public UIDialogScreenWithBackground { public: JitCompareScreen() : currentBlock_(-1) {} - virtual void CreateViews(); + virtual void CreateViews() override; private: void UpdateDisasm(); @@ -137,8 +137,8 @@ private: UI::TextEdit *blockAddr_; UI::TextView *blockStats_; - UI::LinearLayout *leftDisasm_; - UI::LinearLayout *rightDisasm_; + UI::LinearLayout *leftDisasm_; + UI::LinearLayout *rightDisasm_; }; diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 799fb077b5..a9453bcf63 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -46,7 +46,7 @@ public: virtual bool axis(const AxisInput &axis) override; protected: - virtual void CreateViews(); + virtual void CreateViews() override; UI::EventReturn OnDevTools(UI::EventParams ¶ms); private: diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index 8b78d7aafd..70b3a9a098 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -29,11 +29,11 @@ public: : UI::View(layoutParams), pointerDownMask_(0), scale_(scale), bgImg_(bgImg), img_(img), angle_(0.0f), flipImageH_(false) { } - virtual bool Key(const KeyInput &input) { return false; } - virtual void Update(const InputState &input) {} - virtual void Touch(const TouchInput &input); - virtual void Draw(UIContext &dc); - virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const; + virtual bool Key(const KeyInput &input) override { return false; } + virtual void Update(const InputState &input) override {} + virtual void Touch(const TouchInput &input) override; + virtual void Draw(UIContext &dc) override; + virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; virtual bool IsDown() { return pointerDownMask_ != 0; } // chainable MultiTouchButton *FlipImageH(bool flip) { flipImageH_ = flip; return this; } @@ -57,7 +57,7 @@ public: } virtual void Touch(const TouchInput &input) override; - virtual bool IsDown() { return *value_; } + virtual bool IsDown() override { return *value_; } private: bool *value_; @@ -69,7 +69,7 @@ public: : MultiTouchButton(bgImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) { } void Touch(const TouchInput &input) override; - virtual bool IsDown(); + virtual bool IsDown() override; private: int pspButtonBit_; diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 9f7601978c..e25f476b44 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -34,7 +34,7 @@ class UIScreenWithBackground : public UIScreen { public: UIScreenWithBackground() : UIScreen() {} protected: - virtual void DrawBackground(UIContext &dc); + virtual void DrawBackground(UIContext &dc) override; virtual void sendMessage(const char *message, const char *value) override; virtual UI::EventReturn OnLanguageChange(UI::EventParams &e); }; @@ -52,7 +52,7 @@ class UIDialogScreenWithBackground : public UIDialogScreen { public: UIDialogScreenWithBackground() : UIDialogScreen() {} protected: - virtual void DrawBackground(UIContext &dc); + virtual void DrawBackground(UIContext &dc) override; virtual void sendMessage(const char *message, const char *value) override; virtual UI::EventReturn OnLanguageChange(UI::EventParams &e); @@ -63,14 +63,14 @@ class UIDialogScreenWithGameBackground : public UIDialogScreenWithBackground { public: UIDialogScreenWithGameBackground(const std::string &gamePath) : UIDialogScreenWithBackground(), gamePath_(gamePath) {} - virtual void DrawBackground(UIContext &dc); + virtual void DrawBackground(UIContext &dc) override; protected: std::string gamePath_; }; class PromptScreen : public UIDialogScreenWithBackground { public: - PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, + PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, std::function callback = &NoOpVoidBool); virtual void CreateViews() override; @@ -90,7 +90,7 @@ public: NewLanguageScreen(const std::string &title); private: - virtual void OnCompleted(DialogResult result); + virtual void OnCompleted(DialogResult result) override; virtual bool ShowButtons() const override { return true; } std::map> langValuesMapping; std::map titleCodeMapping; @@ -102,7 +102,7 @@ public: PostProcScreen(const std::string &title); private: - virtual void OnCompleted(DialogResult result); + virtual void OnCompleted(DialogResult result) override; virtual bool ShowButtons() const override { return true; } std::vector shaders_; }; @@ -115,7 +115,7 @@ public: virtual void update(InputState &input) override; virtual void render() override; virtual void sendMessage(const char *message, const char *value) override; - virtual void CreateViews() {} + virtual void CreateViews() override {} private: void Next(); @@ -129,7 +129,7 @@ public: virtual void update(InputState &input) override; virtual void render() override; - virtual void CreateViews(); + virtual void CreateViews() override; private: UI::EventReturn OnOK(UI::EventParams &e); diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 7c2a6a51c8..abad0c9b29 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -128,7 +128,7 @@ protected: virtual bool FillVertical() const override { return false; } bool ShowButtons() const override { return true; } - virtual void CreatePopupContents(UI::ViewGroup *parent) { + virtual void CreatePopupContents(UI::ViewGroup *parent) override { // TODO: Find an appropriate size for the image view parent->Add(new AsyncImageFileView(filename_, UI::IS_DEFAULT, NULL, new UI::LayoutParams(480, 272)))->SetCanBeFocused(false); } diff --git a/ext/native/ext/vjson/json.cpp b/ext/native/ext/vjson/json.cpp index bdd7bb1db4..6dc65bff45 100644 --- a/ext/native/ext/vjson/json.cpp +++ b/ext/native/ext/vjson/json.cpp @@ -31,10 +31,6 @@ int json_value::numSiblings() const { } const json_value *json_value::get(const char *child_name) const { - if (!this) { - FLOG("Cannot get from null node"); - return 0; - } if (!child_name) { FLOG("JSON: Cannot get from null child name"); return 0; diff --git a/ext/native/gfx_es2/glsl_program.cpp b/ext/native/gfx_es2/glsl_program.cpp index 38725ccdb4..a620e29fdb 100644 --- a/ext/native/gfx_es2/glsl_program.cpp +++ b/ext/native/gfx_es2/glsl_program.cpp @@ -251,8 +251,8 @@ void GLSLProgram::GLLost() { // glDeleteShader(this->fsh_); // glDeleteProgram(this->program_); ILOG("Restoring GLSL program %s/%s", - this->vshader_filename ? this->vshader_filename : "(mem)", - this->fshader_filename ? this->fshader_filename : "(mem)"); + strlen(this->vshader_filename) > 0 ? this->vshader_filename : "(mem)", + strlen(this->fshader_filename) > 0 ? this->fshader_filename : "(mem)"); this->program_ = 0; this->vsh_ = 0; this->fsh_ = 0; diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 8adb4d8582..08f6383ed5 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -268,16 +268,16 @@ public: glDeleteProgram(program_); } bool Link(); - + void Apply(); void Unapply(); int GetUniformLoc(const char *name); - void SetVector(const char *name, float *value, int n); + void SetVector(const char *name, float *value, int n) override; void SetMatrix4x4(const char *name, const Matrix4x4 &value) override; - void GLLost() { + void GLLost() override { vshader->Compile(vshader->GetSource().c_str()); fshader->Compile(fshader->GetSource().c_str()); Link(); @@ -317,8 +317,8 @@ public: } // The implementation makes the choice of which shader code to use. - Thin3DShader *CreateVertexShader(const char *glsl_source, const char *hlsl_source); - Thin3DShader *CreateFragmentShader(const char *glsl_source, const char *hlsl_source); + Thin3DShader *CreateVertexShader(const char *glsl_source, const char *hlsl_source) override; + Thin3DShader *CreateFragmentShader(const char *glsl_source, const char *hlsl_source) override; void SetScissorEnabled(bool enable) override { if (enable) { @@ -424,7 +424,7 @@ public: glGenTextures(1, &tex_); register_gl_resource_holder(this); } - Thin3DGLTexture(T3DTextureType type, T3DImageFormat format, int width, int height, int depth, int mipLevels) : format_(format), tex_(0), target_(TypeToTarget(type)), mipLevels_(mipLevels) { + Thin3DGLTexture(T3DTextureType type, T3DImageFormat format, int width, int height, int depth, int mipLevels) : tex_(0), target_(TypeToTarget(type)), format_(format), mipLevels_(mipLevels) { width_ = width; height_ = height; depth_ = depth; @@ -436,7 +436,7 @@ public: Destroy(); } - bool Create(T3DTextureType type, T3DImageFormat format, int width, int height, int depth, int mipLevels) { + bool Create(T3DTextureType type, T3DImageFormat format, int width, int height, int depth, int mipLevels) override { format_ = format; target_ = TypeToTarget(type); mipLevels_ = mipLevels; @@ -459,7 +459,7 @@ public: glBindTexture(target_, tex_); } - void GLLost() { + void GLLost() override { if (!filename_.empty()) { if (LoadFromFile(filename_.c_str())) { ILOG("Reloaded lost texture %s", filename_.c_str()); @@ -471,7 +471,7 @@ public: tex_ = 0; } } - void Finalize(int zim_flags); + void Finalize(int zim_flags) override; private: GLuint tex_; diff --git a/ext/native/ui/ui_screen.h b/ext/native/ui/ui_screen.h index 1ffb28c289..0ba9449dd6 100644 --- a/ext/native/ui/ui_screen.h +++ b/ext/native/ui/ui_screen.h @@ -27,7 +27,7 @@ protected: virtual void CreateViews() = 0; virtual void DrawBackground(UIContext &dc) {} - virtual void RecreateViews() { recreateViews_ = true; } + virtual void RecreateViews() override { recreateViews_ = true; } UI::ViewGroup *root_; diff --git a/ext/native/ui/view.h b/ext/native/ui/view.h index bd7f25e2e4..10e0971be3 100644 --- a/ext/native/ui/view.h +++ b/ext/native/ui/view.h @@ -337,6 +337,7 @@ public: virtual bool CanBeFocused() const { return true; } virtual bool SubviewFocused(View *view) { return false; } + bool HasFocus() const { return GetFocusedView() == this; } @@ -583,7 +584,7 @@ public: protected: // hackery - virtual bool IsSticky() const { return true; } + bool IsSticky() const override { return true; } }; class InfoItem : public Item { @@ -655,7 +656,7 @@ public: : InertView(layoutParams), size_(0.0f) {} Spacer(float size, LayoutParams *layoutParams = 0) : InertView(layoutParams), size_(size) {} - virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const { + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { w = size_; h = size_; } void Draw(UIContext &dc) override {} diff --git a/ext/native/ui/viewgroup.h b/ext/native/ui/viewgroup.h index 6126dc63d8..f46bd2fb69 100644 --- a/ext/native/ui/viewgroup.h +++ b/ext/native/ui/viewgroup.h @@ -29,9 +29,9 @@ public: virtual void Axis(const AxisInput &input) override; // By default, a container will layout to its own bounds. - virtual void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) = 0; - virtual void Layout() = 0; - virtual void Update(const InputState &input_state); + virtual void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override = 0; + virtual void Layout() override = 0; + virtual void Update(const InputState &input_state) override; virtual void Draw(UIContext &dc) override; @@ -48,7 +48,7 @@ public: } virtual bool SetFocus() override; - virtual bool SubviewFocused(View *view); + virtual bool SubviewFocused(View *view) override; virtual void RemoveSubview(View *view); void SetDefaultFocusView(View *view) { defaultFocusView_ = view; } @@ -57,8 +57,8 @@ public: // Assumes that layout has taken place. NeighborResult FindNeighbor(View *view, FocusDirection direction, NeighborResult best); - virtual bool CanBeFocused() const { return false; } - virtual bool IsViewGroup() const { return true; } + virtual bool CanBeFocused() const override { return false; } + virtual bool IsViewGroup() const override { return true; } virtual void SetBG(const Drawable &bg) { bg_ = bg; } @@ -85,8 +85,8 @@ protected: // It simply centers the child view. class FrameLayout : public ViewGroup { public: - void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert); - void Layout(); + void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override; + void Layout() override; }; enum { @@ -342,7 +342,7 @@ public: virtual View *CreateItemView(int index) override; virtual int GetNumItems() override { return (int)items_.size(); } virtual bool AddEventCallback(View *view, std::function callback) override; - void SetSelected(int sel) { selected_ = sel; } + void SetSelected(int sel) override { selected_ = sel; } virtual std::string GetTitle(int index) const override { return items_[index]; } virtual int GetSelected() override { return selected_; }