mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add vctest (WIP)
This commit is contained in:
parent
d9bd60f473
commit
5e8805f241
16 changed files with 439 additions and 52 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "window/Events.hpp"
|
||||
#include "window/input.hpp"
|
||||
#include "window/Window.hpp"
|
||||
#include "interfaces/Process.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
|
|
@ -178,12 +179,25 @@ void Engine::saveScreenshot() {
|
|||
|
||||
void Engine::run() {
|
||||
if (params.headless) {
|
||||
logger.info() << "nothing to do";
|
||||
runTest();
|
||||
} else {
|
||||
mainloop();
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::runTest() {
|
||||
if (params.testFile.empty()) {
|
||||
logger.info() << "nothing to do";
|
||||
return;
|
||||
}
|
||||
logger.info() << "starting test " << params.testFile;
|
||||
auto process = scripting::start_coroutine(params.testFile);
|
||||
while (process->isActive()) {
|
||||
process->update();
|
||||
}
|
||||
logger.info() << "test finished";
|
||||
}
|
||||
|
||||
void Engine::mainloop() {
|
||||
logger.info() << "starting menu screen";
|
||||
setScreen(std::make_shared<MenuScreen>(this));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue