1

i don't know how to explain exactly. i upgrade my game from directx 8 to 9. normally there is no problem, but when you start a program with admin authority, textures is corrupted. any app.

before https://pasteboard.co/vGJXHOliVKaU.png

after: https://pasteboard.co/JRQBq3cLuCQu.png

terrain render code

bool isFirst=true;
for (DWORD j = 1; j < pTerrain->GetNumTextures(); ++j)
{
    TTerainSplat & rSplat = rTerrainSplatPatch.Splats[j];
    if (!rSplat.Active)
        continue;

    if (rTerrainSplatPatch.PatchTileCount[sPatchNum][j] == 0)
        continue;

    const TTerrainTexture & rTexture = m_TextureSet.GetTexture(j);

    D3DXMatrixMultiply(&matSplatColorTexTransform, &m_matViewInverse, &rTexture.m_matTransform);
    STATEMANAGER.SetTransform(D3DTS_TEXTURE0, &matSplatColorTexTransform);
    if (isFirst)
    {
        STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE);
        STATEMANAGER.SetTexture(0, rTexture.pd3dTexture);
        STATEMANAGER.SetTexture(1, rSplat.pd3dTexture);
        STATEMANAGER.DrawIndexedPrimitive(ePrimitiveType, 0, m_iPatchTerrainVertexCount, 0, wPrimitiveCount);
        STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP,   D3DTOP_SELECTARG1);
        isFirst=false;
    }
    else
    {
        STATEMANAGER.SetTexture(0, rTexture.pd3dTexture);
        STATEMANAGER.SetTexture(1, rSplat.pd3dTexture);
        STATEMANAGER.DrawIndexedPrimitive(ePrimitiveType, 0, m_iPatchTerrainVertexCount, 0, wPrimitiveCount);
    }
}
Adem d
  • 21
  • 3
  • Maybe you can volunteer the reason for wanting to run with elevated privileges. If we solve the problem of how to run with normal privileges, we don't have to deal with the more difficult issue of the crash, yes? – user6481358 Feb 05 '23 at 09:42

0 Answers0