feat: fast forward
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -103,7 +103,17 @@ int main(int argc, char** argv) {
|
||||
cam.SetCamPos({77, 5, 13});
|
||||
cam.UpdatePerspective(display.GetAspectRatio());
|
||||
|
||||
td::sim::RealTimeSimulation simulation(w, std::move(gh), 500);
|
||||
td::sim::RealTimeSimulation simulation(w, 500);
|
||||
|
||||
display.OnKeyDown.Connect([&simulation](SDL_Keycode key){
|
||||
if (key == SDLK_A) {
|
||||
auto spawn = std::make_shared<td::protocol::commands::SpawnTroopCommand>(0, 0, td::Vec2fp{td::FpFloat(77), td::FpFloat(13)}, 0);
|
||||
std::array<td::protocol::LockStep, LOCKSTEP_BUFFER_SIZE> steps{};
|
||||
steps[0].push_back(spawn);
|
||||
td::protocol::packets::LockStepsPacket packet{0, steps};
|
||||
simulation.HandlePacket(packet);
|
||||
}
|
||||
});
|
||||
|
||||
while (!display.IsCloseRequested()) {
|
||||
display.PollEvents();
|
||||
|
||||
Reference in New Issue
Block a user