mirror of
https://github.com/celisej567/LibBSP.git
synced 2026-09-04 15:35:12 +03:00
VertexExtensions: Read more data for a vertex. Also add support for CoD2 (more to come on this later)
This commit is contained in:
@@ -111,30 +111,43 @@ namespace LibBSP {
|
||||
if (version == 0) {
|
||||
goto case MapType.Quake3;
|
||||
} else if (version == 1) {
|
||||
// Patch vertex. Set color to white (makes things easier in CoDRadiant) and simply read position.
|
||||
result.color = ColorExtensions.FromArgb(255, 255, 255, 255);
|
||||
goto case MapType.DMoMaM;
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MapType.CoD2: {
|
||||
result.normal = new Vector3d(BitConverter.ToSingle(data, 12), BitConverter.ToSingle(data, 16), BitConverter.ToSingle(data, 20));
|
||||
result.color = ColorExtensions.FromArgb(data[27], data[24], data[25], data[26]);
|
||||
result.uv0 = new Vector2d(BitConverter.ToSingle(data, 28), BitConverter.ToSingle(data, 32));
|
||||
result.uv1 = new Vector2d(BitConverter.ToSingle(data, 36), BitConverter.ToSingle(data, 40));
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
case MapType.MOHAA:
|
||||
case MapType.Quake3:
|
||||
case MapType.CoD2:
|
||||
case MapType.CoD4:
|
||||
case MapType.FAKK: {
|
||||
result.uv0 = new Vector2d(BitConverter.ToSingle(data, 12), BitConverter.ToSingle(data, 16));
|
||||
result.uv1 = new Vector2d(BitConverter.ToSingle(data, 20), BitConverter.ToSingle(data, 24));
|
||||
result.normal = new Vector3d(BitConverter.ToSingle(data, 28), BitConverter.ToSingle(data, 32), BitConverter.ToSingle(data, 36));
|
||||
result.color = ColorExtensions.FromArgb(data[43], data[40], data[41], data[42]);
|
||||
goto case MapType.DMoMaM;
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
case MapType.Raven: {
|
||||
result.uv0 = new Vector2d(BitConverter.ToSingle(data, 12), BitConverter.ToSingle(data, 16));
|
||||
result.uv1 = new Vector2d(BitConverter.ToSingle(data, 20), BitConverter.ToSingle(data, 24));
|
||||
result.normal = new Vector3d(BitConverter.ToSingle(data, 52), BitConverter.ToSingle(data, 56), BitConverter.ToSingle(data, 60));
|
||||
result.color = ColorExtensions.FromArgb(data[67], data[64], data[65], data[66]);
|
||||
goto case MapType.DMoMaM;
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
case MapType.STEF2:
|
||||
case MapType.STEF2Demo: {
|
||||
result.uv0 = new Vector2d(BitConverter.ToSingle(data, 12), BitConverter.ToSingle(data, 16));
|
||||
result.uv1 = new Vector2d(BitConverter.ToSingle(data, 20), BitConverter.ToSingle(data, 24));
|
||||
result.color = ColorExtensions.FromArgb(data[35], data[32], data[33], data[34]);
|
||||
goto case MapType.DMoMaM;
|
||||
result.normal = new Vector3d(BitConverter.ToSingle(data, 36), BitConverter.ToSingle(data, 40), BitConverter.ToSingle(data, 44));
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
case MapType.Quake:
|
||||
case MapType.Nightfire:
|
||||
@@ -206,10 +219,14 @@ namespace LibBSP {
|
||||
if (version == 0) {
|
||||
goto case MapType.Quake3;
|
||||
} else if (version == 1) {
|
||||
goto case MapType.DMoMaM;
|
||||
goto case MapType.Quake;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MapType.CoD2: {
|
||||
structLength = 68;
|
||||
break;
|
||||
}
|
||||
case MapType.MOHAA:
|
||||
case MapType.Quake3:
|
||||
case MapType.FAKK: {
|
||||
@@ -279,6 +296,9 @@ namespace LibBSP {
|
||||
case MapType.CoD: {
|
||||
return 7;
|
||||
}
|
||||
case MapType.CoD2: {
|
||||
return 8;
|
||||
}
|
||||
case MapType.Raven:
|
||||
case MapType.Quake3: {
|
||||
return 10;
|
||||
|
||||
Reference in New Issue
Block a user