Mercurial > mm7
changeset 1461:845907a747d3
Merge
author | Gloval |
---|---|
date | Wed, 21 Aug 2013 20:59:16 +0400 |
parents | ff2118028c71 (current diff) 2ca62c9e7b3c (diff) |
children | 090ff42290c4 |
files | Actor.cpp Arcomage.cpp NPC.cpp Player.cpp UI/UICharacter.cpp UI/UIHouses.cpp mm7_4.cpp |
diffstat | 61 files changed, 742 insertions(+), 909 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Actor.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -2419,7 +2419,7 @@ v3->vVelocity.z = v10; v3->vVelocity.y = v10; v3->vVelocity.x = v10; - if ( sub_42FB5C(v16) ) + if ( _42FB5C_check_spell(v16) ) { v3->uCurrentActionLength = 64; v3->uCurrentActionTime = v10; @@ -2525,7 +2525,7 @@ v3->vVelocity.z = v10; v3->vVelocity.y = v10; v3->vVelocity.x = v10; - if ( sub_42FB5C(v16) ) + if ( _42FB5C_check_spell(v16) ) { v3->uCurrentActionLength = 64; v3->uCurrentActionTime = v10; @@ -3997,7 +3997,7 @@ return result; } //----- (00401A91) -------------------------------------------------------- -void __cdecl UpdateActorAI() +void UpdateActorAI() { //unsigned int v0; // esi@4 int v1; // eax@7 @@ -4747,7 +4747,7 @@ return v5; } //----- (00408B54) -------------------------------------------------------- -unsigned int __fastcall SearchActorByID(unsigned int *pTotalActors, unsigned int a2) +unsigned int SearchActorByID(unsigned int *pTotalActors, unsigned int a2) { unsigned int v2; // edi@1 unsigned int *v3; // esi@1 @@ -4770,7 +4770,7 @@ return v5; } //----- (00408AE7) -------------------------------------------------------- -unsigned int __fastcall SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup) +unsigned int SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup) { unsigned int *v2; // esi@1 signed int v3; // ebx@1 @@ -4809,7 +4809,7 @@ return v9; } //----- (00408A7E) -------------------------------------------------------- -unsigned int __fastcall SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID) +unsigned int SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID) { unsigned int *v2; // esi@1 signed int v3; // ebx@1 @@ -4848,7 +4848,7 @@ return v9; } //----- (00408A27) -------------------------------------------------------- -unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors) +unsigned int SearchAliveActors(unsigned int *pTotalActors) { unsigned int *v1; // esi@1 int v2; // eax@1
--- a/Arcomage.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Arcomage.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -58,10 +58,10 @@ void GameResultsApply(); void pPrimaryWindow_draws_text(int a1, const char *pText, POINT *pXY); -void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb +void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); -void __cdecl am_EndScene(); +void am_EndScene(); void DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor ); void SetPixel(POINT *pTargetXY, unsigned __int16 uColor); @@ -1272,9 +1272,6 @@ GameResultsApply(); if ( byte_4FAA2C ) { - // v2 = retzero_sub_40DFA7((int)dword_4FAA28); - // v1 = 1000; - // dword_4FAA70 = v2 / 1000; dword_4FAA70 = 0; } else
--- a/AudioPlayer.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/AudioPlayer.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -1308,7 +1308,7 @@ } //----- (0040DEA5) -------------------------------------------------------- -void __cdecl AudioPlayer::MessWithChannels() +void AudioPlayer::MessWithChannels() { pAudioPlayer->StopChannels(-1, -1); } @@ -2270,7 +2270,7 @@ // 4ABF23: using guessed type int var_48[16]; //----- (004ABFDB) -------------------------------------------------------- -void __cdecl PlayLevelMusic() +void PlayLevelMusic() { unsigned int v0; // eax@1
--- a/AudioPlayer.h Wed Aug 21 20:58:36 2013 +0400 +++ b/AudioPlayer.h Wed Aug 21 20:59:16 2013 +0400 @@ -103,12 +103,16 @@ SOUND_Arcomage_130 = 0x82, SOUND_Arcomage_131 = 0x83, SOUND_Arcomage_WallUpgrade = 0x84, + SOUND_PlayLute = 133, // 85 + SOUND_PlayFaeriePipes = 134, // 86 + SOUND_PlayGryphonheartsTrumpet = 135, // 87 SOUND_GoldReceived = 0xC8, SOUND_203 = 203, SOUND_206 = 206, SOUND_207 = 207, SOUND_OpenChest = 208, SOUND_PlayerCantCastSpell = 0xD1, + SOUND_EatApple = 211, // D3 SOUND_Bell = 0xD9, SOUND_OpenBook = 230, SOUND_CloseBook = 231, @@ -171,7 +175,7 @@ void SetMapEAX(); int _4AC0A2(); void PlayMusicTrack(enum MusicID eTrack); - void __cdecl MessWithChannels(); + void MessWithChannels(); unsigned int bEAXSupported;
--- a/CShow.h Wed Aug 21 20:58:36 2013 +0400 +++ b/CShow.h Wed Aug 21 20:59:16 2013 +0400 @@ -52,6 +52,6 @@ void PlayMovie(MovieType eVideo, bool bShowMouseAfterPlayback); - void (__thiscall ***vdestructor_ptr)(CShow *, bool); + void ( ***vdestructor_ptr)(CShow *, bool); }; #pragma pack(pop)*/ \ No newline at end of file
--- a/CastSpellInfo.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/CastSpellInfo.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -1346,9 +1346,9 @@ else { v155 = stru_5C6E00->Cos(pParty->sRotationY); - uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); + uRequiredMana = pParty->vPosition.x + fixpoint_sub0(2048, v155); v156 = stru_5C6E00->Sin(pParty->sRotationY); - LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); + LODWORD(v727) = pParty->vPosition.y + fixpoint_sub0(2048, v156); v154 = pParty->vPosition.z; } unsigned __int64 k = 0; @@ -1414,7 +1414,7 @@ } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096); + auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); v700.z = 0; v700.y = 0; v700.x = 0; @@ -1653,9 +1653,9 @@ else { v212 = stru_5C6E00->Cos(pParty->sRotationY); - LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); + LODWORD(v718) = pParty->vPosition.x + fixpoint_sub0(2048, v212); v213 = stru_5C6E00->Sin(pParty->sRotationY); - v214 = sub_42EBBE(2048, v213); + v214 = fixpoint_sub0(2048, v213); v211 = pParty->vPosition.z; v713 = pParty->vPosition.y + v214; v208 = LODWORD(v725); @@ -2389,7 +2389,7 @@ LODWORD(v733) = 300 * v2 + 180; if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096); + auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); @@ -2859,7 +2859,7 @@ amount = 180 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096); + auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); @@ -3248,7 +3248,7 @@ break; pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); - v505 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096); + v505 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); ++pSpellSprite.uType; //signed int _v733 = v505; v688.x = 0; @@ -3368,7 +3368,7 @@ } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - v531 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096); + v531 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); ++pSpellSprite.uType; v694.x = 0; v694.y = 0; @@ -3905,7 +3905,7 @@ break; pGame->GetIndoorCamera(); v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth(); - signed int _v733 = sub_46A6AC((int)dword_50BF30.data(), 100, v623); + signed int _v733 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, v623); v707.x = 0; v707.y = 0; v707.z = 0;
--- a/Chest.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Chest.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -198,7 +198,7 @@ //----- (0042038D) -------------------------------------------------------- -void __cdecl ChestUI_WritePointedObjectStatusString() +void ChestUI_WritePointedObjectStatusString() { POINT *v0; // esi@2 int v1; // ecx@2 @@ -282,7 +282,7 @@ itemPixelPosY = chest_offs_y + 32 * (item_counter / chestHeghtCells) + ((signed int)(((itemPixelHeght - 14) & 0xFFFFFFE0) + 32- item_texture->uTextureHeight ) /2); pRenderer->DrawTextureTransparent( itemPixelPosX, itemPixelPosY, item_texture); - sub_40F92A(&v16[itemPixelPosX + pSRZBufferLineOffsets[itemPixelPosY]], item_texture, item_counter + 1); + ZBuffer_DoFill2(&v16[itemPixelPosX + pSRZBufferLineOffsets[itemPixelPosY]], item_texture, item_counter + 1); } } pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); @@ -791,7 +791,7 @@ } // 506128: using guessed type int areWeLoadingTexture; //----- (00420E01) -------------------------------------------------------- -void __cdecl OnChestLeftClick() +void OnChestLeftClick() { int chest_id; // edi@1 POINT *v1; // esi@2
--- a/DecalBuilder.h Wed Aug 21 20:58:36 2013 +0400 +++ b/DecalBuilder.h Wed Aug 21 20:59:16 2013 +0400 @@ -15,14 +15,14 @@ } //----- (0043B54C) -------------------------------------------------------- - //void __thiscall Bloodsplat::vdtor(Bloodsplat *this, char a2) + //void Bloodsplat::vdtor(Bloodsplat *this, char a2) //----- (0043B569) -------------------------------------------------------- virtual ~Bloodsplat() { } - //void (__thiscall ***vdestructor_ptr)(Bloodsplat *, bool); + //void ( ***vdestructor_ptr)(Bloodsplat *, bool); float x; float y; float z; @@ -49,8 +49,8 @@ this->std__vector_pBloodsplats, 40, 64, - (void (__thiscall *)(void *))Bloodsplat::Bloodsplat, - (void (__thiscall *)(void *))Bloodsplat::dtor); + (void ( *)(void *))Bloodsplat::Bloodsplat, + (void ( *)(void *))Bloodsplat::dtor); v1->std__vector_pBloodsplats_size = 0;*/ uNumBloodsplats = 0; } @@ -66,7 +66,7 @@ bool AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b); - //void (__thiscall ***vdestructor_ptr)(BloodsplatContainer *, bool); + //void ( ***vdestructor_ptr)(BloodsplatContainer *, bool); Bloodsplat std__vector_pBloodsplats[64]; unsigned int std__vector_pBloodsplats_size; int uNumBloodsplats; @@ -107,13 +107,13 @@ } //----- (0043B625) -------------------------------------------------------- - //void __thiscall Decal::vdtor(Decal *this, bool a2) + //void Decal::vdtor(Decal *this, bool a2) //----- (0043B641) -------------------------------------------------------- virtual ~Decal() { } - //void (__thiscall ***vdestructor_ptr)(Decal *, bool); + //void ( ***vdestructor_ptr)(Decal *, bool); int uNumVertices; RenderVertexSoft pVertices[64]; __int16 field_C08; @@ -142,8 +142,8 @@ this->std__vector_pDecals, 3104, 1024, - (void (__thiscall *)(void *))Decal::Decal, - (void (__thiscall *)(void *))Decal::dtor);*/ + (void ( *)(void *))Decal::Decal, + (void ( *)(void *))Decal::dtor);*/ v1->std__vector_pDecals_size = 0; v1->field_308008 = 0; v2 = (char *)&v1->pVertices[0].flt_2C; @@ -176,7 +176,7 @@ - //void (__thiscall ***vdestructor_ptr)(DecalBuilder *, bool); + //void ( ***vdestructor_ptr)(DecalBuilder *, bool); Decal std__vector_pDecals[1024]; unsigned int std__vector_pDecals_size; int field_308008;
--- a/Events.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Events.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -91,7 +91,7 @@ } //----- (00443DA1) -------------------------------------------------------- -void __cdecl Initialize_GlobalEVT() +void Initialize_GlobalEVT() { struct raw_event_header {
--- a/GUIButton.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/GUIButton.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -77,7 +77,7 @@ struct GUIWindow *pGUIWindow_CurrentMenu; struct GUIWindow *ptr_507BD0; struct GUIWindow *pGUIWindow_Settings; -struct GUIWindow *ptr_507BDC; +struct GUIWindow *pModalWindow; struct GUIWindow *pGUIWindow_EscMessageWindow; struct GUIWindow *pBooksWindow; struct GUIWindow *pGUIWindow2; @@ -182,13 +182,13 @@ pDialogueWindow->CreateButton( 480, 30 * column_pos + 146, 140, 30, 1, 0, UIMSG_SelectShopDialogueOption, control_id, 0, "", 0); } //----- (00419379) -------------------------------------------------------- -void __cdecl sub_419379() +void ReleaseAwardsScrollBar() { GUIButton *pButton; // esi@2 - if ( dword_507CBC ) + if ( awards_scroll_bar_created ) { - dword_507CBC = 0; + awards_scroll_bar_created = false; ptr_507BA4->Release(); pBtn_Up->Release(); pBtn_Down->Release(); @@ -208,13 +208,13 @@ } } //----- (00419220) -------------------------------------------------------- -void __cdecl CreateAwardsScrollBar() +void CreateAwardsScrollBar() { GUIButton *pButton; // eax@2 - if ( !dword_507CBC ) + if ( !awards_scroll_bar_created ) { - dword_507CBC = 1; + awards_scroll_bar_created = 1; for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) { if ( pButton->msg == UIMSG_InventoryLeftClick )
--- a/GUIWindow.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/GUIWindow.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -74,17 +74,6 @@ - -//----- (004141CA) -------------------------------------------------------- -void ModalWindow( const char *pStrHint, int a4 ) - { - pEventTimer->Pause(); - dword_506F0C[0] = pCurrentScreen; - ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, pStrHint); - pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE; -} -// 4E28F8: using guessed type int pCurrentScreen; - // inlined //----- (mm6c::00420520) -------------------------------------------------- void GUIMessageQueue::Flush() @@ -293,7 +282,7 @@ { pIcons_LOD->SyncLoadedFilesCount(); pCurrentScreen = pMainScreenNum; - pKeyActionMap->SetWindowInputStatus(3); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); break; } case WINDOW_HouseInterior: @@ -1827,7 +1816,7 @@ dialog_menu_id = HOUSE_DIALOGUE_OTHER; } //----- (0044603D) -------------------------------------------------------- -void __cdecl DialogueEnding() +void DialogueEnding() { sDialogue_SpeakingActorNPC_ID = 0; pDialogueWindow->Release(); @@ -1984,9 +1973,9 @@ pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); continue; } - case WINDOW_FinalWindow: + case WINDOW_ModalWindow: { - sub_41420D_press_esc(); + ModalWindow_ShowHint(); continue; } case WINDOW_50: @@ -2278,12 +2267,27 @@ Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); } + + + + +int modal_window_prev_screen; + +//----- (004141CA) -------------------------------------------------------- +void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) +{ + pEventTimer->Pause(); + modal_window_prev_screen = pCurrentScreen; + pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint); + pCurrentScreen = SCREEN_MODAL_WINDOW; +} + //----- (0041420D) -------------------------------------------------------- -void __cdecl sub_41420D_press_esc() +void ModalWindow_ShowHint() { GUIWindow pWindow; // [sp+4h] [bp-54h]@1 - sprintf(pTmpBuf2.data(), "%s\n \n%s", ptr_507BDC->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape + sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape pWindow.Hint = pTmpBuf2.data(); pWindow.uFrameWidth = 400; pWindow.uFrameHeight = 100; @@ -2295,16 +2299,14 @@ } //----- (0041426F) -------------------------------------------------------- -void __cdecl sub_41426F() +void ModalWindow_Release() { - GUIWindow *pWindow; // ecx@1 + pMessageQueue_50CBD0->AddMessage((UIMessageType)pModalWindow->par1C, 0, 0); - pWindow = ptr_507BDC; - pMessageQueue_50CBD0->AddMessage((UIMessageType)ptr_507BDC->par1C, 0, 0); + pModalWindow->Release(); + pModalWindow = nullptr; - pWindow->Release(); - ptr_507BDC = 0; - pCurrentScreen = dword_506F0C[0]; + pCurrentScreen = modal_window_prev_screen; pEventTimer->Resume(); } @@ -2369,7 +2371,7 @@ } } //----- (00467F9F) -------------------------------------------------------- -void __cdecl free_book_subwindow() +void free_book_subwindow() { if ( pGUIWindow_ScrollWindow ) {
--- a/GUIWindow.h Wed Aug 21 20:58:36 2013 +0400 +++ b/GUIWindow.h Wed Aug 21 20:59:16 2013 +0400 @@ -158,7 +158,7 @@ UIMSG_C2 = 192, UIMSG_OnCastTownPortal = 195, - UIMSG_C4 = 196, + UIMSG_OnFinalWindowClose = 196, UIMSG_ShowFinalWindow = 197, UIMSG_C6 = 198, UIMSG_C7 = 199, @@ -222,7 +222,7 @@ MENU_NAMEPANELESC = 7, MENU_CREDITSPROC = 8, MENU_LoadingProcInMainMenu = 9, - MENU_10 = 10, + MENU_DebugBLVLevel = 10, MENU_CREDITSCLOSE = 11, }; @@ -276,7 +276,7 @@ WINDOW_CastSpell = 27, WINDOW_Scroll = 0x1E, WINDOW_CastSpell_InInventory = 31, - WINDOW_FinalWindow = 70, + WINDOW_ModalWindow = 70, WINDOW_50 = 80, WINDOW_59 = 89, WINDOW_PressedButton2 = 90, @@ -398,7 +398,7 @@ SCREEN_INPUT_BLV = 0x12, SCREEN_BRANCHLESS_NPC_DIALOG = 0x13, SCREEN_PARTY_CREATION = 0x15, - SCREEN_PRESS_ESCAPE_MESSAGE = 0x16, + SCREEN_MODAL_WINDOW = 0x16, SCREEN_CASTING = 0x17, SCREEN_19 = 0x19, SCREEN_KEYBOARD_OPTIONS = 0x1A, @@ -464,7 +464,9 @@ -void ModalWindow(const char *pStrHint, int a4); +void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message); +void ModalWindow_ShowHint(); +void ModalWindow_Release(); @@ -549,7 +551,7 @@ void InitializeBookTextures(); void InitializeBookFonts(); void DrawSpellBookContent(Player *player); -unsigned int __cdecl DrawLloydBeaconsScreen(); +unsigned int DrawLloydBeaconsScreen(); void BookUI_DrawTownPortalMap(); void LoadSpellbook(unsigned int uID); // idb void DrawSpellDescriptionPopup(int spell_index); @@ -575,6 +577,15 @@ +void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight); // idb +void DrawCopyrightWindow(); +void LoadFonts_and_DrawCopyrightWindow(); +void GUI_UpdateWindows(); +int GetConditionDrawColor(unsigned int uConditionIdx); // idb +void FillAwardsData(); +void CreateAwardsScrollBar(); +void ReleaseAwardsScrollBar(); + @@ -693,7 +704,7 @@ extern struct GUIWindow *pGUIWindow_CurrentMenu; extern struct GUIWindow *ptr_507BD0; extern struct GUIWindow *pGUIWindow_Settings; -extern struct GUIWindow *ptr_507BDC; +extern struct GUIWindow *pModalWindow; extern struct GUIWindow *pGUIWindow_EscMessageWindow; extern struct GUIWindow *pBooksWindow; extern struct GUIWindow *pGUIWindow2; @@ -738,6 +749,10 @@ extern unsigned int ui_character_skillinfo_can_learn; extern unsigned int ui_character_skillinfo_can_learn_gm; extern unsigned int ui_character_skillinfo_cant_learn; +extern unsigned int ui_character_condition_normal_color; +extern unsigned int ui_character_condition_light_color; +extern unsigned int ui_character_condition_moderate_color; +extern unsigned int ui_character_condition_severe_color; extern std::array<unsigned int, 6> ui_character_award_color; extern unsigned int ui_game_minimap_outline_color; extern unsigned int ui_game_minimap_actor_friendly_color;
--- a/Game.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Game.h Wed Aug 21 20:59:16 2013 +0400 @@ -119,7 +119,7 @@ struct IndoorCameraD3D *GetIndoorCamera() {return this->pIndoorCameraD3D;} - //void (__thiscall ***vdestructor_ptr)(Game *, bool); + //void ( ***vdestructor_ptr)(Game *, bool); Game__StationaryLight pStationaryLights[25]; char field_2C0[1092]; unsigned int uNumStationaryLights;
--- a/GammaControl.h Wed Aug 21 20:58:36 2013 +0400 +++ b/GammaControl.h Wed Aug 21 20:59:16 2013 +0400 @@ -23,7 +23,7 @@ - void (__thiscall ***vdestructor_ptr)(GammaController *, bool); + void ( ***vdestructor_ptr)(GammaController *, bool); IDirectDrawSurface4 *pSurface; IDirectDrawGammaControl *pGammaControl; DDGAMMARAMP pDefaultRamp;
--- a/Indoor.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Indoor.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -2739,7 +2739,7 @@ //----- (0046F228) -------------------------------------------------------- -void __cdecl BLV_UpdateDoors() +void BLV_UpdateDoors() { //int v0; // ebx@1 //int v1; // edi@1 @@ -3162,7 +3162,7 @@ // 6BE13C: using guessed type int dword_6BE13C_uCurrentlyLoadedLocationID; //----- (0046F90C) -------------------------------------------------------- -void __cdecl UpdateActors_BLV() +void UpdateActors_BLV() { Actor *v0; // esi@2 unsigned __int16 v1; // ax@2 @@ -3637,7 +3637,7 @@ //----- (00460A78) -------------------------------------------------------- -void __thiscall PrepareToLoadBLV(unsigned int bLoading) +void PrepareToLoadBLV(unsigned int bLoading) { unsigned int v1; // ebx@1 unsigned int v2; // eax@8 @@ -4241,7 +4241,7 @@ return result; } //----- (004016FA) -------------------------------------------------------- -int __cdecl MakeActorAIList_BLV() +int MakeActorAIList_BLV() { Actor *v0; // esi@2 int v1; // eax@4 @@ -5441,6 +5441,8 @@ int v_4c; // [sp+8Ch] [bp+10h]@141 int v_8; // [sp+90h] [bp+14h]@53 + __debugbreak(); + a4 = __PAIR__(z, x); v4 = stru_5C6E00->Atan2(v.x - x, v.y - z); v114 = 0; @@ -6209,7 +6211,7 @@ return 0; } //----- (0046BDF1) -------------------------------------------------------- -void __cdecl BLV_UpdateUserInputAndOther() +void BLV_UpdateUserInputAndOther() { UpdateObjects(); BLV_ProcessPartyActions();
--- a/IndoorCameraD3D.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/IndoorCameraD3D.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -29,8 +29,8 @@ /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, 24, 6, - (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, - (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ + (void ( *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, + (void ( *)(void *))IndoorCameraD3D_Vec4::dtor);*/ //v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; //v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; //v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; @@ -87,7 +87,7 @@ // v10->mm7__vector_000004, // 48, // 64, - // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); + // (int ( *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); //++v10; --v12; }
--- a/IndoorCameraD3D.h Wed Aug 21 20:58:36 2013 +0400 +++ b/IndoorCameraD3D.h Wed Aug 21 20:59:16 2013 +0400 @@ -14,7 +14,7 @@ //----- (004C039C) -------------------------------------------------------- //void ~IndoorCameraD3D_Vec3() {} - //void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D_Vec3 *, bool); + //void ( ***vdestructor_ptr)(IndoorCameraD3D_Vec3 *, bool); union { @@ -161,7 +161,7 @@ void DebugDrawPortal(struct BLVFace *pFace); - //void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D *, bool); + //void ( ***vdestructor_ptr)(IndoorCameraD3D *, bool); IndoorCameraD3D_Vec3 field_4[3]; //IndoorCameraD3D_Vec3 field_14; //IndoorCameraD3D_Vec3 field_24;
--- a/Indoor_stuff.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Indoor_stuff.h Wed Aug 21 20:59:16 2013 +0400 @@ -33,8 +33,8 @@ inline BspRenderer_stru0() { //_eh_vector_constructor_iterator_(std__vector_0007AC, 24, 4, - // (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, - // (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor); + // (void ( *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, + // (void ( *)(void *))IndoorCameraD3D_Vec4::dtor); //for (int i = 0; i < 4; ++i) // pVertices[i].flt_2C = 0.0f; } @@ -80,8 +80,8 @@ inline BspRenderer() { // _eh_vector_constructor_iterator_(field_FA8, 2252, 150, - // (void (__thiscall *)(void *))stru170_stru0::stru170_stru0, - // (void (__thiscall *)(void *))stru170_stru0::dtor); + // (void ( *)(void *))stru170_stru0::stru170_stru0, + // (void ( *)(void *))stru170_stru0::dtor); num_faces = 0; num_nodes = 0; uNumVisibleNotEmptySectors = 0; @@ -355,7 +355,7 @@ void GetFacePlane(struct ODMFace *pFace, struct BSPVertexBuffer *pVertices, struct Vec3_float_ *pOutNormal, float *pOutDist); - void (__thiscall ***vdestructor_ptr)(stru154 *, bool); + void ( ***vdestructor_ptr)(stru154 *, bool); Plane_float_ face_plane; PolygonType polygonType; char field_15;
--- a/Keyboard.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Keyboard.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -191,8 +191,8 @@ return 1; } LABEL_15: - v3 = 3; - goto LABEL_4; + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); + return 1; } } if ( !pKeyActionMap->uNumKeysPressed ) @@ -203,10 +203,9 @@ pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2; ++pKeyActionMap->uNumKeysPressed; pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0; + LABEL_3: - v3 = 2; -LABEL_4: - pKeyActionMap->SetWindowInputStatus(v3); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED); return 1; } // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
--- a/Keyboard.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Keyboard.h Wed Aug 21 20:59:16 2013 +0400 @@ -86,7 +86,7 @@ bool IsShiftHeld(); void EnterCriticalSection(); - void (__thiscall ***vdestructor_ptr)(Keyboard *, bool); + void ( ***vdestructor_ptr)(Keyboard *, bool); unsigned int bUsingAsynKeyboard; }; #pragma pack(pop)
--- a/LOD.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/LOD.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -1283,8 +1283,8 @@ v1->pSpriteHeaders, 40, 1500, - (void (__thiscall *)(void *))LODSprite::LODSprite, - (void (__thiscall *)(void *))LODSprite::dtor);*/ + (void ( *)(void *))LODSprite::LODSprite, + (void ( *)(void *))LODSprite::dtor);*/ field_ECA4 = 0; field_ECA0 = 0; pHardwareSprites = 0; @@ -2947,7 +2947,7 @@ } //----- (0046080D) -------------------------------------------------------- -void __cdecl sub_46080D() +void sub_46080D() { pAllocator->FreeChunk(ptr_6A0D08); ptr_6A0D08 = 0;
--- a/LightmapBuilder.h Wed Aug 21 20:58:36 2013 +0400 +++ b/LightmapBuilder.h Wed Aug 21 20:59:16 2013 +0400 @@ -12,7 +12,7 @@ Lightmap(); virtual ~Lightmap() {} - //void (__thiscall ***vdestructor_ptr)(Lightmap *, bool); + //void ( ***vdestructor_ptr)(Lightmap *, bool); unsigned int uNumVertices; RenderVertexSoft pVertices[64]; __int16 field_C08; @@ -60,7 +60,7 @@ bool ApplyLights(struct stru320 *a2, struct stru154 *a3, unsigned int uNumVertices, struct RenderVertexSoft *a5, struct IndoorCameraD3D_Vec4 *, char uClipFlag); - //void (__thiscall ***vdestructor_ptr)(LightmapBuilder *, bool); + //void ( ***vdestructor_ptr)(LightmapBuilder *, bool); //std::vector<Lightmap> std__vector_000004; //std::vector<Lightmap> std__vector_183808; Lightmap std__vector_000004[512];
--- a/Lights.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Lights.h Wed Aug 21 20:59:16 2013 +0400 @@ -98,7 +98,7 @@ - //void (__thiscall ***vdestructor_ptr)(LightsStack_StationaryLight_ *, bool); + //void ( ***vdestructor_ptr)(LightsStack_StationaryLight_ *, bool); StationaryLight pLights[400]; unsigned int uNumLightsActive; }; @@ -127,7 +127,7 @@ - //void (__thiscall ***vdestructor_ptr)(LightsStack_MobileLight_ *, bool); + //void ( ***vdestructor_ptr)(LightsStack_MobileLight_ *, bool); MobileLight pLights[400]; unsigned int uNumLightsActive; };
--- a/MM7.h Wed Aug 21 20:58:36 2013 +0400 +++ b/MM7.h Wed Aug 21 20:59:16 2013 +0400 @@ -22,7 +22,7 @@ char ddraw_error(HRESULT hr, char *Str, size_t a3); char dinput_error(int a1, const char *Str, int a3); - void (__thiscall ***vdestructor_ptr)(CheckHRESULT_stru0 *, bool); + void ( ***vdestructor_ptr)(CheckHRESULT_stru0 *, bool); }; #pragma pack(pop)*/
--- a/Mouse.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Mouse.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -614,30 +614,6 @@ } - -//----- (00417871) -------------------------------------------------------- -void __thiscall sub_417871(int *pXY) -{ - POINT v1; // [sp+0h] [bp-18h]@5 - POINT a2; // [sp+8h] [bp-10h]@5 - unsigned int pY; // [sp+10h] [bp-8h]@3 - unsigned int pX; // [sp+14h] [bp-4h]@3 - - if ( !pRenderer->pRenderD3D ) - { - if ( pXY ) - { - pX = *pXY; - pY = pXY[1]; - } - else - { - pMouse->GetClickPos(&pX, &pY); - } - pMouse->GetCursorPos(&a2); - pMouse->GetCursorPos(&v1); - } -} //----- (0041CD4F) -------------------------------------------------------- bool UI_OnKeyDown(unsigned int vkKey) {
--- a/Mouse.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Mouse.h Wed Aug 21 20:59:16 2013 +0400 @@ -32,7 +32,7 @@ DeleteCriticalSection(&v1->csAsyncMouse); } - void (__thiscall ***vdestructor_ptr)(ThreadWard *, bool); + void ( ***vdestructor_ptr)(ThreadWard *, bool); _RTL_CRITICAL_SECTION csAsyncMouse; _RTL_CRITICAL_SECTION cs2; _RTL_CRITICAL_SECTION cs3;
--- a/NPC.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/NPC.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -903,7 +903,7 @@ //----- (00476395) -------------------------------------------------------- //0x26 Wizard eye at skill level 2 -bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession) +bool CheckHiredNPCSpeciality(unsigned int uProfession) { if ( bNoNPCHiring == 1 ) @@ -1142,7 +1142,7 @@ } //----- (00476750) -------------------------------------------------------- -void __cdecl InitializeAutonotes() +void InitializeAutonotes() { int i; char* test_string; @@ -1227,7 +1227,7 @@ //----- (004768A9) -------------------------------------------------------- -void __cdecl InitializeQuests() +void InitializeQuests() { int i; char* test_string; @@ -1340,7 +1340,7 @@ /*switch ( pEventNumber ) { case 139: - sub_4B1ECE(); + OracleDialogue(); goto _return; case 311: sub_4BBA85_bounties(); @@ -1352,7 +1352,7 @@ { if ( pEventNumber == 139 ) { - sub_4B1ECE(); + OracleDialogue(); } else {
--- a/OSInfo.h Wed Aug 21 20:58:36 2013 +0400 +++ b/OSInfo.h Wed Aug 21 20:59:16 2013 +0400 @@ -21,7 +21,7 @@ } - //void (__thiscall ***vdestructor_ptr)(OSVersion *, bool); + //void ( ***vdestructor_ptr)(OSVersion *, bool); OSVERSIONINFOA pVersionInfo; int bInitialized; };
--- a/Outdoor.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Outdoor.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -3546,7 +3546,7 @@ pActors[ai_near_actors_ids[i]].uAttributes |= 0x0400; } //----- (0046BE0A) -------------------------------------------------------- -void __cdecl ODM_UpdateUserInputAndOther() +void ODM_UpdateUserInputAndOther() { bool v0; // eax@5 char pOut[32]; // [sp+8h] [bp-20h]@5 @@ -3581,7 +3581,7 @@ check_event_triggers(); } //----- (0041F54A) -------------------------------------------------------- -void __cdecl LoadActualSkyFrame() +void LoadActualSkyFrame() { if ( pTexture_RestUI_CurrentSkyFrame ) pTexture_RestUI_CurrentSkyFrame->Release();
--- a/Party.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Party.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -1181,7 +1181,7 @@ _494035_timed_effects__water_walking_damage__etc(); } //----- (004B1BDB) -------------------------------------------------------- -void __stdcall RestAndHeal(__int64 uNumMinutes) +void RestAndHeal(__int64 uNumMinutes) { signed __int64 v1; // ST2C_8@1 signed __int64 v2; // qax@1 @@ -1218,7 +1218,7 @@ pParty->UpdatePlayersAndHirelingsEmotions(); } //----- (0041F5BE) -------------------------------------------------------- -void __cdecl Sleep6Hours() +void Sleep6Hours() { if ( _506F18_num_minutes_to_sleep < 6 ) { @@ -1264,7 +1264,7 @@ } //----- (0047752B) -------------------------------------------------------- -int __cdecl GetPartyReputation() +int GetPartyReputation() { DDM_DLV_Header *v0; // ebx@1 signed int v1; // esi@3 @@ -1427,7 +1427,7 @@ pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); } //----- (00421B2C) -------------------------------------------------------- -bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() +bool sub_421B2C_PlaceInInventory_or_DropPickedItem() { unsigned int v0; // eax@2 Texture *v1; // ebx@2
--- a/Player.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Player.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -162,7 +162,7 @@ //----- (00490913) -------------------------------------------------------- -signed int __cdecl PlayerCreation_GetUnspentAttributePointCount() +int PlayerCreation_GetUnspentAttributePointCount() { signed int v0; // edi@1 int raceId; // ebx@2 @@ -5635,7 +5635,7 @@ } //----- (004905F5) -------------------------------------------------------- -//signed int __thiscall PartyCreation_BtnPlusClick(Player *this, int eAttribute) +//signed int PartyCreation_BtnPlusClick(Player *this, int eAttribute) void Player::IncreaseAttribute( int eAttribute ) { int raceId; // eax@1 @@ -6287,9 +6287,9 @@ return; } else - { - if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp - { + { + if (pParty->pPickedItem.uItemID == 616) //Genie Lamp + { thisa = pParty->uCurrentMonthWeek + 1; if ( pParty->uCurrentMonth >= 7 ) v74 = NULL; @@ -6376,7 +6376,7 @@ } ShowStatusBarString(pTmpBuf.data(), 2u); pMouse->RemoveHoldingItem(); - pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); + pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); v3->PlaySound(SPEECH_93, 0); pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) @@ -6397,36 +6397,35 @@ return; } else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple - { + { Party::GiveFood(1u); - pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0); - - } + pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0); + } else if ( pParty->pPickedItem.uItemID == 632 ) //Lute { - pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0); + pAudioPlayer->PlaySound(SOUND_PlayLute, 0, 0, -1, 0, 0, 0, 0); return; } else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes { - pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0); + pAudioPlayer->PlaySound(SOUND_PlayFaeriePipes, 0, 0, -1, 0, 0, 0, 0); return; } else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet { - pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0); + pAudioPlayer->PlaySound(SOUND_PlayGryphonheartsTrumpet, 0, 0, -1, 0, 0, 0, 0); return; } else if ( pParty->pPickedItem.uItemID == 646 ) //Horseshoe - { - pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); - v5 = PID(OBJECT_Player,player_num + 49); + { + pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); + v5 = PID(OBJECT_Player, player_num + 49); pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); v3->AddVariable(VAR_NumSkillPoints, 2); } else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle { - sub_44C28F_open_nwc_dungeon(); + TeleportToNWCDungeon(); return; } else @@ -8683,14 +8682,14 @@ //----- (0049387A) -------------------------------------------------------- -int CycleCharacter(unsigned int _this) +int CycleCharacter(bool backwards) { signed int result; // eax@1 signed int v2; // ecx@2 signed int v3; // ecx@8 result = uActiveCharacter; - if ( _this ) + if ( backwards ) { v2 = 0; while ( 1 ) @@ -8784,7 +8783,7 @@ return false; } //----- (0043EDB9) -------------------------------------------------------- -bool __thiscall sub_43EDB9_get_some_race_sex_relation_2(unsigned int a1) +bool sub_43EDB9_get_some_race_sex_relation_2(unsigned int a1) { unsigned int pNum; // ebp@1 Player **pPlayer; // ebx@1 @@ -9371,7 +9370,7 @@ } } //----- (00421EA6) -------------------------------------------------------- -void __cdecl OnInventoryLeftClick() +void OnInventoryLeftClick() { Player *v0; // ebx@1 signed int v1; // eax@2
--- a/Render.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/Render.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -91,7 +91,7 @@ signed int __stdcall RenderD3D__DeviceEnumerator(GUID *lpGUID, const char *lpDevDesc, const char *lpDriverName, RenderD3D__DevInfo *pOut); // idb //----- (0049E79F) -------------------------------------------------------- -bool __cdecl CheckTextureStages() +bool CheckTextureStages() { bool v0; // edi@1 IDirectDrawSurface4 *pSurface2; // [sp+Ch] [bp-14h]@1 @@ -182,7 +182,7 @@ } //----- (004A16A5) -------------------------------------------------------- -bool __cdecl AreRenderSurfacesOk() +bool AreRenderSurfacesOk() { char v0; // zf@4 bool result; // eax@8 @@ -8378,7 +8378,7 @@ if ( !pRenderer->bWindowMode && (dword_6BE364_game_settings_1 & 2) ) { - ModalWindow(pGlobalTXT_LocalizationStrings[62], 0);// "Might and Magic VII requires your desktop to be in 16bit (32k or 65k) Color mode in order to operate in a window." + ModalWindow(pGlobalTXT_LocalizationStrings[62], UIMSG_0);// "Might and Magic VII requires your desktop to be in 16bit (32k or 65k) Color mode in order to operate in a window." return; } if ( pRenderer->bWindowMode || !pRenderer->pRenderD3D || pRenderer->pRenderD3D->pAvailableDevices->bIsDeviceCompatible ) @@ -8821,15 +8821,7 @@ } } //----- (0040DF3D) -------------------------------------------------------- -void __cdecl CallRenderPresent() +void CallRenderPresent() { pRenderer->Present(); } - - - -//----- (0044EC20) -------------------------------------------------------- -/*bool RenderD3D::DoesRaiseExceptions() -{ - return true; -}*/ \ No newline at end of file
--- a/Render.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Render.h Wed Aug 21 20:59:16 2013 +0400 @@ -445,7 +445,7 @@ IDirect3DTexture2 *pTexture; int field_1036B8; int _gpu_memory_used; - void (__cdecl *pBeforePresentFunction)(); + void ( *pBeforePresentFunction)(); int field_1036C4; uint bFogEnabled; int field_1036CC;
--- a/SaveLoad.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/SaveLoad.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -836,7 +836,7 @@ return pPixels; } //----- (0045E26C) -------------------------------------------------------- -void __thiscall SaveScreenshot(const char *pFilename) +void SaveScreenshot(const char *pFilename) { unsigned __int16 *v2; // esi@1
--- a/UI/Books/UIMapBook.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/Books/UIMapBook.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -78,7 +78,7 @@ } //----- (00410DEC) -------------------------------------------------------- -unsigned int __cdecl DrawLloydBeaconsScreen() +unsigned int DrawLloydBeaconsScreen() { Player *pPlayer; // esi@1 char *pText; // eax@1
--- a/UI/UICharacter.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UICharacter.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -43,6 +43,10 @@ unsigned int ui_character_skillinfo_can_learn; unsigned int ui_character_skillinfo_can_learn_gm; unsigned int ui_character_skillinfo_cant_learn; +unsigned int ui_character_condition_normal_color; +unsigned int ui_character_condition_light_color; +unsigned int ui_character_condition_moderate_color; +unsigned int ui_character_condition_severe_color; std::array<unsigned int, 6> ui_character_award_color; unsigned int ui_game_minimap_outline_color; @@ -107,6 +111,11 @@ ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); + + ui_character_condition_normal_color = TargetColor(255, 255, 255); + ui_character_condition_light_color = TargetColor(0, 255, 0); + ui_character_condition_moderate_color = TargetColor(225, 205, 35); + ui_character_condition_severe_color = TargetColor(255, 35, 0); ui_character_award_color[0] = TargetColor(248, 108, 160); ui_character_award_color[1] = TargetColor(112, 220, 248); @@ -667,7 +676,7 @@ { case WINDOW_CharacterWindow_Stats: // stats CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_StatsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, @@ -680,7 +689,7 @@ CharacterUI_ReleaseButtons(); CharacterUI_SkillsTab_CreateButtons(); } - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_SkillsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, @@ -689,7 +698,7 @@ case WINDOW_CharacterWindow_Awards: // awards CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CreateAwardsScrollBar(); CharacterUI_AwardsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, @@ -699,7 +708,7 @@ case WINDOW_CharacterWindow_Inventory: // inventory and other CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_InventoryTab_Draw(player, false); pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, @@ -2456,7 +2465,7 @@ } } //----- (00468F8A) -------------------------------------------------------- -void __cdecl OnPaperdollLeftClick() +void OnPaperdollLeftClick() { int v1; // ecx@1 unsigned int v2; // edi@1
--- a/UI/UIHouses.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UIHouses.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -762,7 +762,7 @@ //----- (004B1784) -------------------------------------------------------- -bool __cdecl HouseUI_CheckIfPlayerCanInteract() +bool HouseUI_CheckIfPlayerCanInteract() { Player *pPlayer; // ebx@1 bool result; // eax@2 @@ -829,7 +829,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; viewparams->bRedrawGameUI = 1; uDialogueType = 0; - pKeyActionMap->SetWindowInputStatus(3); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); pKeyActionMap->ResetKeys(); if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601) { @@ -2061,7 +2061,7 @@ */ } //----- (004B6943) -------------------------------------------------------- -void __cdecl TravelByTransport() +void TravelByTransport() { GUIWindow *v0; // ebx@1 Player *v1; // esi@1 @@ -2391,7 +2391,7 @@ //----- (004B7911) -------------------------------------------------------- -void __cdecl TownHallDialog() +void TownHallDialog() { GUIWindow *v0; // eax@4 int v1; // eax@10 @@ -2569,7 +2569,7 @@ } //----- (004B7D7E) -------------------------------------------------------- -void __cdecl BankDialog() +void BankDialog() { GUIWindow *v0; // eax@4 //int v1; // ecx@5 @@ -2711,7 +2711,7 @@ // F8B19C: using guessed type int dword_F8B19C; //----- (004B8285) -------------------------------------------------------- -void __cdecl TavernDialog() +void TavernDialog() { int v0; int pItemNum;
--- a/UI/UIHouses.h Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UIHouses.h Wed Aug 21 20:59:16 2013 +0400 @@ -124,15 +124,15 @@ void GuildDialog(); void sub_4B6478(); bool __fastcall IsTravelAvailable(int a1); -void __cdecl TravelByTransport(); +void TravelByTransport(); void TempleDialog(); -void __cdecl TownHallDialog(); -void __cdecl BankDialog(); -void __cdecl TavernDialog(); +void TownHallDialog(); +void BankDialog(); +void TavernDialog(); void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound); // idb -void __cdecl WeaponShopDialog(); -void __cdecl AlchemistDialog(); -void __cdecl ArmorShopDialog(); +void WeaponShopDialog(); +void AlchemistDialog(); +void ArmorShopDialog(); void InitializaDialogueOptions_Tavern(BuildingType type); // idb
--- a/UI/UIPartyCreation.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UIPartyCreation.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -25,7 +25,7 @@ //----- (004908DE) -------------------------------------------------------- -signed int __cdecl PlayerCreation_Chose4Skills() +int PlayerCreation_Choose4Skills() { Player *v0; // esi@1 signed int v1; // edx@2 @@ -59,7 +59,7 @@ //----- (00491CB5) -------------------------------------------------------- -void __cdecl LoadPlayerPortraintsAndVoices() +void LoadPlayerPortraintsAndVoices() { //Texture **v0; // ebx@1 //int v1; // eax@2 @@ -475,7 +475,7 @@ } //----- (0049695A) -------------------------------------------------------- -void __cdecl PlayerCreationUI_Initialize() +void PlayerCreationUI_Initialize() { unsigned int v0; // ebx@5 unsigned int v1; // eax@6
--- a/UI/UIPopup.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UIPopup.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -551,7 +551,7 @@ { if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) { - sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); + init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); strcpy(pTmpBuf.data(), "Duration:"); Str = (char *)(v67.field_18_expire_year - game_starting_year); if (v67.field_18_expire_year != 1168 ) @@ -1596,7 +1596,7 @@ } //----- (00418083) -------------------------------------------------------- -void __cdecl CharacterUI_StatsTab_ShowHint() +void CharacterUI_StatsTab_ShowHint() { int pStringNum; // edi@1 signed int pTextColor; // eax@15 @@ -1687,7 +1687,7 @@ v15 = pPlayers[uActiveCharacter]->uLevel; do { - if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)sub_4B46F8(v15) ) + if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) break; ++v15; } @@ -1696,7 +1696,7 @@ pTmpBuf2[0] = 0; if ( v15 > pPlayers[uActiveCharacter]->uLevel ) sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); - v16 = sub_4B46F8(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience); + v16 = GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience); sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1); strcat(pTmpBuf.data(), "\n"); strcat(pTmpBuf.data(), pTmpBuf2.data()); @@ -1763,7 +1763,7 @@ } //----- (00410B28) -------------------------------------------------------- - void __thiscall DrawSpellDescriptionPopup(int spell_index) + void DrawSpellDescriptionPopup(int spell_index) { Player *v1; // edi@1 SpellInfo *v2; // esi@1
--- a/UI/UIShops.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UIShops.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -14,7 +14,7 @@ #include "..\Viewport.h" //----- (004B910F) -------------------------------------------------------- -void __cdecl WeaponShopDialog() +void WeaponShopDialog() { int v0; // ebx@1 int pNumActiveItem; // eax@6 @@ -183,7 +183,7 @@ v49 += 30; v51 = 60 - ((signed int)v50->uTextureWidth >> 1); pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50); - sub_40F92A(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); v48 = v109; } pItemNum += 70; @@ -376,7 +376,7 @@ v53 = ItemsInShopTexture[(signed int)v109]; v54 = 60 - ((signed int)v53->uTextureWidth >> 1); pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53); - sub_40F92A(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); } v109 = (const char **)((char *)v109 + 1); pItemNum += 70; @@ -538,7 +538,7 @@ } //----- (004BA928) -------------------------------------------------------- -void __cdecl ArmorShopDialog() +void ArmorShopDialog() { signed int v1; // esi@8 unsigned int v2; // eax@10 @@ -1106,7 +1106,7 @@ } } //----- (004B9CC6) -------------------------------------------------------- -void __cdecl AlchemistDialog() +void AlchemistDialog() { int v0; int pNumActiveItem; // eax@7 @@ -1287,7 +1287,7 @@ else if ( (signed int)v48 < 18 ) v48 = 18; pRenderer->DrawTextureTransparent(v48, v47, v46); - sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1); } ++v114; } @@ -1317,7 +1317,7 @@ v52 = 18; } pRenderer->DrawTextureTransparent(v52, v51, v50); - sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); } ++v114; } @@ -1489,7 +1489,7 @@ v56 = 18; } pRenderer->DrawTextureTransparent(v56, v55, v54); - sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1); } ++v114; } @@ -1519,7 +1519,7 @@ v60 = 18; } pRenderer->DrawTextureTransparent(v60, v59, v58); - sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); } ++v114; } @@ -1857,7 +1857,7 @@ v52 = 18; } pRenderer->DrawTextureTransparent(v52, v51, v50); - sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1); v49 = v122; } ++v49; @@ -1887,7 +1887,7 @@ v56 = 18; } pRenderer->DrawTextureTransparent(v56, v55, v54); - sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); } ++v122; } @@ -1987,7 +1987,7 @@ v60 = 18; } pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]); - sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1); v49 = v122; } ++v49; @@ -2018,7 +2018,7 @@ v64 = 18; } pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]); - sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); + ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); } ++v122; } @@ -2293,7 +2293,7 @@ return; } //----- (004BDB56) -------------------------------------------------------- -void __cdecl UIShop_Buy_Identify_Repair() +void UIShop_Buy_Identify_Repair() { int v8; // eax@15 unsigned int pItemID; // esi@20 @@ -2582,7 +2582,7 @@ } } //----- (004B1A2D) -------------------------------------------------------- -void __cdecl ShowPopupShopItem() +void ShowPopupShopItem() { POINT *v1; // esi@5 unsigned int v2; // eax@5 @@ -2646,7 +2646,7 @@ } } //----- (004B1D27) -------------------------------------------------------- -void __cdecl GetHouseGoodbyeSpeech() +void GetHouseGoodbyeSpeech() { signed int v2; // edi@10 signed int v5; // edi@20
--- a/UI/UiGame.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/UI/UiGame.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -809,7 +809,7 @@ } if ( pKeyActionMap->pPressedKeysBuffer[0] ) { - pKeyActionMap->SetWindowInputStatus(0); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); goto LABEL_15; } } @@ -1458,7 +1458,7 @@ //----- (00420EFF) -------------------------------------------------------- -void __cdecl GameUI_WritePointedObjectStatusString() +void GameUI_WritePointedObjectStatusString() { int v1; // ebx@6 GUIWindow *pWindow; // edi@7 @@ -2767,7 +2767,7 @@ } //----- (00441498) -------------------------------------------------------- -void __cdecl GameUI_DrawTorchlightAndWizardEye() +void GameUI_DrawTorchlightAndWizardEye() { if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_MENU @@ -2930,46 +2930,36 @@ } //----- (00417939) -------------------------------------------------------- -signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx) +int GetConditionDrawColor(unsigned int uConditionIdx) { - unsigned int v1; // ebx@1 - signed int v2; // edi@1 - unsigned int v3; // esi@1 - unsigned int v4; // eax@1 - unsigned int v6; // [sp+Ch] [bp-4h]@1 - - v1 = uConditionIdx; - v2 = 65535; - v3 = TargetColor(0xE1u, 0xCDu, 0x23u); - v6 = TargetColor(0xFFu, 0x23u, 0); - v4 = TargetColor(0, 0xFFu, 0); - switch ( v1 ) + switch (uConditionIdx) { - case 0u: - case 1u: - case 3u: - case 4u: - case 5u: - case 6u: - case 7u: - v2 = v4; - break; - case 2u: - case 8u: - case 9u: - case 0xCu: - case 0xDu: - v2 = v3; - break; - case 0xAu: - case 0xBu: - case 0xEu: - case 0xFu: - case 0x10u: - v2 = v6; - break; - default: - return v2; + case Condition_Zombie: + case Condition_Good: + return ui_character_condition_normal_color; + + case Condition_Cursed: + case Condition_Weak: + case Condition_Fear: + case Condition_Drunk: + case Condition_Insane: + case Condition_Poison1: + case Condition_Disease1: + return ui_character_condition_light_color; + + case Condition_Sleep: + case Condition_Poison2: + case Condition_Disease2: + case Condition_Paralyzed: + case Condition_Unconcious: + return ui_character_condition_moderate_color; + + case Condition_Poison3: + case Condition_Disease3: + case Condition_Dead: + case Condition_Pertified: + case Condition_Eradicated: + return ui_character_condition_severe_color; } - return v2; + assert(false && "Invalid condition"); }
--- a/VideoPlayer.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/VideoPlayer.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -65,6 +65,8 @@ +bool BinkLockBuffer(struct _BINKBUF *_this); +void BinkUnlockBuffer(struct _BINKBUF *_this); //----- (004BFE2D) -------------------------------------------------------- _BINKBUF *VideoPlayer::CreateBinkBuffer(HWND hWindow, unsigned int uWidth, unsigned int uHeight, char a4) @@ -293,7 +295,7 @@ } } //----- (004BF794) -------------------------------------------------------- -void __cdecl ShowIntroVideo_and_LoadingScreen() +void ShowIntroVideo_and_LoadingScreen() { RGBTexture tex; // [sp+Ch] [bp-30h]@1 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
--- a/VideoPlayer.h Wed Aug 21 20:58:36 2013 +0400 +++ b/VideoPlayer.h Wed Aug 21 20:59:16 2013 +0400 @@ -104,7 +104,7 @@ -void __cdecl ShowIntroVideo_and_LoadingScreen(); +void ShowIntroVideo_and_LoadingScreen();
--- a/Vis.h Wed Aug 21 20:58:36 2013 +0400 +++ b/Vis.h Wed Aug 21 20:59:16 2013 +0400 @@ -70,7 +70,7 @@ object_pool[uNumPointers++].sZValue = packed_zval; } - void (__thiscall ***vdestructor_ptr)(Vis_SelectionList *, bool); + void ( ***vdestructor_ptr)(Vis_SelectionList *, bool); Vis_ObjectInfo object_pool[512]; Vis_ObjectInfo *object_pointers[512]; unsigned int uNumPointers; @@ -122,7 +122,7 @@ bool SortByScreenSpaceX(struct RenderVertexSoft *pArray, int sLeft, int sRight); bool SortByScreenSpaceY(struct RenderVertexSoft *pArray, int sLeft, int sRight); - //void (__thiscall ***vdestructor_ptr)(Vis *, bool); + //void ( ***vdestructor_ptr)(Vis *, bool); Vis_SelectionList default_list; RenderVertexSoft stru_200C; RenderVertexSoft stru_203C;
--- a/_deleted.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/_deleted.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -71,7 +71,7 @@ void _4898E6(); - void (__thiscall *vdestructor_ptr)(stru12 *); + void ( *vdestructor_ptr)(stru12 *); int field_4[16]; int field_44; int field_48; @@ -5875,7 +5875,7 @@ } //----- (00486F92) -------------------------------------------------------- -void __cdecl sr_sub_486F92_MessWithEdgesAndSpans() +void sr_sub_486F92_MessWithEdgesAndSpans() { Span *v0; // ebx@1 int v1; // eax@2 @@ -9382,7 +9382,7 @@ } //----- (00423B4A) -------------------------------------------------------- -void __cdecl sub_423B4A() +void sub_423B4A() { float *v0; // eax@1 signed int v1; // ecx@1 @@ -10576,7 +10576,7 @@ } //----- (004AF412) -------------------------------------------------------- -int __cdecl sr_4AF412() +int sr_4AF412() { int v0; // ST20_4@2 int v1; // ST20_4@2 @@ -11023,7 +11023,7 @@ return result; } //----- (004AC1C9) -------------------------------------------------------- -int __thiscall _4AC1C9_get_cpu_speed(unsigned int _this, Vec4_int_ *a2) +int _4AC1C9_get_cpu_speed(unsigned int _this, Vec4_int_ *a2) { unsigned int v2; // esi@1 __int16 v3; // di@1 @@ -11097,7 +11097,7 @@ //----- (004382BC) -------------------------------------------------------- -__int16 __thiscall _4382BC_get_cpu_speed_sub0(int _this) +__int16 _4382BC_get_cpu_speed_sub0(int _this) { __int16 result; // ax@4 __int16 v14; // sp@11 @@ -11158,7 +11158,7 @@ //----- (0043847A) -------------------------------------------------------- -__int16 __cdecl _43847A_get_cpu_speed_sub1() +__int16 _43847A_get_cpu_speed_sub1() { signed int v5; // eax@1 char v12[12]; // [sp+Ch] [bp-28h]@1 @@ -11208,7 +11208,7 @@ //----- (004383ED) -------------------------------------------------------- -int __cdecl _4383ED_get_cpu_speed_sub2() +int _4383ED_get_cpu_speed_sub2() { signed int v9; // eax@4 int v16; // [sp-4h] [bp-38h]@0 @@ -11265,7 +11265,7 @@ //----- (004AC4FD) -------------------------------------------------------- -Vec4_int_ *__thiscall _4AC4FD_get_cpu_clocks_rdtsc(int _this, Vec4_int_ *a1) +Vec4_int_ * _4AC4FD_get_cpu_clocks_rdtsc(int _this, Vec4_int_ *a1) { int v2; // eax@1 int v3; // eax@4 @@ -11348,7 +11348,7 @@ //----- (004AC33A) -------------------------------------------------------- -Vec4_int_ *__thiscall _4AC33A_get_cpu_clocks_QPC(int _this, Vec4_int_ *a1) +Vec4_int_ * _4AC33A_get_cpu_clocks_QPC(int _this, Vec4_int_ *a1) { int v2; // esi@1 int v3; // ebx@1 @@ -11459,7 +11459,7 @@ //----- (004AC277) -------------------------------------------------------- -Vec4_int_ *__thiscall _4AC277_get_cpu_speed_sub3(unsigned int _this, Vec4_int_ *a2) +Vec4_int_ * _4AC277_get_cpu_speed_sub3(unsigned int _this, Vec4_int_ *a2) { signed int v2; // esi@1 signed __int16 v4; // bx@3 @@ -11516,7 +11516,7 @@ } //----- (004D714C) -------------------------------------------------------- -int __cdecl sr_sub_4D714C(stru315 *a1) +int sr_sub_4D714C(stru315 *a1) { stru315 *v1; // ebp@0 stru315 *v2; // ebp@1 @@ -11724,7 +11724,7 @@ } //----- (004D71F8) -------------------------------------------------------- -int __cdecl sr_sub_4D71F8(stru315 *a1) +int sr_sub_4D71F8(stru315 *a1) { stru315 *v1; // ebp@0 stru315 *v2; // ebp@1 @@ -11808,7 +11808,7 @@ } //----- (004D754B) -------------------------------------------------------- -void __cdecl sr_sub_4D754B(stru315 *a1, stru316 *a2) +void sr_sub_4D754B(stru315 *a1, stru316 *a2) { int v2; // ecx@1 unsigned int v3; // eax@2 @@ -12017,7 +12017,7 @@ } //----- (004D7630) -------------------------------------------------------- -void __cdecl sr_sub_4D7630(stru315 *a1, stru316 *a2) +void sr_sub_4D7630(stru315 *a1, stru316 *a2) { int v2; // ecx@1 int v3; // eax@2 @@ -12075,7 +12075,7 @@ } //----- (004D76ED) -------------------------------------------------------- -void __cdecl sr_sub_4D76ED(stru315 *a1, stru316 *a2) +void sr_sub_4D76ED(stru315 *a1, stru316 *a2) { int v2; // ecx@1 unsigned int v3; // eax@2 @@ -12143,7 +12143,7 @@ } //----- (004D77D2) -------------------------------------------------------- -void __cdecl sr_sub_4D77D2(stru315 *a1, stru316 *a2) +void sr_sub_4D77D2(stru315 *a1, stru316 *a2) { int v2; // ecx@1 unsigned __int16 *v3; // ebx@2 @@ -12207,7 +12207,7 @@ } } //----- (004D789A) -------------------------------------------------------- -void __cdecl sr_sub_4D789A(stru315 *a1, stru316 *a2) +void sr_sub_4D789A(stru315 *a1, stru316 *a2) { int v2; // ecx@1 unsigned int v3; // eax@2
--- a/lib/legacy_dx/d3drmobj.h Wed Aug 21 20:58:36 2013 +0400 +++ b/lib/legacy_dx/d3drmobj.h Wed Aug 21 20:59:16 2013 +0400 @@ -173,26 +173,26 @@ DEFINE_GUID(IID_IDirect3DRMPicked2Array, 0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); DEFINE_GUID(IID_IDirect3DRMClippedVisual, 0x5434e733, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); -typedef void (__cdecl *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); -typedef void (__cdecl *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); -typedef void (__cdecl *D3DRMFRAME3MOVECALLBACK)(LPDIRECT3DRMFRAME3 obj, LPVOID arg, D3DVALUE delta); -typedef void (__cdecl *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); -typedef void (__cdecl *D3DRMDEVICE3UPDATECALLBACK)(LPDIRECT3DRMDEVICE3 obj, LPVOID arg, int, LPD3DRECT); -typedef int (__cdecl *D3DRMUSERVISUALCALLBACK) +typedef void ( *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); +typedef void ( *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); +typedef void ( *D3DRMFRAME3MOVECALLBACK)(LPDIRECT3DRMFRAME3 obj, LPVOID arg, D3DVALUE delta); +typedef void ( *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); +typedef void ( *D3DRMDEVICE3UPDATECALLBACK)(LPDIRECT3DRMDEVICE3 obj, LPVOID arg, int, LPD3DRECT); +typedef int ( *D3DRMUSERVISUALCALLBACK) ( LPDIRECT3DRMUSERVISUAL obj, LPVOID arg, D3DRMUSERVISUALREASON reason, LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMVIEWPORT view ); -typedef HRESULT (__cdecl *D3DRMLOADTEXTURECALLBACK) +typedef HRESULT ( *D3DRMLOADTEXTURECALLBACK) (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE *); -typedef HRESULT (__cdecl *D3DRMLOADTEXTURE3CALLBACK) +typedef HRESULT ( *D3DRMLOADTEXTURE3CALLBACK) (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE3 *); -typedef void (__cdecl *D3DRMLOADCALLBACK) +typedef void ( *D3DRMLOADCALLBACK) (LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg); -typedef HRESULT (__cdecl *D3DRMDOWNSAMPLECALLBACK) +typedef HRESULT ( *D3DRMDOWNSAMPLECALLBACK) (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, LPDIRECTDRAWSURFACE pDDSSrc, LPDIRECTDRAWSURFACE pDDSDst); -typedef HRESULT (__cdecl *D3DRMVALIDATIONCALLBACK) +typedef HRESULT ( *D3DRMVALIDATIONCALLBACK) (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, DWORD dwFlags, DWORD dwcRects, LPRECT pRects);
--- a/mm7_1.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_1.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -59,6 +59,8 @@ return (((__int64)a1 << 16) * a2) >> 16; } + +//----- (0042EBBE) -------------------------------------------------------- //----- (004453C0) mm6----------------------------------------------------- //----- (004A1760) mm6_chinese--------------------------------------------- int fixpoint_sub0(int a1, int a2)
--- a/mm7_2.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_2.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -296,7 +296,7 @@ } //----- (004BBCDD) -------------------------------------------------------- -void __cdecl sub_4BBCDD() +void sub_4BBCDD() { signed int v0; // ebp@3 Actor *v1; // eax@4 @@ -387,7 +387,7 @@ } //----- (004BC109) -------------------------------------------------------- -void __cdecl ArenaFight() +void ArenaFight() { int v0; // edi@1 char *v1; // eax@7 @@ -598,7 +598,7 @@ } //----- (004BD8B5) -------------------------------------------------------- -signed int __cdecl sub_4BD8B5() +int sub_4BD8B5() { int v0; // eax@4 int v1; // eax@29 @@ -607,7 +607,7 @@ if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pKeyActionMap->SetWindowInputStatus(3); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); pKeyActionMap->ResetKeys(); activeLevelDecoration = NULL; current_npc_text = 0; @@ -694,7 +694,7 @@ } //----- (004BF91E) -------------------------------------------------------- -unsigned int __thiscall GameOverMenu(void *ecx0) +unsigned int GameOverMenu(void *ecx0) { char *v1; // eax@2 unsigned int result; // eax@3 @@ -1578,7 +1578,7 @@ } //----- (00450521) -------------------------------------------------------- -signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) +int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) { int v6; // edi@1 int v7; // esi@1 @@ -1962,7 +1962,7 @@ // 5C6DF8: using guessed type int dword_5C6DF8; //----- (00450DA3) -------------------------------------------------------- -int __cdecl GetAlertStatus() +int GetAlertStatus() { int result; // eax@2 @@ -3034,7 +3034,7 @@ // 6BE35C: using guessed type int uLevel_StartingPointType; //----- (00461103) -------------------------------------------------------- -void __cdecl sub_461103() +void _461103_load_level_sub() { //GUIProgressBar *v0; // ebx@1 //signed int v1; // ebp@1 @@ -3188,7 +3188,7 @@ uNumActors = 0; if ( dword_6BE368_debug_settings_2 & 8 ) uNumLevelDecorations = 0; - sub_4613C4(); + init_event_triggers(); pGameLoadingUI_ProgressBar->Progress(); @@ -3206,38 +3206,15 @@ } //----- (004613C4) -------------------------------------------------------- -int __cdecl sub_4613C4() +void init_event_triggers() { - unsigned __int16 v0; // ax@1 - size_t v1; // ecx@1 - int v2; // esi@1 - int result; // eax@1 - LevelDecoration *v4; // edx@2 - int v5; // edi@4 - - _6836C8_num_decorations_6807E8 = 0; - v0 = pDecorationList->GetDecorIdByName("Event Trigger"); - v1 = uNumLevelDecorations; - v2 = (signed __int16)v0; - result = 0; - if ( (signed int)uNumLevelDecorations > 0 ) - { - v4 = pLevelDecorations.data(); - do - { - if ( v4->uDecorationDescID == v2 ) - { - v5 = _6836C8_num_decorations_6807E8++; - _6807E8_level_decorations_ids[v5] = result; - } - ++result; - ++v4; - } - while ( result < (signed int)v1 ); - } - return result; + uint id = pDecorationList->GetDecorIdByName("Event Trigger"); + + num_event_triggers = 0; + for (uint i = 0; i < uNumLevelDecorations; ++i) + if (pLevelDecorations[i].uDecorationDescID == id) + event_triggers[num_event_triggers++] = i; } -// 6836C8: using guessed type int 6836C8_num_decorations_6807E8; //----- (004621DA) -------------------------------------------------------- int int_get_vector_length(signed int x, signed int y, signed int z) @@ -3267,7 +3244,7 @@ OPENFILENAMEA ofn; //----- (0046271C) -------------------------------------------------------- -void __cdecl crt_init_globals_46271C() +void CreateDefaultBLVLevel() { ofn.lStructSize = 0x4Cu; ofn.hwndOwner = hWnd; @@ -3378,7 +3355,7 @@ } else { - if ( !ptr_507BDC )// ??? + if ( !pModalWindow )// ??? { pButton = pWindow->pControlsHead; for ( pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext ) @@ -3448,6 +3425,7 @@ switch (Msg) { + case WM_SIZING: return 1; case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam); case WM_CHAR: { @@ -3456,6 +3434,14 @@ } return DefWindowProcA(hWnd, Msg, wParam, lParam); + + case WM_DEVICECHANGE: + { + if (wParam == 0x8000) // CD or some device has been inserted - notify InsertCD dialog + PostMessageA(hInsertCDWindow, WM_USER + 1, 0, 0); + return 0; + } + case WM_COMMAND: { switch (wParam) @@ -3640,12 +3626,6 @@ { switch ( Msg ) { - case WM_DEVICECHANGE: - if ( wParam == 0x8000 ) - PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0); - return 0; - case WM_SIZING: - return 1; case WM_LBUTTONDOWN: if ( pArcomageGame->bGameInProgress ) { @@ -3763,7 +3743,6 @@ if ( !pGame ) //goto _def_wnd_proc; return DefWindowProcA(hWnd, Msg, wParam, lParam); - sub_417871(0); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_MOUSEMOVE: if ( pArcomageGame->bGameInProgress ) @@ -3846,14 +3825,14 @@ } if ( wParam >= VK_LEFT && wParam <= VK_DOWN ) { - if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) + if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW ) { if ( !viewparams->field_4C ) UI_OnKeyDown(wParam); return 0; } } - if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) + if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW ) return 0; } @@ -4023,7 +4002,7 @@ } //----- (00464479) -------------------------------------------------------- -void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() +void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() { int v0; // esi@9 @@ -4056,11 +4035,8 @@ } //----- (004646F0) -------------------------------------------------------- -void PrepareWorld(unsigned int this_) +void PrepareWorld(unsigned int _0_box_loading_1_fullscreen) { - unsigned int v1; // ebx@1 - - v1 = this_; if ( pRenderer->pRenderD3D ) pGame->pVisInstance->_4C1A02(); pEventTimer->Pause(); @@ -4068,13 +4044,13 @@ pParty->uFlags = 2; pCastSpellInfo.data()->_427D48(1); ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); - DoPrepareWorld(0, (v1 == 0) + 1); + DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1); pMiscTimer->Resume(); pEventTimer->Resume(); } //----- (00464761) -------------------------------------------------------- -void __thiscall Game_DeinitializeAndTerminate(int exitCode) +void Game_DeinitializeAndTerminate(int exitCode) { int v1; // esi@1 HANDLE v2; // eax@1 @@ -4109,22 +4085,22 @@ // 6BE3A0: using guessed type float flt_6BE3A0; //----- (00464839) -------------------------------------------------------- -char __cdecl Is_out15odm_underwater() +char Is_out15odm_underwater() { return _stricmp(pCurrentMapName.data(), "out15.odm") == 0; } //----- (00464851) -------------------------------------------------------- -void __cdecl SetUnderwaterFog() +void SetUnderwaterFog() { day_fogrange_1 = 50; day_fogrange_2 = 5000; } //----- (00464866) -------------------------------------------------------- -void __fastcall DoPrepareWorld(unsigned int bLoading, int a2) +void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) { - int v2; // esi@1 + //int v2; // esi@1 char *v3; // eax@1 //char *v4; // eax@1 unsigned int v5; // eax@3 @@ -4133,11 +4109,11 @@ char Str1[20]; // [sp+Ch] [bp-18h]@1 unsigned int v9; // [sp+20h] [bp-4h]@1 - v2 = a2; v9 = bLoading; ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); pDecalBuilder->Reset(0); - pGameLoadingUI_ProgressBar->Initialize((GUIProgressBar::Type)v2); + pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen : + GUIProgressBar::TYPE_Box); strcpy(Str1, pCurrentMapName.data()); v3 = strtok(Str1, "."); strcpy(Str1, v3); @@ -4166,7 +4142,7 @@ else PrepareToLoadBLV(v9); pAudioPlayer->SetMapEAX(); - sub_461103(); + _461103_load_level_sub(); if ( !_stricmp(pCurrentMapName.data(), "d11.blv") || !_stricmp(pCurrentMapName.data(), "d10.blv") ) { //spawning grounds & good analogue - no loot & exp from monsters @@ -4181,7 +4157,7 @@ bDialogueUI_InitializeActor_NPC_ID = 0; OnMapLoad(); pGameLoadingUI_ProgressBar->Progress(); -memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); + memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); pGameLoadingUI_ProgressBar->Release(); _flushall(); } @@ -5087,7 +5063,7 @@ } //----- (00465D0B) -------------------------------------------------------- -void __cdecl SecondaryInitialization() +void SecondaryInitialization() { __int16 v4; // ax@4 signed int v5; // esi@5 @@ -5456,13 +5432,16 @@ } else { - if (GetCurrentMenuID() == MENU_10) + if (GetCurrentMenuID() == MENU_DebugBLVLevel) { pMouse->Activate(0); pParty->Reset(); pParty->CreateDefaultParty(1); - crt_init_globals_46271C(); + + extern void CreateDefaultBLVLevel(); + CreateDefaultBLVLevel(); + extern OPENFILENAMEA ofn; if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) { @@ -5509,7 +5488,7 @@ } //----- (004637E0) -------------------------------------------------------- -char __cdecl sub_4637E0_is_there_popup_onscreen() +char sub_4637E0_is_there_popup_onscreen() { return dword_507BF0_is_there_popup_onscreen == 1; } @@ -5659,7 +5638,7 @@ } //----- (004666D5) -------------------------------------------------------- -void __cdecl MM7Initialization() +void MM7Initialization() { if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) { @@ -5705,7 +5684,7 @@ } //----- (00466B8C) -------------------------------------------------------- -int __cdecl AbortWithError() +int AbortWithError() { if ( !aborting_app ) { @@ -5754,7 +5733,7 @@ case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC"; case MENU_CREDITSPROC: return L"MENU_CREDITSPROC"; case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu"; - case MENU_10: return L"MENU_10"; + case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel"; case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE"; default: return L"unk"; }; @@ -5772,12 +5751,9 @@ return uCurrentMenuID; } -// 720980: using guessed type int uTextureID_720980; - -// 4E28F8: using guessed type int pCurrentScreen; //----- (0046A6AC) -------------------------------------------------------- -int __fastcall sub_46A6AC(int a1, int a2, int a3) +int __fastcall _46A6AC_spell_render(int a1, int a2, int a3) { int result; // eax@2 unsigned int v4; // edx@3 @@ -5798,10 +5774,11 @@ v14 = a1; if ( pRenderer->pRenderD3D ) { - result = sub_46A7C8(a1, a2, a3); + result = _46A6AC_spell_render_d3d(a1, a2, a3); } else { + __debugbreak(); // SW render never called v16 = 0; v4 = viewparams->uScreen_topL_X; v12 = viewparams->uScreen_BttmR_X; @@ -5860,7 +5837,7 @@ } //----- (0046A7C8) -------------------------------------------------------- -int __fastcall sub_46A7C8(int a1, int a2, signed int a3) +int __fastcall _46A6AC_spell_render_d3d(int a1, int a2, int a3) { unsigned int v3; // eax@2 int v4; // ecx@2 @@ -5929,7 +5906,7 @@ } //----- (0046A89E) -------------------------------------------------------- -int __fastcall sub_46A89E(int a1, int a2, signed int a3) +int __fastcall _46A89E_immolation_effect(int a1, int a2, int a3) { signed int v3; // edi@1 Actor *v4; // esi@2 @@ -6013,7 +5990,7 @@ } //----- (0046A99B) -------------------------------------------------------- -int __cdecl sub_46A99B() +int sub_46A99B() { int v0; // ebx@1 signed int v1; // ecx@1 @@ -6219,7 +6196,7 @@ } //----- (0046BDA8) -------------------------------------------------------- -unsigned int __cdecl GetGravityStrength() +unsigned int GetGravityStrength() { int v0; // eax@1 @@ -6229,7 +6206,7 @@ } //----- (0046BDC0) -------------------------------------------------------- -void __cdecl UpdateUserInput_and_MapSpecificStuff() +void UpdateUserInput_and_MapSpecificStuff() { if ( dword_6BE364_game_settings_1 & 0x80 ) {
--- a/mm7_3.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_3.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -52,7 +52,7 @@ #include "MM7.h" //----- (0046E44E) -------------------------------------------------------- -int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1) +int _46E44E_collide_against_faces_and_portals(unsigned int b1) { BLVSector *pSector; // edi@1 signed int v2; // ebx@1 @@ -600,7 +600,7 @@ } //----- (0046EF01) -------------------------------------------------------- -int __thiscall _46EF01_collision_chech_player(int a1) +int _46EF01_collision_chech_player(int a1) { int v1; // edx@1 int result; // eax@1 @@ -673,7 +673,7 @@ } //----- (0046F04E) -------------------------------------------------------- -signed int __cdecl _46F04E_collide_against_portals() +int _46F04E_collide_against_portals() { BLVSector *v0; // ecx@1 unsigned int v1; // eax@1 @@ -864,7 +864,7 @@ } //----- (004706C6) -------------------------------------------------------- -void __cdecl UpdateActors_ODM() +void UpdateActors_ODM() { Actor *v0; // esi@2 AIState uAIState; // ax@2 @@ -3348,7 +3348,7 @@ } //----- (00475665) -------------------------------------------------------- -signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3) +int sub_475665(BLVFace *_this, int a2, __int16 a3) { unsigned int v3; // eax@1 Vec3_short_ *v4; // edx@3 @@ -4334,23 +4334,6 @@ return v16; } -//----- (004783FA) -------------------------------------------------------- -void __cdecl sub_4783FA_construct_global_73D150() -{ - char *v0; // eax@1 - signed int v1; // ecx@1 - - v0 = (char *)&array_73D150[0].flt_2C; - v1 = 20; - do - { - *(float *)v0 = 0.0; - v0 += 48; - --v1; - } - while ( v1 ); -} - //----- (0047840D) -------------------------------------------------------- char Render::DrawBuildingsD3D() { @@ -5816,7 +5799,7 @@ } //----- (0047C4FC) -------------------------------------------------------- -signed int __fastcall GetActorTintColor(int max_dimm, int min_dimm, float distance, int a4, RenderBillboard *a5) +int __fastcall GetActorTintColor(int max_dimm, int min_dimm, float distance, int a4, RenderBillboard *a5) { //int v5; // esi@1 signed int v6; // edx@1 @@ -5970,13 +5953,13 @@ } //----- (0047F469) -------------------------------------------------------- -int __stdcall GridCellToWorldPosX(int a1) +int GridCellToWorldPosX(int a1) { return (a1 - 64) << 9; } //----- (0047F476) -------------------------------------------------------- -int __stdcall GridCellToWorldPosZ(int a1) +int GridCellToWorldPosZ(int a1) { return (64 - a1) << 9; } @@ -6010,7 +5993,7 @@ } //----- (00481ED9) -------------------------------------------------------- -void __cdecl sub_481ED9_MessWithOutdoorCamera() +void sub_481ED9_MessWithOutdoorCamera() { stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0); pOutdoorCamera->uNumPolygons = 0; @@ -6189,18 +6172,12 @@ return y_x1z1; } -//----- (00482A90) -------------------------------------------------------- -signed int __cdecl const_1_0() -{ - return 1; -} - //----- (00485F53) -------------------------------------------------------- -void __thiscall sr_485F53(Vec2_int_ *v) +void sr_485F53(Vec2_int_ *v) { ++v->y; if ( v->y > 1000 ) @@ -6726,7 +6703,7 @@ } //----- (00443F95) -------------------------------------------------------- -void __cdecl OnMapLeave() +void OnMapLeave() { _evt_raw *test_event; if ( uLevelEVT_NumEvents > 0 ) @@ -6917,7 +6894,7 @@ } //----- (00444564) -------------------------------------------------------- -const char *__cdecl sub_444564() +const char * sub_444564() { double v0; // st7@3 int v1; // ebx@3 @@ -7047,7 +7024,7 @@ } //----- (004452BB) -------------------------------------------------------- -void __cdecl sub_4452BB() +void sub_4452BB() { pGUIWindow2->Release(); pGUIWindow2 = 0; @@ -7436,7 +7413,7 @@ } //----- (00448B45) -------------------------------------------------------- -void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide) +void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide) { if ( bForceHide || GameUI_Footer_TimeLeft && GetTickCount() >= GameUI_Footer_TimeLeft ) GameUI_Footer_TimeLeft = 0; @@ -7797,32 +7774,29 @@ } //----- (0044C28B) -------------------------------------------------------- -signed int __cdecl const_2() +int const_2() { return 2; } //----- (0044C28F) -------------------------------------------------------- -bool __cdecl sub_44C28F_open_nwc_dungeon() +bool TeleportToNWCDungeon() { - bool result; // eax@1 - - result = _stricmp("nwc.blv", pCurrentMapName.data()); - if ( result ) - { - _5B65A8_npcdata_uflags_or_other = 0; - _5B65AC_npcdata_fame_or_other = 0; - _5B65B0_npcdata_rep_or_other = 0; - _5B65B4_npcdata_loword_house_or_other = 0; - _5B65B8_npcdata_hiword_house_or_other = 0; - dword_5B65BC = 0; - dword_5B65C0 = 0; - pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; - sub_44987B("nwc.blv", MapStartPoint_Party); - pCurrentScreen = SCREEN_GAME; - result = 1; - } - return result; + if (!_stricmp("nwc.blv", pCurrentMapName.data())) + return false; + + _5B65A8_npcdata_uflags_or_other = 0; + _5B65AC_npcdata_fame_or_other = 0; + _5B65B0_npcdata_rep_or_other = 0; + _5B65B4_npcdata_loword_house_or_other = 0; + _5B65B8_npcdata_hiword_house_or_other = 0; + dword_5B65BC = 0; + dword_5B65C0 = 0; + + pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; + sub_44987B("nwc.blv", MapStartPoint_Party); + pCurrentScreen = SCREEN_GAME; + return true; } //----- (0044C2F4) -------------------------------------------------------- @@ -7890,7 +7864,7 @@ } //----- (00401000) -------------------------------------------------------- -void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) +void mm7__vector_constructor(void *a1, int objSize, int numObjs, int ( *constructor)(int)) { void *v4; // esi@2 int v5; // edi@2 @@ -7909,10 +7883,6 @@ } } -// 4F75D8: using guessed type int ai_arrays_size; - -// 4F75D8: using guessed type int ai_arrays_size; - //----- (0040261D) -------------------------------------------------------- int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8) {
--- a/mm7_4.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_4.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -47,7 +47,7 @@ #include "Lights.h" //----- (0046CC4B) -------------------------------------------------------- -void __cdecl check_event_triggers() +void check_event_triggers() { int v0; // eax@1 LevelDecoration *v1; // esi@2 @@ -90,9 +90,9 @@ signed int v38; // [sp+20h] [bp-4h]@24 v0 = 0; - for ( i = 0; i < _6836C8_num_decorations_6807E8; ++i ) + for ( i = 0; i < num_event_triggers; ++i ) { - v1 = &pLevelDecorations[_6807E8_level_decorations_ids[v0]]; + v1 = &pLevelDecorations[event_triggers[v0]]; v2 = v1->field_18; v3 = v1->vPosition.y; v33 = v1->vPosition.x; @@ -440,7 +440,7 @@ } //----- (0046E0B2) -------------------------------------------------------- -void __cdecl _46E0B2_collide_against_decorations() +void _46E0B2_collide_against_decorations() { BLVSector *v0; // ebp@1 LevelDecoration *v1; // edi@2 @@ -532,7 +532,7 @@ } //----- (00487DA9) -------------------------------------------------------- -void __cdecl sub_487DA9() +void sub_487DA9() { for (int i = 0; i < 20000; ++i) array_77EC08[i].field_108 = 0; @@ -597,7 +597,7 @@ } //----- (00491E3A) -------------------------------------------------------- -void __cdecl sub_491E3A() +void sub_491E3A() { Player *v0; // ebx@1 signed int v1; // esi@3 @@ -698,7 +698,7 @@ // 4ED498: using guessed type char byte_4ED498; //----- (00493938) -------------------------------------------------------- -int __cdecl _493938_regenerate() +int _493938_regenerate() { int v0; // edi@1 signed __int64 v1; // qax@1 @@ -842,7 +842,7 @@ a1.spell_caster_pid = v12; a1.uFacing = 0; a1.uSoundID = 0; - v13 = sub_46A89E((int)v41, 100, 307); + v13 = _46A89E_immolation_effect((int)v41, 100, 307); if ( v13 > 0 ) { do @@ -1070,7 +1070,7 @@ } //----- (00493F79) -------------------------------------------------------- -void sub_493F79(stru351_summoned_item *_this, __int64 a2) +void init_summoned_item(stru351_summoned_item *_this, __int64 duration) { signed __int64 v2; // ST2C_8@1 signed __int64 v3; // qax@1 @@ -1078,7 +1078,7 @@ unsigned __int64 v5; // qax@1 unsigned int v6; // ebx@1 - v2 = (signed __int64)((double)a2 * 0.234375); + v2 = (signed __int64)((double)duration * 0.234375); v3 = v2 / 60 / 60; //v4 = v3; v5 = (unsigned int)v3 / 0x18; @@ -1885,8 +1885,7 @@ dword_AE3370 = v3; return pNPCStats->pNPCNames[0][v11 + 2 * v3]; } -// AE336C: using guessed type int dword_AE336C; -// AE3370: using guessed type int dword_AE3370; + //----- (00495430) -------------------------------------------------------- char * GetReputationString( signed int a1 ) @@ -2241,7 +2240,7 @@ i += 2; break; } - sub_493F79(&v56, *a6); + init_summoned_item(&v56, *a6); sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); strcat(pTmpBuf2.data(), a1); dst = strlen(pTmpBuf2.data()); @@ -2272,7 +2271,7 @@ i += 2; break; } - sub_493F79(&v56, pParty->field_3C._s_times[v17-51]); + init_summoned_item(&v56, pParty->field_3C._s_times[v17-51]); sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); strcat(pTmpBuf2.data(), a1); dst = strlen(pTmpBuf2.data()); @@ -2615,7 +2614,7 @@ } //----- (004A57E9) -------------------------------------------------------- -void __cdecl Present_ColorKey() +void Present_ColorKey() { HRESULT v0; // eax@3 HRESULT v1; // eax@3 @@ -2939,7 +2938,7 @@ } //----- (004B1523) -------------------------------------------------------- -void __thiscall sub_4B1523(int *_this) +void sub_4B1523(int *_this) { int v1; // esi@1 int v2; // edx@1 @@ -3009,7 +3008,7 @@ } //----- (004B1ECE) -------------------------------------------------------- -void __cdecl sub_4B1ECE() +void OracleDialogue() { __int16 *v0; // edi@1 int v1; // ebx@3 @@ -3103,13 +3102,9 @@ v9->uHolderPlayer = v5; } } -// 4F08EC: using guessed type int dword_4F08EC[]; -// 722B3C: using guessed type int dword_722B3C; -// 722B44: using guessed type int dword_722B44; -// F8B1A8: using guessed type int dword_F8B1A8; //----- (004B254D) -------------------------------------------------------- -char *__thiscall _4B254D_SkillMasteryTeacher(int _this) +char * _4B254D_SkillMasteryTeacher(int _this) { //Player *v1; // esi@1 int v2; // edx@1 @@ -3485,7 +3480,7 @@ } //----- (004B3E1E) -------------------------------------------------------- -void __cdecl sub_4B3E1E() +void sub_4B3E1E() { NPCData *v0; // ST40_4@1 signed int v1; // edi@1 @@ -3506,7 +3501,6 @@ pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); } -// F8B19C: using guessed type int dword_F8B19C; //----- (004B3FE5) -------------------------------------------------------- void __fastcall sub_4B3FE5(int a4) @@ -3544,13 +3538,13 @@ } //----- (004B46F8) -------------------------------------------------------- -int __fastcall sub_4B46F8(int a1) +__int64 GetExperienceRequiredForLevel(int level) { - int v1; // eax@1 + __int64 v1; // eax@1 int i; // edx@1 v1 = 0; - for ( i = 0; i < a1; ++i ) + for ( i = 0; i < level; ++i ) v1 += i + 1; return 1000 * v1; } @@ -3756,12 +3750,13 @@ switch ( npc_event_id ) { case 139: - sub_4B1ECE(); + OracleDialogue(); break; case 311: sub_4BBA85_bounties(); break; case 399: + __debugbreak(); // what kind of dialogue is that? sub_4BBCDD(); break; default:
--- a/mm7_5.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_5.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -51,7 +51,7 @@ #include "Lights.h" //----- (004304E7) -------------------------------------------------------- -void __cdecl GameUI_MsgProc() +void GameUI_MsgProc() { //signed int v0; // edi@6 //char *v1; // esi@6 @@ -890,7 +890,7 @@ MM7Initialization(); continue; } - ModalWindow(pNPCTopics[453].pText, 0); + ModalWindow(pNPCTopics[453].pText, UIMSG_0); continue; case UIMSG_GameMenu_ReturnToGame: pGUIWindow_CurrentMenu->Release(); @@ -983,7 +983,7 @@ } break; } - if ( !ptr_507BDC ) + if ( !pModalWindow ) { pRenderer->ClearZBuffer(0, 479); viewparams->bRedrawGameUI = 1; @@ -1392,7 +1392,7 @@ continue; case SCREEN_CHARACTERS: CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); pIcons_LOD->RemoveTexturesPackFromTextureList(); if ( pGUIWindow_Settings ) { @@ -1479,7 +1479,7 @@ continue; } CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); pIcons_LOD->RemoveTexturesPackFromTextureList(); } if ( pGUIWindow_Settings ) @@ -1565,7 +1565,7 @@ back_to_game(); continue; } - sub_41426F(); + ModalWindow_Release(); continue; case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel if ( uMessageParam ) @@ -1751,7 +1751,7 @@ TeleportToStartingPoint(uLevel_StartingPointType); pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); pParty->uFallStartY = pParty->vPosition.z; - sub_461103(); + _461103_load_level_sub(); pEventTimer->Resume(); viewparams->bRedrawGameUI = 1; pCurrentScreen = SCREEN_GAME; @@ -2249,13 +2249,14 @@ sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." - ModalWindow(pFinalMessage.data(), 196); + ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose); uGameState = GAME_STATE_FINAL_WINDOW; continue; - case UIMSG_C4: + case UIMSG_OnFinalWindowClose: __debugbreak(); uGameState = GAME_STATE_PLAYING; strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); + __debugbreak(); // missed break/continue? case UIMSG_DD: __debugbreak(); sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); @@ -2479,7 +2480,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; if ( pCurrentScreen ) continue; - if ( sub_42F4DA() ) + if ( _42F4DA_check_actor_proximity() ) { if ( pParty->bTurnBasedModeOn == 1 ) { @@ -2885,13 +2886,13 @@ case UIMSG_ClickStatsBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); continue; case UIMSG_ClickSkillsBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_SkillsTab_CreateButtons(); GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); continue; @@ -2920,7 +2921,7 @@ continue; case UIMSG_ClickInventoryBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_ReleaseButtons(); GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); continue; @@ -2928,7 +2929,7 @@ GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); continue; case UIMSG_ClickAwardsBtn: - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_ReleaseButtons(); CreateAwardsScrollBar(); pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; @@ -3238,7 +3239,7 @@ } //----- (004356FF) -------------------------------------------------------- -void __cdecl back_to_game() +void back_to_game() { dword_507BF0_is_there_popup_onscreen = 0; dword_4E455C = 1; @@ -3251,7 +3252,7 @@ } //----- (00435748) -------------------------------------------------------- -void __cdecl GUI_MainMenuMessageProc() +void GUI_MainMenuMessageProc() { Player *pPlayer; // ebx@2 void *v3; // edi@21 @@ -3387,7 +3388,7 @@ break; case UIMSG_PlayerCreationClickOK: GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); - if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Chose4Skills() ) + if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() ) GameUI_Footer_TimeLeft = GetTickCount() + 4000; else uGameState = GAME_STATE_STARTING_NEW_GAME; @@ -3420,7 +3421,7 @@ pMouse->SetCursorBitmap("MICON2"); break; case UIMSG_3A: - SetCurrentMenuID(MENU_10); + SetCurrentMenuID(MENU_DebugBLVLevel); break; case UIMSG_LoadGame: if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) @@ -3479,12 +3480,12 @@ break; case UIMSG_AE: GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); - SetCurrentMenuID(MENU_10); + SetCurrentMenuID(MENU_DebugBLVLevel); break; case UIMSG_Escape: - if ( ptr_507BDC ) + if ( pModalWindow ) { - sub_41426F(); + ModalWindow_Release(); break; } if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) @@ -3579,7 +3580,7 @@ } //----- (00436427) -------------------------------------------------------- -double __cdecl get_shading_dist_mist() +double get_shading_dist_mist() { if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) return (double)pOutdoorCamera->shading_dist_mist; @@ -4626,6 +4627,8 @@ signed int a3a; // [sp+24h] [bp+8h]@14 int a4a; // [sp+28h] [bp+Ch]@2 + __debugbreak(); + v4 = a4; v5 = a4->uAttributes; if ( v5 & 0x100 ) @@ -4759,6 +4762,8 @@ int a4a; // [sp+28h] [bp+Ch]@2 signed int a5a; // [sp+2Ch] [bp+10h]@14 + __debugbreak(); + v5 = a4; v6 = a4->uAttributes; v7 = 0; @@ -4867,23 +4872,17 @@ } //----- (004088E9) -------------------------------------------------------- -signed int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6) +int __fastcall sub_4088E9(int x1, int y1, int x2, int y2, int x3, int y3) { - int v6; // esi@1 - int v7; // edi@1 int v8; // eax@1 signed int result; // eax@1 - int v10; // [sp+Ch] [bp-4h]@1 int v11; // [sp+18h] [bp+8h]@1 - v6 = a1; - v10 = a2; - v7 = a3 - a1; - v11 = abs(a3 - a1); - v8 = abs(a4 - v10); + v11 = abs(x2 - x1); + v8 = abs(y2 - y1); result = integer_sqrt(v11 * v11 + v8 * v8); if ( result ) - result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result); + result = abs(((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / result); return result; } @@ -4895,13 +4894,6 @@ LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8)); } -//----- (0040DFA7) -------------------------------------------------------- -int __stdcall retzero_sub_40DFA7(int a1) -{ - return 0; -} -// 40DFA7: using guessed type int __stdcall retzero_sub_40DFA7(int); - //----- (0040F82D) -------------------------------------------------------- @@ -4964,7 +4956,7 @@ } //----- (0040F92A) -------------------------------------------------------- -void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3) +void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3) { Texture *v3; // esi@1 void *v4; // eax@3 @@ -5005,7 +4997,7 @@ } //----- (00410D99) -------------------------------------------------------- -signed int __fastcall sub_410D99_get_map_index(int a1) +int __fastcall sub_410D99_get_map_index(int a1) { int v1; // edi@1 signed int v2; // ebp@1
--- a/mm7_6.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_6.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -44,7 +44,7 @@ //----- (00424EE0) -------------------------------------------------------- -signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) +int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) { unsigned int v1; // edx@1 double v2; // st7@1 @@ -209,78 +209,6 @@ return result; } -//----- (0042620A) -------------------------------------------------------- -bool sr_42620A(RenderVertexSoft *p) -{ - __int16 v1; // fps@1 - unsigned __int8 v2; // c0@2 - char v3; // c2@2 - unsigned __int8 v4; // c3@2 - bool result; // eax@2 - unsigned __int8 v6; // c0@4 - char v7; // c2@4 - unsigned __int8 v8; // c3@4 - unsigned __int8 v9; // c0@6 - char v10; // c2@6 - unsigned __int8 v11; // c3@6 - double v12; // st6@7 - float v13; // ST04_4@7 - float v14; // ST00_4@7 - double v15; // st7@7 - double v16; // st6@8 - float v17; // ST04_4@8 - float v18; // ST00_4@8 - double v19; // st7@8 - - //UNDEF(v1); - if ( p->vWorldViewPosition.x < 300.0 - || (v2 = 300.0 < p[1].vWorldViewPosition.x, - v3 = 0, - v4 = 300.0 == p[1].vWorldViewPosition.x, - //BYTE1(result) = HIBYTE(v1), - !(v2 | v4)) ) - { - if ( p->vWorldViewPosition.x < 300.0 ) - { - v6 = 300.0 < p[1].vWorldViewPosition.x; - v7 = 0; - v8 = 300.0 == p[1].vWorldViewPosition.x; - //BYTE1(result) = HIBYTE(v1); - if ( !(v6 | v8) ) - { - //LOBYTE(result) = 0; - return false; - } - } - v9 = 300.0 < p->vWorldViewPosition.x; - v10 = 0; - v11 = 300.0 == p->vWorldViewPosition.x; - //BYTE1(result) = HIBYTE(v1); - if ( v9 | v11 ) - { - v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); - v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; - v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; - v19 = 300.0 - p[1].vWorldViewPosition.x; - p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; - p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; - p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; - } - else - { - v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); - v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; - v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; - v15 = 300.0 - p->vWorldViewPosition.x; - p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; - p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; - p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; - } - } - //LOBYTE(result) = 1; - return true; -} - //----- (004268E3) -------------------------------------------------------- int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) { @@ -313,16 +241,6 @@ LOWORD(v2) = (a1 >> 5) & 0x7E0; return ((unsigned __int8)a1 >> 3) | v2 | v1; } -//----- (00426947) -------------------------------------------------------- -void __cdecl sub_426947() -{ - stru_50C198.field_0 = 0; - dword_50C994 = 0; - dword_50C998_turnbased_icon_1A = 0; -} -// 50C968: using guessed type int dword_50C968; -// 50C994: using guessed type int dword_50C994; -// 50C998: using guessed type int dword_50C998_turnbased_icon_1A; //----- (00426A5A) -------------------------------------------------------- void stru319::LootActor(Actor *pActor) @@ -1137,12 +1055,6 @@ } } -//----- (0042EBBE) -------------------------------------------------------- -int __fastcall sub_42EBBE(int a1, int a2) -{ - return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; -} -// 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); //----- (0042EBDB) -------------------------------------------------------- int stru193_math::Sin(int angle) @@ -1549,7 +1461,7 @@ } //----- (0042F4DA) -------------------------------------------------------- -signed int __cdecl sub_42F4DA() +int _42F4DA_check_actor_proximity() { signed int v0; // edi@1 Actor *v1; // esi@4 @@ -1837,7 +1749,7 @@ } //----- (0042FB5C) -------------------------------------------------------- -bool __fastcall sub_42FB5C(signed int a1) +bool _42FB5C_check_spell(signed int a1) { int v1; // ecx@3 int v2; // ecx@4 @@ -1897,7 +1809,7 @@ } //----- (0042FBDD) -------------------------------------------------------- -void __cdecl sub_42FBDD() +void sub_42FBDD() { pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); @@ -1905,7 +1817,7 @@ } //----- (0042FC15) -------------------------------------------------------- -void __cdecl CloseWindowBackground() +void CloseWindowBackground() { pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); @@ -1913,7 +1825,7 @@ } //----- (0042FC4E) -------------------------------------------------------- -void __cdecl ProcessInputActions() +void ProcessInputActions() { char v4; // al@9 char v8; // bl@100
--- a/mm7_data.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_data.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -500,7 +500,11 @@ int dword_4E4A1C[777]; // weak int dword_4E4A40[777]; // weak int dword_4E4A44[777]; // weak -std::array<float, 10> flt_4E4A80; +std::array<float, 10> flt_4E4A80 = +{ + 0.050000001, 0.1, 0.30000001, 0.5, 0.60000002, + 1.0, 6.0, 25.0, 50.0, 100.0 +}; std::array< std::array<int, 2>, 14> pPartySpellbuffsUI_XYs = @@ -924,7 +928,6 @@ int uGameMenuUI_CurentlySelectedKeyIdx; // 506E68 std::array<unsigned int, 27> pPrevVirtualCidesMapping; int KeyboardPageNum; // weak -std::array<int, 777> dword_506F0C; // idb int uRestUI_FoodRequiredToRest; int dword_506F14; // weak int _506F18_num_minutes_to_sleep; // weak @@ -957,7 +960,7 @@ int dword_507B98_ctrl_pressed; // weak unsigned int uActiveCharacter; int dword_507BF0_is_there_popup_onscreen; // weak -int dword_507CBC; // weak +int awards_scroll_bar_created; // weak int dword_507CC0_activ_ch; // weak __int64 GameUI_RightPanel_BookFlashTimer; // weak int _507CD4_RestUI_hourglass_anim_controller; // weak @@ -995,8 +998,8 @@ unsigned int uIconID_TurnHour; int uIconID_CharacterFrame; // idb unsigned int uIconID_TurnStart; -int dword_50C994; // weak -int dword_50C998_turnbased_icon_1A; // weak +int dword_50C994 = 0; // weak +int dword_50C998_turnbased_icon_1A = 0; // weak int uSpriteID_Spell11; // idb _UNKNOWN unk_50C9A0; // weak int _50C9A8_item_enchantment_timer = 0; // weak @@ -1137,8 +1140,8 @@ std::array<int, 777> _6807B8_level_decorations_ids; // idb int _6807E0_num_decorations_with_sounds_6807B8; // weak -std::array<int, 777> _6807E8_level_decorations_ids; // idb -int _6836C8_num_decorations_6807E8; // weak +std::array<int, 3000> event_triggers; // 6807E8 +int num_event_triggers; // 6836C8 std::array<int, 64> dword_69B010; float flt_69B138_dist; // weak char byte_69BD41_unused; // weak @@ -1380,8 +1383,4 @@ int dword_F93F20; // weak int dword_F93F70; // weak -volatile bool initing; - -//int crt_F94004; // weak -//int crtdword_F9400C; // weak -FARPROC lpfn; // idb \ No newline at end of file +volatile bool initing; \ No newline at end of file
--- a/mm7_data.h Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7_data.h Wed Aug 21 20:59:16 2013 +0400 @@ -570,7 +570,6 @@ extern std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C extern std::array<unsigned int, 27> pPrevVirtualCidesMapping; extern int KeyboardPageNum; // weak -extern std::array<int, 777> dword_506F0C; // idb extern int uRestUI_FoodRequiredToRest; extern int dword_506F14; // weak extern int _506F18_num_minutes_to_sleep; // weak @@ -603,7 +602,7 @@ extern int dword_507B98_ctrl_pressed; // weak extern unsigned int uActiveCharacter; extern int dword_507BF0_is_there_popup_onscreen; // weak -extern int dword_507CBC; // weak +extern int awards_scroll_bar_created; // weak extern int dword_507CC0_activ_ch; // weak extern __int64 GameUI_RightPanel_BookFlashTimer; // weak extern int _507CD4_RestUI_hourglass_anim_controller; // weak @@ -784,8 +783,8 @@ extern std::array<int, 777> _6807B8_level_decorations_ids; // idb extern int _6807E0_num_decorations_with_sounds_6807B8; // weak -extern std::array<int, 777> _6807E8_level_decorations_ids; // idb -extern int _6836C8_num_decorations_6807E8; // weak +extern std::array<int, 3000> event_triggers; // 6807E8 +extern int num_event_triggers; // 6836C8 extern std::array<int, 64> dword_69B010; extern float flt_69B138_dist; // weak extern char byte_69BD41_unused; // weak @@ -1043,18 +1042,6 @@ extern volatile bool initing; //ADDED -//extern int crt_F94004; // weak -//extern int crtdword_F9400C; // weak -extern FARPROC lpfn; // idb -//extern int crt_F944EC; // weak -//extern int crtdword_F944F0; // weak -//extern void *crt_F944F4; // idb -//extern int crtdword_F944F8; // weak -//extern LPVOID crt_lpMem; // idb -//extern int crt_F94500; // weak -//extern HANDLE crt_hHeap; // idb -//extern int crt_F94508; // weak - @@ -1071,12 +1058,21 @@ //------------------------------------------------------------------------- // Function declarations -#define __thiscall __cdecl // Test compile in C mode + +void init_event_triggers(); +void check_event_triggers(); + + + -void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)); +void ShowIntroVideo_and_LoadingScreen(); +unsigned int GameOverMenu(void *ecx0); +int __fastcall SpawnRandomTreasure(struct MapInfo *a1, struct SpawnPointMM7 *a2); +void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity); + void MakeActorAIList_ODM(); -int __cdecl MakeActorAIList_BLV(); -void __cdecl UpdateActorAI(); +int MakeActorAIList_BLV(); +void UpdateActorAI(); bool __fastcall sub_4070EF_prolly_collide_objects(unsigned int uObjID, unsigned int uObj2ID); bool __fastcall sub_4075DB(int a1, int a2, int a3, struct BLVFace *a4); bool __fastcall sub_4077F1(int a1, int a2, int a3, struct ODMFace *a4, struct BSPVertexBuffer *a5); @@ -1084,42 +1080,27 @@ void InitializeActors(); void InitializeSpriteObjects(); int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6); -unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors); -unsigned int __fastcall SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID); -unsigned int __fastcall SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup); -unsigned int __fastcall SearchActorByID(unsigned int *pTotalActors, unsigned int a2); -void PrepareArcomage(); - +unsigned int SearchAliveActors(unsigned int *pTotalActors); +unsigned int SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID); +unsigned int SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup); +unsigned int SearchActorByID(unsigned int *pTotalActors, unsigned int a2); +void PrepareArcomage(); unsigned short TargetColor(unsigned __int16 r, unsigned __int16 g, unsigned __int16 b); // idb -void __cdecl CallRenderPresent(); -void __thiscall DoBlt_Copy(unsigned __int16 *pPixels); // idb -int __stdcall retzero_sub_40DFA7(int); // weak -int loc_40E4FC(); // weak +void CallRenderPresent(); +void DoBlt_Copy(unsigned __int16 *pPixels); // idb void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue); - void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue); -void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb -void __cdecl SetMoonPhaseNames(); -signed int __fastcall sub_410D99_get_map_index(int a1); +void __fastcall ZBuffer_DoFill2(int *pZBuffer, struct Texture *a2, int a3); // idb +void SetMoonPhaseNames(); +int __fastcall sub_410D99_get_map_index(int a1); void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer); void SetAttributeNames(); void uGameUIFontMain_initialize(); void uGameUIFontShadow_initialize(); -void sub_41420D_press_esc(); -void sub_41426F(); -void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight); // idb -void DrawCopyrightWindow(); -void LoadFonts_and_DrawCopyrightWindow(); -void GUI_UpdateWindows(); void identify_item(); -void __thiscall sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(struct Vec2_int_ *_this); +void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(struct Vec2_int_ *_this); void UI_OnMouseLeftClick(int *pXY); // idb -void __thiscall sub_417871(int *pXY); unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2); -signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx); // idb -void FillAwardsData(); -void CreateAwardsScrollBar(); -void sub_419379(); unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels); struct GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey); // idb int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall); @@ -1127,78 +1108,62 @@ bool UI_OnKeyDown(unsigned int vkKey); void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0); -void __cdecl nullsub_3(); // idb -void __cdecl LoadActualSkyFrame(); -void __cdecl Sleep6Hours(); -void __cdecl ChestUI_WritePointedObjectStatusString(); - +void LoadActualSkyFrame(); +void Sleep6Hours(); +void ChestUI_WritePointedObjectStatusString(); void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal); // idb void OnChestLeftClick(); -void __cdecl GameUI_WritePointedObjectStatusString(); -//struct GUIWindow *__thiscall GetCastSpellInInventoryWindow(void *a4); -bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem(); +void GameUI_WritePointedObjectStatusString(); +bool sub_421B2C_PlaceInInventory_or_DropPickedItem(); void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID); // idb void OnInventoryLeftClick(); void OnGameViewportClick(); bool PauseGameDrawing(); void SetUserInterface(enum PartyAlignment alignment, bool bReplace); -void __cdecl reset_some_strus_flt_2Cs(); +void reset_some_strus_flt_2Cs(); int __fastcall GetPortalScreenCoord(unsigned int uFaceID); -signed int __fastcall sr_424579(int uFaceID, struct stru320 *a2); bool PortalFrustrum(int pNumVertices, struct BspRenderer_PortalViewportData *a2, struct BspRenderer_PortalViewportData *near_portal, int uFaceID); int sr_424CD7(unsigned int uVertexID); // idb -signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID); // idb -signed int __fastcall sr_4250FE(unsigned int uVertexID); // idb -bool sr_42620A(struct RenderVertexSoft *p); +int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID); // idb int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor); // idb int __fastcall _42690D_colors_cvt(unsigned int a1); -void __cdecl sub_426947(); void __fastcall GivePartyExp(unsigned int pEXPNum); bool __fastcall sub_427769_spell(unsigned int uSpellID); void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6); -int __fastcall sub_42EBBE(int, int); // weak void _42ECB5_PlayerAttacksActor(); -void __thiscall InitializeTurnBasedAnimations(void *); -signed int __cdecl sub_42F4DA(); +void InitializeTurnBasedAnimations(void *); +int _42F4DA_check_actor_proximity(); bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9); void __fastcall sub_42F960_create_object(int x, int y, int z); // idb void CompactLayingItemsList(); -signed int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6); -bool __fastcall sub_42FB5C(signed int a1); -// int __cdecl crt_sub_42FBB7(); -// void __cdecl crt_construct_50CDB4(); -void __cdecl sub_42FBDD(); -void __cdecl CloseWindowBackground(); -void __cdecl ProcessInputActions(); -void __cdecl GameUI_MsgProc(); -void __cdecl back_to_game(); -void __cdecl GUI_MainMenuMessageProc(); -double __cdecl get_shading_dist_mist(); +int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6); +bool _42FB5C_check_spell(signed int a1); +void sub_42FBDD(); +void CloseWindowBackground(); +void ProcessInputActions(); +void GameUI_MsgProc(); +void back_to_game(); +void GUI_MainMenuMessageProc(); +double get_shading_dist_mist(); void Vec3_short__to_RenderVertexSoft(struct RenderVertexSoft *_this, struct Vec3_short_ *a2); -void __cdecl nullsub_4(); // idb -void __cdecl nullsub_5(); // idb -void __cdecl nullsub_6(); // idb -void __cdecl area_of_effect__damage_evaluate(); +void area_of_effect__damage_evaluate(); void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, struct Vec3_int_ *pPos, unsigned int a4); void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2); // idb double __fastcall sub_43AE12(signed int a1); int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4); void __fastcall sub_43B057(unsigned int uObjID, unsigned int uActorID, struct Vec3_int_ *pVelocity); void sub_43B1B0(signed int a1, unsigned int a2, struct Vec3_int_ *pVelocity, signed int a4); -int __stdcall DirectInputKeyboard_enumerator_43B9B9(int, int); // weak void Software_ResetNewEdges(); -// int __cdecl crt_deconstruct_43B9E3(); -int __stdcall DirectInputMouse_enumerator(int, int); // weak void CharacterUI_LoadPaperdollTextures(); int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder); bool _43ED6F_check_party_races(bool b); -bool __thiscall sub_43EDB9_get_some_race_sex_relation_2(unsigned int _this); +bool sub_43EDB9_get_some_race_sex_relation_2(unsigned int _this); bool __fastcall Player_has_item(unsigned int uItemID, struct Player *pPlayer, char a3); bool __fastcall sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(signed int a1); -void WetsuitOn(unsigned int uPlayerID); // idb -void WetsuitOff(unsigned int uPlayerID); +void WetsuitOn(unsigned int uPlayerID); // idb +void WetsuitOff(unsigned int uPlayerID); void __fastcall PrepareDrawLists_BLV(struct IndoorLocation_drawstru *_this); -void __cdecl FindBillboardsLightLevels_BLV(); +void FindBillboardsLightLevels_BLV(); int __fastcall _43F55F_get_billboard_light_level(struct RenderBillboard *a1, int uBaseLightLevel); int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z); void PrepareBspRenderList_BLV(); @@ -1212,199 +1177,110 @@ __int16 __fastcall sub_441A4E(int a1); void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074); // idb void Initialize2DA(); - -void LoadLevel_InitializeLevelStr(); - -void __cdecl OnMapLeave(); -void /*__usercall*/ OnMapLoad(); +void LoadLevel_InitializeLevelStr(); +void OnMapLeave(); +void OnMapLoad(); void Level_LoadEvtAndStr(const char *pLevelName); -const char *__cdecl sub_444564(); -char *__thiscall GetEventHintString(unsigned int uEventID); // idb +const char *sub_444564(); +char *GetEventHintString(unsigned int uEventID); // idb int GetTravelTime(); void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4); -void __cdecl sub_4452BB(); -const char *GetProfessionActionText(int a1); -struct NPCData *__fastcall GetNPCData(signed int npcid); -struct NPCData * GetNewNPCData(signed int npcid, int* npc_indx); -int __fastcall GetGreetType(signed int SpeakingNPC_ID); -void __cdecl DialogueEnding(); -void PrepareHouse(enum HOUSE_ID house); // idb -bool EnterHouse(enum HOUSE_ID uHouseID); -int sub_4465DF_check_season(int a1); -int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb -// void __cdecl crt_construct_5773C4(); -int NPC_EventProcessor(int npc_event_id, int entry_line = 0); - -void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3); -void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename); -void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName); // idb -void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on); -void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle); -void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb -void OnTimer(int); -void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName); -void __fastcall EventCastSpell(int spellnum, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz);//sub_448DF8 -__int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb -bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2); -void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb -void ShowStatusBarString(const char *pString, unsigned int uNumSeconds); -void __cdecl ShowNothingHereStatus(); -signed int __cdecl const_2(); -bool __cdecl sub_44C28F_open_nwc_dungeon(); -// int __cdecl crt_deconstruct_44C42C(); -void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5); -int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3); - -signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6); -int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2); -void RespawnGlobalDecorations(); -bool __fastcall SpawnActor(unsigned int uMonsterID); -int __cdecl GetAlertStatus(); -unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4); -int integer_sqrt(int val); -int __fastcall MakeColorMaskFromBitDepth(int a1); -void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels); -int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb -inline int round(float x) { return (int)floor(x + 0.5f); } -inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count) -{ - auto p = (unsigned __int32 *)ptr; - for ( int i=0; i < count; i++ ) - *p++ = value; -} -inline void __fastcall j_memset32(int a2, void *a1, unsigned int a3) {memset32(a1, a2, a3);} -// int __cdecl crt_452B74(); -int __cdecl j_SetSomeItemsNames(); - - int SkillToMastery(unsigned int skill_value); unsigned int __fastcall GetSpellColor(signed int a1); -void *__thiscall unknown_vdtor_6(void *_this, bool a2); unsigned short * MakeScreenshot(signed int width, signed int height); -void __thiscall SaveScreenshot(const char *pFilename); +void SaveScreenshot(const char *pFilename); void __fastcall LoadGame(unsigned int uSlot); // idb void SaveGame(bool IsAutoSAve, bool NotSaveWorld); void __fastcall DoSavegame(unsigned int uSlot); // idb -void __cdecl TryLoadLevelFromLOD(); -void __cdecl sub_46080D(); -bool __cdecl Initialize_GamesLOD_NewLOD(); +void TryLoadLevelFromLOD(); +void sub_46080D(); +bool Initialize_GamesLOD_NewLOD(); void SaveNewGame(); -void __thiscall PrepareToLoadBLV(unsigned int bLoading); +void PrepareToLoadBLV(unsigned int bLoading); void __fastcall PrepareToLoadODM(unsigned int bLoading, struct OutdoorCamera *a2); -void __cdecl sub_461103(); -int __cdecl sub_4613C4(); +void _461103_load_level_sub(); int int_get_vector_length(signed int x, signed int y, signed int z); -int __cdecl sub_46224A(); -int __cdecl crt_init_globals_462620(); -void __cdecl crt_init_globals_462659(); -void __cdecl crt_init_globals_46269B(); -void __cdecl crt_init_globals_46271C(); -void __cdecl MainMenu_Loop(); -char __cdecl sub_4637E0_is_there_popup_onscreen(); -void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); -void __thiscall PrepareWorld(unsigned int _this); -void __thiscall Game_DeinitializeAndTerminate(int exitCode); // idb -void __cdecl FinalInitialization(); -char __cdecl Is_out15odm_underwater(); -void __cdecl SetUnderwaterFog(); -void __fastcall DoPrepareWorld(unsigned int bLoading, int a2); +void MainMenu_Loop(); +char sub_4637E0_is_there_popup_onscreen(); +void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); +void PrepareWorld(unsigned int _0_box_loading_1_fullscreen); +void Game_DeinitializeAndTerminate(int exitCode); // idb +void FinalInitialization(); +char Is_out15odm_underwater(); +void SetUnderwaterFog(); +void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box); int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue); // idb void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString); void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue); void __fastcall WriteWindowsRegistryInt(const char *pKey, int val); bool __fastcall CheckMM7CD(char c); -int loc_465CC8(); // weak -void __cdecl SecondaryInitialization(); -void __cdecl CreateAsyncMouse(); -void __cdecl CreateAsyncKeyboard(); -void __cdecl MM6_Initialize(const wchar_t *pIniFilename); -void __cdecl MM7Initialization(); -int __cdecl AbortWithError(); +void SecondaryInitialization(); +void CreateAsyncMouse(); +void CreateAsyncKeyboard(); +void MM6_Initialize(const wchar_t *pIniFilename); +void MM7Initialization(); +int AbortWithError(); void Abortf(const char *Format, ...); void SetCurrentMenuID(enum MENU_STATE); // idb enum MENU_STATE GetCurrentMenuID(); -void *__thiscall output_debug_string(void *_this, std::string a2, const char *a3, int a4); -std::string *__fastcall _4678E2_make_error_string(std::string *a1, int line, std::string file); -void CreateMsgScrollWindow(signed int mscroll_id); -void __cdecl free_book_subwindow(); -void CreateScrollWindow(); -void __cdecl OnPaperdollLeftClick(); +void CreateMsgScrollWindow(signed int mscroll_id); +void free_book_subwindow(); +void CreateScrollWindow(); +void OnPaperdollLeftClick(); void OnPressSpace(); char __fastcall DoInteractionWithTopmostZObject(int a1, int a2); -int __fastcall sub_46A6AC(int a1, int a2, int a3); -int __fastcall sub_46A7C8(int a1, int a2, signed int a3); -int __fastcall sub_46A89E(int a1, int a2, signed int a3); -int __cdecl sub_46A99B(); -void *__thiscall unknown_libname_8(void *_this, char a2); -unsigned int __cdecl GetGravityStrength(); -void __cdecl UpdateUserInput_and_MapSpecificStuff(); -void __cdecl BLV_UpdateUserInputAndOther(); -void __cdecl ODM_UpdateUserInputAndOther(); -bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2); -void __cdecl check_event_triggers(); -int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID); -int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk); -int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4); -void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out); -unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID); -int __fastcall _46DF1A_collide_against_actor(int, int); // weak -void __cdecl _46E0B2_collide_against_decorations(); -void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2); -int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb -int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0); -int collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb -void __fastcall _46ED8A_collide_against_sprite_objects(unsigned int _this); -int __thiscall _46EF01_collision_chech_player(int a1); // idb -signed int __cdecl _46F04E_collide_against_portals(); -void BLV_UpdateDoors(); -void UpdateActors_BLV(); -void UpdateActors_ODM(); -void UpdateObjects(); -int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb -void BLV_ProcessPartyActions(); -void ODM_ProcessPartyActions(); -bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10); -bool __fastcall sub_4754BF(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10, int a11); -signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3); -bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4); -bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4); -bool __fastcall sub_475F30(int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9); - -int __cdecl GetPartyReputation(); -void __cdecl sub_4783FA_construct_global_73D150(); -void __cdecl loc_4789D4(); // idb -void __cdecl loc_47907F(); // idb +int GetPartyReputation(); +void OracleDialogue(); +void __fastcall ClickNPCTopic(signed int uMessageParam); +char * _4B254D_SkillMasteryTeacher(int _this); +const char *ContractSelectText(int pEventCode); +void SimpleHouseAndBoatsDialog(); +void CreateButtonInColumn(int a1, unsigned int a2); +void FillAviableSkillsToTeach(int _this); +void sub_4B3E1E(); +void DrawJoinGuildWindow(int pEventCode); +void __fastcall sub_4B3FE5(int a4); +void NPCHireableDialogPrepare(); +void _4B4224_UpdateNPCTopics(int _this); +void __fastcall DrawTextAtStatusBar(const char *Str, int a5); +__int64 GetExperienceRequiredForLevel(int a1); +const char *sub_4BBA85_bounties(); +void sub_4BBCDD(); +void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb +void ArenaFight(); +void SpellBookGenerator(); +void UI_CreateEndConversationButton(); +void __fastcall OnSelectShopDialogueOption(signed int uMessageParam); +int sub_4BD8B5(); +bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx); +void UIShop_Buy_Identify_Repair(); bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused); -void __thiscall ODM_LoadAndInitialize(const char *pLevelFilename, struct OutdoorCamera *thisa); +void ODM_LoadAndInitialize(const char *pLevelFilename, struct OutdoorCamera *thisa); unsigned int GetLevelFogColor(); int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3); -signed int __fastcall GetActorTintColor(int max_dim, int min_dim, float distance, int a4, struct RenderBillboard *a5); +int __fastcall GetActorTintColor(int max_dim, int min_dim, float distance, int a4, struct RenderBillboard *a5); unsigned int WorldPosToGridCellX(int); // weak unsigned int WorldPosToGridCellZ(int); // weak -int __stdcall GridCellToWorldPosX(int); // weak -int __stdcall GridCellToWorldPosZ(int); // weak -void __cdecl loc_48118F(); // idb -void __cdecl loc_481199(); // idb +int GridCellToWorldPosX(int); // weak +int GridCellToWorldPosZ(int); // weak void ResetPolygons(); -void __cdecl sub_481ED9_MessWithOutdoorCamera(); +void sub_481ED9_MessWithOutdoorCamera(); bool IsTerrainSlopeTooHigh(int pos_x, int pos_y); int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4); -signed int __cdecl const_1_0(); -void __cdecl sub_487DA9(); -double __thiscall GetFogDensityByTime(struct OutdoorLocation *_this); -int __stdcall loc_489BB3(struct stru320 *a2, int thisa, unsigned int uNumVertices, RenderVertexSoft *a5, float a6, char uClipFlag); // weak +void sub_487DA9(); +double GetFogDensityByTime(struct OutdoorLocation *_this); bool __fastcall HSV2RGB(float *a1, float *a2, float *a3, float a4, float a5, float a6); void __fastcall RGB2HSV(float *a1, float *a2, float a3, float a4, float a5, float *a6); unsigned int ReplaceHSV(unsigned int uColor, float a2, float gamma, float a4); -signed int __cdecl PlayerCreation_Chose4Skills(); -signed int __cdecl PlayerCreation_GetUnspentAttributePointCount(); +int PlayerCreation_Choose4Skills(); +int PlayerCreation_GetUnspentAttributePointCount(); void LoadPlayerPortraintsAndVoices(); int __fastcall ReloadPlayerPortraits(int, int); // weak void sub_491E3A(); -signed int __thiscall CycleCharacter(unsigned int _this); +int CycleCharacter(bool backwards); void __fastcall Rest(unsigned int uHoursToSleep); int _493938_regenerate(); -void sub_493F79(struct stru351_summoned_item *_this, __int64 a2); +void init_summoned_item(struct stru351_summoned_item *_this, __int64 duration); void _494035_timed_effects__water_walking_damage__etc(); unsigned int __fastcall _494820_training_time(unsigned int a1); char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2); @@ -1425,51 +1301,100 @@ unsigned int ModulateColor(unsigned int diffuse, float multiplier); // idb struct SoundHeader *FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName); struct SoundData *LoadSound(const char *pSoundName, struct SoundData *pOutBuff, unsigned int uID); -int __fastcall sub_4AAEA6_transform(RenderVertexSoft *a1); +int __fastcall sub_4AAEA6_transform(struct RenderVertexSoft *a1); int __fastcall sub_4AB66C(int, int); // weak int GetSoundStrengthByDistanceFromParty(int x, int y, int z); struct _DIG_DRIVER *Audio_GetFirstHardwareDigitalDriver(void); -void __cdecl PlayLevelMusic(); +void PlayLevelMusic(); unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb struct Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3); -void __thiscall sub_4B1523(int *_this); -void __cdecl ShowPopupShopItem(); -void __stdcall RestAndHeal(__int64 uNumMinutes); // idb -void __cdecl GetHouseGoodbyeSpeech(); - -void __cdecl sub_4B1ECE(); -void __fastcall ClickNPCTopic(signed int uMessageParam); -char *__thiscall _4B254D_SkillMasteryTeacher(int _this); -const char * ContractSelectText(int pEventCode); -void SimpleHouseAndBoatsDialog(); -void CreateButtonInColumn(int a1, unsigned int a2); -void FillAviableSkillsToTeach(int _this); -void __cdecl sub_4B3E1E(); -void DrawJoinGuildWindow(int pEventCode); -void __fastcall sub_4B3FE5(int a4); -void NPCHireableDialogPrepare(); -void _4B4224_UpdateNPCTopics(int _this); -void __fastcall DrawTextAtStatusBar(const char *Str, int a5); -int __fastcall sub_4B46F8(int a1); - -const char *sub_4BBA85_bounties(); -void __cdecl sub_4BBCDD(); -void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb -void __cdecl ArenaFight(); -void SpellBookGenerator(); -void UI_CreateEndConversationButton(); -void __fastcall OnSelectShopDialogueOption(signed int uMessageParam); -signed int __cdecl sub_4BD8B5(); -bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx); -void __cdecl UIShop_Buy_Identify_Repair(); - - -void __cdecl ShowIntroVideo_and_LoadingScreen(); -unsigned int __thiscall GameOverMenu(void *ecx0); -bool __thiscall BinkLockBuffer(struct _BINKBUF *_this); -void __thiscall BinkUnlockBuffer(struct _BINKBUF *_this); -signed int __fastcall SpawnRandomTreasure(struct MapInfo *a1, struct SpawnPointMM7 *a2); -void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity); +void sub_4B1523(int *_this); +void ShowPopupShopItem(); +void RestAndHeal(__int64 uNumMinutes); // idb +void GetHouseGoodbyeSpeech(); +int __fastcall _46A6AC_spell_render(int a1, int a2, int a3); +int __fastcall _46A6AC_spell_render_d3d(int a1, int a2, int a3); +int __fastcall _46A89E_immolation_effect(int a1, int a2, int a3); +int sub_46A99B(); +unsigned int GetGravityStrength(); +void UpdateUserInput_and_MapSpecificStuff(); +void BLV_UpdateUserInputAndOther(); +void ODM_UpdateUserInputAndOther(); +bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2); +int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID); +int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk); +int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4); +void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out); +unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID); +int __fastcall _46DF1A_collide_against_actor(int, int); // weak +void _46E0B2_collide_against_decorations(); +void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2); +int _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb +int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0); +int collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb +void __fastcall _46ED8A_collide_against_sprite_objects(unsigned int _this); +int _46EF01_collision_chech_player(int a1); // idb +int _46F04E_collide_against_portals(); +void BLV_UpdateDoors(); +void UpdateActors_BLV(); +void UpdateActors_ODM(); +void UpdateObjects(); +int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb +void BLV_ProcessPartyActions(); +void ODM_ProcessPartyActions(); +bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, struct BLVFace *a9, int a10); +bool __fastcall sub_4754BF(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, struct BLVFace *a9, int a10, int a11); +int sub_475665(struct BLVFace *_this, int a2, __int16 a3); +bool __fastcall sub_4759C9(struct BLVFace *a1, int a2, int a3, __int16 a4); +bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, struct BLVFace *a4); +bool __fastcall sub_475F30(int *a1, struct BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9); +void sub_4452BB(); +const char *GetProfessionActionText(int a1); +struct NPCData *__fastcall GetNPCData(signed int npcid); +struct NPCData * GetNewNPCData(signed int npcid, int* npc_indx); +int __fastcall GetGreetType(signed int SpeakingNPC_ID); +void DialogueEnding(); +void PrepareHouse(enum HOUSE_ID house); // idb +bool EnterHouse(enum HOUSE_ID uHouseID); +int sub_4465DF_check_season(int a1); +int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb +int NPC_EventProcessor(int npc_event_id, int entry_line = 0); +void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3); +void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename); +void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName); // idb +void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on); +void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle); +void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb +void OnTimer(int); +void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName); +void __fastcall EventCastSpell(int spellnum, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz);//sub_448DF8 +__int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb +bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2); +void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb +void ShowStatusBarString(const char *pString, unsigned int uNumSeconds); +void ShowNothingHereStatus(); +int const_2(); +bool TeleportToNWCDungeon(); +void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5); +int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3); +int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6); +int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2); +void RespawnGlobalDecorations(); +bool __fastcall SpawnActor(unsigned int uMonsterID); +int GetAlertStatus(); +unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4); +int integer_sqrt(int val); +int __fastcall MakeColorMaskFromBitDepth(int a1); +void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels); +int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb +inline int round(float x) { return (int)floor(x + 0.5f); } +inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count) +{ + auto p = (unsigned __int32 *)ptr; + for ( int i=0; i < count; i++ ) + *p++ = value; +} +inline void __fastcall j_memset32(int a2, void *a1, unsigned int a3) {memset32(a1, a2, a3);} #define ErrD3D(hr) do {extern void ErrHR(HRESULT, const char *, const char *, const char *, int); ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__);} while(0)
--- a/mm7text_ru.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/mm7text_ru.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -1161,7 +1161,7 @@ return nullptr; } -int __cdecl sprintfex_internal(char *str) +int sprintfex_internal(char *str) { auto p = strstr(str, "^"); if (!p)
--- a/stru10.h Wed Aug 21 20:58:36 2013 +0400 +++ b/stru10.h Wed Aug 21 20:59:16 2013 +0400 @@ -17,7 +17,7 @@ void _49CE9E(struct BLVFace *pFace, struct RenderVertexSoft *pVertices, unsigned int uNumVertices, RenderVertexSoft *pOutLimits); - void (__thiscall ***vdestructor_ptr)(stru10 *, bool); + void ( ***vdestructor_ptr)(stru10 *, bool); int bDoNotDrawPortalFrustum; }; #pragma pack(pop)
--- a/stru6.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/stru6.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -28,6 +28,80 @@ +//----- (0042620A) -------------------------------------------------------- +bool sr_42620A(RenderVertexSoft *p) +{ + __int16 v1; // fps@1 + unsigned __int8 v2; // c0@2 + char v3; // c2@2 + unsigned __int8 v4; // c3@2 + bool result; // eax@2 + unsigned __int8 v6; // c0@4 + char v7; // c2@4 + unsigned __int8 v8; // c3@4 + unsigned __int8 v9; // c0@6 + char v10; // c2@6 + unsigned __int8 v11; // c3@6 + double v12; // st6@7 + float v13; // ST04_4@7 + float v14; // ST00_4@7 + double v15; // st7@7 + double v16; // st6@8 + float v17; // ST04_4@8 + float v18; // ST00_4@8 + double v19; // st7@8 + + //UNDEF(v1); + if ( p->vWorldViewPosition.x < 300.0 + || (v2 = 300.0 < p[1].vWorldViewPosition.x, + v3 = 0, + v4 = 300.0 == p[1].vWorldViewPosition.x, + //BYTE1(result) = HIBYTE(v1), + !(v2 | v4)) ) + { + if ( p->vWorldViewPosition.x < 300.0 ) + { + v6 = 300.0 < p[1].vWorldViewPosition.x; + v7 = 0; + v8 = 300.0 == p[1].vWorldViewPosition.x; + //BYTE1(result) = HIBYTE(v1); + if ( !(v6 | v8) ) + { + //LOBYTE(result) = 0; + return false; + } + } + v9 = 300.0 < p->vWorldViewPosition.x; + v10 = 0; + v11 = 300.0 == p->vWorldViewPosition.x; + //BYTE1(result) = HIBYTE(v1); + if ( v9 | v11 ) + { + v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); + v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; + v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; + v19 = 300.0 - p[1].vWorldViewPosition.x; + p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; + p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; + p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; + } + else + { + v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); + v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; + v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; + v15 = 300.0 - p->vWorldViewPosition.x; + p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; + p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; + p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; + } + } + //LOBYTE(result) = 1; + return true; +} + + + //----- (004775C4) -------------------------------------------------------- stru6_stru1_indoor_sw_billboard::~stru6_stru1_indoor_sw_billboard() {
--- a/stru9.h Wed Aug 21 20:58:36 2013 +0400 +++ b/stru9.h Wed Aug 21 20:59:16 2013 +0400 @@ -58,6 +58,6 @@ bool AreVectorsCollinear(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct stru312 *a3); bool _4989E1(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4); - void (__thiscall ***vdestructor_ptr)(stru9 *, bool); + void ( ***vdestructor_ptr)(stru9 *, bool); }; #pragma pack(pop) \ No newline at end of file
--- a/texts.cpp Wed Aug 21 20:58:36 2013 +0400 +++ b/texts.cpp Wed Aug 21 20:59:16 2013 +0400 @@ -18,7 +18,7 @@ -int __cdecl sprintfex(char *buf, const char *format, ...) +int sprintfex(char *buf, const char *format, ...) { va_list args_ptr; va_start(args_ptr, format); @@ -27,12 +27,12 @@ } va_end(args_ptr); - extern int __cdecl sprintfex_internal(char *buf); + extern int sprintfex_internal(char *buf); return sprintfex_internal(buf); } //----- (00452B95) -------------------------------------------------------- -void __cdecl SetSomeItemsNames() +void SetSomeItemsNames() { pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568]; pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271]; @@ -442,7 +442,7 @@ aAttributeNames[6] = pGlobalTXT_LocalizationStrings[136]; } //----- (00410AF5) -------------------------------------------------------- -void __cdecl SetMoonPhaseNames() +void SetMoonPhaseNames() { aMoonPhaseNames[0] = pGlobalTXT_LocalizationStrings[150]; aMoonPhaseNames[1] = pGlobalTXT_LocalizationStrings[171];
--- a/texts.h Wed Aug 21 20:58:36 2013 +0400 +++ b/texts.h Wed Aug 21 20:59:16 2013 +0400 @@ -2,12 +2,12 @@ #include <array> -int __cdecl sprintfex(char *buf, const char *format, ...); +int sprintfex(char *buf, const char *format, ...); -void __cdecl SetSomeItemsNames(); +void SetSomeItemsNames(); char *RemoveQuotes(char *Str); -void __cdecl InitializeGameText(); +void InitializeGameText(); enum GLOBAL_LOCALIZ_INDEX