summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorjussi2022-05-04 17:21:49 +0300
committerjussi2022-05-04 17:21:49 +0300
commited4636fa812e64c5391ee9f408092990f33277b4 (patch)
tree9ea8054c54c5dd2d9da449f401d3c064a3b6114a /src/state.c
parent6f4aceeb4c9793ff8b86cbae99d5475b987af9eb (diff)
downloadreilua-enhanced-ed4636fa812e64c5391ee9f408092990f33277b4.tar.gz
reilua-enhanced-ed4636fa812e64c5391ee9f408092990f33277b4.tar.bz2
reilua-enhanced-ed4636fa812e64c5391ee9f408092990f33277b4.zip
Camera2D.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index cd7629b..860bc45 100644
--- a/src/state.c
+++ b/src/state.c
@@ -37,6 +37,10 @@ bool stateInit( const char *exePath ) {
state->soundAlloc = ALLOC_PAGE_SIZE;
state->soundCount = 0;
state->sounds = malloc( state->soundAlloc * sizeof( Sound* ) );
+ /* Camera2D's. */
+ state->camera2DAlloc = ALLOC_PAGE_SIZE;
+ state->camera2DCount = 0;
+ state->camera2Ds = malloc( state->camera2DAlloc * sizeof( Camera2D* ) );
/* Camera3D's. */
state->camera3DAlloc = ALLOC_PAGE_SIZE;
state->camera3DCount = 0;
@@ -71,6 +75,7 @@ bool stateInit( const char *exePath ) {
state->textures[i] = NULL;
state->renderTextures[i] = NULL;
state->sounds[i] = NULL;
+ state->camera2Ds[i] = NULL;
state->camera3Ds[i] = NULL;
state->meshes[i] = NULL;
state->models[i] = NULL;
@@ -137,6 +142,11 @@ void stateFree() {
free( state->sounds[i] );
}
}
+ for ( int i = 0; i < state->camera2DCount; ++i ) {
+ if ( state->camera2Ds[i] != NULL ) {
+ free( state->camera2Ds[i] );
+ }
+ }
for ( int i = 0; i < state->camera3DCount; ++i ) {
if ( state->camera3Ds[i] != NULL ) {
free( state->camera3Ds[i] );
@@ -197,6 +207,7 @@ void stateFree() {
free( state->renderTextures );
free( state->fonts );
free( state->sounds );
+ free( state->camera2Ds );
free( state->camera3Ds );
free( state->meshes );
free( state->materials );