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

PCF parsing improvements #143

Open
maxdup opened this issue Feb 13, 2021 · 1 comment
Open

PCF parsing improvements #143

maxdup opened this issue Feb 13, 2021 · 1 comment
Labels

Comments

@maxdup
Copy link
Collaborator

maxdup commented Feb 13, 2021

I have not experienced any bugs, but this will surely cause some.
I've been researching pcf files and had new findings about the format. Figured I'd share to help improve the parsing.

first:
https://github.com/ruarai/CompilePal/blob/master/CompilePalX/Compilers/Utility/ParticleUtils.cs#L282
TypeId is a uInt32 in binaryVersion 5.

second:
https://github.com/ruarai/CompilePal/blob/master/CompilePalX/Compilers/Utility/ParticleUtils.cs#L293
Parsing strings is done differently in binaryVersion 4 and 5,
Version 2-3 are directly a string, 4-5 are an Int id into the StringDict. Version 4 is uInt16, version 5 is uInt32.

@maxdup maxdup added the bug label Feb 13, 2021
@maxdup
Copy link
Collaborator Author

maxdup commented Feb 14, 2021

third:
This assumption is wrong. Pcf material strings are never prefixed with "materials/". This bit of code should be changed to always prepend "materials/".
https://github.com/ruarai/CompilePal/blob/master/CompilePalX/Compilers/Utility/ParticleUtils.cs#L58

This would be consistent with this bit of code which always prefixes strings with "materials/"
https://github.com/ruarai/CompilePal/blob/master/CompilePalX/Compilers/Utility/ParticleUtils.cs#L296

likewise, Pcf model strings are never prefixed with "models/". This bit of code should be changed to always prefix strings with "models/"
https://github.com/ruarai/CompilePal/blob/master/CompilePalX/Compilers/Utility/ParticleUtils.cs#L39

(Note: a few model strings in csgo are actually prefixed with "models/", but don't get confused, this correctly refers to "/models/models/")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant