comparison stru6.cpp @ 2155:0a1438c16c2b

Render decoupling.
author Nomad
date Thu, 09 Jan 2014 17:29:17 +0200
parents 9bd7522cdbbb
children 0ae56373cc35
comparison
equal deleted inserted replaced
2154:9bd7522cdbbb 2155:0a1438c16c2b
1415 1415
1416 //----- (004A8BDF) -------------------------------------------------------- 1416 //----- (004A8BDF) --------------------------------------------------------
1417 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime) 1417 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime)
1418 { 1418 {
1419 this->uFadeTime = uFadeTime; 1419 this->uFadeTime = uFadeTime;
1420 this->uFadeTime2 = uFadeTime; 1420 this->uFadeLength = uFadeTime;
1421 this->uFadeColor = uDiffuseColor; 1421 this->uFadeColor = uDiffuseColor;
1422 } 1422 }
1423 1423
1424 //----- (004A8BFC) -------------------------------------------------------- 1424 //----- (004A8BFC) --------------------------------------------------------
1425 int stru6::_4A8BFC() 1425 int stru6::_4A8BFC()
1431 //----- (004A8C27) -------------------------------------------------------- 1431 //----- (004A8C27) --------------------------------------------------------
1432 void stru6::RenderSpecialEffects() 1432 void stru6::RenderSpecialEffects()
1433 { 1433 {
1434 double v4; // st7@4 1434 double v4; // st7@4
1435 double v5; // st6@4 1435 double v5; // st6@4
1436 double v6; // st7@4 1436 //double v6; // st7@4
1437 float v7; // ST14_4@6 1437 float v7; // ST14_4@6
1438 unsigned int v8; // ST14_4@8 1438 unsigned int v8; // ST14_4@8
1439 unsigned int v9; // eax@8 1439 unsigned int v9; // eax@8
1440 SpriteFrame *v10; // eax@8 1440 SpriteFrame *v10; // eax@8
1441 int v11; // edi@8 1441 int v11; // edi@8
1459 DrawProjectiles(); 1459 DrawProjectiles();
1460 uNumProjectiles = 0; 1460 uNumProjectiles = 0;
1461 } 1461 }
1462 1462
1463 field_204 = 0; 1463 field_204 = 0;
1464 v26 = uFadeTime; 1464 if ( uFadeTime > 0 )
1465 if ( v26 > 0 ) 1465 {
1466 { 1466 v4 = (double)uFadeTime / (double)uFadeLength;
1467 v4 = (double)(signed int)v26 / (double)uFadeTime2;
1468 v5 = 1.0 - v4 * v4; 1467 v5 = 1.0 - v4 * v4;
1469 v6 = v5; 1468 //v6 = v5;
1470 if ( v5 > 0.9 ) 1469 if ( v5 > 0.9 )
1471 v6 = 1.0 - (v5 - 0.9) * 10.0; 1470 v5 = 1.0 - (v5 - 0.9) * 10.0;
1472 v7 = v6; 1471 v7 = v5;
1473 pRenderer->_4A52F1(uFadeColor, v7); 1472 pRenderer->ScreenFade(uFadeColor, v7);
1474 uFadeTime -= pEventTimer->uTimeElapsed; 1473 uFadeTime -= pEventTimer->uTimeElapsed;
1475 } 1474 }
1476 1475
1477 if (uAnimLength > 0) 1476 if (uAnimLength > 0)
1478 { 1477 {
1521 vd3d[3].texcoord.x = 1.0; 1520 vd3d[3].texcoord.x = 1.0;
1522 vd3d[0].texcoord.y = 0.0; 1521 vd3d[0].texcoord.y = 0.0;
1523 vd3d[1].texcoord.y = 1.0; 1522 vd3d[1].texcoord.y = 1.0;
1524 vd3d[2].texcoord.y = 1.0; 1523 vd3d[2].texcoord.y = 1.0;
1525 vd3d[3].texcoord.y = 0.0; 1524 vd3d[3].texcoord.y = 0.0;
1526 pRenderer->pRenderD3D->pDevice->SetTexture( 1525
1527 0, 1526 pRenderer->DrawSpecialEffectsQuad(vd3d, pSprites_LOD->pHardwareSprites[v11].pTexture);
1528 pSprites_LOD->pHardwareSprites[v11].pTexture);
1529 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE);
1530 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
1531 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE);
1532 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE);
1533 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE);
1534 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE);
1535 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS);
1536 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
1537 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, vd3d, 4, 28);
1538 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE));
1539 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO));
1540 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
1541 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE);
1542 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, TRUE);
1543 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, D3DCMP_LESS);
1544 } 1527 }
1545 /*else 1528 /*else
1546 { 1529 {
1547 vsr.pTarget = pRenderer->pTargetSurface; 1530 vsr.pTarget = pRenderer->pTargetSurface;
1548 vsr.sParentBillboardID = -1; 1531 vsr.sParentBillboardID = -1;