Skip to content

Commit efb78aa

Browse files
committed
Fixed crash from non-editor-mode calls to editor controller
1 parent aa077b1 commit efb78aa

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

examples/game/src/entities/Player.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
#include "Player.h"
1010

1111
#include <core/Statics.h>
12-
#include <core/Ticker.h>
1312
#include <core/physics/CollisionSystem.h>
1413
#include <core/scene/SceneFile.h>
15-
#include <utils/Logging.h>
1614
#include <window/Input.h>
1715

1816
#include "../ServiceLocator.h"

examples/game/src/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <core/ResourceSystem.h>
1010
#include <core/Statics.h>
1111
#include <core/Ticker.h>
12-
#include <core/entity/EntitySystem.h>
1312
#include <core/physics/CollisionSystem.h>
1413
#include <core/scene/SceneSystem.h>
1514
#include <render/renderer/Renderer.h>
@@ -107,9 +106,6 @@ int main(int argc, char* argv[])
107106

108107
float aspect = window.AspectRatio();
109108

110-
// float panelWidth = window.GetWidth();
111-
// float panelHeight = 50.f;
112-
113109
camera3d.SetAspectRatio(aspect);
114110
camera2d.Update(0.f, window.GetWidth(), 0.f, window.GetHeight(), 0.1f, 1000.f);
115111

examples/game/src/tools/DevConsole.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void DevConsole::OnUpdate()
2626
// Toggle the console
2727
isActive = !isActive;
2828
if (!isActive) inputText = "";
29-
ServiceLocator::GetEditorController()->SetIsHandlingInput(!isActive);
29+
if (isEditorMode) ServiceLocator::GetEditorController()->SetIsHandlingInput(!isActive);
3030
return;
3131
}
3232

@@ -154,14 +154,12 @@ void DevConsole::OnDraw2D()
154154
Siege::Window* window = ServiceLocator::GetWindow();
155155

156156
// Draw the console to the screen
157-
// Siege::Statics::Render().DrawRectangle2D(0, 0, window->GetWidth(), 40,
158-
// Siege::IColour::Black);
159157
ServiceLocator::GetRenderer()->DrawQuad({0.f, -1.f},
160158
{((float) window->GetWidth()) / 2, 25.f},
161159
Siege::IColour::Black,
162160
0,
163161
1);
164-
ServiceLocator::GetRenderer()->DrawText2D("~ " + inputText,
162+
ServiceLocator::GetRenderer()->DrawText2D("> " + inputText,
165163
ServiceLocator::GetRenderResources()->GetFont(),
166164
{10.f, 10.f},
167165
{20.f, 20.f},

0 commit comments

Comments
 (0)