Mercurial > mm7
comparison mm7_1.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 | 1f92c110a4f2 |
children | ab6560001f5b |
comparison
equal
deleted
inserted
replaced
1204:832f09144726 | 1205:8c02e6f74b29 |
---|---|
381 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | 381 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; |
382 v19 = (unsigned int)v8 / 0x18; | 382 v19 = (unsigned int)v8 / 0x18; |
383 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | 383 v18 = (signed __int64)__PAIR__(v4, v5) % 60; |
384 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | 384 v17 = (signed __int64)__PAIR__(v6, v7) % 60; |
385 v9 = v8 % 24; | 385 v9 = v8 % 24; |
386 strcpy(pTmpBuf, "\r020"); | 386 strcpy(pTmpBuf.data(), "\r020"); |
387 if ( (unsigned int)v8 / 0x18 ) | 387 if ( (unsigned int)v8 / 0x18 ) |
388 { | 388 { |
389 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | 389 v10 = pGlobalTXT_LocalizationStrings[57]; // Days |
390 if ( v19 <= 1 ) | 390 if ( v19 <= 1 ) |
391 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | 391 v10 = pGlobalTXT_LocalizationStrings[56]; // Day |
392 sprintfex(pTmpBuf2, "%d %s ", (int)v19, v10); | 392 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v19, v10); |
393 strcat(pTmpBuf, pTmpBuf2); | 393 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
394 } | 394 } |
395 if ( v9 ) | 395 if ( v9 ) |
396 { | 396 { |
397 if ( v9 <= 1 ) | 397 if ( v9 <= 1 ) |
398 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | 398 v11 = pGlobalTXT_LocalizationStrings[109];// Hour |
399 else | 399 else |
400 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | 400 v11 = pGlobalTXT_LocalizationStrings[110];// Hours |
401 sprintfex(pTmpBuf2, "%d %s ", (int)v9, v11); | 401 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v9, v11); |
402 strcat(pTmpBuf, pTmpBuf2); | 402 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
403 } | 403 } |
404 if ( v17 && !v19 ) | 404 if ( v17 && !v19 ) |
405 { | 405 { |
406 if ( v17 <= 1 ) | 406 if ( v17 <= 1 ) |
407 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | 407 v12 = pGlobalTXT_LocalizationStrings[437];// Minute |
408 else | 408 else |
409 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | 409 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes |
410 sprintfex(pTmpBuf2, "%d %s ", (int)v17, v12); | 410 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v17, v12); |
411 strcat(pTmpBuf, pTmpBuf2); | 411 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
412 } | 412 } |
413 if ( v18 && !v9 ) | 413 if ( v18 && !v9 ) |
414 { | 414 { |
415 if ( v18 <= 1 ) | 415 if ( v18 <= 1 ) |
416 v13 = pGlobalTXT_LocalizationStrings[439];// Second | 416 v13 = pGlobalTXT_LocalizationStrings[439];// Second |
417 else | 417 else |
418 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | 418 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds |
419 sprintfex(pTmpBuf2, "%d %s ", (int)v18, v13); | 419 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v18, v13); |
420 strcat(pTmpBuf, pTmpBuf2); | 420 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
421 } | 421 } |
422 a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | 422 a1->DrawText(a2, 32, uY, 0, pTmpBuf.data(), 0, 0, 0); |
423 } | 423 } |
424 | 424 |
425 //----- (0041F54A) -------------------------------------------------------- | 425 //----- (0041F54A) -------------------------------------------------------- |
426 void __cdecl LoadActualSkyFrame() | 426 void __cdecl LoadActualSkyFrame() |
427 { | 427 { |
428 if ( pTexture_RestUI_CurrentSkyFrame ) | 428 if ( pTexture_RestUI_CurrentSkyFrame ) |
429 pTexture_RestUI_CurrentSkyFrame->Release(); | 429 pTexture_RestUI_CurrentSkyFrame->Release(); |
430 if ( pTexture_RestUI_CurrentHourglassFrame ) | 430 if ( pTexture_RestUI_CurrentHourglassFrame ) |
431 pTexture_RestUI_CurrentHourglassFrame->Release(); | 431 pTexture_RestUI_CurrentHourglassFrame->Release(); |
432 pIcons_LOD->SyncLoadedFilesCount(); | 432 pIcons_LOD->SyncLoadedFilesCount(); |
433 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | 433 sprintf(pTmpBuf.data(), "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); |
434 pTexture_RestUI_CurrentSkyFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); | 434 pTexture_RestUI_CurrentSkyFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); |
435 } | 435 } |
436 | 436 |
437 //----- (0041F5BE) -------------------------------------------------------- | 437 //----- (0041F5BE) -------------------------------------------------------- |
438 void __cdecl Sleep6Hours() | 438 void __cdecl Sleep6Hours() |
439 { | 439 { |
530 v4 = uNumGold; | 530 v4 = uNumGold; |
531 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | 531 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) |
532 { | 532 { |
533 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | 533 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) |
534 { | 534 { |
535 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | 535 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! |
536 } | 536 } |
537 else | 537 else |
538 { | 538 { |
539 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | 539 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) |
540 pTmpBuf2[0] = 0; | 540 pTmpBuf2[0] = 0; |
599 if ( v3 ) | 599 if ( v3 ) |
600 { | 600 { |
601 v3 = (signed int)(v4 * v3 / 100) / 100; | 601 v3 = (signed int)(v4 * v3 / 100) / 100; |
602 if ( v3 < 1 ) | 602 if ( v3 < 1 ) |
603 v3 = 1; | 603 v3 = 1; |
604 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | 604 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! |
605 } | 605 } |
606 else | 606 else |
607 { | 607 { |
608 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | 608 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! |
609 } | 609 } |
610 v2 = 0; | 610 v2 = 0; |
611 } | 611 } |
612 pParty->uNumGold += v4 - v3; | 612 pParty->uNumGold += v4 - v3; |
613 pUIAnim_Gold->uAnimTime = v2; | 613 pUIAnim_Gold->uAnimTime = v2; |
614 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | 614 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; |
615 if ( pTmpBuf2[0] ) | 615 if ( pTmpBuf2[0] ) |
616 ShowStatusBarString(pTmpBuf2, 2u); | 616 ShowStatusBarString(pTmpBuf2.data(), 2u); |
617 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | 617 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); |
618 } | 618 } |
619 | 619 |
620 //----- (00420E01) -------------------------------------------------------- | 620 //----- (00420E01) -------------------------------------------------------- |
621 void __cdecl OnChestLeftClick() | 621 void __cdecl OnChestLeftClick() |
921 party_finds_gold(v22->uSpecEnchantmentType, 0); | 921 party_finds_gold(v22->uSpecEnchantmentType, 0); |
922 viewparams->bRedrawGameUI = 1; | 922 viewparams->bRedrawGameUI = 1; |
923 } | 923 } |
924 else | 924 else |
925 { | 925 { |
926 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); | 926 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); |
927 ShowStatusBarString(pTmpBuf2, 2u); | 927 ShowStatusBarString(pTmpBuf2.data(), 2u); |
928 if ( v22->uItemID == 506 ) | 928 if ( v22->uItemID == 506 ) |
929 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); | 929 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
930 if ( v22->uItemID == 455 ) | 930 if ( v22->uItemID == 455 ) |
931 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); | 931 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
932 if ( !pParty->AddItem(v22) ) | 932 if ( !pParty->AddItem(v22) ) |
1082 { | 1082 { |
1083 v20 = pNPCStats->pCatchPhrases[v19]; | 1083 v20 = pNPCStats->pCatchPhrases[v19]; |
1084 if ( v20 ) | 1084 if ( v20 ) |
1085 { | 1085 { |
1086 pParty->uFlags |= 2u; | 1086 pParty->uFlags |= 2u; |
1087 strcpy(byte_5B0938, v20); | 1087 strcpy(byte_5B0938.data(), v20); |
1088 sub_4451A8_press_any_key(0, 0, 0); | 1088 sub_4451A8_press_any_key(0, 0, 0); |
1089 } | 1089 } |
1090 } | 1090 } |
1091 return; | 1091 return; |
1092 } | 1092 } |