@Benni003, Ok well I guess I'm no help. Good luck.
One question - I do not know if it work this way - Instead of rendering to the bmpMap, can you render to bmap_zbuffer.
bmap_rendertarget(render_zbuffer,0,0);
Yes I have no clue and am now just guessing. Sorry I'm not testing this stuff, I don't have the engine currently installed
Mal
The LPDIRECT3DSURFACE9 pointer to the created z buffer is available through the render_zbuffer variable.
And the BMAP struct takes a LPDIRECT3DTEXTURE9
Info for moving LPDIRECT3DSURFACE9 into LPDIRECT3DTEXTURE9
http://stackoverflow.com/questions/14279843/directx9-surface-to-textureAnd YES I'm just wild fishing