add 'test' library

This commit is contained in:
MihailRis
2024-12-07 22:16:50 +03:00
parent bbb9987140
commit 59402b6607
10 changed files with 56 additions and 12 deletions
+14
View File
@@ -190,9 +190,15 @@ void Engine::runTest() {
logger.info() << "nothing to do";
return;
}
int tps = 20;
logger.info() << "starting test " << params.testFile;
auto process = scripting::start_coroutine(params.testFile);
while (process->isActive()) {
frame++;
delta = 1.0f / static_cast<float>(tps);
lastTime += delta;
process->update();
}
logger.info() << "test finished";
@@ -466,6 +472,10 @@ double Engine::getDelta() const {
return delta;
}
double Engine::getUptime() const {
return lastTime;
}
void Engine::setScreen(std::shared_ptr<Screen> screen) {
// reset audio channels (stop all sources)
audio::reset_channel(audio::get_channel_index("regular"));
@@ -534,3 +544,7 @@ SettingsHandler& Engine::getSettingsHandler() {
network::Network& Engine::getNetwork() {
return *network;
}
const CoreParameters& Engine::getCoreParameters() const {
return params;
}