]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
softwaretransform hasn't been used in ages, I thought I had already gotten rid of...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 20 Nov 2002 11:10:37 +0000 (11:10 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 20 Nov 2002 11:10:37 +0000 (11:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2638 d7cf8633-e32d-0410-b094-e92efae38249

makefile
render.h
transform.c [deleted file]
transform.h [deleted file]

index c0ac45edc4ae23bac237b48f3625111519adc7a4..c13853079c08388f048ab30396b9d1b6662a93bc 100644 (file)
--- a/makefile
+++ b/makefile
@@ -51,7 +51,7 @@ SHAREDOBJECTS=        builddate.o cmd.o collision.o common.o crc.o cvar.o \
                model_alias.o model_brush.o model_shared.o model_sprite.o \
                net_bsd.o net_dgrm.o net_loop.o net_main.o net_master.o \
                net_udp.o palette.o portals.o protocol.o quakeio.o sys_linux.o \
-               sys_shared.o transform.o world.o wad.o zone.o
+               sys_shared.o world.o wad.o zone.o
 
 OBJ_COMMON= $(CLIENTOBJECTS) $(SERVEROBJECTS) $(SHAREDOBJECTS)
 OBJ_GLX= vid_glx.c $(OBJ_CD) $(OBJ_SND)
index 1c9a91abc5228856c1527b6af7ab1a291ad75b66..01c58448dc3d5f0bc81879096ee040389eb459c8 100644 (file)
--- a/render.h
+++ b/render.h
@@ -114,9 +114,6 @@ void R_DrawWorld(entity_render_t *ent);
 void R_DrawParticles(void);
 void R_DrawExplosions(void);
 
-// LordHavoc: vertex transform
-#include "transform.h"
-
 #define gl_solid_format 3
 #define gl_alpha_format 4
 
diff --git a/transform.c b/transform.c
deleted file mode 100644 (file)
index 66628f6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include "quakedef.h"
-
-vec_t softwaretransform_rotatematrix[3][4];
-vec_t softwaretransform_matrix[3][4];
-vec_t softwaretransform_invmatrix[3][4];
-int softwaretransform_complexity;
-
-vec_t softwaretransform_identitymatrix[3][4] =
-{
-       {1, 0, 0, 0},
-       {0, 1, 0, 0},
-       {0, 0, 1, 0}
-};
-
-void softwaretransformidentity(void)
-{
-       memcpy(softwaretransform_rotatematrix, softwaretransform_identitymatrix, sizeof(vec_t[3][4]));
-       memcpy(softwaretransform_matrix      , softwaretransform_identitymatrix, sizeof(vec_t[3][4]));
-       memcpy(softwaretransform_invmatrix   , softwaretransform_identitymatrix, sizeof(vec_t[3][4]));
-       softwaretransform_complexity = 0;
-}
-
-void softwaretransformset (vec3_t origin, vec3_t angles, vec_t scale)
-{
-       float invscale;
-       invscale = 1.0f / scale;
-       if (scale == 0)
-               Host_Error("softwaretransformset: 0 scale\n");
-
-       AngleMatrix(angles, origin, softwaretransform_rotatematrix);
-
-       softwaretransform_matrix[0][0] = softwaretransform_rotatematrix[0][0] * scale;
-       softwaretransform_matrix[0][1] = softwaretransform_rotatematrix[0][1] * scale;
-       softwaretransform_matrix[0][2] = softwaretransform_rotatematrix[0][2] * scale;
-       softwaretransform_matrix[1][0] = softwaretransform_rotatematrix[1][0] * scale;
-       softwaretransform_matrix[1][1] = softwaretransform_rotatematrix[1][1] * scale;
-       softwaretransform_matrix[1][2] = softwaretransform_rotatematrix[1][2] * scale;
-       softwaretransform_matrix[2][0] = softwaretransform_rotatematrix[2][0] * scale;
-       softwaretransform_matrix[2][1] = softwaretransform_rotatematrix[2][1] * scale;
-       softwaretransform_matrix[2][2] = softwaretransform_rotatematrix[2][2] * scale;
-       softwaretransform_matrix[0][3] = softwaretransform_rotatematrix[0][3];
-       softwaretransform_matrix[1][3] = softwaretransform_rotatematrix[1][3];
-       softwaretransform_matrix[2][3] = softwaretransform_rotatematrix[2][3];
-
-       softwaretransform_invmatrix[0][0] = softwaretransform_rotatematrix[0][0] * invscale;
-       softwaretransform_invmatrix[0][1] = softwaretransform_rotatematrix[1][0] * invscale;
-       softwaretransform_invmatrix[0][2] = softwaretransform_rotatematrix[2][0] * invscale;
-       softwaretransform_invmatrix[1][0] = softwaretransform_rotatematrix[0][1] * invscale;
-       softwaretransform_invmatrix[1][1] = softwaretransform_rotatematrix[1][1] * invscale;
-       softwaretransform_invmatrix[1][2] = softwaretransform_rotatematrix[2][1] * invscale;
-       softwaretransform_invmatrix[2][0] = softwaretransform_rotatematrix[0][2] * invscale;
-       softwaretransform_invmatrix[2][1] = softwaretransform_rotatematrix[1][2] * invscale;
-       softwaretransform_invmatrix[2][2] = softwaretransform_rotatematrix[2][2] * invscale;
-       softwaretransform_invmatrix[0][3] = softwaretransform_rotatematrix[0][3];
-       softwaretransform_invmatrix[1][3] = softwaretransform_rotatematrix[1][3];
-       softwaretransform_invmatrix[2][3] = softwaretransform_rotatematrix[2][3];
-
-       // choose transform mode
-       if (softwaretransform_matrix[0][0] != 1 || softwaretransform_matrix[0][1] != 0 || softwaretransform_matrix[0][2] != 0
-        || softwaretransform_matrix[1][0] != 0 || softwaretransform_matrix[1][1] != 1 || softwaretransform_matrix[1][2] != 0
-        || softwaretransform_matrix[2][0] != 0 || softwaretransform_matrix[2][1] != 0 || softwaretransform_matrix[2][2] != 1)
-               softwaretransform_complexity = 2;
-       else if (softwaretransform_matrix[0][3] != 0 || softwaretransform_matrix[1][3] != 0 || softwaretransform_matrix[2][3] != 0)
-               softwaretransform_complexity = 1;
-       else
-               softwaretransform_complexity = 0;
-}
-
-void softwaretransformforentity (entity_render_t *r)
-{
-       vec3_t angles;
-       if (r->model->type == mod_brush)
-       {
-               angles[0] = r->angles[0];
-               angles[1] = r->angles[1];
-               angles[2] = r->angles[2];
-               softwaretransformset(r->origin, angles, r->scale);
-       }
-       else
-       {
-               angles[0] = -r->angles[0];
-               angles[1] = r->angles[1];
-               angles[2] = r->angles[2];
-               softwaretransformset(r->origin, angles, r->scale);
-       }
-}
-
diff --git a/transform.h b/transform.h
deleted file mode 100644 (file)
index a5e7a09..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-
-#ifndef TRANSFORM_H
-#define TRANSFORM_H
-
-extern vec_t softwaretransform_rotatematrix[3][4];
-extern vec_t softwaretransform_matrix[3][4];
-extern vec_t softwaretransform_invmatrix[3][4];
-extern int softwaretransform_complexity;
-
-void softwaretransformidentity (void);
-void softwaretransformset (vec3_t origin, vec3_t angles, vec_t scale);
-void softwaretransformforentity (entity_render_t *r);
-
-// #defines for speed reasons
-#define softwaretransform(in, out)\
-{\
-       if (softwaretransform_complexity == 0)\
-       {\
-               VectorCopy(in, out);\
-       }\
-       else if (softwaretransform_complexity == 1)\
-       {\
-               out[0] = in[0] + softwaretransform_matrix[0][3];\
-               out[1] = in[1] + softwaretransform_matrix[1][3];\
-               out[2] = in[2] + softwaretransform_matrix[2][3];\
-       }\
-       else\
-       {\
-               out[0] = DotProduct(in, softwaretransform_matrix[0]) + softwaretransform_matrix[0][3];\
-               out[1] = DotProduct(in, softwaretransform_matrix[1]) + softwaretransform_matrix[1][3];\
-               out[2] = DotProduct(in, softwaretransform_matrix[2]) + softwaretransform_matrix[2][3];\
-       }\
-}
-
-#define softwaretransformdirection(in, out)\
-{\
-       if (softwaretransform_complexity == 2)\
-       {\
-               out[0] = DotProduct(in, softwaretransform_rotatematrix[0]);\
-               out[1] = DotProduct(in, softwaretransform_rotatematrix[1]);\
-               out[2] = DotProduct(in, softwaretransform_rotatematrix[2]);\
-       }\
-       else\
-               VectorCopy(in, out);\
-}
-
-#define softwareuntransform(in, out)\
-{\
-       if (softwaretransform_complexity == 0)\
-       {\
-               VectorCopy(in, out);\
-       }\
-       else if (softwaretransform_complexity == 1)\
-       {\
-               out[0] = in[0] - softwaretransform_invmatrix[0][3];\
-               out[1] = in[1] - softwaretransform_invmatrix[1][3];\
-               out[2] = in[2] - softwaretransform_invmatrix[2][3];\
-       }\
-       else\
-       {\
-               vec3_t soft_v;\
-               soft_v[0] = in[0] - softwaretransform_invmatrix[0][3];\
-               soft_v[1] = in[1] - softwaretransform_invmatrix[1][3];\
-               soft_v[2] = in[2] - softwaretransform_invmatrix[2][3];\
-               out[0] = DotProduct(soft_v, softwaretransform_invmatrix[0]);\
-               out[1] = DotProduct(soft_v, softwaretransform_invmatrix[1]);\
-               out[2] = DotProduct(soft_v, softwaretransform_invmatrix[2]);\
-       }\
-}
-
-#endif
-