Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

77 рядки
1.1 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <cstdio>
  14. #include <cstring>
  15. #include <cstdlib>
  16. #include <ctype.h>
  17. #include "core.h"
  18. /*
  19. * World implementation class
  20. */
  21. class WorldData
  22. {
  23. friend class World;
  24. private:
  25. int width, height;
  26. };
  27. /*
  28. * Public World class
  29. */
  30. World::World()
  31. : data(new WorldData())
  32. {
  33. data->width = 0;
  34. data->height = 0;
  35. drawgroup = DRAWGROUP_BEFORE;
  36. }
  37. World::~World()
  38. {
  39. delete data;
  40. }
  41. char const *World::GetName()
  42. {
  43. return "<world>";
  44. }
  45. void World::TickGame(float deltams)
  46. {
  47. Entity::TickGame(deltams);
  48. }
  49. void World::TickDraw(float deltams)
  50. {
  51. Entity::TickDraw(deltams);
  52. }
  53. int World::GetWidth()
  54. {
  55. return data->width * 32;
  56. }
  57. int World::GetHeight()
  58. {
  59. return data->height * 32;
  60. }