|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // Lol Engine
- //
- // Copyright: (c) 2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
- // 2013 Sam Hocevar <sam@hocevar.net>
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the Do What The Fuck You Want To
- // Public License, Version 2, as published by Sam Hocevar. See
- // http://www.wtfpl.net/ for more details.
- //
-
- #if defined HAVE_CONFIG_H
- # include "config.h"
- #endif
-
- #include <lol/main.h>
- #include "scenesetup.h"
- #include "scenesetup-compiler.h"
-
- namespace lol
- {
-
- //-----------------------------------------------------------------------------
- //CTor/DTor
- SceneSetup::SceneSetup()
- {
- m_clear_color = vec4(vec3::zero, 1.f);
- m_show_gizmo = true;
- m_show_lights = true;
- }
-
- //----
- SceneSetup::~SceneSetup()
- {
- Shutdown(true);
- }
-
- //-----------------------------------------------------------------------------
- bool SceneSetup::Compile(char const *command)
- {
- SceneSetupCompiler mc(*this);
- return mc.ParseString(command);
- }
-
- //-----------------------------------------------------------------------------
- bool SceneSetup::Startup()
- {
- for (int i = 0; i < m_lights.Count(); i++)
- Ticker::Ref(m_lights[i]);
- return true;
- }
-
- //-----------------------------------------------------------------------------
- bool SceneSetup::Shutdown(bool destroy)
- {
- for (int i = 0; i < m_lights.Count(); i++)
- if (m_lights[i]->IsTicked())
- Ticker::Unref(m_lights[i]);
-
- if (destroy)
- m_lights.Empty();
- return true;
- }
-
- } /* namespace lol */
|