Mercurial > mm7
comparison Outdoor.cpp @ 768:67b77b052ef3
Merge
author | Nomad |
---|---|
date | Sat, 23 Mar 2013 21:16:04 +0200 |
parents | 45615cacad31 777c42590ffc |
children | b27dd658ea77 |
comparison
equal
deleted
inserted
replaced
767:45615cacad31 | 768:67b77b052ef3 |
---|---|
551 || v15 ) | 551 || v15 ) |
552 return 2; | 552 return 2; |
553 v5 = WorldPosToGridCellX(pParty->vPosition.x); | 553 v5 = WorldPosToGridCellX(pParty->vPosition.x); |
554 v6 = WorldPosToGridCellZ(pParty->vPosition.y); | 554 v6 = WorldPosToGridCellZ(pParty->vPosition.y); |
555 v7 = _47ED83(v5, v6 - 1); | 555 v7 = _47ED83(v5, v6 - 1); |
556 v8 = pTileTable->pTiles[_47ECC1(v7)].tileset; | 556 v8 = pTileTable->pTiles[GetTileIdByTileMapId(v7)].tileset; |
557 if ( v8 ) | 557 if ( v8 ) |
558 { | 558 { |
559 v9 = v8 - 1; | 559 v9 = v8 - 1; |
560 if ( !v9 ) | 560 if ( !v9 ) |
561 return 3; | 561 return 3; |
2349 } | 2349 } |
2350 return true; | 2350 return true; |
2351 } | 2351 } |
2352 | 2352 |
2353 //----- (0047ECC1) -------------------------------------------------------- | 2353 //----- (0047ECC1) -------------------------------------------------------- |
2354 int OutdoorLocation::_47ECC1(signed int a2) | 2354 int OutdoorLocation::GetTileIdByTileMapId(signed int a2) |
2355 { | 2355 { |
2356 signed int result; // eax@2 | 2356 signed int result; // eax@2 |
2357 int v3; // eax@3 | 2357 int v3; // eax@3 |
2358 | 2358 |
2359 if ( a2 >= 90 ) | 2359 if ( a2 >= 90 ) |
2472 result = 32 * *(&this->pTerrain.pHeightmap[uZ * 128 + uX]); | 2472 result = 32 * *(&this->pTerrain.pHeightmap[uZ * 128 + uX]); |
2473 return result; | 2473 return result; |
2474 } | 2474 } |
2475 | 2475 |
2476 //----- (0047EE49) -------------------------------------------------------- | 2476 //----- (0047EE49) -------------------------------------------------------- |
2477 int OutdoorLocation::_47EE49(signed int a2, signed int a3, int a4) | 2477 int OutdoorLocation::GetSoundIdByPosition( signed int X_pos, signed int Y_pos, int running ) |
2478 { | 2478 { |
2479 signed int v4; // eax@5 | 2479 signed int v4; // eax@5 |
2480 signed int v5; // eax@7 | 2480 signed int v5; // eax@7 |
2481 int v6; // eax@8 | 2481 int v6; // eax@8 |
2482 signed int v8; // eax@9 | 2482 signed int v8; // eax@9 |
2483 int v9; // eax@12 | 2483 int modif=0; |
2484 int v10; // eax@13 | 2484 |
2485 int v11; // eax@14 | 2485 if ( X_pos < 0 || X_pos > 127 || Y_pos < 0 || Y_pos > 127 ) |
2486 int v12; // eax@16 | |
2487 int v13; // eax@17 | |
2488 int v14; // eax@18 | |
2489 int v15; // eax@19 | |
2490 int v16; // eax@20 | |
2491 int v17; // eax@21 | |
2492 int v18; // eax@28 | |
2493 int v19; // eax@29 | |
2494 int v20; // eax@30 | |
2495 | |
2496 if ( a2 < 0 || a2 > 127 || a3 < 0 || a3 > 127 ) | |
2497 v4 = 0; | 2486 v4 = 0; |
2498 else | 2487 else |
2499 v4 = *(&this->pTerrain.pTilemap[128 * a3] + a2); | 2488 v4 = this->pTerrain.pTilemap[128 * Y_pos + X_pos]; |
2500 v5 = _47ECC1(v4); | 2489 v5 = GetTileIdByTileMapId(v4); |
2490 if (running) | |
2491 modif=-39; | |
2501 if ( !v5 ) | 2492 if ( !v5 ) |
2502 { | 2493 return 92+modif; |
2503 v6 = -(a4 != 0); | 2494 |
2504 LOBYTE(v6) = v6 & 0xD9; | 2495 switch (pTileTable->pTiles[v5].tileset) |
2505 return v6 + 92; | 2496 { |
2506 } | 2497 case 0: return 93+ modif; |
2507 v8 = pTileTable->pTiles[v5].tileset; | 2498 case 1: return 97+ modif; |
2508 if ( v8 <= 6 ) | 2499 case 2: return 91+ modif; |
2509 { | 2500 case 3: return 90+ modif; |
2510 if ( v8 == Tileset_6 ) | 2501 case 4: return 101+ modif; |
2511 { | 2502 case 5: return 95+ modif; |
2512 v17 = -(a4 != 0); | 2503 case 6: return 88+ modif; |
2513 LOBYTE(v17) = v17 & 0xD9; | 2504 case 7: return 100+ modif; |
2514 return v17 + 88; | 2505 case 8: return 93+ modif; |
2515 } | 2506 default: |
2516 if ( v8 ) | 2507 v8=pTileTable->pTiles[v5].tileset; |
2517 { | 2508 if ( (v8 > 9 && v8 <= 17) || (v8 > 21 && v8 <= 27) ) |
2518 v9 = v8 - 1; | 2509 return 96+ modif; |
2519 if ( !v9 ) | 2510 else |
2520 { | 2511 return 95+ modif; |
2521 v15 = -(a4 != 0); | 2512 } |
2522 LOBYTE(v15) = v15 & 0xD9; | 2513 |
2523 return v15 + 97; | |
2524 } | |
2525 v10 = v9 - 1; | |
2526 if ( !v10 ) | |
2527 { | |
2528 v14 = -(a4 != 0); | |
2529 LOBYTE(v14) = v14 & 0xD9; | |
2530 return v14 + 91; | |
2531 } | |
2532 v11 = v10 - 1; | |
2533 if ( !v11 ) | |
2534 { | |
2535 v13 = -(a4 != 0); | |
2536 LOBYTE(v13) = v13 & 0xD9; | |
2537 return v13 + 90; | |
2538 } | |
2539 if ( v11 == 2 ) | |
2540 { | |
2541 v12 = -(a4 != 0); | |
2542 LOBYTE(v12) = v12 & 0xD9; | |
2543 return v12 + 101; | |
2544 } | |
2545 LABEL_29: | |
2546 v19 = -(a4 != 0); | |
2547 LOBYTE(v19) = v19 & 0xD9; | |
2548 return v19 + 95; | |
2549 } | |
2550 goto LABEL_20; | |
2551 } | |
2552 if ( v8 != 7 ) | |
2553 { | |
2554 if ( v8 != 8 ) | |
2555 { | |
2556 if ( v8 > 9 && (v8 <= 17 || v8 > 21 && v8 <= 27) ) | |
2557 { | |
2558 v18 = -(a4 != 0); | |
2559 LOBYTE(v18) = v18 & 0xD9; | |
2560 return v18 + 96; | |
2561 } | |
2562 goto LABEL_29; | |
2563 } | |
2564 LABEL_20: | |
2565 v16 = -(a4 != 0); | |
2566 LOBYTE(v16) = v16 & 0xD9; | |
2567 return v16 + 93; | |
2568 } | |
2569 v20 = -(a4 != 0); | |
2570 LOBYTE(v20) = v20 & 0xD9; | |
2571 return v20 + 100; | |
2572 } | 2514 } |
2573 | 2515 |
2574 //----- (0047EF60) -------------------------------------------------------- | 2516 //----- (0047EF60) -------------------------------------------------------- |
2575 int OutdoorLocation::UpdateDiscoveredArea(int X_grid_pos, int Y_grid_poa, int a4) | 2517 int OutdoorLocation::UpdateDiscoveredArea(int X_grid_pos, int Y_grid_poa, int a4) |
2576 { | 2518 { |
2712 pSoundList->LoadSound(v4, 0); | 2654 pSoundList->LoadSound(v4, 0); |
2713 v5 = _6807E0_num_decorations_with_sounds_6807B8++; | 2655 v5 = _6807E0_num_decorations_with_sounds_6807B8++; |
2714 _6807B8_level_decorations_ids[v5] = i; | 2656 _6807B8_level_decorations_ids[v5] = i; |
2715 } | 2657 } |
2716 if ( v8 && decor->uCog == 20 ) | 2658 if ( v8 && decor->uCog == 20 ) |
2717 LOBYTE(decor->field_2) |= 0x40u; | 2659 decor->field_2 |= 0x0040u; |
2718 if ( !decor->field_16_event_id ) | 2660 if ( !decor->field_16_event_id ) |
2719 { | 2661 { |
2720 if ( decor->IsInteractive() ) | 2662 if ( decor->IsInteractive() ) |
2721 { | 2663 { |
2722 if ( v1 < 124 ) | 2664 if ( v1 < 124 ) |
2723 { | 2665 { |
2724 v6 = v1 + 75; | 2666 v6 = v1 + 75; |
2725 decor->_idx_in_stru123 = v6; | 2667 decor->_idx_in_stru123 = v6; |
2726 if ( !stru_5E4C90._decor_events[v1++] ) | 2668 if ( !stru_5E4C90._decor_events[v1++] ) |
2727 LOBYTE(decor->field_2) |= 0x20u; | 2669 decor->field_2 |= 0x0020u; |
2728 } | 2670 } |
2729 } | 2671 } |
2730 } | 2672 } |
2731 } | 2673 } |
2732 | 2674 |