Started my morning by getting George to help with joe.joeuser.com. Due to my own user error, I completely screwed up the site and I couldn't even edit the article that screwed it up. Many thanks to George for getting this right.
Then, I checked in the my political machine stuff and chatted with Scott about the political machine code. On to the project...
Spent a lot of time today trying to get the explosion animations in. Turns out that the mesh file I was using was truncated. That's why I couldn't get the animations to work. After figuring that out, everything went a lot smoother.
Quick programming note:
Lint test. Find the error.
LPDIRECT3DTEXTURE9 *pTextures = new LPDIRECT3DTEXTURE9[dwNumMaterials];
memcpy(pTextures, pSrcTextures, sizeof(pTextures));
Yup, you guessed it. You only copied 4 bytes. Simple mistake disasterous results. This is the proper way to do it:
LPDIRECT3DTEXTURE9 *pTextures = new LPDIRECT3DTEXTURE9[dwNumMaterials];
memcpy(pTextures, pSrcTextures, sizeof(LPDIRECT3DTEXTURE9) * dwNumMaterials));
Luckily I had the experienced eyes to catch that one
I need to ask everyone a question. What's the best practice for importing models into a game? We've got an issue where the models that Alex gives us aren't in the correct orientation or scale for Cari's code. So, in the code, we go through a few machinations, changing the mesh vertices to fit Cari's code. Should we be going through the machinations in the code, or should Alex just give us models in the correct orientation or scale?
My opinion is that anything can be done in code. I prefer to do it in code and let the artist do their thing. I guess I can see both side, because Alex is still giving us the models in a standard orientation, but it's just not Cari's orientation. If he could do that we wouldn't have to come up with a code solution. On the other hand, once you write the proper code solution, then the artist doesn't have to change their practice. Hmm. What do you think?
... [Many frustrating hours later] ...
UGH! It turned into another one of those days. Animations are something you can just whip out in a day I guess. I've got more work to do, but I think I may have to fall back to plan B for the demo. I'll investigate that tonight.