is there anything wrong with this code that could be screwing anything read in

is there anything wrong with this code that could be screwing anything read in

This is a discussion on is there anything wrong with this code that could be screwing anything read in within the C++ Programming forums, part of the General Programming Boards category; is there anything wrong with this code that could be screwing anything read in from a file? I have been ...

is there anything wrong with this code that could be screwing anything read in

is there anything wrong with this code that could be screwing anything read in from a file? I have been reading a .md3 tutorial so I am pretty sure the number of instances i am allocating memory for is correct, i.e the number of tags is equal to the number of tags in the header multiplied by the number of frames. Assuming all of that is correct are there any errors?

I only provided the actual implementation for the reader, I chose not to include the data structures because if there are any errors they must be in this following implementation. If no one finds any errors in this I am completely stumped because this is exactly how the online tutorial was doing it.

well I am pretty much hopeless then because I have been doing all of that stuff. Nothing works. I have tried plugging different versions into an opengl proggie and nothing gets drawn telling me that the data is getting broken up and won't form triangles (i.e the total number of vertices is no longer divisible by 3)

EDIT:
Im really sorry for dumping all that code on you guys, it's just that I honestly cannot figure out why I'm not getting correct data. I know it's not correct because I've viewed the model in milkshape. I've tried drawing the model in opengl. I've done the 'coutting' of the values with the z up orientation but also y up orientation. I feel stupid because this model loading is a basic step in my project and I haven't been able to get it working for 2-3 weeks now and i'm really starting to get depressed.

Even though the reader doesn't seem to be the most optimized it looks like it should be reading. I'd crack open a hex editor and make sure everything is order in the file you are reading.

[EDIT]
The thought just occured to me that maybe data is being misaligned. I know that I've always had trouble directly reading a bitmap file header into a struct since a struct is aligned on the 32-bit boundary and the header is 14 bytes. Look into that too.
[/EDIT]

well i guess it just comes down to this: I have made a not so obvious mistake somewhere along the lines here. And until I get my head out of my ass and realize what it is this reader will not be spitting out correct information.