mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-05-23 06:54:37 -04:00
Frame Interp changes (#654)
This commit is contained in:
@@ -21,9 +21,12 @@ extern "C" {
|
||||
#include "code_80005FD0.h"
|
||||
}
|
||||
|
||||
size_t AText::_count;
|
||||
|
||||
AText::AText(const SpawnParams& params) : AActor(params) {
|
||||
Name = "Text";
|
||||
ResourceName = "hm:text";
|
||||
_idx = _count;
|
||||
|
||||
SpawnPos = params.Location.value_or(FVector(0.0f, 100.0f, 0.0f));
|
||||
Pos[0] = SpawnPos.x;
|
||||
@@ -65,6 +68,8 @@ AText::AText(const SpawnParams& params) : AActor(params) {
|
||||
|
||||
Text = ValidateString(params.Skin.value_or("Harbour Masters"));
|
||||
AText::Print3D((char*)Text.c_str(), 0, CENTER_TEXT_MODE_2);
|
||||
|
||||
_count += 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,7 +365,7 @@ void AText::DrawText3D(Camera* camera) { // Based on func_80095BD0
|
||||
|
||||
AddObjectMatrix(mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
FrameInterpolation_RecordOpenChild("actor_text", ((uintptr_t)this << 6) | camera->cameraId);
|
||||
FrameInterpolation_RecordOpenChild("actor_text", ((uintptr_t)_idx << 6) | camera->cameraId);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_020077A8);
|
||||
|
||||
for (CharacterList& tex : TextureList) {
|
||||
|
||||
@@ -60,7 +60,13 @@ public:
|
||||
|
||||
// Constructor
|
||||
AText(const SpawnParams& params);
|
||||
virtual ~AText() override = default;
|
||||
virtual ~AText() {
|
||||
_count--;
|
||||
};
|
||||
|
||||
static size_t GetCount() {
|
||||
return _count;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is simply a helper function to keep Spawning code clean
|
||||
@@ -147,4 +153,7 @@ public:
|
||||
{{{30, 0, 0}, 0, {1856, 1984}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
{{{ 0, 0, 0}, 0, { 0, 1984}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
};
|
||||
private:
|
||||
static size_t _count;
|
||||
size_t _idx;
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ class GameCamera {
|
||||
public:
|
||||
GameCamera();
|
||||
GameCamera(FVector spawn, s16 rot, u32 mode);
|
||||
~GameCamera() {
|
||||
virtual ~GameCamera() {
|
||||
_count--;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user