Upgraded to DirectX 9

This commit is contained in:
2024-03-28 22:27:09 +02:00
parent fb64ecafe7
commit a21139193e
110 changed files with 1604 additions and 3977 deletions

View File

@ -87,6 +87,7 @@ BOOL CSpeedTreeForest::GetMainTree(DWORD dwCRC, CSpeedTreeWrapper ** ppMainTree,
if (!pTree->LoadTree(c_pszFileName, (const BYTE *) c_pvData, file.Size()))
{
delete pTree;
pTree = nullptr;
return FALSE;
}
@ -230,63 +231,12 @@ void CSpeedTreeForest::SetupWindMatrices(float fTimeInSecs)
afMatrix[9] = -fSinX;
afMatrix[10] = fCosX * fCosY;
afMatrix[15] = 1.0f;
#ifdef WRAPPER_USE_CPU_WIND
CSpeedTreeRT::SetWindMatrix(j, afMatrix);
#endif
#ifdef WRAPPER_USE_GPU_WIND
// graphics API specific
UploadWindMatrix(c_nVertexShader_WindMatrices + j * 4, afMatrix);
#endif
}
// track wind strength
fOldStrength = m_fWindStrength;
}
///////////////////////////////////////////////////////////////////////
// CSpeedTreeForest::SetLodLimits
/*
void CSpeedTreeForest::SetLodLimits(void)
{
// find tallest tree
float fTallest = -1.0f;
TTreeMap::iterator itor = m_pMainTreeMap.begin();
UINT uiCount;
while (itor != m_pMainTreeMap.end())
{
CSpeedTreeWrapper * pMainTree = (itor++)->second;
CSpeedTreeWrapper ** ppInstances = pMainTree->GetInstances(uiCount);
float fHeight;
fHeight = pMainTree->GetBoundingBox()[5] - pMainTree->GetBoundingBox()[0];
fTallest = __max(fHeight, fTallest);
for (UINT i = 0; i < uiCount; ++i)
{
fHeight = ppInstances[i]->GetBoundingBox()[5] - ppInstances[i]->GetBoundingBox()[0];
fTallest = __max(fHeight, fTallest);
}
}
itor = m_pMainTreeMap.begin();
while (itor != m_pMainTreeMap.end())
{
CSpeedTreeWrapper * pMainTree = (itor++)->second;
CSpeedTreeWrapper ** ppInstances = pMainTree->GetInstances(uiCount);
pMainTree->GetSpeedTree()->SetLodLimits(fTallest * c_fNearLodFactor, fTallest * c_fFarLodFactor);
for (UINT i = 0; i < uiCount; ++i)
ppInstances[i]->GetSpeedTree()->SetLodLimits(fTallest * c_fNearLodFactor, fTallest * c_fFarLodFactor);
}
}
*/
void CSpeedTreeForest::SetLight(const float * afDirection, const float * afAmbient, const float * afDiffuse)
{
m_afLighting[0] = afDirection[0];