Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

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