New File tools
This commit is contained in:
@ -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}
|
||||
|
@ -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;
|
||||
}
|
39
src/dawntools/visualnovel/vnscenegen/VnSceneGen.hpp
Normal file
39
src/dawntools/visualnovel/vnscenegen/VnSceneGen.hpp
Normal 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;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user