Changeset - r25613:0450f3bdfa6e
[Not reviewed]
master
0 1 0
Patric Stout - 3 years ago 2021-06-10 17:34:53
truebrain@openttd.org
Add: adhere the autosave_on_exit setting for Null videodriver (#9343)

This is especially useful for automated-testing, to make a save
when the game quits while using "-vnull:ticks=N".
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/video/null_v.cpp
Show inline comments
 
@@ -10,6 +10,7 @@
 
#include "../stdafx.h"
 
#include "../gfx_func.h"
 
#include "../blitter/factory.hpp"
 
#include "../saveload/saveload.h"
 
#include "../window_func.h"
 
#include "null_v.h"
 

	
 
@@ -52,6 +53,12 @@ void VideoDriver_Null::MainLoop()
 
		::InputLoop();
 
		::UpdateWindows();
 
	}
 

	
 
	/* If requested, make a save just before exit. The normal exit-flow is
 
	 * not triggered from this driver, so we have to do this manually. */
 
	if (_settings_client.gui.autosave_on_exit) {
 
		DoExitSave();
 
	}
 
}
 

	
 
bool VideoDriver_Null::ChangeResolution(int w, int h) { return false; }
0 comments (0 inline, 0 general)