summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-05-15 10:30:39 -0600
committerGitHub <noreply@github.com>2025-05-15 10:30:39 -0600
commite7415ec072ee1cdc99a49db658062d4de0b3301c (patch)
tree5b01d3f1921e221d03b05ec101d10d7513624974 /src/engine
parent0e35858050fd00e5871f0ac9d1684edc61251d49 (diff)
Fixes made so far (#198)
* Fixed compile * Moved GetInterpreter() to a single function under the Engine.h
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/editor/EditorMath.cpp15
-rw-r--r--src/engine/editor/EditorMath.h2
2 files changed, 11 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();
diff --git a/src/engine/editor/EditorMath.h b/src/engine/editor/EditorMath.h
index abc694976..d5d75fe13 100644
--- a/src/engine/editor/EditorMath.h
+++ b/src/engine/editor/EditorMath.h
@@ -6,6 +6,8 @@
#include "../CoreMath.h"
#include <vector>
#include "GameObject.h"
+#include <graphic/Fast3D/Fast3dWindow.h>
+#include <graphic/Fast3D/interpreter.h>
extern "C" {
#include "common_structs.h"