Fixing text buffer texture/font corruption (#479) * #479 demonstrates that the contents of the text buffer are NOT irrelevant for reproducing bugs. So I set up recording/replay for the burma shave easter egg. This also makes an easy way to mess with the buffer state when debugging (just mash &/\*/&/\*/&/\* n times) * When a replay throws an error, it puts up a showError() dialog. If the next action is a control_click, the system will try to click that control on the error dialog--which is totally divergent from the replay's intended behavior. So we should just stop replaying when an error happens. * If you have a long replay and want to run it very fast, but then slow down when you get to the sequence that reproduces your bug, now you can add a `<change_fps>` to your replay to achieve that. * Fixes for the 2 legacy replay errors that I opened recently Fix #479 Fix #532 Fix #533
25 lines
684 B
C++
25 lines
684 B
C++
|
|
|
|
#define CATCH_CONFIG_MAIN
|
|
#include "catch.hpp"
|
|
|
|
// After this are some globals that are referenced from common code but not defined, and not used in the test cases
|
|
#include "gfx/gfxsheets.hpp"
|
|
#include "universe/universe.hpp"
|
|
sf::RenderWindow mainPtr;
|
|
std::string scenario_temp_dir_name = "test_scenario";
|
|
cCustomGraphics spec_scen_g;
|
|
cUniverse univ;
|
|
std::vector<fs::path> extra_scen_dirs;
|
|
|
|
bool check_for_interrupt(std::string) { return false; }
|
|
|
|
// And these are referenced from the scenario code, though not used in test cases
|
|
#include "scenario/scenario.hpp"
|
|
#include "tools/undo.hpp"
|
|
location cur_out;
|
|
short cur_town;
|
|
cScenario scenario;
|
|
bool change_made;
|
|
cUndoList undo_list;
|