Asm rendering of alias models is back in now - and it works

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@833 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-26 17:16:08 +00:00
parent 8233e58472
commit 7dfa8ee86c
10 changed files with 43 additions and 63 deletions

View File

@ -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

View File

@ -256,7 +256,7 @@ void R_StoreEfrags (efrag_t **ppefrag)
entity_t *pent;
model_t *clmodel;
efrag_t *pefrag;
return;
while ((pefrag = *ppefrag) != NULL)
{

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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
// }

View File

@ -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"

View File

@ -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.
/*
================

View File

@ -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 ; i<r_anumverts ; i++, fv++, pverts++)
// for (i=0 ; i<r_anumverts ; i++, fv++, pverts++, pstverts++)
// {
#if 0
movl pstverts(%esp),%ebp
#endif
movl fv(%esp),%edi
movl C(r_anumverts),%ecx
subl %edx,%edx
@ -106,12 +99,11 @@ Lloop:
fdivrs Lfloat_1 // zi | v[2] | v[1] | v[0]
#if 0
// fv->v[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: