Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

62 wiersze
1.4 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
  5. // 2013 Sam Hocevar <sam@hocevar.net>
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the Do What The Fuck You Want To
  8. // Public License, Version 2, as published by Sam Hocevar. See
  9. // http://www.wtfpl.net/ for more details.
  10. //
  11. #if defined HAVE_CONFIG_H
  12. # include "config.h"
  13. #endif
  14. #include "core.h"
  15. #include "scenesetup.h"
  16. #include "scenesetup-compiler.h"
  17. namespace lol
  18. {
  19. //-----------------------------------------------------------------------------
  20. //CTor/DTor
  21. SceneSetup::SceneSetup()
  22. {
  23. }
  24. //----
  25. SceneSetup::~SceneSetup()
  26. {
  27. Shutdown(true);
  28. }
  29. //-----------------------------------------------------------------------------
  30. bool SceneSetup::Compile(char const *command)
  31. {
  32. SceneSetupCompiler mc(*this);
  33. return mc.ParseString(command);
  34. }
  35. //-----------------------------------------------------------------------------
  36. bool SceneSetup::Startup()
  37. {
  38. for (int i = 0; i < m_lights.Count(); i++)
  39. Ticker::Ref(m_lights[i]);
  40. return true;
  41. }
  42. //-----------------------------------------------------------------------------
  43. bool SceneSetup::Shutdown(bool destroy)
  44. {
  45. for (int i = 0; i < m_lights.Count(); i++)
  46. Ticker::Unref(m_lights[i]);
  47. if (destroy)
  48. m_lights.Empty();
  49. return true;
  50. }
  51. } /* namespace lol */