diff --git a/engine/common/bspfile.h b/engine/common/bspfile.h index 87f417e78..ee6dab1ae 100644 --- a/engine/common/bspfile.h +++ b/engine/common/bspfile.h @@ -649,6 +649,12 @@ typedef struct //#define TI_KINGPIN_WNDW33 0x4000 //#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 //#define Q3SURFACEFLAG_NODAMAGE 0x1 // never give falling damage //#define Q3SURFACEFLAG_SLICK 0x2 // effects game physics diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 3146a4522..d3916e07d 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -1428,7 +1428,7 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname, if (wal->offsets[0]) base = R_LoadReplacementTexture(wal->name, "bmodels", imageflags, (qbyte *)wal+wal->offsets[0], wal->width, wal->height, TF_SOLID8); else - base = R_LoadReplacementTexture(wal->name, "bmodels", imageflags, NULL, 0, 0, TF_INVALID); + base = R_LoadHiResTexture(wal->name, "bmodels", imageflags); } else 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)); if (out->flags & TI_FLOWING) 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) Q_strncatz(sname, "#ALPHA=0.66", sizeof(sname)); else if (out->flags & TI_TRANS33) 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)); else if (out->flags & (TI_WARP)) Q_strncatz(sname, "#ALPHA=1", sizeof(sname)); diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index cd2a6782d..32e119e08 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -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; if (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) diff --git a/engine/shaders/glsl/defaultwall.glsl b/engine/shaders/glsl/defaultwall.glsl index 99e9f6807..60a296903 100644 --- a/engine/shaders/glsl/defaultwall.glsl +++ b/engine/shaders/glsl/defaultwall.glsl @@ -78,6 +78,9 @@ void main () invsurface = mat3(v_svector, v_tvector, v_normal); #endif tc = v_texcoord; +#ifdef FLOWV + tc.st += e_time * vec2(FLOWV); +#endif #ifdef FLOW tc.s += e_time * -0.5; #endif diff --git a/engine/shaders/glsl/defaultwarp.glsl b/engine/shaders/glsl/defaultwarp.glsl index c74a5d558..69eaaad99 100644 --- a/engine/shaders/glsl/defaultwarp.glsl +++ b/engine/shaders/glsl/defaultwarp.glsl @@ -17,6 +17,9 @@ varying vec2 lm0; void main () { tc = v_texcoord.st; + #ifdef FLOWV + tc.st += e_time * vec2(FLOWV); + #endif #ifdef FLOW tc.s += e_time * -0.5; #endif