Disable depth writing before drawing the sprites and reenable afterwards. The sprites will be drawn as normal, but their depth position won't be written to the z-buffer so everything else will draw over them.
d3ddevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
void XRendererDX9::DrawTexture(XTexture* Texture, float X, float Y, XRect<int> Rect)
{
if(!Texture || Texture->Color.Alpha <= 0)
return;
static RECT rect;
static D3DXVECTOR3 Position;
Position.x = X;
Position.y = Y;
Position.z = 0.0f;
rect.left = Rect.X;
rect.top = Rect.Y;
rect.right = Rect.X + Rect.Width;
rect.bottom = Rect.Y + Rect.Height;
Direct3D9Device->SetRenderState(D3DRS_ZWRITEENABLE, 0);
Direct3D9Sprite->Draw(static_cast<IDirect3DTexture9*>(Texture->Get()), &rect, 0, &Position,
D3DCOLOR_ARGB(Texture->Color.Alpha, Texture->Color.Red, Texture->Color.Green, Texture->Color.Blue));
Direct3D9Device->SetRenderState(D3DRS_ZWRITEENABLE, 1);
}Still not working.