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

Corrige Cmakelist e adiciona tinyxml2

This commit is contained in:
Danilo 2024-11-16 19:07:04 -03:00
parent 31c9cdfb3e
commit 38fbc5ea59
4 changed files with 2420 additions and 5 deletions

View File

@ -24,7 +24,7 @@ namespace xna {
//Accesses a statically typed ContentImporter instance from generic code using dynamic typing. //Accesses a statically typed ContentImporter instance from generic code using dynamic typing.
struct IContentImporter { struct IContentImporter {
//Imports an asset from the specified file. //Imports an asset from the specified file.
virtual std::any Import(std::string const& filename, ContentImporterContext& context) = 0; virtual std::any ImportObject(std::string const& filename, ContentImporterContext& context) = 0;
}; };
//Implements a file format importer for use with game assets. //Implements a file format importer for use with game assets.
@ -34,15 +34,15 @@ namespace xna {
virtual T Import(std::string const& filename, ContentImporterContext& context) = 0; virtual T Import(std::string const& filename, ContentImporterContext& context) = 0;
//Imports an asset from the specified file. //Imports an asset from the specified file.
std::any Import(std::string const& filename, ContentImporterContext& context) override { std::any ImportObject(std::string const& filename, ContentImporterContext& context) override {
std::any obj = Import<T>(filename, context); std::any obj = Import(filename, context);
return obj; return obj;
} }
}; };
//rovides properties that identify and provide metadata about the importer, such as supported file extensions and caching information. //rovides properties that identify and provide metadata about the importer, such as supported file extensions and caching information.
struct ContentImporterAttribute { struct ContentImporterAttribute {
bool CacheImportedData; bool CacheImportedData{ false };
std::string DisplayName; std::string DisplayName;
std::string DefaultProcessor; std::string DefaultProcessor;
@ -62,6 +62,25 @@ namespace xna {
private: private:
std::vector<std::string> fileExtensions; std::vector<std::string> fileExtensions;
}; };
struct ImporterRegistration {
inline static auto Importers = std::vector<IContentImporter>();
};
class ImporterManager {
public:
private:
};
struct XmlImporter : ContentImporter_T<std::any> {
std::any Import(std::string const& filename, ContentImporterContext& context) override {
//TODO: XmlReader
return { };
}
};
} }
#endif #endif

2380
includes/tinyxml2.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
#ifndef XNA_CSHARP_XML_HPP
#define XNA_CSHARP_XML_HPP
namespace xna {
class XmlReader {
};
}
#endif

View File

@ -17,9 +17,13 @@ add_library (Xn65 STATIC
"common/gjk.cpp" "common/gjk.cpp"
"common/numerics.cpp" "common/numerics.cpp"
"common/packedvalue.cpp" "common/packedvalue.cpp"
"graphics/displaymode" "graphics/displaymode.cpp"
"exception.cpp") "exception.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.12) if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET Xn65 PROPERTY CXX_STANDARD 20) set_property(TARGET Xn65 PROPERTY CXX_STANDARD 20)
endif() endif()
#find_package(tinyxml2 CONFIG REQUIRED)
target_link_libraries(Xn65 "${PROJECT_VCPKG_DIRECTORY}/installed/x64-windows/lib/tinyxml2.lib")