diff options
author | Aki <please@ignore.pl> | 2024-03-19 22:56:52 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-19 22:56:52 +0100 |
commit | f5b8091ee91b8323b8e2b1044ba8be676f2bfaf4 (patch) | |
tree | bbcfc73dd8db75579127686f9cd07e9c45d374d0 /StarsEx/ShipDesign.cpp | |
parent | 2066e4911948d11cac5a234d2f7773dc5f06ba96 (diff) | |
download | starshatter-f5b8091ee91b8323b8e2b1044ba8be676f2bfaf4.zip starshatter-f5b8091ee91b8323b8e2b1044ba8be676f2bfaf4.tar.gz starshatter-f5b8091ee91b8323b8e2b1044ba8be676f2bfaf4.tar.bz2 |
Definition Parser now consumes from the new Reader
Next steps are to move ParseUtils functionality to DefinitinoEx, sort
things into the namespaces in this library, and then prepare it to
handle overloading like nlohmann_json does. On the other side, it's
time for starshatter::data.
Diffstat (limited to 'StarsEx/ShipDesign.cpp')
-rw-r--r-- | StarsEx/ShipDesign.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/StarsEx/ShipDesign.cpp b/StarsEx/ShipDesign.cpp index 9b4be4c..3fb11f3 100644 --- a/StarsEx/ShipDesign.cpp +++ b/StarsEx/ShipDesign.cpp @@ -264,7 +264,7 @@ bolt_hit_sound_resource(0), beam_hit_sound_resource(0), lod_levels(0) return; } - Parser parser(new BlockReader((const char*) block, blocklen)); + Parser parser({reinterpret_cast<const char*>(block), blocklen}); Term* term = parser.ParseTerm(); if (!term) { @@ -527,7 +527,7 @@ void AddModCatalogEntry(const char* design_name, const char* design_path) return; } - Parser parser(new BlockReader((const char*) block, blocklen)); + Parser parser({reinterpret_cast<const char*>(block), blocklen}); Term* term = parser.ParseTerm(); if (!term) { @@ -665,7 +665,7 @@ ShipDesign::LoadCatalog(const char* path, const char* fname, bool mod) BYTE* block; int blocklen = loader->LoadBuffer(filename, block, true); - Parser parser(new BlockReader((const char*) block, blocklen)); + Parser parser({reinterpret_cast<const char*>(block), blocklen}); Term* term = parser.ParseTerm(); if (!term) { @@ -771,7 +771,7 @@ ShipDesign::LoadSkins(const char* path, int source) continue; } - Parser parser(new BlockReader((const char*) block, blocklen)); + Parser parser({reinterpret_cast<const char*>(block), blocklen}); Term* term = parser.ParseTerm(); ShipDesign* design = 0; |