Mercurial > might-and-magic-trilogy
comparison mm7_4.cpp @ 50:fde5c5acb66e
BLV render
author | Nomad |
---|---|
date | Tue, 23 Oct 2012 23:38:05 +0200 |
parents | 8a8dd0164b12 |
children | 4211cceb3813 |
comparison
equal
deleted
inserted
replaced
47:8a8dd0164b12 | 50:fde5c5acb66e |
---|---|
7334 pRenderer->pCurrentlyLockedSoftSurface = pRenderer->pTargetSurface; | 7334 pRenderer->pCurrentlyLockedSoftSurface = pRenderer->pTargetSurface; |
7335 pRenderer->uCurrentlyLockedSurfacePitch = Dst.lPitch; | 7335 pRenderer->uCurrentlyLockedSurfacePitch = Dst.lPitch; |
7336 v1 = pRenderer->pTargetSurface; | 7336 v1 = pRenderer->pTargetSurface; |
7337 v2 = Dst.lpSurface; | 7337 v2 = Dst.lpSurface; |
7338 | 7338 |
7339 | |
7339 for (uint y = 0; y < 480; ++y) | 7340 for (uint y = 0; y < 480; ++y) |
7340 { | 7341 { |
7341 auto pDst = (unsigned short *)((char *)Dst.lpSurface + y * Dst.lPitch); | 7342 auto pDst = (unsigned short *)((char *)Dst.lpSurface + y * Dst.lPitch); |
7342 for (uint x = 0; x < 640; ++x) | 7343 for (uint x = 0; x < 640; ++x) |
7343 pDst[x] = pRenderer->uTargetGMask | pRenderer->uTargetBMask; | 7344 pDst[x] = pRenderer->uTargetRMask | pRenderer->uTargetBMask; |
7344 } | 7345 } |
7345 | 7346 |
7346 auto pSrc = pRenderer->pTargetSurface; | 7347 auto pSrc = pRenderer->pTargetSurface; |
7347 auto pDst = (__int16 *)Dst.lpSurface; | 7348 auto pDst = (__int16 *)Dst.lpSurface; |
7348 | 7349 |
15112 int v8; // eax@10 | 15113 int v8; // eax@10 |
15113 SpriteFrame *v9; // eax@16 | 15114 SpriteFrame *v9; // eax@16 |
15114 SpriteFrame *v10; // ebx@18 | 15115 SpriteFrame *v10; // ebx@18 |
15115 int *v11; // eax@18 | 15116 int *v11; // eax@18 |
15116 int v12; // ecx@28 | 15117 int v12; // ecx@28 |
15117 IndoorCameraD3D **v14; // eax@36 | 15118 //IndoorCameraD3D **v14; // eax@36 |
15118 double v15; // st7@36 | 15119 double v15; // st7@36 |
15119 float v16; // eax@36 | 15120 float v16; // eax@36 |
15120 double v17; // ST30_8@36 | 15121 //double v17; // ST30_8@36 |
15121 signed __int64 v18; // qtt@36 | 15122 signed __int64 v18; // qtt@36 |
15122 int v19; // ST5C_4@36 | 15123 int v19; // ST5C_4@36 |
15123 signed __int64 v20; // qtt@37 | 15124 signed __int64 v20; // qtt@37 |
15124 int v21; // ST5C_4@37 | 15125 int v21; // ST5C_4@37 |
15125 signed __int16 v22; // cx@39 | 15126 signed __int16 v22; // cx@39 |
15126 int v23; // ST50_4@40 | 15127 int v23; // ST50_4@40 |
15127 signed int v24; // ecx@40 | 15128 signed int v24; // ecx@40 |
15128 int v25; // edx@44 | 15129 int v25; // edx@44 |
15129 __int16 v26; // ax@44 | 15130 __int16 v26; // ax@44 |
15130 MonsterDesc *v27; // edx@44 | 15131 //MonsterDesc *v27; // edx@44 |
15131 int v28; // ecx@44 | 15132 //int v28; // ecx@44 |
15132 unsigned __int8 v29; // zf@44 | 15133 unsigned __int8 v29; // zf@44 |
15133 unsigned __int8 v30; // sf@44 | 15134 unsigned __int8 v30; // sf@44 |
15134 unsigned int v31; // [sp-8h] [bp-5Ch]@15 | 15135 unsigned int v31; // [sp-8h] [bp-5Ch]@15 |
15135 int v32; // [sp+1Ch] [bp-38h]@5 | 15136 int v32; // [sp+1Ch] [bp-38h]@5 |
15136 int a3; // [sp+20h] [bp-34h]@5 | 15137 int a3; // [sp+20h] [bp-34h]@5 |
15184 v8 = p->uCurrentActionTime; | 15185 v8 = p->uCurrentActionTime; |
15185 LABEL_12: | 15186 LABEL_12: |
15186 if (p->pActorBuffs[5].uExpireTime > 0i64 || p->pActorBuffs[6].uExpireTime > 0i64 ) | 15187 if (p->pActorBuffs[5].uExpireTime > 0i64 || p->pActorBuffs[6].uExpireTime > 0i64 ) |
15187 v8 = 0; | 15188 v8 = 0; |
15188 v31 = p->pSpriteIDs[v5]; | 15189 v31 = p->pSpriteIDs[v5]; |
15189 if (p->uAIState == 16 ) | 15190 if (p->uAIState == Resurrected) |
15190 v9 = pSpriteFrameTable->GetFrameBy_x(v31, v8); | 15191 v9 = pSpriteFrameTable->GetFrameBy_x(v31, v8); |
15191 else | 15192 else |
15192 v9 = pSpriteFrameTable->GetFrame(v31, v8); | 15193 v9 = pSpriteFrameTable->GetFrame(v31, v8); |
15193 v41 = 0; | 15194 v41 = 0; |
15194 v10 = v9; | 15195 v10 = v9; |
15215 0xFFu, | 15216 0xFFu, |
15216 0xFFu, | 15217 0xFFu, |
15217 v11); | 15218 v11); |
15218 } | 15219 } |
15219 v12 = 0; | 15220 v12 = 0; |
15220 if ( pStru170->field_53730 <= 0 ) | 15221 if ( pStru170->uNumVisibleNotEmptySectors <= 0 ) |
15221 continue; | 15222 continue; |
15222 while (pStru170->pSectorIDs_toDrawDecorationsFrom[v12] != p->uSectorID) | 15223 while (pStru170->pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[v12] != p->uSectorID) |
15223 { | 15224 { |
15224 ++v12; | 15225 ++v12; |
15225 if ( v12 >= pStru170->field_53730 ) | 15226 if ( v12 >= pStru170->uNumVisibleNotEmptySectors ) |
15226 continue; | 15227 goto _continue; |
15227 } | 15228 } |
15228 if ( !pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1a, a2, a3, &x, &y, &z, 1) | 15229 if ( !pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1a, a2, a3, &x, &y, &z, 1) |
15229 || (v0 = (RenderBillboard *)abs(x), (signed int)v0 < abs(y)) ) | 15230 || (v0 = (RenderBillboard *)abs(x), (signed int)v0 < abs(y)) ) |
15230 continue; | 15231 continue; |
15231 pGame->pIndoorCameraD3D->Project(x, y, z, &v43, &a6); | 15232 pGame->pIndoorCameraD3D->Project(x, y, z, &v43, &a6); |
15248 v0->field_0 = (unsigned __int64)(v10->scale * v20 / x) >> 16; | 15249 v0->field_0 = (unsigned __int64)(v10->scale * v20 / x) >> 16; |
15249 a5a = (unsigned __int64)(v10->scale * (signed __int64)v21) >> 16; | 15250 a5a = (unsigned __int64)(v10->scale * (signed __int64)v21) >> 16; |
15250 } | 15251 } |
15251 else | 15252 else |
15252 { | 15253 { |
15253 v14 = &pGame->pIndoorCameraD3D; | 15254 //v14 = &pGame->pIndoorCameraD3D; |
15254 v0->flt_8 = pGame->pIndoorCameraD3D->flt_D0; | 15255 v0->flt_8 = pGame->pIndoorCameraD3D->flt_D0; |
15255 v15 = (*v14)->flt_D4; | 15256 v15 = pGame->pIndoorCameraD3D->flt_D4; |
15256 v16 = v0->flt_8; | 15257 v16 = v0->flt_8; |
15257 v0->flt_C = v15; | 15258 v0->flt_C = v15; |
15258 v17 = v16 + 6.7553994e15; | 15259 //v17 = v16 + 6.7553994e15; |
15259 LODWORD(v18) = 0; | 15260 LODWORD(v18) = 0; |
15260 HIDWORD(v18) = SLOWORD(v17); | 15261 HIDWORD(v18) = floorf(v16 + 0.5f); |
15261 v19 = v18 / x; | 15262 v19 = v18 / x; |
15262 v0->field_0 = (unsigned __int64)(v10->scale * v18 / x) >> 16; | 15263 v0->field_0 = (unsigned __int64)(v10->scale * v18 / x) >> 16; |
15263 a5a = (unsigned __int64)(v10->scale * (signed __int64)v19) >> 16; | 15264 a5a = (unsigned __int64)(v10->scale * (signed __int64)v19) >> 16; |
15264 } | 15265 } |
15265 v0->field_4 = a5a; | 15266 v0->field_4 = a5a; |
15293 v0->uScreenSpaceX = v43; | 15294 v0->uScreenSpaceX = v43; |
15294 v0->uScreenSpaceY = a6; | 15295 v0->uScreenSpaceY = a6; |
15295 LOWORD(v25) = 0; | 15296 LOWORD(v25) = 0; |
15296 LOBYTE(v26) = v41; | 15297 LOBYTE(v26) = v41; |
15297 v0->sZValue = v25 + (8 * i | 3); | 15298 v0->sZValue = v25 + (8 * i | 3); |
15298 v27 = pMonsterList->pMonsters; | 15299 //v27 = pMonsterList->pMonsters; |
15299 v28 = p->pMonsterInfo.uID; | 15300 //v28 = p->pMonsterInfo.uID; |
15300 v29 = HIDWORD(p->pActorBuffs[5].uExpireTime) == 0; | 15301 v29 = HIDWORD(p->pActorBuffs[5].uExpireTime) == 0; |
15301 v30 = HIDWORD(p->pActorBuffs[5].uExpireTime) < 0; | 15302 v30 = HIDWORD(p->pActorBuffs[5].uExpireTime) < 0; |
15302 v0->field_1E = v41; | 15303 v0->field_1E = v41; |
15303 v0->pSpriteFrame = v10; | 15304 v0->pSpriteFrame = v10; |
15304 v0->uTintColor = *((_DWORD *)&v27[v28] - 36); | 15305 v0->uTintColor = pMonsterList->pMonsters[p->pMonsterInfo.uID - 1].uTintColor; |
15305 if ( !v30 && (!(v30 | v29) || LODWORD(p->pActorBuffs[5].uExpireTime)) ) | 15306 if ( !v30 && (!(v30 | v29) || LODWORD(p->pActorBuffs[5].uExpireTime)) ) |
15306 { | 15307 { |
15307 HIBYTE(v26) = HIBYTE(v41) | 1; | 15308 HIBYTE(v26) = HIBYTE(v41) | 1; |
15308 v0->field_1E = v26; | 15309 v0->field_1E = v26; |
15309 } | 15310 } |
15311 | |
15312 _continue: | |
15313 ; | |
15310 } | 15314 } |
15311 } | 15315 } |
15312 | 15316 |
15313 | 15317 |
15314 | 15318 |