summaryrefslogtreecommitdiff
path: root/src/engine/editor/EditorMath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/editor/EditorMath.cpp')
-rw-r--r--src/engine/editor/EditorMath.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/engine/editor/EditorMath.cpp b/src/engine/editor/EditorMath.cpp
index 533c0c2b5..a3e19716c 100644
--- a/src/engine/editor/EditorMath.cpp
+++ b/src/engine/editor/EditorMath.cpp
@@ -10,6 +10,9 @@
#include <limits>
#include <cmath>
+#include <graphic/Fast3D/Fast3dWindow.h>
+#include <graphic/Fast3D/interpreter.h>
+
extern "C" {
#include "common_structs.h"
#include "main.h"
@@ -20,16 +23,15 @@ extern "C" {
#include "camera.h"
}
-std::vector<Mtx> EditorMatrix;
-
bool IsInGameScreen() {
auto wnd = GameEngine::Instance->context->GetWindow();
Ship::Coords mouse = wnd->GetMousePos();
// Define viewport boundaries
- int left = gfx_current_game_window_viewport.x;
+ auto gfx_current_game_window_viewport = GameEngine::GetInterpreter().get()->mGameWindowViewport;
+ int left = gfx_current_game_window_viewport.width;
int right = left + OTRGetGameRenderWidth();
- int top = gfx_current_game_window_viewport.y;
+ int top = gfx_current_game_window_viewport.height;
int bottom = top + OTRGetGameRenderHeight();
// Check if the mouse is within the game render area
@@ -41,8 +43,9 @@ FVector ScreenRayTrace() {
Camera* camera = &cameras[0];
Ship::Coords mouse = wnd->GetMousePos();
- mouse.x -= gfx_current_game_window_viewport.x;
- mouse.y -= gfx_current_game_window_viewport.y;
+ auto gfx_current_game_window_viewport = GameEngine::GetInterpreter().get()->mGameWindowViewport;
+ mouse.x -= gfx_current_game_window_viewport.width;
+ mouse.y -= gfx_current_game_window_viewport.height;
// Get screen dimensions
uint32_t width = OTRGetGameViewportWidth();
uint32_t height = OTRGetGameViewportHeight();