Mercurial > mm7
comparison mm7_2.cpp @ 1205:8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 00:30:48 +0200 |
parents | 1eed3e0ab666 |
children | fd3bea473c0c 0d6c7ff3cddd |
comparison
equal
deleted
inserted
replaced
1204:832f09144726 | 1205:8c02e6f74b29 |
---|---|
878 { | 878 { |
879 //v3 = byte_591180; | 879 //v3 = byte_591180; |
880 do | 880 do |
881 { | 881 { |
882 HouseNPCData[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2], | 882 HouseNPCData[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2], |
883 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2], 0, 0, 0); | 883 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2].data(), 0, 0, 0); |
884 v1 = uNumDialogueNPCPortraits; | 884 v1 = uNumDialogueNPCPortraits; |
885 ++v2; | 885 ++v2; |
886 //v3 += 100; | 886 //v3 += 100; |
887 } | 887 } |
888 while ( (signed int)v2 < uNumDialogueNPCPortraits ); | 888 while ( (signed int)v2 < uNumDialogueNPCPortraits ); |
1083 else | 1083 else |
1084 bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];//(ItemGen *)&pParty->field_C59C[v31 + 724]; | 1084 bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];//(ItemGen *)&pParty->field_C59C[v31 + 724]; |
1085 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier); | 1085 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier); |
1086 uNumSeconds = 0; | 1086 uNumSeconds = 0; |
1087 a3 = 0; | 1087 a3 = 0; |
1088 if ( pMapStats->GetMapInfo(pCurrentMapName) ) | 1088 if ( pMapStats->GetMapInfo(pCurrentMapName.data()) ) |
1089 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]._steal_perm; | 1089 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())]._steal_perm; |
1090 party_reputation = GetPartyReputation(); | 1090 party_reputation = GetPartyReputation(); |
1091 if (pPlayers[uActiveCharacter]->CanSteal()) | 1091 if (pPlayers[uActiveCharacter]->CanSteal()) |
1092 { | 1092 { |
1093 if ( GetAsyncKeyState(VK_CONTROL) ) | 1093 if ( GetAsyncKeyState(VK_CONTROL) ) |
1094 { | 1094 { |
1283 //for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i ) | 1283 //for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i ) |
1284 for ( i = pParty->pPlayers; ; v3 = i ) | 1284 for ( i = pParty->pPlayers; ; v3 = i ) |
1285 { | 1285 { |
1286 v4 = pClassNames[v3->classType]; | 1286 v4 = pClassNames[v3->classType]; |
1287 v5 = v3->GetBaseLevel(); | 1287 v5 = v3->GetBaseLevel(); |
1288 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i->pName, v5, v4); | 1288 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], i->pName, v5, v4); |
1289 pWindow.DrawTitleText( | 1289 pWindow.DrawTitleText( |
1290 pFont, | 1290 pFont, |
1291 1u, | 1291 1u, |
1292 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, | 1292 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, |
1293 1u, | 1293 1u, |
1294 pTmpBuf, | 1294 pTmpBuf.data(), |
1295 3u); | 1295 3u); |
1296 v23 += i->uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8)); | 1296 v23 += i->uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8)); |
1297 ++v20; | 1297 ++v20; |
1298 ++i; | 1298 ++i; |
1299 if ( i > &pParty->pPlayers[3] ) | 1299 if ( i > &pParty->pPlayers[3] ) |
1300 break; | 1300 break; |
1301 } | 1301 } |
1302 v23 = (signed __int64)v23 / v19; | 1302 v23 = (signed __int64)v23 / v19; |
1303 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0); | 1303 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0); |
1304 pWindow.DrawTitleText(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0); | 1304 pWindow.DrawTitleText(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0); |
1305 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]); | 1305 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]); |
1306 v7 = pGlobalTXT_LocalizationStrings[56]; | 1306 v7 = pGlobalTXT_LocalizationStrings[56]; |
1307 if ( v17 != 1 ) | 1307 if ( v17 != 1 ) |
1308 v7 = pGlobalTXT_LocalizationStrings[57]; | 1308 v7 = pGlobalTXT_LocalizationStrings[57]; |
1309 v8 = pGlobalTXT_LocalizationStrings[146]; | 1309 v8 = pGlobalTXT_LocalizationStrings[146]; |
1310 if ( v18 != 1 ) | 1310 if ( v18 != 1 ) |
1311 v8 = pGlobalTXT_LocalizationStrings[148]; | 1311 v8 = pGlobalTXT_LocalizationStrings[148]; |
1312 v9 = pGlobalTXT_LocalizationStrings[245]; | 1312 v9 = pGlobalTXT_LocalizationStrings[245]; |
1313 if ( v14 != 1 ) | 1313 if ( v14 != 1 ) |
1314 v9 = pGlobalTXT_LocalizationStrings[132]; | 1314 v9 = pGlobalTXT_LocalizationStrings[132]; |
1315 sprintf(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); | 1315 sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); |
1316 strcat(pTmpBuf, pTmpBuf2); | 1316 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1317 pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u); | 1317 pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf.data(), 3u); |
1318 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23); | 1318 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23); |
1319 pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u); | 1319 pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf.data(), 3u); |
1320 BYTE1(dword_6BE364_game_settings_1) |= 0x40u; | 1320 BYTE1(dword_6BE364_game_settings_1) |= 0x40u; |
1321 pRenderer->EndScene(); | 1321 pRenderer->EndScene(); |
1322 pRenderer->Present(); | 1322 pRenderer->Present(); |
1323 if ( pRenderer->pRenderD3D ) | 1323 if ( pRenderer->pRenderD3D ) |
1324 pRenderer->pBeforePresentFunction(); | 1324 pRenderer->pBeforePresentFunction(); |
5106 char Filename[256]; // [sp+204h] [bp-20Ch]@1 | 5106 char Filename[256]; // [sp+204h] [bp-20Ch]@1 |
5107 char a1[260]; // [sp+304h] [bp-10Ch]@1 | 5107 char a1[260]; // [sp+304h] [bp-10Ch]@1 |
5108 char Drive[4]; // [sp+408h] [bp-8h]@1 | 5108 char Drive[4]; // [sp+408h] [bp-8h]@1 |
5109 int DstBuf; // [sp+40Ch] [bp-4h]@2 | 5109 int DstBuf; // [sp+40Ch] [bp-4h]@2 |
5110 | 5110 |
5111 strcpy(a1, pCurrentMapName); | 5111 strcpy(a1, pCurrentMapName.data()); |
5112 _splitpath(a1, Drive, Dir, Filename, Ext); | 5112 _splitpath(a1, Drive, Dir, Filename, Ext); |
5113 sprintf(a1, "levels\\%s%s", Filename, ".lod"); | 5113 sprintf(a1, "levels\\%s%s", Filename, ".lod"); |
5114 v0 = fopen(a1, "rb"); | 5114 v0 = fopen(a1, "rb"); |
5115 v1 = v0; | 5115 v1 = v0; |
5116 if ( v0 ) | 5116 if ( v0 ) |
5220 v2 = bLoading; | 5220 v2 = bLoading; |
5221 v3 = a2; | 5221 v3 = a2; |
5222 pGameLoadingUI_ProgressBar->Reset(0x1Bu); | 5222 pGameLoadingUI_ProgressBar->Reset(0x1Bu); |
5223 pSoundList->_4A9D79(0); | 5223 pSoundList->_4A9D79(0); |
5224 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2; | 5224 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2; |
5225 ODM_LoadAndInitialize(pCurrentMapName, v3); | 5225 ODM_LoadAndInitialize(pCurrentMapName.data(), v3); |
5226 if ( !v2 ) | 5226 if ( !v2 ) |
5227 TeleportToStartingPoint(uLevel_StartingPointType); | 5227 TeleportToStartingPoint(uLevel_StartingPointType); |
5228 viewparams->_443365(); | 5228 viewparams->_443365(); |
5229 PlayLevelMusic(); | 5229 PlayLevelMusic(); |
5230 } | 5230 } |
5262 pParty->uFlags |= 2u; | 5262 pParty->uFlags |= 2u; |
5263 pParty->field_7B5_in_arena_quest = 0; | 5263 pParty->field_7B5_in_arena_quest = 0; |
5264 //v1 = 0; | 5264 //v1 = 0; |
5265 dword_5C6DF8 = 1; | 5265 dword_5C6DF8 = 1; |
5266 pNPCStats->uNewlNPCBufPos = 0; | 5266 pNPCStats->uNewlNPCBufPos = 0; |
5267 v19 = pMapStats->GetMapInfo(pCurrentMapName); | 5267 v19 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
5268 | 5268 |
5269 //v15 = 0; | 5269 //v15 = 0; |
5270 for (uint i = 0; i < uNumActors; ++i) | 5270 for (uint i = 0; i < uNumActors; ++i) |
5271 //if ( (signed int)uNumActors > 0 ) | 5271 //if ( (signed int)uNumActors > 0 ) |
5272 { | 5272 { |
5489 ofn.nFileExtension = 0; | 5489 ofn.nFileExtension = 0; |
5490 ofn.lpstrDefExt = "blv"; | 5490 ofn.lpstrDefExt = "blv"; |
5491 ofn.lCustData = 0; | 5491 ofn.lCustData = 0; |
5492 ofn.lpfnHook = 0; | 5492 ofn.lpfnHook = 0; |
5493 ofn.lpTemplateName = 0; | 5493 ofn.lpTemplateName = 0; |
5494 ofn.lpstrFileTitle = pTmpBuf; | 5494 ofn.lpstrFileTitle = pTmpBuf.data(); |
5495 } | 5495 } |
5496 | 5496 |
5497 //----- (004627B7) -------------------------------------------------------- | 5497 //----- (004627B7) -------------------------------------------------------- |
5498 void MainMenu_Loop() | 5498 void MainMenu_Loop() |
5499 { | 5499 { |
6843 // 6BE3A0: using guessed type float flt_6BE3A0; | 6843 // 6BE3A0: using guessed type float flt_6BE3A0; |
6844 | 6844 |
6845 //----- (00464839) -------------------------------------------------------- | 6845 //----- (00464839) -------------------------------------------------------- |
6846 char __cdecl Is_out15odm_underwater() | 6846 char __cdecl Is_out15odm_underwater() |
6847 { | 6847 { |
6848 return _stricmp(pCurrentMapName, "out15.odm") == 0; | 6848 return _stricmp(pCurrentMapName.data(), "out15.odm") == 0; |
6849 } | 6849 } |
6850 | 6850 |
6851 //----- (00464851) -------------------------------------------------------- | 6851 //----- (00464851) -------------------------------------------------------- |
6852 void __cdecl SetUnderwaterFog() | 6852 void __cdecl SetUnderwaterFog() |
6853 { | 6853 { |
6870 v2 = a2; | 6870 v2 = a2; |
6871 v9 = bLoading; | 6871 v9 = bLoading; |
6872 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | 6872 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
6873 pDecalBuilder->Reset(0); | 6873 pDecalBuilder->Reset(0); |
6874 pGameLoadingUI_ProgressBar->Initialize((GUIProgressBar::Type)v2); | 6874 pGameLoadingUI_ProgressBar->Initialize((GUIProgressBar::Type)v2); |
6875 strcpy(Str1, pCurrentMapName); | 6875 strcpy(Str1, pCurrentMapName.data()); |
6876 v3 = strtok(Str1, "."); | 6876 v3 = strtok(Str1, "."); |
6877 strcpy(Str1, v3); | 6877 strcpy(Str1, v3); |
6878 Level_LoadEvtAndStr(Str1); | 6878 Level_LoadEvtAndStr(Str1); |
6879 LoadLevel_InitializeLevelEvt(); | 6879 LoadLevel_InitializeLevelEvt(); |
6880 strcpy(Str1, pCurrentMapName); | 6880 strcpy(Str1, pCurrentMapName.data()); |
6881 _strrev(Str1); | 6881 _strrev(Str1); |
6882 strtok(Str1, "."); | 6882 strtok(Str1, "."); |
6883 _strrev(Str1); | 6883 _strrev(Str1); |
6884 | 6884 |
6885 for (uint i = 0; i < 1000; ++i) | 6885 for (uint i = 0; i < 1000; ++i) |
6886 pSpriteObjects[i].uObjectDescID = 0; | 6886 pSpriteObjects[i].uObjectDescID = 0; |
6887 | 6887 |
6888 v5 = pMapStats->GetMapInfo(pCurrentMapName); | 6888 v5 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
6889 bUnderwater = 0; | 6889 bUnderwater = 0; |
6890 uLevelMapStatsID = v5; | 6890 uLevelMapStatsID = v5; |
6891 pGame->uFlags2 &= 0xFFFFFFF7u; | 6891 pGame->uFlags2 &= 0xFFFFFFF7u; |
6892 if ( !_stricmp(pCurrentMapName, "out15.odm") ) | 6892 if ( !_stricmp(pCurrentMapName.data(), "out15.odm") ) |
6893 { | 6893 { |
6894 bUnderwater = 1; | 6894 bUnderwater = 1; |
6895 pGame->uFlags2 |= 8u; | 6895 pGame->uFlags2 |= 8u; |
6896 } | 6896 } |
6897 pParty->floor_face_pid = 0; | 6897 pParty->floor_face_pid = 0; |
6899 PrepareToLoadODM(v9, 0); | 6899 PrepareToLoadODM(v9, 0); |
6900 else | 6900 else |
6901 PrepareToLoadBLV(v9); | 6901 PrepareToLoadBLV(v9); |
6902 pAudioPlayer->SetMapEAX(); | 6902 pAudioPlayer->SetMapEAX(); |
6903 sub_461103(); | 6903 sub_461103(); |
6904 if ( !_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv") ) | 6904 if ( !_stricmp(pCurrentMapName.data(), "d11.blv") || !_stricmp(pCurrentMapName.data(), "d10.blv") ) |
6905 { | 6905 { |
6906 //spawning grounds & good analogue - no loot & exp from monsters | 6906 //spawning grounds & good analogue - no loot & exp from monsters |
6907 | 6907 |
6908 for (uint i = 0; i < uNumActors; ++i) | 6908 for (uint i = 0; i < uNumActors; ++i) |
6909 { | 6909 { |
7908 | 7908 |
7909 _mkdir("Saves"); | 7909 _mkdir("Saves"); |
7910 for (uint i = 0; i < 5; ++i) | 7910 for (uint i = 0; i < 5; ++i) |
7911 for (uint j = 0; j < 6; ++j) | 7911 for (uint j = 0; j < 6; ++j) |
7912 { | 7912 { |
7913 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j); | 7913 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j); |
7914 remove(pTmpBuf); | 7914 remove(pTmpBuf.data()); |
7915 } | 7915 } |
7916 | 7916 |
7917 Initialize_GamesLOD_NewLOD(); | 7917 Initialize_GamesLOD_NewLOD(); |
7918 _576E2C_current_minimap_zoom = 512; | 7918 _576E2C_current_minimap_zoom = 512; |
7919 dword_576E28 = 9; | 7919 dword_576E28 = 9; |
8154 if ( pAudioPlayer->hAILRedbook ) | 8154 if ( pAudioPlayer->hAILRedbook ) |
8155 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | 8155 AIL_redbook_stop(pAudioPlayer->hAILRedbook); |
8156 pParty->Reset(); | 8156 pParty->Reset(); |
8157 pOtherOverlayList->Reset(); | 8157 pOtherOverlayList->Reset(); |
8158 | 8158 |
8159 strcpy(pCurrentMapName, pStartingMapName); | 8159 strcpy(pCurrentMapName.data(), pStartingMapName.data()); |
8160 pParty->CreateDefaultParty(0); | 8160 pParty->CreateDefaultParty(0); |
8161 PlayerCreationUI_Initialize(); | 8161 PlayerCreationUI_Initialize(); |
8162 if ( PlayerCreationUI_Loop() ) | 8162 if ( PlayerCreationUI_Loop() ) |
8163 { | 8163 { |
8164 DeleteCCharFont(); | 8164 DeleteCCharFont(); |
8210 pMouse->Activate(1); | 8210 pMouse->Activate(1); |
8211 | 8211 |
8212 break; | 8212 break; |
8213 } | 8213 } |
8214 _chdir("..\\"); | 8214 _chdir("..\\"); |
8215 strcpy(pCurrentMapName, ofn.lpstrFileTitle); | 8215 strcpy(pCurrentMapName.data(), ofn.lpstrFileTitle); |
8216 pMouse->Activate(1); | 8216 pMouse->Activate(1); |
8217 } | 8217 } |
8218 //LABEL_48: | 8218 //LABEL_48: |
8219 pGame->Loop(); | 8219 pGame->Loop(); |
8220 LABEL_49: | 8220 LABEL_49: |
8304 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename)) | 8304 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename)) |
8305 dword_6BE368_debug_settings_2 |= 8; | 8305 dword_6BE368_debug_settings_2 |= 8; |
8306 | 8306 |
8307 wchar_t pStartingMapNameW[1024]; | 8307 wchar_t pStartingMapNameW[1024]; |
8308 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename); | 8308 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename); |
8309 sprintf(pStartingMapName, "%S", pStartingMapNameW); | 8309 sprintf(pStartingMapName.data(), "%S", pStartingMapNameW); |
8310 | 8310 |
8311 v9 = 0; | 8311 v9 = 0; |
8312 if ( strlen(pStartingMapName) ) | 8312 if ( strlen(pStartingMapName.data()) ) |
8313 { | 8313 { |
8314 do | 8314 do |
8315 { | 8315 { |
8316 if ( pStartingMapName[v9] == 32 ) | 8316 if ( pStartingMapName[v9] == 32 ) |
8317 pStartingMapName[v9] = 0; | 8317 pStartingMapName[v9] = 0; |
8318 ++v9; | 8318 ++v9; |
8319 v2 = strlen(pStartingMapName); | 8319 v2 = strlen(pStartingMapName.data()); |
8320 } | 8320 } |
8321 while ( v9 < v2 ); | 8321 while ( v9 < v2 ); |
8322 } | 8322 } |
8323 | 8323 |
8324 pOutdoorCamera = new OutdoorCamera; | 8324 pOutdoorCamera = new OutdoorCamera; |
8353 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); | 8353 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); |
8354 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename); | 8354 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename); |
8355 | 8355 |
8356 wchar_t pDefaultSkyTextureW[1024]; | 8356 wchar_t pDefaultSkyTextureW[1024]; |
8357 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename); | 8357 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename); |
8358 sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW); | 8358 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW); |
8359 | 8359 |
8360 wchar_t pDefaultGroundTextureW[1024]; | 8360 wchar_t pDefaultGroundTextureW[1024]; |
8361 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename); | 8361 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename); |
8362 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW); | 8362 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW); |
8363 | 8363 |
8369 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2); | 8369 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2); |
8370 | 8370 |
8371 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667; | 8371 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667; |
8372 | 8372 |
8373 v3 = 0; | 8373 v3 = 0; |
8374 if ( strlen(pDefaultSkyTexture) ) | 8374 if ( strlen(pDefaultSkyTexture.data()) ) |
8375 { | 8375 { |
8376 do | 8376 do |
8377 { | 8377 { |
8378 if ( pDefaultSkyTexture[v3] == ' ' ) | 8378 if ( pDefaultSkyTexture[v3] == ' ' ) |
8379 pDefaultSkyTexture[v3] = 0; | 8379 pDefaultSkyTexture[v3] = 0; |
8380 ++v3; | 8380 ++v3; |
8381 } | 8381 } |
8382 while ( v3 < strlen(pDefaultSkyTexture) ); | 8382 while ( v3 < strlen(pDefaultSkyTexture.data()) ); |
8383 } | 8383 } |
8384 v4 = 0; | 8384 v4 = 0; |
8385 if ( strlen(pDefaultGroundTexture) ) | 8385 if ( strlen(pDefaultGroundTexture) ) |
8386 { | 8386 { |
8387 do | 8387 do |
8467 va_list va; // [sp+8h] [bp+8h]@1 | 8467 va_list va; // [sp+8h] [bp+8h]@1 |
8468 | 8468 |
8469 va_start(va, Format); | 8469 va_start(va, Format); |
8470 if ( !pRenderer->bWindowMode ) | 8470 if ( !pRenderer->bWindowMode ) |
8471 pRenderer->ChangeBetweenWinFullscreenModes(); | 8471 pRenderer->ChangeBetweenWinFullscreenModes(); |
8472 vsprintf(pTmpBuf, Format, va); | 8472 vsprintf(pTmpBuf.data(), Format, va); |
8473 if ( pMouse ) | 8473 if ( pMouse ) |
8474 pMouse->Activate(0); | 8474 pMouse->Activate(0); |
8475 ClipCursor(0); | 8475 ClipCursor(0); |
8476 MessageBoxA(0, pTmpBuf, "Error", 0x30u); | 8476 MessageBoxA(0, pTmpBuf.data(), "Error", 0x30u); |
8477 Game_DeinitializeAndTerminate(1); | 8477 Game_DeinitializeAndTerminate(1); |
8478 } | 8478 } |
8479 | 8479 |
8480 //----- (00466C40) -------------------------------------------------------- | 8480 //----- (00466C40) -------------------------------------------------------- |
8481 const wchar_t *MENU_STATE_to_string(MENU_STATE m) | 8481 const wchar_t *MENU_STATE_to_string(MENU_STATE m) |
8649 a1.uFrameHeight -= 12; | 8649 a1.uFrameHeight -= 12; |
8650 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | 8650 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; |
8651 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | 8651 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; |
8652 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | 8652 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; |
8653 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | 8653 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
8654 sprintf(pTmpBuf, format_4E2D80, v2, v1); | 8654 sprintf(pTmpBuf.data(), format_4E2D80, v2, v1); |
8655 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); | 8655 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u); |
8656 a1.DrawText( | 8656 a1.DrawText( |
8657 pFontSmallnum, | 8657 pFontSmallnum, |
8658 1, | 8658 1, |
8659 LOBYTE(pFontCreate->uFontHeight) - 3, | 8659 LOBYTE(pFontCreate->uFontHeight) - 3, |
8660 0, | 8660 0, |
9322 else | 9322 else |
9323 { | 9323 { |
9324 if ( pParty->pPickedItem.uItemID ) | 9324 if ( pParty->pPickedItem.uItemID ) |
9325 return 1; | 9325 return 1; |
9326 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName; | 9326 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName; |
9327 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24); | 9327 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v24); |
9328 ShowStatusBarString(pTmpBuf2, 2u); | 9328 ShowStatusBarString(pTmpBuf2.data(), 2u); |
9329 if ( v19->uItemID == 506 ) | 9329 if ( v19->uItemID == 506 ) |
9330 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); | 9330 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
9331 if ( v19->uItemID == 455 ) | 9331 if ( v19->uItemID == 455 ) |
9332 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); | 9332 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
9333 if ( !pParty->AddItem(v19) ) | 9333 if ( !pParty->AddItem(v19) ) |
9363 { | 9363 { |
9364 v16 = pNPCStats->pCatchPhrases[v15]; | 9364 v16 = pNPCStats->pCatchPhrases[v15]; |
9365 if ( v16 ) | 9365 if ( v16 ) |
9366 { | 9366 { |
9367 pParty->uFlags |= 2u; | 9367 pParty->uFlags |= 2u; |
9368 strcpy(byte_5B0938, v16); | 9368 strcpy(byte_5B0938.data(), v16); |
9369 sub_4451A8_press_any_key(0, 0, 0); | 9369 sub_4451A8_press_any_key(0, 0, 0); |
9370 } | 9370 } |
9371 } | 9371 } |
9372 } | 9372 } |
9373 } | 9373 } |
9775 if ( !v0 ) | 9775 if ( !v0 ) |
9776 return 0; | 9776 return 0; |
9777 LABEL_18: | 9777 LABEL_18: |
9778 if ( !((unsigned __int8)(v11 ^ v12) | v10) ) | 9778 if ( !((unsigned __int8)(v11 ^ v12) | v10) ) |
9779 { | 9779 { |
9780 v14 = dword_720020_zvalues; | 9780 v14 = dword_720020_zvalues.data(); |
9781 v15 = 1; | 9781 v15 = 1; |
9782 do | 9782 do |
9783 { | 9783 { |
9784 for ( i = v15; i < v32; ++i ) | 9784 for ( i = v15; i < v32; ++i ) |
9785 { | 9785 { |
9920 if ( pParty->vPosition.x < -22528 | 9920 if ( pParty->vPosition.x < -22528 |
9921 || pParty->vPosition.x > 22528 | 9921 || pParty->vPosition.x > 22528 |
9922 || pParty->vPosition.y < -22528 | 9922 || pParty->vPosition.y < -22528 |
9923 || pParty->vPosition.y > 22528 ) | 9923 || pParty->vPosition.y > 22528 ) |
9924 { | 9924 { |
9925 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | 9925 strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data()); |
9926 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 32); | 9926 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 32); |
9927 if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 ) | 9927 if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 ) |
9928 { | 9928 { |
9929 if ( pParty->vPosition.x < -22528 ) | 9929 if ( pParty->vPosition.x < -22528 ) |
9930 pParty->vPosition.x = -22528; | 9930 pParty->vPosition.x = -22528; |