MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / d3d_SetZBufferState

Function d3d_SetZBufferState

legacy/renderer/Direct3D.cpp:2549–2566  ·  view source on GitHub ↗

Sets the state of zbuffering to on or off

Source from the content-addressed store, hash-verified

2547
2548// Sets the state of zbuffering to on or off
2549void d3d_SetZBufferState(int8_t state) {
2550 if (state == D3D_state.cur_zbuffer_state)
2551 return;
2552
2553 D3D_sets_this_frame[4]++;
2554
2555 D3D_state.cur_zbuffer_state = state;
2556
2557 if (state) {
2558 if (d3d_WBuffer)
2559 lpD3DDevice->SetRenderState(D3DRENDERSTATE_ZENABLE, D3DZB_USEW);
2560 else
2561 lpD3DDevice->SetRenderState(D3DRENDERSTATE_ZENABLE, TRUE);
2562
2563 } else {
2564 lpD3DDevice->SetRenderState(D3DRENDERSTATE_ZENABLE, FALSE);
2565 }
2566}
2567
2568int Last_z_buffer_write_mask_state = -1;
2569

Callers 2

d3d_SetDefaultStatesFunction · 0.85
rend_SetZBufferStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected