Cache system doesnt break when transforming objects

This commit is contained in:
Yousef Khadadeh 2025-07-21 11:59:19 +03:00
parent caea747f1e
commit eb00125f01
9 changed files with 101 additions and 95 deletions

View file

@ -109,14 +109,14 @@ void DrawComponent::check_timers(DrawingProgram& drawP) {
}
void DrawComponent::temp_update(DrawingProgram& drawP) {
drawP.compCache.preupdate_component(this);
drawP.compCache.preupdate_component(collabListInfo.lock());
worldAABB = std::nullopt;
initialize_draw_data(drawP);
updateDraw = true;
}
void DrawComponent::transform_temp_update(DrawingProgram& drawP) {
drawP.compCache.preupdate_component(this);
drawP.compCache.preupdate_component(collabListInfo.lock());
worldAABB = std::nullopt;
updateDraw = true;
}
@ -127,12 +127,6 @@ void DrawComponent::final_update(DrawingProgram& drawP) {
updateDraw = true;
}
void DrawComponent::final_update_dont_invalidate_cache(DrawingProgram& drawP) {
initialize_draw_data(drawP);
finalize_update(drawP, false);
updateDraw = true;
}
void DrawComponent::client_send_place(DrawingProgram& drawP, uint64_t placement) {
drawP.world.con.client_send_items_to_server(RELIABLE_COMMAND_CHANNEL, SERVER_PLACE_COMPONENT, placement, get_type(), this->coords, *this);
}
@ -159,7 +153,7 @@ void DrawComponent::client_send_transform_final(DrawingProgram& drawP, ServerCli
void DrawComponent::finalize_update(DrawingProgram& drawP, bool invalidateCache) {
if(invalidateCache)
drawP.compCache.preupdate_component(this);
drawP.compCache.preupdate_component(collabListInfo.lock());
create_collider(drawP.colliderAllocated);
updateDraw = true;
}