diff --git a/src/Common/Game/IW4/IW4_Assets.h b/src/Common/Game/IW4/IW4_Assets.h index 71325344..d2aae8fa 100644 --- a/src/Common/Game/IW4/IW4_Assets.h +++ b/src/Common/Game/IW4/IW4_Assets.h @@ -159,7 +159,7 @@ namespace IW4 typedef tdef_align(16) float raw_float16; typedef unsigned int raw_uint; typedef tdef_align(128) unsigned int raw_uint128; - typedef char cbrushedge_t; + typedef unsigned char cbrushedge_t; typedef unsigned short r_index_t; typedef float vec2_t[2]; typedef float vec3_t[3]; @@ -225,8 +225,8 @@ namespace IW4 cbrushside_t* sides; cbrushedge_t* baseAdjacentSide; int16_t axialMaterialNum[2][3]; - char firstAdjacentSideOffsets[2][3]; - char edgeCount[2][3]; + unsigned char firstAdjacentSideOffsets[2][3]; + unsigned char edgeCount[2][3]; }; struct BrushWrapper diff --git a/src/ObjWriting/Dumping/MapFile/MapFileDumper.cpp b/src/ObjWriting/Dumping/MapFile/MapFileDumper.cpp index cebb9606..8f013032 100644 --- a/src/ObjWriting/Dumping/MapFile/MapFileDumper.cpp +++ b/src/ObjWriting/Dumping/MapFile/MapFileDumper.cpp @@ -65,6 +65,12 @@ void MapFileDumper::Init() const m_stream << "\"The Map\" flags\n"; } +void MapFileDumper::WriteComment(const std::string& key) const +{ + Indent(); + m_stream << "// " << key << "\n"; +} + void MapFileDumper::BeginEntity() { assert(!m_flags.m_in_entity); diff --git a/src/ObjWriting/Dumping/MapFile/MapFileDumper.h b/src/ObjWriting/Dumping/MapFile/MapFileDumper.h index 14934bf4..ff9b5843 100644 --- a/src/ObjWriting/Dumping/MapFile/MapFileDumper.h +++ b/src/ObjWriting/Dumping/MapFile/MapFileDumper.h @@ -58,6 +58,7 @@ public: explicit MapFileDumper(std::ostream& stream); void Init() const; + void WriteComment(const std::string& key) const; void BeginEntity(); void EndEntity(); diff --git a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperPhysCollmap.cpp b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperPhysCollmap.cpp index 546fd99b..314ca79a 100644 --- a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperPhysCollmap.cpp +++ b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperPhysCollmap.cpp @@ -47,6 +47,8 @@ void AssetDumperPhysCollmap::DumpAsset(AssetDumpingContext& context, XAssetInfo< switch (geom.type) { case PHYS_GEOM_NONE: + // TODO: Dump BrushWrapper (probably GJK related) + mapFileDumper.WriteComment("TODO: Brush data"); break; case PHYS_GEOM_BOX: mapFileDumper.WritePhysicsBox({ @@ -73,6 +75,7 @@ void AssetDumperPhysCollmap::DumpAsset(AssetDumpingContext& context, XAssetInfo< case PHYS_GEOM_CAPSULE: case PHYS_GEOM_GLASS: default: + // These do not seem to appear inside any collmap assets assert(false); break; }