void cgLdMem(IRLS& env, const IRInstruction* inst) { auto const ptr = inst->src(0); auto const ptrLoc = tmpLoc(env, ptr); auto const dstLoc = tmpLoc(env, inst->dst()); loadTV(vmain(env), inst->dst()->type(), dstLoc, memTVTypePtr(ptr, ptrLoc), memTVValPtr(ptr, ptrLoc)); }
void cgStMem(IRLS& env, const IRInstruction* inst) { auto const ptr = inst->src(0); auto const ptrLoc = tmpLoc(env, ptr); auto const src = inst->src(1); auto const srcLoc = tmpLoc(env, src); storeTV(vmain(env), src->type(), srcLoc, memTVTypePtr(ptr, ptrLoc), memTVValPtr(ptr, ptrLoc)); }
inline void SceneSkyBoxRender() { ////////////////////////////////////////////////// //temporary view matrix Vec3D tmpLoc(g_mtxView[FXMTX_NORMAL]._41, g_mtxView[FXMTX_NORMAL]._42, g_mtxView[FXMTX_NORMAL]._43); g_mtxView[FXMTX_NORMAL]._41 = 0; g_mtxView[FXMTX_NORMAL]._42 = 0; g_mtxView[FXMTX_NORMAL]._43 = 0; //set the one in d3d as well g_p3DDevice->SetTransform(D3DTS_VIEW, (const D3DMATRIX*)&g_mtxView[FXMTX_NORMAL]); GFXSetViewProjMtxFX(); ////////////////////////////////////////////////// //don't use lights u8 bSkyboxTmpIsLight = TESTFLAGS(g_FLAGS, GFX_LIGHTENABLE); LightEnableRender(FALSE); g_p3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); //g_p3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE ); //render the skybox geometries if(g_sceneTNum[SCENE_SKYBOXES] > 0) _SceneRender(0, g_sceneTNum[SCENE_SKYBOXES]-1); ////////////////////////////////////////////////// //reset the global view matrix g_mtxView[FXMTX_NORMAL]._41 = tmpLoc.x; g_mtxView[FXMTX_NORMAL]._42 = tmpLoc.y; g_mtxView[FXMTX_NORMAL]._43 = tmpLoc.z; GFXSetViewProjMtxFX(); //reset the view matrix on d3d g_p3DDevice->SetTransform(D3DTS_VIEW, (const D3DMATRIX*)&g_mtxView[FXMTX_NORMAL]); ////////////////////////////////////////////////// LightEnableRender(bSkyboxTmpIsLight); g_p3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE ); ///g_p3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE ); }