mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-04 02:49:38 -04:00
Fixes made so far (#198)
* Fixed compile * Moved GetInterpreter() to a single function under the Engine.h
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user