mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-07-09 14:56:07 -04:00
Fix compile (#199)
* Fixes made so far * Fixes up until linking * Moved GetInterpreter() to a single function under the Engine.h * Updated shader files included with assets, added exception for Linux for including SDL2_net * Removed osSetTime stub(for now) * Adjustments to get it to compile + run * Decoupled GetInterpreter() from the GameEngine Class, corrected a invalid include in SpaghettiGui.cpp --------- Co-authored-by: sitton76 <58642183+sitton76@users.noreply.github.com>
This commit is contained in:
+11
-19
@@ -49,14 +49,11 @@ float gInterpolationStep = 0.0f;
|
||||
#include "audio/GameAudio.h"
|
||||
}
|
||||
|
||||
std::weak_ptr<Fast::Interpreter> GameEngine::mInterpreter;
|
||||
|
||||
std::shared_ptr<Fast::Interpreter> GameEngine::GetInterpreter() {
|
||||
auto intP = mInterpreter.lock();
|
||||
if (!intP) {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
}
|
||||
return intP;
|
||||
Fast::Interpreter* GetInterpreter() {
|
||||
return static_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow())
|
||||
->GetInterpreterWeak()
|
||||
.lock()
|
||||
.get();
|
||||
}
|
||||
|
||||
GameEngine* GameEngine::Instance;
|
||||
@@ -543,7 +540,7 @@ extern "C" void GameEngine_UnloadSequence(const uint8_t seqId) {
|
||||
}
|
||||
|
||||
extern "C" float GameEngine_GetAspectRatio() {
|
||||
auto gfx_current_dimensions = GameEngine::GetInterpreter().get()->mCurDimensions;
|
||||
auto gfx_current_dimensions = GetInterpreter()->mCurDimensions;
|
||||
return gfx_current_dimensions.aspect_ratio;
|
||||
}
|
||||
|
||||
@@ -617,8 +614,7 @@ extern "C" void Timer_SetValue(int32_t* address, int32_t value) {
|
||||
// }
|
||||
|
||||
extern "C" float OTRGetAspectRatio() {
|
||||
auto gfx_current_dimensions = GameEngine::GetInterpreter().get()->mCurDimensions;
|
||||
return gfx_current_dimensions.aspect_ratio;
|
||||
return GetInterpreter()->mCurDimensions.aspect_ratio;
|
||||
}
|
||||
|
||||
extern "C" float OTRGetDimensionFromLeftEdge(float v) {
|
||||
@@ -661,22 +657,18 @@ extern "C" uint32_t OTRCalculateCenterOfAreaFromLeftEdge(int32_t center) {
|
||||
|
||||
// Gets the width of the current render target area
|
||||
extern "C" uint32_t OTRGetGameRenderWidth() {
|
||||
auto gfx_current_dimensions = GameEngine::GetInterpreter().get()->mCurDimensions;
|
||||
return gfx_current_dimensions.width;
|
||||
return GetInterpreter()->mCurDimensions.width;
|
||||
}
|
||||
|
||||
// Gets the height of the current render target area
|
||||
extern "C" uint32_t OTRGetGameRenderHeight() {
|
||||
auto gfx_current_dimensions = GameEngine::GetInterpreter().get()->mCurDimensions;
|
||||
return gfx_current_dimensions.height;
|
||||
return GetInterpreter()->mCurDimensions.height;
|
||||
}
|
||||
|
||||
extern "C" uint32_t OTRGetGameViewportWidth() {
|
||||
auto gfx_current_game_window_viewport = GameEngine::GetInterpreter().get()->mGameWindowViewport;
|
||||
return gfx_current_game_window_viewport.width;
|
||||
return GetInterpreter()->mGameWindowViewport.width;
|
||||
}
|
||||
|
||||
extern "C" uint32_t OTRGetGameViewportHeight() {
|
||||
auto gfx_current_game_window_viewport = GameEngine::GetInterpreter().get()->mGameWindowViewport;
|
||||
return gfx_current_game_window_viewport.height;
|
||||
return GetInterpreter()->mGameWindowViewport.height;
|
||||
}
|
||||
Reference in New Issue
Block a user