Mercurial > mm7
comparison UI/Books/UIMapBook.cpp @ 1722:e1c451f4d5ba
m
author | Ritor1 |
---|---|
date | Wed, 25 Sep 2013 11:12:49 +0600 |
parents | 5f2583a4fa7d |
children | 8de9b24ace86 |
comparison
equal
deleted
inserted
replaced
1721:1c072d19e397 | 1722:e1c451f4d5ba |
---|---|
263 | 263 |
264 //----- (00442955) -------------------------------------------------------- | 264 //----- (00442955) -------------------------------------------------------- |
265 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) | 265 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) |
266 { | 266 { |
267 int v20; // eax@16 | 267 int v20; // eax@16 |
268 signed int v21; // esi@18 | |
269 int v22; // ecx@21 | |
270 BLVMapOutline *v23; // ecx@21 | |
271 Vec3_short_ *v24; // edx@21 | |
272 Vec3_short_ *v25; // eax@21 | |
273 int v26; // ecx@21 | 268 int v26; // ecx@21 |
274 unsigned __int16 *v27; // edi@21 | 269 unsigned __int16 *v27; // edi@21 |
275 int v28; // edx@21 | 270 int v28; // edx@21 |
276 int v29; // eax@21 | 271 int v29; // eax@21 |
277 double v30; // st7@23 | 272 double v30; // st7@23 |
311 unsigned int v65; // ebx@95 | 306 unsigned int v65; // ebx@95 |
312 unsigned short *v66; // edx@95 | 307 unsigned short *v66; // edx@95 |
313 unsigned __int16 *v67; // esi@96 | 308 unsigned __int16 *v67; // esi@96 |
314 int v68; // edi@98 | 309 int v68; // edi@98 |
315 unsigned __int16 v69; // cx@99 | 310 unsigned __int16 v69; // cx@99 |
316 unsigned int v70; // [sp-10h] [bp-48074h]@80 | |
317 unsigned int v71; // [sp-Ch] [bp-48070h]@80 | |
318 unsigned int v72; // [sp-8h] [bp-4806Ch]@80 | |
319 signed int v73; // [sp-4h] [bp-48068h]@59 | 311 signed int v73; // [sp-4h] [bp-48068h]@59 |
320 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 | 312 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 |
321 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 | 313 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 |
322 int v76; // [sp+4800Ch] [bp-58h]@23 | 314 int v76; // [sp+4800Ch] [bp-58h]@23 |
323 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 | 315 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 |
324 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 | 316 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 |
325 int v81; // [sp+48020h] [bp-44h]@23 | 317 int map_tile_X; // [sp+48020h] [bp-44h]@23 |
326 unsigned __int16* render16_data; | 318 unsigned __int16* render16_data; |
327 unsigned char* texture8_data; | 319 unsigned char* texture8_data; |
328 unsigned char* curr_line; | 320 unsigned char* curr_line; |
329 int scale_increment; | 321 int scale_increment; |
330 int scaled_posX; | 322 int scaled_posX; |
341 int screenCenterY; // [sp+48044h] [bp-20h]@1 | 333 int screenCenterY; // [sp+48044h] [bp-20h]@1 |
342 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 | 334 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 |
343 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 | 335 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 |
344 signed int screenWidth; // [sp+48054h] [bp-10h]@8 | 336 signed int screenWidth; // [sp+48054h] [bp-10h]@8 |
345 unsigned int v95; // [sp+48058h] [bp-Ch]@16 | 337 unsigned int v95; // [sp+48058h] [bp-Ch]@16 |
346 int v96; // [sp+4805Ch] [bp-8h]@10 | 338 int map_tile_Y; // [sp+4805Ch] [bp-8h]@10 |
347 const void *v97; // [sp+48060h] [bp-4h]@16 | 339 const void *v97; // [sp+48060h] [bp-4h]@16 |
348 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 | 340 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 |
349 int a5a; // [sp+48070h] [bp+Ch]@86 | 341 int a5a; // [sp+48070h] [bp+Ch]@86 |
350 | 342 |
351 screenCenter_X = (signed int)(tl_x + br_x) / 2; | 343 screenCenter_X = (signed int)(tl_x + br_x) / 2; |
443 { | 435 { |
444 v93 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX); | 436 v93 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX); |
445 screenHeight = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y - pCenterY; | 437 screenHeight = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y - pCenterY; |
446 v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY; | 438 v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY; |
447 v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX; | 439 v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX; |
448 v97 = (const void *)v20; | 440 |
449 v88 = (unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 441 v88 = (unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
450 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 442 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
451 v93 = (unsigned __int16 *)((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); | 443 v93 = (unsigned __int16 *)((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); |
452 screenHeight = (unsigned __int64)(v20 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 444 screenHeight = (unsigned __int64)(v20 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
453 pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87, | 445 pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87, |
454 screenCenter_X + ((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - screenHeight, black); | 446 screenCenter_X + ((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - screenHeight, black); |
455 } | 447 } |
456 } | 448 } |
457 } | 449 } |
458 } | 450 } |
459 v21 = 0; | |
460 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) | 451 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) |
461 { | 452 { |
462 while ( 1 ) | 453 for ( uint j = 0; j < (signed int)uNumBlueFacesInBLVMinimap; ++j ) |
463 { | 454 { |
464 v22 = pBlueFacesInBLVMinimapIDs[v21]; | 455 v26 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].x; |
465 v87 = viewparams->uMapBookMapZoom; | 456 v27 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].x - pCenterX); |
466 v23 = &pIndoor->pMapOutlines->pOutlines[v22]; | 457 v28 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].y - pCenterY; |
467 v24 = &pIndoor->pVertices[v23->uVertex1ID]; | 458 v29 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].y - pCenterY; |
468 v25 = &pIndoor->pVertices[v23->uVertex2ID]; | 459 |
469 v26 = v25->x; | |
470 v27 = (unsigned __int16 *)(v24->x - pCenterX); | |
471 v28 = v24->y - pCenterY; | |
472 v29 = v25->y - pCenterY; | |
473 v93 = v27; | |
474 screenHeight = v28; | |
475 v97 = (const void *)v29; | |
476 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 460 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
477 v88 = (unsigned __int64)(v28 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 461 v88 = (unsigned __int64)(v28 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
478 uint i = (unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 462 uint i = (unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
479 v95 = (unsigned __int64)(v29 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; | 463 v95 = (unsigned __int64)(v29 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; |
480 pRenderer->RasterLine2D(screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16), | 464 pRenderer->RasterLine2D(screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16), |
481 screenCenterY - v88, screenCenter_X + ((unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - v95, teal); | 465 screenCenterY - v88, screenCenter_X + ((unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - v95, teal); |
482 ++v21; | |
483 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) | |
484 break; | |
485 } | 466 } |
486 viewparams->sViewCenterX = pCenterX; | 467 viewparams->sViewCenterX = pCenterX; |
487 } | 468 } |
488 } | 469 } |
489 v47 = ((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 3; | 470 v47 = ((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 3; |
490 v81 = pParty->vPosition.y - pCenterY; | 471 //v81 = pParty->vPosition.y - pCenterY; |
491 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - pCenterY) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); | 472 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - pCenterY) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); |
492 v48 = 1; | 473 v48 = 1; |
493 v49 = screenCenterY - (int)v97 - 3; | 474 v49 = screenCenterY - (int)v97 - 3; |
494 if ( v47 >= (signed int)tl_x ) | 475 if ( v47 >= (signed int)tl_x ) |
495 { | 476 { |
540 v50 = 0; | 521 v50 = 0; |
541 if ( (signed int)v51 < 128 || (signed int)v51 > 1920 ) | 522 if ( (signed int)v51 < 128 || (signed int)v51 > 1920 ) |
542 v50 = 7; | 523 v50 = 7; |
543 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50])); | 524 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50])); |
544 } | 525 } |
545 result = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
546 pCenterX = result; | |
547 if ( (signed int)uNumLevelDecorations > 0 ) | 526 if ( (signed int)uNumLevelDecorations > 0 ) |
548 { | 527 { |
549 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i ) | 528 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i ) |
550 { | 529 { |
551 if (pLevelDecorations[i].uFlags & LEVEL_DECORATION_VISIBLE_ON_MAP) | 530 if (pLevelDecorations[i].uFlags & LEVEL_DECORATION_VISIBLE_ON_MAP) |
553 screenHeight = pLevelDecorations[i].vPosition.y - pCenterY; | 532 screenHeight = pLevelDecorations[i].vPosition.y - pCenterY; |
554 v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX); | 533 v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX); |
555 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X; | 534 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X; |
556 v97 = (const void *)((unsigned __int64)(screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16); | 535 v97 = (const void *)((unsigned __int64)(screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16); |
557 v55 = screenCenterY - (int)v97; | 536 v55 = screenCenterY - (int)v97; |
558 if ( v54 >= pRenderer->raster_clip_x ) | 537 if ( v54 >= pRenderer->raster_clip_x && v54 <= pRenderer->raster_clip_z |
559 { | 538 && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w ) |
560 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w ) | 539 { |
540 if ( viewparams->uMapBookMapZoom > 512 ) | |
561 { | 541 { |
562 if ( viewparams->uMapBookMapZoom > 512 ) | 542 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, TargetColor(0xFFu, 0xFFu, 0xFFu)); |
563 { | 543 pRenderer->RasterLine2D(v54, v55 - 1, v54, v55 + 1, TargetColor(0xFFu, 0xFFu, 0xFFu)); |
564 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, pCenterX); | 544 pRenderer->RasterLine2D(v54 + 1, v55 - 1, v54 + 1, v55 + 1, TargetColor(0xFFu, 0xFFu, 0xFFu)); |
565 pRenderer->RasterLine2D(v54, v55 - 1, v54, v55 + 1, pCenterX); | |
566 ++v54; | |
567 v72 = v55 + 1; | |
568 v71 = v54; | |
569 v70 = v55 - 1; | |
570 } | |
571 else | |
572 { | |
573 v72 = screenCenterY - (int)v97; | |
574 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X; | |
575 v70 = screenCenterY - (int)v97; | |
576 } | |
577 pRenderer->RasterLine2D(v54, v70, v71, v72, pCenterX); | |
578 } | 545 } |
546 else | |
547 pRenderer->RasterLine2D(v54, screenCenterY - (int)v97, | |
548 ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X, | |
549 screenCenterY - (int)v97, TargetColor(0xFFu, 0xFFu, 0xFFu)); | |
579 } | 550 } |
580 } | 551 } |
581 } | 552 } |
582 } | 553 } |
583 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 554 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
584 { | 555 { |
585 screenCenterY = br_x - tl_x + 1; | 556 screenCenterY = br_x - tl_x + 1; |
586 v95 = br_y - tl_y + 1; | 557 v95 = br_y - tl_y + 1; |
587 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch]; | 558 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch]; |
588 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | 559 //v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; |
589 black = (1 << (v56 + 16)) / viewparams->uMapBookMapZoom; | 560 black = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / viewparams->uMapBookMapZoom; |
590 v57 = (double)(1 << (16 - v56)); | 561 v57 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); |
591 v58 = 22528 / (viewparams->uMapBookMapZoom / 384); | 562 //v58 = 22528 / (viewparams->uMapBookMapZoom / 384); |
592 v59 = (signed __int64)((double)(viewparams->sViewCenterX - v58 + 32768) / v57); | 563 //v59 = (signed __int64)((double)(viewparams->sViewCenterX - (22528 / (viewparams->uMapBookMapZoom / 384)) + 32768) / v57); |
593 v60 = (int)v59 << 16; | 564 v60 = (int)((signed __int64)((double)(viewparams->sViewCenterX - (22528 / (viewparams->uMapBookMapZoom / 384)) + 32768) / v57)) << 16; |
594 v97 = (const void *)((int)v59 << 16); | 565 teal = v60 >> 16; |
595 v61 = (signed __int64)((double)(32768 - v58 - pCenterY) / v57); | |
596 pPalette_16 = (unsigned __int16 *)(v60 >> 16); | 566 pPalette_16 = (unsigned __int16 *)(v60 >> 16); |
597 v62 = (int)v61 << 16; | 567 v97 = (const void *)((int)((signed __int64)((double)(viewparams->sViewCenterX - (22528 / (viewparams->uMapBookMapZoom / 384)) + 32768) / v57)) << 16); |
598 teal = v60 >> 16; | 568 //v61 = (signed __int64)((double)(32768 - (22528 / (viewparams->uMapBookMapZoom / 384)) - pCenterY) / v57); |
599 v63 = (signed __int16)v61; | 569 v62 = (int)((signed __int64)((double)(32768 - (22528 / (viewparams->uMapBookMapZoom / 384)) - pCenterY) / v57)) << 16; |
570 v63 = (signed __int16)((signed __int64)((double)(32768 - (22528 / (viewparams->uMapBookMapZoom / 384)) - pCenterY) / v57)); | |
600 a4a = map_texture_16; | 571 a4a = map_texture_16; |
601 result = TargetColor(0xCu, 0xCu, 0xCu); | |
602 for ( screenCenter_X = 0; screenCenter_X < (signed int)v95; ++screenCenter_X ) | 572 for ( screenCenter_X = 0; screenCenter_X < (signed int)v95; ++screenCenter_X ) |
603 { | 573 { |
604 if ( screenCenterY > 0 ) | 574 if ( screenCenterY > 0 ) |
605 { | 575 { |
606 v96 = (v63 - 80) / 4; | 576 map_tile_Y = (v63 - 80) / 4; |
607 v64 = teal; | 577 v64 = teal; |
608 for ( a5a = 0; a5a < screenCenterY; ++a5a ) | 578 for ( a5a = 0; a5a < screenCenterY; ++a5a ) |
609 { | 579 { |
610 v81 = (v64 - 80) / 4; | 580 map_tile_X = (v64 - 80) / 4; |
611 if ( !pOutdoor->_47F04C(v81, v96) ) | 581 if ( !pOutdoor->_47F04C(map_tile_X, map_tile_Y) ) |
612 { | 582 { |
613 if ( pOutdoor->_47F097(v81, v96) ) | 583 if ( pOutdoor->_47F097(map_tile_X, map_tile_Y) ) |
614 { | 584 { |
615 if ( !((a5a + screenCenter_X) % 2) ) | 585 if ( !((a5a + screenCenter_X) % 2) ) |
616 *a4a = result; | 586 *a4a = TargetColor(0xCu, 0xCu, 0xCu); |
617 } | 587 } |
618 else | 588 else |
619 *a4a = 0; | 589 *a4a = 0; |
620 } | 590 } |
621 ++a4a; | 591 ++a4a; |
650 v67 = (unsigned __int16 *)((char *)v67 + result); | 620 v67 = (unsigned __int16 *)((char *)v67 + result); |
651 } | 621 } |
652 } | 622 } |
653 } | 623 } |
654 } | 624 } |
625 | |
626 //----- (00444564) -------------------------------------------------------- | |
627 const char * GetMapBookHintText() | |
628 { | |
629 int v20; | |
630 int v21; // [sp+14h] [bp-Ch]@1 | |
631 double v0; // st7@3 | |
632 unsigned int pX; // [sp+1Ch] [bp-4h]@3 | |
633 unsigned int pY; // [sp+8h] [bp-18h]@3 | |
634 int global_coord_X; // ebx@3 | |
635 int global_coord_Y; | |
636 int map_tile_X; // edi@3 | |
637 int map_tile_Y; // eax@3 | |
638 const char *result; // eax@15 | |
639 | |
640 v20 = viewparams->sViewCenterX; | |
641 v21 = viewparams->sViewCenterY; | |
642 if ( viewparams->uMapBookMapZoom == 384 ) | |
643 { | |
644 v20 = viewparams->indoor_center_x; | |
645 v21 = viewparams->indoor_center_y; | |
646 } | |
647 pMouse->GetClickPos(&pX, &pY); | |
648 v0 = 1.0 / (float)((signed int)viewparams->uMapBookMapZoom * 0.000015258789); | |
649 | |
650 global_coord_X = (signed __int64)((double)(pX - 229) * v0 + (double)v20); | |
651 global_coord_Y = (signed __int64)((double)v21 - (double)(pY - 181) * v0); | |
652 | |
653 result = 0; | |
654 map_tile_X = abs(global_coord_X + 22528) / 512; | |
655 map_tile_Y = abs(global_coord_Y - 22528) / 512; | |
656 if ( pOutdoor->_47F04C(map_tile_X, map_tile_Y) && uCurrentlyLoadedLevelType == LEVEL_Outdoor && (signed int)pOutdoor->uNumBModels > 0 ) | |
657 { | |
658 for(int i = 0; i < pOutdoor->uNumBModels && !result; i++) | |
659 { | |
660 if ( int_get_vector_length(abs((signed)pOutdoor->pBModels[i].vBoundingCenter.x - global_coord_X), | |
661 abs((signed)pOutdoor->pBModels[i].vBoundingCenter.y - global_coord_Y), 0) < pOutdoor->pBModels[i].sBoundingRadius ) | |
662 { | |
663 if ( pOutdoor->pBModels[i].uNumFaces > 0 ) | |
664 { | |
665 for( int j = 0; j < pOutdoor->pBModels[i].uNumFaces; j++ ) | |
666 { | |
667 if ( pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID ) | |
668 { | |
669 if ( !(pOutdoor->pBModels[i].pFaces[j].uAttributes & 0x100000) ) | |
670 { | |
671 if ( GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID) ) | |
672 { | |
673 if ( _stricmp(GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID), "") ) | |
674 result = GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID); | |
675 } | |
676 } | |
677 } | |
678 } | |
679 } | |
680 } | |
681 } | |
682 } | |
683 return result; | |
684 } |