# HG changeset patch # User Ritor1 # Date 1358794742 -21600 # Node ID 764abc86ce90b2b45e990f51e0b7f9fd2bdd086d # Parent 8af333180755f7190c0ccd63cb771524d651f319 22.01.13 diff -r 8af333180755 -r 764abc86ce90 GUIWindow.cpp --- a/GUIWindow.cpp Mon Jan 21 20:22:10 2013 +0600 +++ b/GUIWindow.cpp Tue Jan 22 00:59:02 2013 +0600 @@ -1830,7 +1830,6 @@ break; } - auto pWindow = &pWindowList[uNextFreeWindowID]; pWindow->uFrameWidth = uWidth; pWindow->uFrameZ = uX + uWidth - 1; diff -r 8af333180755 -r 764abc86ce90 Outdoor.cpp --- a/Outdoor.cpp Mon Jan 21 20:22:10 2013 +0600 +++ b/Outdoor.cpp Tue Jan 22 00:59:02 2013 +0600 @@ -102,7 +102,7 @@ //LABEL_14: pRenderer->DrawSkyD3D(); pRenderer->DrawBuildingsD3D(); - //pRenderer->DrawBezierTerrain(); + pRenderer->DrawBezierTerrain();// Ritor1: sometimes crash goto LABEL_16; } pRenderer->DrawBuildingsSW(); diff -r 8af333180755 -r 764abc86ce90 Render.cpp --- a/Render.cpp Mon Jan 21 20:22:10 2013 +0600 +++ b/Render.cpp Tue Jan 22 00:59:02 2013 +0600 @@ -7083,7 +7083,7 @@ if (pRenderD3D) { pGame->draw_debug_outlines(); - //DoRenderBillboards_D3D(); //Ritor1: it's temporarily + DoRenderBillboards_D3D(); //Ritor1: it's temporarily pGame->pStru6Instance->RenderSpecialEffects(); pRenderD3D->pDevice->EndScene(); } @@ -8228,11 +8228,11 @@ if ( a1->uNumD3DSceneBegins ) { v5 = a2; - v6 = (double)HIWORD(a2->sZValue); + v6 = (double)a2->sZValue; //Ritor1:begin pBillboardRenderListD3D v31 = v6; v7 = v6; - v8 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v7)); - if ( BYTE3(v5->uTintColor) ) + v8 = Billboard_ProbablyAddToListAndSortByZOrder(v7); + if ( v5->uTintColor ) pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_3; else pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Transparent; @@ -8267,8 +8267,7 @@ pBillboardRenderListD3D[v8].pQuards[0].pos.y = a1b - v26 * v29; v27 = v31 * 1000.0; v13 = 1.0; - pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - - 1.0 / (v27 / (double)pOutdoorCamera->shading_dist_mist); + pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - 1.0 / (v27 / (double)pOutdoorCamera->shading_dist_mist); v25 = 1.0 / v31; pBillboardRenderListD3D[v8].pQuards[0].rhw = v25; if ( a3->bUsingSpecular ) @@ -11084,10 +11083,10 @@ //----- (004A1C1E) -------------------------------------------------------- void DoRenderBillboards_D3D() { - ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3u)); - ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1u)); + ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3)); + ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1)); ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0)); - ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1u)); + ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1)); for (uint i = pRenderer->uNumBillboardsToDraw - 1; i != (uint)-1; --i) { diff -r 8af333180755 -r 764abc86ce90 Vis.cpp --- a/Vis.cpp Mon Jan 21 20:22:10 2013 +0600 +++ b/Vis.cpp Tue Jan 22 00:59:02 2013 +0600 @@ -1819,7 +1819,7 @@ v9 = v8 < fDepth, v10 = 0, v11 = v8 == fDepth, - BYTE1(result) = HIBYTE(v7), + //BYTE1(result) = HIBYTE(v7), v9 | v11) ) { LOWORD(v5) = 0; @@ -1850,7 +1850,7 @@ v15 = v14 < fBillboardCenterY, v16 = 0, v17 = v14 == fBillboardCenterY, - BYTE1(result) = HIBYTE(v13), + //BYTE1(result) = HIBYTE(v13), v14 < fBillboardCenterY) ) { a3a = 0; diff -r 8af333180755 -r 764abc86ce90 mm7_2.cpp --- a/mm7_2.cpp Mon Jan 21 20:22:10 2013 +0600 +++ b/mm7_2.cpp Tue Jan 22 00:59:02 2013 +0600 @@ -12980,6 +12980,7 @@ bDialogueUI_InitializeActor_NPC_ID = 0; OnMapLoad(); pGameLoadingUI_ProgressBar->Progress(); + memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));//Ritor1: fix pGameLoadingUI_ProgressBar->Release(); _flushall(); }