comparison mm7_6.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 0dbf6c4dd029
children ab6560001f5b
comparison
equal deleted inserted replaced
1204:832f09144726 1205:8c02e6f74b29
1277 { 1277 {
1278 Dst.Reset(); 1278 Dst.Reset();
1279 Dst.uItemID = pActor->uCarriedItemID; 1279 Dst.uItemID = pActor->uCarriedItemID;
1280 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; 1280 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
1281 if ( v14 ) 1281 if ( v14 )
1282 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); 1282 sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[490], v14, v9);
1283 else 1283 else
1284 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); 1284 sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[471], v9);
1285 ShowStatusBarString(pTmpBuf2, 2u); 1285 ShowStatusBarString(pTmpBuf2.data(), 2u);
1286 v4 = Dst.uItemID; 1286 v4 = Dst.uItemID;
1287 v5 = Dst.uItemID; 1287 v5 = Dst.uItemID;
1288 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) 1288 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 )
1289 { 1289 {
1290 v5 = Dst.uItemID; 1290 v5 = Dst.uItemID;
1327 { 1327 {
1328 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); 1328 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst));
1329 pActor->array_000234[3].Reset(); 1329 pActor->array_000234[3].Reset();
1330 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; 1330 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
1331 if ( v14 ) 1331 if ( v14 )
1332 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); 1332 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11);
1333 else 1333 else
1334 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); 1334 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11);
1335 ShowStatusBarString(pTmpBuf2, 2u); 1335 ShowStatusBarString(pTmpBuf2.data(), 2u);
1336 if ( !pParty->AddItem(&Dst) ) 1336 if ( !pParty->AddItem(&Dst) )
1337 pParty->SetHoldingItem(&Dst); 1337 pParty->SetHoldingItem(&Dst);
1338 v13 = 1; 1338 v13 = 1;
1339 } 1339 }
1340 goto LABEL_44; 1340 goto LABEL_44;
1346 goto LABEL_45; 1346 goto LABEL_45;
1347 } 1347 }
1348 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); 1348 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst);
1349 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; 1349 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
1350 if ( v14 ) 1350 if ( v14 )
1351 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); 1351 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);
1352 else 1352 else
1353 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); 1353 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);
1354 ShowStatusBarString(pTmpBuf2, 2u); 1354 ShowStatusBarString(pTmpBuf2.data(), 2u);
1355 v8 = pParty; 1355 v8 = pParty;
1356 if ( !pParty->AddItem(&Dst) ) 1356 if ( !pParty->AddItem(&Dst) )
1357 pParty->SetHoldingItem(&Dst); 1357 pParty->SetHoldingItem(&Dst);
1358 v13 = 1; 1358 v13 = 1;
1359 LABEL_45: 1359 LABEL_45:
3791 pCastSpell->spellnum = 0; 3791 pCastSpell->spellnum = 0;
3792 continue; 3792 continue;
3793 } 3793 }
3794 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3794 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3795 break; 3795 break;
3796 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); 3796 auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
3797 v700.z = 0; 3797 v700.z = 0;
3798 v700.y = 0; 3798 v700.y = 0;
3799 v700.x = 0; 3799 v700.x = 0;
3800 pSpellSprite.stru_24.Reset(); 3800 pSpellSprite.stru_24.Reset();
3801 pSpellSprite.spell_id = pCastSpell->spellnum; 3801 pSpellSprite.spell_id = pCastSpell->spellnum;
4496 break; 4496 break;
4497 } 4497 }
4498 case SPELL_WATER_LLOYDS_BEACON: 4498 case SPELL_WATER_LLOYDS_BEACON:
4499 { 4499 {
4500 LODWORD(v733) = 604800 * v2; 4500 LODWORD(v733) = 604800 * v2;
4501 if ( !_stricmp(pCurrentMapName, "d05.blv") ) 4501 if ( !_stricmp(pCurrentMapName.data(), "d05.blv") )
4502 { 4502 {
4503 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed 4503 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
4504 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); 4504 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4505 pCastSpell->spellnum = 0; 4505 pCastSpell->spellnum = 0;
4506 continue; 4506 continue;
4763 LODWORD(v733) = 60 * (v2 + 3); 4763 LODWORD(v733) = 60 * (v2 + 3);
4764 else 4764 else
4765 LODWORD(v733) = 300 * v2 + 180; 4765 LODWORD(v733) = 300 * v2 + 180;
4766 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4766 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4767 break; 4767 break;
4768 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); 4768 auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
4769 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); 4769 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
4770 ++pSpellSprite.uType; 4770 ++pSpellSprite.uType;
4771 pSpellSprite.stru_24.Reset(); 4771 pSpellSprite.stru_24.Reset();
4772 pSpellSprite.spell_id = pCastSpell->spellnum; 4772 pSpellSprite.spell_id = pCastSpell->spellnum;
4773 pSpellSprite.spell_level = v2; 4773 pSpellSprite.spell_level = v2;
5068 { 5068 {
5069 v675 = _v733; 5069 v675 = _v733;
5070 if (v683.uItemID) 5070 if (v683.uItemID)
5071 { 5071 {
5072 v422 = v683.GetDisplayName(); 5072 v422 = v683.GetDisplayName();
5073 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); 5073 sprintf(pTmpBuf2.data(), "(%s), and %d gold", v422, v675);
5074 5074
5075 } 5075 }
5076 else 5076 else
5077 { 5077 {
5078 v664 = "%d gold"; 5078 v664 = "%d gold";
5079 sprintf(pTmpBuf2, v664, v675); 5079 sprintf(pTmpBuf2.data(), v664, v675);
5080 } 5080 }
5081 } 5081 }
5082 else 5082 else
5083 { 5083 {
5084 if (v683.uItemID) 5084 if (v683.uItemID)
5085 { 5085 {
5086 const char *_v675 = v683.GetDisplayName(); 5086 const char *_v675 = v683.GetDisplayName();
5087 v664 = "(%s)"; 5087 v664 = "(%s)";
5088 sprintf(pTmpBuf2, v664, _v675); 5088 sprintf(pTmpBuf2.data(), v664, _v675);
5089 } 5089 }
5090 else 5090 else
5091 { 5091 {
5092 strcpy(pTmpBuf2, "nothing"); 5092 strcpy(pTmpBuf2.data(), "nothing");
5093 ShowStatusBarString(pTmpBuf2, 2u); 5093 ShowStatusBarString(pTmpBuf2.data(), 2u);
5094 } 5094 }
5095 } 5095 }
5096 ShowStatusBarString(pTmpBuf2, 2u); 5096 ShowStatusBarString(pTmpBuf2.data(), 2u);
5097 pSpellSprite.stru_24.Reset(); 5097 pSpellSprite.stru_24.Reset();
5098 pSpellSprite.spell_id = pCastSpell->spellnum; 5098 pSpellSprite.spell_id = pCastSpell->spellnum;
5099 pSpellSprite.spell_level = v2; 5099 pSpellSprite.spell_level = v2;
5100 pSpellSprite.spell_skill = v731; 5100 pSpellSprite.spell_skill = v731;
5101 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); 5101 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
5233 amount = 300 * v2; 5233 amount = 300 * v2;
5234 else 5234 else
5235 amount = 180 * v2; 5235 amount = 180 * v2;
5236 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 5236 if ( !pPlayer->CanCastSpell(uRequiredMana) )
5237 break; 5237 break;
5238 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); 5238 auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
5239 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); 5239 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
5240 ++pSpellSprite.uType; 5240 ++pSpellSprite.uType;
5241 pSpellSprite.stru_24.Reset(); 5241 pSpellSprite.stru_24.Reset();
5242 pSpellSprite.spell_id = pCastSpell->spellnum; 5242 pSpellSprite.spell_id = pCastSpell->spellnum;
5243 pSpellSprite.spell_level = v2; 5243 pSpellSprite.spell_level = v2;
5326 party_finds_gold(*((int *)v449 + 3), 0); 5326 party_finds_gold(*((int *)v449 + 3), 0);
5327 viewparams->bRedrawGameUI = 1; 5327 viewparams->bRedrawGameUI = 1;
5328 } 5328 }
5329 else 5329 else
5330 { 5330 {
5331 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); 5331 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
5332 ShowStatusBarString(pTmpBuf2, 2u); 5332 ShowStatusBarString(pTmpBuf2.data(), 2u);
5333 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) ) 5333 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) )
5334 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); 5334 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24);
5335 } 5335 }
5336 SpriteObject::OnInteraction(v445); 5336 SpriteObject::OnInteraction(v445);
5337 } 5337 }
5627 sRecoveryTime -= v2; 5627 sRecoveryTime -= v2;
5628 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 5628 if ( !pPlayer->CanCastSpell(uRequiredMana) )
5629 break; 5629 break;
5630 5630
5631 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); 5631 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u);
5632 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); 5632 v505 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
5633 ++pSpellSprite.uType; 5633 ++pSpellSprite.uType;
5634 //signed int _v733 = v505; 5634 //signed int _v733 = v505;
5635 v688.x = 0; 5635 v688.x = 0;
5636 v688.y = 0; 5636 v688.y = 0;
5637 v688.z = 0; 5637 v688.z = 0;
5747 pCastSpell->spellnum = 0; 5747 pCastSpell->spellnum = 0;
5748 continue; 5748 continue;
5749 } 5749 }
5750 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 5750 if ( !pPlayer->CanCastSpell(uRequiredMana) )
5751 break; 5751 break;
5752 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); 5752 v531 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
5753 ++pSpellSprite.uType; 5753 ++pSpellSprite.uType;
5754 v694.x = 0; 5754 v694.x = 0;
5755 v694.y = 0; 5755 v694.y = 0;
5756 v694.z = 0; 5756 v694.z = 0;
5757 pSpellSprite.stru_24.Reset(); 5757 pSpellSprite.stru_24.Reset();
6284 { 6284 {
6285 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 6285 if ( !pPlayer->CanCastSpell(uRequiredMana) )
6286 break; 6286 break;
6287 pGame->GetIndoorCamera(); 6287 pGame->GetIndoorCamera();
6288 v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth(); 6288 v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth();
6289 signed int _v733 = sub_46A6AC((int)dword_50BF30, 100, v623); 6289 signed int _v733 = sub_46A6AC((int)dword_50BF30.data(), 100, v623);
6290 v707.x = 0; 6290 v707.x = 0;
6291 v707.y = 0; 6291 v707.y = 0;
6292 v707.z = 0; 6292 v707.z = 0;
6293 pSpellSprite.stru_24.Reset(); 6293 pSpellSprite.stru_24.Reset();
6294 pSpellSprite.spell_id = pCastSpell->spellnum; 6294 pSpellSprite.spell_id = pCastSpell->spellnum;
6927 while ( !v15 ); 6927 while ( !v15 );
6928 } 6928 }
6929 if ( v4 > 0 ) 6929 if ( v4 > 0 )
6930 { 6930 {
6931 v32 = 1; 6931 v32 = 1;
6932 v16 = (int)dword_50BC10; 6932 v16 = (int)dword_50BC10.data();
6933 do 6933 do
6934 { 6934 {
6935 for ( i = v32; i < v4; ++i ) 6935 for ( i = v32; i < v4; ++i )
6936 { 6936 {
6937 v17 = dword_50BC10[i]; 6937 v17 = dword_50BC10[i];
6950 { 6950 {
6951 v18 = v24; 6951 v18 = v24;
6952 v19 = v4; 6952 v19 = v4;
6953 do 6953 do
6954 { 6954 {
6955 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; 6955 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10.data() - (char *)v24].field_0 >> 3) & 0x1FFF;
6956 v18 += 4; 6956 v18 += 4;
6957 --v19; 6957 --v19;
6958 } 6958 }
6959 while ( v19 ); 6959 while ( v19 );
6960 } 6960 }
6990 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); 6990 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
6991 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); 6991 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
6992 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); 6992 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
6993 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); 6993 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
6994 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); 6994 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
6995 v1 = pIconIDs_Turn; 6995 v1 = pIconIDs_Turn.data();
6996 do 6996 do
6997 { 6997 {
6998 pIconsFrameTable->InitializeAnimation(*v1); 6998 pIconsFrameTable->InitializeAnimation(*v1);
6999 ++v1; 6999 ++v1;
7000 } 7000 }