Warning fixes for new LLVM on mac (warns on inconsistent usage of override)

This commit is contained in:
Henrik Rydgård 2015-09-17 20:29:37 +02:00
parent a3eb31994b
commit a71fbccfbc
23 changed files with 125 additions and 136 deletions

View file

@ -783,7 +783,7 @@ void ARM64XEmitter::EncodeLoadStorePair(u32 op, u32 load, IndexType type, ARM64R
imm >>= 2; 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); Rt = DecodeReg(Rt);
Rt2 = DecodeReg(Rt2); Rt2 = DecodeReg(Rt2);
@ -867,11 +867,11 @@ void ARM64XEmitter::SetJumpTarget(FixupBranch const& branch)
} }
break; break;
case 5: // B (uncoditional) 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); inst = (0x5 << 26) | MaskImm26(distance);
break; break;
case 6: // BL (unconditional) 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); inst = (0x25 << 26) | MaskImm26(distance);
break; break;
} }
@ -959,7 +959,7 @@ void ARM64XEmitter::B(CCFlags cond, const void* ptr)
distance >>= 2; 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); Write32((0x54 << 24) | (MaskImm19(distance) << 5) | cond);
} }

View file

@ -68,7 +68,7 @@ public:
int Abort(); int Abort();
protected: protected:
virtual bool UseAutoStatus() { virtual bool UseAutoStatus() override {
return false; return false;
} }

View file

@ -17,6 +17,8 @@
#pragma once #pragma once
#include <string>
#include "Core/Dialog/PSPDialog.h" #include "Core/Dialog/PSPDialog.h"
#include "Core/MemMap.h" #include "Core/MemMap.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
@ -177,9 +179,9 @@ enum OskKeyboardLanguage
// Internal enum, not from PSP. // Internal enum, not from PSP.
enum enum
{ {
LOWERCASE, LOWERCASE,
UPPERCASE UPPERCASE
}; };
const OskKeyboardDisplay OskKeyboardCases[OSK_LANGUAGE_COUNT][2] = const OskKeyboardDisplay OskKeyboardCases[OSK_LANGUAGE_COUNT][2] =
@ -212,7 +214,7 @@ public:
virtual pspUtilityDialogCommon *GetCommonParam() override; virtual pspUtilityDialogCommon *GetCommonParam() override;
protected: protected:
virtual bool UseAutoStatus() { virtual bool UseAutoStatus() override {
return false; return false;
} }
@ -227,7 +229,7 @@ private:
std::wstring CombinationString(bool isInput); // for Japanese, Korean std::wstring CombinationString(bool isInput); // for Japanese, Korean
std::wstring CombinationKorean(bool isInput); // for Korea std::wstring CombinationKorean(bool isInput); // for Korea
void RemoveKorean(); // for Korean character removal void RemoveKorean(); // for Korean character removal
u32 FieldMaxLength(); u32 FieldMaxLength();
int GetIndex(const wchar_t* src, wchar_t ch); int GetIndex(const wchar_t* src, wchar_t ch);

View file

@ -81,7 +81,7 @@ public:
void ExecuteIOAction(); void ExecuteIOAction();
protected: protected:
virtual bool UseAutoStatus() { virtual bool UseAutoStatus() override {
return false; return false;
} }

View file

@ -18,10 +18,11 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include <string>
#include "Core/HLE/sceKernel.h" #include "Core/HLE/sceKernel.h"
enum FileAccess enum FileAccess {
{
FILEACCESS_NONE = 0, FILEACCESS_NONE = 0,
FILEACCESS_READ = 1, FILEACCESS_READ = 1,
FILEACCESS_WRITE = 2, FILEACCESS_WRITE = 2,
@ -30,28 +31,24 @@ enum FileAccess
FILEACCESS_TRUNCATE = 16, FILEACCESS_TRUNCATE = 16,
}; };
enum FileMove enum FileMove {
{
FILEMOVE_BEGIN = 0, FILEMOVE_BEGIN = 0,
FILEMOVE_CURRENT = 1, FILEMOVE_CURRENT = 1,
FILEMOVE_END = 2 FILEMOVE_END = 2
}; };
enum FileType enum FileType {
{
FILETYPE_NORMAL = 1, FILETYPE_NORMAL = 1,
FILETYPE_DIRECTORY = 2 FILETYPE_DIRECTORY = 2
}; };
enum DevType enum DevType {
{
PSP_DEV_TYPE_BLOCK = 0x04, PSP_DEV_TYPE_BLOCK = 0x04,
PSP_DEV_TYPE_FILE = 0x10, PSP_DEV_TYPE_FILE = 0x10,
PSP_DEV_TYPE_ALIAS = 0x20, PSP_DEV_TYPE_ALIAS = 0x20,
}; };
enum FileSystemFlags enum FileSystemFlags {
{
FILESYSTEM_SIMULATE_FAT32 = 1, FILESYSTEM_SIMULATE_FAT32 = 1,
}; };
@ -65,20 +62,19 @@ public:
class SequentialHandleAllocator : public IHandleAllocator { class SequentialHandleAllocator : public IHandleAllocator {
public: public:
SequentialHandleAllocator() : handle_(1) {} SequentialHandleAllocator() : handle_(1) {}
virtual u32 GetNewHandle() { virtual u32 GetNewHandle() override {
u32 res = handle_++; u32 res = handle_++;
if (handle_ < 0) { if (handle_ < 0) {
handle_ = 0; handle_ = 0;
} }
return res; return res;
} }
virtual void FreeHandle(u32 handle) {} virtual void FreeHandle(u32 handle) override {}
private: private:
int handle_; int handle_;
}; };
struct PSPFileInfo struct PSPFileInfo {
{
PSPFileInfo() PSPFileInfo()
: size(0), access(0), exists(false), type(FILETYPE_NORMAL), isOnSectorSystem(false), startSector(0), numSectors(0) {} : 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: public:
virtual ~IFileSystem() {} virtual ~IFileSystem() {}
virtual void DoState(PointerWrap &p) = 0; virtual void DoState(PointerWrap &p) = 0;
virtual std::vector<PSPFileInfo> GetDirListing(std::string path) = 0; virtual std::vector<PSPFileInfo> 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 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) = 0;
virtual size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) = 0; virtual size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) = 0;
@ -132,25 +127,25 @@ public:
class EmptyFileSystem : public IFileSystem class EmptyFileSystem : public IFileSystem
{ {
public: public:
virtual void DoState(PointerWrap &p) {} virtual void DoState(PointerWrap &p) override {}
std::vector<PSPFileInfo> GetDirListing(std::string path) {std::vector<PSPFileInfo> vec; return vec;} std::vector<PSPFileInfo> GetDirListing(std::string path) override {std::vector<PSPFileInfo> vec; return vec;}
u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL) {return 0;} u32 OpenFile(std::string filename, FileAccess access, const char *devicename=nullptr) override {return 0;}
void CloseFile(u32 handle) {} void CloseFile(u32 handle) override {}
size_t ReadFile(u32 handle, u8 *pointer, s64 size) {return 0;} size_t ReadFile(u32 handle, u8 *pointer, s64 size) override {return 0;}
size_t ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) {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) {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) {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) {return 0;} size_t SeekFile(u32 handle, s32 position, FileMove type) override {return 0;}
PSPFileInfo GetFileInfo(std::string filename) {PSPFileInfo f; return f;} PSPFileInfo GetFileInfo(std::string filename) override {PSPFileInfo f; return f;}
bool OwnsHandle(u32 handle) {return false;} bool OwnsHandle(u32 handle) override {return false;}
virtual bool MkDir(const std::string &dirname) {return false;} virtual bool MkDir(const std::string &dirname) override {return false;}
virtual bool RmDir(const std::string &dirname) {return false;} virtual bool RmDir(const std::string &dirname) override {return false;}
virtual int RenameFile(const std::string &from, const std::string &to) {return -1;} virtual int RenameFile(const std::string &from, const std::string &to) override {return -1;}
virtual bool RemoveFile(const std::string &filename) {return false;} virtual bool RemoveFile(const std::string &filename) override {return false;}
virtual bool GetHostPath(const std::string &inpath, std::string &outpath) {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) {return SCE_KERNEL_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED; } 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) { return 0; } virtual int DevType(u32 handle) override { return 0; }
virtual int Flags() { return 0; } virtual int Flags() override { return 0; }
virtual u64 FreeSpace(const std::string &path) override { return 0; } virtual u64 FreeSpace(const std::string &path) override { return 0; }
}; };

View file

@ -26,8 +26,7 @@
bool parseLBN(std::string filename, u32 *sectorStart, u32 *readSize); bool parseLBN(std::string filename, u32 *sectorStart, u32 *readSize);
class ISOFileSystem : public IFileSystem class ISOFileSystem : public IFileSystem {
{
public: public:
ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice, std::string _restrictPath = ""); ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice, std::string _restrictPath = "");
~ISOFileSystem(); ~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) override;
size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) 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 MkDir(const std::string &dirname) override {return false;}
bool RmDir(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; } int RenameFile(const std::string &from, const std::string &to) override { return -1; }
bool RemoveFile(const std::string &filename) override { return false; } bool RemoveFile(const std::string &filename) override { return false; }
private: private:
struct TreeEntry struct TreeEntry {
{
TreeEntry(){} TreeEntry(){}
~TreeEntry(); ~TreeEntry();
@ -71,8 +69,7 @@ private:
std::vector<TreeEntry*> children; std::vector<TreeEntry*> children;
}; };
struct OpenFileEntry struct OpenFileEntry {
{
TreeEntry *file; TreeEntry *file;
unsigned int seekPos; // TODO: Make 64-bit? unsigned int seekPos; // TODO: Make 64-bit?
bool isRawSector; // "/sce_lbn" mode bool isRawSector; // "/sce_lbn" mode
@ -80,7 +77,7 @@ private:
u32 sectorStart; u32 sectorStart;
u32 openSize; u32 openSize;
}; };
typedef std::map<u32,OpenFileEntry> EntryMap; typedef std::map<u32,OpenFileEntry> EntryMap;
EntryMap entries; EntryMap entries;
IHandleAllocator *hAlloc; IHandleAllocator *hAlloc;
@ -147,7 +144,7 @@ public:
size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) override { size_t WriteFile(u32 handle, const u8 *pointer, s64 size, int &usec) override {
return isoFileSystem_->WriteFile(handle, pointer, size, usec); 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 MkDir(const std::string &dirname) override { return false; }
bool RmDir(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; } int RenameFile(const std::string &from, const std::string &to) override { return -1; }

View file

@ -17,23 +17,24 @@
#pragma once #pragma once
#include <string>
#include <vector>
#include "base/mutex.h" #include "base/mutex.h"
#include "Core/FileSystems/FileSystem.h" #include "Core/FileSystems/FileSystem.h"
class MetaFileSystem : public IHandleAllocator, public IFileSystem class MetaFileSystem : public IHandleAllocator, public IFileSystem {
{
private: private:
s32 current; s32 current;
struct MountPoint struct MountPoint {
{
std::string prefix; std::string prefix;
IFileSystem *system; IFileSystem *system;
bool operator == (const MountPoint &other) const bool operator == (const MountPoint &other) const {
{
return prefix == other.prefix && system == other.system; return prefix == other.prefix && system == other.system;
} }
}; };
std::vector<MountPoint> fileSystems; std::vector<MountPoint> fileSystems;
typedef std::map<int, std::string> currentDir_t; typedef std::map<int, std::string> currentDir_t;
@ -44,8 +45,7 @@ private:
recursive_mutex lock; recursive_mutex lock;
public: public:
MetaFileSystem() MetaFileSystem() {
{
current = 6; // what? current = 6; // what?
} }
@ -60,7 +60,7 @@ public:
void Shutdown(); void Shutdown();
u32 GetNewHandle() { u32 GetNewHandle() override {
u32 res = current++; u32 res = current++;
if (current < 0) { if (current < 0) {
current = 0; current = 0;
@ -74,11 +74,9 @@ public:
IFileSystem *GetHandleOwner(u32 handle); IFileSystem *GetHandleOwner(u32 handle);
bool MapFilePath(const std::string &inpath, std::string &outpath, MountPoint **system); 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; MountPoint *mountPoint;
if (MapFilePath(_inpath, outpath, &mountPoint)) if (MapFilePath(_inpath, outpath, &mountPoint)) {
{
*system = mountPoint->system; *system = mountPoint->system;
return true; return true;
} }
@ -90,7 +88,7 @@ public:
// Only possible if a file system is a DirectoryFileSystem or similar. // Only possible if a file system is a DirectoryFileSystem or similar.
bool GetHostPath(const std::string &inpath, std::string &outpath) override; bool GetHostPath(const std::string &inpath, std::string &outpath) override;
std::vector<PSPFileInfo> GetDirListing(std::string path) override; std::vector<PSPFileInfo> GetDirListing(std::string path) override;
u32 OpenFile(std::string filename, FileAccess access, const char *devicename = NULL) 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); u32 OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename = NULL);

View file

@ -75,9 +75,9 @@ public:
transformDraw_ = td; transformDraw_ = td;
} }
virtual void MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override; 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; 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 DrawFramebuffer(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override;
// If texture != 0, will bind it. // If texture != 0, will bind it.
// x,y,w,h are relative to destW, destH which fill out the target completely. // x,y,w,h are relative to destW, destH which fill out the target completely.
@ -105,10 +105,10 @@ public:
std::vector<FramebufferInfo> GetFramebufferList(); std::vector<FramebufferInfo> 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 DestroyFramebuf(VirtualFramebuffer *vfb) override;
void ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force = false); 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 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); bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer);

View file

@ -76,14 +76,14 @@ public:
primaryInfo = reportingPrimaryInfo_; primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_; fullInfo = reportingFullInfo_;
} }
std::vector<FramebufferInfo> GetFramebufferList(); std::vector<FramebufferInfo> GetFramebufferList() override;
bool GetCurrentFramebuffer(GPUDebugBuffer &buffer); bool GetCurrentFramebuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentTexture(GPUDebugBuffer &buffer, int level); bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override;
static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer);
bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices); bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
bool DescribeCodePtr(const u8 *ptr, std::string &name) override; bool DescribeCodePtr(const u8 *ptr, std::string &name) override;

View file

@ -128,7 +128,7 @@ public:
} }
void InitDeviceObjects(); void InitDeviceObjects();
void DestroyDeviceObjects(); void DestroyDeviceObjects();
void GLLost(); void GLLost() override;
void Resized(); void Resized();
void DecimateTrackedVertexArrays(); void DecimateTrackedVertexArrays();

View file

@ -84,7 +84,7 @@ public:
bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override; bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override;
bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices); bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
protected: protected:
void FastRunLoop(DisplayList &list) override; void FastRunLoop(DisplayList &list) override;

View file

@ -356,13 +356,13 @@ class JoystickHistoryView : public UI::InertView {
public: public:
JoystickHistoryView(int xAxis, int xDevice, int yAxis, int yDevice, UI::LayoutParams *layoutParams = nullptr) JoystickHistoryView(int xAxis, int xDevice, int yAxis, int yDevice, UI::LayoutParams *layoutParams = nullptr)
: UI::InertView(layoutParams), : UI::InertView(layoutParams),
xAxis_(xAxis), xDevice_(xDevice), xAxis_(xAxis), xDevice_(xDevice),
yAxis_(yAxis), yDevice_(yDevice), yAxis_(yAxis), yDevice_(yDevice),
curX_(0.0f), curY_(0.0f), curX_(0.0f), curY_(0.0f),
maxCount_(500) {} maxCount_(500) {}
void Draw(UIContext &dc) override; void Draw(UIContext &dc) override;
void Update(const InputState &input_state) override; void Update(const InputState &input_state) override;
void Axis(const AxisInput &input) { void Axis(const AxisInput &input) override{
if (input.axisId == xAxis_) { if (input.axisId == xAxis_) {
curX_ = input.value; curX_ = input.value;
} else if (input.axisId == yAxis_) { } else if (input.axisId == yAxis_) {
@ -379,8 +379,8 @@ private:
}; };
int xAxis_; int xAxis_;
int yAxis_;
int xDevice_; int xDevice_;
int yAxis_;
int yDevice_; int yDevice_;
float curX_; float curX_;

View file

@ -97,7 +97,7 @@ public:
protected: protected:
virtual void CreatePopupContents(UI::ViewGroup *parent) override; 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 OnDigitButton(UI::EventParams &e);
UI::EventReturn OnBackspace(UI::EventParams &e); UI::EventReturn OnBackspace(UI::EventParams &e);
@ -114,7 +114,7 @@ private:
class JitCompareScreen : public UIDialogScreenWithBackground { class JitCompareScreen : public UIDialogScreenWithBackground {
public: public:
JitCompareScreen() : currentBlock_(-1) {} JitCompareScreen() : currentBlock_(-1) {}
virtual void CreateViews(); virtual void CreateViews() override;
private: private:
void UpdateDisasm(); void UpdateDisasm();
@ -137,8 +137,8 @@ private:
UI::TextEdit *blockAddr_; UI::TextEdit *blockAddr_;
UI::TextView *blockStats_; UI::TextView *blockStats_;
UI::LinearLayout *leftDisasm_; UI::LinearLayout *leftDisasm_;
UI::LinearLayout *rightDisasm_; UI::LinearLayout *rightDisasm_;
}; };

View file

@ -46,7 +46,7 @@ public:
virtual bool axis(const AxisInput &axis) override; virtual bool axis(const AxisInput &axis) override;
protected: protected:
virtual void CreateViews(); virtual void CreateViews() override;
UI::EventReturn OnDevTools(UI::EventParams &params); UI::EventReturn OnDevTools(UI::EventParams &params);
private: private:

View file

@ -29,11 +29,11 @@ public:
: UI::View(layoutParams), pointerDownMask_(0), scale_(scale), bgImg_(bgImg), img_(img), angle_(0.0f), flipImageH_(false) { : 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 bool Key(const KeyInput &input) override { return false; }
virtual void Update(const InputState &input) {} virtual void Update(const InputState &input) override {}
virtual void Touch(const TouchInput &input); virtual void Touch(const TouchInput &input) override;
virtual void Draw(UIContext &dc); virtual void Draw(UIContext &dc) override;
virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const; virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const override;
virtual bool IsDown() { return pointerDownMask_ != 0; } virtual bool IsDown() { return pointerDownMask_ != 0; }
// chainable // chainable
MultiTouchButton *FlipImageH(bool flip) { flipImageH_ = flip; return this; } MultiTouchButton *FlipImageH(bool flip) { flipImageH_ = flip; return this; }
@ -57,7 +57,7 @@ public:
} }
virtual void Touch(const TouchInput &input) override; virtual void Touch(const TouchInput &input) override;
virtual bool IsDown() { return *value_; } virtual bool IsDown() override { return *value_; }
private: private:
bool *value_; bool *value_;
@ -69,7 +69,7 @@ public:
: MultiTouchButton(bgImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) { : MultiTouchButton(bgImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) {
} }
void Touch(const TouchInput &input) override; void Touch(const TouchInput &input) override;
virtual bool IsDown(); virtual bool IsDown() override;
private: private:
int pspButtonBit_; int pspButtonBit_;

View file

@ -34,7 +34,7 @@ class UIScreenWithBackground : public UIScreen {
public: public:
UIScreenWithBackground() : UIScreen() {} UIScreenWithBackground() : UIScreen() {}
protected: protected:
virtual void DrawBackground(UIContext &dc); virtual void DrawBackground(UIContext &dc) override;
virtual void sendMessage(const char *message, const char *value) override; virtual void sendMessage(const char *message, const char *value) override;
virtual UI::EventReturn OnLanguageChange(UI::EventParams &e); virtual UI::EventReturn OnLanguageChange(UI::EventParams &e);
}; };
@ -52,7 +52,7 @@ class UIDialogScreenWithBackground : public UIDialogScreen {
public: public:
UIDialogScreenWithBackground() : UIDialogScreen() {} UIDialogScreenWithBackground() : UIDialogScreen() {}
protected: protected:
virtual void DrawBackground(UIContext &dc); virtual void DrawBackground(UIContext &dc) override;
virtual void sendMessage(const char *message, const char *value) override; virtual void sendMessage(const char *message, const char *value) override;
virtual UI::EventReturn OnLanguageChange(UI::EventParams &e); virtual UI::EventReturn OnLanguageChange(UI::EventParams &e);
@ -63,14 +63,14 @@ class UIDialogScreenWithGameBackground : public UIDialogScreenWithBackground {
public: public:
UIDialogScreenWithGameBackground(const std::string &gamePath) UIDialogScreenWithGameBackground(const std::string &gamePath)
: UIDialogScreenWithBackground(), gamePath_(gamePath) {} : UIDialogScreenWithBackground(), gamePath_(gamePath) {}
virtual void DrawBackground(UIContext &dc); virtual void DrawBackground(UIContext &dc) override;
protected: protected:
std::string gamePath_; std::string gamePath_;
}; };
class PromptScreen : public UIDialogScreenWithBackground { class PromptScreen : public UIDialogScreenWithBackground {
public: public:
PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText,
std::function<void(bool)> callback = &NoOpVoidBool); std::function<void(bool)> callback = &NoOpVoidBool);
virtual void CreateViews() override; virtual void CreateViews() override;
@ -90,7 +90,7 @@ public:
NewLanguageScreen(const std::string &title); NewLanguageScreen(const std::string &title);
private: private:
virtual void OnCompleted(DialogResult result); virtual void OnCompleted(DialogResult result) override;
virtual bool ShowButtons() const override { return true; } virtual bool ShowButtons() const override { return true; }
std::map<std::string, std::pair<std::string, int>> langValuesMapping; std::map<std::string, std::pair<std::string, int>> langValuesMapping;
std::map<std::string, std::string> titleCodeMapping; std::map<std::string, std::string> titleCodeMapping;
@ -102,7 +102,7 @@ public:
PostProcScreen(const std::string &title); PostProcScreen(const std::string &title);
private: private:
virtual void OnCompleted(DialogResult result); virtual void OnCompleted(DialogResult result) override;
virtual bool ShowButtons() const override { return true; } virtual bool ShowButtons() const override { return true; }
std::vector<ShaderInfo> shaders_; std::vector<ShaderInfo> shaders_;
}; };
@ -115,7 +115,7 @@ public:
virtual void update(InputState &input) override; virtual void update(InputState &input) override;
virtual void render() override; virtual void render() override;
virtual void sendMessage(const char *message, const char *value) override; virtual void sendMessage(const char *message, const char *value) override;
virtual void CreateViews() {} virtual void CreateViews() override {}
private: private:
void Next(); void Next();
@ -129,7 +129,7 @@ public:
virtual void update(InputState &input) override; virtual void update(InputState &input) override;
virtual void render() override; virtual void render() override;
virtual void CreateViews(); virtual void CreateViews() override;
private: private:
UI::EventReturn OnOK(UI::EventParams &e); UI::EventReturn OnOK(UI::EventParams &e);

View file

@ -128,7 +128,7 @@ protected:
virtual bool FillVertical() const override { return false; } virtual bool FillVertical() const override { return false; }
bool ShowButtons() const override { return true; } 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 // 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); parent->Add(new AsyncImageFileView(filename_, UI::IS_DEFAULT, NULL, new UI::LayoutParams(480, 272)))->SetCanBeFocused(false);
} }

View file

@ -31,10 +31,6 @@ int json_value::numSiblings() const {
} }
const json_value *json_value::get(const char *child_name) 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) { if (!child_name) {
FLOG("JSON: Cannot get from null child name"); FLOG("JSON: Cannot get from null child name");
return 0; return 0;

View file

@ -251,8 +251,8 @@ void GLSLProgram::GLLost() {
// glDeleteShader(this->fsh_); // glDeleteShader(this->fsh_);
// glDeleteProgram(this->program_); // glDeleteProgram(this->program_);
ILOG("Restoring GLSL program %s/%s", ILOG("Restoring GLSL program %s/%s",
this->vshader_filename ? this->vshader_filename : "(mem)", strlen(this->vshader_filename) > 0 ? this->vshader_filename : "(mem)",
this->fshader_filename ? this->fshader_filename : "(mem)"); strlen(this->fshader_filename) > 0 ? this->fshader_filename : "(mem)");
this->program_ = 0; this->program_ = 0;
this->vsh_ = 0; this->vsh_ = 0;
this->fsh_ = 0; this->fsh_ = 0;

View file

@ -268,16 +268,16 @@ public:
glDeleteProgram(program_); glDeleteProgram(program_);
} }
bool Link(); bool Link();
void Apply(); void Apply();
void Unapply(); void Unapply();
int GetUniformLoc(const char *name); 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 SetMatrix4x4(const char *name, const Matrix4x4 &value) override;
void GLLost() { void GLLost() override {
vshader->Compile(vshader->GetSource().c_str()); vshader->Compile(vshader->GetSource().c_str());
fshader->Compile(fshader->GetSource().c_str()); fshader->Compile(fshader->GetSource().c_str());
Link(); Link();
@ -317,8 +317,8 @@ public:
} }
// The implementation makes the choice of which shader code to use. // The implementation makes the choice of which shader code to use.
Thin3DShader *CreateVertexShader(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); Thin3DShader *CreateFragmentShader(const char *glsl_source, const char *hlsl_source) override;
void SetScissorEnabled(bool enable) override { void SetScissorEnabled(bool enable) override {
if (enable) { if (enable) {
@ -424,7 +424,7 @@ public:
glGenTextures(1, &tex_); glGenTextures(1, &tex_);
register_gl_resource_holder(this); 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; width_ = width;
height_ = height; height_ = height;
depth_ = depth; depth_ = depth;
@ -436,7 +436,7 @@ public:
Destroy(); 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; format_ = format;
target_ = TypeToTarget(type); target_ = TypeToTarget(type);
mipLevels_ = mipLevels; mipLevels_ = mipLevels;
@ -459,7 +459,7 @@ public:
glBindTexture(target_, tex_); glBindTexture(target_, tex_);
} }
void GLLost() { void GLLost() override {
if (!filename_.empty()) { if (!filename_.empty()) {
if (LoadFromFile(filename_.c_str())) { if (LoadFromFile(filename_.c_str())) {
ILOG("Reloaded lost texture %s", filename_.c_str()); ILOG("Reloaded lost texture %s", filename_.c_str());
@ -471,7 +471,7 @@ public:
tex_ = 0; tex_ = 0;
} }
} }
void Finalize(int zim_flags); void Finalize(int zim_flags) override;
private: private:
GLuint tex_; GLuint tex_;

View file

@ -27,7 +27,7 @@ protected:
virtual void CreateViews() = 0; virtual void CreateViews() = 0;
virtual void DrawBackground(UIContext &dc) {} virtual void DrawBackground(UIContext &dc) {}
virtual void RecreateViews() { recreateViews_ = true; } virtual void RecreateViews() override { recreateViews_ = true; }
UI::ViewGroup *root_; UI::ViewGroup *root_;

View file

@ -337,6 +337,7 @@ public:
virtual bool CanBeFocused() const { return true; } virtual bool CanBeFocused() const { return true; }
virtual bool SubviewFocused(View *view) { return false; } virtual bool SubviewFocused(View *view) { return false; }
bool HasFocus() const { bool HasFocus() const {
return GetFocusedView() == this; return GetFocusedView() == this;
} }
@ -583,7 +584,7 @@ public:
protected: protected:
// hackery // hackery
virtual bool IsSticky() const { return true; } bool IsSticky() const override { return true; }
}; };
class InfoItem : public Item { class InfoItem : public Item {
@ -655,7 +656,7 @@ public:
: InertView(layoutParams), size_(0.0f) {} : InertView(layoutParams), size_(0.0f) {}
Spacer(float size, LayoutParams *layoutParams = 0) Spacer(float size, LayoutParams *layoutParams = 0)
: InertView(layoutParams), size_(size) {} : 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_; w = size_; h = size_;
} }
void Draw(UIContext &dc) override {} void Draw(UIContext &dc) override {}

View file

@ -29,9 +29,9 @@ public:
virtual void Axis(const AxisInput &input) override; virtual void Axis(const AxisInput &input) override;
// By default, a container will layout to its own bounds. // By default, a container will layout to its own bounds.
virtual void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) = 0; virtual void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override = 0;
virtual void Layout() = 0; virtual void Layout() override = 0;
virtual void Update(const InputState &input_state); virtual void Update(const InputState &input_state) override;
virtual void Draw(UIContext &dc) override; virtual void Draw(UIContext &dc) override;
@ -48,7 +48,7 @@ public:
} }
virtual bool SetFocus() override; virtual bool SetFocus() override;
virtual bool SubviewFocused(View *view); virtual bool SubviewFocused(View *view) override;
virtual void RemoveSubview(View *view); virtual void RemoveSubview(View *view);
void SetDefaultFocusView(View *view) { defaultFocusView_ = view; } void SetDefaultFocusView(View *view) { defaultFocusView_ = view; }
@ -57,8 +57,8 @@ public:
// Assumes that layout has taken place. // Assumes that layout has taken place.
NeighborResult FindNeighbor(View *view, FocusDirection direction, NeighborResult best); NeighborResult FindNeighbor(View *view, FocusDirection direction, NeighborResult best);
virtual bool CanBeFocused() const { return false; } virtual bool CanBeFocused() const override { return false; }
virtual bool IsViewGroup() const { return true; } virtual bool IsViewGroup() const override { return true; }
virtual void SetBG(const Drawable &bg) { bg_ = bg; } virtual void SetBG(const Drawable &bg) { bg_ = bg; }
@ -85,8 +85,8 @@ protected:
// It simply centers the child view. // It simply centers the child view.
class FrameLayout : public ViewGroup { class FrameLayout : public ViewGroup {
public: public:
void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert); void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override;
void Layout(); void Layout() override;
}; };
enum { enum {
@ -342,7 +342,7 @@ public:
virtual View *CreateItemView(int index) override; virtual View *CreateItemView(int index) override;
virtual int GetNumItems() override { return (int)items_.size(); } virtual int GetNumItems() override { return (int)items_.size(); }
virtual bool AddEventCallback(View *view, std::function<EventReturn(EventParams&)> callback) override; virtual bool AddEventCallback(View *view, std::function<EventReturn(EventParams&)> 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 std::string GetTitle(int index) const override { return items_[index]; }
virtual int GetSelected() override { return selected_; } virtual int GetSelected() override { return selected_; }