• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About bios10h

  • Rank
  1. Hi, I have a general c++ question... I'm looking for how to do manual padding. I've searched on google and couldn't find anything so I figured someone here might know. I've seen padding to 4 bytes done like this: totalSize = (totalSize + 0x3) & ~0x3; But I'd like to know if that can be generalized? If I want to pad to the next 16 bytes boundary, how can I do it? totalSize = (totalSize + 0x7) & ~0x7; ? totalSize = (totalSize + 0x15) & ~0x15; ? Or the algorithm can't be generalized? Thank you!
  2. Bumping up! I really would appreciate some advice on this one. Thanks!
  3. Hi everybody, I'm working on a X file loader that uses the ID3DXFile & ID3DXFileData helpers. I'm not using the D3DXMesh functions because I need to load these into my custom mesh class. I got everything working except the normals which I find to be akwardly defined in the MeshNormals template. For some reason, it defines the normals with a new set of faces and a set of normals which basically invalidates the positions/texcoords/color buffers I had loaded previously because all these other components use another, but common, index buffer (faces). Now I tried solving the problem: I "unindexed" my verts and the normals using their respective faces info and then I rebuilt a new common set of faces but that's slow as hell and I didn't get it to work perfectly yet. So, before I start going down the path of finalizing this solution and optimizing it for cache-coherency in the hope of speeding it up, my question is: is there something I'm missing? Looks like this is getting all very dumb but I don't see any other way! I wish there was a way to "merge" the faces without "unindexing" them. Thanks! [Edited by - bios10h on March 26, 2006 10:33:03 PM]