Okay, lets all bash HeelX for his stupidity:
So, our beloved HeelX did the following: He created three large BMP textures, 50 mb each, and added them to the model.
Then he loaded the model via la_ent_create() and wondered why it blocked the main thread. Turns out, he declared the textures as "extern" in MED and assumed that it would load the textures because, for whatever reason, add_buffer() or al_ent_create() would actually parse the mdl file.
NO! This is not how this works.

What happens is that my code works as expected, and then ent_create() kicks in, reads the model from the cached buffer and then sees: Yay, textures grin
And then happily loads 100 mb from the HDD.

So, how to avoid this? I'm not going to parse the files. Neither will add_buffer() parse the content (that would result in no longer thread safety). The solution: FIRST load the textures, and then load the model! The la_checkFile() function can be used to load the texture when it returns 1, its safe to load the model.
All in the background, all smooth.

Last edited by JustSid; 05/21/11 10:57.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com