25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

64 satır
1.5 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. m_clear_color = vec4(vec3::zero, 1.f);
  24. }
  25. //----
  26. SceneSetup::~SceneSetup()
  27. {
  28. Shutdown(true);
  29. }
  30. //-----------------------------------------------------------------------------
  31. bool SceneSetup::Compile(char const *command)
  32. {
  33. SceneSetupCompiler mc(*this);
  34. return mc.ParseString(command);
  35. }
  36. //-----------------------------------------------------------------------------
  37. bool SceneSetup::Startup()
  38. {
  39. for (int i = 0; i < m_lights.Count(); i++)
  40. Ticker::Ref(m_lights[i]);
  41. return true;
  42. }
  43. //-----------------------------------------------------------------------------
  44. bool SceneSetup::Shutdown(bool destroy)
  45. {
  46. for (int i = 0; i < m_lights.Count(); i++)
  47. if (m_lights[i]->IsTicked())
  48. Ticker::Unref(m_lights[i]);
  49. if (destroy)
  50. m_lights.Empty();
  51. return true;
  52. }
  53. } /* namespace lol */