comparison Render.cpp @ 840:6dd2b94efce7

DrawFan
author Ritor1
date Fri, 29 Mar 2013 10:43:46 +0600
parents f5156b8c61ad
children e3609dd06c15
comparison
equal deleted inserted replaced
838:d061180f2b42 840:6dd2b94efce7
7599 // 4D864C: using guessed type char byte_4D864C; 7599 // 4D864C: using guessed type char byte_4D864C;
7600 7600
7601 //----- (004A2DA3) -------------------------------------------------------- 7601 //----- (004A2DA3) --------------------------------------------------------
7602 void Render::DrawStrip(unsigned int uNumVertices, struct stru148 *a3, IDirect3DTexture2 *pTexture) 7602 void Render::DrawStrip(unsigned int uNumVertices, struct stru148 *a3, IDirect3DTexture2 *pTexture)
7603 { 7603 {
7604 int v4; // ebx@1 7604 //int v4; // ebx@1
7605 int v7; // eax@7 7605 int v7; // eax@7
7606 float v12; // ST3C_4@8 7606 float v12; // ST3C_4@8
7607 int i; 7607 int i;
7608 7608
7609 v4 = (int)this; 7609 //v4 = (int)this;
7610 if (!this->uNumD3DSceneBegins) 7610 if (!this->uNumD3DSceneBegins)
7611 return; 7611 return;
7612 7612
7613 if (uNumVertices >= 3) 7613 if (uNumVertices >= 3)
7614 { 7614 {
7637 pVertices[i].specular = v7; 7637 pVertices[i].specular = v7;
7638 pVertices[i].texcoord.x = array_50AC10[i].u; 7638 pVertices[i].texcoord.x = array_50AC10[i].u;
7639 pVertices[i].texcoord.y = array_50AC10[i].v; 7639 pVertices[i].texcoord.y = array_50AC10[i].v;
7640 } 7640 }
7641 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); 7641 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture);
7642 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT); 7642 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
7643 pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT);
7643 } 7644 }
7644 } 7645 }
7645 7646
7646 //----- (004A2DA3) -------------------------------------------------------- 7647 //----- (004A2DA3) --------------------------------------------------------
7647 void Render::DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture) 7648 void Render::DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture)
7648 { 7649 {
7649 int v4; // ebx@1 7650 //int v4; // ebx@1
7650 int v7; // eax@7 7651 int v7; // eax@7
7651 float v13; // ST3C_4@8 7652 float v13; // ST3C_4@8
7652 int i; 7653 int i;
7653 7654
7654 v4 = (int)this; 7655 //v4 = (int)this;
7655 if ( !this->uNumD3DSceneBegins ) 7656 if ( !this->uNumD3DSceneBegins )
7656 return; 7657 return;
7657 if ( uNumVertices >= 3 ) 7658 if ( uNumVertices >= 3 )
7658 { 7659 {
7659 this->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP); 7660 this->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP);
7661 { 7662 {
7662 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); 7663 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
7663 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); 7664 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE);
7664 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); 7665 this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO);
7665 } 7666 }
7666 for (i = 0; i < uNumVertices; ++i) 7667 for ( i = 0; i < uNumVertices; ++i )
7667 { 7668 {
7668 pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX; 7669 pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX;
7669 pVertices[i].pos.y = array_50AC10[i].vWorldViewProjY; 7670 pVertices[i].pos.y = array_50AC10[i].vWorldViewProjY;
7670 pVertices[i].pos.z = 0.99989998; 7671 pVertices[i].pos.z = 0.99989998;
7671 pVertices[i].rhw = array_50AC10[i]._rhw; 7672 pVertices[i].rhw = array_50AC10[i]._rhw;
7672 7673
7673 pVertices[i].diffuse = GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0); 7674 pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0);
7674 v7 = 0; 7675 v7 = 0;
7675 if (this->bUsingSpecular) 7676 if (this->bUsingSpecular)
7676 { 7677 {
7677 v13 = array_50AC10[i].vWorldViewPosition.x; 7678 v13 = array_50AC10[i].vWorldViewPosition.x;
7678 v7 = sub_47C3D7_get_fog_related_stuff(0, 1, v13); 7679 v7 = sub_47C3D7_get_fog_related_stuff(0, 1, v13);
7681 pVertices[i].texcoord.x = array_50AC10[i].u; 7682 pVertices[i].texcoord.x = array_50AC10[i].u;
7682 pVertices[i].texcoord.y = array_50AC10[i].v; 7683 pVertices[i].texcoord.y = array_50AC10[i].v;
7683 } 7684 }
7684 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); 7685 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture);
7685 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, 7686 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
7686 pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT); 7687 pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT);
7687 } 7688 }
7688 } 7689 }
7689 7690
7690 //----- (004A2ED5) -------------------------------------------------------- 7691 //----- (004A2ED5) --------------------------------------------------------
7691 void Render::_4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex) 7692 void Render::_4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex)