diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-05-08 23:43:46 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-05-08 23:43:46 +0100 |
commit | 53dcec8caa5943c7fa5d4a55072289c62b62b545 (patch) | |
tree | 7d5a21d5e658ce09b3ed1b1396c9ef4727e4795d /tr8vm.c | |
parent | ef6a41652e0d3ee5b1745286fefa6d8f57509a23 (diff) | |
download | tr8vm-53dcec8caa5943c7fa5d4a55072289c62b62b545.tar.gz tr8vm-53dcec8caa5943c7fa5d4a55072289c62b62b545.zip |
Less locking, perhaps?
Diffstat (limited to 'tr8vm.c')
-rw-r--r-- | tr8vm.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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) |