General: Make use of override where applicable

Continues the override modernizations, but now targeting boo.
This commit is contained in:
Lioncash
2019-08-12 20:52:20 -04:00
parent af50bc0bc2
commit d4cd2b4dce
34 changed files with 732 additions and 714 deletions

View File

@@ -21,7 +21,7 @@ class ApplicationNX : public IApplication {
NXContext m_nxCtx;
void _deletedWindow(IWindow* window) {}
void _deletedWindow(IWindow* window) override {}
public:
ApplicationNX(IApplicationCallback& callback, std::string_view uniqueName, std::string_view friendlyName,
@@ -29,9 +29,9 @@ public:
uint32_t anisotropy, bool deepColor, bool singleInstance)
: m_callback(callback), m_uniqueName(uniqueName), m_friendlyName(friendlyName), m_pname(pname), m_args(args) {}
EPlatformType getPlatformType() const { return EPlatformType::NX; }
EPlatformType getPlatformType() const override { return EPlatformType::NX; }
int run() {
int run() override {
/* Spawn client thread */
int clientReturn = INT_MIN;
std::mutex initmt;
@@ -63,16 +63,16 @@ public:
return 0;
}
std::string_view getUniqueName() const { return m_uniqueName; }
std::string_view getUniqueName() const override { return m_uniqueName; }
std::string_view getFriendlyName() const { return m_friendlyName; }
std::string_view getFriendlyName() const override { return m_friendlyName; }
std::string_view getProcessName() const { return m_pname; }
std::string_view getProcessName() const override { return m_pname; }
const std::vector<std::string>& getArgs() const { return m_args; }
const std::vector<std::string>& getArgs() const override { return m_args; }
std::shared_ptr<IWindow> m_window;
std::shared_ptr<IWindow> newWindow(std::string_view title) {
std::shared_ptr<IWindow> newWindow(std::string_view title) override {
if (m_window)
Log.report(logvisor::Fatal, fmt("Only 1 window allowed on NX"));
m_window = _WindowNXNew(title, &m_nxCtx);

View File

@@ -21,18 +21,18 @@ public:
m_commandQueue = _NewNXCommandQueue(nxCtx, this);
}
EGraphicsAPI getAPI() const { return EGraphicsAPI::NX; }
EPixelFormat getPixelFormat() const { return EPixelFormat::RGBA8; }
void setPixelFormat(EPixelFormat pf) {}
bool initializeContext(void* handle) { return m_nxCtx->initialize(); }
void makeCurrent() {}
void postInit() {}
void present() {}
EGraphicsAPI getAPI() const override { return EGraphicsAPI::NX; }
EPixelFormat getPixelFormat() const override { return EPixelFormat::RGBA8; }
void setPixelFormat(EPixelFormat pf) override {}
bool initializeContext(void* handle) override { return m_nxCtx->initialize(); }
void makeCurrent() override {}
void postInit() override {}
void present() override {}
IGraphicsCommandQueue* getCommandQueue() { return m_commandQueue.get(); }
IGraphicsDataFactory* getDataFactory() { return m_dataFactory.get(); }
IGraphicsDataFactory* getMainContextDataFactory() { return m_dataFactory.get(); }
IGraphicsDataFactory* getLoadContextDataFactory() { return m_dataFactory.get(); }
IGraphicsCommandQueue* getCommandQueue() override { return m_commandQueue.get(); }
IGraphicsDataFactory* getDataFactory() override { return m_dataFactory.get(); }
IGraphicsDataFactory* getMainContextDataFactory() override { return m_dataFactory.get(); }
IGraphicsDataFactory* getLoadContextDataFactory() override { return m_dataFactory.get(); }
};
class WindowNX : public IWindow {
@@ -45,20 +45,20 @@ public:
m_gfxCtx->initializeContext(nullptr);
}
void setCallback(IWindowCallback* cb) { m_callback = cb; }
void setCallback(IWindowCallback* cb) override { m_callback = cb; }
void closeWindow() {}
void showWindow() {}
void hideWindow() {}
void closeWindow() override {}
void showWindow() override {}
void hideWindow() override {}
SystemString getTitle() { return m_title; }
void setTitle(SystemStringView title) { m_title = title; }
SystemString getTitle() override { return m_title; }
void setTitle(SystemStringView title) override { m_title = title; }
void setCursor(EMouseCursor cursor) {}
void setWaitCursor(bool wait) {}
void setCursor(EMouseCursor cursor) override {}
void setWaitCursor(bool wait) override {}
void setWindowFrameDefault() {}
void getWindowFrame(float& xOut, float& yOut, float& wOut, float& hOut) const {
void setWindowFrameDefault() override {}
void getWindowFrame(float& xOut, float& yOut, float& wOut, float& hOut) const override {
u32 width, height;
gfxGetFramebufferResolution(&width, &height);
xOut = 0;
@@ -66,7 +66,7 @@ public:
wOut = width;
hOut = height;
}
void getWindowFrame(int& xOut, int& yOut, int& wOut, int& hOut) const {
void getWindowFrame(int& xOut, int& yOut, int& wOut, int& hOut) const override {
u32 width, height;
gfxGetFramebufferResolution(&width, &height);
xOut = 0;
@@ -74,37 +74,37 @@ public:
wOut = width;
hOut = height;
}
void setWindowFrame(float x, float y, float w, float h) {}
void setWindowFrame(int x, int y, int w, int h) {}
float getVirtualPixelFactor() const { return 1.f; }
void setWindowFrame(float x, float y, float w, float h) override {}
void setWindowFrame(int x, int y, int w, int h) override {}
float getVirtualPixelFactor() const override { return 1.f; }
bool isFullscreen() const { return true; }
void setFullscreen(bool fs) {}
bool isFullscreen() const override { return true; }
void setFullscreen(bool fs) override {}
void claimKeyboardFocus(const int coord[2]) {}
bool clipboardCopy(EClipboardType type, const uint8_t* data, size_t sz) { return false; }
std::unique_ptr<uint8_t[]> clipboardPaste(EClipboardType type, size_t& sz) { return {}; }
void claimKeyboardFocus(const int coord[2]) override {}
bool clipboardCopy(EClipboardType type, const uint8_t* data, size_t sz) override { return false; }
std::unique_ptr<uint8_t[]> clipboardPaste(EClipboardType type, size_t& sz) override { return {}; }
void waitForRetrace() {}
void waitForRetrace() override {}
uintptr_t getPlatformHandle() const { return 0; }
bool _incomingEvent(void* event) {
uintptr_t getPlatformHandle() const override { return 0; }
bool _incomingEvent(void* event) override {
(void)event;
return false;
}
void _cleanup() {}
void _cleanup() override {}
ETouchType getTouchType() const { return ETouchType::Display; }
ETouchType getTouchType() const override { return ETouchType::Display; }
void setStyle(EWindowStyle style) {}
EWindowStyle getStyle() const { return EWindowStyle::None; }
void setStyle(EWindowStyle style) override {}
EWindowStyle getStyle() const override { return EWindowStyle::None; }
void setTouchBarProvider(void*) {}
void setTouchBarProvider(void*) override {}
IGraphicsCommandQueue* getCommandQueue() { return m_gfxCtx->getCommandQueue(); }
IGraphicsDataFactory* getDataFactory() { return m_gfxCtx->getDataFactory(); }
IGraphicsDataFactory* getMainContextDataFactory() { return m_gfxCtx->getMainContextDataFactory(); }
IGraphicsDataFactory* getLoadContextDataFactory() { return m_gfxCtx->getLoadContextDataFactory(); }
IGraphicsCommandQueue* getCommandQueue() override { return m_gfxCtx->getCommandQueue(); }
IGraphicsDataFactory* getDataFactory() override { return m_gfxCtx->getDataFactory(); }
IGraphicsDataFactory* getMainContextDataFactory() override { return m_gfxCtx->getMainContextDataFactory(); }
IGraphicsDataFactory* getLoadContextDataFactory() override { return m_gfxCtx->getLoadContextDataFactory(); }
};
std::shared_ptr<IWindow> _WindowNXNew(std::string_view title, NXContext* nxCtx) {