comparison UIPartyCreation.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 8b3e7d5ba069
children fac7751b2dc9
comparison
equal deleted inserted replaced
1204:832f09144726 1205:8c02e6f74b29
109 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles; 109 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles;
110 110
111 for (uint i = 0; i < 4; ++i) 111 for (uint i = 0; i < 4; ++i)
112 for (uint j = 0; j < 56; ++j) 112 for (uint j = 0; j < 56; ++j)
113 { 113 {
114 sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1); 114 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
115 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); 115 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
116 } 116 }
117 117
118 pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE); 118 pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE);
119 pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE); 119 pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE);
120 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); 120 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
135 Texture **v4; // ebx@1 135 Texture **v4; // ebx@1
136 int v5; // esi@2 136 int v5; // esi@2
137 137
138 result = 0; 138 result = 0;
139 v3 = &pPlayerPortraitsNames[a2]; 139 v3 = &pPlayerPortraitsNames[a2];
140 v4 = pTextures_PlayerFaces[a1]; 140 v4 = pTextures_PlayerFaces[a1].data();
141 do 141 do
142 { 142 {
143 v5 = result + 1; 143 v5 = result + 1;
144 sprintf(pTmpBuf, "%s%02d", *v3, result + 1); 144 sprintf(pTmpBuf.data(), "%s%02d", *v3, result + 1);
145 pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2); 145 pIcons_LOD->ReloadTexture(*v4, pTmpBuf.data(), 2);
146 result = v5; 146 result = v5;
147 ++v4; 147 ++v4;
148 } 148 }
149 while ( v5 < 56 ); 149 while ( v5 < 56 );
150 return result; 150 return result;
307 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" 307 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
308 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" 308 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
309 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" 309 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
310 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" 310 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
311 }; 311 };
312 strcpy(pTmpBuf, uRaceName); 312 strcpy(pTmpBuf.data(), uRaceName);
313 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf, 130, 0);//Race Name 313 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name
314 314
315 pTextCenter = pFontCreate->AlignText_Center(150, pText); 315 pTextCenter = pFontCreate->AlignText_Center(150, pText);
316 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills 316 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills
317 317
318 uStatLevel = player->GetActualMight(); 318 uStatLevel = player->GetActualMight();
319 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might" 319 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
320 pStatColor = player->GetStatColor(0); 320 pStatColor = player->GetStatColor(0);
321 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf, 0, 0, 0); 321 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
322 322
323 uStatLevel = player->GetActualIntelligence(); 323 uStatLevel = player->GetActualIntelligence();
324 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect" 324 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
325 pStatColor = player->GetStatColor(1); 325 pStatColor = player->GetStatColor(1);
326 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 326 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
327 327
328 uStatLevel = player->GetActualWillpower(); 328 uStatLevel = player->GetActualWillpower();
329 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality" 329 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
330 pStatColor = player->GetStatColor(2); 330 pStatColor = player->GetStatColor(2);
331 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 331 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
332 332
333 uStatLevel = player->GetActualEndurance(); 333 uStatLevel = player->GetActualEndurance();
334 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance" 334 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
335 pStatColor = player->GetStatColor(3); 335 pStatColor = player->GetStatColor(3);
336 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 336 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
337 337
338 uStatLevel = player->GetActualAccuracy(); 338 uStatLevel = player->GetActualAccuracy();
339 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy" 339 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
340 pStatColor = player->GetStatColor(4); 340 pStatColor = player->GetStatColor(4);
341 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 341 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
342 342
343 uStatLevel = player->GetActualSpeed(); 343 uStatLevel = player->GetActualSpeed();
344 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed" 344 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
345 pStatColor = player->GetStatColor(5); 345 pStatColor = player->GetStatColor(5);
346 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 346 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
347 347
348 uStatLevel = player->GetActualLuck(); 348 uStatLevel = player->GetActualLuck();
349 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck" 349 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
350 pStatColor = player->GetStatColor(6); 350 pStatColor = player->GetStatColor(6);
351 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); 351 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
352 352
353 353
354 pSkillsType = player->GetSkillIdxByOrder(0); 354 pSkillsType = player->GetSkillIdxByOrder(0);
355 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 355 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
356 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 356 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
357 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); 357 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
358 358
359 pSkillsType = player->GetSkillIdxByOrder(1); 359 pSkillsType = player->GetSkillIdxByOrder(1);
360 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 360 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
361 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 361 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf, 0, 0, 0); 362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
363 363
364 pSkillsType = player->GetSkillIdxByOrder(2); 364 pSkillsType = player->GetSkillIdxByOrder(2);
365 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 365 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
366 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 366 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
367 pColorText = uColorGreen; 367 pColorText = uColorGreen;
368 if ( (signed int)pSkillsType >= 37 ) 368 if ( (signed int)pSkillsType >= 37 )
369 pColorText = uColorTeal; 369 pColorText = uColorTeal;
370 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0); 370 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
371 371
372 pSkillsType = player->GetSkillIdxByOrder(3); 372 pSkillsType = player->GetSkillIdxByOrder(3);
373 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 373 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
374 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 374 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
375 pColorText = uColorGreen; 375 pColorText = uColorGreen;
376 if ( (signed int)pSkillsType >= 37 ) 376 if ( (signed int)pSkillsType >= 37 )
377 pColorText = uColorTeal; 377 pColorText = uColorTeal;
378 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0); 378 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
379 379
380 //v124 = (char *)v124 + 1; 380 //v124 = (char *)v124 + 1;
381 pIntervalX += 159; 381 pIntervalX += 159;
382 pX_Numbers -= 158; 382 pX_Numbers -= 158;
383 uX += 158; 383 uX += 158;
492 } 492 }
493 493
494 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" 494 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
495 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); 495 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
496 pBonusNum = PlayerCreation_ComputeAttributeBonus(); 496 pBonusNum = PlayerCreation_ComputeAttributeBonus();
497 sprintf(pTmpBuf, "%d", pBonusNum); 497 sprintf(pTmpBuf.data(), "%d", pBonusNum);
498 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf); 498 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
499 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0); 499 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf.data(), 0, 0, 0);
500 if ( GameUI_Footer_TimeLeft > GetTickCount() ) 500 if ( GameUI_Footer_TimeLeft > GetTickCount() )
501 { 501 {
502 pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points." 502 pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
503 if ( pBonusNum < 0 ) 503 if ( pBonusNum < 0 )
504 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." 504 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
554 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); 554 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE);
555 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); 555 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE);
556 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); 556 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
557 for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture 557 for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture
558 { 558 {
559 sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]); 559 sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]);
560 v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); 560 v1 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
561 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1]; 561 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1];
562 562
563 } 563 }
564 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); 564 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
565 pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE); 565 pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE);
567 pTexture_pressrigh = pIcons_LOD->LoadTexturePtr("presrigh", TEXTURE_16BIT_PALETTE); 567 pTexture_pressrigh = pIcons_LOD->LoadTexturePtr("presrigh", TEXTURE_16BIT_PALETTE);
568 pTexture_presleft = pIcons_LOD->LoadTexturePtr("presleft", TEXTURE_16BIT_PALETTE); 568 pTexture_presleft = pIcons_LOD->LoadTexturePtr("presleft", TEXTURE_16BIT_PALETTE);
569 uControlParam = 1; 569 uControlParam = 1;
570 do 570 do
571 { 571 {
572 sprintf(pTmpBuf, "arrowl%d", uControlParam); 572 sprintf(pTmpBuf.data(), "arrowl%d", uControlParam);
573 pTextures_arrowl[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); 573 pTextures_arrowl[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
574 574
575 sprintf(pTmpBuf, "arrowr%d", uControlParam); 575 sprintf(pTmpBuf.data(), "arrowr%d", uControlParam);
576 pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); 576 pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
577 } 577 }
578 while ( ++uControlParam < 20 ); 578 while ( ++uControlParam < 20 );
579 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 579 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
580 uControlParama = 0; 580 uControlParama = 0;
581 uXa = 8; 581 uXa = 8;