Mercurial > mm7
comparison mm7_3.cpp @ 240:e9fabaf75628
map working
author | zipi |
---|---|
date | Sun, 17 Feb 2013 21:51:35 +0000 |
parents | ea0b5ff2ae23 |
children | 37dcbe8f3cca 48f21f569328 92a551e4dbeb |
comparison
equal
deleted
inserted
replaced
239:ea0b5ff2ae23 | 240:e9fabaf75628 |
---|---|
14385 //----- (00442955) -------------------------------------------------------- | 14385 //----- (00442955) -------------------------------------------------------- |
14386 int __fastcall DrawBook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074) | 14386 int __fastcall DrawBook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074) |
14387 { | 14387 { |
14388 int v5; // ebx@1 | 14388 int v5; // ebx@1 |
14389 int v6; // edi@1 | 14389 int v6; // edi@1 |
14390 unsigned int *v7; // eax@8 | 14390 BLVMapOutlines *v7; // eax@8 |
14391 unsigned __int8 v8; // zf@8 | 14391 unsigned __int8 v8; // zf@8 |
14392 unsigned __int8 v9; // sf@8 | 14392 unsigned __int8 v9; // sf@8 |
14393 int v10; // esi@10 | 14393 int v10; // esi@10 |
14394 unsigned int v11; // edx@11 | 14394 unsigned int v11; // edx@11 |
14395 __int16 v12; // cx@12 | 14395 __int16 v12; // cx@12 |
14401 Vec3_short_ *v18; // eax@16 | 14401 Vec3_short_ *v18; // eax@16 |
14402 int v19; // ecx@16 | 14402 int v19; // ecx@16 |
14403 int v20; // eax@16 | 14403 int v20; // eax@16 |
14404 signed int v21; // esi@18 | 14404 signed int v21; // esi@18 |
14405 int v22; // ecx@21 | 14405 int v22; // ecx@21 |
14406 int v23; // ecx@21 | 14406 BLVMapOutline *v23; // ecx@21 |
14407 Vec3_short_ *v24; // edx@21 | 14407 Vec3_short_ *v24; // edx@21 |
14408 Vec3_short_ *v25; // eax@21 | 14408 Vec3_short_ *v25; // eax@21 |
14409 int v26; // ecx@21 | 14409 int v26; // ecx@21 |
14410 unsigned __int16 *v27; // edi@21 | 14410 unsigned __int16 *v27; // edi@21 |
14411 int v28; // edx@21 | 14411 int v28; // edx@21 |
14412 int v29; // eax@21 | 14412 int v29; // eax@21 |
14413 double v30; // st7@23 | 14413 double v30; // st7@23 |
14414 signed __int64 v31; // qax@23 | 14414 signed __int64 v31; // qax@23 |
14415 char *v32; // edx@23 | 14415 unsigned short *v32; // edx@23 |
14416 int v33; // esi@23 | 14416 int v33; // esi@23 |
14417 signed int v34; // eax@23 | 14417 signed int v34; // eax@23 |
14418 signed int v35; // ecx@23 | 14418 signed int v35; // ecx@23 |
14419 int v36; // esi@27 | 14419 int v36; // esi@27 |
14420 int v37; // ecx@27 | 14420 int v37; // ecx@27 |
14421 int v38; // edx@31 | 14421 int v38; // edx@31 |
14422 unsigned int v39; // eax@33 | 14422 unsigned int v39; // eax@33 |
14423 const void *v40; // esi@33 | 14423 short *v40; // esi@33 |
14424 unsigned __int16 *v41; // edi@33 | 14424 short *v41; // edi@33 |
14425 unsigned __int8 v42; // cf@33 | 14425 unsigned __int8 v42; // cf@33 |
14426 unsigned int v43; // ecx@33 | 14426 unsigned int v43; // ecx@33 |
14427 int v44; // edi@33 | 14427 short *v44; // edi@33 |
14428 int v45; // esi@33 | 14428 short *v45; // esi@33 |
14429 int v46; // ecx@33 | 14429 int v46; // ecx@33 |
14430 signed int v47; // esi@38 | 14430 signed int v47; // esi@38 |
14431 signed int v48; // ecx@38 | 14431 signed int v48; // ecx@38 |
14432 int v49; // eax@38 | 14432 int v49; // eax@38 |
14433 signed int v50; // edx@55 | 14433 signed int v50; // edx@55 |
14444 signed __int64 v61; // qax@85 | 14444 signed __int64 v61; // qax@85 |
14445 signed int v62; // ebx@85 | 14445 signed int v62; // ebx@85 |
14446 signed int v63; // esi@85 | 14446 signed int v63; // esi@85 |
14447 int v64; // eax@87 | 14447 int v64; // eax@87 |
14448 unsigned int v65; // ebx@95 | 14448 unsigned int v65; // ebx@95 |
14449 char *v66; // edx@95 | 14449 unsigned short *v66; // edx@95 |
14450 unsigned __int16 *v67; // esi@96 | 14450 unsigned __int16 *v67; // esi@96 |
14451 int v68; // edi@98 | 14451 int v68; // edi@98 |
14452 unsigned __int16 v69; // cx@99 | 14452 unsigned __int16 v69; // cx@99 |
14453 unsigned int v70; // [sp-10h] [bp-48074h]@80 | 14453 unsigned int v70; // [sp-10h] [bp-48074h]@80 |
14454 unsigned int v71; // [sp-Ch] [bp-48070h]@80 | 14454 unsigned int v71; // [sp-Ch] [bp-48070h]@80 |
14455 unsigned int v72; // [sp-8h] [bp-4806Ch]@80 | 14455 unsigned int v72; // [sp-8h] [bp-4806Ch]@80 |
14456 signed int v73; // [sp-4h] [bp-48068h]@59 | 14456 signed int v73; // [sp-4h] [bp-48068h]@59 |
14457 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 | 14457 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 |
14458 char v75[65535]; // [sp+Ch] [bp-48058h]@23 | 14458 unsigned short v75[131070]; // [sp+Ch] [bp-48058h]@23 |
14459 int v76; // [sp+4800Ch] [bp-58h]@23 | 14459 int v76; // [sp+4800Ch] [bp-58h]@23 |
14460 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 | 14460 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 |
14461 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23 | 14461 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23 |
14462 unsigned int v79; // [sp+48018h] [bp-4Ch]@1 | 14462 unsigned int v79; // [sp+48018h] [bp-4Ch]@1 |
14463 unsigned int y_; // [sp+4801Ch] [bp-48h]@1 | 14463 unsigned int y_; // [sp+4801Ch] [bp-48h]@1 |
14472 int black; // [sp+48040h] [bp-24h]@8 | 14472 int black; // [sp+48040h] [bp-24h]@8 |
14473 int v90; // [sp+48044h] [bp-20h]@1 | 14473 int v90; // [sp+48044h] [bp-20h]@1 |
14474 unsigned int i; // [sp+48048h] [bp-1Ch]@9 | 14474 unsigned int i; // [sp+48048h] [bp-1Ch]@9 |
14475 unsigned int v92; // [sp+4804Ch] [bp-18h]@16 | 14475 unsigned int v92; // [sp+4804Ch] [bp-18h]@16 |
14476 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 | 14476 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 |
14477 unsigned int v94; // [sp+48054h] [bp-10h]@8 | 14477 signed int v94; // [sp+48054h] [bp-10h]@8 |
14478 unsigned int v95; // [sp+48058h] [bp-Ch]@16 | 14478 unsigned int v95; // [sp+48058h] [bp-Ch]@16 |
14479 int v96; // [sp+4805Ch] [bp-8h]@10 | 14479 int v96; // [sp+4805Ch] [bp-8h]@10 |
14480 const void *v97; // [sp+48060h] [bp-4h]@16 | 14480 const void *v97; // [sp+48060h] [bp-4h]@16 |
14481 char *a4a; // [sp+4806Ch] [bp+8h]@85 | 14481 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 |
14482 int a5a; // [sp+48070h] [bp+Ch]@86 | 14482 int a5a; // [sp+48070h] [bp+Ch]@86 |
14483 | 14483 |
14484 x_ = x; | 14484 x_ = x; |
14485 y_ = y; | 14485 y_ = y; |
14486 v85 = (signed int)(x + a4) >> 1; | 14486 v85 = (signed int)(x + a4) >> 1; |
14542 v37 = black; | 14542 v37 = black; |
14543 v77 = (unsigned __int16 *)v36; | 14543 v77 = (unsigned __int16 *)v36; |
14544 do | 14544 do |
14545 { | 14545 { |
14546 *(short *)v32 = v78[*((char *)v77 + v37)];//crash | 14546 *(short *)v32 = v78[*((char *)v77 + v37)];//crash |
14547 v32 += 2; | 14547 ++v32; |
14548 v97 = (char *)v97 + v87; | 14548 v97 = (char *)v97 + v87; |
14549 v37 = (signed int)v97 >> 16; | 14549 v37 = (signed int)v97 >> 16; |
14550 --i; | 14550 --i; |
14551 } | 14551 } |
14552 while ( i ); | 14552 while ( i ); |
14568 do | 14568 do |
14569 { | 14569 { |
14570 if ( (signed int)v94 > 0 ) | 14570 if ( (signed int)v94 > 0 ) |
14571 { | 14571 { |
14572 v39 = v94; | 14572 v39 = v94; |
14573 v40 = v97; | 14573 v40 = (short *)v97; |
14574 v41 = v93; | 14574 v41 = (short *)v93; |
14575 v42 = v94 & 1; | 14575 v42 = v94 & 1; |
14576 v43 = v94 >> 1; | 14576 v43 = v94 >> 1; |
14577 memcpy(v93, v97, 4 * (v94 >> 1)); | 14577 memcpy(v93, v97, 2 * (v94 >> 1)); |
14578 v45 = (int)((char *)v40 + 4 * v43); | 14578 v45 = &v40[2 * v43]; |
14579 v44 = (int)&v41[2 * v43]; | 14579 v44 = &v41[2 * v43]; |
14580 v46 = v42; | 14580 v46 = v42; |
14581 v39 *= 2; | 14581 v39 *= 2; |
14582 v93 = (unsigned __int16 *)((char *)v93 + v39); | 14582 v93 = (unsigned __int16 *)((char *)v93 + v39); |
14583 v97 = (char *)v97 + v39; | 14583 v97 = (char *)v97 + v39; |
14584 while ( v46 ) | 14584 while ( v46 ) |
14585 { | 14585 { |
14586 *(short *)v44 = *(short *)v45; | 14586 *v44 = *v45; |
14587 v45 += 2; | 14587 ++v45; |
14588 v44 += 2; | 14588 ++v44; |
14589 --v46; | 14589 --v46; |
14590 } | 14590 } |
14591 v6 = v86; | 14591 v6 = v86; |
14592 } | 14592 } |
14593 v93 = (unsigned __int16 *)((char *)v93 + v38); | 14593 v93 = (unsigned __int16 *)((char *)v93 + v38); |
14598 } | 14598 } |
14599 else | 14599 else |
14600 { | 14600 { |
14601 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | 14601 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); |
14602 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); | 14602 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); |
14603 v7 = (uint *)pIndoor->pMapOutlines; | 14603 v7 = pIndoor->pMapOutlines; |
14604 uNumBlueFacesInBLVMinimap = 0; | 14604 uNumBlueFacesInBLVMinimap = 0; |
14605 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; | 14605 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; |
14606 v9 = pIndoor->pMapOutlines->uNumOutlines < 0; | 14606 v9 = pIndoor->pMapOutlines->uNumOutlines < 0; |
14607 v94 = 0; | 14607 v94 = 0; |
14608 if ( !(v9 | v8) ) | 14608 if ( !(v9 | v8) ) |
14647 v85 + v88, | 14647 v85 + v88, |
14648 v90 - v87, | 14648 v90 - v87, |
14649 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), | 14649 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), |
14650 v90 - v92, | 14650 v90 - v92, |
14651 black); | 14651 black); |
14652 v7 = (uint *)pIndoor->pMapOutlines; | 14652 v7 = pIndoor->pMapOutlines; |
14653 } | 14653 } |
14654 } | 14654 } |
14655 ++v94; | 14655 ++v94; |
14656 i += 12; | 14656 i += 12; |
14657 } | 14657 } |
14658 while ( (signed int)v94 < (signed int)*v7 ); | 14658 while ( v94 < (signed int)v7->uNumOutlines ); |
14659 } | 14659 } |
14660 v21 = 0; | 14660 v21 = 0; |
14661 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) | 14661 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) |
14662 { | 14662 { |
14663 while ( 1 ) | 14663 while ( 1 ) |
14664 { | 14664 { |
14665 v22 = pBlueFacesInBLVMinimapIDs[v21]; | 14665 v22 = pBlueFacesInBLVMinimapIDs[v21]; |
14666 v87 = v5; | 14666 v87 = v5; |
14667 v23 = (int)&v7[3 * v22 + 1]; | 14667 v23 = &v7->pOutlines[v22]; |
14668 v24 = &pIndoor->pVertices[*(short *)v23]; | 14668 v24 = &pIndoor->pVertices[v23->uVertex1ID]; |
14669 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)]; | 14669 v25 = &pIndoor->pVertices[v23->uVertex2ID]; |
14670 v26 = v25->x; | 14670 v26 = v25->x; |
14671 v27 = (unsigned __int16 *)(v24->x - v86); | 14671 v27 = (unsigned __int16 *)(v24->x - v86); |
14672 v28 = v24->y - v84; | 14672 v28 = v24->y - v84; |
14673 v29 = v25->y - v84; | 14673 v29 = v25->y - v84; |
14674 v93 = v27; | 14674 v93 = v27; |
14685 v90 - v95, | 14685 v90 - v95, |
14686 teal); | 14686 teal); |
14687 ++v21; | 14687 ++v21; |
14688 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) | 14688 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) |
14689 break; | 14689 break; |
14690 v7 = (uint *)pIndoor->pMapOutlines; | 14690 v7 = pIndoor->pMapOutlines; |
14691 } | 14691 } |
14692 v6 = v86; | 14692 v6 = v86; |
14693 } | 14693 } |
14694 } | 14694 } |
14695 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3; | 14695 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3; |
14865 if ( !pOutdoor->_47F04C(v81, v96) ) | 14865 if ( !pOutdoor->_47F04C(v81, v96) ) |
14866 { | 14866 { |
14867 if ( pOutdoor->_47F097(v81, v96) ) | 14867 if ( pOutdoor->_47F097(v81, v96) ) |
14868 { | 14868 { |
14869 if ( !((a5a + v85) % 2) ) | 14869 if ( !((a5a + v85) % 2) ) |
14870 *(short *)a4a = i; | 14870 *a4a = i; |
14871 } | 14871 } |
14872 else | 14872 else |
14873 { | 14873 { |
14874 *(short *)a4a = 0; | 14874 *a4a = 0; |
14875 } | 14875 } |
14876 } | 14876 } |
14877 a4a += 2; | 14877 ++a4a; |
14878 v97 = (char *)v97 + black; | 14878 v97 = (char *)v97 + black; |
14879 v64 = (signed int)v97 >> 16; | 14879 v64 = (signed int)v97 >> 16; |
14880 ++a5a; | 14880 ++a5a; |
14881 } | 14881 } |
14882 while ( a5a < v90 ); | 14882 while ( a5a < v90 ); |
14883 } | 14883 } |
14884 v62 += black; | 14884 v62 += black; |
14885 v97 = (const void *)v60; | 14885 v97 = (const void *)v60; |
14886 a4a += 2 * (v90 - a5a); | 14886 a4a += v90 - a5a; |
14887 v63 = v62 >> 16; | 14887 v63 = v62 >> 16; |
14888 ++v85; | 14888 ++v85; |
14889 teal = (unsigned int)v78; | 14889 teal = (unsigned int)v78; |
14890 } | 14890 } |
14891 v65 = v95; | 14891 v65 = v95; |
14902 do | 14902 do |
14903 { | 14903 { |
14904 v69 = *(short *)v66; | 14904 v69 = *(short *)v66; |
14905 if ( !*(short *)v66 || v69 == (short)i ) | 14905 if ( !*(short *)v66 || v69 == (short)i ) |
14906 *v67 = v69; | 14906 *v67 = v69; |
14907 v66 += 2; | 14907 ++v66; |
14908 ++v67; | 14908 ++v67; |
14909 --v68; | 14909 --v68; |
14910 } | 14910 } |
14911 while ( v68 ); | 14911 while ( v68 ); |
14912 } | 14912 } |