From a1f1a35372a61729ba34493de75a3c50c6f2f9a6 Mon Sep 17 00:00:00 2001 From: <> Date: Wed, 5 Jul 2017 16:25:00 -0700 Subject: [PATCH] Appended hex color to the end of material name --- ReflexToQ3/includes/oopless-parser.hpp | 2 +- ReflexToQ3/includes/planes.cpp | 3 +++ ReflexToQ3/includes/worldspawn.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ReflexToQ3/includes/oopless-parser.hpp b/ReflexToQ3/includes/oopless-parser.hpp index 4dcba89..dede6f9 100644 --- a/ReflexToQ3/includes/oopless-parser.hpp +++ b/ReflexToQ3/includes/oopless-parser.hpp @@ -118,7 +118,7 @@ using namespace std; if (SECONDCH(fdata) == 'x') { // this is the unidentified hex digit. // out of range for stoi - x.hex = strtoul(fdata.c_str(), NULL, 16); + x.hex = fdata; hex = true; } } else if (!hex) { diff --git a/ReflexToQ3/includes/planes.cpp b/ReflexToQ3/includes/planes.cpp index c586af1..87dd031 100644 --- a/ReflexToQ3/includes/planes.cpp +++ b/ReflexToQ3/includes/planes.cpp @@ -90,6 +90,9 @@ std::vector GetBrushPlanes(const TBrush& _krBrush) } TPlanePoints PP = GetPlanePoints(Verts.data(), Verts.size()); PP.m_material = krFace.m_Material; + if (!krFace.hex.empty()) { + PP.m_material.append("+" + krFace.hex); + } Planes.push_back(PP); } diff --git a/ReflexToQ3/includes/worldspawn.h b/ReflexToQ3/includes/worldspawn.h index 85e767e..7ba971d 100644 --- a/ReflexToQ3/includes/worldspawn.h +++ b/ReflexToQ3/includes/worldspawn.h @@ -18,7 +18,7 @@ struct TFace float m_fYScale; float m_fRotation; std::vector m_Indices; - unsigned long hex; + std::string hex; std::string m_Material; };