Mercurial > mm7
diff ParticleEngine.cpp @ 64:f6e7d7110512
Слияние
author | Ritor1 |
---|---|
date | Wed, 23 Jan 2013 13:14:41 +0600 |
parents | a96ebf3123d2 80484cf3a683 |
children | 8ab4484c22e0 |
line wrap: on
line diff
--- a/ParticleEngine.cpp Wed Jan 23 13:14:10 2013 +0600 +++ b/ParticleEngine.cpp Wed Jan 23 13:14:41 2013 +0600 @@ -707,121 +707,115 @@ //----- (0048BEEF) -------------------------------------------------------- void ParticleEngine::DrawParticles_ODM() { - ParticleEngine *v1; // esi@1 - int v2; // eax@1 + ParticleEngine *pParticleEngine; // esi@1 + int pParticleNum; // eax@1 unsigned __int8 v3; // zf@1 char v4; // sf@1 unsigned __int8 v5; // of@1 char *v7; // edi@2 int v8; // eax@6 - signed int v9; // eax@8 + signed int pNumLines; // eax@8 int v10; // eax@14 int v11; // ecx@16 int v12; // edx@16 - Particle *v13; // eax@24 - RenderBillboardTransform_local0 v14; // [sp+Ch] [bp-58h]@1 + Particle *pParticle; // eax@24 + RenderBillboardTransform_local0 pBillboard; // [sp+Ch] [bp-58h]@1 int v15; // [sp+5Ch] [bp-8h]@9 int v16; // [sp+60h] [bp-4h]@1 - v14.uParentBillboardID = -1; - v1 = this; - v2 = this->uStartParticle; - v5 = v2 > this->uEndParticle;// v5 = __OFSUB__(v2, this->uEndParticle); - v3 = v2 == this->uEndParticle; - v4 = v2 - this->uEndParticle < 0; - v16 = this->uStartParticle; - if ( (unsigned __int8)(v4 ^ v5) | v3 ) + pBillboard.uParentBillboardID = -1; + pParticleEngine = this; + //v2 = this->uStartParticle; + //v5 = v2 > this->uEndParticle;// v5 = __OFSUB__(v2, this->uEndParticle); + //v3 = v2 == this->uEndParticle; + //v4 = v2 - this->uEndParticle < 0; + //v16 = this->uStartParticle; + for (pParticleNum = this->uStartParticle; pParticleNum <= this->uEndParticle; ++pParticleNum) { - v7 = (char *)&this->pParticles[v2].sZValue + 2; - do - { - if ( *(int *)(v7 - 82) && v1->_48B5B3(v2) ) + v7 = (char *)&this->pParticles[pParticleNum].sZValue + 2; + //do + //{ + if ( *(_DWORD *)(v7 - 82) && pParticleEngine->_48B5B3(pParticleNum) )//*(_DWORD *)(v7 - 82) = this->pParticles[pParticleNum] or this->pParticles[pParticleNum].uType { if ( pRenderer->pRenderD3D ) { - v8 = *(int *)(v7 - 82); + v8 = *(_DWORD *)(v7 - 82); if ( BYTE1(v8) & 1 ) { - v13 = &v1->pParticles[v16]; - v14.field_10 = v13->field_58 >> 2; - v14.field_14 = v13->field_58 >> 2; - v14.uScreenSpaceX = v13->uScreenSpaceX; - v14.uScreenSpaceY = v13->uScreenSpaceY; - v14.sZValue = v13->sZValue; - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, 0, v13->uLightColor, v13->_rotation); + pParticle = &pParticleEngine->pParticles[pParticleNum]; + pBillboard.field_10 = pParticle->field_58 >> 2; + pBillboard.field_14 = pParticle->field_58 >> 2; + pBillboard.uScreenSpaceX = pParticle->uScreenSpaceX; + pBillboard.uScreenSpaceY = pParticle->uScreenSpaceY; + pBillboard.sZValue = pParticle->sZValue; + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, 0, pParticle->uLightColor, pParticle->_rotation); return; } if ( BYTE1(v8) & 2 ) { - v9 = v1->pLines.uNumLines; - if ( v9 < 100 ) + pNumLines = pParticleEngine->pLines.uNumLines; + if ( pNumLines < 100 ) { - v1->pLines.pLineVertices[2 * v9].pos.x = (double)*(signed int *)(v7 - 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.y = (double)*(signed int *)(v7 - 14); - v15 = *(short *)v7; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].rhw = 1.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].diffuse = *(int *)(v7 + 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].specular = 0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].texcoord.x = 0.0; - *((float *)&v1->pParticles[0].uType + 16 * (v1->pLines.uNumLines + 813)) = 0.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.x = (double)*(signed int *)(v7 - 10); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.y = (double)*(signed int *)(v7 - 6); - v15 = *(short *)v7; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].rhw = 1.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].diffuse = *(int *)(v7 + 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].specular = 0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].texcoord.x = 0.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines++ + 1].texcoord.y = 0.0; + pParticleEngine->pLines.pLineVertices[2 * pNumLines].pos.x = (double)*(signed int *)(v7 - 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].pos.y = (double)*(signed int *)(v7 - 14); + v15 = *(_DWORD *)v7; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].rhw = 1.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].diffuse = *(_DWORD *)(v7 + 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].specular = 0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].texcoord.x = 0.0; + *((float *)&pParticleEngine->pParticles[0].uType + 16 * (pParticleEngine->pLines.uNumLines + 813)) = 0.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.x = (double)*(signed int *)(v7 - 10); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.y = (double)*(signed int *)(v7 - 6); + v15 = *(_DWORD *)v7; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].rhw = 1.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].diffuse = *(_DWORD *)(v7 + 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].specular = 0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].texcoord.x = 0.0; + __debugbreak();//v1->pLines.pLineVertices[2 * v1->pLines.uNumLines++ + 1].texcoord.y = 0.0; } } if ( *(v7 - 81) & 4 ) { - v14.field_10 = *(int *)(v7 + 6); - v14.field_14 = *(int *)(v7 + 6); - v14.uScreenSpaceX = *(int *)(v7 - 18); - v14.uScreenSpaceY = *(int *)(v7 - 14); - v14.sZValue = *(int *)(v7 - 2); - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pBitmaps_LOD->pHardwareTextures[*(int *)(v7 - 46)], *(int *)(v7 + 18), *(int *)(v7 - 22)); + pBillboard.field_10 = *(_DWORD *)(v7 + 6); + pBillboard.field_14 = *(_DWORD *)(v7 + 6); + pBillboard.uScreenSpaceX = *(_DWORD *)(v7 - 18); + pBillboard.uScreenSpaceY = *(_DWORD *)(v7 - 14); + pBillboard.sZValue = *(_DWORD *)(v7 - 2); + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pBitmaps_LOD->pHardwareTextures[*(_DWORD *)(v7 - 46)], *(_DWORD *)(v7 + 18), *(_DWORD *)(v7 - 22)); } if ( *(v7 - 81) & 8 ) { - v14.field_10 = *(int *)(v7 + 6); - v14.field_14 = *(int *)(v7 + 6); - v14.uScreenSpaceX = *(int *)(v7 - 18); - v14.uScreenSpaceY = *(int *)(v7 - 14); - v14.sZValue = *(int *)(v7 - 2); - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pSprites_LOD->pHardwareSprites[*(int *)(v7 - 46)].pTexture, *(int *)(v7 + 18), - *(int *)(v7 - 22)); + pBillboard.field_10 = *(_DWORD *)(v7 + 6); + pBillboard.field_14 = *(_DWORD *)(v7 + 6); + pBillboard.uScreenSpaceX = *(_DWORD *)(v7 - 18); + pBillboard.uScreenSpaceY = *(_DWORD *)(v7 - 14); + pBillboard.sZValue = *(_DWORD *)(v7 - 2); + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pSprites_LOD->pHardwareSprites[*(_DWORD *)(v7 - 46)].pTexture, *(_DWORD *)(v7 + 18), + *(_DWORD *)(v7 - 22)); } } else { - v10 = 13 * *(int *)(v7 + 6) >> 16; + v10 = 13 * *(_DWORD *)(v7 + 6) >> 16; if ( v10 > 30 ) v10 = 30; - v11 = *(int *)(v7 - 18) - (v10 >> 1); - v12 = *(int *)(v7 - 14) - v10; - if ( v11 + v10 < (signed int)pViewport->uViewportX - || v11 >= (signed int)pViewport->uViewportZ - || *(int *)(v7 - 14) < (signed int)pViewport->uViewportY + v11 = *(_DWORD *)(v7 - 18) - (v10 >> 1); + v12 = *(_DWORD *)(v7 - 14) - v10; + if ( v11 + v10 < pViewport->uViewportX + || v11 >= pViewport->uViewportZ + || *(_DWORD *)(v7 - 14) < pViewport->uViewportY || v12 >= (signed int)pViewport->uViewportW ) { ; } else { - pRenderer->MakeParticleBillboardAndPush_BLV_Software(v11, v12, *(int *)(v7 - 2), *(int *)(v7 + 18), v10); + pRenderer->MakeParticleBillboardAndPush_BLV_Software(v11, v12, *(_DWORD *)(v7 - 2), *(_DWORD *)(v7 + 18), v10); } } } - v7 += 104; - v2 = v16 + 1; - v5 = v16 + 1 > v1->uEndParticle;// v5 = __OFSUB__(v16 + 1, v1->uEndParticle); - v3 = v16 + 1 == v1->uEndParticle; - v4 = v16++ + 1 - v1->uEndParticle < 0; - } - while ( (unsigned __int8)(v4 ^ v5) | v3 ); + } } \ No newline at end of file