summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Instance.cpp20
-rw-r--r--src/render/Instance.h14
-rw-r--r--src/render/Sprite2d.cpp14
-rw-r--r--src/render/Sprite2d.h14
4 files changed, 48 insertions, 14 deletions
diff --git a/src/render/Instance.cpp b/src/render/Instance.cpp
new file mode 100644
index 00000000..775341be
--- /dev/null
+++ b/src/render/Instance.cpp
@@ -0,0 +1,20 @@
+#include "common.h"
+#include "patcher.h"
+#include "Instance.h"
+
+void
+CInstance::Shutdown()
+{
+ GetMatrix().Detach();
+}
+
+class CInstance_ : public CInstance
+{
+public:
+ void dtor() { CInstance::~CInstance(); }
+};
+
+STARTPATCHES
+ InjectHook(0x50BE90, &CInstance_::dtor, PATCH_JUMP);
+ InjectHook(0x50B850, &CInstance::Shutdown, PATCH_JUMP);
+ENDPATCHES
diff --git a/src/render/Instance.h b/src/render/Instance.h
new file mode 100644
index 00000000..01dfb6a2
--- /dev/null
+++ b/src/render/Instance.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "Placeable.h"
+
+// unused
+
+class CInstance : public CPlaceable
+{
+public:
+ int m_modelIndex;
+public:
+ ~CInstance() = default;
+ void Shutdown();
+};
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 3f21516a..1fe70121 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -5,13 +5,13 @@
#include "Camera.h"
#include "Sprite2d.h"
-RwIm2DVertex *CSprite2d::maVertices = (RwIm2DVertex*)0x6E9168;
-float &CSprite2d::RecipNearClip = *(float*)0x880DB4;
-int32 &CSprite2d::mCurrentBank = *(int32*)0x8F1AF4;
-RwTexture **CSprite2d::mpBankTextures = (RwTexture**)0x774DC0;
-int32 *CSprite2d::mCurrentSprite = (int32*)0x6F4500;
-int32 *CSprite2d::mBankStart = (int32*)0x774BE8;
-RwIm2DVertex *CSprite2d::maBankVertices = (RwIm2DVertex*)0x8429F8;
+RwIm2DVertex CSprite2d::maVertices[4];
+float CSprite2d::RecipNearClip;
+int32 CSprite2d::mCurrentBank;
+RwTexture *CSprite2d::mpBankTextures[10];
+int32 CSprite2d::mCurrentSprite[10];
+int32 CSprite2d::mBankStart[10];
+RwIm2DVertex CSprite2d::maBankVertices[500];
void
CSprite2d::SetRecipNearClip(void)
diff --git a/src/render/Sprite2d.h b/src/render/Sprite2d.h
index 268c7d2b..0b073557 100644
--- a/src/render/Sprite2d.h
+++ b/src/render/Sprite2d.h
@@ -2,13 +2,13 @@
class CSprite2d
{
- static float &RecipNearClip;
- static int32 &mCurrentBank;
- static RwTexture **mpBankTextures; //[10];
- static int32 *mCurrentSprite; //[10];
- static int32 *mBankStart; //[10];
- static RwIm2DVertex *maBankVertices; //[500];
- static RwIm2DVertex *maVertices; //[4];
+ static float RecipNearClip;
+ static int32 mCurrentBank;
+ static RwTexture *mpBankTextures[10];
+ static int32 mCurrentSprite[10];
+ static int32 mBankStart[10];
+ static RwIm2DVertex maBankVertices[500];
+ static RwIm2DVertex maVertices[4];
public:
RwTexture *m_pTexture;