diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-10-11 12:33:36 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-10-11 12:33:36 +0700 |
commit | e4b2f78462f902a9c1eb267cbf8df90c0cfce7a7 (patch) | |
tree | f54533204058079b1007ebf0180dc7b6206a76f5 | |
parent | d978f7fd54f0ebb8d967912e593be96d15d6028d (diff) |
fix swap state
-rw-r--r-- | sources/main.c | 6 |
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(); |