Unload functions clear object to 0 so they would not be ready in Is*Ready.
This commit is contained in:
@@ -52,6 +52,7 @@ DETAILED CHANGES:
|
|||||||
- FIXED: GenMeshCustom indices wasn't changing triangleCount.
|
- FIXED: GenMeshCustom indices wasn't changing triangleCount.
|
||||||
- ADDED: GetPlatform.
|
- ADDED: GetPlatform.
|
||||||
- ADDED: Object lib serialization.
|
- ADDED: Object lib serialization.
|
||||||
|
- ADDED: Unload functions clear object to 0 so they would not be ready in Is*Ready.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
Release: ReiLua version 0.7.0 Using Raylib 5.0 and Forked Raygui 4.0
|
Release: ReiLua version 0.7.0 Using Raylib 5.0 and Forked Raygui 4.0
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ int laudioUnloadWave( lua_State* L ) {
|
|||||||
Wave* wave = uluaGetWave( L, 1 );
|
Wave* wave = uluaGetWave( L, 1 );
|
||||||
|
|
||||||
UnloadWave( *wave );
|
UnloadWave( *wave );
|
||||||
|
memset( wave, 0, sizeof( Wave ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -225,6 +226,7 @@ int laudioUnloadSound( lua_State* L ) {
|
|||||||
Sound* sound = uluaGetSound( L, 1 );
|
Sound* sound = uluaGetSound( L, 1 );
|
||||||
|
|
||||||
UnloadSound( *sound );
|
UnloadSound( *sound );
|
||||||
|
memset( sound, 0, sizeof( Sound ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -238,6 +240,7 @@ int laudioUnloadSoundAlias( lua_State* L ) {
|
|||||||
Sound* alias = uluaGetSound( L, 1 );
|
Sound* alias = uluaGetSound( L, 1 );
|
||||||
|
|
||||||
UnloadSoundAlias( *alias );
|
UnloadSoundAlias( *alias );
|
||||||
|
memset( alias, 0, sizeof( Sound ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -517,6 +520,7 @@ int laudioUnloadMusicStream( lua_State* L ) {
|
|||||||
Music* music = uluaGetMusic( L, 1 );
|
Music* music = uluaGetMusic( L, 1 );
|
||||||
|
|
||||||
UnloadMusicStream( *music );
|
UnloadMusicStream( *music );
|
||||||
|
memset( music, 0, sizeof( Music ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1106,6 +1106,7 @@ int lcoreUnloadShader( lua_State* L ) {
|
|||||||
Shader* shader = uluaGetShader( L, 1 );
|
Shader* shader = uluaGetShader( L, 1 );
|
||||||
|
|
||||||
UnloadShader( *shader );
|
UnloadShader( *shader );
|
||||||
|
memset( shader, 0, sizeof( Shader ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2010,6 +2011,7 @@ int lcoreUnloadAutomationEventList( lua_State* L ) {
|
|||||||
AutomationEventList* list = uluaGetAutomationEventList( L, 1 );
|
AutomationEventList* list = uluaGetAutomationEventList( L, 1 );
|
||||||
|
|
||||||
UnloadAutomationEventList( list );
|
UnloadAutomationEventList( list );
|
||||||
|
memset( list, 0, sizeof( AutomationEventList ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3479,6 +3481,7 @@ int lcoreUnloadBuffer( lua_State* L ) {
|
|||||||
Buffer* buffer = uluaGetBuffer( L, 1 );
|
Buffer* buffer = uluaGetBuffer( L, 1 );
|
||||||
|
|
||||||
unloadBuffer( buffer );
|
unloadBuffer( buffer );
|
||||||
|
memset( buffer, 0, sizeof( Buffer ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -559,6 +559,7 @@ int lmodelsUnloadModel( lua_State* L ) {
|
|||||||
Model* model = uluaGetModel( L, 1 );
|
Model* model = uluaGetModel( L, 1 );
|
||||||
|
|
||||||
UnloadModel( *model );
|
UnloadModel( *model );
|
||||||
|
memset( model, 0, sizeof( Model ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1137,6 +1138,7 @@ int lmodelsUnloadMesh( lua_State* L ) {
|
|||||||
Mesh* mesh = uluaGetMesh( L, 1 );
|
Mesh* mesh = uluaGetMesh( L, 1 );
|
||||||
|
|
||||||
UnloadMesh( *mesh );
|
UnloadMesh( *mesh );
|
||||||
|
memset( mesh, 0, sizeof( Mesh ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1906,6 +1908,7 @@ int lmodelsUnloadMaterial( lua_State* L ) {
|
|||||||
|
|
||||||
/* Custom UnloadMaterial since we don't want to free Shaders or Textures. */
|
/* Custom UnloadMaterial since we don't want to free Shaders or Textures. */
|
||||||
unloadMaterial( material );
|
unloadMaterial( material );
|
||||||
|
memset( material, 0, sizeof( Material ) );
|
||||||
|
|
||||||
// UnloadMaterial( *material );
|
// UnloadMaterial( *material );
|
||||||
|
|
||||||
@@ -2140,6 +2143,7 @@ int lmodelsUnloadModelAnimation( lua_State* L ) {
|
|||||||
ModelAnimation* animation = uluaGetModelAnimation( L, 1 );
|
ModelAnimation* animation = uluaGetModelAnimation( L, 1 );
|
||||||
|
|
||||||
UnloadModelAnimation( *animation );
|
UnloadModelAnimation( *animation );
|
||||||
|
memset( animation, 0, sizeof( ModelAnimation ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2157,6 +2161,7 @@ int lmodelsUnloadModelAnimations( lua_State* L ) {
|
|||||||
if ( lua_isuserdata( L, -1 ) ) {
|
if ( lua_isuserdata( L, -1 ) ) {
|
||||||
ModelAnimation* animation = uluaGetModelAnimation( L, lua_gettop( L ) );
|
ModelAnimation* animation = uluaGetModelAnimation( L, lua_gettop( L ) );
|
||||||
UnloadModelAnimation( *animation );
|
UnloadModelAnimation( *animation );
|
||||||
|
memset( animation, 0, sizeof( ModelAnimation ) );
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
lua_pop( L, 1 );
|
lua_pop( L, 1 );
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ int ltextUnloadFont( lua_State* L ) {
|
|||||||
Font* font = uluaGetFont( L, 1 );
|
Font* font = uluaGetFont( L, 1 );
|
||||||
|
|
||||||
UnloadFont( *font );
|
UnloadFont( *font );
|
||||||
|
memset( font, 0, sizeof( Font ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ int ltextureUnloadImage( lua_State* L ) {
|
|||||||
Image* image = uluaGetImage( L, 1 );
|
Image* image = uluaGetImage( L, 1 );
|
||||||
|
|
||||||
UnloadImage( *image );
|
UnloadImage( *image );
|
||||||
|
memset( image, 0, sizeof( Image ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1296,6 +1297,7 @@ int ltextureUnloadTexture( lua_State* L ) {
|
|||||||
Texture* texture = uluaGetTexture( L, 1 );
|
Texture* texture = uluaGetTexture( L, 1 );
|
||||||
|
|
||||||
UnloadTexture( *texture );
|
UnloadTexture( *texture );
|
||||||
|
memset( texture, 0, sizeof( Texture ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1324,6 +1326,7 @@ int ltextureUnloadRenderTexture( lua_State* L ) {
|
|||||||
RenderTexture* target = uluaGetRenderTexture( L, 1 );
|
RenderTexture* target = uluaGetRenderTexture( L, 1 );
|
||||||
|
|
||||||
UnloadRenderTexture( *target );
|
UnloadRenderTexture( *target );
|
||||||
|
memset( target, 0, sizeof( RenderTexture ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user