Fixes made so far (#198)

* Fixed compile

* Moved GetInterpreter() to a single function under the Engine.h
This commit is contained in:
MegaMech
2025-05-15 10:30:39 -06:00
committed by GitHub
parent 0e35858050
commit e7415ec072
18 changed files with 76 additions and 36 deletions
+9 -6
View File
@@ -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();
+2
View File
@@ -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"