mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 23:11:49 +00:00
use real delta in client-side tests
This commit is contained in:
parent
0bfc63d51f
commit
dd62393eb6
1 changed files with 1 additions and 6 deletions
|
|
@ -18,11 +18,9 @@ Mainloop::Mainloop(Engine& engine) : engine(engine) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mainloop::run() {
|
void Mainloop::run() {
|
||||||
const auto& coreParams = engine.getCoreParameters();
|
|
||||||
auto& time = engine.getTime();
|
auto& time = engine.getTime();
|
||||||
auto& window = engine.getWindow();
|
auto& window = engine.getWindow();
|
||||||
auto& settings = engine.getSettings();
|
auto& settings = engine.getSettings();
|
||||||
double targetDelta = 1.0 / static_cast<double>(coreParams.tps);
|
|
||||||
|
|
||||||
engine.setLevelConsumer([this](auto level, int64_t localPlayer) {
|
engine.setLevelConsumer([this](auto level, int64_t localPlayer) {
|
||||||
if (level == nullptr) {
|
if (level == nullptr) {
|
||||||
|
|
@ -39,13 +37,10 @@ void Mainloop::run() {
|
||||||
|
|
||||||
logger.info() << "starting menu screen";
|
logger.info() << "starting menu screen";
|
||||||
engine.setScreen(std::make_shared<MenuScreen>(engine));
|
engine.setScreen(std::make_shared<MenuScreen>(engine));
|
||||||
|
|
||||||
double testTimer = 0.0;
|
|
||||||
|
|
||||||
logger.info() << "main loop started";
|
logger.info() << "main loop started";
|
||||||
while (!window.isShouldClose()) {
|
while (!window.isShouldClose()) {
|
||||||
testTimer += targetDelta;
|
time.update(window.time());
|
||||||
time.update(coreParams.testMode ? testTimer : window.time());
|
|
||||||
engine.applicationTick();
|
engine.applicationTick();
|
||||||
engine.updateFrontend();
|
engine.updateFrontend();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue