Update to new icon API

This commit is contained in:
wheremyfoodat 2023-10-23 15:38:45 +03:00
parent 8902e796da
commit 039066663a
3 changed files with 795 additions and 1063 deletions

File diff suppressed because it is too large Load diff

View file

@ -5,11 +5,7 @@
#include "hydra_icon.hpp"
class HC_GLOBAL HydraCore final : public hydra::IBase,
public hydra::IOpenGlRendered,
public hydra::IFrontendDriven,
public hydra::IInput,
public hydra::IIcon {
class HC_GLOBAL HydraCore final : public hydra::IBase, public hydra::IOpenGlRendered, public hydra::IFrontendDriven, public hydra::IInput {
HYDRA_CLASS
public:
HydraCore();
@ -34,10 +30,6 @@ class HC_GLOBAL HydraCore final : public hydra::IBase,
void setPollInputCallback(void (*callback)()) override;
void setCheckButtonCallback(int32_t (*callback)(uint32_t player, hydra::ButtonType button)) override;
// IICon
hydra::Size getIconSize() override;
const u8* getIconData() override;
std::unique_ptr<Emulator> emulator;
RendererGL* renderer;
void (*pollInputCallback)() = nullptr;
@ -114,9 +106,6 @@ void HydraCore::setFbo(unsigned handle) { renderer->setFBO(handle); }
void HydraCore::setPollInputCallback(void (*callback)()) { pollInputCallback = callback; }
void HydraCore::setCheckButtonCallback(int32_t (*callback)(uint32_t player, hydra::ButtonType button)) { checkButtonCallback = callback; }
hydra::Size HydraCore::getIconSize() { return {HYDRA_ICON_WIDTH, HYDRA_ICON_HEIGHT}; }
const u8* HydraCore::getIconData() { return &HYDRA_ICON_DATA[0]; }
HC_API hydra::IBase* createEmulator() { return new HydraCore; }
HC_API void destroyEmulator(hydra::IBase* emulator) { delete emulator; }
@ -131,6 +120,10 @@ HC_API const char* getInfo(hydra::InfoType type) {
case hydra::InfoType::Website: return "https://panda3ds.com/";
case hydra::InfoType::Extensions: return "3ds,cci,cxi,app,3dsx,elf,axf";
case hydra::InfoType::Firmware: return "";
case hydra::InfoType::IconWidth: return HYDRA_ICON_WIDTH;
case hydra::InfoType::IconHeight: return HYDRA_ICON_HEIGHT;
case hydra::InfoType::IconData: return (const char*)&HYDRA_ICON_DATA[0];
default: return nullptr;
}
}

@ -1 +1 @@
Subproject commit a1bf28e2e4a8bd10aeb9f0228c5bb669f17c6bfe
Subproject commit e4cc6b0fc224583e509bc3472a4c11eafb69c041