game.h 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Luanti
  2. // SPDX-License-Identifier: LGPL-2.1-or-later
  3. // Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. #pragma once
  5. #include "irrlichttypes.h"
  6. #include "config.h"
  7. #include <string>
  8. #if !IS_CLIENT_BUILD
  9. #error Do not include in server builds
  10. #endif
  11. class InputHandler;
  12. class ChatBackend;
  13. class RenderingEngine;
  14. struct SubgameSpec;
  15. struct GameStartData;
  16. struct Jitter {
  17. f32 max, min, avg, counter, max_sample, min_sample, max_fraction;
  18. };
  19. struct RunStats {
  20. u64 drawtime; // (us)
  21. Jitter dtime_jitter, busy_time_jitter;
  22. };
  23. struct CameraOrientation {
  24. f32 camera_yaw; // "right/left"
  25. f32 camera_pitch; // "up/down"
  26. };
  27. #define GAME_FALLBACK_TIMEOUT 1.8f
  28. #define GAME_CONNECTION_TIMEOUT 10.0f
  29. void the_game(bool *kill,
  30. InputHandler *input,
  31. RenderingEngine *rendering_engine,
  32. const GameStartData &start_data,
  33. std::string &error_message,
  34. ChatBackend &chat_backend,
  35. bool *reconnect_requested);