Unload functions clear object to 0 so they would not be ready in Is*Ready.

This commit is contained in:
jussi
2024-05-29 22:44:36 +03:00
parent cd8989376e
commit f3dbe7d24b
6 changed files with 17 additions and 0 deletions

View File

@@ -188,6 +188,7 @@ int ltextureUnloadImage( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
UnloadImage( *image );
memset( image, 0, sizeof( Image ) );
return 0;
}
@@ -1296,6 +1297,7 @@ int ltextureUnloadTexture( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
UnloadTexture( *texture );
memset( texture, 0, sizeof( Texture ) );
return 0;
}
@@ -1324,6 +1326,7 @@ int ltextureUnloadRenderTexture( lua_State* L ) {
RenderTexture* target = uluaGetRenderTexture( L, 1 );
UnloadRenderTexture( *target );
memset( target, 0, sizeof( RenderTexture ) );
return 0;
}