forked from Tr0n/client
Upgraded to DirectX 9
This commit is contained in:
@ -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];
|
||||
|
Reference in New Issue
Block a user