Overhaul animation queues so the queue is stored as a single encoded string.

This commit is contained in:
2023-07-26 17:40:20 -04:00
parent 2dff145885
commit b459eedc82
10 changed files with 239 additions and 242 deletions

View File

@@ -227,24 +227,19 @@ void World::get_near(int64_t player_id, float radius, bool exclude_nowhere, bool
get_near(scan, into);
}
void World::get_animation_queue_hashes(uint32_t count, const int64_t *ids, uint64_t *hashes) {
void World::get_encoded_animation_queues(uint32_t count, const int64_t *ids, util::SharedStdStringVec &into) {
util::SharedStdString empty = std::make_shared<std::string>("");
into.resize(count);
for (int i = 0; i < int(count); i++) {
Tangible *tan = tangible_get(ids[i]);
if (tan == 0) {
hashes[i] = 0;
if (tan == nullptr) {
into[i] = empty;
} else {
hashes[i] = tan->anim_queue_.get_final_hash();
into[i] = tan->anim_queue_.get_encoded_queue();
}
}
}
void World::get_animation_queue(int64_t tanid, std::vector<EngineWrapper::AnimEntry> *into) {
Tangible *tan = tangible_get(tanid);
if (tan != nullptr) {
tan->anim_queue_.get_for_engine_wrapper(into);
}
}
World::Redirects World::fetch_redirects() {
World::Redirects result = std::move(redirects_);
redirects_.clear();