Index: cl_ents.c =================================================================== --- cl_ents.c (revision 3813) +++ cl_ents.c (working copy) @@ -498,6 +498,11 @@ } #ifdef PROTOCOL_VERSION_FTE +#ifdef FTE_PEXT_TRANS + if (morebits & U_FTE_TRANS && cls.fteprotocolextensions & FTE_PEXT_TRANS) + to->trans = MSG_ReadByte(); +#endif + #ifdef FTE_PEXT_ENTITYDBL if (morebits & U_FTE_ENTITYDBL) to->number += 512; @@ -969,7 +974,12 @@ VectorInterpolate(cent->old_origin, lerp, cent->current.origin, ent.origin); } } - + +#ifdef FTE_PEXT_TRANS + //set trans + ent.alpha = state->trans/255.0; +#endif + if (ent.model->flags & EF_ROTATE) { ent.angles[0] = ent.angles[2] = 0; @@ -1921,6 +1931,13 @@ else state->weaponframe = 0; + + state->alpha = 255; +#ifdef FTE_PEXT_TRANS + if (flags & PF_TRANS_Z && cls.fteprotocolextensions & FTE_PEXT_TRANS) + state->alpha = MSG_ReadByte(); +#endif + if (cl.z_ext & Z_EXT_PM_TYPE) { pm_code = (flags >> PF_PMC_SHIFT) & PF_PMC_MASK; Index: cl_main.c =================================================================== --- cl_main.c (revision 3813) +++ cl_main.c (working copy) @@ -543,6 +543,9 @@ #ifdef FTE_PEXT_ACCURATETIMINGS fteprotextsupported |= FTE_PEXT_ACCURATETIMINGS; #endif +#ifdef FTE_PEXT_TRANS + fteprotextsupported |= FTE_PEXT_TRANS; +#endif #ifdef FTE_PEXT_CHUNKEDDOWNLOADS if (cl_pext_chunkeddownloads.value) fteprotextsupported |= FTE_PEXT_CHUNKEDDOWNLOADS; @@ -607,6 +610,7 @@ { char tmp[128]; snprintf(tmp, sizeof(tmp), "0x%x 0x%x\n", PROTOCOL_VERSION_FTE, cls.fteprotocolextensions); + Con_Printf( "0x%x is fte protocol ver and 0x%x is fteprotocolextensions\n", PROTOCOL_VERSION_FTE, cls.fteprotocolextensions); strlcat(data, tmp, sizeof(data)); } #endif // PROTOCOL_VERSION_FTE Index: client.h =================================================================== --- client.h (revision 3813) +++ client.h (working copy) @@ -77,6 +77,8 @@ int flags; // Dead, gib, etc. + byte alpha; + byte vw_index; byte pm_type; float waterjumptime; Index: common.h =================================================================== --- common.h (revision 3813) +++ common.h (working copy) @@ -45,7 +45,7 @@ #define CL_MAX_EDICTS 2048 // FIXME: ouch! ouch! ouch! //#define SV_MAX_EDICTS 1024 // FIXME: ouch! ouch! ouch! #define MAX_EDICTS 512 // FIXME: ouch! ouch! ouch! - trying to fix... -#define MAX_LIGHTSTYLES 64 +#define MAX_LIGHTSTYLES 256 #define MAX_MODELS 512 // these are sent over the net as bytes #define MAX_VWEP_MODELS 32 // could be increased to 256 #define MAX_SOUNDS 256 // so they cannot be blindly increased Index: d_init.c =================================================================== --- d_init.c (revision 3813) +++ d_init.c (working copy) @@ -69,6 +69,10 @@ Cvar_ResetCurrentGroup(); r_aliasuvscale = 1.0; + +#ifdef FTE_PEXT_TRANS + D_InitTrans(); +#endif } void D_EnableBackBufferAccess (void) { Index: d_local.h =================================================================== --- d_local.h (revision 3813) +++ d_local.h (working copy) @@ -104,3 +104,47 @@ extern float d_scalemip[3]; extern void (*d_drawspans) (espan_t *pspan); + +#ifdef FTE_PEXT_TRANS +#define PAL555_SIZE 32*32*32 +#define TRANS_LEVELS 65 +#define TRANS_MAX (TRANS_LEVELS - 1) + +#define TRANS_UPPER_CAP (TRANS_MAX / (TRANS_LEVELS + 0.0)) +#define TRANS_LOWER_CAP (1.0 / TRANS_LEVELS) + +#define REMAP_MAX 64 + +// palette remap cache +typedef struct palremap_s { + int r; + int g; + int b; + int key; + int references; + qbyte pal[256]; +} palremap_t; + +palremap_t *palremaps; +int palremapsize; + +#define fbremapidx(x) palremaps[1].pal[x] + +#define identityremap palremaps[0] +#define fullbrightremap palremaps[1] + +palremap_t *D_GetPaletteRemap(int red, int green, int blue, qboolean desaturate, qboolean fullbrights, int topcolor, int bottomcolor); +qbyte *D_GetMenuTintPal(void); +struct palremap_s *D_IdentityRemap(void); +void D_DereferenceRemap(palremap_t *palremap); + +void D_InitTrans(void); +// void Set_TransLevelI(int level); +void D_SetTransLevel(float level, blendmode_t blend); +extern qbyte Trans(qbyte p, qbyte p2); +extern qbyte AddBlend(qbyte p, qbyte p2); + +extern qbyte *pal555to8; + +void D_ShutdownTrans(void); +#endif \ No newline at end of file Index: d_polyse.c =================================================================== --- d_polyse.c (revision 3813) +++ d_polyse.c (working copy) @@ -198,6 +198,19 @@ ptri = r_affinetridesc.ptriangles; lnumtriangles = r_affinetridesc.numtriangles; +#ifdef FTE_PEXT_TRANS + if (transbackfac) + { + if (r_pixbytes == 4) + drawfnc = D_PolysetRecursiveTriangle32Trans; + else if (r_pixbytes == 2) + drawfnc = D_PolysetRecursiveTriangle16C; + else //if (r_pixbytes == 1) + drawfnc = D_PolysetRecursiveTriangleTrans; + } + else +#endif + for (i=0 ; iorigin, clmodel->radius)) return; + if (e->alpha) { + glEnable (GL_BLEND); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glColor4f (1, 1, 1, e->alpha); + } else { + glColor3f (1,1,1); + } } else { rotated = false; VectorAdd (e->origin, clmodel->mins, mins); @@ -1147,6 +1154,14 @@ if (R_CullBox (mins, maxs)) return; + + if (e->alpha) { + glEnable (GL_BLEND); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glColor4f (1, 1, 1, e->alpha); + } else { + glColor3f (1,1,1); + } } VectorSubtract (r_refdef.vieworg, e->origin, modelorg); Index: protocol.h =================================================================== --- protocol.h (revision 3813) +++ protocol.h (working copy) @@ -31,6 +31,7 @@ // qqshka: FTE_PEXT_ACCURATETIMINGS - not actually used in ezquake. // I added it to ezquake in hope what someone made some rockets(enitities) smoothing code... // But it not happens, so better turn it off. +#define FTE_PEXT_TRANS 0x00000008 // .alpha support //#define FTE_PEXT_ACCURATETIMINGS 0x00000040 #define FTE_PEXT_HLBSP 0x00000200 //stops fte servers from complaining #define FTE_PEXT_MODELDBL 0x00001000 @@ -285,6 +286,9 @@ #ifdef FTE_PEXT_TRANS #define U_FTE_TRANS (1<<1) //transparency value #endif +#ifdef FTE_PEXT_TRANS +#define PF_TRANS_Z (1<<17) +#endif #ifdef FTE_PEXT_FATNESS #define U_FTE_FATNESS (1<<2) //byte describing how fat an alias model should be. //moves verticies along normals @@ -372,6 +376,7 @@ int colormap; int skinnum; int effects; + byte trans; } entity_state_t; #ifdef SERVERONLY