feat(arc): add optional arg for filename in gscobj header (#153)

This commit is contained in:
INeedGames 2023-10-02 15:42:14 -06:00 committed by GitHub
parent 898e575978
commit 834e4023f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ class assembler
public:
assembler(context const* ctx);
auto assemble(assembly const& data) -> buffer;
auto assemble(assembly const& data, std::string const& name = {}) -> buffer;
private:
auto assemble_function(function& func) -> void;

View File

@ -14,7 +14,7 @@ assembler::assembler(context const* ctx) : ctx_{ ctx }, script_{ ctx->endian() =
{
}
auto assembler::assemble(assembly const& data) -> buffer
auto assembler::assemble(assembly const& data, std::string const& name) -> buffer
{
assembly_ = &data;
script_.clear();
@ -26,7 +26,7 @@ auto assembler::assemble(assembly const& data) -> buffer
auto head = header{};
script_.pos((ctx_->props() & props::headerxx) ? 0 : (ctx_->props() & props::header72) ? 72 : 64);
process_string("");
process_string(name);
for (auto const& func : assembly_->functions)
{
@ -183,7 +183,7 @@ auto assembler::assemble(assembly const& data) -> buffer
head.profile_count = 0;
head.flags = 0;
head.name = resolve_string("");
head.name = resolve_string(name);
auto endpos = script_.pos();