game.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include "irrlichttypes.h"
  18. #include <string>
  19. class InputHandler;
  20. class ChatBackend; /* to avoid having to include chat.h */
  21. struct SubgameSpec;
  22. struct Jitter {
  23. f32 max, min, avg, counter, max_sample, min_sample, max_fraction;
  24. };
  25. struct RunStats {
  26. u32 drawtime;
  27. Jitter dtime_jitter, busy_time_jitter;
  28. };
  29. struct CameraOrientation {
  30. f32 camera_yaw; // "right/left"
  31. f32 camera_pitch; // "up/down"
  32. };
  33. void the_game(bool *kill,
  34. bool random_input,
  35. InputHandler *input,
  36. const std::string &map_dir,
  37. const std::string &playername,
  38. const std::string &password,
  39. const std::string &address, // If "", local server is used
  40. u16 port,
  41. std::string &error_message,
  42. ChatBackend &chat_backend,
  43. bool *reconnect_requested,
  44. const SubgameSpec &gamespec, // Used for local game
  45. bool simple_singleplayer_mode);