comparison mm7_4.cpp @ 729:8323734d58c8

Fixed few errors in blv walking commit.
author Nomad
date Fri, 22 Mar 2013 00:27:11 +0200
parents 9f596a163257
children 79ad0526166c 14cf77af15de
comparison
equal deleted inserted replaced
728:9f596a163257 729:8323734d58c8
241 int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID) 241 int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID)
242 { 242 {
243 int v13; // ecx@13 243 int v13; // ecx@13
244 signed int v14; // ebx@14 244 signed int v14; // ebx@14
245 int v15; // eax@16 245 int v15; // eax@16
246 int v16; // edx@19 246 //int v16; // edx@19
247 int v17; // ST18_4@19 247 int v17; // ST18_4@19
248 signed int v18; // edx@19 248 signed int v18; // edx@19
249 signed __int64 v19; // qtt@19 249 signed __int64 v19; // qtt@19
250 int v21; // eax@27 250 int v21; // eax@27
251 int v22; // ecx@29 251 int v22; // ecx@29
308 else 308 else
309 { 309 {
310 v13 = i; 310 v13 = i;
311 v14 = word_721460[i + 1] >= x ? 0 : 2; 311 v14 = word_721460[i + 1] >= x ? 0 : 2;
312 v15 = v14 | word_721460[i] < x; 312 v15 = v14 | word_721460[i] < x;
313 if ( v15 != 3 ) 313
314 if ( !v15)
315 ++v53;
316 else
317 {
318 //v16 = word_721390[i];
319 v17 = word_721390[i + 1] - word_721390[i];
320 v18 = y - word_721390[i];
321 LODWORD(v19) = v18 << 16;
322 HIDWORD(v19) = v18 >> 16;
323 if ((signed int)(((unsigned __int64)(((signed int)word_721460[i + 1] - (signed int)word_721460[i]) * v19 / v17) >> 16) + word_721460[i]) >= x)
324 ++v53;
325 }
326 /*if ( v15 != 3 )
314 { 327 {
315 if ( !v15 ) 328 if ( !v15 )
316 { 329 {
317 LODWORD(v19) = (y - word_721390[i]) << 16; 330 LODWORD(v19) = (y - word_721390[i]) << 16;
318 HIDWORD(v19) = (y - word_721390[i]) >> 16; 331 HIDWORD(v19) = (y - word_721390[i]) >> 16;
319 v16 = ((((word_721460[i + 1] - word_721460[i]) * v19 / (word_721390[i + 1] - word_721390[i])) >> 16) + word_721460[i]); 332 v16 = ((((word_721460[i + 1] - word_721460[i]) * v19 / (word_721390[i + 1] - word_721390[i])) >> 16) + word_721460[i]);
320 if ( v16 >= x) 333 if ( v16 >= x)
321 ++v53; 334 ++v53;
322 } 335 }
323 } 336 }*/
324 } 337 }
325 v48 = v50; 338 v48 = v50;
326 } 339 }
327 if ( v53 == 1 ) 340 if ( v53 == 1 )
328 { 341 {
379 v28 = word_721460[i + 1] >= x ? 0 : 2; 392 v28 = word_721460[i + 1] >= x ? 0 : 2;
380 v29 = v28 | word_721460[i] < x; 393 v29 = v28 | word_721460[i] < x;
381 if ( v29 != 3 ) 394 if ( v29 != 3 )
382 { 395 {
383 if ( !v29 ) 396 if ( !v29 )
384 LODWORD(v33) = (y - word_721390[i]) << 16; 397 ++v54;
385 HIDWORD(v33) = (y - word_721390[i]) >> 16; 398 else
386 v30 = ((((word_721460[i + 1] - word_721460[i]) * v33 / (word_721390[i + 1] - word_721390[i])) >> 16) + word_721460[i]); 399 {
387 if ( v30 >= x) 400 //v30 = word_721390[v27];
401 v31 = word_721390[i + 1] - word_721390[i];
402 v32 = y - word_721390[i];
403 LODWORD(v33) = v32 << 16;
404 HIDWORD(v33) = v32 >> 16;
405 if ((signed int)(((unsigned __int64)(((signed int)word_721460[i + 1] - (signed int)word_721460[i]) * v33 / v31) >> 16) + word_721460[i]) >= x)
388 ++v54; 406 ++v54;
407 }
389 } 408 }
390 } 409 }
391 v49 = v47; 410 v49 = v47;
392 } 411 }
393 if ( v54 == 1 ) 412 if ( v54 == 1 )