summaryrefslogtreecommitdiff
path: root/src/renderergl2
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2014-06-17 17:43:05 +0100
committerTim Angus <tim@ngus.net>2014-06-17 17:43:43 +0100
commit77c45fa12305eb8c977c5c7803f6cb1f24ce4ec4 (patch)
treeec9324ad73575a42b2eec5050a746b07aa26989d /src/renderergl2
parent1193e49c35fdd0ea24f21c6dff74b5b2cd074c3b (diff)
Various adjustments so it compiles
Diffstat (limited to 'src/renderergl2')
-rw-r--r--src/renderergl2/tr_extramath.c7
-rw-r--r--src/renderergl2/tr_extramath.h3
-rw-r--r--src/renderergl2/tr_vbo.c15
3 files changed, 13 insertions, 12 deletions
diff --git a/src/renderergl2/tr_extramath.c b/src/renderergl2/tr_extramath.c
index fe787ef1..84816a61 100644
--- a/src/renderergl2/tr_extramath.c
+++ b/src/renderergl2/tr_extramath.c
@@ -156,6 +156,13 @@ void Mat4SimpleInverse( const mat4_t in, mat4_t out)
out[ 3] = 0.0f; out[ 7] = 0.0f; out[11] = 0.0f; out[15] = 1.0f;
}
+void VectorLerp( vec3_t a, vec3_t b, float lerp, vec3_t c)
+{
+ c[0] = a[0] * (1.0f - lerp) + b[0] * lerp;
+ c[1] = a[1] * (1.0f - lerp) + b[1] * lerp;
+ c[2] = a[2] * (1.0f - lerp) + b[2] * lerp;
+}
+
qboolean SpheresIntersect(vec3_t origin1, float radius1, vec3_t origin2, float radius2)
{
float radiusSum = radius1 + radius2;
diff --git a/src/renderergl2/tr_extramath.h b/src/renderergl2/tr_extramath.h
index af7c3804..f1ea5767 100644
--- a/src/renderergl2/tr_extramath.h
+++ b/src/renderergl2/tr_extramath.h
@@ -77,6 +77,9 @@ static ID_INLINE int VectorCompare5(const vec5_t v1, const vec5_t v2)
return 1;
}
+void VectorLerp( vec3_t a, vec3_t b, float lerp, vec3_t c);
+
+
qboolean SpheresIntersect(vec3_t origin1, float radius1, vec3_t origin2, float radius2);
void BoundingSphereOfSpheres(vec3_t origin1, float radius1, vec3_t origin2, float radius2, vec3_t origin3, float *radius3);
diff --git a/src/renderergl2/tr_vbo.c b/src/renderergl2/tr_vbo.c
index 8eb85d41..dc0f33be 100644
--- a/src/renderergl2/tr_vbo.c
+++ b/src/renderergl2/tr_vbo.c
@@ -559,14 +559,11 @@ R_CreateIBO2
IBO_t *R_CreateIBO2(const char *name, int numIndexes, glIndex_t * inIndexes, vboUsage_t usage)
{
IBO_t *ibo;
- int i, j;
+ int i;
glIndex_t *indexes;
int indexesSize;
- int indexesCount;
- glIndex_t *tri;
- glIndex_t index;
int glUsage;
switch (usage)
@@ -605,16 +602,10 @@ IBO_t *R_CreateIBO2(const char *name, int numIndexes, glIndex_t * inInd
indexesSize = numIndexes * sizeof(glIndex_t);
indexes = ri.Hunk_AllocateTempMemory(indexesSize);
- indexesCount = 0;
- for(i = 0, tri = inIndexes; i < numIndexes; i += 3, tri += 3)
+ for(i = 0; i < numIndexes; i++)
{
- for(j = 0; j < 3; j++)
- {
- index = tri[j];
- memcpy(indexes + indexesOfs, &index, sizeof(glIndex_t));
- indexesOfs += sizeof(glIndex_t);
- }
+ indexes[i] = inIndexes[i];
}
ibo->indexesSize = indexesSize;