summaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorjussi2024-05-29 22:44:36 +0300
committerjussi2024-05-29 22:44:36 +0300
commitf3dbe7d24bcf01d9a23326880dbb1a28457ff51f (patch)
tree1eb3ad7dc25d3be9f05d6e3443b451094fd7ac75 /src/models.c
parentcd8989376e03700669da08d98f62f04b0fea5462 (diff)
downloadreilua-enhanced-f3dbe7d24bcf01d9a23326880dbb1a28457ff51f.tar.gz
reilua-enhanced-f3dbe7d24bcf01d9a23326880dbb1a28457ff51f.tar.bz2
reilua-enhanced-f3dbe7d24bcf01d9a23326880dbb1a28457ff51f.zip
Unload functions clear object to 0 so they would not be ready in Is*Ready.
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index 193fcb7..61b9c2b 100644
--- a/src/models.c
+++ b/src/models.c
@@ -559,6 +559,7 @@ int lmodelsUnloadModel( lua_State* L ) {
Model* model = uluaGetModel( L, 1 );
UnloadModel( *model );
+ memset( model, 0, sizeof( Model ) );
return 0;
}
@@ -1137,6 +1138,7 @@ int lmodelsUnloadMesh( lua_State* L ) {
Mesh* mesh = uluaGetMesh( L, 1 );
UnloadMesh( *mesh );
+ memset( mesh, 0, sizeof( Mesh ) );
return 0;
}
@@ -1906,6 +1908,7 @@ int lmodelsUnloadMaterial( lua_State* L ) {
/* Custom UnloadMaterial since we don't want to free Shaders or Textures. */
unloadMaterial( material );
+ memset( material, 0, sizeof( Material ) );
// UnloadMaterial( *material );
@@ -2140,6 +2143,7 @@ int lmodelsUnloadModelAnimation( lua_State* L ) {
ModelAnimation* animation = uluaGetModelAnimation( L, 1 );
UnloadModelAnimation( *animation );
+ memset( animation, 0, sizeof( ModelAnimation ) );
return 0;
}
@@ -2157,6 +2161,7 @@ int lmodelsUnloadModelAnimations( lua_State* L ) {
if ( lua_isuserdata( L, -1 ) ) {
ModelAnimation* animation = uluaGetModelAnimation( L, lua_gettop( L ) );
UnloadModelAnimation( *animation );
+ memset( animation, 0, sizeof( ModelAnimation ) );
}
i++;
lua_pop( L, 1 );