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

WAD textures with name containing upper case characters are not applied to mesh materials #157

Open
puzzud opened this issue Jul 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@puzzud
Copy link

puzzud commented Jul 19, 2022

Given

  • A MAP file which has attribute "wad".
  • A QodotMap scene instance which references this MAP and its corresponding WAD file referenced by that attribute.
  • This WAD file contains a texture which has a name which contains at least one uppercase character.

When

  • Building this QodotMap in Godot.

Then

  • Meshes which are expected to get a material which references such a texture name are not given such.

It seems to be a convention that WAD texture names are lowercase but I suspect it is not a rule. Both Trenchbroom & TexMex support such. I encountered this problem when trying to use Valve's cs_dust.wad, which contains texture names like "SandRoad".

I have a fix for this problem by modifying qodot_texture_loader.gd::load_texture to not apply "to_lower" to the texture_name parameter before searching for this name as a key in texture_wad_resources' textures. I think this fix is sound because observing the dictionaries of loaded WADs in Godot show that the texture names are still in their original form (not forced into their lowercase form).

I don't know if there is some other use case which requires this string manipulation. Perhaps an earlier developer was catering to a case where a MAP file contained a texture name with mixed case whereas the WAD file did not and it was expected that they should match up. At any rate, that's not a valid normalization of naming because as I mentioned before, Qodot in the least is allowing texture names to be mixed case when loading a WAD. It's also worth mentioning that TexMex allows another texture in the same WAD to have the same name in a different case. However, I didn't text if Quake had a problem with such a thing--I don't know what client, editor, or compiler that may have created this precedent. Skimming the WAD2 specification, I didn't see anything that indicated such.

But if this behavior is to be retained, first a check for texture_name in texture_wad.textures can be performed prior to texture_name_lower.

@DeerTears DeerTears added the bug Something isn't working label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants