momentum-mod/BSPConvert

Add support for loading texture and lightmap coordinates from face primitives

Panzerhandschuh opened this issue · 0 comments

Add the following fields to the PRIMVERT lump:

struct dprimvert_t
{
	DECLARE_BYTESWAP_DATADESC();
	Vector		pos;
	float		texCoord[2];
	float		lightCoord[2];
};

Note: These changes will make the data structure identical to mprimvert_t, which is the version of primvert after it has been loaded into the engine.

Add PRIM_MESH type to the primitive type enum:

enum dprimitive_type
{
	PRIM_TRILIST=0,
	PRIM_TRISTRIP=1,
	PRIM_MESH=2
};

If the primitive type is set to PRIM_MESH, load face geometry using primitive data instead of surface edges. If the primitive type is set to TRILIST or TRISTRIP, ignore the new texCoord/lightCoord fields and load the primitives using the original code.