comparison mm7_3.cpp @ 724:737d7fec67f0

Слияние
author Ritor1
date Thu, 21 Mar 2013 16:09:59 +0600
parents 256211e8243a af5771589d22
children 9d13d2ec35a6
comparison
equal deleted inserted replaced
723:256211e8243a 724:737d7fec67f0
11171 int v14; // ebx@16 11171 int v14; // ebx@16
11172 RenderBillboard *v15; // ecx@17 11172 RenderBillboard *v15; // ecx@17
11173 char v16; // zf@18 11173 char v16; // zf@18
11174 IndoorCameraD3D **v17; // eax@19 11174 IndoorCameraD3D **v17; // eax@19
11175 double v18; // st7@19 11175 double v18; // st7@19
11176 float v19; // eax@19 11176 //float v19; // eax@19
11177 signed __int64 v20; // qtt@19 11177 signed __int64 v20; // qtt@19
11178 signed __int64 v21; // qtt@20 11178 signed __int64 v21; // qtt@20
11179 int v22; // edx@21 11179 //int v22; // edx@21
11180 int v23; // eax@21 11180 //int v23; // eax@21
11181 Particle_sw local_0; // [sp+Ch] [bp-A0h]@3 11181 Particle_sw local_0; // [sp+Ch] [bp-A0h]@3
11182 double v25; // [sp+74h] [bp-38h]@19 11182 //double v25; // [sp+74h] [bp-38h]@19
11183 unsigned int v26; // [sp+7Ch] [bp-30h]@1 11183 //unsigned int v26; // [sp+7Ch] [bp-30h]@1
11184 int a2; // [sp+80h] [bp-2Ch]@5 11184 int a2; // [sp+80h] [bp-2Ch]@5
11185 int a3; // [sp+84h] [bp-28h]@5 11185 int a3; // [sp+84h] [bp-28h]@5
11186 int a1; // [sp+88h] [bp-24h]@5 11186 int a1; // [sp+88h] [bp-24h]@5
11187 int v30; // [sp+8Ch] [bp-20h]@7 11187 int v30; // [sp+8Ch] [bp-20h]@7
11188 float v31; // [sp+90h] [bp-1Ch]@1 11188 //float v31; // [sp+90h] [bp-1Ch]@1
11189 int a5; // [sp+94h] [bp-18h]@17 11189 int a5; // [sp+94h] [bp-18h]@17
11190 int z; // [sp+98h] [bp-14h]@15 11190 int z; // [sp+98h] [bp-14h]@15
11191 int a6; // [sp+9Ch] [bp-10h]@17 11191 int a6; // [sp+9Ch] [bp-10h]@17
11192 int y; // [sp+A0h] [bp-Ch]@15 11192 int y; // [sp+A0h] [bp-Ch]@15
11193 int x; // [sp+A4h] [bp-8h]@15 11193 int x; // [sp+A4h] [bp-8h]@15
11194 int v37; // [sp+A8h] [bp-4h]@5 11194 int v37; // [sp+A8h] [bp-4h]@5
11195 11195
11196 v26 = uDecorationID; 11196 //v26 = uDecorationID;
11197 LODWORD(v31) = uSectorID; 11197 //LODWORD(v31) = uSectorID;
11198 v2 = &pLevelDecorations[uDecorationID]; 11198 v2 = &pLevelDecorations[uDecorationID];
11199 if ( !(v2->field_2 & 0x20) ) 11199 if (v2->field_2 & 0x20)
11200 { 11200 return;
11201
11201 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID]; 11202 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
11202 v4 = v3->uFlags; 11203 v4 = v3->uFlags;
11203 if ( (char)v4 >= 0 ) 11204 if (v3->uFlags & DECORATION_EMITS_FIRE)
11204 { 11205 {
11205 if ( !(v4 & DECORATION_DONT_DRAW) ) 11206 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
11206 { 11207 v5 = (double)v2->vPosition.x;
11208 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
11209 local_0.uDiffuse = 0xFF3C1E;
11210 local_0.x = v5;
11211 local_0.y = (double)v2->vPosition.y;
11212 local_0.z = (double)v2->vPosition.z;
11213 local_0.flt_10 = 0.0;
11214 local_0.flt_14 = 0.0;
11215 local_0.flt_18 = 0.0;
11216 local_0.flt_28 = 1.0;
11217 local_0.timeToLive = (rand() & 0x80) + 128;
11218 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
11219 pGame->pParticleEngine->AddParticle(&local_0);
11220 return;
11221 }
11222
11223
11224 if (v4 & DECORATION_DONT_DRAW)
11225 return;
11226
11207 v6 = v2->vPosition.x; 11227 v6 = v2->vPosition.x;
11208 v7 = v2->vPosition.z; 11228 v7 = v2->vPosition.z;
11209 a2 = v2->vPosition.y; 11229 a2 = v2->vPosition.y;
11210 a1 = v6; 11230 a1 = v6;
11211 a3 = v7; 11231 a3 = v7;
11212 v8 = v2->field_10_y_rot 11232 v8 = v2->field_10_y_rot
11213 + ((signed int)stru_5C6E00->uIntegerPi >> 3) 11233 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
11214 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y); 11234 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
11215 v37 = pBLVRenderParams->field_0_timer_; 11235 v37 = pBLVRenderParams->field_0_timer_;
11216 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7; 11236 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
11217 if ( pParty->bTurnBasedModeOn == 1 ) 11237 if (pParty->bTurnBasedModeOn)
11218 v37 = pMiscTimer->uTotalGameTimeElapsed; 11238 v37 = pMiscTimer->uTotalGameTimeElapsed;
11219 v10 = abs(v2->vPosition.x + v2->vPosition.y); 11239 v10 = abs(v2->vPosition.x + v2->vPosition.y);
11220 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10); 11240 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
11221 v30 = 0; 11241 v30 = 0;
11222 v12 = v11; 11242 v12 = v11;
11233 { 11253 {
11234 v14 = abs(x); 11254 v14 = abs(x);
11235 if ( v14 >= abs(y) ) 11255 if ( v14 >= abs(y) )
11236 { 11256 {
11237 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6); 11257 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
11258
11238 v15 = &pBillboardRenderList[uNumBillboardsToDraw]; 11259 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
11239 if ( (signed int)uNumBillboardsToDraw < 500 ) 11260 assert(uNumBillboardsToDraw < 500);
11240 { 11261
11241 ++uNumBillboardsToDraw; 11262 ++uNumBillboardsToDraw;
11242 ++uNumDecorationsDrawnThisFrame; 11263 ++uNumDecorationsDrawnThisFrame;
11243 v16 = pRenderer->pRenderD3D == 0; 11264 v16 = pRenderer->pRenderD3D == 0;
11244 v15->uHwSpriteID = v12->pHwSpriteIDs[v9]; 11265 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
11245 v15->uPalette = v12->uPaletteIndex; 11266 v15->uPalette = v12->uPaletteIndex;
11246 v15->uIndoorSectorID = LOWORD(v31); 11267 v15->uIndoorSectorID = uSectorID;
11247 if ( v16 ) 11268 if ( v16 )
11248 { 11269 {
11249 LODWORD(v21) = pBLVRenderParams->field_40 << 16; 11270 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
11250 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16; 11271 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
11251 v37 = v21 / x; 11272 v37 = v21 / x;
11252 LODWORD(v31) = v12->scale; 11273 //LODWORD(v31) = v12->scale;
11253 v37 = v21 / x; 11274 v37 = v21 / x;
11254 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16; 11275 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v12->scale * v21 / x) >> 16;
11255 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16; 11276 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
11256 } 11277 }
11257 else 11278 else
11258 { 11279 {
11259 v17 = &pGame->pIndoorCameraD3D; 11280 v17 = &pGame->pIndoorCameraD3D;
11260 v15->fov_x = pGame->pIndoorCameraD3D->fov_x; 11281 v15->fov_x = pGame->pIndoorCameraD3D->fov_x;
11261 v18 = (*v17)->fov_y; 11282 v18 = (*v17)->fov_y;
11262 v19 = v15->fov_x; 11283 //v19 = v15->fov_x;
11263 v15->fov_y = v18; 11284 v15->fov_y = v18;
11264 v31 = v19; 11285 //v31 = v19;
11265 v25 = v19 + 6.7553994e15; 11286 //v25 = v19 + 6.7553994e15;
11287 //v25 = floorf(v15->fov_x + 0.5f);
11266 LODWORD(v20) = 0; 11288 LODWORD(v20) = 0;
11267 HIDWORD(v20) = SLOWORD(v25); 11289 HIDWORD(v20) = floorf(v15->fov_x + 0.5f);
11268 v37 = v20 / x; 11290 v37 = v20 / x;
11269 LODWORD(v31) = v12->scale; 11291 //LODWORD(v31) = v12->scale;
11270 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; 11292 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11271 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; 11293 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11272 v31 = v15->fov_y; 11294 //v31 = v15->fov_y;
11273 v25 = v31 + 6.7553994e15; 11295 //v25 = v31 + 6.7553994e15;
11296 //v25 = floorf(v15->fov_y + 0.5f);
11274 LODWORD(v20) = 0; 11297 LODWORD(v20) = 0;
11275 HIDWORD(v20) = SLOWORD(v25); 11298 HIDWORD(v20) = floorf(v15->fov_y + 0.5f);
11276 v37 = v20 / x; 11299 v37 = v20 / x;
11277 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16; 11300 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11278 } 11301 }
11279 HIWORD(v22) = HIWORD(x); 11302 //HIWORD(v22) = HIWORD(x);
11303 //LOWORD(v22) = 0;
11280 v15->_screenspace_y_scaler_packedfloat = v37; 11304 v15->_screenspace_y_scaler_packedfloat = v37;
11281 v15->field_1E = v30; 11305 v15->field_1E = v30;
11282 v15->world_x = a1; 11306 v15->world_x = a1;
11283 v15->world_y = a2; 11307 v15->world_y = a2;
11284 v15->world_z = a3; 11308 v15->world_z = a3;
11285 v15->uScreenSpaceX = a5; 11309 v15->uScreenSpaceX = a5;
11286 v15->uScreenSpaceY = a6; 11310 v15->uScreenSpaceY = a6;
11287 v23 = 8 * v26; 11311 //v23 = 8 * uDecorationID;
11288 LOBYTE(v23) = 8 * v26 | OBJECT_Decoration; 11312 //LOBYTE(v23) = 8 * uDecorationID | OBJECT_Decoration;
11289 LOWORD(v22) = 0;
11290 11313
11291 //v15->sZValue = v22 + v23; 11314 //v15->sZValue = v22 + v23;
11292 v15->actual_z = HIWORD(x); 11315 v15->actual_z = HIWORD(x);
11293 v15->object_pid = 8 * v26 | OBJECT_Decoration; 11316 v15->object_pid = 8 * uDecorationID | OBJECT_Decoration;
11294 11317
11295 v15->uTintColor = 0; 11318 v15->uTintColor = 0;
11296 v15->pSpriteFrame = v12; 11319 v15->pSpriteFrame = v12;
11297 }
11298 } 11320 }
11299 } 11321 }
11300 }
11301 }
11302 else
11303 {
11304 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
11305 v5 = (double)v2->vPosition.x;
11306 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
11307 local_0.uDiffuse = 0xFF3C1E;
11308 local_0.x = v5;
11309 local_0.y = (double)v2->vPosition.y;
11310 local_0.z = (double)v2->vPosition.z;
11311 local_0.flt_10 = 0.0;
11312 local_0.flt_14 = 0.0;
11313 local_0.flt_18 = 0.0;
11314 local_0.flt_28 = 1.0;
11315 local_0.timeToLive = (rand() & 0x80) + 128;
11316 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
11317 pGame->pParticleEngine->AddParticle(&local_0);
11318 }
11319 }
11320 } 11322 }
11321 11323
11322 11324
11323 //----- (0044028F) -------------------------------------------------------- 11325 //----- (0044028F) --------------------------------------------------------
11324 void PrepareItemsRenderList_BLV() 11326 void PrepareItemsRenderList_BLV()
11332 int v7; // ecx@12 11334 int v7; // ecx@12
11333 int v8; // edx@12 11335 int v8; // edx@12
11334 int v9; // ecx@12 11336 int v9; // ecx@12
11335 unsigned __int16 v10; // ax@12 11337 unsigned __int16 v10; // ax@12
11336 int *v11; // eax@20 11338 int *v11; // eax@20
11337 char v12; // zf@26 11339 //char v12; // zf@26
11338 int v18; // ST5C_4@27 11340 __int64 v18; // ST5C_4@27
11339 signed __int64 v19; // qtt@28 11341 signed __int64 v19; // qtt@28
11340 int v20; // ST5C_4@28 11342 int v20; // ST5C_4@28
11341 int v21; // edx@29 11343 //int v21; // edx@29
11342 __int16 v22; // ax@29 11344 __int16 v22; // ax@29
11343 int v23; // eax@29 11345 //int v23; // eax@29
11344 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12 11346 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
11345 __int16 a5; // [sp+28h] [bp-34h]@12 11347 //__int16 a5; // [sp+28h] [bp-34h]@12
11346 int a6; // [sp+2Ch] [bp-30h]@12 11348 int a6; // [sp+2Ch] [bp-30h]@12
11347 int a2; // [sp+30h] [bp-2Ch]@12 11349 int a2; // [sp+30h] [bp-2Ch]@12
11348 int a1; // [sp+34h] [bp-28h]@12 11350 int a1; // [sp+34h] [bp-28h]@12
11349 int v30; // [sp+38h] [bp-24h]@12 11351 int v30; // [sp+38h] [bp-24h]@12
11350 int v31; // [sp+38h] [bp-24h]@27 11352 int v31; // [sp+38h] [bp-24h]@27
11367 if ( ((v2 = p->uType, v2 < 1000) || v2 >= 10000) 11369 if ( ((v2 = p->uType, v2 < 1000) || v2 >= 10000)
11368 && (v2 < 500 || v2 >= 600) 11370 && (v2 < 500 || v2 >= 600)
11369 && (v2 < 811 || v2 >= 815) 11371 && (v2 < 811 || v2 >= 815)
11370 || pGame->pStru6Instance->_4A81CA(p)) 11372 || pGame->pStru6Instance->_4A81CA(p))
11371 { 11373 {
11372 a5 = p->uSectorID; 11374 //a5 = p->uSectorID;
11373 a1 = p->vPosition.x; 11375 a1 = p->vPosition.x;
11374 a2 = p->vPosition.y; 11376 a2 = p->vPosition.y;
11375 a3 = p->vPosition.z; 11377 a3 = p->vPosition.z;
11376 v3 = &pBillboardRenderList[uNumBillboardsToDraw]; 11378 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
11377 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID); 11379 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID);
11387 v10 = v5->pHwSpriteIDs[v9]; 11389 v10 = v5->pHwSpriteIDs[v9];
11388 v3->uHwSpriteID = v10; 11390 v3->uHwSpriteID = v10;
11389 if ( v30 & 0x20 ) 11391 if ( v30 & 0x20 )
11390 { 11392 {
11391 v8 = v30; 11393 v8 = v30;
11392 a3 -= (signed int)((unsigned __int64)(v5->scale 11394 a3 -= (signed int)((unsigned __int64)(v5->scale * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
11393 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
11394 } 11395 }
11395 v34 = 0; 11396 v34 = 0;
11396 if ( v8 & 2 ) 11397 if ( v8 & 2 )
11397 v34 = 2; 11398 v34 = 2;
11398 if ( v8 & 0x40000 ) 11399 if ( v8 & 0x40000 )
11407 LOBYTE(v11) = byte_4E94D3; 11408 LOBYTE(v11) = byte_4E94D3;
11408 pMobileLightsStack->AddLight( 11409 pMobileLightsStack->AddLight(
11409 a1, 11410 a1,
11410 a2, 11411 a2,
11411 a3, 11412 a3,
11412 a5, 11413 p->uSectorID,
11413 a6, 11414 a6,
11414 v1->uParticleTrailColorR, 11415 v1->uParticleTrailColorR,
11415 v1->uParticleTrailColorG, 11416 v1->uParticleTrailColorG,
11416 v1->uParticleTrailColorB, 11417 v1->uParticleTrailColorB,
11417 byte_4E94D3); 11418 byte_4E94D3);
11424 &y, 11425 &y,
11425 &z, 11426 &z,
11426 1) ) 11427 1) )
11427 { 11428 {
11428 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35); 11429 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
11429 if ( (signed int)uNumBillboardsToDraw >= 500 ) 11430
11430 return; 11431 assert(uNumBillboardsToDraw < 500);
11432 //if ( (signed int)uNumBillboardsToDraw >= 500 )
11433 // return;
11431 ++uNumBillboardsToDraw; 11434 ++uNumBillboardsToDraw;
11432 ++uNumSpritesDrawnThisFrame; 11435 ++uNumSpritesDrawnThisFrame;
11433 p->uAttributes |= 1u; 11436 p->uAttributes |= 1u;
11434 v12 = pRenderer->pRenderD3D == 0; 11437 //v12 = pRenderer->pRenderD3D == 0;
11435 v3->uPalette = v24->uPaletteIndex; 11438 v3->uPalette = v24->uPaletteIndex;
11436 v3->uIndoorSectorID = a5; 11439 v3->uIndoorSectorID = p->uSectorID;
11437 if ( v12 ) 11440 if ( pRenderer->pRenderD3D )
11441 {
11442 v3->fov_x = pGame->pIndoorCameraD3D->fov_x;
11443 v3->fov_y = pGame->pIndoorCameraD3D->fov_y;
11444 LODWORD(v18) = 0;
11445 HIDWORD(v18) = (int)floorf(v3->fov_x + 0.5f);
11446 v18 = v18 / x;
11447 v3->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v24->scale * v18) >> 16;
11448 v31 = (unsigned __int64)(v24->scale * v18) >> 16;
11449 }
11450 else
11438 { 11451 {
11439 LODWORD(v19) = pBLVRenderParams->field_40 << 16; 11452 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
11440 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16; 11453 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
11441 v20 = v19 / x; 11454 v20 = v19 / x;
11442 v3->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v24->scale * v19 / x) >> 16; 11455 v3->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v24->scale * v19 / x) >> 16;
11443 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16; 11456 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
11444 } 11457 }
11445 else 11458 //HIWORD(v21) = HIWORD(x);
11446 { 11459 //LOWORD(v21) = 0;
11447 v3->fov_x = pGame->pIndoorCameraD3D->fov_x;
11448 v3->fov_y = pGame->pIndoorCameraD3D->fov_y;
11449 v18 = (int)floorf(v3->fov_x + 0.5f) / x;
11450 v3->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
11451 v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
11452 }
11453 HIWORD(v21) = HIWORD(x);
11454 v3->_screenspace_y_scaler_packedfloat = v31; 11460 v3->_screenspace_y_scaler_packedfloat = v31;
11455 v3->field_1E = v34; 11461 v3->field_1E = v34;
11456 v3->world_x = a1; 11462 v3->world_x = a1;
11457 v3->world_y = a2; 11463 v3->world_y = a2;
11458 v3->world_z = a3; 11464 v3->world_z = a3;
11459 v3->uScreenSpaceX = v36; 11465 v3->uScreenSpaceX = v36;
11460 v22 = v35; 11466 v22 = v35;
11461 v3->uTintColor = 0; 11467 v3->uTintColor = 0;
11462 v3->uScreenSpaceY = v22; 11468 v3->uScreenSpaceY = v22;
11463 LOWORD(v21) = 0; 11469 //v23 = 8 * i;
11464 v23 = 8 * i; 11470 //LOBYTE(v23) = 8 * i | OBJECT_Item;
11465 LOBYTE(v23) = 8 * i | OBJECT_Item;
11466 v3->pSpriteFrame = v24; 11471 v3->pSpriteFrame = v24;
11467 v12 = (p->uAttributes & 0x20) == 0; 11472 //v12 = (p->uAttributes & 0x20) == 0;
11468 v3->sZValue = v21 + v23; 11473 //v3->sZValue = v21 + v23;
11469 if ( !v12 ) 11474 v3->actual_z = HIWORD(x);
11475 v3->object_pid = 8 * i | OBJECT_Item;
11476 if (p->uAttributes & 0x20)
11470 { 11477 {
11471 if ( !pRenderer->pRenderD3D ) 11478 if ( !pRenderer->pRenderD3D )
11472 v3->sZValue = 0; 11479 v3->sZValue = 0;
11473 } 11480 }
11474 } 11481 }