Mercurial > might-and-magic-trilogy
diff Render.cpp @ 47:8a8dd0164b12
BLV render
cd check fix
author | Nomad |
---|---|
date | Tue, 23 Oct 2012 13:51:21 +0200 |
parents | 79a30ee1ecdb |
children | fde5c5acb66e |
line wrap: on
line diff
--- a/Render.cpp Mon Oct 22 20:54:14 2012 +0200 +++ b/Render.cpp Tue Oct 23 13:51:21 2012 +0200 @@ -4614,6 +4614,7 @@ v1->field_1036B8 = 0; v1->_gpu_memory_used = 0; uNumBillboardsToDraw = 0; + bFogEnabled = false; } bool Render::Initialize(bool bWindowed, uint uDefaultDevice, @@ -7106,29 +7107,10 @@ } //----- (004A1EB6) -------------------------------------------------------- -void Render::SetGameRenderStates() -{ - Render *v1; // esi@1 - unsigned int v2; // eax@1 - RenderD3D *v3; // ecx@2 - unsigned int uFogColor; // edi@6 - IDirect3DDevice3 *v5; // eax@8 - //IDirect3DDevice3Vtbl *v6; // ecx@8 - RenderD3D *v7; // eax@9 - RenderD3D *v8; // eax@9 - std::string v9; // [sp-14h] [bp-2Ch]@4 - IDirect3DDevice3 *v10; // [sp-8h] [bp-20h]@9 - signed int v11; // [sp-4h] [bp-1Ch]@4 - int v12; // [sp+0h] [bp-18h]@4 - std::string *v13; // [sp+10h] [bp-8h]@4 - int a3; // [sp+17h] [bp-1h]@4 - - v1 = this; - v2 = this->uNumD3DSceneBegins; - this->uNumD3DSceneBegins = v2 + 1; - if ( !v2 ) - { - v3 = this->pRenderD3D; +void Render::BeginSceneD3D() +{ + if (!uNumD3DSceneBegins++) + { if (pRenderD3D) { pRenderD3D->ClearTarget(1u, 0, 1u, 1.0); @@ -7142,42 +7124,27 @@ uFogColor = GetLevelFogColor(); else uFogColor = 0; - v5 = v1->pRenderD3D->pDevice; - //v6 = v5->lpVtbl; + if ( uFogColor & 0xFF000000 ) { - v12 = 1; - v11 = 28; - v10 = v5; - pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 1u); - //v7 = v1->pRenderD3D; - v12 = uFogColor & 0xFFFFFF; - v11 = 34; - //v10 = v7->pDevice; + pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 1); pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGCOLOR, uFogColor & 0xFFFFFF); - v8 = v1->pRenderD3D; - *(float *)&v12 = 0.0; - v11 = 35; - //v10 = v8->pDevice; pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGTABLEMODE, 0); - v1->bUsingSpecular = 1; + bUsingSpecular = true; } else { - *(float *)&v12 = 0.0; - v11 = 28; - v10 = v5; pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 0); - v1->bUsingSpecular = 0; + bUsingSpecular = 0; } } else { - LockRenderSurface((void **)&v1->pTargetSurface, &v1->uTargetSurfacePitch); - if ( v1->pTargetSurface ) - v1->field_18_locked_pitch = v1->uTargetSurfacePitch; + LockRenderSurface((void **)&pTargetSurface, &uTargetSurfacePitch); + if (pTargetSurface) + field_18_locked_pitch = uTargetSurfacePitch; else - --v1->uNumD3DSceneBegins; + --uNumD3DSceneBegins; } } }