I've been working on the code to make the vehicles respond to the landscape that they are travelling across and hit a couple of setbacks. The first involves identifying what kind of terrain the vehicle is on, I was planning on using the GetPixel function to determine the terrain, but this only works on the screen and not on the backbuffer and by the time I've updated the screen the landscape under the car is obscured from GetPixel. Instead I think I'm going to have to use pointer arithmetic on the tile surfaces to find the colour at a given coordinate.
The other problem I've got is with STL vectors. I'm getting memory access violations when trying to add new items to the vector that stores all of the sprites. I think the problem is that I'm pushing a new item onto the vector whilst iterating through the same vector with an iterator. The iterator seems to lose track of where its current object is. I'm going to investigate whats happening more at the weekend as I find it hard to believe that you can't push a new item onto a vector while iterating through it.
In the meantime, here's a screengrab from the game showing some trees and wrecks.
The other problem I've got is with STL vectors. I'm getting memory access violations when trying to add new items to the vector that stores all of the sprites. I think the problem is that I'm pushing a new item onto the vector whilst iterating through the same vector with an iterator. The iterator seems to lose track of where its current object is. I'm going to investigate whats happening more at the weekend as I find it hard to believe that you can't push a new item onto a vector while iterating through it.
In the meantime, here's a screengrab from the game showing some trees and wrecks.