From e0e924fadf44713ca0e92d4ff29181c91468655c Mon Sep 17 00:00:00 2001 From: chronokun Date: Wed, 22 Jul 2015 22:13:44 +1200 Subject: [PATCH] Made converter preserve textures. --- ReflexToQ3/main.cpp | 14 ++++++++++++-- ReflexToQ3/testout.map | 40 ---------------------------------------- 2 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 ReflexToQ3/testout.map diff --git a/ReflexToQ3/main.cpp b/ReflexToQ3/main.cpp index fe92788..60ef34e 100644 --- a/ReflexToQ3/main.cpp +++ b/ReflexToQ3/main.cpp @@ -14,6 +14,7 @@ struct TPlanePoints TVector3f m_A; TVector3f m_B; TVector3f m_C; + std::string m_material; }; TPlanePoints GetPlanePoints(const TVector3f* _kpPoints, const size_t _kNumPoints) @@ -54,7 +55,9 @@ std::vector GetBrushPlanes(const TBrush& _krBrush) { Verts[i] = _krBrush.m_Vertices[krFace.m_Indices[i]]; } - Planes.push_back(GetPlanePoints(Verts.data(), Verts.size())); + TPlanePoints PP = GetPlanePoints(Verts.data(), Verts.size()); + PP.m_material = krFace.m_Material; + Planes.push_back(PP); } return(Planes); @@ -73,7 +76,14 @@ std::string GetBrushString(const TBrush& _krBrush) ssOutput << "( " << krPlane.m_A.m_fX << " " << krPlane.m_A.m_fZ << " " << krPlane.m_A.m_fY << " ) "; ssOutput << "( " << krPlane.m_B.m_fX << " " << krPlane.m_B.m_fZ << " " << krPlane.m_B.m_fY << " ) "; ssOutput << "( " << krPlane.m_C.m_fX << " " << krPlane.m_C.m_fZ << " " << krPlane.m_C.m_fY << " ) "; - ssOutput << "common/caulk 0 0 0 0.500000 0.500000 0 4 0" << std::endl; + if(krPlane.m_material.length()) + { + ssOutput << krPlane.m_material << " 0 0 0 0.500000 0.500000 0 4 0" << std::endl; + } + else + { + ssOutput << "common/caulk 0 0 0 0.500000 0.500000 0 4 0" << std::endl; + } } ssOutput << "}" << std::endl; } diff --git a/ReflexToQ3/testout.map b/ReflexToQ3/testout.map deleted file mode 100644 index b4f42e4..0000000 --- a/ReflexToQ3/testout.map +++ /dev/null @@ -1,40 +0,0 @@ -reflex map version 6 -entity - type WorldSpawn -brush - vertices - -256.000000 0.000000 256.000000 - 256.000000 0.000000 256.000000 - 256.000000 0.000000 -256.000000 - -256.000000 0.000000 -256.000000 - -256.000000 -16.000000 256.000000 - 256.000000 -16.000000 256.000000 - 256.000000 -16.000000 -256.000000 - -256.000000 -16.000000 -256.000000 - faces - 0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 3 - 0.000000 0.000000 1.000000 1.000000 0.000000 6 5 4 7 - 0.000000 0.000000 1.000000 1.000000 0.000000 2 1 5 6 - 0.000000 0.000000 1.000000 1.000000 0.000000 0 3 7 4 - 0.000000 0.000000 1.000000 1.000000 0.000000 3 2 6 7 - 0.000000 0.000000 1.000000 1.000000 0.000000 1 0 4 5 -brush - vertices - -64.000000 64.000000 256.000000 - 64.000000 64.000000 256.000000 - 64.000000 0.000000 128.000000 - -64.000000 0.000000 256.000000 - -64.000000 0.000000 128.000000 - 64.000000 0.000000 256.000000 - faces - 0.000000 0.000000 1.000000 1.000000 0.000000 3 0 4 - 0.000000 0.000000 1.000000 1.000000 0.000000 2 1 5 - 0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 4 - 0.000000 0.000000 1.000000 1.000000 0.000000 1 0 3 5 - 0.000000 0.000000 1.000000 1.000000 0.000000 3 4 2 5 -entity - type PlayerSpawn -entity - type CameraPath - UInt8 posLerp 2 - UInt8 angleLerp 2