839 {
840 if (!appState->states.ruinning)
841 {
842 return;
843 }
844
845 appState->globals.secondCounter++;
846
847 if (appState->globals.secondCounter % 5 == 0)
848 {
849 if (appState->states.autoSave)
850 {
851 SaveFile(appState->constants.cacheDir + PATH_SEPARATOR "autosave" PATH_SEPARATOR "autosave.terr3d");
852
853 if (appState->globals.currentOpenFilePath.size() > 3)
854 {
855 SaveFile(appState->globals.currentOpenFilePath);
856 }
857 }
858 }
859
860 GetWindow()->SetVSync(appState->states.vSync);
861 appState->stats.frameRate = 1 / appState->stats.deltatime;
862 }