|
|
@@ -81,6 +81,7 @@ Device::Device() :
|
|
|
|
|
|
m_is_init(false),
|
|
|
m_is_running(false),
|
|
|
+ m_is_paused(true),
|
|
|
|
|
|
m_frame_count(0),
|
|
|
|
|
|
@@ -203,11 +204,12 @@ bool Device::init(int argc, char** argv)
|
|
|
m_is_init = true;
|
|
|
start();
|
|
|
|
|
|
- ResourceId luagame_id = m_resource_manager->load("lua", m_boot_file);
|
|
|
- m_resource_manager->flush();
|
|
|
- m_lua_environment->load((LuaResource*) m_resource_manager->data(luagame_id));
|
|
|
+ // Execute lua boot file
|
|
|
+ m_lua_environment->load_and_execute(m_boot_file);
|
|
|
m_lua_environment->call_global("init", 0);
|
|
|
- m_resource_manager->unload(luagame_id);
|
|
|
+
|
|
|
+ // Show main window
|
|
|
+ m_window->show();
|
|
|
|
|
|
if (m_quit_after_init == 1)
|
|
|
{
|
|
|
@@ -215,9 +217,6 @@ bool Device::init(int argc, char** argv)
|
|
|
shutdown();
|
|
|
}
|
|
|
|
|
|
- // Show main window
|
|
|
- m_window->show();
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -386,6 +385,18 @@ void Device::stop()
|
|
|
m_is_running = false;
|
|
|
}
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+void Device::pause()
|
|
|
+{
|
|
|
+ m_is_paused = true;
|
|
|
+}
|
|
|
+
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+void Device::unpause()
|
|
|
+{
|
|
|
+ m_is_paused = false;
|
|
|
+}
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
bool Device::is_running() const
|
|
|
{
|
|
|
@@ -415,10 +426,9 @@ void Device::frame()
|
|
|
|
|
|
m_window->frame();
|
|
|
m_input_manager->frame(frame_count());
|
|
|
+
|
|
|
m_lua_environment->call_global("frame", 1, ARGUMENT_FLOAT, last_delta_time());
|
|
|
|
|
|
- // m_console_server->execute();
|
|
|
-
|
|
|
m_debug_renderer->draw_all();
|
|
|
m_renderer->frame();
|
|
|
|