diff --git a/engine/Makefile b/engine/Makefile index 66dd0c69e..d40880f47 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -396,8 +396,8 @@ ifeq ($(USEASM),true) else SWCL_OBJS=$(SOFTWARE_OBJS) vid_x.o snd_linux.o cd_linux.o sys_linux.o endif - SW_EXE_NAME=../fteswqw.exe - SWCL_EXE_NAME=../fteswqwcl.exe + SW_EXE_NAME=../fteqw.sw + SWCL_EXE_NAME=../fteqwcl.sw SW_LDFLAGS=$(SWLDFLAGS) $(XLDFLAGS) SW_CFLAGS=$(SWCFLAGS) SWB_DIR=sw_linux @@ -431,7 +431,7 @@ $(OUT_DIR)/%.o : %.c $(DO_CC) ifeq ($(USEASM),true) -$(OUT_DIR)/%.o : %.s +$(OUT_DIR)/%.o : %.s sw/*.h $(DO_AS) endif diff --git a/engine/client/r_efrag.c b/engine/client/r_efrag.c index ac693dd74..10d9130ca 100644 --- a/engine/client/r_efrag.c +++ b/engine/client/r_efrag.c @@ -256,7 +256,7 @@ void R_StoreEfrags (efrag_t **ppefrag) entity_t *pent; model_t *clmodel; efrag_t *pefrag; - + return; while ((pefrag = *ppefrag) != NULL) { diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 3ae693b02..e5e7cdf37 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -23,6 +23,10 @@ #error "nodraw isn't constant" #endif +#ifdef SWQUAKE +extern qboolean r_usinglits; +#endif + //these are in model.c (or gl_model.c) void GLMod_LoadVertexes (lump_t *l); diff --git a/engine/gl/gl_model.h b/engine/gl/gl_model.h index 0ff3c44c9..44a1d9cb4 100644 --- a/engine/gl/gl_model.h +++ b/engine/gl/gl_model.h @@ -456,7 +456,8 @@ typedef struct typedef struct mtriangle_s { int xyz_index[3]; int st_index[3]; - int neighbors[3]; + + int pad[2]; } mtriangle_t; diff --git a/engine/sw/asm_draw.h b/engine/sw/asm_draw.h index 6adc6897d..f746187c3 100644 --- a/engine/sw/asm_draw.h +++ b/engine/sw/asm_draw.h @@ -138,17 +138,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define rd_yOrigin 108 #define rd_vieworg 112 #define rd_viewangles 124 -#define rd_ambientlight 136 -#define rd_flags 140 -#define rd_currentplayernum 144 -#define rd_size 148 +//fox x, fov y +#define rd_ambientlight 144 +#define rd_flags 148 +#define rd_currentplayernum 152 +#define rd_size 156 // mtriangle_t structure // !!! if this is changed, it must be changed in model.h too !!! -#define mtri_facesfront 0 -#define mtri_vertindex 4 -#define mtri_stindex 16 -#define mtri_size 28 // !!! if this changes, array indexing in !!! +#define mtri_vertindex 0 +#define mtri_stindex 12 +#define mtri_size 32 // !!! if this changes, array indexing in !!! // !!! d_polysa.s must be changed to match !!! -#define mtri_shift 4 +#define mtri_shift 5 diff --git a/engine/sw/d_ifacea.h b/engine/sw/d_ifacea.h index aa7dcba07..9cc4a213a 100644 --- a/engine/sw/d_ifacea.h +++ b/engine/sw/d_ifacea.h @@ -71,9 +71,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // stvert_t structure // !!! if this is changed, it must be changed in modelgen.h too !!! -#define stv_s 4 -#define stv_t 8 -#define stv_size 12 +#define stv_s 0 +#define stv_t 4 +#define stv_size 8 // trivertx_t structure @@ -92,6 +92,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define atd_pfinalverts 20 #define atd_numtriangles 24 #define atd_drawtype 28 -#define atd_seamfixupX16 32 +#define atd_pstverts 32 +//#define atd_seamfixupX16 32 #define atd_size 36 - diff --git a/engine/sw/d_polysa.s b/engine/sw/d_polysa.s index fbc8ab812..6746a8a82 100644 --- a/engine/sw/d_polysa.s +++ b/engine/sw/d_polysa.s @@ -22,11 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // x86 assembly-language polygon model drawing code // -//the id made assembler cannot cope with the changes made to the triangle data type. -#ifndef NOASM -#define NOASM -#endif - #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" @@ -1190,15 +1185,15 @@ Llooptop: subl $0x80000001,%eax jc Lskip -#if 0 +#ifdef ONSEAMSTUFF // if (ptri[i].facesfront) // { // D_PolysetRecursiveTriangle(index0->v, index1->v, index2->v); - movl mtri_facesfront-16(%ebx,%ebp,),%eax testl %eax,%eax jz Lfacesback #endif + pushl %edx pushl %esi pushl %ecx @@ -1207,7 +1202,8 @@ Llooptop: subl $16,%ebp jnz Llooptop jmp Ldone2 -#if 0 + +#ifdef ONSEAMSTUFF // } // else // { @@ -1266,10 +1262,8 @@ Lp13: movl %eax,fv_v+8(%ecx) // } - -#endif - // } +#endif Lskip: subl $16,%ebp jnz Llooptop @@ -1575,7 +1569,7 @@ C(D_DrawNonSubdiv): pushl %ebp // preserve caller stack frame pointer movl C(r_affinetridesc)+atd_numtriangles,%ebp pushl %ebx - shll $(mtri_shift),%ebp + shll $(mtri_shift), %ebp pushl %esi // preserve register variables movl C(r_affinetridesc)+atd_ptriangles,%esi pushl %edi @@ -1689,12 +1683,10 @@ LNDLoop: movl fv_v+16(%ebx),%eax movl fv_v+20(%ebx),%esi movl %eax,C(r_p2)+16 -#if 0 movl C(r_affinetridesc)+atd_ptriangles,%edi -#endif movl %esi,C(r_p2)+20 - -#if 0 + +#ifdef ONSEAMSTUFF movl mtri_facesfront-mtri_size(%edi,%ebp,1),%eax // if (!ptri->facesfront) @@ -1707,7 +1699,7 @@ LNDLoop: movl fv_flags(%ecx),%eax movl fv_flags(%edx),%esi movl fv_flags(%ebx),%edi - testl $(ALIAS_ONSEAM),%eax + testl $(ALIAS_ONSEAM),%eax movl C(r_affinetridesc)+atd_seamfixupX16,%eax jz LOnseamDone0 addl %eax,C(r_p0)+8 @@ -1726,10 +1718,10 @@ LOnseamDone1: jz LOnseamDone2 addl %eax,C(r_p2)+8 LOnseamDone2: - // } LFacesFront: + #endif fstps C(d_xdenom) @@ -1741,7 +1733,7 @@ LFacesFront: LNextTri: movl C(r_affinetridesc)+atd_ptriangles,%esi - subl $16,%ebp + subl $(mtri_size),%ebp jnz LNDLoop // } diff --git a/engine/sw/d_polyse.c b/engine/sw/d_polyse.c index 9641454e3..3e38949f1 100644 --- a/engine/sw/d_polyse.c +++ b/engine/sw/d_polyse.c @@ -22,10 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //changes include stvertexes now being seperatly number from the triangles. //this allows q2 models to be supported. -#ifndef NOASM -#define NOASM -#endif - #include "quakedef.h" #include "r_local.h" #include "d_local.h" diff --git a/engine/sw/r_alias.c b/engine/sw/r_alias.c index 26f5c3a1e..cf01dfe09 100644 --- a/engine/sw/r_alias.c +++ b/engine/sw/r_alias.c @@ -26,9 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //future aims include better skin management. //the asm code cannot handle alias models anymore. -#ifndef NOASM -#define NOASM -#endif #include "quakedef.h" #include "r_local.h" @@ -513,7 +510,7 @@ void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av, } -#if 1 //!id386 since stvert_t was changed. +#if !id386 //since stvert_t was changed. /* ================ diff --git a/engine/sw/r_aliasa.s b/engine/sw/r_aliasa.s index 34a2e1806..b3bca82d6 100644 --- a/engine/sw/r_aliasa.s +++ b/engine/sw/r_aliasa.s @@ -27,8 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "asm_draw.h" #include "d_ifacea.h" -//FIXME: rework the changes to stvert_t in. -#if 0//id386 +#if id386 .data @@ -39,15 +38,11 @@ Lcoords: .long 0, 0, 0 .text #define fv 12+4 -#if 0 #define pstverts 12+8 -#endif .globl C(R_AliasTransformAndProjectFinalVerts) C(R_AliasTransformAndProjectFinalVerts): -#if 0 pushl %ebp // preserve caller's stack frame -#endif pushl %edi pushl %esi // preserve register variables @@ -55,14 +50,12 @@ C(R_AliasTransformAndProjectFinalVerts): // float lightcos, *plightnormal, zi; // trivertx_t *pverts; -// pverts = r_apverts; +// pverts = r_apnewverts; movl C(r_apnewverts),%esi -// for (i=0 ; iv[2] = pstverts->s; // fv->v[3] = pstverts->t; // fv->flags = pstverts->onseam; - movl stv_onseam(%ebp),%eax - movl %eax,fv_flags(%edi) +// movl stv_onseam(%ebp),%eax +// movl %eax,fv_flags(%edi) movl fv_size(%edi),%eax movl stv_size(%ebp),%eax @@ -120,7 +112,7 @@ Lloop: leal (%edx,%edx,2),%eax // index*3 fxch %st(3) // v[0] | v[2] | v[1] | zi -#endif + // lightcos = DotProduct (plightnormal, r_plightvec); flds C(r_avertexnormals)(,%eax,4) fmuls C(r_plightvec) @@ -234,9 +226,7 @@ Lp1: popl %esi // restore register variables popl %edi -#if 0 -// popl %ebp // restore the caller's stack frame -#endif + popl %ebp // restore the caller's stack frame ret Lsavelight: