summaryrefslogtreecommitdiffstats
path: root/src/collision/ColStore.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-16 11:49:23 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-16 11:49:23 +0100
commitcdd30f4da5f220aa584eebddcfd5d16c39ca7426 (patch)
tree540a167f585e3779380dd3ce67140e75c9191e15 /src/collision/ColStore.h
parentsmall fix of fix (diff)
downloadre3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar.gz
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar.bz2
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar.lz
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar.xz
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.tar.zst
re3-cdd30f4da5f220aa584eebddcfd5d16c39ca7426.zip
Diffstat (limited to 'src/collision/ColStore.h')
-rw-r--r--src/collision/ColStore.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/collision/ColStore.h b/src/collision/ColStore.h
new file mode 100644
index 00000000..8e2a3a70
--- /dev/null
+++ b/src/collision/ColStore.h
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "templates.h"
+
+struct ColDef { // made up name
+ int32 unused;
+ bool isLoaded;
+ CRect bounds;
+ char name[20];
+ int16 minIndex;
+ int16 maxIndex;
+};
+
+class CColStore
+{
+ static CPool<ColDef,ColDef> *ms_pColPool;
+
+public:
+ static void Initialise(void);
+ static void Shutdown(void);
+ static int AddColSlot(const char *name);
+ static void RemoveColSlot(int32 slot);
+ static int FindColSlot(const char *name);
+ static char *GetColName(int32 slot);
+ static CRect &GetBoundingBox(int32 slot);
+ static void IncludeModelIndex(int32 slot, int32 modelIndex);
+ static bool LoadCol(int32 storeID, uint8 *buffer, int32 bufsize);
+ static void RemoveCol(int32 slot);
+ static void AddCollisionNeededAtPosn(const CVector2D &pos);
+ static void LoadAllCollision(void);
+ static void RemoveAllCollision(void);
+ static void LoadCollision(const CVector2D &pos);
+ static void RequestCollision(const CVector2D &pos);
+ static void EnsureCollisionIsInMemory(const CVector2D &pos);
+ static bool HasCollisionLoaded(const CVector2D &pos);
+
+ static ColDef *GetSlot(int slot) {
+ assert(slot >= 0);
+ assert(ms_pColPool);
+ assert(slot < ms_pColPool->GetSize());
+ return ms_pColPool->GetSlot(slot);
+ }
+};