From 53dcec8caa5943c7fa5d4a55072289c62b62b545 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 8 May 2023 23:43:46 +0100 Subject: Less locking, perhaps? --- tr8vm.c | 13 +++---------- 1 file 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) -- cgit v1.2.3