Mercurial > mm7
diff Render.cpp @ 872:2db21a810d48
Merge
author | Nomad |
---|---|
date | Mon, 01 Apr 2013 13:39:39 +0200 |
parents | 710cf848ad24 f4394e320312 |
children | 10fa7dad1391 |
line wrap: on
line diff
--- a/Render.cpp Mon Apr 01 13:39:19 2013 +0200 +++ b/Render.cpp Mon Apr 01 13:39:39 2013 +0200 @@ -23,6 +23,7 @@ #include "TileFrameTable.h" #include "texts.h" #include "mm7_data.h" +#include "MM7.h" #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib") #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib") @@ -3182,7 +3183,7 @@ HIWORD(v26) = HIWORD(v42); LOWORD(v26) = 0; v27 = (object->uAttributes & 0x20) == 0; - v3->sZValue = v26 + (8 * i | OBJECT_Item); + v3->sZValue = v26 + (PID(OBJECT_Item,i)); v3->dimming_level = 0; v3->uTintColor = 0; if ( !v27 ) @@ -3682,7 +3683,7 @@ v27->world_z = decor->vPosition.z; v27->uScreenSpaceY = v40; HIWORD(v30) = HIWORD(v39); - v31 = 8 * i | OBJECT_Decoration; + v31 = PID(OBJECT_Decoration,i); LOWORD(v30) = 0; v27->uIndoorSectorID = 0; v27->sZValue = v30 + v31; @@ -7599,59 +7600,12 @@ // 4D864C: using guessed type char byte_4D864C; //----- (004A2DA3) -------------------------------------------------------- -void Render::DrawStrip(unsigned int uNumVertices, struct stru148 *a3, IDirect3DTexture2 *pTexture) -{ - int v4; // ebx@1 - int v7; // eax@7 - float v12; // ST3C_4@8 - int i; - - v4 = (int)this; - if (!this->uNumD3DSceneBegins) - return; - - if (uNumVertices >= 3) - { - this->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP); - if (this->bUsingSpecular) - { - this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); - this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - } - - for (i = 0; i < uNumVertices; ++i) - { - pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX; - pVertices[i].pos.y = array_50AC10[i].vWorldViewProjY; - pVertices[i].pos.z = 0.99989998; - pVertices[i].rhw = array_50AC10[i]._rhw; - - pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, true, false); - v7 = 0; - if (this->bUsingSpecular) - { - v12 = array_50AC10[i].vWorldViewPosition.x; - v7 = sub_47C3D7_get_fog_related_stuff(0, 1, v12); - } - pVertices[i].specular = v7; - pVertices[i].texcoord.x = array_50AC10[i].u; - pVertices[i].texcoord.y = array_50AC10[i].v; - } - pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); - pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT); - } -} - -//----- (004A2DA3) -------------------------------------------------------- -void Render::DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture) -{ - int v4; // ebx@1 +void Render::DrawSkyPolygon(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture) +{ int v7; // eax@7 float v13; // ST3C_4@8 int i; - v4 = (int)this; if ( !this->uNumD3DSceneBegins ) return; if ( uNumVertices >= 3 ) @@ -7663,14 +7617,14 @@ this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); } - for (i = 0; i < uNumVertices; ++i) + for ( i = 0; i < uNumVertices; ++i ) { pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX; pVertices[i].pos.y = array_50AC10[i].vWorldViewProjY; pVertices[i].pos.z = 0.99989998; pVertices[i].rhw = array_50AC10[i]._rhw; - pVertices[i].diffuse = GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0); + pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0); v7 = 0; if (this->bUsingSpecular) { @@ -7683,7 +7637,7 @@ } pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, - pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT); + pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT); } }