comparison UI/UITransition.cpp @ 1545:c4ab816fcc5e

assert, Abortf, AbortWithError -> Assert, Error refactors here and there
author Nomad
date Sat, 07 Sep 2013 20:05:20 +0200
parents 7ef4b64f6329
children 79621dd04649 bae4ffd25a03
comparison
equal deleted inserted replaced
1544:499761153844 1545:c4ab816fcc5e
1 #ifdef _MSC_VER 1 #ifdef _MSC_VER
2 #define _CRT_SECURE_NO_WARNINGS 2 #define _CRT_SECURE_NO_WARNINGS
3 #endif 3 #endif
4 4
5 #include <assert.h>
6 #include <io.h> 5 #include <io.h>
7 6
8 #include "..\mm7_data.h" 7 #include "..\mm7_data.h"
9 #include "..\VideoPlayer.h" 8 #include "..\VideoPlayer.h"
10 #include "..\MapInfo.h" 9 #include "..\MapInfo.h"
61 switch (pParty->alignment) 60 switch (pParty->alignment)
62 { 61 {
63 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break; 62 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
64 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break; 63 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
65 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; 64 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
66 default: assert(false); 65 default: Error("Invalid alignment: %u", pParty->alignment);
67 } 66 }
68 67
69 v12 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 68 v12 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
70 v13 = pHouse_ExitPictures[exit_pic_id]; 69 v13 = pHouse_ExitPictures[exit_pic_id];
71 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v12]; 70 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v12];
127 switch (pParty->alignment) 126 switch (pParty->alignment)
128 { 127 {
129 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break; 128 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
130 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break; 129 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
131 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; 130 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
132 default: assert(false); 131 default: Error("Invalid alignment: %u", pParty->alignment);
133 } 132 }
134 133
135 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); 134 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
136 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE); 135 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
137 v1 = pMapStats->GetMapInfo(pCurrentMapName); 136 v1 = pMapStats->GetMapInfo(pCurrentMapName);
246 { 245 {
247 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?" 246 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
248 v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &v8, 0, 0)) / 2 + 101; 247 v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &v8, 0, 0)) / 2 + 101;
249 v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3); 248 v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3);
250 } 249 }
251 else assert(false); 250 else Error("Troubles in da house");
252 251
253 _unused_5B5924_is_travel_ui_drawn = true; 252 _unused_5B5924_is_travel_ui_drawn = true;
254 } 253 }