Mercurial > mm7
comparison Indoor.cpp @ 2406:33659ef7fbac
Слияние
author | Ritor1 |
---|---|
date | Fri, 04 Jul 2014 23:18:36 +0600 |
parents | 22cbc67a619e |
children | 8cee51ce4382 |
comparison
equal
deleted
inserted
replaced
2405:c4d286e4bb80 | 2406:33659ef7fbac |
---|---|
3815 pSector = &pIndoor->pSectors[pBspRenderer->nodes[node_id].uSectorID]; | 3815 pSector = &pIndoor->pSectors[pBspRenderer->nodes[node_id].uSectorID]; |
3816 //if ( pRenderer->pRenderD3D ) | 3816 //if ( pRenderer->pRenderD3D ) |
3817 { | 3817 { |
3818 for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i) | 3818 for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i) |
3819 //Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); | 3819 //Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); |
3820 pBspRenderer->AddFaceToRenderList_d3d(node_id, pSector->pFaceIDs[i]); | 3820 pBspRenderer->AddFaceToRenderList_d3d(node_id, pSector->pFaceIDs[i]);//\recursion |
3821 } | 3821 } |
3822 /*else | 3822 /*else |
3823 { | 3823 { |
3824 for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i) | 3824 for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i) |
3825 pBspRenderer->AddFaceToRenderList_sw(node_id, pSector->pFaceIDs[i]); | 3825 pBspRenderer->AddFaceToRenderList_sw(node_id, pSector->pFaceIDs[i]); |
4137 this->field_28 = fixpoint_dot(this->angle_from_east, this->field_0_party_dir_x, | 4137 this->field_28 = fixpoint_dot(this->angle_from_east, this->field_0_party_dir_x, |
4138 this->angle_from_south, this->field_4_party_dir_y, | 4138 this->angle_from_south, this->field_4_party_dir_y, |
4139 this->viewing_angle_from_north_south, this->field_8_party_dir_z); | 4139 this->viewing_angle_from_north_south, this->field_8_party_dir_z); |
4140 } | 4140 } |
4141 //----- (00407A1C) -------------------------------------------------------- | 4141 //----- (00407A1C) -------------------------------------------------------- |
4142 bool __fastcall sub_407A1C(int x, int z, int y, Vec3_int_ v) | 4142 bool __fastcall sub_407A1C(int x, int y, int z, Vec3_int_ v) |
4143 { | 4143 { |
4144 unsigned int v4; // esi@1 | 4144 unsigned int v4; // esi@1 |
4145 int dist_y; // edi@2 | 4145 int dist_y; // edi@2 |
4146 int dist_z; // ebx@2 | 4146 int dist_z; // ebx@2 |
4147 int dist_x; // esi@2 | 4147 int dist_x; // esi@2 |
4150 int v12; // eax@4 | 4150 int v12; // eax@4 |
4151 int v17; // ST34_4@25 | 4151 int v17; // ST34_4@25 |
4152 int v18; // ST38_4@25 | 4152 int v18; // ST38_4@25 |
4153 int v19; // eax@25 | 4153 int v19; // eax@25 |
4154 char v20; // zf@25 | 4154 char v20; // zf@25 |
4155 int v21; // ebx@25 | 4155 signed int v21; // ebx@25 |
4156 signed int v23; // edi@26 | 4156 signed int v23; // edi@26 |
4157 int v24; // ST34_4@30 | 4157 int v24; // ST34_4@30 |
4158 Vec3_int_ v27; // ST08_12@37 | |
4159 Vec3_int_ v28; // ST08_12@37 | |
4160 signed int v32; // ecx@37 | 4158 signed int v32; // ecx@37 |
4161 int v33; // eax@37 | 4159 int v33; // eax@37 |
4162 int v35; // eax@39 | 4160 int v35; // eax@39 |
4163 ODMFace *odm_face; // esi@54 | 4161 ODMFace *odm_face; // esi@54 |
4164 int v40; // ebx@60 | 4162 signed int v40; // ebx@60 |
4165 signed int v42; // edi@61 | 4163 signed int v42; // edi@61 |
4166 Vec3_int_ v45; // ST08_12@73 | |
4167 signed int v49; // ecx@73 | 4164 signed int v49; // ecx@73 |
4168 int v50; // eax@73 | 4165 int v50; // eax@73 |
4169 int v51; // edx@75 | 4166 int v51; // edx@75 |
4170 int v52; // ecx@75 | 4167 int v52; // ecx@75 |
4171 int v53; // eax@75 | 4168 int v53; // eax@75 |
4172 int v59; // eax@90 | 4169 int v59; // eax@90 |
4173 BLVFace *face; // esi@91 | 4170 BLVFace *face; // esi@91 |
4174 int v63; // ST34_4@98 | 4171 int v63; // ST34_4@98 |
4175 int v64; // ST30_4@98 | 4172 int v64; // ST30_4@98 |
4176 int v65; // eax@98 | 4173 int v65; // eax@98 |
4177 int v66; // ebx@98 | 4174 signed int v66; // ebx@98 |
4178 signed int v68; // edi@99 | 4175 signed int v68; // edi@99 |
4179 int v69; // ST2C_4@103 | 4176 int v69; // ST2C_4@103 |
4180 Vec3_int_ v72; // ST08_12@111 | |
4181 signed int v77; // ecx@111 | 4177 signed int v77; // ecx@111 |
4182 int v78; // eax@111 | 4178 int v78; // eax@111 |
4183 int v79; // edx@113 | 4179 int v79; // edx@113 |
4184 int v80; // ecx@113 | 4180 int v80; // ecx@113 |
4185 int v81; // eax@113 | 4181 int v81; // eax@113 |
4186 int v87; // ecx@128 | 4182 int v87; // ecx@128 |
4187 int v91; // ebx@136 | 4183 signed int v91; // ebx@136 |
4188 signed int v93; // edi@137 | 4184 signed int v93; // edi@137 |
4189 Vec3_int_ v97; // [sp-18h] [bp-94h]@1 | 4185 Vec3_int_ v97; // [sp-18h] [bp-94h]@1 |
4190 int v98; // [sp-Ch] [bp-88h]@88 | |
4191 int v99; // [sp-Ch] [bp-88h]@126 | |
4192 int v100; // [sp-8h] [bp-84h]@88 | |
4193 int v101; // [sp-8h] [bp-84h]@126 | |
4194 int v102; // [sp-4h] [bp-80h]@88 | |
4195 int v103; // [sp-4h] [bp-80h]@126 | |
4196 int v107; // [sp+10h] [bp-6Ch]@98 | 4186 int v107; // [sp+10h] [bp-6Ch]@98 |
4197 int v108; // [sp+10h] [bp-6Ch]@104 | 4187 int v108; // [sp+10h] [bp-6Ch]@104 |
4198 int v109; // [sp+18h] [bp-64h]@25 | 4188 int v109; // [sp+18h] [bp-64h]@25 |
4199 int v110; // [sp+18h] [bp-64h]@31 | 4189 int v110; // [sp+18h] [bp-64h]@31 |
4200 signed int v113; // [sp+20h] [bp-5Ch]@1 | 4190 signed int v113; // [sp+20h] [bp-5Ch]@1 |
4201 signed int v114; // [sp+24h] [bp-58h]@1 | 4191 signed int v114; // [sp+24h] [bp-58h]@1 |
4202 unsigned int a4_8; // [sp+30h] [bp-4Ch]@1 | |
4203 int v119; // [sp+34h] [bp-48h]@75 | 4192 int v119; // [sp+34h] [bp-48h]@75 |
4204 int v120; // [sp+34h] [bp-48h]@113 | 4193 int v120; // [sp+34h] [bp-48h]@113 |
4205 int v121; // [sp+38h] [bp-44h]@4 | 4194 int v121; // [sp+38h] [bp-44h]@4 |
4206 int v122; // [sp+38h] [bp-44h]@39 | 4195 int v122; // [sp+38h] [bp-44h]@39 |
4207 int v123; // [sp+38h] [bp-44h]@76 | 4196 int v123; // [sp+38h] [bp-44h]@76 |
4255 int v_4c; // [sp+8Ch] [bp+10h]@141 | 4244 int v_4c; // [sp+8Ch] [bp+10h]@141 |
4256 // int v_8; // [sp+90h] [bp+14h]@53 | 4245 // int v_8; // [sp+90h] [bp+14h]@53 |
4257 | 4246 |
4258 //__debugbreak(); | 4247 //__debugbreak(); |
4259 | 4248 |
4260 v4 = stru_5C6E00->Atan2(v.x - x, v.y - z); | 4249 v4 = stru_5C6E00->Atan2(v.x - x, v.y - y); |
4250 | |
4251 v113 = 0; | |
4261 v114 = 0; | 4252 v114 = 0; |
4262 v97.z = y; | 4253 |
4254 v97.z = z; | |
4263 v97.x = x; | 4255 v97.x = x; |
4264 v97.y = z; | 4256 v97.y = y; |
4265 v113 = 0; | 4257 |
4266 a4_8 = stru_5C6E00->Atan2(v.x - x, v.y - z); | |
4267 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 4258 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4268 { | 4259 { |
4269 Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &sX, &sY, &sZ); | 4260 Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &sX, &sY, &sZ); |
4270 v45.z = v.z; | 4261 Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v, &outx, &outy, &outz); |
4271 v45.x = v.x; | |
4272 v45.y = v.y; | |
4273 Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v45, &outx, &outy, &outz); | |
4274 dist_y = outy - sY; | 4262 dist_y = outy - sY; |
4275 dist_z = outz - sZ; | 4263 dist_z = outz - sZ; |
4276 dist_x = outx - sX; | 4264 dist_x = outx - sX; |
4277 v49 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); | 4265 v49 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); |
4278 v50 = 65536; | 4266 v50 = 65536; |
4294 | 4282 |
4295 for ( a5b = 0; a5b < 2; a5b++ ) | 4283 for ( a5b = 0; a5b < 2; a5b++ ) |
4296 { | 4284 { |
4297 if ( a5b ) | 4285 if ( a5b ) |
4298 { | 4286 { |
4299 v102 = sZ; | 4287 v59 = pIndoor->GetSector(sX, sY, sZ); |
4300 v100 = sY; | |
4301 v98 = sX; | |
4302 } | 4288 } |
4303 else | 4289 else |
4304 { | 4290 { |
4305 v102 = outz; | 4291 v59 = pIndoor->GetSector(outx, outy, outz); |
4306 v100 = outy; | 4292 } |
4307 v98 = outx; | |
4308 } | |
4309 v59 = pIndoor->GetSector(v98, v100, v102); | |
4310 //v60 = pIndoor->pSectors; | 4293 //v60 = pIndoor->pSectors; |
4311 //v61 = 116 * v59; | 4294 //v61 = 116 * v59; |
4312 //i = 116 * v59; | 4295 //i = 116 * v59; |
4313 //for (sDepthb = 0; *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v61) | 4296 //for (sDepthb = 0; *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v61) |
4314 //+ 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v61); ++sDepthb) | 4297 //+ 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v61); ++sDepthb) |
4316 { | 4299 { |
4317 face = &pIndoor->pFaces[pIndoor->pSectors[v59].pFaceIDs[sDepthb]];// face = &pIndoor->pFaces[*(__int16 *)((char *)&pIndoor->pSectors->pWalls + v61)[sDepthb]] | 4300 face = &pIndoor->pFaces[pIndoor->pSectors[v59].pFaceIDs[sDepthb]];// face = &pIndoor->pFaces[*(__int16 *)((char *)&pIndoor->pSectors->pWalls + v61)[sDepthb]] |
4318 v63 = fixpoint_mul(v143, face->pFacePlane_old.vNormal.x); | 4301 v63 = fixpoint_mul(v143, face->pFacePlane_old.vNormal.x); |
4319 v64 = fixpoint_mul(v53, face->pFacePlane_old.vNormal.z); | 4302 v64 = fixpoint_mul(v53, face->pFacePlane_old.vNormal.z); |
4320 v65 = fixpoint_mul(v52, face->pFacePlane_old.vNormal.y); | 4303 v65 = fixpoint_mul(v52, face->pFacePlane_old.vNormal.y); |
4321 v20 = v63 + v64 + v65; | 4304 v20 = v63 + v64 + v65 == 0; |
4322 v66 = v63 + v64 + v65; | 4305 v66 = v63 + v64 + v65; |
4323 v107 = v63 + v64 + v65; | 4306 v107 = v63 + v64 + v65; |
4324 if ( face->Portal() | 4307 if ( face->Portal() |
4325 || v119 > face->pBounding.x2 || v123 < face->pBounding.x1 | 4308 || v119 > face->pBounding.x2 || v123 < face->pBounding.x1 |
4326 || v127 > face->pBounding.y2 || v131 < face->pBounding.y1 | 4309 || v127 > face->pBounding.y2 || v131 < face->pBounding.y1 |
4327 || v135 > face->pBounding.z2 || v139 < face->pBounding.z1 | 4310 || v135 > face->pBounding.z2 || v139 < face->pBounding.z1 |
4328 || !v20 ) | 4311 || v20 ) |
4329 continue; | 4312 continue; |
4330 v68 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x | 4313 v68 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x |
4331 + sY * face->pFacePlane_old.vNormal.y | 4314 + sY * face->pFacePlane_old.vNormal.y |
4332 + sZ * face->pFacePlane_old.vNormal.z); | 4315 + sZ * face->pFacePlane_old.vNormal.z); |
4333 if ( v66 <= 0 ) | 4316 if ( v66 <= 0 ) |
4367 } | 4350 } |
4368 } | 4351 } |
4369 } | 4352 } |
4370 } | 4353 } |
4371 | 4354 |
4372 v72.z = y; | 4355 Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX, &sY, &sZ); |
4373 v72.x = x; | 4356 Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz); |
4374 v72.y = z; | |
4375 Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v72, &sX, &sY, &sZ); | |
4376 Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz); | |
4377 dist_y = outy - sY; | 4357 dist_y = outy - sY; |
4378 dist_z = outz - sZ; | 4358 dist_z = outz - sZ; |
4379 dist_x = outx - sX; | 4359 dist_x = outx - sX; |
4380 v77 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); | 4360 v77 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); |
4381 v78 = 65536; | 4361 v78 = 65536; |
4399 { | 4379 { |
4400 if ( v113 ) | 4380 if ( v113 ) |
4401 return !v114 || !v113; | 4381 return !v114 || !v113; |
4402 if ( a5c ) | 4382 if ( a5c ) |
4403 { | 4383 { |
4404 v103 = sZ; | 4384 v87 = pIndoor->GetSector(sX, sY, sZ); |
4405 v101 = sY; | |
4406 v99 = sX; | |
4407 } | 4385 } |
4408 else | 4386 else |
4409 { | 4387 { |
4410 v103 = outz; | 4388 v87 = pIndoor->GetSector(outx, outy, outz); |
4411 v101 = outy; | 4389 } |
4412 v99 = outx; | |
4413 } | |
4414 v87 = pIndoor->GetSector(v99, v101, v103); | |
4415 //v88 = pIndoor->pSectors; | |
4416 //v89 = 116 * v87; | |
4417 | |
4418 //v112 = v89; | |
4419 //if ( *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v89) | |
4420 //+ 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v89) > 0 ) | |
4421 //{ | |
4422 //while ( 1 ) | |
4423 for ( v162 = 0; v162 < pIndoor->pSectors[v87].uNumFaces; v162++) | 4390 for ( v162 = 0; v162 < pIndoor->pSectors[v87].uNumFaces; v162++) |
4424 { | 4391 { |
4425 face = &pIndoor->pFaces[pIndoor->pSectors[v87].pFaceIDs[v162]]; | 4392 face = &pIndoor->pFaces[pIndoor->pSectors[v87].pFaceIDs[v162]]; |
4426 yb = fixpoint_mul(v144, face->pFacePlane_old.vNormal.x); | 4393 yb = fixpoint_mul(v144, face->pFacePlane_old.vNormal.x); |
4427 v_4b = fixpoint_mul(v80, face->pFacePlane_old.vNormal.y); | 4394 v_4b = fixpoint_mul(v80, face->pFacePlane_old.vNormal.y); |
4428 vf = fixpoint_mul(v81, face->pFacePlane_old.vNormal.z); | 4395 vf = fixpoint_mul(v81, face->pFacePlane_old.vNormal.z); |
4429 v20 = yb + vf + v_4b; | 4396 v20 = yb + vf + v_4b == 0; |
4430 v91 = yb + vf + v_4b; | 4397 v91 = yb + vf + v_4b; |
4431 vc = yb + vf + v_4b; | 4398 vc = yb + vf + v_4b; |
4432 if ( face->Portal() | 4399 if ( face->Portal() |
4433 || v120 > face->pBounding.x2 || v124 < face->pBounding.x1 | 4400 || v120 > face->pBounding.x2 || v124 < face->pBounding.x1 |
4434 || v128 > face->pBounding.y2 || v132 < face->pBounding.y1 | 4401 || v128 > face->pBounding.y2 || v132 < face->pBounding.y1 |
4435 || v136 > face->pBounding.z2 || v140 < face->pBounding.z1 | 4402 || v136 > face->pBounding.z2 || v140 < face->pBounding.z1 |
4436 || !v20 ) | 4403 || v20 ) |
4437 continue; | 4404 continue; |
4438 //v92 = sZ * face->pFacePlane_old.vNormal.z; | |
4439 v93 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x | 4405 v93 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x |
4440 + sY * face->pFacePlane_old.vNormal.y | 4406 + sY * face->pFacePlane_old.vNormal.y |
4441 + sZ * face->pFacePlane_old.vNormal.z); | 4407 + sZ * face->pFacePlane_old.vNormal.z); |
4442 if ( v91 <= 0 ) | 4408 if ( v91 <= 0 ) |
4443 { | 4409 { |
4456 v_4c = abs(-(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x | 4422 v_4c = abs(-(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x |
4457 + sY * face->pFacePlane_old.vNormal.y | 4423 + sY * face->pFacePlane_old.vNormal.y |
4458 + sZ * face->pFacePlane_old.vNormal.z)) >> 14; | 4424 + sZ * face->pFacePlane_old.vNormal.z)) >> 14; |
4459 if ( v_4c <= abs(v91) ) | 4425 if ( v_4c <= abs(v91) ) |
4460 { | 4426 { |
4461 //LODWORD(v94) = v93 << 16; | |
4462 //HIDWORD(v94) = v93 >> 16; | |
4463 //v95 = v94 / vc; | |
4464 //vd = v94 / vc; | |
4465 vd = fixpoint_div(v93, vc); | 4427 vd = fixpoint_div(v93, vc); |
4466 if ( vd >= 0 ) | 4428 if ( vd >= 0 ) |
4467 { | 4429 { |
4468 if ( sub_4075DB(sX + ((signed int)(fixpoint_mul(vd, v144) + 0x8000) >> 16), | 4430 if ( sub_4075DB(sX + ((signed int)(fixpoint_mul(vd, v144) + 0x8000) >> 16), |
4469 sY + ((signed int)(fixpoint_mul(vd, v80) + 0x8000) >> 16), | 4431 sY + ((signed int)(fixpoint_mul(vd, v80) + 0x8000) >> 16), |
4511 { | 4473 { |
4512 odm_face = &pOutdoor->pBModels[model_id].pFaces[face_id]; | 4474 odm_face = &pOutdoor->pBModels[model_id].pFaces[face_id]; |
4513 v17 = fixpoint_mul(v125, odm_face->pFacePlane.vNormal.x); | 4475 v17 = fixpoint_mul(v125, odm_face->pFacePlane.vNormal.x); |
4514 v18 = fixpoint_mul(v121, odm_face->pFacePlane.vNormal.y); | 4476 v18 = fixpoint_mul(v121, odm_face->pFacePlane.vNormal.y); |
4515 v19 = fixpoint_mul(v12, odm_face->pFacePlane.vNormal.z); | 4477 v19 = fixpoint_mul(v12, odm_face->pFacePlane.vNormal.z); |
4516 v20 = v17 + v18 + v19; | 4478 v20 = v17 + v18 + v19 == 0; |
4517 v21 = v17 + v18 + v19; | 4479 v21 = v17 + v18 + v19; |
4518 v109 = v17 + v18 + v19; | 4480 v109 = v17 + v18 + v19; |
4519 if ( v149 > odm_face->pBoundingBox.x2 || v145 < odm_face->pBoundingBox.x1 | 4481 if ( v149 > odm_face->pBoundingBox.x2 || v145 < odm_face->pBoundingBox.x1 |
4520 || v141 > odm_face->pBoundingBox.y2 || v137 < odm_face->pBoundingBox.y1 | 4482 || v141 > odm_face->pBoundingBox.y2 || v137 < odm_face->pBoundingBox.y1 |
4521 || v133 > odm_face->pBoundingBox.z2 || v129 < odm_face->pBoundingBox.z1 | 4483 || v133 > odm_face->pBoundingBox.z2 || v129 < odm_face->pBoundingBox.z1 |
4522 || !v20 ) | 4484 || v20 ) |
4523 continue; | 4485 continue; |
4524 v23 = -(odm_face->pFacePlane.dist + sX * odm_face->pFacePlane.vNormal.x | 4486 v23 = -(odm_face->pFacePlane.dist + sX * odm_face->pFacePlane.vNormal.x |
4525 + sY * odm_face->pFacePlane.vNormal.y | 4487 + sY * odm_face->pFacePlane.vNormal.y |
4526 + sZ * odm_face->pFacePlane.vNormal.z); | 4488 + sZ * odm_face->pFacePlane.vNormal.z); |
4527 if ( v21 <= 0 ) | 4489 if ( v21 <= 0 ) |
4541 v24 = abs(-(odm_face->pFacePlane.dist + sX * odm_face->pFacePlane.vNormal.x | 4503 v24 = abs(-(odm_face->pFacePlane.dist + sX * odm_face->pFacePlane.vNormal.x |
4542 + sY * odm_face->pFacePlane.vNormal.y | 4504 + sY * odm_face->pFacePlane.vNormal.y |
4543 + sZ * odm_face->pFacePlane.vNormal.z)) >> 14; | 4505 + sZ * odm_face->pFacePlane.vNormal.z)) >> 14; |
4544 if ( v24 <= abs(v21) ) | 4506 if ( v24 <= abs(v21) ) |
4545 { | 4507 { |
4546 //LODWORD(v25) = v23 << 16; | |
4547 //HIDWORD(v25) = v23 >> 16; | |
4548 //v26 = v25 / v109; | |
4549 //v110 = v25 / v109; | |
4550 v110 = fixpoint_div(v23, v109); | 4508 v110 = fixpoint_div(v23, v109); |
4551 if ( v110 >= 0 ) | 4509 if ( v110 >= 0 ) |
4552 { | 4510 { |
4553 if ( sub_4077F1(sX + ((signed int)(fixpoint_mul(v110, v125) + 0x8000) >> 16), | 4511 if ( sub_4077F1(sX + ((signed int)(fixpoint_mul(v110, v125) + 0x8000) >> 16), |
4554 sY + ((signed int)(fixpoint_mul(v110, v121) + 0x8000) >> 16), | 4512 sY + ((signed int)(fixpoint_mul(v110, v121) + 0x8000) >> 16), |
4563 } | 4521 } |
4564 } | 4522 } |
4565 } | 4523 } |
4566 } | 4524 } |
4567 | 4525 |
4568 v27.z = y; | 4526 Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX, &sY, &sZ); |
4569 v27.x = x; | 4527 Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx, &outy, &outz); |
4570 v27.y = z; | |
4571 Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v27, &sX, &sY, &sZ); | |
4572 v28.z = v.z; | |
4573 v28.x = v.x; | |
4574 v28.y = v.y; | |
4575 Vec3_int_::Rotate(32, a4_8 - stru_5C6E00->uIntegerHalfPi, 0, v28, &outx, &outy, &outz); | |
4576 dist_y = outy - sY; | 4528 dist_y = outy - sY; |
4577 dist_z = outz - sZ; | 4529 dist_z = outz - sZ; |
4578 dist_x = outx - sX; | 4530 dist_x = outx - sX; |
4579 v32 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); | 4531 v32 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z); |
4580 v33 = 65536; | 4532 v33 = 65536; |