1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/includes/pipeline/compiler.hpp

45 lines
1.2 KiB
C++
Raw Permalink Normal View History

2024-11-08 11:13:44 -03:00
#ifndef XNA_PIPELINE_COMPILER_HPP
#define XNA_PIPELINE_COMPILER_HPP
#include "xna/default.hpp"
#include "xna/csharp/stream.hpp"
#include "enums.hpp"
2024-11-08 11:13:44 -03:00
#include "default.hpp"
#include <stack>
namespace xna {
//Provides methods for writing compiled binary format.
class ContentCompiler : public std::enable_shared_from_this<ContentCompiler> {
public:
ContentCompiler();
//Retrieves the worker writer for the specified type
P_ContentTypeWriter GetTypeWriter(Type const& type, std::vector<P_Type> dependencies);
private:
void Compile(
P_Stream const& output,
Object& value,
TargetPlatform targetPlatform,
GraphicsProfile targetProfile,
bool compressContent,
String const& rootDirectory,
String const& referenceRelocationPath);
void AddTypeWriter(P_ContentTypeWriter const& writer);
bool ShouldCompressContent(TargetPlatform targetPlatform, Object& value) {
return false;
}
private:
using TypeList = std::vector<P_Type>;
std::map<HashValue, P_ContentTypeWriter> writerInstances;
std::map<HashValue, TypeList> writerDependecies;
std::stack<P_ContentTypeWriter> initializeContext;
P_ContentTypeWriterFactory typeWriterFactory;
};
}
#endif