Mercurial > might-and-magic-trilogy
diff mm7_2.cpp @ 97:d7e68aebe0b3
Слияние
author | Ritor1 |
---|---|
date | Sat, 03 Nov 2012 19:59:36 +0600 |
parents | 51a5b0dc3f30 b5e26a133fae |
children | 8be5293b6b33 ccc0cf95706a 2331a331d36a |
line wrap: on
line diff
--- a/mm7_2.cpp Sat Nov 03 19:58:37 2012 +0600 +++ b/mm7_2.cpp Sat Nov 03 19:59:36 2012 +0600 @@ -145,7 +145,7 @@ _this.uFrameZ = 334; v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); + sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); _this.DrawText2(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u); if ( dword_F8B19C == 1 ) { @@ -206,7 +206,7 @@ v0 = ptr_507BC0; if ( ptr_507BC0->field_40 == 1 ) { - sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); + sprintfex(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); _this.DrawText2(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); _this.DrawText2(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); v3 = pFontArrus; @@ -257,8 +257,8 @@ v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v7 = v5->pName; v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6); - sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); + sprintfex(pTmpBuf, &byte_4F0F98, v8, v7, v6); + sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); ptr_F8B1E8 = pTmpBuf2; memcpy(&a1, pDialogueWindow, sizeof(a1)); w.uFrameWidth = 458; @@ -310,7 +310,7 @@ _this.uFrameZ = 334; *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); + sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); _this.DrawText2(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); if ( dword_F8B19C != 1 ) { @@ -394,7 +394,7 @@ v11 = pGlobalTXT_LocalizationStrings[112]; v10 = pGlobalTXT_LocalizationStrings[244]; } - sprintf(pTmpBuf, "%s\n%s", v10, v11); + sprintfex(pTmpBuf, "%s\n%s", v10, v11); _this.DrawText2(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u); _this.DrawText2(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); v4 = pFontArrus; @@ -681,7 +681,7 @@ while ( (signed int)v10 < v8->pStartingPosActiveItem + v8->pNumPresenceButton ); if ( v86 ) { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString); v79.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); pOutString = (GUIFont *)((149 - v89) / v86); if ( (149 - v89) / v86 > 32 ) @@ -731,7 +731,7 @@ } } v26 = pTmpBuf; - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->uClass]); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->uClass]); strcat(pTmpBuf, "\n \n"); strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); goto LABEL_97; @@ -770,16 +770,16 @@ v28 = *(int *)v84; if ( pDialogueWindow->pCurrentPosActiveItem != 2 ) v28 = v81; - sprintf(&Dest, format_4E2DC8, v28); - sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); + sprintfex(&Dest, format_4E2DC8, v28); + sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); strcat(&Dest, pTmpBuf2); v90 = pFontArrus->CalcTextHeight(&Dest, &v79, 0, 0); strcat(&Dest, "\n \n"); v29 = *(int *)v84; if ( pDialogueWindow->pCurrentPosActiveItem != 3 ) v29 = v81; - sprintf(&a1, format_4E2DC8, v29); - sprintf(pTmpBuf2, + sprintfex(&a1, format_4E2DC8, v29); + sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[86], //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier, @@ -790,7 +790,7 @@ v30 = *(int *)v84; if ( pDialogueWindow->pCurrentPosActiveItem != 4 ) v30 = v81; - sprintf(&v77, format_4E2DC8, v30); + sprintfex(&v77, format_4E2DC8, v30); strcat(&v77, pGlobalTXT_LocalizationStrings[160]); v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0); strcat(&v77, "\n \n"); @@ -802,7 +802,7 @@ v32 = *(int *)v84; if ( pDialogueWindow->pCurrentPosActiveItem != 5 ) v32 = v81; - sprintf(&v75, format_4E2DC8, v32); + sprintfex(&v75, format_4E2DC8, v32); strcat(&v75, pGlobalTXT_LocalizationStrings[611]); v87 = pFontArrus->CalcTextHeight(&v75, &v79, 0, 0); } @@ -816,7 +816,7 @@ if ( !(v37 ^ __OFSUB__(v34, v35)) ) { LABEL_75: - sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75); + sprintfex(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75); v71 = 3; v69 = pTmpBuf; v67 = 0; @@ -1215,7 +1215,7 @@ if ( !v109 ) { LABEL_105: - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]); strcat(pTmpBuf, "\n \n"); strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); v7 = pTmpBuf; @@ -1227,7 +1227,7 @@ v77 = &v101; goto LABEL_15; } - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); v101.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); v108 = (149 - v106.y) / (signed int)v109; if ( (149 - v106.y) / (signed int)v109 > 32 ) @@ -1954,7 +1954,7 @@ while ( (signed int)v6 < v2->pNumPresenceButton + v2->pStartingPosActiveItem ); if ( v114 ) { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v111); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v111); v104.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); v111 = (const char **)((signed int)(149 - v112) / v114); if ( (signed int)(149 - v112) / v114 > 32 ) @@ -2004,7 +2004,7 @@ return result; } } - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]); strcat(pTmpBuf, "\n \n"); strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); v21 = pTmpBuf; @@ -2548,7 +2548,7 @@ while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem ); if ( v153 ) { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this); v144.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); _this = (Player *)((149 - v152) / v153); if ( (149 - v152) / v153 > 32 ) @@ -2597,7 +2597,7 @@ return; } } - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]); strcat(pTmpBuf, "\n \n"); strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); v11 = 0; @@ -5154,7 +5154,7 @@ { v4 = pClassNames[(unsigned __int8)v3[17]]; v5 = ((Player *)(v3 - 168))->GetBaseLevel(); - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4); pWindow.DrawText2( pFont, 1u, @@ -5181,10 +5181,10 @@ v9 = pGlobalTXT_LocalizationStrings[245]; if ( v14 != 1 ) v9 = pGlobalTXT_LocalizationStrings[132]; - sprintf(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); + sprintfex(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); strcat(pTmpBuf, pTmpBuf2); pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u); - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23); pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u); BYTE1(dword_6BE364_game_settings_1) |= 0x40u; pRenderer->EndScene(); @@ -7640,7 +7640,7 @@ LABEL_24: v44 = "%s C"; LABEL_25: - result = (void *)sprintf(&Source, v44, v45); + result = (void *)sprintfex(&Source, v44, v45); LABEL_26: if ( Source == 48 ) return result; @@ -7710,14 +7710,14 @@ v44 = "%s C"; } } - sprintf(&Str2, v44, v45); + sprintfex(&Str2, v44, v45); } v26 = pMonsterList->GetMonsterByName(&Str2); v50 = (signed __int16)v26; v45 = &Str2; if ( (signed __int16)v26 == -1 ) { - sprintf(&Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45); + sprintfex(&Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45); MessageBoxA(nullptr, &Str, nullptr, 0); ExitProcess(0); } @@ -10330,7 +10330,7 @@ } if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") ) { - sprintf(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4)); + sprintfex(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4)); MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0); result = 0; goto LABEL_76; @@ -11471,7 +11471,7 @@ pRenderer->DrawTextureIndexed( 8u, 8u, - (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0)); + uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0); if ( a4 ) { v2 = uTextureID_save_up; @@ -11482,23 +11482,20 @@ v2 = uTextureID_load_up; v3 = uTextureID_LS_loadU; } - pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); - pRenderer->DrawTextureIndexed(0x12u, 0x8Bu, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); - pRenderer->DrawTextureIndexed( - 0x15Fu, - 0x12Eu, - (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0)); + pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0)); + pRenderer->DrawTextureIndexed(18, 139, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0)); + pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0)); v1 = 255; } if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) { memset(&Dst, 0, 0x54u); Dst.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240; - v4 = pGUIWindow_CurrentMenu->uFrameY - LOBYTE(pFontSmallnum->uFontHeight); + v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight; Dst.uFrameWidth = 220; v4 += 157; Dst.uFrameY = v4; - v5 = LOBYTE(pFontSmallnum->uFontHeight); + v5 = pFontSmallnum->uFontHeight; Dst.uFrameZ = Dst.uFrameX + 219; Dst.uFrameHeight = v5; Dst.uFrameW = v5 + v4 - 1; @@ -11592,10 +11589,10 @@ v18 = pGlobalTXT_LocalizationStrings[135]; v19 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[135]); pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, v18, 0, 0, 0); - v20 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot); + v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot); v21 = pFontSmallnum->AlignText_Center( 0xBAu, - (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); + (const char *)pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106u, 0, v20, 185, 0); v22 = pGlobalTXT_LocalizationStrings[165]; v23 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]); @@ -13532,7 +13529,7 @@ v4 = hdc * BytesPerSector * SectorsPerCluster; if ( (unsigned int)v4 < 0x1E00000 ) { - sprintf( + sprintfex( pTmpBuf, "Due to Window Virtual Memory requirements Might and Magic VII\nrequires 30MB of free hard drive space to operate properly.\n\nAvailable on Current Drive = %luk", (unsigned int)v4 / 1024i64); @@ -13932,9 +13929,9 @@ pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); - pPaletteManager->field_267AD0 = 128; - pPaletteManager->field_267AD1 = 128; - pPaletteManager->field_267AD2 = 128; + pPaletteManager->pPalette_mistColor[0] = 128; + pPaletteManager->pPalette_mistColor[1] = 128; + pPaletteManager->pPalette_mistColor[2] = 128; pPaletteManager->RecalculateAll(); pSprites_LOD->field_ECAC = 1; pObjectList->InitializeSprites(); @@ -14017,7 +14014,7 @@ v11 = 1; do { - sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11); + sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11); remove(pTmpBuf); ++v11; } @@ -14300,7 +14297,7 @@ unsigned int v9; // [sp+184h] [bp-4h]@28 //_getcwd(v5, 120); - //sprintf(pIniFilename, "%s\\mm6.ini", v5); + //sprintfex(pIniFilename, "%s\\mm6.ini", v5); viewparams = new ViewingParams; viewparams->uScreenX = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename); viewparams->uScreenY = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename); @@ -14972,7 +14969,7 @@ } } LABEL_174: - sprintf(&Src, "Unknown DirectDraw/Direct3D error number %X", v4); + sprintfex(&Src, "Unknown DirectDraw/Direct3D error number %X", v4); v13 = strlen(&Src); v12 = &Src; goto LABEL_175; @@ -15165,7 +15162,7 @@ a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; v1 = pItemsTable->pItems[(unsigned int)ptr_507BC4->ptr_1C + 700].pName; v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, format_4E2D80, v2, v1); + sprintfex(pTmpBuf, format_4E2D80, v2, v1); a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u); return a1.DrawText( pFontSmallnum, @@ -15861,7 +15858,7 @@ if ( pParty->pPickedItem.uItemID ) return 1; v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName; - sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24); + sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24); ShowStatusBarString(pTmpBuf2, 2u); if ( v19->uItemID == 506 ) _449B7E_toggle_bit(pParty->_award_bits, 184, 1u);