summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-04-16 00:38:56 +0000
committerTim Angus <tim@ngus.net>2006-04-16 00:38:56 +0000
commitdfa4bb52a7ac0b1f99d1ce9f78ec0ffbb7d7febc (patch)
tree5a9285a1e1b232615ad964efc09237fe2d0b60b1 /src/renderer
parent85a7e9ef79326422e1fea85d7668f37c24c3dd93 (diff)
* Merged ioq3-r708
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/tr_main.c8
-rw-r--r--src/renderer/tr_model.c32
-rw-r--r--src/renderer/tr_shade_calc.c2
3 files changed, 21 insertions, 21 deletions
diff --git a/src/renderer/tr_main.c b/src/renderer/tr_main.c
index 56f3cbef..bbe94236 100644
--- a/src/renderer/tr_main.c
+++ b/src/renderer/tr_main.c
@@ -1038,11 +1038,17 @@ Radix sort with 4 byte size buckets
static void R_RadixSort( drawSurf_t *source, int size )
{
static drawSurf_t scratch[ MAX_DRAWSURFS ];
-
+#ifdef Q3_LITTLE_ENDIAN
R_Radix( 0, size, source, scratch );
R_Radix( 1, size, scratch, source );
R_Radix( 2, size, source, scratch );
R_Radix( 3, size, scratch, source );
+#else
+ R_Radix( 3, size, source, scratch );
+ R_Radix( 2, size, scratch, source );
+ R_Radix( 1, size, source, scratch );
+ R_Radix( 0, size, scratch, source );
+#endif //Q3_LITTLE_ENDIAN
}
//==========================================================================================
diff --git a/src/renderer/tr_model.c b/src/renderer/tr_model.c
index 9d6732e0..b59ff3b4 100644
--- a/src/renderer/tr_model.c
+++ b/src/renderer/tr_model.c
@@ -661,19 +661,20 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
curtri++;
}
- // tri and curtri now point to the end of their surfaces.
+ // tri now points to the end of the surface.
surf->ofsEnd = (byte *) tri - (byte *) surf;
-
- // find the next surface
surf = (mdrSurface_t *) tri;
- cursurf = (mdrSurface_t *) curtri;
+
+ // find the next surface.
+ cursurf = (mdrSurface_t *) ((byte *) cursurf + LittleLong(cursurf->ofsEnd));
}
// surf points to the next lod now.
lod->ofsEnd = (int)((byte *) surf - (byte *) lod);
-
lod = (mdrLOD_t *) surf;
- curlod = (mdrLOD_t *) cursurf;
+
+ // find the next LOD.
+ curlod = (mdrLOD_t *)((byte *) curlod + LittleLong(curlod->ofsEnd));
}
// lod points to the first tag now, so update the offset too.
@@ -959,7 +960,7 @@ static md3Tag_t *R_GetTag( md3Header_t *mod, int frame, const char *tagName ) {
#ifdef RAVENMD4
void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, md3Tag_t * dest)
{
- int i;
+ int i, j, k;
int frameSize;
mdrFrame_t *frame;
mdrTag_t *tag;
@@ -981,20 +982,13 @@ void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, md3Tag_t
//
frameSize = (long)( &((mdrFrame_t *)0)->bones[ mod->numBones ] );
frame = (mdrFrame_t *)((byte *)mod + mod->ofsFrames + framenum * frameSize );
- #if 1
- VectorCopy(&frame->bones[tag->boneIndex].matrix[0][0], dest->axis[0] );
- VectorCopy(&frame->bones[tag->boneIndex].matrix[1][0], dest->axis[1] );
- VectorCopy(&frame->bones[tag->boneIndex].matrix[2][0], dest->axis[2] );
- #else
+
+ for (j = 0; j < 3; j++)
{
- int j,k;
- for (j=0;j<3;j++)
- {
- for (k=0;k<3;k++)
- dest->axis[j][k]=frame->bones[tag->boneIndex].matrix[k][j];
- }
+ for (k = 0; k < 3; k++)
+ dest->axis[j][k]=frame->bones[tag->boneIndex].matrix[k][j];
}
- #endif
+
dest->origin[0]=frame->bones[tag->boneIndex].matrix[0][3];
dest->origin[1]=frame->bones[tag->boneIndex].matrix[1][3];
dest->origin[2]=frame->bones[tag->boneIndex].matrix[2][3];
diff --git a/src/renderer/tr_shade_calc.c b/src/renderer/tr_shade_calc.c
index df509cec..ee2f6ecb 100644
--- a/src/renderer/tr_shade_calc.c
+++ b/src/renderer/tr_shade_calc.c
@@ -620,7 +620,7 @@ void RB_CalcColorFromOneMinusEntity( unsigned char *dstColors )
{
int i;
int *pColors = ( int * ) dstColors;
- unsigned char invModulate[3];
+ unsigned char invModulate[4];
int c;
if ( !backEnd.currentEntity )