diff --git a/data/dynos.cpp.h b/data/dynos.cpp.h index 720da5ab..8be11195 100644 --- a/data/dynos.cpp.h +++ b/data/dynos.cpp.h @@ -757,6 +757,7 @@ void DynOS_Anim_Swap(void *aPtr); void DynOS_Tex_Valid(GfxData* aGfxData); void DynOS_Tex_Invalid(GfxData* aGfxData); +void DynOS_Tex_Update(); u8 *DynOS_Tex_ConvertToRGBA32(const u8 *aData, u64 aLength, s32 aFormat, s32 aSize, const u8 *aPalette); bool DynOS_Tex_Import(void **aOutput, void *aPtr, s32 aTile, void *aGfxRApi, void **aHashMap, void *aPool, u32 *aPoolPos, u32 aPoolSize); diff --git a/data/dynos_gfx_update.cpp b/data/dynos_gfx_update.cpp index 81c2fef0..55949777 100644 --- a/data/dynos_gfx_update.cpp +++ b/data/dynos_gfx_update.cpp @@ -3,4 +3,5 @@ extern "C" { } void DynOS_Gfx_Update() { + DynOS_Tex_Update(); } diff --git a/data/dynos_mgr_tex.cpp b/data/dynos_mgr_tex.cpp index 290944f7..e3ddf44a 100644 --- a/data/dynos_mgr_tex.cpp +++ b/data/dynos_mgr_tex.cpp @@ -10,6 +10,13 @@ static std::set *>& DynosValidTextures() { return sDynosValidTextures; } +static Array *>& DynosScheduledInvalidTextures() { + static Array *> sDynosScheduledInvalidTextures; + return sDynosScheduledInvalidTextures; +} + +static bool sDynosDumpTextureCache = false; + // // Conversion // @@ -260,9 +267,19 @@ void DynOS_Tex_Valid(GfxData* aGfxData) { } void DynOS_Tex_Invalid(GfxData* aGfxData) { + auto& schedule = DynosScheduledInvalidTextures(); for (auto &_Texture : aGfxData->mTextures) { + schedule.Add(_Texture); + } +} + +void DynOS_Tex_Update() { + auto& schedule = DynosScheduledInvalidTextures(); + if (schedule.Count() == 0) { return; } + for (auto &_Texture : schedule) { DynosValidTextures().erase(_Texture); } + schedule.Clear(); } // diff --git a/mods/shell-rush/item-box.lua b/mods/shell-rush/item-box.lua index c4d1880e..c9452e79 100644 --- a/mods/shell-rush/item-box.lua +++ b/mods/shell-rush/item-box.lua @@ -35,7 +35,7 @@ function bhv_item_box_loop(obj) if obj.oItemBoxTouched == 1 then if obj.oTimer >= itemBoxTimeout then obj.oItemBoxTouched = 0 - if get_network_player_smallest_global() == gNetworkPlayers[0] then + if network_is_server() then network_send_object(obj, true) end elseif obj.oTimer < 5 then