Mercurial > mm7
comparison _deleted.cpp @ 1545:c4ab816fcc5e
assert, Abortf, AbortWithError -> Assert, Error
refactors here and there
author | Nomad |
---|---|
date | Sat, 07 Sep 2013 20:05:20 +0200 |
parents | 499761153844 |
children | 2d9c8f609a3c |
comparison
equal
deleted
inserted
replaced
1544:499761153844 | 1545:c4ab816fcc5e |
---|---|
12274 v2 = v16 - 1; | 12274 v2 = v16 - 1; |
12275 } | 12275 } |
12276 while ( v16 != 1 ); | 12276 while ( v16 != 1 ); |
12277 } | 12277 } |
12278 } | 12278 } |
12279 //----- (00481EB7) -------------------------------------------------------- | |
12280 void ResetPolygons() | |
12281 { | |
12282 for (auto i = 0; i < pOutdoorCamera->uNumPolygons; ++i) | |
12283 { | |
12284 array_77EC08[i].prolly_head = nullptr; | |
12285 array_77EC08[i].prolly_tail = nullptr; | |
12286 | |
12287 array_77EC08[i].flags = 0; | |
12288 array_77EC08[i].field_32 = 0; | |
12289 } | |
12290 } | |
12291 //----- (00466BE5) -------------------------------------------------------- | |
12292 void Abortf(const char *Format, ...) | |
12293 { | |
12294 va_list va; // [sp+8h] [bp+8h]@1 | |
12295 | |
12296 va_start(va, Format); | |
12297 if ( !pRenderer->bWindowMode ) | |
12298 pRenderer->ChangeBetweenWinFullscreenModes(); | |
12299 vsprintf(pTmpBuf.data(), Format, va); | |
12300 if ( pMouse ) | |
12301 pMouse->Activate(0); | |
12302 ClipCursor(0); | |
12303 MessageBoxA(0, pTmpBuf.data(), "Error", 0x30u); | |
12304 Game_DeinitializeAndTerminate(1); | |
12305 } | |
12306 //----- (00466B8C) -------------------------------------------------------- | |
12307 int AbortWithError() | |
12308 { | |
12309 if ( !aborting_app ) | |
12310 { | |
12311 ClipCursor(0); | |
12312 aborting_app = 1; | |
12313 if ( !pRenderer->bWindowMode ) | |
12314 pRenderer->ChangeBetweenWinFullscreenModes(); | |
12315 if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 ) | |
12316 SaveGame(1, 0); // "Internal Error" | |
12317 // "Might and Magic VII has detected an internal error and will be forced to close. Would you like us to autosave your game before closing?" | |
12318 Game_DeinitializeAndTerminate(1); | |
12319 } | |
12320 return 0; | |
12321 } | |
12322 | |
12323 //----- (0046271C) -------------------------------------------------------- | |
12324 void CreateDefaultBLVLevel() | |
12325 { | |
12326 ofn.lStructSize = 0x4Cu; | |
12327 ofn.hwndOwner = hWnd; | |
12328 ofn.hInstance = 0; | |
12329 ofn.lpstrFilter = "Indoor BLV Files (*.blv)"; | |
12330 ofn.lpstrCustomFilter = 0; | |
12331 ofn.nMaxCustFilter = 0; | |
12332 ofn.nFilterIndex = 0; | |
12333 ofn.lpstrFile = 0; | |
12334 ofn.nMaxFile = 260; | |
12335 ofn.nMaxFileTitle = 512; | |
12336 ofn.lpstrInitialDir = "levels"; | |
12337 ofn.lpstrTitle = "Might and MagicŪ VII - Load Which Level?"; | |
12338 ofn.Flags = 4; | |
12339 ofn.nFileOffset = 0; | |
12340 ofn.nFileExtension = 0; | |
12341 ofn.lpstrDefExt = "blv"; | |
12342 ofn.lCustData = 0; | |
12343 ofn.lpfnHook = 0; | |
12344 ofn.lpTemplateName = 0; | |
12345 ofn.lpstrFileTitle = pTmpBuf.data(); | |
12346 } | |
12347 | |
12279 const wchar_t *UIMessage2String(UIMessageType msg) | 12348 const wchar_t *UIMessage2String(UIMessageType msg) |
12280 { | 12349 { |
12281 #define CASE(xxx) case xxx: swprintf(b, wcslen(L"%03X/%s"), L"%03X/%s", msg, L#xxx); return b; | 12350 #define CASE(xxx) case xxx: swprintf(b, wcslen(L"%03X/%s"), L"%03X/%s", msg, L#xxx); return b; |
12282 static wchar_t b[256]; // bad for threads | 12351 static wchar_t b[256]; // bad for threads |
12283 switch (msg) | 12352 switch (msg) |