I made some more progress today. Engine wise I cleaned up a large problem with my pool class. I was checking to see if the resource already existed, if so I would return it; otherwise I would create a new resource. This is, of course, a really good idea... if I was adding the new resource to the list. I thought it was pretty odd when my terrain system was taking over half a minute to load (new terrain system, I'll explain in a moment.) Turns out, it was loading 100 copies of floor4.x and floor4.png.
So, I dropped the heightmap system. I don't really like heightmaps, but that might stem from the fact that I suck horribly at using them. Anyway, the new map splits the terrain into tiles, which are models. So far it's working pretty good and runs fast enough, so I'm pretty sure I'm going to be sticking with it. Here's a screeny for you:
It's running slow in the screenshot because the meshes are being rendered like so (just so I could get the black outline. Without it, the shapes blend together since I haven't added lighting yet):
Without the second section I get about 400-450fps.
Now, onto a question: Is there any way to tell how tall an object is after it's been loaded (using D3DXLoadMeshFromX() and ID3DXMesh)? I'm going to allow for layers (as you can see from screenshot), but I need to know how tall the object is. I was thinking that maybe I could do it somehow using D3DXComputeBoundingBox(), but the documentation is kind of lacking in documentation for it:
[in] Pointer to the first position.
[in] Number of vertices.
[in] Count or number of bytes between vertices.
[out] Pointer to a D3DXVECTOR3 structure, describing the returned lower-left corner of the bounding box. See Remarks.
[out] Pointer to a D3DXVECTOR3 structure, describing the returned upper-right corner of the bounding box. See Remarks.
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.
Header: Declared in D3dx9mesh.h.
Yea, I don't see any remarks. Mostly my problem is what are pMin and pMax? I know lower-left and upper-right, but there are more than one of each on a box. Here's a diagram:
/ | / |
| / | /
Would pMin be 1 or 2? And would pMax be 3 or 4?
Any help would be appreciated!