diff options
| author | jussi | 2023-05-01 18:23:36 +0300 |
|---|---|---|
| committer | jussi | 2023-05-01 18:23:36 +0300 |
| commit | acc56fc7c2bedde6eced005eab0a37b6281b9a23 (patch) | |
| tree | 6298f7eeee27469f20d6d992c93118aa162b49a8 /src/state.c | |
| parent | 8b6337446dd79faf226ea9df40d4d06d81c38436 (diff) | |
| download | reilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.tar.gz reilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.tar.bz2 reilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.zip | |
Texture now can be either Texture or RenderTexture. No need to change texture source anymore.
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/state.c b/src/state.c index ed96115..6db0812 100644 --- a/src/state.c +++ b/src/state.c @@ -16,7 +16,6 @@ bool stateInit( const char *exePath ) { state->run = true; state->resolution = (Vector2){ 800, 600 }; state->luaState = NULL; - state->textureSource = TEXTURE_SOURCE_TEXTURE; state->guiFont = 0; /* Images. */ state->imageAlloc = ALLOC_PAGE_SIZE; @@ -25,11 +24,7 @@ bool stateInit( const char *exePath ) { /* Textures. */ state->textureAlloc = ALLOC_PAGE_SIZE; state->textureCount = 0; - state->textures = malloc( state->textureAlloc * sizeof( Texture2D* ) ); - /* RenderTextures. */ - state->renderTextureAlloc = ALLOC_PAGE_SIZE; - state->renderTextureCount = 0; - state->renderTextures = malloc( state->renderTextureAlloc * sizeof( RenderTexture2D* ) ); + state->textures = malloc( state->textureAlloc * sizeof( ReiTexture* ) ); /* Fonts. */ state->fontAlloc = ALLOC_PAGE_SIZE; state->fontCount = 1; @@ -82,7 +77,6 @@ bool stateInit( const char *exePath ) { for ( int i = 0; i < ALLOC_PAGE_SIZE; i++ ) { state->images[i] = NULL; state->textures[i] = NULL; - state->renderTextures[i] = NULL; state->waves[i] = NULL; state->sounds[i] = NULL; state->camera2Ds[i] = NULL; @@ -133,16 +127,10 @@ void stateFree() { } for ( int i = 0; i < state->textureCount; ++i ) { if ( state->textures[i] != NULL ) { - UnloadTexture( *state->textures[i] ); + texturesFreeTexture(i); free( state->textures[i] ); } } - for ( int i = 0; i < state->renderTextureCount; ++i ) { - if ( state->renderTextures[i] != NULL ) { - UnloadRenderTexture( *state->renderTextures[i] ); - free( state->renderTextures[i] ); - } - } for ( int i = 0; i < state->fontCount; ++i ) { if ( state->fonts[i] != NULL ) { UnloadFont( *state->fonts[i] ); @@ -232,7 +220,6 @@ void stateFree() { } free( state->images ); free( state->textures ); - free( state->renderTextures ); free( state->fonts ); free( state->waves ); free( state->sounds ); |
