summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosyid Haryadi <rosyid_haryadi@protonmail.com>2024-10-11 12:33:36 +0700
committerRosyid Haryadi <rosyid_haryadi@protonmail.com>2024-10-11 12:33:36 +0700
commite4b2f78462f902a9c1eb267cbf8df90c0cfce7a7 (patch)
treef54533204058079b1007ebf0180dc7b6206a76f5
parentd978f7fd54f0ebb8d967912e593be96d15d6028d (diff)
fix swap state
-rw-r--r--sources/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sources/main.c b/sources/main.c
index 27eb631..ecd88f0 100644
--- a/sources/main.c
+++ b/sources/main.c
@@ -1,7 +1,7 @@
#include "raylib.h"
#include <stdlib.h>
#include <time.h>
-#include <stdio.h>
+#include <string.h>
int main(void)
{
@@ -96,9 +96,7 @@ int main(void)
}
if (isRunning) {
- bool (*temp)[dim] = currState;
- currState = nextState;
- nextState = temp;
+ memcpy(currState, nextState, dim * dim * sizeof(bool));
}
EndDrawing();