Mercurial > mm7
diff GUIWindow.cpp @ 1018:9ac94d00012e
Merge
author | Grumpy7 |
---|---|
date | Tue, 21 May 2013 02:24:31 +0200 |
parents | c45d51b3f4f4 9e823ad5eaa6 |
children | 306ec23b37df |
line wrap: on
line diff
--- a/GUIWindow.cpp Sun May 19 20:41:19 2013 +0200 +++ b/GUIWindow.cpp Tue May 21 02:24:31 2013 +0200 @@ -33,7 +33,7 @@ struct GUIWindow pWindowList[20]; struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; - +struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue; // inlined //----- (mm6c::00420520) -------------------------------------------------- @@ -175,8 +175,8 @@ // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; //----- (0041D73D) -------------------------------------------------------- -char GUIWindow::_41D73D_draw_buff_tooltip() -{ +void GUIWindow::_41D73D_draw_buff_tooltip() + { GUIFont *v1; // esi@1 GUIWindow *v2; // edi@1 SpellBuff *v3; // eax@1 @@ -241,7 +241,7 @@ (unsigned __int8)*v8, (unsigned __int8)v8[1]); v2->DrawText(a2, 52, v12, v14, v13, 0, 0, 0); - LOBYTE(v9) = sub_41D20D_buff_remaining_time_string(v12, v2, v11, a2); + sub_41D20D_buff_remaining_time_string(v12, v2, v11, a2); v1 = a2; } ++v18; @@ -249,130 +249,10 @@ v8 += 3; } while ( (signed int)v18 < (signed int)pParty->pPlayers ); - return v9; + } -//----- (0041D3B7) -------------------------------------------------------- -void GUIWindow::DrawQuickCharRecord() - { - Player *pPlayer; // esi@1 - int v6; // eax@5 - int v7; // ebx@5 - unsigned int v8; // ecx@5 - int v9; // ebx@5 - unsigned int v10; // eax@5 - int v11; // eax@5 - unsigned int v12; // ecx@5 - Texture *v13; // eax@6 - unsigned int v14; // eax@12 - PlayerFrame *v15; // eax@12 - unsigned int v16; // eax@15 - unsigned int v20; // eax@15 - unsigned int v24; // eax@15 - unsigned int v25; // eax@15 - unsigned __int8 v28; // al@15 - char *v29; // eax@16 - __int64 v35; // ST38_8@22 - int v36; // esi@22 - unsigned int v38; // eax@22 - char *v39; // eax@24 - signed int uFramesetID; // [sp+20h] [bp-8h]@9 - int uFramesetIDa; // [sp+20h] [bp-8h]@18 - - pPlayer = &pParty->pPlayers[(unsigned int)ptr_1C]; - - uint numActivePlayerBuffs = 0; - - for (uint i = 0; i < 24; ++i) - if (pPlayer->pPlayerBuffs[i].uExpireTime > 0) - ++numActivePlayerBuffs; - - v6 = pFontArrus->uFontHeight + 162; - uFrameHeight = v6; - v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; - v8 = uFrameX; - v9 = v6 + v7; - v10 = uFrameWidth; - uFrameHeight = v9; - v11 = v10 + v8 - 1; - v12 = uFrameY; - uFrameZ = v11; - uFrameW = v9 + v12 - 1; - DrawMessageBox(0); - if (pPlayer->Eradicated()) - v13 = pTexture_PlayerFaceEradicated; - else if (pPlayer->Dead()) - v13 = pTexture_PlayerFaceDead; - else - { - uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(pPlayer->expression); - if ( !uFramesetID ) - uFramesetID = 1; - if ( pPlayer->expression == CHARACTER_EXPRESSION_21) - { - v15 = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); - } - else - { - v14 = pMiscTimer->Time(); - v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); - } - pPlayer->field_1AA2 = v15->uTextureID - 1; - v13 = pTextures_PlayerFaces[(unsigned int)ptr_1C][v15->uTextureID-1]; - } - - pRenderer->DrawTextureTransparent(uFrameX + 24, uFrameY + 24, v13); - v16 = TargetColor(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, "\f%05d", v16); - sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]); - strcat(pTmpBuf, pTmpBuf2); - strcat(pTmpBuf, "\f00000\n"); - v20 = UI_GetHealthManaStringColor(pPlayer->sHealth, pPlayer->GetMaxHealth()); - sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], - v20, pPlayer->sHealth, pPlayer->GetMaxHealth()); - strcat(pTmpBuf, pTmpBuf2); - v24 = UI_GetHealthManaStringColor(pPlayer->sMana, pPlayer->GetMaxMana()); - sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], - v24, pPlayer->sMana, pPlayer->GetMaxMana()); - strcat(pTmpBuf, pTmpBuf2); - v25 = pPlayer->GetMajorConditionIdx(); - sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], - GetConditionDrawColor(v25), aCharacterConditionNames[v25]); - strcat(pTmpBuf, pTmpBuf2); - v28 = pPlayer->uQuickSpell; - if ( v28 ) - v29 = pSpellStats->pInfos[v28].pShortName; - else - v29 = pGlobalTXT_LocalizationStrings[153]; - sprintf((char*)pTmpBuf2, "%s: %s", (char*)pGlobalTXT_LocalizationStrings[172], v29); - strcat((char*)pTmpBuf, (char*)pTmpBuf2); - DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); - - uFramesetIDa = 0; - for (uint i = 0; i < 24; ++i) - { - auto buff = pPlayer->pPlayerBuffs + i; - if (buff->uExpireTime > 0) - { - v35 = buff->uExpireTime - pParty->uTimePlayed; - v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; - v38 = TargetColor( - _4E2AD8_ui_colors[i * 3], - _4E2AD8_ui_colors[i * 3 + 1], - _4E2AD8_ui_colors[i * 3 + 2]); - DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); - sub_41D20D_buff_remaining_time_string(v36, this, v35, pFontComic); - } - } - - v39 = ""; - if ( uFramesetIDa == 0 ) - v39 = pGlobalTXT_LocalizationStrings[153]; - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); - DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0); -} - //----- (0041D08F) -------------------------------------------------------- void GUIWindow::_41D08F_set_keyboard_control_group(int a2, int a3, int a4, int a5) { @@ -416,7 +296,7 @@ { case WINDOW_GreetingNPC: { - pIcons_LOD->_40F9C5(); + pIcons_LOD->SyncLoadedFilesCount(); pCurrentScreen = pMainScreenNum; pKeyActionMap->_459ED1(3); break; @@ -428,7 +308,7 @@ uNumDialogueNPCPortraits = 0; pTexture_Dialogue_Background->Release(); - pIcons_LOD->_40F9C5(); + pIcons_LOD->SyncLoadedFilesCount(); pIcons_LOD->_4114F2(); dword_5C35D4 = 0; if ( bFlipOnExit ) @@ -445,7 +325,7 @@ pVideoPlayer->Unload(); pTexture_outside->Release(); pTexture_Dialogue_Background->Release(); - pIcons_LOD->_40F9C5(); + pIcons_LOD->SyncLoadedFilesCount(); pCurrentScreen = pMainScreenNum; break; } @@ -464,7 +344,7 @@ { pTexture_outside->Release(); pTexture_Dialogue_Background->Release(); - pIcons_LOD->_40F9C5(); + pIcons_LOD->SyncLoadedFilesCount(); pCurrentScreen = pMainScreenNum; break; } @@ -475,7 +355,7 @@ uNumDialogueNPCPortraits = 0; pTexture_Dialogue_Background->Release(); - pIcons_LOD->_40F9C5(); + pIcons_LOD->SyncLoadedFilesCount(); pCurrentScreen = pMainScreenNum; } default: @@ -767,7 +647,7 @@ } break; - case WINDOW_HistoryBook: + case WINDOW_JournalBook: { pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); @@ -938,7 +818,7 @@ if ( v17 ) { v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0); - v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u); + v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3); } } @@ -1359,8 +1239,8 @@ //----- (0044CE08) -------------------------------------------------------- -char GUIWindow::DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor) -{ +void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor ) + { GUIWindow *v9; // edi@1 GUIFont *v10; // ebx@1 int v11; // eax@2 @@ -1394,7 +1274,7 @@ if ( !Str ) { MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); - return v11; + return; } v11 = strcmp(Str, "null"); if ( v11 ) @@ -1469,7 +1349,7 @@ LABEL_36: v11 = v11 + v13 - 3; if ( v11 > a8 ) - return v11; + return; break; } break; @@ -1521,7 +1401,7 @@ } } } - return v11; + return; }