Mercurial > mm7
comparison mm7_5.cpp @ 784:b3e08a496778
Merge
author | Nomad |
---|---|
date | Sun, 24 Mar 2013 21:15:01 +0200 |
parents | b27dd658ea77 c47efaf23642 |
children | 41b4e9769863 |
comparison
equal
deleted
inserted
replaced
783:b27dd658ea77 | 784:b3e08a496778 |
---|---|
1 #include <assert.h> | 1 #include <assert.h> |
2 | 2 |
3 #include "mm7.h" | 3 #include "mm7.h" |
4 | |
5 #include "MapInfo.h" | 4 #include "MapInfo.h" |
6 #include "Game.h" | 5 #include "Game.h" |
7 #include "GUIWindow.h" | 6 #include "GUIWindow.h" |
8 #include "GUIFont.h" | 7 #include "GUIFont.h" |
9 #include "GUIButton.h" | 8 #include "GUIButton.h" |
43 #include "StorylineTextTable.h" | 42 #include "StorylineTextTable.h" |
44 #include "Events2D.h" | 43 #include "Events2D.h" |
45 #include "texts.h" | 44 #include "texts.h" |
46 #include "Log.h" | 45 #include "Log.h" |
47 #include "UIHouses.h" | 46 #include "UIHouses.h" |
48 | |
49 #include "mm7_data.h" | 47 #include "mm7_data.h" |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | |
64 | |
65 | 48 |
66 //----- (004304E7) -------------------------------------------------------- | 49 //----- (004304E7) -------------------------------------------------------- |
67 void __cdecl GameUI_MsgProc() | 50 void __cdecl GameUI_MsgProc() |
68 { | 51 { |
69 signed int v0; // edi@6 | 52 signed int v0; // edi@6 |
3478 } | 3461 } |
3479 } | 3462 } |
3480 pStru277->_427E01_cast_spell(); | 3463 pStru277->_427E01_cast_spell(); |
3481 } | 3464 } |
3482 | 3465 |
3483 | |
3484 //----- (004356FF) -------------------------------------------------------- | 3466 //----- (004356FF) -------------------------------------------------------- |
3485 void __cdecl back_to_game() | 3467 void __cdecl back_to_game() |
3486 { | 3468 { |
3487 dword_507BF0_is_there_popup_onscreen = 0; | 3469 dword_507BF0_is_there_popup_onscreen = 0; |
3488 dword_4E455C = 1; | 3470 dword_4E455C = 1; |
3491 free_book_subwindow(); | 3473 free_book_subwindow(); |
3492 if ( !pCurrentScreen && !pGUIWindow_Settings ) | 3474 if ( !pCurrentScreen && !pGUIWindow_Settings ) |
3493 pEventTimer->Resume(); | 3475 pEventTimer->Resume(); |
3494 viewparams->bRedrawGameUI = 1; | 3476 viewparams->bRedrawGameUI = 1; |
3495 } | 3477 } |
3478 | |
3496 //----- (00435748) -------------------------------------------------------- | 3479 //----- (00435748) -------------------------------------------------------- |
3497 void __cdecl GUI_MainMenuMessageProc() | 3480 void __cdecl GUI_MainMenuMessageProc() |
3498 { | 3481 { |
3499 //AudioPlayer *v0; // ebp@2 | 3482 //AudioPlayer *v0; // ebp@2 |
3500 //Player *pPlayer1; // ebx@2 | 3483 //Player *pPlayer1; // ebx@2 |
4012 v1->x = v2 * v1->x; | 3995 v1->x = v2 * v1->x; |
4013 v1->y = v2 * v1->y; | 3996 v1->y = v2 * v1->y; |
4014 v1->z = v2 * v1->z; | 3997 v1->z = v2 * v1->z; |
4015 } | 3998 } |
4016 | 3999 |
4017 | |
4018 | |
4019 | |
4020 | |
4021 | |
4022 | |
4023 | |
4024 | |
4025 | |
4026 //----- (004385B5) -------------------------------------------------------- | 4000 //----- (004385B5) -------------------------------------------------------- |
4027 void stru11::CheckCPU() | 4001 void stru11::CheckCPU() |
4028 { | 4002 { |
4029 LOG_DECOMPILATION_WARNING(); | 4003 LOG_DECOMPILATION_WARNING(); |
4030 /* | 4004 /* |
4412 v18[2][3] = _EDX; | 4386 v18[2][3] = _EDX; |
4413 v17 = v19; | 4387 v17 = v19; |
4414 memcpy(v1->cpuid_80000002_registers, v18, 0x30u); | 4388 memcpy(v1->cpuid_80000002_registers, v18, 0x30u); |
4415 memcpy((char *)&v17->cpuid_80000002_registers2[0] + 1, v18, 0x30u);*/ | 4389 memcpy((char *)&v17->cpuid_80000002_registers2[0] + 1, v18, 0x30u);*/ |
4416 } | 4390 } |
4417 | |
4418 | |
4419 | 4391 |
4420 //----- (00438BDF) -------------------------------------------------------- | 4392 //----- (00438BDF) -------------------------------------------------------- |
4421 bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype) | 4393 bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype) |
4422 { | 4394 { |
4423 unsigned __int8 v2; // zf@15 | 4395 unsigned __int8 v2; // zf@15 |
4498 break; | 4470 break; |
4499 } | 4471 } |
4500 return result; | 4472 return result; |
4501 } | 4473 } |
4502 | 4474 |
4503 | |
4504 //----- (00438F8F) -------------------------------------------------------- | 4475 //----- (00438F8F) -------------------------------------------------------- |
4505 void __cdecl area_of_effect__damage_evaluate() | 4476 void __cdecl area_of_effect__damage_evaluate() |
4506 { | 4477 { |
4507 int v0; // edx@1 | 4478 int v0; // edx@1 |
4508 char *v1; // esi@2 | 4479 char *v1; // esi@2 |
5198 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z); | 5169 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z); |
5199 } | 5170 } |
5200 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61); | 5171 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61); |
5201 } | 5172 } |
5202 // 4D864C: using guessed type char byte_4D864C; | 5173 // 4D864C: using guessed type char byte_4D864C; |
5203 | |
5204 | 5174 |
5205 //----- (00439FCB) -------------------------------------------------------- | 5175 //----- (00439FCB) -------------------------------------------------------- |
5206 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4) | 5176 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4) |
5207 { | 5177 { |
5208 signed int v4; // esi@1 | 5178 signed int v4; // esi@1 |
5706 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; | 5676 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; |
5707 goto LABEL_168; | 5677 goto LABEL_168; |
5708 } | 5678 } |
5709 } | 5679 } |
5710 | 5680 |
5711 | |
5712 //----- (0043A97E) -------------------------------------------------------- | 5681 //----- (0043A97E) -------------------------------------------------------- |
5713 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2) | 5682 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2) |
5714 { | 5683 { |
5715 unsigned int v2; // esi@1 | 5684 unsigned int v2; // esi@1 |
5716 unsigned int v3; // ebx@1 | 5685 unsigned int v3; // ebx@1 |
5796 v5 = integer_sqrt(*y * *y + *z * *z + *x * *x); | 5765 v5 = integer_sqrt(*y * *y + *z * *z + *x * *x); |
5797 *v3 *= 65536 / (v5 | 1); | 5766 *v3 *= 65536 / (v5 | 1); |
5798 *v4 *= 65536 / (v5 | 1); | 5767 *v4 *= 65536 / (v5 | 1); |
5799 *z *= 65536 / (v5 | 1); | 5768 *z *= 65536 / (v5 | 1); |
5800 } | 5769 } |
5801 | |
5802 | |
5803 | |
5804 | 5770 |
5805 //----- (0043AE12) -------------------------------------------------------- | 5771 //----- (0043AE12) -------------------------------------------------------- |
5806 double __fastcall sub_43AE12(signed int a1) | 5772 double __fastcall sub_43AE12(signed int a1) |
5807 { | 5773 { |
5808 signed int v1; // ST00_4@1 | 5774 signed int v1; // ST00_4@1 |
6048 goto LABEL_30; | 6014 goto LABEL_30; |
6049 } | 6015 } |
6050 } | 6016 } |
6051 } | 6017 } |
6052 } | 6018 } |
6053 | |
6054 | |
6055 | 6019 |
6056 //----- (0043C91D) -------------------------------------------------------- | 6020 //----- (0043C91D) -------------------------------------------------------- |
6057 int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4) | 6021 int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4) |
6058 { | 6022 { |
6059 int result; // eax@2 | 6023 int result; // eax@2 |
6254 return result; | 6218 return result; |
6255 } | 6219 } |
6256 return result; | 6220 return result; |
6257 } | 6221 } |
6258 | 6222 |
6259 | |
6260 | |
6261 //----- (0043ED6F) -------------------------------------------------------- | 6223 //----- (0043ED6F) -------------------------------------------------------- |
6262 bool _43ED6F_check_party_races(bool a1) | 6224 bool _43ED6F_check_party_races(bool a1) |
6263 { | 6225 { |
6264 bool v6; // zf@5 | 6226 bool v6; // zf@5 |
6265 | 6227 |
6527 IsPlayerWearingWatersuit[v7] = 0; | 6489 IsPlayerWearingWatersuit[v7] = 0; |
6528 } | 6490 } |
6529 return result; | 6491 return result; |
6530 } | 6492 } |
6531 | 6493 |
6532 | |
6533 //----- (0043F333) -------------------------------------------------------- | 6494 //----- (0043F333) -------------------------------------------------------- |
6534 void BspRenderer::MakeVisibleSectorList() | 6495 void BspRenderer::MakeVisibleSectorList() |
6535 { | 6496 { |
6536 int v6; // ebx@3 | 6497 int v6; // ebx@3 |
6537 | 6498 |
6554 } | 6515 } |
6555 } | 6516 } |
6556 | 6517 |
6557 } | 6518 } |
6558 } | 6519 } |
6559 | |
6560 | 6520 |
6561 //----- (0043F515) -------------------------------------------------------- | 6521 //----- (0043F515) -------------------------------------------------------- |
6562 void FindBillboardsLightLevels_BLV() | 6522 void FindBillboardsLightLevels_BLV() |
6563 { | 6523 { |
6564 for (uint i = 0; i < uNumBillboardsToDraw; ++i) | 6524 for (uint i = 0; i < uNumBillboardsToDraw; ++i) |
9344 } | 9304 } |
9345 } | 9305 } |
9346 return !v114 || !v113; | 9306 return !v114 || !v113; |
9347 } | 9307 } |
9348 | 9308 |
9349 | |
9350 //----- (00408768) -------------------------------------------------------- | 9309 //----- (00408768) -------------------------------------------------------- |
9351 void InitializeActors() | 9310 void InitializeActors() |
9352 { | 9311 { |
9353 signed int v5; // [sp+Ch] [bp-10h]@1 | 9312 signed int v5; // [sp+Ch] [bp-10h]@1 |
9354 signed int v6; // [sp+10h] [bp-Ch]@1 | 9313 signed int v6; // [sp+10h] [bp-Ch]@1 |
9433 if ( result ) | 9392 if ( result ) |
9434 result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result); | 9393 result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result); |
9435 return result; | 9394 return result; |
9436 } | 9395 } |
9437 | 9396 |
9438 | |
9439 //----- (00408A27) -------------------------------------------------------- | 9397 //----- (00408A27) -------------------------------------------------------- |
9440 unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors) | 9398 unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors) |
9441 { | 9399 { |
9442 unsigned int *v1; // esi@1 | 9400 unsigned int *v1; // esi@1 |
9443 int v2; // eax@1 | 9401 int v2; // eax@1 |
9574 if ( pActors[v2].IsNotAlive() == 1 ) | 9532 if ( pActors[v2].IsNotAlive() == 1 ) |
9575 v5 = 1; | 9533 v5 = 1; |
9576 } | 9534 } |
9577 return v5; | 9535 return v5; |
9578 } | 9536 } |
9579 | |
9580 | 9537 |
9581 //----- (00409BE8) -------------------------------------------------------- | 9538 //----- (00409BE8) -------------------------------------------------------- |
9582 void __cdecl sub_409BE8() | 9539 void __cdecl sub_409BE8() |
9583 { | 9540 { |
9584 void *v0; // eax@1 | 9541 void *v0; // eax@1 |
9620 // 4E1888: using guessed type int dword_4E1888; | 9577 // 4E1888: using guessed type int dword_4E1888; |
9621 // 505884: using guessed type int amuint_505884; | 9578 // 505884: using guessed type int amuint_505884; |
9622 // 505888: using guessed type int amuint_505888; | 9579 // 505888: using guessed type int amuint_505888; |
9623 // 50588C: using guessed type int amuint_50588C; | 9580 // 50588C: using guessed type int amuint_50588C; |
9624 | 9581 |
9625 | |
9626 | |
9627 | |
9628 | |
9629 | |
9630 | |
9631 //----- (0040D75D) -------------------------------------------------------- | 9582 //----- (0040D75D) -------------------------------------------------------- |
9632 char __fastcall pPrimaryWindow_draws_text(int a1, const char *pText, int *pXY) | 9583 char __fastcall pPrimaryWindow_draws_text(int a1, const char *pText, int *pXY) |
9633 { | 9584 { |
9634 const char *v3; // ST0C_4@1 | 9585 const char *v3; // ST0C_4@1 |
9635 __int64 v4; // qax@1 | 9586 __int64 v4; // qax@1 |
9645 0, | 9596 0, |
9646 0, | 9597 0, |
9647 0); | 9598 0); |
9648 } | 9599 } |
9649 | 9600 |
9650 | |
9651 | |
9652 //----- (0040DB27) -------------------------------------------------------- | 9601 //----- (0040DB27) -------------------------------------------------------- |
9653 void __fastcall DrawRect(Vec4_int_ *pXYZW, unsigned __int16 uColor, char bSolidFill) | 9602 void __fastcall DrawRect(Vec4_int_ *pXYZW, unsigned __int16 uColor, char bSolidFill) |
9654 { | 9603 { |
9655 Vec4_int_ *v3; // esi@1 | 9604 Vec4_int_ *v3; // esi@1 |
9656 unsigned __int16 v4; // bp@1 | 9605 unsigned __int16 v4; // bp@1 |
9673 pRenderer->RasterLine2D(v3->x, v3->w, v3->x, v3->y, v4); | 9622 pRenderer->RasterLine2D(v3->x, v3->w, v3->x, v3->y, v4); |
9674 } | 9623 } |
9675 pRenderer->EndScene(); | 9624 pRenderer->EndScene(); |
9676 } | 9625 } |
9677 | 9626 |
9678 | |
9679 | |
9680 | |
9681 //----- (0040DDB1) -------------------------------------------------------- | 9627 //----- (0040DDB1) -------------------------------------------------------- |
9682 int __fastcall rand_interval(int a, int b) | 9628 int __fastcall rand_interval(int a, int b) |
9683 { | 9629 { |
9684 return a + rand() % (b - a + 1); | 9630 return a + rand() % (b - a + 1); |
9685 } | 9631 } |
9719 //----- (0040DF3D) -------------------------------------------------------- | 9665 //----- (0040DF3D) -------------------------------------------------------- |
9720 void __cdecl CallRenderPresent() | 9666 void __cdecl CallRenderPresent() |
9721 { | 9667 { |
9722 pRenderer->Present(); | 9668 pRenderer->Present(); |
9723 } | 9669 } |
9724 | |
9725 | 9670 |
9726 //----- (0040DFA7) -------------------------------------------------------- | 9671 //----- (0040DFA7) -------------------------------------------------------- |
9727 int __stdcall retzero_sub_40DFA7(int a1) | 9672 int __stdcall retzero_sub_40DFA7(int a1) |
9728 { | 9673 { |
9729 return 0; | 9674 return 0; |
9933 result = 3; | 9878 result = 3; |
9934 } | 9879 } |
9935 return result; | 9880 return result; |
9936 } | 9881 } |
9937 | 9882 |
9938 | |
9939 | |
9940 | |
9941 | |
9942 | |
9943 | |
9944 //----- (0040F82D) -------------------------------------------------------- | 9883 //----- (0040F82D) -------------------------------------------------------- |
9945 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | 9884 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) |
9946 { | 9885 { |
9947 ZBuffer_DoFill(pZBuffer, (Texture *)(uTextureId != -1 ? (int)&pIcons_LOD->pTextures[uTextureId] : 0), iZValue); | 9886 ZBuffer_DoFill(pZBuffer, (Texture *)(uTextureId != -1 ? (int)&pIcons_LOD->pTextures[uTextureId] : 0), iZValue); |
9948 } | 9887 } |
10034 { | 9973 { |
10035 if ( v8->uDecompressedSize ) | 9974 if ( v8->uDecompressedSize ) |
10036 free(v12); | 9975 free(v12); |
10037 } | 9976 } |
10038 } | 9977 } |
10039 | |
10040 | 9978 |
10041 //----- (0040F92A) -------------------------------------------------------- | 9979 //----- (0040F92A) -------------------------------------------------------- |
10042 void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3) | 9980 void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3) |
10043 { | 9981 { |
10044 Texture *v3; // esi@1 | 9982 Texture *v3; // esi@1 |