Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2016 06:41:55 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r412156 - in head/games: . zhlt zhlt/files
Message-ID:  <201603300641.u2U6fthB036074@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Wed Mar 30 06:41:55 2016
New Revision: 412156
URL: https://svnweb.freebsd.org/changeset/ports/412156

Log:
  Add a port of Zoner's Half-Life compile tools, which offer many improvements
  over the original map compiling tools for Half-Life.
  
  WWW: http://zhlt.info/

Added:
  head/games/zhlt/
  head/games/zhlt/Makefile   (contents, props changed)
  head/games/zhlt/distinfo   (contents, props changed)
  head/games/zhlt/files/
  head/games/zhlt/files/Makefile   (contents, props changed)
  head/games/zhlt/files/patch-common_bspfile.h   (contents, props changed)
  head/games/zhlt/files/patch-common_cmdlib.cpp   (contents, props changed)
  head/games/zhlt/files/patch-common_mathlib.h   (contents, props changed)
  head/games/zhlt/files/patch-common_win32fix.h   (contents, props changed)
  head/games/zhlt/files/patch-hlrad_mathutil.cpp   (contents, props changed)
  head/games/zhlt/pkg-descr   (contents, props changed)
Modified:
  head/games/Makefile

Modified: head/games/Makefile
==============================================================================
--- head/games/Makefile	Wed Mar 30 05:57:42 2016	(r412155)
+++ head/games/Makefile	Wed Mar 30 06:41:55 2016	(r412156)
@@ -1194,6 +1194,7 @@
     SUBDIR += zatacka
     SUBDIR += zaz
     SUBDIR += zephulor
+    SUBDIR += zhlt
     SUBDIR += znibbles
     SUBDIR += zoom
     SUBDIR += ztrack

Added: head/games/zhlt/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/Makefile	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,32 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	zhlt
+PORTVERSION=	3.4
+CATEGORIES=	games devel
+MASTER_SITES=	http://downloads.ammahls.com/zhlt/Old%20SDK%20Code/
+DISTNAME=	${PORTNAME}${PORTVERSION:S/.//}f-src
+
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Zoner's Half-Life compile tools
+
+USES=		dos2unix zip
+DOS2UNIX_FILES=	common/bspfile.h common/cmdlib.cpp common/mathlib.h \
+		common/win32fix.h hlrad/mathutil.cpp
+
+MAKEFILE=	${FILESDIR}/Makefile
+NO_WRKSUBDIR=	yes
+
+PLIST_FILES=	bin/hlbsp bin/hlcsg bin/hlrad bin/hlvis bin/ripent
+
+post-patch:
+	@${REINPLACE_CMD} -E 's,(min|max)\(,std::&,g' \
+		${WRKSRC}/common/boundingbox.h \
+		${WRKSRC}/common/filelib.cpp \
+		${WRKSRC}/common/winding.cpp \
+		${WRKSRC}/hlrad/lightmap.cpp \
+		${WRKSRC}/hlvis/flow.cpp
+	@${REINPLACE_CMD} -e 's,min(32,&L,' \
+		${WRKSRC}/common/filelib.cpp
+
+.include <bsd.port.mk>

Added: head/games/zhlt/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/distinfo	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,2 @@
+SHA256 (zhlt34f-src.zip) = 17cce9227f825498f0ce2ba7a55a5f28229eedf9609aa59c029d533f6facab39
+SIZE (zhlt34f-src.zip) = 519205

Added: head/games/zhlt/files/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/Makefile	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,79 @@
+CPPFLAGS+=	-DSYSTEM_POSIX -DSTDC_HEADERS -DHAVE_SYS_RESOURCE_H \
+		-DHAVE_SYS_STAT_H -DHAVE_SYS_TIME_H \
+		-DHAVE_FCNTL_H -DHAVE_UNISTD_H -DDOUBLEVEC_T
+CXXFLAGS+=	-Wall -Wextra
+
+common_OBJS=	common/blockmem.o \
+		common/bspfile.o \
+		common/cmdlib.o \
+		common/filelib.o \
+		common/files.o \
+		common/log.o \
+		common/mathlib.o \
+		common/messages.o \
+		common/resourcelock.o \
+		common/scriplib.o \
+		common/threads.o \
+		common/winding.o
+
+hlbsp_OBJ=	hlbsp/merge.o \
+		hlbsp/outside.o \
+		hlbsp/portals.o \
+		hlbsp/qbsp.o \
+		hlbsp/solidbsp.o \
+		hlbsp/surfaces.o \
+		hlbsp/tjunc.o \
+		hlbsp/writebsp.o
+
+hlcsg_OBJS=	hlcsg/autowad.o \
+		hlcsg/brush.o \
+		hlcsg/brushunion.o \
+		hlcsg/hullfile.o \
+		hlcsg/map.o \
+		hlcsg/netvis_in_vis.o \
+		hlcsg/properties.o \
+		hlcsg/qcsg.o \
+		hlcsg/textures.o \
+		hlcsg/wadcfg.o \
+		hlcsg/wadinclude.o \
+		hlcsg/wadpath.o
+
+hlrad_OBJS=	hlrad/lerp.o \
+		hlrad/lightmap.o \
+		hlrad/mathutil.o \
+		hlrad/nomatrix.o \
+		hlrad/qrad.o \
+		hlrad/qradutil.o \
+		hlrad/sparse.o \
+		hlrad/trace.o \
+		hlrad/transfers.o \
+		hlrad/transparency.o \
+		hlrad/vismatrix.o \
+		hlrad/vismatrixutil.o
+
+hlvis_OBJS=	hlvis/flow.o \
+		hlvis/vis.o \
+		hlvis/zones.o
+
+ripent_OBJS=	ripent/ripent.o
+
+PROGS=		hlbsp/hlbsp hlcsg/hlcsg hlrad/hlrad hlvis/hlvis ripent/ripent
+
+.cpp.o:
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< -Icommon -Itemplate
+
+all: $(PROGS)
+
+hlbsp/hlbsp: $(common_OBJS) $(hlbsp_OBJ)
+hlcsg/hlcsg: $(common_OBJS) $(hlcsg_OBJS)
+hlrad/hlrad: $(common_OBJS) $(hlrad_OBJS)
+hlvis/hlvis: $(common_OBJS) $(hlvis_OBJS)
+ripent/ripent: $(common_OBJS) $(ripent_OBJS)
+
+$(PROGS):
+	$(CXX) $(LDFLAGS) -o $@ $> -lpthread
+
+install: $(PROGS)
+	$(BSD_INSTALL_PROGRAM) $> $(DESTDIR)$(PREFIX)/bin
+
+.PHONY: all install

Added: head/games/zhlt/files/patch-common_bspfile.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/patch-common_bspfile.h	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,11 @@
+--- common/bspfile.h.orig	2016-03-30 06:24:01 UTC
++++ common/bspfile.h
+@@ -155,7 +155,7 @@ dvertex_t;
+ 
+ typedef struct
+ {
+-    float           normal[3];
++    vec3_t          normal;
+     float           dist;
+     planetypes      type;                                  // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
+ }

Added: head/games/zhlt/files/patch-common_cmdlib.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/patch-common_cmdlib.cpp	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,30 @@
+--- common/cmdlib.cpp.orig	2016-03-30 06:24:01 UTC
++++ common/cmdlib.cpp
+@@ -13,6 +13,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_TIME_H
++#include <sys/time.h>
++#endif
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -21,6 +24,8 @@
+ #endif
+ #endif
+ 
++#include <algorithm>
++
+ #define PATHSEPARATOR(c) ((c) == '\\' || (c) == '/')
+ 
+ /*
+@@ -128,7 +133,7 @@ inline void getFilePositions(char* path,
+ 	else
+ 	{ *extension_position = ptr - path; }
+ 
+-	ptr = max(strrchr(path,'/'),strrchr(path,'\\'));
++	ptr = std::max(strrchr(path,'/'),strrchr(path,'\\'));
+ 	if(ptr == 0)
+ 	{ *directory_position = -1; }
+ 	else

Added: head/games/zhlt/files/patch-common_mathlib.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/patch-common_mathlib.h	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,46 @@
+--- common/mathlib.h.orig	2016-03-30 06:24:01 UTC
++++ common/mathlib.h
+@@ -12,20 +12,13 @@
+ #endif
+ 
+ #ifdef STDC_HEADERS
++#include <sys/limits.h>
+ #include <math.h>
+ #include <float.h>
+ #endif
+ 
+ #include <algorithm>
+ 
+-#if !defined(max) 
+-#define max(a,b)            (((a) > (b)) ? (a) : (b))
+-#endif
+-
+-#if !defined(min)
+-#define min(a,b)            (((a) < (b)) ? (a) : (b))
+-#endif
+-
+ #define	Q_PI	3.14159265358979323846
+ 
+ extern const vec3_t vec3_origin;
+@@ -71,8 +64,8 @@ extern const vec3_t vec3_origin;
+ #define VectorCopy(a,b) { (b)[0]=(a)[0]; (b)[1]=(a)[1]; (b)[2]=(a)[2]; }
+ #define VectorClear(a)  { (a)[0] = (a)[1] = (a)[2] = 0.0; }
+ 
+-#define VectorMaximum(a) ( max( (a)[0], max( (a)[1], (a)[2] ) ) )
+-#define VectorMinimum(a) ( min( (a)[0], min( (a)[1], (a)[2] ) ) )
++#define VectorMaximum(a) ( std::max( (a)[0], std::max( (a)[1], (a)[2] ) ) )
++#define VectorMinimum(a) ( std::min( (a)[0], std::min( (a)[1], (a)[2] ) ) )
+ 
+ #define VectorInverse(a) \
+ { \
+@@ -88,8 +81,8 @@ extern const vec3_t vec3_origin;
+     (dest)[2] = (a)[2] + scale * (b)[2]; \
+ }
+ #define VectorLength(a)  sqrt((double) ((double)((a)[0] * (a)[0]) + (double)( (a)[1] * (a)[1]) + (double)( (a)[2] * (a)[2])) )
+-#define VectorCompareMinimum(a,b,c) { (c)[0] = min((a)[0], (b)[0]); (c)[1] = min((a)[1], (b)[1]); (c)[2] = min((a)[2], (b)[2]); }
+-#define VectorCompareMaximum(a,b,c) { (c)[0] = max((a)[0], (b)[0]); (c)[1] = max((a)[1], (b)[1]); (c)[2] = max((a)[2], (b)[2]); }
++#define VectorCompareMinimum(a,b,c) { (c)[0] = std::min((a)[0], (b)[0]); (c)[1] = std::min((a)[1], (b)[1]); (c)[2] = std::min((a)[2], (b)[2]); }
++#define VectorCompareMaximum(a,b,c) { (c)[0] = std::max((a)[0], (b)[0]); (c)[1] = std::max((a)[1], (b)[1]); (c)[2] = std::max((a)[2], (b)[2]); }
+ 
+ inline vec_t   VectorNormalize(vec3_t v)
+ {

Added: head/games/zhlt/files/patch-common_win32fix.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/patch-common_win32fix.h	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,31 @@
+--- common/win32fix.h.orig	2016-03-30 06:24:01 UTC
++++ common/win32fix.h
+@@ -5,7 +5,7 @@
+ #pragma once
+ #endif
+ 
+-#include <malloc.h>
++#include <stdlib.h>
+ 
+ /////////////////////////////
+ #ifdef SYSTEM_WIN32
+@@ -50,6 +50,19 @@
+ 
+ #define INLINE inline
+ 
++#define _close close
++#define _open open
++#define _read read
++#define _strdup strdup
++#define _strlwr strlwr
++#define _strupr strupr
++#define _unlink unlink
++
++#define fscanf_s fscanf
++#define sprintf_s(str, ...) snprintf(str, sizeof(str), __VA_ARGS__)
++#define sscanf_s sscanf
++#define strcpy_s(dst, src) strlcpy(dst, src, sizeof(dst))
++
+ #endif
+ /////////////////////////////
+ 

Added: head/games/zhlt/files/patch-hlrad_mathutil.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/files/patch-hlrad_mathutil.cpp	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,54 @@
+--- hlrad/mathutil.cpp.orig	2016-03-30 06:24:01 UTC
++++ hlrad/mathutil.cpp
+@@ -20,7 +20,7 @@ inline bool PointInEdge(const vec_t* con
+ // PointInWall - check a lerpWall_t boundary
+ //===============================================
+ 
+-inline bool PointInWall(const lerpWall_t* const wall, const vec_t* const point)
++bool PointInWall(const lerpWall_t* const wall, const vec_t* const point)
+ {
+ 	for(int counter = 0; counter < NUM_LERP_POINTS; counter++)
+ 	{
+@@ -49,7 +49,7 @@ inline bool PointInWinding(const Winding
+ // PointInTri - check a boundary defined by 3 points
+ //==================================================
+ 
+-inline bool PointInTri(const vec_t* const point, const dplane_t* const plane, const vec_t* const p1, const vec_t* const p2, const vec_t* const p3)
++bool PointInTri(const vec_t* const point, const dplane_t* const plane, const vec_t* const p1, const vec_t* const p2, const vec_t* const p3)
+ {
+ 	return (PointInEdge(point,p1,p2,plane->normal) && PointInEdge(point,p2,p3,plane->normal) && PointInEdge(point,p3,p1,plane->normal));
+ }
+@@ -131,7 +131,7 @@ inline bool LineSegmentIntersectsFace(co
+ // point in point parameter if it exists
+ //==================================================
+ 
+-inline bool LineSegmentIntersectsPlane(const dplane_t& plane, const vec_t* const p1, const vec_t* const p2, vec3_t& point)
++bool LineSegmentIntersectsPlane(const dplane_t& plane, const vec_t* const p1, const vec_t* const p2, vec3_t& point)
+ {
+ 	vec3_t line;
+ 	VectorSubtract(p2,p1,line);
+@@ -156,7 +156,7 @@ inline bool LineSegmentIntersectsPlane(c
+ // PlaneFromPoints
+ //==================================================
+ 
+-inline void PlaneFromPoints(const vec_t* const p1, const vec_t* const p2, const vec_t* const p3, dplane_t* plane)
++void PlaneFromPoints(const vec_t* const p1, const vec_t* const p2, const vec_t* const p3, dplane_t* plane)
+ {
+ 	vec3_t	temp, temp2;
+ 	VectorSubtract(p3,p2,temp);
+@@ -170,7 +170,7 @@ inline void PlaneFromPoints(const vec_t*
+ // SnapToPlane
+ //==================================================
+ 
+-inline void SnapToPlane(const dplane_t* const plane, vec_t* const point, const vec_t offset)
++void SnapToPlane(const dplane_t* const plane, vec_t* const point, const vec_t offset)
+ {
+ 	vec_t scale = (plane->dist + offset);
+ 	scale -= DotProduct(plane->normal,point);
+@@ -243,4 +243,4 @@ int TestSegmentAgainstOpaqueList(const v
+ 	}
+ #endif
+     return -1; //not completely blocked
+-}
+\ No newline at end of file
++}

Added: head/games/zhlt/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/zhlt/pkg-descr	Wed Mar 30 06:41:55 2016	(r412156)
@@ -0,0 +1,11 @@
+Zoner's Half-Life compile tools offer many improvements over the original
+map compiling tools for Half-Life, such as better lighting quality, faster
+vis times, switchable texture based lighting, support for brush entities
+casting shadows, removal of "sticky" edges, support for 64-bit processors,
+and much more.
+
+Please note that these tools are for use with the Half-Life 1 engine (also
+known as GoldSrc or GoldSource), not for the Source Engine used in Half-
+Life 2.  For the Source Engine, refer to Custom Source Tools (CST).
+
+WWW: http://zhlt.info/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603300641.u2U6fthB036074>