aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-08 23:43:46 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-08 23:43:46 +0100
commit53dcec8caa5943c7fa5d4a55072289c62b62b545 (patch)
tree7d5a21d5e658ce09b3ed1b1396c9ef4727e4795d
parentef6a41652e0d3ee5b1745286fefa6d8f57509a23 (diff)
downloadtr8vm-53dcec8caa5943c7fa5d4a55072289c62b62b545.tar.gz
tr8vm-53dcec8caa5943c7fa5d4a55072289c62b62b545.zip
Less locking, perhaps?
-rw-r--r--tr8vm.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/tr8vm.c b/tr8vm.c
index f5b2098..41ce6eb 100644
--- a/tr8vm.c
+++ b/tr8vm.c
@@ -311,7 +311,9 @@ int main(int argc, char *argv[])
pitch = 0;
fb_data = NULL;
SDL_LockTexture(fb, NULL, (void **)&fb_data, &pitch);
- rc = tr8_eval(&vm);
+ rc = tr8_frame_int(&vm);
+ if (rc)
+ rc = tr8_eval(&vm);
SDL_UnlockTexture(fb);
if (!rc)
@@ -329,15 +331,6 @@ int main(int argc, char *argv[])
SDL_RenderCopy(renderer, canvas, NULL, &dst);
SDL_RenderPresent(renderer);
-
- pitch = 0;
- fb_data = NULL;
- SDL_LockTexture(fb, NULL, (void **)&fb_data, &pitch);
- rc = tr8_frame_int(&vm);
- SDL_UnlockTexture(fb);
-
- if (!rc)
- break;
}
if (canvas)