engine.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #include "engine.h"
  2. #include "version.h"
  3. void Engine::set_iterations_per_second(int p_ips) {
  4. ips=p_ips;
  5. }
  6. int Engine::get_iterations_per_second() const {
  7. return ips;
  8. }
  9. void Engine::set_target_fps(int p_fps) {
  10. _target_fps=p_fps>0? p_fps : 0;
  11. }
  12. float Engine::get_target_fps() const {
  13. return _target_fps;
  14. }
  15. uint64_t Engine::get_frames_drawn() {
  16. return frames_drawn;
  17. }
  18. void Engine::set_frame_delay(uint32_t p_msec) {
  19. _frame_delay=p_msec;
  20. }
  21. uint32_t Engine::get_frame_delay() const {
  22. return _frame_delay;
  23. }
  24. void Engine::set_time_scale(float p_scale) {
  25. _time_scale=p_scale;
  26. }
  27. float Engine::get_time_scale() const {
  28. return _time_scale;
  29. }
  30. String Engine::get_version() const {
  31. return VERSION_FULL_NAME;
  32. }
  33. String Engine::get_version_name() const{
  34. return _MKSTR(VERSION_NAME);
  35. }
  36. String Engine::get_version_short_name() const{
  37. return _MKSTR(VERSION_SHORT_NAME);
  38. }
  39. int Engine::get_version_major() const{
  40. return VERSION_MAJOR;
  41. }
  42. int Engine::get_version_minor() const{
  43. return VERSION_MINOR;
  44. }
  45. String Engine::get_version_revision() const{
  46. return _MKSTR(VERSION_REVISION);
  47. }
  48. String Engine::get_version_status() const{
  49. return _MKSTR(VERSION_STATUS);
  50. }
  51. int Engine::get_version_year() const{
  52. return VERSION_YEAR;
  53. }
  54. Engine *Engine::singleton=NULL;
  55. Engine *Engine::get_singleton() {
  56. return singleton;
  57. }
  58. Engine::Engine()
  59. {
  60. singleton=this;
  61. frames_drawn=0;
  62. ips=60;
  63. _frame_delay=0;
  64. _fps=1;
  65. _target_fps=0;
  66. _time_scale=1.0;
  67. _pixel_snap=false;
  68. _fixed_frames=0;
  69. _idle_frames=0;
  70. _in_fixed=false;
  71. }