# HG changeset patch # User Nomad # Date 1377087996 -7200 # Node ID 934074e7fcc1c257d8daa839dc67814f1ba78691 # Parent 9dc33590f93e2b35d328f32ac2133eb796d237a0 ModalWindow __thiscall and __cdecl removed Some random renames & refactors diff -r 9dc33590f93e -r 934074e7fcc1 Actor.cpp --- a/Actor.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Actor.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 Arcomage.cpp --- a/Arcomage.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Arcomage.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 AudioPlayer.cpp --- a/AudioPlayer.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/AudioPlayer.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 AudioPlayer.h --- a/AudioPlayer.h Wed Aug 14 00:40:51 2013 +0400 +++ b/AudioPlayer.h Wed Aug 21 14:26:36 2013 +0200 @@ -171,7 +171,7 @@ void SetMapEAX(); int _4AC0A2(); void PlayMusicTrack(enum MusicID eTrack); - void __cdecl MessWithChannels(); + void MessWithChannels(); unsigned int bEAXSupported; diff -r 9dc33590f93e -r 934074e7fcc1 CShow.h --- a/CShow.h Wed Aug 14 00:40:51 2013 +0400 +++ b/CShow.h Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 Chest.cpp --- a/Chest.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Chest.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 DecalBuilder.h --- a/DecalBuilder.h Wed Aug 14 00:40:51 2013 +0400 +++ b/DecalBuilder.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 Events.cpp --- a/Events.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Events.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -91,7 +91,7 @@ } //----- (00443DA1) -------------------------------------------------------- -void __cdecl Initialize_GlobalEVT() +void Initialize_GlobalEVT() { struct raw_event_header { diff -r 9dc33590f93e -r 934074e7fcc1 GUIButton.cpp --- a/GUIButton.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/GUIButton.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 ) diff -r 9dc33590f93e -r 934074e7fcc1 GUIWindow.cpp --- a/GUIWindow.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/GUIWindow.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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() @@ -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 ) { diff -r 9dc33590f93e -r 934074e7fcc1 GUIWindow.h --- a/GUIWindow.h Wed Aug 14 00:40:51 2013 +0400 +++ b/GUIWindow.h Wed Aug 21 14:26:36 2013 +0200 @@ -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 ui_character_award_color; extern unsigned int ui_game_minimap_outline_color; extern unsigned int ui_game_minimap_actor_friendly_color; diff -r 9dc33590f93e -r 934074e7fcc1 Game.h --- a/Game.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Game.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 GammaControl.h --- a/GammaControl.h Wed Aug 14 00:40:51 2013 +0400 +++ b/GammaControl.h Wed Aug 21 14:26:36 2013 +0200 @@ -23,7 +23,7 @@ - void (__thiscall ***vdestructor_ptr)(GammaController *, bool); + void ( ***vdestructor_ptr)(GammaController *, bool); IDirectDrawSurface4 *pSurface; IDirectDrawGammaControl *pGammaControl; DDGAMMARAMP pDefaultRamp; diff -r 9dc33590f93e -r 934074e7fcc1 Indoor.cpp --- a/Indoor.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Indoor.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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(); diff -r 9dc33590f93e -r 934074e7fcc1 IndoorCameraD3D.cpp --- a/IndoorCameraD3D.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/IndoorCameraD3D.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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; } diff -r 9dc33590f93e -r 934074e7fcc1 IndoorCameraD3D.h --- a/IndoorCameraD3D.h Wed Aug 14 00:40:51 2013 +0400 +++ b/IndoorCameraD3D.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 Indoor_stuff.h --- a/Indoor_stuff.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Indoor_stuff.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 Keyboard.h --- a/Keyboard.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Keyboard.h Wed Aug 21 14:26:36 2013 +0200 @@ -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) diff -r 9dc33590f93e -r 934074e7fcc1 LOD.cpp --- a/LOD.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/LOD.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 LightmapBuilder.h --- a/LightmapBuilder.h Wed Aug 14 00:40:51 2013 +0400 +++ b/LightmapBuilder.h Wed Aug 21 14:26:36 2013 +0200 @@ -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 std__vector_000004; //std::vector std__vector_183808; Lightmap std__vector_000004[512]; diff -r 9dc33590f93e -r 934074e7fcc1 Lights.h --- a/Lights.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Lights.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; }; diff -r 9dc33590f93e -r 934074e7fcc1 MM7.h --- a/MM7.h Wed Aug 14 00:40:51 2013 +0400 +++ b/MM7.h Wed Aug 21 14:26:36 2013 +0200 @@ -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)*/ diff -r 9dc33590f93e -r 934074e7fcc1 Mouse.cpp --- a/Mouse.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Mouse.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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) { diff -r 9dc33590f93e -r 934074e7fcc1 Mouse.h --- a/Mouse.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Mouse.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 NPC.cpp --- a/NPC.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/NPC.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 OSInfo.h --- a/OSInfo.h Wed Aug 14 00:40:51 2013 +0400 +++ b/OSInfo.h Wed Aug 21 14:26:36 2013 +0200 @@ -21,7 +21,7 @@ } - //void (__thiscall ***vdestructor_ptr)(OSVersion *, bool); + //void ( ***vdestructor_ptr)(OSVersion *, bool); OSVERSIONINFOA pVersionInfo; int bInitialized; }; diff -r 9dc33590f93e -r 934074e7fcc1 Outdoor.cpp --- a/Outdoor.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Outdoor.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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(); diff -r 9dc33590f93e -r 934074e7fcc1 Party.cpp --- a/Party.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Party.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 Player.cpp --- a/Player.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Player.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -162,7 +162,7 @@ //----- (00490913) -------------------------------------------------------- -signed int __cdecl PlayerCreation_GetUnspentAttributePointCount() +signed 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 @@ -8784,7 +8784,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 +9371,7 @@ } } //----- (00421EA6) -------------------------------------------------------- -void __cdecl OnInventoryLeftClick() +void OnInventoryLeftClick() { Player *v0; // ebx@1 signed int v1; // eax@2 diff -r 9dc33590f93e -r 934074e7fcc1 Render.cpp --- a/Render.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/Render.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 Render.h --- a/Render.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Render.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 SaveLoad.cpp --- a/SaveLoad.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/SaveLoad.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -836,7 +836,7 @@ return pPixels; } //----- (0045E26C) -------------------------------------------------------- -void __thiscall SaveScreenshot(const char *pFilename) +void SaveScreenshot(const char *pFilename) { unsigned __int16 *v2; // esi@1 diff -r 9dc33590f93e -r 934074e7fcc1 UI/Books/UIMapBook.cpp --- a/UI/Books/UIMapBook.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/Books/UIMapBook.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -78,7 +78,7 @@ } //----- (00410DEC) -------------------------------------------------------- -unsigned int __cdecl DrawLloydBeaconsScreen() +unsigned int DrawLloydBeaconsScreen() { Player *pPlayer; // esi@1 char *pText; // eax@1 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UICharacter.cpp --- a/UI/UICharacter.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UICharacter.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 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, @@ -2435,7 +2444,7 @@ } } //----- (00468F8A) -------------------------------------------------------- -void __cdecl OnPaperdollLeftClick() +void OnPaperdollLeftClick() { int v1; // ecx@1 unsigned int v2; // edi@1 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UIHouses.cpp --- a/UI/UIHouses.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UIHouses.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -762,7 +762,7 @@ //----- (004B1784) -------------------------------------------------------- -bool __cdecl HouseUI_CheckIfPlayerCanInteract() +bool HouseUI_CheckIfPlayerCanInteract() { Player *pPlayer; // ebx@1 bool result; // eax@2 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 UI/UIHouses.h --- a/UI/UIHouses.h Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UIHouses.h Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UIPartyCreation.cpp --- a/UI/UIPartyCreation.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UIPartyCreation.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -25,7 +25,7 @@ //----- (004908DE) -------------------------------------------------------- -signed int __cdecl PlayerCreation_Chose4Skills() +signed int PlayerCreation_Chose4Skills() { 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 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UIPopup.cpp --- a/UI/UIPopup.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UIPopup.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -1596,7 +1596,7 @@ } //----- (00418083) -------------------------------------------------------- -void __cdecl CharacterUI_StatsTab_ShowHint() +void CharacterUI_StatsTab_ShowHint() { int pStringNum; // edi@1 signed int pTextColor; // eax@15 @@ -1763,7 +1763,7 @@ } //----- (00410B28) -------------------------------------------------------- - void __thiscall DrawSpellDescriptionPopup(int spell_index) + void DrawSpellDescriptionPopup(int spell_index) { Player *v1; // edi@1 SpellInfo *v2; // esi@1 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UIShops.cpp --- a/UI/UIShops.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UIShops.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 UI/UiGame.cpp --- a/UI/UiGame.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/UI/UiGame.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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"); } diff -r 9dc33590f93e -r 934074e7fcc1 VideoPlayer.cpp --- a/VideoPlayer.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/VideoPlayer.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -293,7 +293,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 diff -r 9dc33590f93e -r 934074e7fcc1 VideoPlayer.h --- a/VideoPlayer.h Wed Aug 14 00:40:51 2013 +0400 +++ b/VideoPlayer.h Wed Aug 21 14:26:36 2013 +0200 @@ -104,7 +104,7 @@ -void __cdecl ShowIntroVideo_and_LoadingScreen(); +void ShowIntroVideo_and_LoadingScreen(); diff -r 9dc33590f93e -r 934074e7fcc1 Vis.h --- a/Vis.h Wed Aug 14 00:40:51 2013 +0400 +++ b/Vis.h Wed Aug 21 14:26:36 2013 +0200 @@ -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; diff -r 9dc33590f93e -r 934074e7fcc1 _deleted.cpp --- a/_deleted.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/_deleted.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 lib/legacy_dx/d3drmobj.h --- a/lib/legacy_dx/d3drmobj.h Wed Aug 14 00:40:51 2013 +0400 +++ b/lib/legacy_dx/d3drmobj.h Wed Aug 21 14:26:36 2013 +0200 @@ -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); diff -r 9dc33590f93e -r 934074e7fcc1 mm7_2.cpp --- a/mm7_2.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_2.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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() +signed int sub_4BD8B5() { int v0; // eax@4 int v1; // eax@29 @@ -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 @@ -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 sub_461103() { //GUIProgressBar *v0; // ebx@1 //signed int v1; // ebp@1 @@ -3206,7 +3206,7 @@ } //----- (004613C4) -------------------------------------------------------- -int __cdecl sub_4613C4() +int sub_4613C4() { unsigned __int16 v0; // ax@1 size_t v1; // ecx@1 @@ -3267,7 +3267,7 @@ OPENFILENAMEA ofn; //----- (0046271C) -------------------------------------------------------- -void __cdecl crt_init_globals_46271C() +void CreateDefaultBLVLevel() { ofn.lStructSize = 0x4Cu; ofn.hwndOwner = hWnd; @@ -3378,7 +3378,7 @@ } else { - if ( !ptr_507BDC )// ??? + if ( !pModalWindow )// ??? { pButton = pWindow->pControlsHead; for ( pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext ) @@ -3448,6 +3448,7 @@ switch (Msg) { + case WM_SIZING: return 1; case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam); case WM_CHAR: { @@ -3456,6 +3457,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 +3649,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 +3766,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 +3848,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 +4025,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 +4058,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 +4067,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 +4108,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 +4132,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); @@ -5087,7 +5086,7 @@ } //----- (00465D0B) -------------------------------------------------------- -void __cdecl SecondaryInitialization() +void SecondaryInitialization() { __int16 v4; // ax@4 signed int v5; // esi@5 @@ -5456,13 +5455,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 +5511,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 +5661,7 @@ } //----- (004666D5) -------------------------------------------------------- -void __cdecl MM7Initialization() +void MM7Initialization() { if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) { @@ -5705,7 +5707,7 @@ } //----- (00466B8C) -------------------------------------------------------- -int __cdecl AbortWithError() +int AbortWithError() { if ( !aborting_app ) { @@ -5754,7 +5756,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"; }; @@ -6013,7 +6015,7 @@ } //----- (0046A99B) -------------------------------------------------------- -int __cdecl sub_46A99B() +int sub_46A99B() { int v0; // ebx@1 signed int v1; // ecx@1 @@ -6219,7 +6221,7 @@ } //----- (0046BDA8) -------------------------------------------------------- -unsigned int __cdecl GetGravityStrength() +unsigned int GetGravityStrength() { int v0; // eax@1 @@ -6229,7 +6231,7 @@ } //----- (0046BDC0) -------------------------------------------------------- -void __cdecl UpdateUserInput_and_MapSpecificStuff() +void UpdateUserInput_and_MapSpecificStuff() { if ( dword_6BE364_game_settings_1 & 0x80 ) { diff -r 9dc33590f93e -r 934074e7fcc1 mm7_3.cpp --- a/mm7_3.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_3.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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() +signed 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) +signed int sub_475665(BLVFace *_this, int a2, __int16 a3) { unsigned int v3; // eax@1 Vec3_short_ *v4; // edx@3 @@ -4335,7 +4335,7 @@ } //----- (004783FA) -------------------------------------------------------- -void __cdecl sub_4783FA_construct_global_73D150() +void sub_4783FA_construct_global_73D150() { char *v0; // eax@1 signed int v1; // ecx@1 @@ -6010,7 +6010,7 @@ } //----- (00481ED9) -------------------------------------------------------- -void __cdecl sub_481ED9_MessWithOutdoorCamera() +void sub_481ED9_MessWithOutdoorCamera() { stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0); pOutdoorCamera->uNumPolygons = 0; @@ -6190,7 +6190,7 @@ } //----- (00482A90) -------------------------------------------------------- -signed int __cdecl const_1_0() +signed int const_1_0() { return 1; } @@ -6200,7 +6200,7 @@ //----- (00485F53) -------------------------------------------------------- -void __thiscall sr_485F53(Vec2_int_ *v) +void sr_485F53(Vec2_int_ *v) { ++v->y; if ( v->y > 1000 ) @@ -6726,7 +6726,7 @@ } //----- (00443F95) -------------------------------------------------------- -void __cdecl OnMapLeave() +void OnMapLeave() { _evt_raw *test_event; if ( uLevelEVT_NumEvents > 0 ) @@ -6917,7 +6917,7 @@ } //----- (00444564) -------------------------------------------------------- -const char *__cdecl sub_444564() +const char * sub_444564() { double v0; // st7@3 int v1; // ebx@3 @@ -7047,7 +7047,7 @@ } //----- (004452BB) -------------------------------------------------------- -void __cdecl sub_4452BB() +void sub_4452BB() { pGUIWindow2->Release(); pGUIWindow2 = 0; @@ -7436,7 +7436,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,13 +7797,13 @@ } //----- (0044C28B) -------------------------------------------------------- -signed int __cdecl const_2() +signed int const_2() { return 2; } //----- (0044C28F) -------------------------------------------------------- -bool __cdecl sub_44C28F_open_nwc_dungeon() +bool sub_44C28F_open_nwc_dungeon() { bool result; // eax@1 @@ -7890,7 +7890,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 +7909,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) { diff -r 9dc33590f93e -r 934074e7fcc1 mm7_4.cpp --- a/mm7_4.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_4.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 @@ -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 @@ -2615,7 +2615,7 @@ } //----- (004A57E9) -------------------------------------------------------- -void __cdecl Present_ColorKey() +void Present_ColorKey() { HRESULT v0; // eax@3 HRESULT v1; // eax@3 @@ -2939,7 +2939,7 @@ } //----- (004B1523) -------------------------------------------------------- -void __thiscall sub_4B1523(int *_this) +void sub_4B1523(int *_this) { int v1; // esi@1 int v2; // edx@1 @@ -3009,7 +3009,7 @@ } //----- (004B1ECE) -------------------------------------------------------- -void __cdecl sub_4B1ECE() +void sub_4B1ECE() { __int16 *v0; // edi@1 int v1; // ebx@3 @@ -3109,7 +3109,7 @@ // 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 +3485,7 @@ } //----- (004B3E1E) -------------------------------------------------------- -void __cdecl sub_4B3E1E() +void sub_4B3E1E() { NPCData *v0; // ST40_4@1 signed int v1; // edi@1 diff -r 9dc33590f93e -r 934074e7fcc1 mm7_5.cpp --- a/mm7_5.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_5.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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 ) @@ -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 @@ -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; @@ -4895,13 +4900,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 +4962,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 +5003,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 diff -r 9dc33590f93e -r 934074e7fcc1 mm7_6.cpp --- a/mm7_6.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_6.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -314,7 +314,7 @@ return ((unsigned __int8)a1 >> 3) | v2 | v1; } //----- (00426947) -------------------------------------------------------- -void __cdecl sub_426947() +void sub_426947() { stru_50C198.field_0 = 0; dword_50C994 = 0; @@ -1549,7 +1549,7 @@ } //----- (0042F4DA) -------------------------------------------------------- -signed int __cdecl sub_42F4DA() +int _42F4DA_check_actor_proximity() { signed int v0; // edi@1 Actor *v1; // esi@4 @@ -1837,7 +1837,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 +1897,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 +1905,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 +1913,7 @@ } //----- (0042FC4E) -------------------------------------------------------- -void __cdecl ProcessInputActions() +void ProcessInputActions() { char v4; // al@9 char v8; // bl@100 diff -r 9dc33590f93e -r 934074e7fcc1 mm7_data.cpp --- a/mm7_data.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_data.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -500,7 +500,11 @@ int dword_4E4A1C[777]; // weak int dword_4E4A40[777]; // weak int dword_4E4A44[777]; // weak -std::array flt_4E4A80; +std::array 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, 14> pPartySpellbuffsUI_XYs = @@ -924,7 +928,6 @@ int uGameMenuUI_CurentlySelectedKeyIdx; // 506E68 std::array pPrevVirtualCidesMapping; int KeyboardPageNum; // weak -std::array 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 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 mm7_data.h --- a/mm7_data.h Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7_data.h Wed Aug 21 14:26:36 2013 +0200 @@ -570,7 +570,6 @@ extern std::array GameMenuUI_InvaligKeyBindingsFlags; // 506E6C extern std::array pPrevVirtualCidesMapping; extern int KeyboardPageNum; // weak -extern std::array 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 @@ -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,168 +1058,17 @@ //------------------------------------------------------------------------- // Function declarations -#define __thiscall __cdecl // Test compile in C mode - -void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)); -void MakeActorAIList_ODM(); -int __cdecl MakeActorAIList_BLV(); -void __cdecl 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); -bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb -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 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 __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 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 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); -void __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); -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 __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 __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(); -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 _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(); -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(); -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 __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 __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 __fastcall PrepareDrawLists_BLV(struct IndoorLocation_drawstru *_this); -void __cdecl 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(); -void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID); -void PrepareActorRenderList_BLV(); -void PrepareItemsRenderList_BLV(); -void AddBspNodeToRenderList(unsigned int node_id); -void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb -void __fastcall sub_440BED(struct IndoorLocation_drawstru *_this); -bool sub_44100D(); -__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 Level_LoadEvtAndStr(const char *pLevelName); -const char *__cdecl sub_444564(); -char *__thiscall GetEventHintString(unsigned int uEventID); // idb -int GetTravelTime(); -void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4); -void __cdecl sub_4452BB(); +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 __cdecl DialogueEnding(); +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 -// void __cdecl crt_construct_5773C4(); +// void 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); @@ -1240,7 +1076,7 @@ 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 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 @@ -1248,10 +1084,10 @@ 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 ShowNothingHereStatus(); +signed int const_2(); +bool sub_44C28F_open_nwc_dungeon(); +// int 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); @@ -1259,7 +1095,7 @@ int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2); void RespawnGlobalDecorations(); bool __fastcall SpawnActor(unsigned int uMonsterID); -int __cdecl GetAlertStatus(); +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); @@ -1273,89 +1109,85 @@ *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 crt_452B74(); +int j_SetSomeItemsNames(); int SkillToMastery(unsigned int skill_value); unsigned int __fastcall GetSpellColor(signed int a1); -void *__thiscall unknown_vdtor_6(void *_this, bool a2); +void * 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 sub_461103(); +int sub_4613C4(); 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); +int sub_46224A(); +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); +void * 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 free_book_subwindow(); void CreateScrollWindow(); -void __cdecl OnPaperdollLeftClick(); +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(); +int sub_46A99B(); +void * unknown_libname_8(void *_this, char a2); +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); -void __cdecl check_event_triggers(); +void 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 _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 _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(); +int _46EF01_collision_chech_player(int a1); // idb +signed int _46F04E_collide_against_portals(); void BLV_UpdateDoors(); void UpdateActors_BLV(); void UpdateActors_ODM(); @@ -1363,19 +1195,19 @@ 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); +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); +signed 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); -int __cdecl GetPartyReputation(); -void __cdecl sub_4783FA_construct_global_73D150(); -void __cdecl loc_4789D4(); // idb -void __cdecl loc_47907F(); // idb +int GetPartyReputation(); +void sub_4783FA_construct_global_73D150(); +void loc_4789D4(); // idb +void loc_47907F(); // idb 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); @@ -1383,25 +1215,25 @@ 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 +void loc_48118F(); // idb +void loc_481199(); // idb 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 +signed int const_1_0(); +void sub_487DA9(); +double GetFogDensityByTime(struct OutdoorLocation *_this); +int __stdcall loc_489BB3(struct stru320 *a2, int thisa, unsigned int uNumVertices, struct RenderVertexSoft *a5, float a6, char uClipFlag); // weak 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(); +signed int PlayerCreation_Chose4Skills(); +signed int PlayerCreation_GetUnspentAttributePointCount(); void LoadPlayerPortraintsAndVoices(); int __fastcall ReloadPlayerPortraits(int, int); // weak void sub_491E3A(); -signed int __thiscall CycleCharacter(unsigned int _this); +signed int CycleCharacter(unsigned int _this); void __fastcall Rest(unsigned int uHoursToSleep); int _493938_regenerate(); void sub_493F79(struct stru351_summoned_item *_this, __int64 a2); @@ -1425,26 +1257,26 @@ 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 sub_4B1523(int *_this); +void ShowPopupShopItem(); void __stdcall RestAndHeal(__int64 uNumMinutes); // idb -void __cdecl GetHouseGoodbyeSpeech(); +void GetHouseGoodbyeSpeech(); -void __cdecl sub_4B1ECE(); +void sub_4B1ECE(); void __fastcall ClickNPCTopic(signed int uMessageParam); -char *__thiscall _4B254D_SkillMasteryTeacher(int _this); +char * _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 sub_4B3E1E(); void DrawJoinGuildWindow(int pEventCode); void __fastcall sub_4B3FE5(int a4); void NPCHireableDialogPrepare(); @@ -1453,24 +1285,147 @@ int __fastcall sub_4B46F8(int a1); const char *sub_4BBA85_bounties(); -void __cdecl sub_4BBCDD(); +void sub_4BBCDD(); void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb -void __cdecl ArenaFight(); +void ArenaFight(); void SpellBookGenerator(); void UI_CreateEndConversationButton(); void __fastcall OnSelectShopDialogueOption(signed int uMessageParam); -signed int __cdecl sub_4BD8B5(); +signed int sub_4BD8B5(); bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx); -void __cdecl UIShop_Buy_Identify_Repair(); +void 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); +void ShowIntroVideo_and_LoadingScreen(); +unsigned int GameOverMenu(void *ecx0); +bool BinkLockBuffer(struct _BINKBUF *_this); +void 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 MakeActorAIList_ODM(); +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); +bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb +void InitializeActors(); +void InitializeSpriteObjects(); +int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6); +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 CallRenderPresent(); +void DoBlt_Copy(unsigned __int16 *pPixels); // idb +int loc_40E4FC(); // weak +void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue); +void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue); +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 identify_item(); +void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(struct Vec2_int_ *_this); +void UI_OnMouseLeftClick(int *pXY); // idb +unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2); +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); +void __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); +bool UI_OnKeyDown(unsigned int vkKey); +void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb +void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0); +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 GameUI_WritePointedObjectStatusString(); +//struct GUIWindow * GetCastSpellInInventoryWindow(void *a4); +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 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 _4268E3_smthn_to_a1r5g5b5(unsigned int uColor); // idb +int __fastcall _42690D_colors_cvt(unsigned int a1); +void 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 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(); +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 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); +void Software_ResetNewEdges(); +void CharacterUI_LoadPaperdollTextures(); +int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder); +bool _43ED6F_check_party_races(bool b); +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 __fastcall PrepareDrawLists_BLV(struct IndoorLocation_drawstru *_this); +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(); +void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID); +void PrepareActorRenderList_BLV(); +void PrepareItemsRenderList_BLV(); +void AddBspNodeToRenderList(unsigned int node_id); +void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb +void __fastcall sub_440BED(struct IndoorLocation_drawstru *_this); +bool sub_44100D(); +__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 OnMapLeave(); +void OnMapLoad(); +void Level_LoadEvtAndStr(const char *pLevelName); +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); #define ErrD3D(hr) do {extern void ErrHR(HRESULT, const char *, const char *, const char *, int); ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__);} while(0) diff -r 9dc33590f93e -r 934074e7fcc1 mm7text_ru.cpp --- a/mm7text_ru.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/mm7text_ru.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -1161,7 +1161,7 @@ return nullptr; } -int __cdecl sprintfex_internal(char *str) +int sprintfex_internal(char *str) { auto p = strstr(str, "^"); if (!p) diff -r 9dc33590f93e -r 934074e7fcc1 stru10.h --- a/stru10.h Wed Aug 14 00:40:51 2013 +0400 +++ b/stru10.h Wed Aug 21 14:26:36 2013 +0200 @@ -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) diff -r 9dc33590f93e -r 934074e7fcc1 stru9.h --- a/stru9.h Wed Aug 14 00:40:51 2013 +0400 +++ b/stru9.h Wed Aug 21 14:26:36 2013 +0200 @@ -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 diff -r 9dc33590f93e -r 934074e7fcc1 texts.cpp --- a/texts.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/texts.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -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]; diff -r 9dc33590f93e -r 934074e7fcc1 texts.h --- a/texts.h Wed Aug 14 00:40:51 2013 +0400 +++ b/texts.h Wed Aug 21 14:26:36 2013 +0200 @@ -2,12 +2,12 @@ #include -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