Comment out [move_units_fake] animation...

...to focus on the fake units. Reduce loglevel
This commit is contained in:
Alexander van Gessel 2010-05-17 02:43:32 +01:00
parent 2f68352a6a
commit 946a3062db

View File

@ -1131,7 +1131,7 @@ WML_HANDLER_FUNCTION(move_unit_fake, /*event_info*/, cfg)
WML_HANDLER_FUNCTION(move_units_fake, /*event_info*/, cfg)
{
ERR_WML << "Processing [move_units_fake]\n";
LOG_WML << "Processing [move_units_fake]\n";
const vconfig::child_list unit_cfgs = cfg.get_children("fake_unit");
size_t num_units = unit_cfgs.size();
@ -1140,7 +1140,7 @@ WML_HANDLER_FUNCTION(move_units_fake, /*event_info*/, cfg)
paths.reserve(num_units);
game_display* disp = game_display::get_singleton();
ERR_WML << "Moving " << num_units << " units\n";
LOG_WML << "Moving " << num_units << " units\n";
size_t longest_path = 0;
@ -1150,38 +1150,44 @@ WML_HANDLER_FUNCTION(move_units_fake, /*event_info*/, cfg)
units.push_back(create_fake_unit(config));
paths.push_back(fake_unit_path(units.back(), xvals, yvals));
longest_path = std::max(longest_path, paths.back().size());
ERR_WML << "Path " << paths.size() - 1 << " has length " << paths.back().size() << '\n';
DBG_WML << "Path " << paths.size() - 1 << " has length " << paths.back().size() << '\n';
units.back().set_location(paths.back().front());
disp->place_temporary_unit(&units.back());
disp->invalidate(units.back().get_location()); // shouldn't be needed, place_temporary_unit already calls invalidate()
}
disp->draw();
ERR_WML << "Units placed, longest path is " << longest_path << " long\n";
LOG_WML << "Units placed, longest path is " << longest_path << " long\n";
std::vector<map_location> path_step(2);
path_step.resize(2);
for(size_t step = 1; step < longest_path; ++step) {
ERR_WML << "Doing step " << step << "...\n";
DBG_WML << "Doing step " << step << "...\n";
for(size_t un = 0; un < num_units; ++un) {
if(step >= paths[un].size())
continue;
ERR_WML << "Moving unit " << un << ", doing step " << step << '\n';
DBG_WML << "Moving unit " << un << ", doing step " << step << '\n';
path_step[0] = paths[un][step - 1];
path_step[1] = paths[un][step];
unit_display::move_unit(path_step, units[un], *resources::teams);
//unit_display::move_unit(path_step, units[un], *resources::teams);
resources::screen->delay(400);
units[un].set_location(path_step[1]);
disp->invalidate(path_step[0]);
disp->invalidate(path_step[1]);
//disp->invalidate(path_step[0]);
//disp->invalidate(path_step[1]);
units[un].invalidate(path_step[0]);
units[un].invalidate(path_step[1]);
disp->invalidate_all();
disp->draw();
}
}
ERR_WML << "Units moved\n";
LOG_WML << "Units moved\n";
foreach(unit& u, units)
disp->remove_temporary_unit(&u);
ERR_WML << "Units removed\n";
LOG_WML << "Units removed\n";
}
// Helper function(s) for [set_variable]