Remove main update loop

This commit is contained in:
Varun Patil 2020-05-04 22:51:21 +05:30
parent b7c8011c52
commit f20d7a43b1
2 changed files with 7 additions and 45 deletions

View file

@ -137,10 +137,12 @@ int rgssThreadFun(void *userdata)
return 0;
}
bool vsync = conf.vsync || conf.syncToRefreshrate;
SDL_GL_SetSwapInterval(vsync ? 1 : 0);
/* Start script execution */
scriptBinding->execute();
#ifndef __EMSCRIPTEN__
threadData->rqTermAck.set();
threadData->ethread->requestTerminate();
@ -148,10 +150,6 @@ int rgssThreadFun(void *userdata)
alcDestroyContext(alcCtx);
SDL_GL_DeleteContext(glCtx);
#endif
bool vsync = conf.vsync || conf.syncToRefreshrate;
SDL_GL_SetSwapInterval(vsync ? 1 : 0);
return 0;
}
@ -331,15 +329,8 @@ int main(int argc, char *argv[])
/* Start event processing */
eventThread.process(rtData);
#ifdef __EMSCRIPTEN__
::rgssThreadFun(&rtData);
printf("Exiting main function\n");
return 0;
#endif
/* Start RGSS thread */
rgssThreadFun(&rtData);
return 0;
/* Request RGSS thread to stop */
rtData.rqTerm.set();