Files
ArchezandGarrett Cox 8cec7afa25 Bump lus with packages, new namespace, and global factories (#292)
* imgui

* detangle zapdutils

* ship namespace

* register global factories

* readfb

* deps

* bump submodules

* keyframe

* bump modules
2024-05-22 09:05:03 -05:00

29 lines
1.2 KiB
C++

#pragma once
#include "2s2h/resource/type/Scene.h"
#include "2s2h/resource/type/scenecommand/SceneCommand.h"
#include "2s2h/resource/importer/scenecommand/SceneCommandFactory.h"
#include "Resource.h"
#include "ResourceFactoryBinary.h"
namespace SOH {
class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary {
public:
ResourceFactoryBinarySceneV0();
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader);
// Doing something very similar to what we do on the ResourceLoader.
// Eventually, scene commands should be moved up to the ResourceLoader as well.
// They can not right now because the exporter does not give them a proper resource type enum value,
// and the exporter does not export the commands with a proper OTR header.
static inline std::unordered_map<SceneCommandID, std::shared_ptr<SceneCommandFactoryBinaryV0>>
sceneCommandFactories;
protected:
std::shared_ptr<ISceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene,
std::shared_ptr<Ship::BinaryReader> reader, uint32_t index);
};
} // namespace SOH