[model] Support the transparent texture marker

Textures whose names start with a { are meant to be rendered with
transparency. Surfaces using those textures are marked with
SURF_DRAWALPHA.

Unfortunately, the mip levels of ad_tears' transparent textures use the
wrong color so only the highest LOD works properly, but those textures
are meant to be loaded from external files anyway, it seems.
This commit is contained in:
Bill Currie 2022-05-27 08:07:50 +09:00
parent 1fa202608e
commit a936336e84
2 changed files with 22 additions and 18 deletions

View file

@ -103,13 +103,13 @@ typedef struct texture_s {
} texture_t;
#define SURF_PLANEBACK 0x02
#define SURF_DRAWSKY 0x04
#define SURF_DRAWTURB 0x08
#define SURF_DRAWSKY 0x01
#define SURF_DRAWALPHA 0x02
#define SURF_DRAWTURB 0x04
#define SURF_PLANEBACK 0x08
#define SURF_DRAWTILED 0x10
#define SURF_DRAWBACKGROUND 0x20
#define SURF_DRAWNOALPHA 0x40
#define SURF_LIGHTBOTHSIDES 0x80
#define SURF_LIGHTBOTHSIDES 0x40
// !!! if this is changed, it must be changed in asm_draw.h too !!!
typedef struct {

View file

@ -652,19 +652,23 @@ Mod_LoadFaces (model_t *mod, bsp_t *bsp)
continue;
}
if (out->texinfo->texture->name[0] == '*') { // turbulent
out->flags |= (SURF_DRAWTURB
| SURF_DRAWTILED
| SURF_LIGHTBOTHSIDES);
for (i = 0; i < 2; i++) {
out->extents[i] = 16384;
out->texturemins[i] = -8192;
}
if (mod_funcs && mod_funcs->Mod_SubdivideSurface) {
// cut up polygon for warps
mod_funcs->Mod_SubdivideSurface (mod, out);
}
continue;
switch (out->texinfo->texture->name[0]) {
case '*': // turbulent
out->flags |= (SURF_DRAWTURB
| SURF_DRAWTILED
| SURF_LIGHTBOTHSIDES);
for (i = 0; i < 2; i++) {
out->extents[i] = 16384;
out->texturemins[i] = -8192;
}
if (mod_funcs && mod_funcs->Mod_SubdivideSurface) {
// cut up polygon for warps
mod_funcs->Mod_SubdivideSurface (mod, out);
}
break;
case '{':
out->flags |= SURF_DRAWALPHA;
break;
}
}
}