Mercurial > mm7
diff _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 |
line wrap: on
line diff
--- a/_deleted.cpp Sat Sep 07 15:20:57 2013 +0200 +++ b/_deleted.cpp Sat Sep 07 20:05:20 2013 +0200 @@ -12276,6 +12276,75 @@ while ( v16 != 1 ); } } +//----- (00481EB7) -------------------------------------------------------- +void ResetPolygons() +{ + for (auto i = 0; i < pOutdoorCamera->uNumPolygons; ++i) + { + array_77EC08[i].prolly_head = nullptr; + array_77EC08[i].prolly_tail = nullptr; + + array_77EC08[i].flags = 0; + array_77EC08[i].field_32 = 0; + } +} +//----- (00466BE5) -------------------------------------------------------- +void Abortf(const char *Format, ...) +{ + va_list va; // [sp+8h] [bp+8h]@1 + + va_start(va, Format); + if ( !pRenderer->bWindowMode ) + pRenderer->ChangeBetweenWinFullscreenModes(); + vsprintf(pTmpBuf.data(), Format, va); + if ( pMouse ) + pMouse->Activate(0); + ClipCursor(0); + MessageBoxA(0, pTmpBuf.data(), "Error", 0x30u); + Game_DeinitializeAndTerminate(1); +} +//----- (00466B8C) -------------------------------------------------------- +int AbortWithError() +{ + if ( !aborting_app ) + { + ClipCursor(0); + aborting_app = 1; + if ( !pRenderer->bWindowMode ) + pRenderer->ChangeBetweenWinFullscreenModes(); + if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 ) + SaveGame(1, 0); // "Internal Error" + // "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?" + Game_DeinitializeAndTerminate(1); + } + return 0; +} + +//----- (0046271C) -------------------------------------------------------- +void CreateDefaultBLVLevel() +{ + ofn.lStructSize = 0x4Cu; + ofn.hwndOwner = hWnd; + ofn.hInstance = 0; + ofn.lpstrFilter = "Indoor BLV Files (*.blv)"; + ofn.lpstrCustomFilter = 0; + ofn.nMaxCustFilter = 0; + ofn.nFilterIndex = 0; + ofn.lpstrFile = 0; + ofn.nMaxFile = 260; + ofn.nMaxFileTitle = 512; + ofn.lpstrInitialDir = "levels"; + ofn.lpstrTitle = "Might and MagicŪ VII - Load Which Level?"; + ofn.Flags = 4; + ofn.nFileOffset = 0; + ofn.nFileExtension = 0; + ofn.lpstrDefExt = "blv"; + ofn.lCustData = 0; + ofn.lpfnHook = 0; + ofn.lpTemplateName = 0; + ofn.lpstrFileTitle = pTmpBuf.data(); +} + const wchar_t *UIMessage2String(UIMessageType msg) { #define CASE(xxx) case xxx: swprintf(b, wcslen(L"%03X/%s"), L"%03X/%s", msg, L#xxx); return b;