Skip to content

Commit

Permalink
mbspc * decompile brushes with texinfo -1 ZHLT optimisation, deduce c…
Browse files Browse the repository at this point in the history
…lip, AAATRIGGER, NULL textures
  • Loading branch information
Garux committed Dec 20, 2024
1 parent d6cbd7e commit 79b9b69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/changelog-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
11 changes: 11 additions & 0 deletions tools/mbspc/mbspc/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
12 changes: 8 additions & 4 deletions tools/mbspc/mbspc/map_hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit 79b9b69

Please sign in to comment.