comparison mm7_3.cpp @ 707:436ae1842e92

Decorations in blv
author Nomad
date Thu, 21 Mar 2013 10:21:46 +0200
parents d6236f6a9882
children af5771589d22
comparison
equal deleted inserted replaced
706:d6236f6a9882 707:436ae1842e92
11205 int v14; // ebx@16 11205 int v14; // ebx@16
11206 RenderBillboard *v15; // ecx@17 11206 RenderBillboard *v15; // ecx@17
11207 char v16; // zf@18 11207 char v16; // zf@18
11208 IndoorCameraD3D **v17; // eax@19 11208 IndoorCameraD3D **v17; // eax@19
11209 double v18; // st7@19 11209 double v18; // st7@19
11210 float v19; // eax@19 11210 //float v19; // eax@19
11211 signed __int64 v20; // qtt@19 11211 signed __int64 v20; // qtt@19
11212 signed __int64 v21; // qtt@20 11212 signed __int64 v21; // qtt@20
11213 int v22; // edx@21 11213 //int v22; // edx@21
11214 int v23; // eax@21 11214 //int v23; // eax@21
11215 Particle_sw local_0; // [sp+Ch] [bp-A0h]@3 11215 Particle_sw local_0; // [sp+Ch] [bp-A0h]@3
11216 double v25; // [sp+74h] [bp-38h]@19 11216 //double v25; // [sp+74h] [bp-38h]@19
11217 unsigned int v26; // [sp+7Ch] [bp-30h]@1 11217 //unsigned int v26; // [sp+7Ch] [bp-30h]@1
11218 int a2; // [sp+80h] [bp-2Ch]@5 11218 int a2; // [sp+80h] [bp-2Ch]@5
11219 int a3; // [sp+84h] [bp-28h]@5 11219 int a3; // [sp+84h] [bp-28h]@5
11220 int a1; // [sp+88h] [bp-24h]@5 11220 int a1; // [sp+88h] [bp-24h]@5
11221 int v30; // [sp+8Ch] [bp-20h]@7 11221 int v30; // [sp+8Ch] [bp-20h]@7
11222 float v31; // [sp+90h] [bp-1Ch]@1 11222 //float v31; // [sp+90h] [bp-1Ch]@1
11223 int a5; // [sp+94h] [bp-18h]@17 11223 int a5; // [sp+94h] [bp-18h]@17
11224 int z; // [sp+98h] [bp-14h]@15 11224 int z; // [sp+98h] [bp-14h]@15
11225 int a6; // [sp+9Ch] [bp-10h]@17 11225 int a6; // [sp+9Ch] [bp-10h]@17
11226 int y; // [sp+A0h] [bp-Ch]@15 11226 int y; // [sp+A0h] [bp-Ch]@15
11227 int x; // [sp+A4h] [bp-8h]@15 11227 int x; // [sp+A4h] [bp-8h]@15
11228 int v37; // [sp+A8h] [bp-4h]@5 11228 int v37; // [sp+A8h] [bp-4h]@5
11229 11229
11230 v26 = uDecorationID; 11230 //v26 = uDecorationID;
11231 LODWORD(v31) = uSectorID; 11231 //LODWORD(v31) = uSectorID;
11232 v2 = &pLevelDecorations[uDecorationID]; 11232 v2 = &pLevelDecorations[uDecorationID];
11233 if ( !(v2->field_2 & 0x20) ) 11233 if (v2->field_2 & 0x20)
11234 { 11234 return;
11235
11235 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID]; 11236 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
11236 v4 = v3->uFlags; 11237 v4 = v3->uFlags;
11237 if ( (char)v4 >= 0 ) 11238 if (v3->uFlags & DECORATION_EMITS_FIRE)
11238 { 11239 {
11239 if ( !(v4 & DECORATION_DONT_DRAW) ) 11240 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
11240 { 11241 v5 = (double)v2->vPosition.x;
11242 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
11243 local_0.uDiffuse = 0xFF3C1E;
11244 local_0.x = v5;
11245 local_0.y = (double)v2->vPosition.y;
11246 local_0.z = (double)v2->vPosition.z;
11247 local_0.flt_10 = 0.0;
11248 local_0.flt_14 = 0.0;
11249 local_0.flt_18 = 0.0;
11250 local_0.flt_28 = 1.0;
11251 local_0.timeToLive = (rand() & 0x80) + 128;
11252 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
11253 pGame->pParticleEngine->AddParticle(&local_0);
11254 return;
11255 }
11256
11257
11258 if (v4 & DECORATION_DONT_DRAW)
11259 return;
11260
11241 v6 = v2->vPosition.x; 11261 v6 = v2->vPosition.x;
11242 v7 = v2->vPosition.z; 11262 v7 = v2->vPosition.z;
11243 a2 = v2->vPosition.y; 11263 a2 = v2->vPosition.y;
11244 a1 = v6; 11264 a1 = v6;
11245 a3 = v7; 11265 a3 = v7;
11246 v8 = v2->field_10_y_rot 11266 v8 = v2->field_10_y_rot
11247 + ((signed int)stru_5C6E00->uIntegerPi >> 3) 11267 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
11248 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y); 11268 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
11249 v37 = pBLVRenderParams->field_0_timer_; 11269 v37 = pBLVRenderParams->field_0_timer_;
11250 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7; 11270 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
11251 if ( pParty->bTurnBasedModeOn == 1 ) 11271 if (pParty->bTurnBasedModeOn)
11252 v37 = pMiscTimer->uTotalGameTimeElapsed; 11272 v37 = pMiscTimer->uTotalGameTimeElapsed;
11253 v10 = abs(v2->vPosition.x + v2->vPosition.y); 11273 v10 = abs(v2->vPosition.x + v2->vPosition.y);
11254 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10); 11274 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
11255 v30 = 0; 11275 v30 = 0;
11256 v12 = v11; 11276 v12 = v11;
11267 { 11287 {
11268 v14 = abs(x); 11288 v14 = abs(x);
11269 if ( v14 >= abs(y) ) 11289 if ( v14 >= abs(y) )
11270 { 11290 {
11271 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6); 11291 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
11292
11272 v15 = &pBillboardRenderList[uNumBillboardsToDraw]; 11293 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
11273 if ( (signed int)uNumBillboardsToDraw < 500 ) 11294 assert(uNumBillboardsToDraw < 500);
11274 { 11295
11275 ++uNumBillboardsToDraw; 11296 ++uNumBillboardsToDraw;
11276 ++uNumDecorationsDrawnThisFrame; 11297 ++uNumDecorationsDrawnThisFrame;
11277 v16 = pRenderer->pRenderD3D == 0; 11298 v16 = pRenderer->pRenderD3D == 0;
11278 v15->uHwSpriteID = v12->pHwSpriteIDs[v9]; 11299 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
11279 v15->uPalette = v12->uPaletteIndex; 11300 v15->uPalette = v12->uPaletteIndex;
11280 v15->uIndoorSectorID = LOWORD(v31); 11301 v15->uIndoorSectorID = uSectorID;
11281 if ( v16 ) 11302 if ( v16 )
11282 { 11303 {
11283 LODWORD(v21) = pBLVRenderParams->field_40 << 16; 11304 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
11284 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16; 11305 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
11285 v37 = v21 / x; 11306 v37 = v21 / x;
11286 LODWORD(v31) = v12->scale; 11307 //LODWORD(v31) = v12->scale;
11287 v37 = v21 / x; 11308 v37 = v21 / x;
11288 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16; 11309 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v12->scale * v21 / x) >> 16;
11289 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16; 11310 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
11290 } 11311 }
11291 else 11312 else
11292 { 11313 {
11293 v17 = &pGame->pIndoorCameraD3D; 11314 v17 = &pGame->pIndoorCameraD3D;
11294 v15->fov_x = pGame->pIndoorCameraD3D->fov_x; 11315 v15->fov_x = pGame->pIndoorCameraD3D->fov_x;
11295 v18 = (*v17)->fov_y; 11316 v18 = (*v17)->fov_y;
11296 v19 = v15->fov_x; 11317 //v19 = v15->fov_x;
11297 v15->fov_y = v18; 11318 v15->fov_y = v18;
11298 v31 = v19; 11319 //v31 = v19;
11299 v25 = v19 + 6.7553994e15; 11320 //v25 = v19 + 6.7553994e15;
11321 //v25 = floorf(v15->fov_x + 0.5f);
11300 LODWORD(v20) = 0; 11322 LODWORD(v20) = 0;
11301 HIDWORD(v20) = SLOWORD(v25); 11323 HIDWORD(v20) = floorf(v15->fov_x + 0.5f);
11302 v37 = v20 / x; 11324 v37 = v20 / x;
11303 LODWORD(v31) = v12->scale; 11325 //LODWORD(v31) = v12->scale;
11304 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; 11326 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11305 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; 11327 v15->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11306 v31 = v15->fov_y; 11328 //v31 = v15->fov_y;
11307 v25 = v31 + 6.7553994e15; 11329 //v25 = v31 + 6.7553994e15;
11330 //v25 = floorf(v15->fov_y + 0.5f);
11308 LODWORD(v20) = 0; 11331 LODWORD(v20) = 0;
11309 HIDWORD(v20) = SLOWORD(v25); 11332 HIDWORD(v20) = floorf(v15->fov_y + 0.5f);
11310 v37 = v20 / x; 11333 v37 = v20 / x;
11311 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16; 11334 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
11312 } 11335 }
11313 HIWORD(v22) = HIWORD(x); 11336 //HIWORD(v22) = HIWORD(x);
11337 //LOWORD(v22) = 0;
11314 v15->_screenspace_y_scaler_packedfloat = v37; 11338 v15->_screenspace_y_scaler_packedfloat = v37;
11315 v15->field_1E = v30; 11339 v15->field_1E = v30;
11316 v15->world_x = a1; 11340 v15->world_x = a1;
11317 v15->world_y = a2; 11341 v15->world_y = a2;
11318 v15->world_z = a3; 11342 v15->world_z = a3;
11319 v15->uScreenSpaceX = a5; 11343 v15->uScreenSpaceX = a5;
11320 v15->uScreenSpaceY = a6; 11344 v15->uScreenSpaceY = a6;
11321 v23 = 8 * v26; 11345 //v23 = 8 * uDecorationID;
11322 LOBYTE(v23) = 8 * v26 | OBJECT_Decoration; 11346 //LOBYTE(v23) = 8 * uDecorationID | OBJECT_Decoration;
11323 LOWORD(v22) = 0;
11324 11347
11325 //v15->sZValue = v22 + v23; 11348 //v15->sZValue = v22 + v23;
11326 v15->actual_z = HIWORD(x); 11349 v15->actual_z = HIWORD(x);
11327 v15->object_pid = 8 * v26 | OBJECT_Decoration; 11350 v15->object_pid = 8 * uDecorationID | OBJECT_Decoration;
11328 11351
11329 v15->uTintColor = 0; 11352 v15->uTintColor = 0;
11330 v15->pSpriteFrame = v12; 11353 v15->pSpriteFrame = v12;
11331 }
11332 } 11354 }
11333 } 11355 }
11334 }
11335 }
11336 else
11337 {
11338 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
11339 v5 = (double)v2->vPosition.x;
11340 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
11341 local_0.uDiffuse = 0xFF3C1E;
11342 local_0.x = v5;
11343 local_0.y = (double)v2->vPosition.y;
11344 local_0.z = (double)v2->vPosition.z;
11345 local_0.flt_10 = 0.0;
11346 local_0.flt_14 = 0.0;
11347 local_0.flt_18 = 0.0;
11348 local_0.flt_28 = 1.0;
11349 local_0.timeToLive = (rand() & 0x80) + 128;
11350 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
11351 pGame->pParticleEngine->AddParticle(&local_0);
11352 }
11353 }
11354 } 11356 }
11355 11357
11356 11358
11357 //----- (0044028F) -------------------------------------------------------- 11359 //----- (0044028F) --------------------------------------------------------
11358 void PrepareItemsRenderList_BLV() 11360 void PrepareItemsRenderList_BLV()
11421 v10 = v5->pHwSpriteIDs[v9]; 11423 v10 = v5->pHwSpriteIDs[v9];
11422 v3->uHwSpriteID = v10; 11424 v3->uHwSpriteID = v10;
11423 if ( v30 & 0x20 ) 11425 if ( v30 & 0x20 )
11424 { 11426 {
11425 v8 = v30; 11427 v8 = v30;
11426 a3 -= (signed int)((unsigned __int64)(v5->scale 11428 a3 -= (signed int)((unsigned __int64)(v5->scale * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
11427 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
11428 } 11429 }
11429 v34 = 0; 11430 v34 = 0;
11430 if ( v8 & 2 ) 11431 if ( v8 & 2 )
11431 v34 = 2; 11432 v34 = 2;
11432 if ( v8 & 0x40000 ) 11433 if ( v8 & 0x40000 )