Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBX.NET 2.1.1 #138

Merged
merged 58 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2a85c39
Add ivXor of CPlugVehiclePhyTuning (ty Auris!)
BigBang1112 Jan 2, 2025
0597677
Log about file/folder argument resolving
BigBang1112 Jan 3, 2025
f49cea4
Add Samples to CSceneVehicleCarMarksSamples
BigBang1112 Jan 3, 2025
3c68e36
Fix CGameCtnCollection not linking header chunks properly
BigBang1112 Jan 4, 2025
b3fcf3d
Add missing FolderItem
BigBang1112 Jan 4, 2025
f23ed36
Add remaining header strings
BigBang1112 Jan 4, 2025
7acdf68
Link SortIndex in body
BigBang1112 Jan 4, 2025
4bf2053
Minor CGameCtnCollection tweaks
BigBang1112 Jan 4, 2025
d621bc2
Fix HasLightmaps for Chunk0304305B
BigBang1112 Jan 4, 2025
7d1ca9b
Add CarCanBeDirty (ty marosis)
BigBang1112 Jan 4, 2025
9e4811a
Fix CGameCtnCollection 0x038 v4- being broken
BigBang1112 Jan 4, 2025
3f173f9
Progress CSceneLayout
BigBang1112 Jan 9, 2025
e851e38
Complete Scene3d for TMF
BigBang1112 Jan 9, 2025
b7035f4
Name stuff (ty marosis)
BigBang1112 Jan 9, 2025
3d6d76b
Tweaks
BigBang1112 Jan 10, 2025
0f793d0
Replace ExternalData with ExternalNodes (ExternalData will return som…
BigBang1112 Jan 11, 2025
0d00472
Fix EncryptionInitializer
BigBang1112 Jan 11, 2025
7135175
Mark deep clone as experimental
BigBang1112 Jan 11, 2025
1704d32
Update NativeSharpZlib
BigBang1112 Jan 12, 2025
8a0e6ea
Recognize newer paks
BigBang1112 Jan 12, 2025
40fe7f6
Handle encrypted part
BigBang1112 Jan 12, 2025
ddfd3d2
Add support for second key
BigBang1112 Jan 12, 2025
8f44eff
Fix CPlugGameSkin header v8
BigBang1112 Jan 12, 2025
14b2f1d
Update README.md
BigBang1112 Jan 13, 2025
52f4005
Update README.md
BigBang1112 Jan 13, 2025
c2d3f1d
Fill CPlugMaterialCustom.Bitmap
BigBang1112 Jan 18, 2025
17b9973
Merge branch 'dev' of https://github.com/bigbang1112/gbx-net into dev
BigBang1112 Jan 18, 2025
4de691f
Add CPlugShaderApply 0x007
BigBang1112 Jan 18, 2025
05ffe74
Support embedded shaders
BigBang1112 Jan 18, 2025
b585676
Fix CPlugBitmapApply remap bug
BigBang1112 Jan 18, 2025
6f94ab8
Add TMVehicle.Gbx support for CGameItemModel
BigBang1112 Jan 18, 2025
2bbf9e5
Various classic and chunk fixes
BigBang1112 Jan 18, 2025
930f83e
Add VehicleStruct support
BigBang1112 Jan 19, 2025
70ae833
Cleaner visualization
BigBang1112 Jan 19, 2025
6b1a036
Make CPlugVehiclePhyTuning.Name not nullable
BigBang1112 Jan 19, 2025
878fbec
Update to 2.1.1
BigBang1112 Jan 19, 2025
bef6f7d
Add CGameControlCameras
BigBang1112 Jan 20, 2025
ba7c37d
Change log level to Info on header class ID
BigBang1112 Jan 20, 2025
3d350a5
Add Unlimiter class names (custom-made)
BigBang1112 Jan 20, 2025
4394443
Explorer: full chunk ID, fixes to missing names
BigBang1112 Jan 20, 2025
f2e40e5
Explorer: Add namespace on grouping hover
BigBang1112 Jan 20, 2025
9ae459b
Add loads of tmf camera stuff
BigBang1112 Jan 20, 2025
25a8c62
Add CGameCtnBlockInfo.Selection
BigBang1112 Jan 20, 2025
720e2a4
Add ParentCollectorId and IsInternal
BigBang1112 Jan 20, 2025
ebecf00
Add ParentCollectorId to body
BigBang1112 Jan 20, 2025
a7f7a16
Add cameras from older TMs
BigBang1112 Jan 20, 2025
bfa096f
Fix RefBuffer.Gbx
BigBang1112 Jan 20, 2025
0f4c262
TMVehicle and VehicleStruct compatibility for ESWC/TMS
BigBang1112 Jan 21, 2025
cdba52c
Add class name
BigBang1112 Jan 21, 2025
eca3bc1
Update SUPPORTED_GBX_FILE_TYPES.md
BigBang1112 Jan 21, 2025
583bce7
Fix external nodes in IReadable archives
BigBang1112 Jan 21, 2025
d291e70
Add missing EmitterModel
BigBang1112 Jan 21, 2025
2ea50a7
Add missing CGameCtnDecoration header chunks
BigBang1112 Jan 21, 2025
593eea4
Implement CHmsAmbientOcc
BigBang1112 Jan 21, 2025
c5668f6
Tweaks
BigBang1112 Jan 21, 2025
e879e94
Add BorderRGB and AtlasCountUVs
BigBang1112 Jan 21, 2025
071c690
Update GBX.NET.PAK to 2.1.0
BigBang1112 Jan 22, 2025
d698961
Update GBX.NET.Tool.CLI to 0.5.1
BigBang1112 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Generators/GBX.NET.Generators/ChunkL/MemberSerializationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,32 +301,42 @@ private void AppendRead(int indent, ChunkProperty chunkProperty)
var contextual = archives.TryGetValue(chunkProperty.Type.PrimaryType, out var archiveModel)
&& archiveModel.ChunkLDefinition?.Properties.ContainsKey("contextual") == true;

var comma = false;

if (contextual)
{
sb.Append('n');
comma = true;
}

if (chunkProperty.Properties?.TryGetValue("version", out var version) == true)
{
if (contextual)
if (comma)
{
sb.Append(", ");
}

sb.Append("version: ");
sb.Append(version);

comma = true;
}

if (chunkProperty.Properties?.ContainsKey("external") == true && !chunkProperty.Type.IsArray)
{
sb.Append(", out ");
if (comma)
{
sb.Append(", ");
}

sb.Append("out ");

if (!self && !isUnknown)
{
sb.Append("n.");
}

sb.Append(name);
sb.Append(char.ToLowerInvariant(name[0]) + name.Substring(1));
sb.Append("File");
}

Expand Down
2 changes: 1 addition & 1 deletion Generators/GBX.NET.Generators/ClassChunkLMixedGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public virtual void Initialize(IncrementalGeneratorInitializationContext context
var classIdContents = context.AdditionalTextsProvider
.Where(static file =>
{
return file.Path.EndsWith("ClassId.txt") && Path.GetDirectoryName(file.Path).EndsWith("Resources");
return (file.Path.EndsWith("ClassId.txt") || file.Path.EndsWith("ClassIdManual.txt")) && Path.GetDirectoryName(file.Path).EndsWith("Resources");
})
.Select((additionalText, cancellationToken) =>
{
Expand Down
9 changes: 8 additions & 1 deletion Generators/GBX.NET.Generators/Utils/ClassIdParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ public static Dictionary<uint, string> Parse(TextReader reader)
// combine engine and class like EECCC000
var classId = (uint)((currentEngineByte << 24) | (classPart << 12));

result.Add(classId, currentClassName);
if (!result.TryGetValue(classId, out var curName) || string.IsNullOrEmpty(curName))
{
result[classId] = currentClassName;
}
else
{
throw new Exception($"Duplicate class id {classId:X8} with names '{curName}' and '{currentClassName}'.");
}
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ For any questions, open an issue, join the [GameBox Sandbox Discord server](http

Many *essential* Gbx files from many games are supported:

- **Trackmania (2020)**, October 2024 update
- **Trackmania (2020)**, December 2024 update
- **ManiaPlanet 4**(.1), TM2/SM
- **Trackmania Turbo**
- ManiaPlanet 3, TM2/SM
Expand Down Expand Up @@ -87,7 +87,7 @@ Here are some of the known file types to start with:
| LightMapCache.Gbx | [CHmsLightMapCache](Src/GBX.NET/Engines/Hms/CHmsLightMapCache.chunkl) | No | No
| SystemConfig.Gbx | [CSystemConfig](Src/GBX.NET/Engines/System/CSystemConfig.chunkl) | Yes | Yes
| FidCache.Gbx | [CMwRefBuffer](Src/GBX.NET/Engines/MwFoundations/CMwRefBuffer.chunkl) | Yes | Yes
| Scores.Gbx | [CGamePlayerScore](Src/GBX.NET/Engines/Game/CGamePlayerScore.chunkl) | Yes | No
| Scores.Gbx | [CGamePlayerScore](Src/GBX.NET/Engines/Game/CGamePlayerScore.chunkl) | No | No

**Full list of supported file types is available in the [SUPPORTED GBX FILE TYPES](SUPPORTED_GBX_FILE_TYPES.md)**.

Expand Down
Binary file added Resources/ClassIdManual.txt
Binary file not shown.
2 changes: 0 additions & 2 deletions Resources/Wrap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
08050000 090E5000
08051000 09126000
08053000 090BF000
08055000 09125000
0805A000 090B2000
0805B000 090B3000
0900D000 0900F000
09012000 09047000
09063000 09026000
09068000 09026000
090E3000 2E006000
Expand Down
21 changes: 19 additions & 2 deletions SUPPORTED_GBX_FILE_TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Older extensions | Latest extension | Class | Read (whole) | Write | Read (heade
| | Shape.Gbx | [CPlugSurface](Src/GBX.NET/Engines/Plug/CPlugSurface.chunkl) | Yes | Yes
| | Macroblock.Gbx | [CGameCtnMacroBlockInfo](Src/GBX.NET/Engines/Game/CGameCtnMacroBlockInfo.chunkl) | Yes | Yes | Yes
| | SystemConfig.Gbx | [CSystemConfig](Src/GBX.NET/Engines/System/CSystemConfig.chunkl) | Yes | Yes
| | FidCache.Gbx | [CMwRefBuffer](Src/GBX.NET/Engines/MwFoundations/CMwRefBuffer.chunkl) | Yes | Yes
| RefBuffer.Gbx | FidCache.Gbx | [CMwRefBuffer](Src/GBX.NET/Engines/MwFoundations/CMwRefBuffer.chunkl) | Yes | Yes
| | Profile.Gbx | [CGamePlayerProfile](Src/GBX.NET/Engines/Game/CGamePlayerProfile.chunkl) | Up to TMF | Up to TMF | Yes
| | Spawn.Gbx | [CGameSpawnModel](Src/GBX.NET/Engines/GameData/CGameSpawnModel.chunkl) | Yes | Yes
| ConstructionCampaign.Gbx | Campaign.Gbx | [CGameCtnCampaign](Src/GBX.NET/Engines/Game/CGameCtnCampaign.chunkl) | Yes | Yes
Expand All @@ -24,6 +24,7 @@ Older extensions | Latest extension | Class | Read (whole) | Write | Read (heade
| TMDecorationSize.Gbx | DecorationSize.Gbx | [CGameCtnDecorationSize](Src/GBX.NET/Engines/Game/CGameCtnDecorationSize.chunkl) | Yes | Yes | Yes
| TMDecorationMood.Gbx | DecorationMood.Gbx | [CGameCtnDecorationMood](Src/GBX.NET/Engines/Game/CGameCtnDecorationMood.chunkl) | Yes | Yes | Yes
| TMDecorationAudio.Gbx | DecorationAudio.Gbx | [CGameCtnDecorationAudio](Src/GBX.NET/Engines/Game/CGameCtnDecorationAudio.chunkl) | Yes | Yes | Yes
| | Scene3d.Gbx | [CSceneLayout](Src/GBX.NET/Engines/Scene/CSceneLayout.chunkl) | Yes | Yes
| TMEDClassic.Gbx | EDClassic.Gbx | [CGameCtnBlockInfoClassic](Src/GBX.NET/Engines/Game/CGameCtnBlockInfoClassic.chunkl) | Yes | Yes | Yes
| TMEDClip.Gbx | EDClip.Gbx | [CGameCtnBlockInfoClip](Src/GBX.NET/Engines/Game/CGameCtnBlockInfoClip.chunkl) | Yes | Yes | Yes
| TMEDFlat.Gbx | EDFlat.Gbx | [CGameCtnBlockInfoFlat](Src/GBX.NET/Engines/Game/CGameCtnBlockInfoFlat.chunkl) | Yes | Yes | Yes
Expand All @@ -39,13 +40,29 @@ Older extensions | Latest extension | Class | Read (whole) | Write | Read (heade
| | MotionManagerWeathers.Gbx | [CPlugWeatherModel](Src/GBX.NET/Engines/Plug/CPlugWeatherModel.chunkl) | Up to TMUF | Yes
| | RallyLeafManager.Gbx | [CMotionManagerLeaves](Src/GBX.NET/Engines/Motion/CMotionManagerLeaves.chunkl) | Yes | Yes
| | GameSkin.Gbx | [CPlugGameSkin](Src/GBX.NET/Engines/Plug/CPlugGameSkin.chunkl) | Yes | Yes
| | VehicleTunings.Gbx | [CPlugVehiclePhyTunings](Src/GBX.NET/Engines/Plug/CPlugVehiclePhyTunings.chunkl) | Up to TM2 | Up to TM2 | Yes
| | VehicleTunings.Gbx | [CPlugVehiclePhyTunings](Src/GBX.NET/Engines/Plug/CPlugVehiclePhyTunings.chunkl) | Up to TM2 | Up to TM2
| | CtrlCam.Gbx | [CGameControlCamera](Src/GBX.NET/Engines/Game/CGameControlCamera.chunkl) | Yes | Yes
| | CtrlCamTarget.Gbx | [CGameControlCameraTarget](Src/GBX.NET/Engines/Game/CGameControlCameraTarget.chunkl) | Yes | Yes
| | CtrlCamOrbital3d.Gbx | [CGameControlCameraOrbital3d](Src/GBX.NET/Engines/Game/CGameControlCameraOrbital3d.chunkl) | Yes | Yes
| | CtrlCamTmRace.Gbx | [CGameControlCameraTrackManiaRace](Src/GBX.NET/Engines/TrackMania/CGameControlCameraTrackManiaRace.chunkl) | Yes | Yes
| | CtrlCamTmRace2.Gbx | [CGameControlCameraTrackManiaRace2](Src/GBX.NET/Engines/TrackMania/CGameControlCameraTrackManiaRace2.chunkl) | Yes | Yes
| | CtrlCamTmRace3.Gbx | [CGameControlCameraTrackManiaRace3](Src/GBX.NET/Engines/TrackMania/CGameControlCameraTrackManiaRace3.chunkl) | Yes | Yes
| | DecoSolid.Gbx | [CPlugDecoratorSolid](Src/GBX.NET/Engines/CPlug/CPlugDecoratorSolid.chunkl) | Yes | Yes
| | TrackManiaVehicle.Gbx | [CSceneVehicleCar](Src/GBX.NET/Engines/Scene/CSceneVehicleCar.chunkl) | Only TMUF | Only TMUF
| TMVehicle.Gbx | ConstructionVehicle.Gbx | [CGameItemModel](Src/GBX.NET/Engines/GameData/CGameItemModel.chunkl) | Yes | Yes | Yes
| | ParticleModel.Gbx | [CPlugParticleEmitterModel](Src/GBX.NET/Engines/CPlug/CPlugParticleEmitterModel.chunkl) | Up to TMUF | Up to TMUF
| | VehicleStruct.Gbx | [CPlugVehicleVisModelShared](Src/GBX.NET/Engines/GameData/CPlugVehicleVisModelShared.chunkl) | Yes | Yes
| | FuncClouds.Gbx | [CPlugClouds](Src/GBX.NET/Engines/Plug/CPlugClouds.chunkl) | Yes | Yes
| | FuncShader.Gbx | [CFuncShaderLayerUV](Src/GBX.NET/Engines/Func/CFuncShaderLayerUV.chunkl) | Yes | Yes
| | AmbientOcc.Gbx | [CHmsAmbientOcc](Src/GBX.NET/Engines/Hms/CHmsAmbientOcc.chunkl) | Yes | Yes
| | ObjectInfo.Gbx | [CGameItemModel](Src/GBX.NET/Engines/GameData/CGameItemModel.chunkl) | Yes | Yes | Yes
| | Mobil.Gbx | [CSceneMobil](Src/GBX.NET/Engines/Scene/CSceneMobil.chunkl) | Yes | Yes
| | Solid.Gbx | [CPlugSolid](Src/GBX.NET/Engines/Plug/CPlugSolid.cs) | Yes | Yes
| | Material.Gbx | [CPlugMaterial](Src/GBX.NET/Engines/Plug/CPlugMaterial.cs) | Up to TM2 | No
| | Shader.Gbx | [CPlugShader](Src/GBX.NET/Engines/Plug/CPlugShader.cs) | Up to TMUF | No
| | Texture.Gbx | [CPlugBitmap](Src/GBX.NET/Engines/Plug/CPlugBitmap.cs) | Up to TMUF | No
| | Light.Gbx | [CPlugLight](Src/GBX.NET/Engines/Plug/CPlugLight.cs) | Yes | Yes
| | Prefab.Gbx | [CPlugPrefab](Src/GBX.NET/Engines/Plug/CPlugPrefab.cs) | Yes | Yes
| | Wagon.Gbx | [CPlugTrainWagonModel](Src/GBX.NET/Engines/Plug/CPlugTrainWagonModel.cs) | Yes | Yes

- <sup>1</sup>Safety reasons. Consider extracting `CGameCtnGhost` from `CGameCtnReplayRecord`, transfer it over to `CGameCtnMediaBlockGhost`, add it to `CGameCtnMediaClip`, and save it as `.Clip.Gbx`, which you can then import in MediaTracker.
8 changes: 4 additions & 4 deletions Src/GBX.NET.PAK/Exceptions/NotAPakException.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace GBX.NET.Exceptions;
namespace GBX.NET.PAK.Exceptions;

[Serializable]
public class NotAPakException : Exception
{
public NotAPakException() : base("Pak data stream was not identified.") { }
public NotAPakException(string message) : base(message) { }
public NotAPakException(string message, Exception? innerException) : base(message, innerException) { }
public NotAPakException() : base("Pak data stream was not identified.") { }
public NotAPakException(string message) : base(message) { }
public NotAPakException(string message, Exception? innerException) : base(message, innerException) { }
}
4 changes: 2 additions & 2 deletions Src/GBX.NET.PAK/GBX.NET.PAK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>GBX.NET.PAK</PackageId>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionPrefix>2.1.0</VersionPrefix>
<Authors>BigBang1112</Authors>
<Description>Support for Pak (NadeoPak) package files, integrated with GBX.NET.</Description>
<Copyright>Copyright (c) 2024 Petr Pivoňka</Copyright>
Expand Down Expand Up @@ -45,7 +45,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NativeSharpZlib" Version="0.2.6" />
<PackageReference Include="NativeSharpZlib" Version="0.2.8" />
<PackageReference Include="Zomp.SyncMethodGenerator" Version="1.4.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Loading
Loading