[keel] Split out Nostalgia Foundation and Pack lib into Keel

This commit is contained in:
2023-03-24 21:20:55 -05:00
parent 4a95a79926
commit 7beb3cc6fc
50 changed files with 185 additions and 206 deletions

40
src/keel/context.hpp Normal file
View File

@@ -0,0 +1,40 @@
/*
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <ox/fs/fs.hpp>
#include <ox/std/memory.hpp>
#include <ox/std/stringview.hpp>
#include "assetmanager.hpp"
namespace keel {
class Context;
using PackTransform = ox::Error(*)(Context*, ox::Buffer *clawData);
class Context {
public:
ox::UPtr<ox::FileSystem> rom;
ox::StringView appName = "Nostalgia Foundation App";
#ifndef OX_BARE_METAL
AssetManager assetManager;
ox::HashMap<ox::String, ox::UUID> pathToUuid;
ox::HashMap<ox::UUIDStr, ox::String> uuidToPath;
ox::Vector<const class BaseConverter*> converters;
ox::Vector<PackTransform> packTransforms;
#else
std::size_t preloadSectionOffset = 0;
#endif
constexpr Context() noexcept = default;
Context(const Context&) noexcept = delete;
Context(Context&&) noexcept = delete;
Context &operator=(const Context&) noexcept = delete;
Context &operator=(Context&&) noexcept = delete;
constexpr virtual ~Context() noexcept = default;
};
}