New File tools

This commit is contained in:
2023-02-08 20:05:41 -08:00
parent c3dbacde76
commit bbe30d9253
13 changed files with 210 additions and 73 deletions

View File

@ -4,20 +4,30 @@
# https://opensource.org/licenses/MIT
# Texture Build Tool
project(vnscenegen VERSION 1.0)
project(vnscenegen VERSION 1.1)
add_executable(vnscenegen)
target_sources(vnscenegen
PRIVATE
main.cpp
${DAWN_SHARED_SOURCES}
VnSceneGen.cpp
../../util/DawnTool.cpp
../../util/file.cpp
../../util/xml.cpp
)
target_include_directories(vnscenegen
PUBLIC
${DAWN_SHARED_INCLUDES}
${CMAKE_CURRENT_LIST_DIR}/../../
${CMAKE_CURRENT_LIST_DIR}
)
target_compile_definitions(vnscenegen
PUBLIC
DAWN_TOOL_INSTANCE=VnSceneGen
DAWN_TOOL_HEADER="VnSceneGen.hpp"
)
target_link_libraries(vnscenegen
PUBLIC
${DAWN_BUILD_HOST_LIBS}

View File

@ -3,28 +3,9 @@
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "../../util/file.hpp"
#include "../../util/xml.hpp"
#include <iostream>
#include <vector>
#include "VnSceneGen.hpp"
struct CharacterInformation {
std::string clazz;
std::string name;
};
struct Asset {
std::string type;
std::string name;
};
struct HeaderInformation {
std::string type;
std::string name;
std::vector<std::string> includes;
std::vector<struct CharacterInformation> characters;
std::vector<struct Asset> assets;
};
using namespace Dawn;
int32_t parseInclude(struct HeaderInformation *info, xml_t *node) {
auto attrPath = xmlGetAttributeByName(node, "path");
@ -211,7 +192,7 @@ std::string parseEvent(xml_t *evt, struct HeaderInformation *header) {
return buffer;
}
int main(int32_t argc, char *args[]) {
int oldmain(int32_t argc, char *args[]) {
if(argc != 3) {
std::cout << "Invalid number of args passed to VNScene Generator" << std::endl;
return 1;
@ -358,5 +339,9 @@ int main(int32_t argc, char *args[]) {
fclose(fout);
std::cout << "Generated Scene " << fileOut << std::endl;
return 0;
}
int32_t VnSceneGen::start() {
return 0;
}

View File

@ -0,0 +1,39 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/DawnTool.hpp"
#include "util/Xml.hpp"
#include "../../util/file.hpp"
#include "../../util/xml.hpp"
#include <iostream>
#include <vector>
namespace Dawn {
struct CharacterInformation {
std::string clazz;
std::string name;
};
struct Asset {
std::string type;
std::string name;
};
struct HeaderInformation {
std::string type;
std::string name;
std::vector<std::string> includes;
std::vector<struct CharacterInformation> characters;
std::vector<struct Asset> assets;
};
class VnSceneGen : public DawnTool {
protected:
public:
int32_t start() override;
};
}