Skip to content

Commit a026367

Browse files
committed
match vmap field names
1 parent 8521657 commit a026367

1 file changed

Lines changed: 92 additions & 91 deletions

File tree

Tests/vmap.cs

Lines changed: 92 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22
using System.Numerics;
33
using DMElement = Datamodel.Element;
44

5-
namespace ValveResourceFormat.IO.ContentFormats.ValveMap;
5+
namespace consoleTestApp.VMAP;
66

77
/// <summary>
88
/// Valve Map (VMAP) format version 29.
99
/// </summary>
1010
internal class CMapRootElement : DMElement
1111
{
12-
public bool IsPrefab { get; set; }
13-
public int EditorBuild { get; set; } = 8600;
14-
public int EditorVersion { get; set; } = 400;
15-
public bool ShowGrid { get; set; } = true;
16-
public int SnapRotationAngle { get; set; } = 15;
17-
public float GridSpacing { get; set; } = 64;
18-
public bool Show3DGrid { get; set; } = true;
12+
public bool isprefab { get; set; }
13+
public int editorbuild { get; set; } = 8600;
14+
public int editorversion { get; set; } = 400;
15+
public bool showgrid { get; set; } = true;
16+
public int snaprotationangle { get; set; } = 15;
17+
public float gridspacing { get; set; } = 64;
18+
public bool show3dgrid { get; set; } = true;
1919
[DMProperty(name: "itemFile")]
20-
public string ItemFile { get; set; } = string.Empty;
21-
public CStoredCamera DefaultCamera { get; set; } = [];
20+
public string Itemfile { get; set; } = string.Empty;
21+
public CStoredCamera defaultcamera { get; set; } = [];
2222
[DMProperty(name: "3dcameras")]
2323
public CStoredCameras Cameras { get; set; } = [];
2424
public CMapWorld world { get; set; } = [];
25+
[DMProperty(name: "visbility")]
2526
public CVisibilityMgr Visibility { get; set; } = [];
2627
[DMProperty(name: "mapVariables")]
2728
public CMapVariableSet MapVariables { get; set; } = [];
@@ -40,16 +41,16 @@ internal class CMapRootElement : DMElement
4041

4142
internal class CStoredCamera : DMElement
4243
{
43-
public Vector3 Position { get; set; } = new Vector3(0, -1000, 1000);
44-
public Vector3 LookAt { get; set; }
44+
public Vector3 position { get; set; } = new Vector3(0, -1000, 1000);
45+
public Vector3 lookat { get; set; }
4546
}
4647

4748

4849
internal class CStoredCameras : DMElement
4950
{
5051
[DMProperty(name: "activecamera")]
5152
public int ActiveCameraIndex { get; set; } = -1;
52-
public Datamodel.ElementArray Cameras { get; set; } = [];
53+
public Datamodel.ElementArray cameras { get; set; } = [];
5354
}
5455

5556

@@ -74,18 +75,18 @@ internal abstract class MapNode : DMElement
7475

7576
internal class CMapPrefab : MapNode
7677
{
77-
public bool FixupEntityNames { get; set; } = true;
78-
public bool LoadAtRuntime { get; set; }
79-
public bool LoadIfNested { get; set; } = true;
80-
public string TargetMapPath { get; set; } = string.Empty;
81-
public string TargetName { get; set; } = string.Empty;
78+
public bool fixupEntityNames { get; set; } = true;
79+
public bool loadAtRuntime { get; set; }
80+
public bool loadIfNested { get; set; } = true;
81+
public string targetMapPath { get; set; } = string.Empty;
82+
public string targetName { get; set; } = string.Empty;
8283
}
8384

8485

8586
internal abstract class BaseEntity : MapNode
8687
{
87-
public DmePlugList RelayPlugData { get; set; } = [];
88-
public Datamodel.ElementArray ConnectionsData { get; set; } = [];
88+
public DmePlugList relayPlugData { get; set; } = [];
89+
public Datamodel.ElementArray connectionsData { get; set; } = [];
8990
[DMProperty(name: "entity_properties")]
9091
public EditGameClassProps EntityProperties { get; set; } = [];
9192

@@ -112,22 +113,22 @@ public BaseEntity WithClassName(string className)
112113

113114
internal class DmePlugList : DMElement
114115
{
115-
public Datamodel.StringArray Names { get; set; } = [];
116-
public Datamodel.IntArray DataTypes { get; set; } = [];
117-
public Datamodel.IntArray PlugTypes { get; set; } = [];
118-
public Datamodel.StringArray Descriptions { get; set; } = [];
116+
public Datamodel.StringArray names { get; set; } = [];
117+
public Datamodel.IntArray dataTypes { get; set; } = [];
118+
public Datamodel.IntArray plugTypes { get; set; } = [];
119+
public Datamodel.StringArray descriptions { get; set; } = [];
119120
}
120121

121122

122123
internal class DmeConnectionData : DMElement
123124
{
124-
public string OutputName { get; set; } = string.Empty;
125-
public int TargetType { get; set; }
126-
public string TargetName { get; set; } = string.Empty;
127-
public string InputName { get; set; } = string.Empty;
128-
public string OverrideParam { get; set; } = string.Empty;
129-
public float Delay { get; set; }
130-
public int TimesToFire { get; set; } = -1;
125+
public string outputName { get; set; } = string.Empty;
126+
public int targetType { get; set; }
127+
public string targetName { get; set; } = string.Empty;
128+
public string inputName { get; set; } = string.Empty;
129+
public string overrideParam { get; set; } = string.Empty;
130+
public float delay { get; set; }
131+
public int timesToFire { get; set; } = -1;
131132
}
132133

133134
/// <summary>
@@ -143,9 +144,9 @@ internal class EditGameClassProps : DMElement
143144

144145
internal class CMapWorld : BaseEntity
145146
{
146-
public int NextDecalID { get; set; }
147-
public bool FixupEntityNames { get; set; } = true;
148-
public string MapUsageType { get; set; } = "standard";
147+
public int nextDecalID { get; set; }
148+
public bool fixupEntityNames { get; set; } = true;
149+
public string mapUsageType { get; set; } = "standard";
149150

150151
public CMapWorld()
151152
{
@@ -156,46 +157,46 @@ public CMapWorld()
156157

157158
internal class CVisibilityMgr : MapNode
158159
{
159-
public Datamodel.ElementArray Nodes { get; set; } = [];
160-
public Datamodel.IntArray HiddenFlags { get; set; } = [];
160+
public Datamodel.ElementArray nodes { get; set; } = [];
161+
public Datamodel.IntArray hiddenFlags { get; set; } = [];
161162
}
162163

163164

164165
internal class CMapVariableSet : DMElement
165166
{
166-
public Datamodel.StringArray VariableNames { get; set; } = [];
167-
public Datamodel.StringArray VariableValues { get; set; } = [];
168-
public Datamodel.StringArray VariableTypeNames { get; set; } = [];
169-
public Datamodel.StringArray VariableTypeParameters { get; set; } = [];
167+
public Datamodel.StringArray variableNames { get; set; } = [];
168+
public Datamodel.StringArray variableValues { get; set; } = [];
169+
public Datamodel.StringArray variableTypeNames { get; set; } = [];
170+
public Datamodel.StringArray variableTypeParameters { get; set; } = [];
170171
[DMProperty(name: "m_ChoiceGroups")]
171172
public Datamodel.ElementArray ChoiceGroups { get; set; } = [];
172173
}
173174

174175

175176
internal class CMapSelectionSet : DMElement
176177
{
177-
public Datamodel.ElementArray Children { get; set; } = [];
178-
public string SelectionSetName { get; set; } = string.Empty;
179-
public CObjectSelectionSetDataElement SelectionSetData { get; set; } = [];
178+
public Datamodel.ElementArray children { get; set; } = [];
179+
public string selectionSetName { get; set; } = string.Empty;
180+
public CObjectSelectionSetDataElement selectionSetData { get; set; } = [];
180181

181182
public CMapSelectionSet() { }
182183
public CMapSelectionSet(string name)
183184
{
184-
SelectionSetName = name;
185+
selectionSetName = name;
185186
}
186187
}
187188

188189

189190
internal class CObjectSelectionSetDataElement : DMElement
190191
{
191-
public Datamodel.ElementArray SelectedObjects { get; set; } = [];
192+
public Datamodel.ElementArray selectedObjects { get; set; } = [];
192193
}
193194

194195

195196
internal class CMapEntity : BaseEntity
196197
{
197-
public Vector3 HitNormal { get; set; }
198-
public bool IsProceduralEntity { get; set; }
198+
public Vector3 hitNormal { get; set; }
199+
public bool isProceduralEntity { get; set; }
199200
}
200201

201202

@@ -204,8 +205,8 @@ internal class CMapInstance : BaseEntity
204205
/// <summary>
205206
/// A target <see cref="CMapGroup"/> to instance. With custom tint and transform.
206207
/// </summary>
207-
public DMElement? Target { get; set; }
208-
public Datamodel.Color TintColor { get; set; } = new Datamodel.Color(255, 255, 255, 255);
208+
public DMElement? target { get; set; }
209+
public Datamodel.Color tintColor { get; set; } = new Datamodel.Color(255, 255, 255, 255);
209210
}
210211

211212
internal class CMapGroup : MapNode
@@ -215,19 +216,19 @@ internal class CMapGroup : MapNode
215216

216217
internal class CMapWorldLayer : CMapGroup
217218
{
218-
public string WorldLayerName { get; set; } = string.Empty;
219+
public string worldLayerName { get; set; } = string.Empty;
219220
}
220221

221222

222223
internal class CMapMesh : MapNode
223224
{
224-
public string CubeMapName { get; set; } = string.Empty;
225-
public string LightGroup { get; set; } = string.Empty;
225+
public string cubeMapName { get; set; } = string.Empty;
226+
public string lightGroup { get; set; } = string.Empty;
226227
[DMProperty(name: "visexclude")]
227228
public bool VisExclude { get; set; }
228229
[DMProperty(name: "renderwithdynamic")]
229230
public bool RenderWithDynamic { get; set; }
230-
public bool DisableHeightDisplacement { get; set; }
231+
public bool disableHeightDisplacement { get; set; }
231232
[DMProperty(name: "fademindist")]
232233
public float FadeMinDist { get; set; } = -1;
233234
[DMProperty(name: "fademaxdist")]
@@ -236,21 +237,21 @@ internal class CMapMesh : MapNode
236237
public bool BakeLighting { get; set; } = true;
237238
[DMProperty(name: "precomputelightprobes")]
238239
public bool PrecomputeLightProbes { get; set; } = true;
239-
public bool RenderToCubemaps { get; set; } = true;
240-
public int DisableShadows { get; set; }
241-
public float SmoothingAngle { get; set; } = 40f;
242-
public Datamodel.Color TintColor { get; set; } = new Datamodel.Color(255, 255, 255, 255);
240+
public bool renderToCubemaps { get; set; } = true;
241+
public int disableShadows { get; set; }
242+
public float smoothingAngle { get; set; } = 40f;
243+
public Datamodel.Color tintColor { get; set; } = new Datamodel.Color(255, 255, 255, 255);
243244
[DMProperty(name: "renderAmt")]
244245
public int RenderAmount { get; set; } = 255;
245-
public string PhysicsType { get; set; } = "default";
246-
public string PhysicsGroup { get; set; } = string.Empty;
247-
public string PhysicsInteractsAs { get; set; } = string.Empty;
248-
public string PhysicsInteractWsith { get; set; } = string.Empty;
249-
public string PhysicsInteractsExclude { get; set; } = string.Empty;
246+
public string physicsType { get; set; } = "default";
247+
public string physicsGroup { get; set; } = string.Empty;
248+
public string physicsInteractsAs { get; set; } = string.Empty;
249+
public string physicsInteractWsith { get; set; } = string.Empty;
250+
public string physicsInteractsExclude { get; set; } = string.Empty;
250251
public CDmePolygonMesh meshData { get; set; } = [];
251-
public bool UseAsOccluder { get; set; }
252-
public bool PhysicsSimplificationOverride { get; set; }
253-
public float PhysicsSimplificationError { get; set; }
252+
public bool useAsOccluder { get; set; }
253+
public bool physicsSimplificationOverride { get; set; }
254+
public float physicsSimplificationError { get; set; }
254255
}
255256

256257

@@ -259,79 +260,79 @@ internal class CDmePolygonMesh : MapNode
259260
/// <summary>
260261
/// Index to one of the edges stemming from this vertex.
261262
/// </summary>
262-
public Datamodel.IntArray VertexEdgeIndices { get; set; } = [];
263+
public Datamodel.IntArray vertexEdgeIndices { get; set; } = [];
263264

264265
/// <summary>
265266
/// Index to the <see cref="VertexData"/> streams.
266267
/// </summary>
267-
public Datamodel.IntArray VertexDataIndices { get; set; } = [];
268+
public Datamodel.IntArray vertexDataIndices { get; set; } = [];
268269

269270
/// <summary>
270271
/// The destination vertex of this edge.
271272
/// </summary>
272-
public Datamodel.IntArray EdgeVertexIndices { get; set; } = [];
273+
public Datamodel.IntArray edgeVertexIndices { get; set; } = [];
273274

274275
/// <summary>
275276
/// Index to the opposite/twin edge.
276277
/// </summary>
277-
public Datamodel.IntArray EdgeOppositeIndices { get; set; } = [];
278+
public Datamodel.IntArray edgeOppositeIndices { get; set; } = [];
278279

279280
/// <summary>
280281
/// Index to the next edge in the loop, in counter-clockwise order.
281282
/// </summary>
282-
public Datamodel.IntArray EdgeNextIndices { get; set; } = [];
283+
public Datamodel.IntArray edgeNextIndices { get; set; } = [];
283284

284285
/// <summary>
285286
/// Per half-edge index to the adjacent face. -1 if void (open edge).
286287
/// </summary>
287-
public Datamodel.IntArray EdgeFaceIndices { get; set; } = [];
288+
public Datamodel.IntArray edgeFaceIndices { get; set; } = [];
288289

289290
/// <summary>
290291
/// Per half-edge index to the <see cref="EdgeData"/> streams.
291292
/// </summary>
292-
public Datamodel.IntArray EdgeDataIndices { get; set; } = [];
293+
public Datamodel.IntArray edgeDataIndices { get; set; } = [];
293294

294295
/// <summary>
295296
/// Per half-edge index to the <see cref="FaceVertexData"/> streams.
296297
/// </summary>
297-
public Datamodel.IntArray EdgeVertexDataIndices { get; set; } = [];
298+
public Datamodel.IntArray edgeVertexDataIndices { get; set; } = [];
298299

299300
/// <summary>
300301
/// Per face index to one of the *inner* edges encapsulating this face.
301302
/// </summary>
302-
public Datamodel.IntArray FaceEdgeIndices { get; set; } = [];
303+
public Datamodel.IntArray faceEdgeIndices { get; set; } = [];
303304

304305
/// <summary>
305306
/// Per face index to the <see cref="FaceData"/> streams.
306307
/// </summary>
307-
public Datamodel.IntArray FaceDataIndices { get; set; } = [];
308+
public Datamodel.IntArray faceDataIndices { get; set; } = [];
308309

309310
/// <summary>
310311
/// List of material names. Indexed by the 'meshindex' <see cref="FaceData"/> stream.
311312
/// </summary>
312-
public Datamodel.StringArray Materials { get; set; } = [];
313+
public Datamodel.StringArray materials { get; set; } = [];
313314

314315
/// <summary>
315316
/// Stores vertex positions.
316317
/// </summary>
317-
public CDmePolygonMeshDataArray VertexData { get; set; } = [];
318+
public CDmePolygonMeshDataArray vertexData { get; set; } = [];
318319

319320
/// <summary>
320321
/// Stores vertex uv, normal, tangent, etc. Two per vertex (for each half?).
321322
/// </summary>
322-
public CDmePolygonMeshDataArray FaceVertexData { get; set; } = [];
323+
public CDmePolygonMeshDataArray faceVertexData { get; set; } = [];
323324

324325
/// <summary>
325326
/// Stores edge data such as soft or hard normals.
326327
/// </summary>
327-
public CDmePolygonMeshDataArray EdgeData { get; set; } = [];
328+
public CDmePolygonMeshDataArray edgeData { get; set; } = [];
328329

329330
/// <summary>
330331
/// Stores face data such as texture scale, UV offset, material, lightmap bias.
331332
/// </summary>
332-
public CDmePolygonMeshDataArray FaceData { get; set; } = [];
333+
public CDmePolygonMeshDataArray faceData { get; set; } = [];
333334

334-
public CDmePolygonMeshSubdivisionData SubdivisionData { get; set; } = [];
335+
public CDmePolygonMeshSubdivisionData subdivisionData { get; set; } = [];
335336
}
336337

337338

@@ -341,30 +342,30 @@ internal class CDmePolygonMeshDataArray : DMElement
341342
/// <summary>
342343
/// Array of <see cref="CDmePolygonMeshDataStream"/>.
343344
/// </summary>
344-
public Datamodel.ElementArray Streams { get; set; } = [];
345+
public Datamodel.ElementArray streams { get; set; } = [];
345346
}
346347

347348

348349
internal class CDmePolygonMeshSubdivisionData : DMElement
349350
{
350-
public Datamodel.IntArray SubdivisionLevels { get; set; } = [];
351+
public Datamodel.IntArray subdivisionLevels { get; set; } = [];
351352
/// <summary>
352353
/// Array of <see cref="CDmePolygonMeshDataStream"/>.
353354
/// </summary>
354-
public Datamodel.ElementArray Streams { get; set; } = [];
355+
public Datamodel.ElementArray streams { get; set; } = [];
355356
}
356357

357358

358359
internal class CDmePolygonMeshDataStream<T> : DMElement
359360
{
360-
public string StandardAttributeName { get; set; } = string.Empty;
361-
public string SemanticName { get; set; } = string.Empty;
362-
public int SemanticIndex { get; set; }
363-
public int VertexBufferLocation { get; set; }
364-
public int DataStateFlags { get; set; }
365-
public DMElement? SubdivisionBinding { get; set; }
361+
public string standardAttributeName { get; set; } = string.Empty;
362+
public string semanticName { get; set; } = string.Empty;
363+
public int semanticIndex { get; set; }
364+
public int vertexBufferLocation { get; set; }
365+
public int dataStateFlags { get; set; }
366+
public DMElement? subdivisionBinding { get; set; }
366367
/// <summary>
367368
/// An int, vector2, vector3, or vector4 array.
368369
/// </summary>
369-
public required Datamodel.Array<T> Data { get; set; }
370+
public required Datamodel.Array<T> data { get; set; }
370371
}

0 commit comments

Comments
 (0)