mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
Merge pull request #637 from MihailRis/add-headless-tps-cmd-line-argument
add 'tps' command line argument
This commit is contained in:
commit
f5f1831275
4 changed files with 34 additions and 13 deletions
|
|
@ -50,6 +50,7 @@ struct CoreParameters {
|
|||
std::filesystem::path userFolder = ".";
|
||||
std::filesystem::path scriptFile;
|
||||
std::filesystem::path projectFolder;
|
||||
int tps = 20;
|
||||
};
|
||||
|
||||
using OnWorldOpen = std::function<void(std::unique_ptr<Level>, int64_t)>;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ using namespace std::chrono;
|
|||
|
||||
static debug::Logger logger("mainloop");
|
||||
|
||||
inline constexpr int TPS = 20;
|
||||
|
||||
ServerMainloop::ServerMainloop(Engine& engine) : engine(engine) {
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +37,7 @@ void ServerMainloop::run() {
|
|||
"script:" + coreParams.scriptFile.filename().u8string()
|
||||
);
|
||||
|
||||
double targetDelta = 1.0 / static_cast<double>(TPS);
|
||||
double targetDelta = 1.0 / static_cast<double>(coreParams.tps);
|
||||
double delta = targetDelta;
|
||||
auto begin = system_clock::now();
|
||||
auto startupTime = begin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue