mirror of
https://github.com/Relintai/sfw.git
synced 2025-04-21 01:11:16 +02:00
Fail if scene is null.
This commit is contained in:
parent
c6cdd2fed8
commit
3062dada73
@ -11,14 +11,20 @@
|
|||||||
#include "object/core_string_names.h"
|
#include "object/core_string_names.h"
|
||||||
|
|
||||||
void Application::input_event(const Ref<InputEvent> &event) {
|
void Application::input_event(const Ref<InputEvent> &event) {
|
||||||
|
ERR_FAIL_COND(scene.is_null());
|
||||||
|
|
||||||
scene->input_event(event);
|
scene->input_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::update(float delta) {
|
void Application::update(float delta) {
|
||||||
|
ERR_FAIL_COND(scene.is_null());
|
||||||
|
|
||||||
scene->update(delta);
|
scene->update(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::render() {
|
void Application::render() {
|
||||||
|
ERR_FAIL_COND(scene.is_null());
|
||||||
|
|
||||||
scene->render();
|
scene->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,14 +90,14 @@ Application::Application() {
|
|||||||
MemoryPool::setup();
|
MemoryPool::setup();
|
||||||
CoreStringNames::create();
|
CoreStringNames::create();
|
||||||
|
|
||||||
// TODO add a helper static method
|
// TODO add a helper static method
|
||||||
memnew(AppWindow());
|
memnew(AppWindow());
|
||||||
|
|
||||||
if (!Input::get_singleton()) {
|
if (!Input::get_singleton()) {
|
||||||
memnew(Input());
|
memnew(Input());
|
||||||
}
|
}
|
||||||
|
|
||||||
_init_window();
|
_init_window();
|
||||||
}
|
}
|
||||||
Application::~Application() {
|
Application::~Application() {
|
||||||
_instance = NULL;
|
_instance = NULL;
|
||||||
@ -101,7 +107,7 @@ Application::~Application() {
|
|||||||
MemoryPool::cleanup();
|
MemoryPool::cleanup();
|
||||||
CoreStringNames::free();
|
CoreStringNames::free();
|
||||||
|
|
||||||
// TODO add a helper static method
|
// TODO add a helper static method
|
||||||
memdelete(AppWindow::get_singleton());
|
memdelete(AppWindow::get_singleton());
|
||||||
memdelete(Input::get_singleton());
|
memdelete(Input::get_singleton());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user