From 4841c9c59315c6a2fbe389a14ded358ec5cc60f7 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 20 Nov 2002 11:10:37 +0000 Subject: [PATCH] softwaretransform hasn't been used in ages, I thought I had already gotten rid of it... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2638 d7cf8633-e32d-0410-b094-e92efae38249 --- makefile | 2 +- render.h | 3 -- transform.c | 88 ----------------------------------------------------- transform.h | 72 ------------------------------------------- 4 files changed, 1 insertion(+), 164 deletions(-) delete mode 100644 transform.c delete mode 100644 transform.h diff --git a/makefile b/makefile index c0ac45ed..c1385307 100644 --- 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) diff --git a/render.h b/render.h index 1c9a91ab..01c58448 100644 --- 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 index 66628f6e..00000000 --- a/transform.c +++ /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 index a5e7a091..00000000 --- a/transform.h +++ /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 - -- 2.39.2