Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2963,8 +2963,7 @@ void BaseHeightMapRenderObjClass::renderTrees(CameraClass * camera)
if (m_map==NULL) return;
if (Scene==NULL) return;
if (m_treeBuffer) {
Matrix3D tm(Transform);
DX8Wrapper::Set_Transform(D3DTS_WORLD,tm);
DX8Wrapper::Set_Transform(D3DTS_WORLD,Transform);
DX8Wrapper::Set_Material(m_vertexMaterialClass);
RTS3DScene *pMyScene = (RTS3DScene *)Scene;
RefRenderObjListIterator pDynamicLightsIterator(pMyScene->getDynamicLights());
Expand Down
20 changes: 10 additions & 10 deletions Core/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,20 +711,20 @@ void LightMapTerrainTextureClass::Apply(unsigned int stage)
DX8Wrapper::Set_DX8_Texture_Stage_State( stage, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
DX8Wrapper::Set_DX8_Texture_Stage_State( stage, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);

Matrix4x4 curView;
D3DXMATRIX curView;
DX8Wrapper::_Get_DX8_Transform(D3DTS_VIEW, curView);


D3DXMATRIX inv;
float det;
D3DXMatrixInverse(&inv, &det, (D3DXMATRIX*)&curView);
D3DXMatrixInverse(&inv, &det, &curView);

D3DXMATRIX scale;
D3DXMatrixScaling(&scale, STRETCH_FACTOR, STRETCH_FACTOR,1);
inv *=scale;
if (stage==0) {
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE0, *((Matrix4x4*)&inv));
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE0, inv));
} if (stage==1) {
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE1, *((Matrix4x4*)&inv));
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE1, inv));
}


Expand Down Expand Up @@ -965,13 +965,13 @@ void CloudMapTerrainTextureClass::Apply(unsigned int stage)
DX8Wrapper::Set_DX8_Texture_Stage_State( stage, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
DX8Wrapper::Set_DX8_Texture_Stage_State( stage, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);

Matrix4x4 curView;
D3DXMATRIX curView;
DX8Wrapper::_Get_DX8_Transform(D3DTS_VIEW, curView);


D3DXMATRIX inv;
float det;
D3DXMatrixInverse(&inv, &det, (D3DXMATRIX*)&curView);
D3DXMatrixInverse(&inv, &det, &curView);

D3DXMATRIX scale;
D3DXMatrixScaling(&scale, STRETCH_FACTOR, STRETCH_FACTOR,1);
inv *=scale;
Expand Down Expand Up @@ -999,7 +999,7 @@ void CloudMapTerrainTextureClass::Apply(unsigned int stage)
DX8Wrapper::Set_DX8_Texture_Stage_State( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
DX8Wrapper::Set_DX8_Texture_Stage_State( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE );

DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE0, *((Matrix4x4*)&inv));
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE0, inv);

// Disable 3rd stage just in case.
DX8Wrapper::Set_DX8_Texture_Stage_State( 2, D3DTSS_COLOROP, D3DTOP_DISABLE );
Expand All @@ -1018,7 +1018,7 @@ void CloudMapTerrainTextureClass::Apply(unsigned int stage)
DX8Wrapper::Set_DX8_Texture_Stage_State( 1, D3DTSS_ALPHAARG1, D3DTA_CURRENT );
DX8Wrapper::Set_DX8_Texture_Stage_State( 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );

DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE1, *((Matrix4x4*)&inv));
DX8Wrapper::_Set_DX8_Transform(D3DTS_TEXTURE1, inv);
}
#endif
}
Expand Down
Loading
Loading