Closed jdolan closed 3 years ago
CC @Paril
Shit. I see what's going on here. The player model in question has an upper.md3
and an upper.tga
. The skin file displaced the model in the media table. Hmm. How to handle...
Could just append _mod, _tex, etc to the key name, similar to how we append _mat for materials so they don't collide with the textures.
Yea, it'd require a bunch of path mangling (lookup name versus underlying asset name), but it's doable. Another option would be to have separate hash tables in r_media_t for each media type.. but, meh.
Both options are attractive... the latter option means shorter lookup times and less collisions between types but slightly more complex pathing, the former is uglier code-wise and slams everything into one hash map but is easier to do for us.
Honestly, in the long run, path #2 seems best to me.
Couldn't we also provide a better custom hash value function for media, instead of just relying on g_str_hash
and g_str_equal
? That seems like an easy, and correct, fix for this. In other words: just implement the hashcode and equals contracts correctly for r_media_t.
Fixed. 'Bout fuckin' time :)
This is a nasty one.. with a couple hundred (really bad) Q3 player models on my system, I'm seeing renderer media corruption that I don't fully understand yet. Screenshot of the stack trace and corruption:
You can see that the
mod
, which should be a mesh MD3, is identifying asMEDIA_IMAGE
. Itsmesh
member is allNULL
s, so it probably is an image that is, for some reason, keyed with the model name.