starting playing the wherigo

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2026-02-13 02:41:12 +01:00
parent 50267e47dc
commit f9c45ca81f
34 changed files with 4055 additions and 84 deletions

View File

@@ -0,0 +1,43 @@
#ifndef MEDIA_MANAGER_H
#define MEDIA_MANAGER_H
#include <cartridge/cartridge.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
extern "C" {
struct lua_State;
}
namespace wherigo {
class MediaManager {
public:
static MediaManager& getInstance();
void init(lua_State *L, cartridge::Cartridge *cartridge);
// Get media data by ZMedia object name (e.g., "Title Plate 1")
std::vector<uint8_t> getMediaByName(const std::string &name);
// Get media data by index
std::vector<uint8_t> getMediaByIndex(int index);
private:
MediaManager() = default;
void buildMediaIndex(lua_State *L);
lua_State *m_luaState = nullptr;
cartridge::Cartridge *m_cartridge = nullptr;
// Map from media name to cartridge object index
std::map<std::string, int> m_nameToIndex;
};
} // namespace wherigo
#endif // MEDIA_MANAGER_H