1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
Matthias Urlichs 31ce55c0c6
Merge bac9bf93bc into 03672ed8eb 2025-07-18 11:02:57 +00:00
Jonathan G Rennison 03672ed8eb
Fix: EngineImageType mismatch between sizing and drawing in preview window (#14455) 2025-07-18 07:02:46 -04:00
Matthias Urlichs bac9bf93bc Codefix: Null video driver: take the game lock
The game loop must run with the game lock held.
2025-02-05 06:40:50 +01:00
Matthias Urlichs abdea49d24 Codechange: Null video driver: End on game exit
The Null driver now exits when the game ends.

It also gains the ability to run for an unlimited number of
ticks (using '-v null:ticks=0').
2025-02-04 20:47:51 +01:00
2 changed files with 6 additions and 3 deletions

View File

@ -84,7 +84,7 @@ struct EnginePreviewWindow : Window {
/* Get size of engine sprite, on loan from depot_gui.cpp */
EngineID engine = static_cast<EngineID>(this->window_number);
EngineImageType image_type = EIT_PURCHASE;
EngineImageType image_type = EIT_PREVIEW;
uint x, y;
int x_offs, y_offs;

View File

@ -50,8 +50,11 @@ void VideoDriver_Null::MainLoop()
{
uint i;
for (i = 0; i < this->ticks; i++) {
::GameLoop();
for (i = 0; i < this->ticks && ! _exit_game; i++) {
{
std::lock_guard<std::mutex> lock(this->game_state_mutex);
::GameLoop();
}
::InputLoop();
::UpdateWindows();
}