diff --git a/docs/changelog-custom.txt b/docs/changelog-custom.txt index 37ed74ab..0e9ca681 100644 --- a/docs/changelog-custom.txt +++ b/docs/changelog-custom.txt @@ -197,6 +197,7 @@ MBSPC: * improve decompilation quality of Q1, HL maps greatly (texturing correctness, less brushes) * -lessbrushes switch: less brushes when decompiling Q1, HL maps at the expense of texturing * fix build speed penalty due to terminal output + * decompile brushes with texinfo -1 ZHLT optimisation, deduce clip, AAATRIGGER, NULL textures diff --git a/tools/mbspc/mbspc/map.c b/tools/mbspc/mbspc/map.c index 4832f1ce..091358b7 100644 --- a/tools/mbspc/mbspc/map.c +++ b/tools/mbspc/mbspc/map.c @@ -803,6 +803,13 @@ qboolean WriteMapBrush(FILE *fp, mapbrush_t *brush, vec3_t origin) fprintf(fp, "clip"); } } + else if(loadedmaptype == MAPTYPE_HALFLIFE) + { + if(!Q_strncasecmp(ValueForKey(&entities[brush->entitynum], "classname"), "trigger_", 8)) + fprintf(fp, "AAATRIGGER"); + else + fprintf(fp, "NULL"); + } else { fprintf(fp, "clip"); @@ -1062,6 +1069,10 @@ qboolean WriteMapFileSafe(FILE *fp) { fprintf(fp, "// generic/misc/red is used for unknown textures\n"); } + if (loadedmaptype == MAPTYPE_HALFLIFE) + { + fprintf(fp, "// NULL is used for unknown textures\n"); + } fprintf(fp, "//\n" "//=====================================================\n"); diff --git a/tools/mbspc/mbspc/map_hl.c b/tools/mbspc/mbspc/map_hl.c index 4cf1ca20..52846a98 100644 --- a/tools/mbspc/mbspc/map_hl.c +++ b/tools/mbspc/mbspc/map_hl.c @@ -363,9 +363,6 @@ bspbrush_t *HL_CreateBrushes_r(bspbrush_t *brush, int nodenum) return NULL; } //end case case HL_CONTENTS_SOLID: -#ifdef HLCONTENTS - case HL_CONTENTS_CLIP: -#endif //HLCONTENTS case HL_CONTENTS_SKY: #ifdef HLCONTENTS case HL_CONTENTS_TRANSLUCENT: @@ -374,6 +371,13 @@ bspbrush_t *HL_CreateBrushes_r(bspbrush_t *brush, int nodenum) brush->side = CONTENTS_SOLID; return brush; } //end case +#ifdef HLCONTENTS + case HL_CONTENTS_CLIP: + { + brush->side = CONTENTS_PLAYERCLIP; + return brush; + } //end case +#endif //HLCONTENTS case HL_CONTENTS_WATER: { brush->side = CONTENTS_WATER; @@ -988,7 +992,7 @@ void HL_BSPBrushToMapBrush(bspbrush_t *bspbrush, entity_t *mapent) mapbrush->numsides++; } //end for // - if (besttexinfo == TEXINFO_NODE) + if (besttexinfo == TEXINFO_NODE && !(bspbrush->side & (CONTENTS_SOLID | CONTENTS_PLAYERCLIP))) { mapbrush->numsides = 0; hl_numclipbrushes++;