This wasn't a thing yet?

This commit is contained in:
korenkonder
2023-10-03 15:38:36 +03:00
parent 6f756b1b34
commit e2ed5eb4d4
3 changed files with 6 additions and 1 deletions
+4
View File
@@ -482,6 +482,10 @@ const spr_db_spr* sprite_database::get_tex_by_set_id_index(uint32_t set_id, uint
return &spr_db_spr_null;
}
uint32_t sprite_database::get_spr_id_by_name(const char* name) const {
return get_spr_by_name(name)->id;
}
const char* sprite_database::get_spr_set_file_name(uint32_t set_id) const {
return get_spr_set_by_id(set_id)->file_name.c_str();
}
+1
View File
@@ -152,6 +152,7 @@ struct sprite_database {
const spr_db_spr* get_spr_by_id(uint32_t id) const;
const spr_db_spr* get_spr_by_set_id_index(uint32_t set_id, uint32_t index) const;
const spr_db_spr* get_tex_by_set_id_index(uint32_t set_id, uint32_t index) const;
uint32_t get_spr_id_by_name(const char* name) const;
const char* get_spr_set_file_name(uint32_t set_id) const;
uint32_t get_spr_set_id_by_name(const char* name) const;
uint32_t get_spr_set_id_by_name_index(uint32_t index) const;
+1 -1
View File
@@ -2986,7 +2986,7 @@ bool pv_game::load() {
std::string spr_set_back_image(i.spr_set_back);
spr_set_back_image.append("_IMAGE");
uint32_t spr_id = aft_spr_db->get_spr_set_id_by_name(spr_set_back_image.c_str());
uint32_t spr_id = aft_spr_db->get_spr_id_by_name(spr_set_back_image.c_str());
if (spr_id != -1) {
data.spr_set_back_ids.push_back(spr_set_id);
field.spr_set_back_id = spr_id;