1
0
Fork 0
forked from fte/fteqw

Add the n64 texinfo flags from the q2 remaster.

This commit is contained in:
Shpoike 2023-09-02 06:42:06 +01:00
parent f4330d765d
commit 9c96ab9b31
5 changed files with 29 additions and 2 deletions

View file

@ -649,6 +649,12 @@ typedef struct
//#define TI_KINGPIN_WNDW33 0x4000 //#define TI_KINGPIN_WNDW33 0x4000
//#define TI_KINGPIN_WNDW64 0x8000 //#define TI_KINGPIN_WNDW64 0x8000
#define TI_Q2EX_ALPHATEST (1u<<25)
#define TI_N64_UV (1u<<28)
#define TI_N64_SCROLL_X (1u<<29)
#define TI_N64_SCROLL_Y (1u<<30)
#define TI_N64_SCROLL_FLIP (1u<<31)
//Surface flags //Surface flags
//#define Q3SURFACEFLAG_NODAMAGE 0x1 // never give falling damage //#define Q3SURFACEFLAG_NODAMAGE 0x1 // never give falling damage
//#define Q3SURFACEFLAG_SLICK 0x2 // effects game physics //#define Q3SURFACEFLAG_SLICK 0x2 // effects game physics

View file

@ -1428,7 +1428,7 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname,
if (wal->offsets[0]) if (wal->offsets[0])
base = R_LoadReplacementTexture(wal->name, "bmodels", imageflags, (qbyte *)wal+wal->offsets[0], wal->width, wal->height, TF_SOLID8); base = R_LoadReplacementTexture(wal->name, "bmodels", imageflags, (qbyte *)wal+wal->offsets[0], wal->width, wal->height, TF_SOLID8);
else else
base = R_LoadReplacementTexture(wal->name, "bmodels", imageflags, NULL, 0, 0, TF_INVALID); base = R_LoadHiResTexture(wal->name, "bmodels", imageflags);
} }
else else
base = NULL; base = NULL;
@ -1529,11 +1529,20 @@ static qboolean CModQ2_LoadTexInfo (model_t *mod, qbyte *mod_base, lump_t *l, ch
Q_strncatz(sname, "#WARP", sizeof(sname)); Q_strncatz(sname, "#WARP", sizeof(sname));
if (out->flags & TI_FLOWING) if (out->flags & TI_FLOWING)
Q_strncatz(sname, "#FLOW", sizeof(sname)); Q_strncatz(sname, "#FLOW", sizeof(sname));
if (out->flags & (TI_N64_SCROLL_X | TI_N64_SCROLL_Y | TI_N64_SCROLL_FLIP))
{
Q_snprintfz(sname+strlen(sname), sizeof(sname)-strlen(sname), "#FLOWV=%s%s,%s%s",
(out->flags&TI_N64_SCROLL_FLIP)?"":"-",
(out->flags&TI_N64_SCROLL_X)?"1.0":"0.0",
(out->flags&TI_N64_SCROLL_FLIP)?"-":"",
(out->flags&TI_N64_SCROLL_Y)?"1.0":"0.0"
);
}
if (out->flags & TI_TRANS66) if (out->flags & TI_TRANS66)
Q_strncatz(sname, "#ALPHA=0.66", sizeof(sname)); Q_strncatz(sname, "#ALPHA=0.66", sizeof(sname));
else if (out->flags & TI_TRANS33) else if (out->flags & TI_TRANS33)
Q_strncatz(sname, "#ALPHA=0.33", sizeof(sname)); Q_strncatz(sname, "#ALPHA=0.33", sizeof(sname));
else if (out->flags & TI_KINGPIN_ALPHATEST) //kingpin... else if (out->flags & (TI_KINGPIN_ALPHATEST|TI_Q2EX_ALPHATEST)) //kingpin...
Q_strncatz(sname, "#MASK=0.666#MASKLT", sizeof(sname)); Q_strncatz(sname, "#MASK=0.666#MASKLT", sizeof(sname));
else if (out->flags & (TI_WARP)) else if (out->flags & (TI_WARP))
Q_strncatz(sname, "#ALPHA=1", sizeof(sname)); Q_strncatz(sname, "#ALPHA=1", sizeof(sname));

View file

@ -2556,6 +2556,12 @@ void ModQ1_Batches_BuildQ1Q2Poly(model_t *mod, msurface_t *surf, builddata_t *co
mesh->st_array[i][0] /= surf->texinfo->texture->vwidth; mesh->st_array[i][0] /= surf->texinfo->texture->vwidth;
if (surf->texinfo->texture->vheight) if (surf->texinfo->texture->vheight)
mesh->st_array[i][1] /= surf->texinfo->texture->vheight; mesh->st_array[i][1] /= surf->texinfo->texture->vheight;
if (surf->texinfo->flags & TI_N64_UV)
{
mesh->st_array[i][0] /= 2;
mesh->st_array[i][1] /= 2;
}
} }
if (flmv) if (flmv)

View file

@ -78,6 +78,9 @@ void main ()
invsurface = mat3(v_svector, v_tvector, v_normal); invsurface = mat3(v_svector, v_tvector, v_normal);
#endif #endif
tc = v_texcoord; tc = v_texcoord;
#ifdef FLOWV
tc.st += e_time * vec2(FLOWV);
#endif
#ifdef FLOW #ifdef FLOW
tc.s += e_time * -0.5; tc.s += e_time * -0.5;
#endif #endif

View file

@ -17,6 +17,9 @@ varying vec2 lm0;
void main () void main ()
{ {
tc = v_texcoord.st; tc = v_texcoord.st;
#ifdef FLOWV
tc.st += e_time * vec2(FLOWV);
#endif
#ifdef FLOW #ifdef FLOW
tc.s += e_time * -0.5; tc.s += e_time * -0.5;
#endif #endif