summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-08 16:36:53 +0200
committeraap <aap@papnet.eu>2020-04-08 18:45:55 +0200
commit9176aef1b251fe08d536f69e383334015c94e146 (patch)
tree27f3979748ae701790a87ce701a87a75c6d9f9a7 /src/render
parentimplemented CSkidmarks (diff)
parentfix bug (diff)
downloadre3-9176aef1b251fe08d536f69e383334015c94e146.tar
re3-9176aef1b251fe08d536f69e383334015c94e146.tar.gz
re3-9176aef1b251fe08d536f69e383334015c94e146.tar.bz2
re3-9176aef1b251fe08d536f69e383334015c94e146.tar.lz
re3-9176aef1b251fe08d536f69e383334015c94e146.tar.xz
re3-9176aef1b251fe08d536f69e383334015c94e146.tar.zst
re3-9176aef1b251fe08d536f69e383334015c94e146.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Skidmarks.cpp10
-rw-r--r--src/render/Skidmarks.h6
2 files changed, 9 insertions, 7 deletions
diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp
index 87881fb9..41ee5d1d 100644
--- a/src/render/Skidmarks.cpp
+++ b/src/render/Skidmarks.cpp
@@ -8,8 +8,8 @@
CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS];
-RwImVertexIndex SkidmarkIndexList[16 * 6];
-RwIm3DVertex SkidmarkVertices[16 * 2];
+RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6];
+RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2];
RwTexture *gpSkidTex;
RwTexture *gpSkidBloodTex;
RwTexture *gpSkidMudTex;
@@ -32,7 +32,7 @@ CSkidmarks::Init(void)
}
ix = 0;
- for(i = 0; i < 16; i++){
+ for(i = 0; i < SKIDMARK_LENGTH; i++){
SkidmarkIndexList[i*6+0] = ix+0;
SkidmarkIndexList[i*6+1] = ix+2;
SkidmarkIndexList[i*6+2] = ix+1;
@@ -42,7 +42,7 @@ CSkidmarks::Init(void)
ix += 2;
}
- for(i = 0; i < 16; i++){
+ for(i = 0; i < SKIDMARK_LENGTH; i++){
RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 0], 0.0f);
RwIm3DVertexSetV(&SkidmarkVertices[i*2 + 0], i*5.01f);
RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 1], 1.0f);
@@ -201,7 +201,7 @@ CSkidmarks::RegisterOne(uintptr id, CVector pos, float fwdX, float fwdY, bool *i
}
aSkidmarks[i].m_lastUpdate = CTimer::GetTimeInMilliseconds();
- if(aSkidmarks[i].m_last >= 15){
+ if(aSkidmarks[i].m_last >= SKIDMARK_LENGTH-1){
// No space to continue, end it
aSkidmarks[i].m_state = 2;
aSkidmarks[i].m_fadeStart = CTimer::GetTimeInMilliseconds() + 10000;
diff --git a/src/render/Skidmarks.h b/src/render/Skidmarks.h
index 5387d8f4..085b4c6d 100644
--- a/src/render/Skidmarks.h
+++ b/src/render/Skidmarks.h
@@ -1,5 +1,7 @@
#pragma once
+enum { SKIDMARK_LENGTH = 16 };
+
class CSkidmark
{
public:
@@ -12,8 +14,8 @@ public:
uint32 m_lastUpdate;;
uint32 m_fadeStart;
uint32 m_fadeEnd;
- CVector m_pos[16];
- CVector m_side[16];
+ CVector m_pos[SKIDMARK_LENGTH];
+ CVector m_side[SKIDMARK_LENGTH];
};
class CSkidmarks