comparison Render.cpp @ 743:353ff9ea11e6

m
author Ritor1
date Fri, 22 Mar 2013 23:42:09 +0600
parents cd9ae9a2c99c
children 852ec78d9548
comparison
equal deleted inserted replaced
742:bd611ae85d27 743:353ff9ea11e6
8207 8207
8208 8208
8209 //----- (004A354F) -------------------------------------------------------- 8209 //----- (004A354F) --------------------------------------------------------
8210 void Render::MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) 8210 void Render::MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle)
8211 { 8211 {
8212 double v5; // st7@3 8212 //double v5; // st7@3
8213 float v6; // ST20_4@3 8213 //float v6; // ST20_4@3
8214 float v7; // ST00_4@3 8214 //float v7; // ST00_4@3
8215 unsigned int v8; // esi@3 8215 unsigned int v8; // esi@3
8216 int v9; // eax@3 8216 //int v9; // eax@3
8217 int v10; // ebx@3 8217 //int v10; // ebx@3
8218 float v11; // ST28_4@3 8218 float v11; // ST28_4@3
8219 double v12; // st7@3 8219 //double v12; // st7@3
8220 float v13; // ST24_4@3 8220 //float v13; // ST24_4@3
8221 double v14; // st6@3 8221 //double v14; // st6@3
8222 float v15; // ST1C_4@3 8222 //float v15; // ST1C_4@3
8223 float v16; // ST2C_4@3 8223 float v16; // ST2C_4@3
8224 float v17; // ST30_4@3 8224 float v17; // ST30_4@3
8225 signed int v18; // ST18_4@3 8225 signed int v18; // ST18_4@3
8226 signed int v19; // ST14_4@3 8226 signed int v19; // ST14_4@3
8227 signed int v20; // ST10_4@3 8227 signed int v20; // ST10_4@3
8254 8254
8255 if ( this->uNumD3DSceneBegins ) 8255 if ( this->uNumD3DSceneBegins )
8256 { 8256 {
8257 if (a2->zbuffer_depth) 8257 if (a2->zbuffer_depth)
8258 { 8258 {
8259 v5 = (double)a2->zbuffer_depth; 8259 //v5 = (double)a2->zbuffer_depth;
8260 v6 = v5; 8260 //v6 = v5;
8261 v7 = v5; 8261 //v7 = v5;
8262 v8 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v7)); 8262 v8 = Billboard_ProbablyAddToListAndSortByZOrder(a2->zbuffer_depth);
8263 pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_1; 8263 pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_1;
8264 pBillboardRenderListD3D[v8].field_90 = a2->field_44; 8264 pBillboardRenderListD3D[v8].field_90 = a2->field_44;
8265 pBillboardRenderListD3D[v8].sZValue = a2->sZValue; 8265 pBillboardRenderListD3D[v8].sZValue = a2->sZValue;
8266 pBillboardRenderListD3D[v8].uParentBillboardID = a2->uParentBillboardID; 8266 pBillboardRenderListD3D[v8].uParentBillboardID = a2->uParentBillboardID;
8267 v9 = a2->uScreenSpaceX; 8267 //v9 = a2->uScreenSpaceX;
8268 v10 = a2->uScreenSpaceY; 8268 //v10 = a2->uScreenSpaceY;
8269 v11 = (a2->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(a2->_screenspace_x_scaler_packedfloat); 8269 v11 = (a2->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(a2->_screenspace_x_scaler_packedfloat);
8270 v12 = (double)v9; 8270 //v12 = (double) a2->uScreenSpaceX;
8271 v13 = v12; 8271 //v13 = v12;
8272 v14 = (double)(v10 - 12); 8272 //v14 = (double)(a2->uScreenSpaceY - 12);
8273 v15 = v14; 8273 //v15 = v14;
8274 v16 = (double)(v9 - 12) - v12; 8274 v16 = (double)( a2->uScreenSpaceX - 12) - (double) a2->uScreenSpaceX;
8275 v17 = (double)(v10 - 25) - v14; 8275 v17 = (double)(a2->uScreenSpaceY - 25) - (double)(a2->uScreenSpaceY - 12);
8276 v18 = stru_5C6E00->Cos(angle); 8276 v18 = stru_5C6E00->Cos(angle);
8277 v19 = stru_5C6E00->Sin(angle); 8277 v19 = stru_5C6E00->Sin(angle);
8278 v20 = stru_5C6E00->Sin(angle); 8278 v20 = stru_5C6E00->Sin(angle);
8279 v21 = stru_5C6E00->Cos(angle); 8279 v21 = stru_5C6E00->Cos(angle);
8280 pBillboardRenderListD3D[v8].pQuards[0].pos.x = (((double)(unsigned __int16)v18 * 0.000015259022 8280 pBillboardRenderListD3D[v8].pQuards[0].pos.x = (((double)(unsigned __int16)v18 * 0.000015259022
8281 + (double)(v18 >> 16)) 8281 + (double)(v18 >> 16))
8282 * v16 8282 * v16
8283 - ((double)(unsigned __int16)v19 * 0.000015259022 8283 - ((double)(unsigned __int16)v19 * 0.000015259022
8284 + (double)(v19 >> 16)) 8284 + (double)(v19 >> 16))
8285 * v17) 8285 * v17)
8286 * v11 + v13; 8286 * v11 + (double) a2->uScreenSpaceX;
8287 v22 = (((double)(unsigned __int16)v21 * 0.000015259022 + (double)(v21 >> 16)) * v17 8287 v22 = (((double)(unsigned __int16)v21 * 0.000015259022 + (double)(v21 >> 16)) * v17
8288 + ((double)(unsigned __int16)v20 * 0.000015259022 + (double)(v20 >> 16)) * v16 8288 + ((double)(unsigned __int16)v20 * 0.000015259022 + (double)(v20 >> 16)) * v16
8289 - 12.0) 8289 - 12.0)
8290 * v11 8290 * v11
8291 + (double)a2->uScreenSpaceY; 8291 + (double)a2->uScreenSpaceY;
8292 pBillboardRenderListD3D[v8].pQuards[0].specular = 0; 8292 pBillboardRenderListD3D[v8].pQuards[0].specular = 0;
8293 pBillboardRenderListD3D[v8].pQuards[0].diffuse = uDiffuse; 8293 pBillboardRenderListD3D[v8].pQuards[0].diffuse = uDiffuse;
8294 pBillboardRenderListD3D[v8].pQuards[0].pos.y = v22; 8294 pBillboardRenderListD3D[v8].pQuards[0].pos.y = v22;
8295 pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - 1.0 / (v6 * 0.061758894); 8295 pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - 1.0 / (a2->zbuffer_depth * 0.061758894);
8296 pBillboardRenderListD3D[v8].pQuards[0].rhw = 1.0 / v6; 8296 pBillboardRenderListD3D[v8].pQuards[0].rhw = 1.0 / a2->zbuffer_depth;
8297 pBillboardRenderListD3D[v8].pQuards[0].texcoord.x = 0.0; 8297 pBillboardRenderListD3D[v8].pQuards[0].texcoord.x = 0.0;
8298 pBillboardRenderListD3D[v8].pQuards[0].texcoord.y = 0.0; 8298 pBillboardRenderListD3D[v8].pQuards[0].texcoord.y = 0.0;
8299 v31 = (double)(a2->uScreenSpaceX + 12) - v13; 8299 v31 = (double)(a2->uScreenSpaceX + 12) - (double) a2->uScreenSpaceX;
8300 v32 = (double)a2->uScreenSpaceY - v15; 8300 v32 = (double)a2->uScreenSpaceY - (double)(a2->uScreenSpaceY - 12);
8301 v25 = stru_5C6E00->Cos(angle); 8301 v25 = stru_5C6E00->Cos(angle);
8302 v26 = stru_5C6E00->Sin(angle); 8302 v26 = stru_5C6E00->Sin(angle);
8303 v27 = stru_5C6E00->Sin(angle); 8303 v27 = stru_5C6E00->Sin(angle);
8304 v28 = stru_5C6E00->Cos(angle); 8304 v28 = stru_5C6E00->Cos(angle);
8305 pBillboardRenderListD3D[v8].pQuards[1].pos.x = (((double)(unsigned __int16)v25 * 0.000015259022 8305 pBillboardRenderListD3D[v8].pQuards[1].pos.x = (((double)(unsigned __int16)v25 * 0.000015259022
8306 + (double)(v25 >> 16)) 8306 + (double)(v25 >> 16))
8307 * v31 8307 * v31
8308 - ((double)(unsigned __int16)v26 * 0.000015259022 8308 - ((double)(unsigned __int16)v26 * 0.000015259022
8309 + (double)(v26 >> 16)) 8309 + (double)(v26 >> 16))
8310 * v32) 8310 * v32)
8311 * v11 + v13; 8311 * v11 + (double) a2->uScreenSpaceX;
8312 v29 = (((double)(unsigned __int16)v28 * 0.000015259022 + (double)(v28 >> 16)) * v32 8312 v29 = (((double)(unsigned __int16)v28 * 0.000015259022 + (double)(v28 >> 16)) * v32
8313 + ((double)(unsigned __int16)v27 * 0.000015259022 + (double)(v27 >> 16)) * v31 8313 + ((double)(unsigned __int16)v27 * 0.000015259022 + (double)(v27 >> 16)) * v31
8314 - 12.0) 8314 - 12.0)
8315 * v11 8315 * v11
8316 + (double)a2->uScreenSpaceY; 8316 + (double)a2->uScreenSpaceY;
8320 pBillboardRenderListD3D[v8].pQuards[1].specular = 0; 8320 pBillboardRenderListD3D[v8].pQuards[1].specular = 0;
8321 pBillboardRenderListD3D[v8].pQuards[1].rhw = v30; 8321 pBillboardRenderListD3D[v8].pQuards[1].rhw = v30;
8322 pBillboardRenderListD3D[v8].pQuards[1].diffuse = uDiffuse; 8322 pBillboardRenderListD3D[v8].pQuards[1].diffuse = uDiffuse;
8323 pBillboardRenderListD3D[v8].pQuards[1].texcoord.x = 0.0; 8323 pBillboardRenderListD3D[v8].pQuards[1].texcoord.x = 0.0;
8324 pBillboardRenderListD3D[v8].pQuards[1].texcoord.y = 1.0; 8324 pBillboardRenderListD3D[v8].pQuards[1].texcoord.y = 1.0;
8325 v23 = (double)(a2->uScreenSpaceX - 12) - v13; 8325 v23 = (double)(a2->uScreenSpaceX - 12) - (double) a2->uScreenSpaceX;
8326 v24 = (double)a2->uScreenSpaceY - v15; 8326 v24 = (double)a2->uScreenSpaceY - (double)(a2->uScreenSpaceY - 12);
8327 v33 = stru_5C6E00->Cos(angle); 8327 v33 = stru_5C6E00->Cos(angle);
8328 v34 = stru_5C6E00->Sin(angle); 8328 v34 = stru_5C6E00->Sin(angle);
8329 v35 = stru_5C6E00->Sin(angle); 8329 v35 = stru_5C6E00->Sin(angle);
8330 v36 = stru_5C6E00->Cos(angle); 8330 v36 = stru_5C6E00->Cos(angle);
8331 pBillboardRenderListD3D[v8].pQuards[2].pos.x = (((double)(unsigned __int16)v33 * 0.000015259022 8331 pBillboardRenderListD3D[v8].pQuards[2].pos.x = (((double)(unsigned __int16)v33 * 0.000015259022
8332 + (double)(v33 >> 16)) 8332 + (double)(v33 >> 16))
8333 * v23 8333 * v23
8334 - ((double)(unsigned __int16)v34 * 0.000015259022 8334 - ((double)(unsigned __int16)v34 * 0.000015259022
8335 + (double)(v34 >> 16)) 8335 + (double)(v34 >> 16))
8336 * v24) 8336 * v24)
8337 * v11 + v13; 8337 * v11 + (double) a2->uScreenSpaceX;
8338 v37 = pBillboardRenderListD3D[v8].pQuards[0].pos.z; 8338 v37 = pBillboardRenderListD3D[v8].pQuards[0].pos.z;
8339 v38 = (((double)(unsigned __int16)v36 * 0.000015259022 + (double)(v36 >> 16)) * v24 8339 v38 = (((double)(unsigned __int16)v36 * 0.000015259022 + (double)(v36 >> 16)) * v24
8340 + ((double)(unsigned __int16)v35 * 0.000015259022 + (double)(v35 >> 16)) * v23 8340 + ((double)(unsigned __int16)v35 * 0.000015259022 + (double)(v35 >> 16)) * v23
8341 - 12.0) 8341 - 12.0)
8342 * v11 8342 * v11
8346 pBillboardRenderListD3D[v8].pQuards[2].rhw = pBillboardRenderListD3D[v8].pQuards[0].rhw; 8346 pBillboardRenderListD3D[v8].pQuards[2].rhw = pBillboardRenderListD3D[v8].pQuards[0].rhw;
8347 pBillboardRenderListD3D[v8].pQuards[2].diffuse = uDiffuse; 8347 pBillboardRenderListD3D[v8].pQuards[2].diffuse = uDiffuse;
8348 pBillboardRenderListD3D[v8].pQuards[2].pos.y = v38; 8348 pBillboardRenderListD3D[v8].pQuards[2].pos.y = v38;
8349 pBillboardRenderListD3D[v8].pQuards[2].texcoord.x = 1.0; 8349 pBillboardRenderListD3D[v8].pQuards[2].texcoord.x = 1.0;
8350 pBillboardRenderListD3D[v8].pQuards[2].texcoord.y = 1.0; 8350 pBillboardRenderListD3D[v8].pQuards[2].texcoord.y = 1.0;
8351 v39 = (double)(a2->uScreenSpaceX + 12) - v13; 8351 v39 = (double)(a2->uScreenSpaceX + 12) - (double) a2->uScreenSpaceX;
8352 v40 = (double)(a2->uScreenSpaceY - 25) - v15; 8352 v40 = (double)(a2->uScreenSpaceY - 25) - (double)(a2->uScreenSpaceY - 12);
8353 v41 = stru_5C6E00->Cos(angle); 8353 v41 = stru_5C6E00->Cos(angle);
8354 v42 = stru_5C6E00->Sin(angle); 8354 v42 = stru_5C6E00->Sin(angle);
8355 v43 = stru_5C6E00->Sin(angle); 8355 v43 = stru_5C6E00->Sin(angle);
8356 v44 = stru_5C6E00->Cos(angle); 8356 v44 = stru_5C6E00->Cos(angle);
8357 pBillboardRenderListD3D[v8].pQuards[3].pos.x = (((double)(unsigned __int16)v41 * 0.000015259022 8357 pBillboardRenderListD3D[v8].pQuards[3].pos.x = (((double)(unsigned __int16)v41 * 0.000015259022
8358 + (double)(v41 >> 16)) 8358 + (double)(v41 >> 16))
8359 * v39 8359 * v39
8360 - ((double)(unsigned __int16)v42 * 0.000015259022 8360 - ((double)(unsigned __int16)v42 * 0.000015259022
8361 + (double)(v42 >> 16)) 8361 + (double)(v42 >> 16))
8362 * v40) 8362 * v40)
8363 * v11 + v13; 8363 * v11 + (double) a2->uScreenSpaceX;
8364 v45 = (((double)(unsigned __int16)v44 * 0.000015259022 + (double)(v44 >> 16)) * v40 8364 v45 = (((double)(unsigned __int16)v44 * 0.000015259022 + (double)(v44 >> 16)) * v40
8365 + ((double)(unsigned __int16)v43 * 0.000015259022 + (double)(v43 >> 16)) * v39 8365 + ((double)(unsigned __int16)v43 * 0.000015259022 + (double)(v43 >> 16)) * v39
8366 - 12.0) 8366 - 12.0)
8367 * v11 8367 * v11
8368 + (double)a2->uScreenSpaceY; 8368 + (double)a2->uScreenSpaceY;
8370 pBillboardRenderListD3D[v8].pQuards[3].specular = 0; 8370 pBillboardRenderListD3D[v8].pQuards[3].specular = 0;
8371 pBillboardRenderListD3D[v8].pQuards[3].pos.z = v46; 8371 pBillboardRenderListD3D[v8].pQuards[3].pos.z = v46;
8372 pBillboardRenderListD3D[v8].pQuards[3].rhw = pBillboardRenderListD3D[v8].pQuards[0].rhw; 8372 pBillboardRenderListD3D[v8].pQuards[3].rhw = pBillboardRenderListD3D[v8].pQuards[0].rhw;
8373 pBillboardRenderListD3D[v8].pQuards[3].diffuse = uDiffuse; 8373 pBillboardRenderListD3D[v8].pQuards[3].diffuse = uDiffuse;
8374 pBillboardRenderListD3D[v8].pTexture = a3; 8374 pBillboardRenderListD3D[v8].pTexture = a3;
8375 pBillboardRenderListD3D[v8].z_order = v6; 8375 pBillboardRenderListD3D[v8].z_order = a2->zbuffer_depth;
8376 pBillboardRenderListD3D[v8].uNumVertices = 4; 8376 pBillboardRenderListD3D[v8].uNumVertices = 4;
8377 pBillboardRenderListD3D[v8].pQuards[3].pos.y = v45; 8377 pBillboardRenderListD3D[v8].pQuards[3].pos.y = v45;
8378 pBillboardRenderListD3D[v8].pQuards[3].texcoord.x = 1.0; 8378 pBillboardRenderListD3D[v8].pQuards[3].texcoord.x = 1.0;
8379 pBillboardRenderListD3D[v8].pQuards[3].texcoord.y = 0.0; 8379 pBillboardRenderListD3D[v8].pQuards[3].texcoord.y = 0.0;
8380 } 8380 }