Initial import of Red Planet v4.10 Win32 source

Imports the current Win32 source for the pod-racing game 'Red Planet',
built on the MUNGA engine and its L4 (Win32/DirectX) platform layer:

- MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend
- RP / RP_L4: Red Planet game logic and Win32 application
- DivLoader, Setup1: asset loader and installer project
- lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies

Removed stale Subversion metadata and added .gitignore/.gitattributes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-06-30 07:59:51 -05:00
co-authored by Claude Opus 4.8
commit 4abbf8879f
551 changed files with 254956 additions and 0 deletions
+172
View File
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="DivLoader"
ProjectGUID="{2742FFCF-E94C-4202-BB0E-36D86CD04A09}"
RootNamespace="DivLoader"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="..\lib"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\VGCDivLoader.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\tagIdents.h"
>
</File>
<File
RelativePath=".\VGCDivLoader.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
File diff suppressed because it is too large Load Diff
+240
View File
@@ -0,0 +1,240 @@
#pragma once
#include <iostream>
#include <functional>
#include <vector>
#include <map>
#include <hash_map>
#include <string>
#include <D3DX9.h>
#include <tchar.h>
#include "tagIdents.h"
using namespace std;
using namespace stdext;
enum FloatPrecision
{
PRECISION_32BIT,
PRECISION_64BIT
};
enum FileType
{
TYPE_GEOMETRY,
TYPE_MATERIAL,
TYPE_TEXTURE
};
enum Unit
{
UNIT_INCHES,
UNIT_MILLIMETERS
};
struct BIZ_IDENTTAG
{
unsigned short identity : 12;
unsigned short RESERVED : 1;
unsigned short configBit : 1;
unsigned short headerSize : 2;
};
struct HeaderInfo
{
char verMajor;
char verMinor;
char dateDay;
char dateMon;
char dateYear;
char timeHour;
char timeMin;
float scale;
FloatPrecision precision;
FileType type;
Unit unit;
};
struct DivVertex
{
char mask;
float x,y,z;
float Nx,Ny,Nz;
float r,g,b;
float l;
float a;
float u,v;
float w;
};
struct ConList
{
unsigned char sideCount;
int numIndices;
int *indices;
};
struct Triangle
{
int indices[3];
};
struct SurfaceProps
{
char *name;
char f_material_type;
char *f_material_name;
char b_material_type;//Slinky has too much comments
char *b_material_name;
char plane;
char drawmode;
char drawmode_width;
int decal_offset;
char faceted;
char vertex_mask;
char *specialInst;
char locks;
bool isImmune;
bool drawSpheres;
};
struct DivPatch
{
vector<Triangle> frontTriangles;
vector<Triangle> backTriangles;
SurfaceProps surface;
};
struct DivObject
{
char *objName;
vector<DivVertex> vertices;
vector<DivPatch*> patches;
};
struct DivMaterial
{
char *name;
unsigned char tex_type;
char *tex_name;
unsigned char env_type;
char *env_name;
float amb_r, amb_g, amb_b; //Ambient
float dif_r, dif_g, dif_b; //Diffuse
float spe_r, spe_g, spe_b, spe_p; //Specular
float emi_r, emi_g, emi_b; //Emissive
float opa_r, opa_g, opa_b; //Opacity
char *ramp_name;
bool isImmune;
};
struct RGBA
{
unsigned char r, g, b, a;
};
struct TexBuffer
{
int height, width;
RGBA **m_buffer;
};
struct DivTexture
{
char *name;
TexBuffer *texBuffer;
unsigned char minify;
unsigned char magnify;
unsigned char alpha;
unsigned char wrap_u;
unsigned char wrap_v;
unsigned char detail_type;
char *detail_name;
bool doScroll;
float scrollU;
float scrollV;
};
struct DivRamp
{
float r1, g1, b1;
float r2, g2, b2;
};
class VGCDivLoader
{
public:
VGCDivLoader();
~VGCDivLoader();
static void FindObject(hyper hashValue);
void parse(LPDIRECT3DDEVICE9 device, char *fileName);
static hash_map< string , DivMaterial* > mMaterials;
static hash_map< string , DivTexture* > mTextures;
static hash_map< string , DivRamp* > mRamps;
static hash_map< string, DivObject*> mObjects;
protected:
HeaderInfo mHeaderInfo;
void precacheMaterial(char *name);
//void precacheTexture(char *name, FILE *matFile);
TexBuffer *LoadVTXFile(char *fileName, DivTexture *tex);
TexBuffer *LoadBSLFile(char *fileName, char channelIndex, DivTexture *tex);
void parseHeader(FILE *file, unsigned int len);
void parseTexture(FILE *file, unsigned int len);
bool parseMaterial(FILE *file, unsigned int len, char *filename);
void parseRamp(FILE *file, unsigned int len);
void parseObject(FILE *file, unsigned int len, char *fileName);
void parseLOD(DivObject *obj, FILE *file, unsigned int len);
void parsePatch(DivObject *obj, FILE *file, unsigned int len);
void parseSurface(FILE *file, BIZ_IDENTITIES ident, unsigned int len, SurfaceProps &props);
void parsePMesh(FILE *file, unsigned int len, DivPatch *patch, DivObject *obj);
DivVertex *parseVList(FILE *file, unsigned int len, unsigned char vertTypeMask, int &n);
int getVertex(DivVertex vert, DivObject *obj);
void addPolygon(int *indices, int numIndices, DivPatch *patch);
int floatSize();
int getBlock(FILE *file, BIZ_IDENTITIES &id, unsigned int &length);
SurfaceProps mMasterProps;
std::vector<DivVertex> mVertices;
};
+89
View File
@@ -0,0 +1,89 @@
#pragma once
enum BIZ_IDENTITIES
{
COMMENT,
REF_COMMENT,
COMMENT_DICT,
HEADER,
OLD_COMMENT,
TRAILER,
TEXTURE = 16,
TEX_MAP,
TEX_MINIFY,
TEX_MAGNIFY,
TEX_ALPHA,
TEX_WRAP_U,
TEX_WRAP_V,
TEX_DETAIL,
TEX_BSL_CHANNEL,
MATERIAL = 32,
MAT_TEXTURE,
MAT_ENVIRONMENT,
MAT_AMBIENT,
MAT_DIFFUSE,
MAT_SPECULAR,
MAT_EMISSIVE,
MAT_OPACITY,
MAT_RAMP,
RAMP = 48,
RMP_DATA,
OBJECT = 64,
LOD,
PATCH,
POLYGON,
TRISTRIP,
POLYSTRIP,
PMESH,
PMESH_CONLIST,
SPHERE_LIST,
SPHERE,
LINE_LIST,
TEXT,
TEXT_VAL,
PMESH_CONLIST_NEW,
VTX_TEX = 96,
LINE = 128,
HDR_VERSION = 2002,
HDR_DATE,
HDR_TIME,
HDR_SCALE,
HDR_PRECISION,
HDR_FILETYPE,
GEN_NAME,
HDR_UNIT,
GEN_SCOPE,
SRF_F_MATERIAL = 2048,
SRF_B_MATERIAL,
SRF_PLANE,
SRF_DRAWMODE,
SRF_DECAL,
SRF_FACETED,
SRF_VERTEX,
SRF_SPECIAL,
SRF_LOCK,
SPHERE_DICE_V = 2064,
SPHERE_DICE_U,
LINE_THICKNESS,
TEXT_FONT,
TEXT_SCALE,
TEXT_ORIENTATION,
LOD_DISTANCE = 2070,
LOD_REFERENCE,
LOD_TRANSITION,
VTX_COLOR = 2096,
VTX_SIZE,
VTX_DIMENSIONS
};