Remove ase_file_write_properties to be consistent with decoding

This commit is contained in:
Martín Capello 2023-01-12 16:24:11 -03:00
parent 5823abd1c0
commit f9843ac0f9

View File

@ -205,8 +205,6 @@ static void ase_file_write_tileset_chunk(FILE* f, FileOp* fop,
const dio::AsepriteExternalFiles& ext_files,
const Tileset* tileset,
const tileset_index si);
static void ase_file_write_properties(FILE* f,
const UserData::Properties& properties);
static void ase_file_write_properties_maps(FILE* f, FileOp* fop,
const dio::AsepriteExternalFiles& ext_files,
size_t nmaps,
@ -1504,27 +1502,22 @@ static void ase_file_write_property_value(FILE* f,
}
break;
}
case USER_DATA_PROPERTY_TYPE_PROPERTIES:
ase_file_write_properties(f, *std::get_if<UserData::Properties>(&value));
case USER_DATA_PROPERTY_TYPE_PROPERTIES: {
auto& properties = *std::get_if<UserData::Properties>(&value);
ASSERT(properties.size() > 0);
fputl(properties.size(), f);
for (auto property : properties) {
const std::string& name = property.first;
ase_file_write_string(f, name);
const UserData::Variant& value = property.second;
fputw(value.type(), f);
ase_file_write_property_value(f, value);
}
break;
}
}
static void ase_file_write_properties(FILE* f,
const UserData::Properties& properties)
{
ASSERT(properties.size() > 0);
fputl(properties.size(), f);
for (auto property : properties) {
const std::string& name = property.first;
ase_file_write_string(f, name);
const UserData::Variant& value = property.second;
fputw(value.type(), f);
ase_file_write_property_value(f, value);
}
}
}
@ -1567,7 +1560,7 @@ static void ase_file_write_properties_maps(FILE* f, FileOp* fop,
//continue;
}
fputl(extensionId, f);
ase_file_write_properties(f, properties);
ase_file_write_property_value(f, properties);
}
long endPos = ftell(f);
// We can overwrite the properties maps size now