diff options
author | AECX <aecx@aecx.cc> | 2019-11-17 19:34:59 +0100 |
---|---|---|
committer | AECX <aecx@aecx.cc> | 2019-11-17 19:34:59 +0100 |
commit | fef92472d7a2f694d98623a5595f10dca93b1207 (patch) | |
tree | b6d93fdcddce2f24704dbb124cbd8b63650d7331 | |
parent | c57b1a49a3abc80032bc493942153cc238b518a6 (diff) |
u8 parsing fix
-rw-r--r-- | source/Twilight Editor.cpp | 12 | ||||
-rw-r--r-- | source/converter.cpp | 8 |
2 files changed, 11 insertions, 9 deletions
diff --git a/source/Twilight Editor.cpp b/source/Twilight Editor.cpp index 4baccb5..d34e227 100644 --- a/source/Twilight Editor.cpp +++ b/source/Twilight Editor.cpp @@ -3,6 +3,7 @@ int main(int argc, char* argv[]) { + /* auto result = parse(argc, argv); auto arguments = result.arguments(); @@ -23,14 +24,15 @@ int main(int argc, char* argv[]) std::cout << "Verbose: " << TwilightEditor::Settings.VERBOSE << std::endl; std::cout << "Force: " << TwilightEditor::Settings.FORCE << std::endl; } - - /* - TwilightEditor::Settings.INPUT_FILE = "ql.tp"; + */ + + TwilightEditor::Settings.INPUT_FILE = "new.file"; TwilightEditor::Settings.OUTPUT_FILE = "new.tp"; TwilightEditor::Settings.FORCE = true; - TwilightEditor::Settings.LENGTH = 4; + TwilightEditor::Settings.LENGTH = 1; TwilightEditor::Settings.OFFSET = 0x0A; - TwilightEditor::Settings.TYPE = TwilightEditor::offsetType::TPUINT;*/ + TwilightEditor::Settings.TYPE = TwilightEditor::offsetType::TPUINT; + TwilightEditor::Settings.MODE = TwilightEditor::mode::GET; fastPrint("initializing file..."); diff --git a/source/converter.cpp b/source/converter.cpp index 66fe8da..40fa5ce 100644 --- a/source/converter.cpp +++ b/source/converter.cpp @@ -252,10 +252,10 @@ namespace TwilightEditor switch (length) { case 1: - value = std::to_string(data[0]); + value = std::to_string(*data); if (hex) { - ss << std::hex << static_cast<unsigned>(data[0]); + ss << std::hex << static_cast<unsigned>(*data); value = ss.str(); } break; @@ -291,10 +291,10 @@ namespace TwilightEditor switch (length) { case 1: - value = std::to_string(*reinterpret_cast<int8_t*>(data[0])); + value = std::to_string(*reinterpret_cast<int8_t*>(data)); if (hex) { - ss << std::hex << *reinterpret_cast<int8_t*>(data[0]); + ss << std::hex << *reinterpret_cast<int8_t*>(data); value = ss.str(); } break; |