# HG changeset patch # User Ritor1 # Date 1431609381 -21600 # Node ID 44d9df75dc13d2c6b20138fec6e0000e979724ed # Parent 6ab1273bc507d893ea29ac7945959b4411b0dd85# Parent 91c75d202d30d3e37e69bda462fc412302b02304 Слияние diff -r 6ab1273bc507 -r 44d9df75dc13 Engine/Engine.cpp --- a/Engine/Engine.cpp Thu May 14 19:16:08 2015 +0600 +++ b/Engine/Engine.cpp Thu May 14 19:16:21 2015 +0600 @@ -2094,8 +2094,6 @@ //----- (00464479) -------------------------------------------------------- void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() { - int v0; // esi@9 - if (pMouse) pMouse->SetCursorBitmap("MICON1"); @@ -2113,13 +2111,15 @@ pSoundList->_4A9D79(0); uCurrentlyLoadedLevelType = LEVEL_null; pSpriteFrameTable->ResetSomeSpriteFlags(); - v0 = uNumVisibleWindows; pParty->armageddon_timer = 0; - while (v0 > 0) + + while (uNumVisibleWindows > 0) { - pWindowList[pVisibleWindowsIdxs[v0--] - 1]->Release(); - delete pWindowList[pVisibleWindowsIdxs[v0--] - 1]; - pWindowList[pVisibleWindowsIdxs[v0--] - 1] = nullptr; + pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 1]->Release(); + delete pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 1]; + pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 1] = nullptr; + + uNumVisibleWindows--; } } diff -r 6ab1273bc507 -r 44d9df75dc13 Engine/Graphics/Render.cpp --- a/Engine/Graphics/Render.cpp Thu May 14 19:16:08 2015 +0600 +++ b/Engine/Graphics/Render.cpp Thu May 14 19:16:21 2015 +0600 @@ -1250,28 +1250,49 @@ } } - for (int i = 0; i < 4; i++) - { - delete[] this->pAvailableDevices[i].pDriverName; - this->pAvailableDevices[i].pDriverName = nullptr; - - delete[] this->pAvailableDevices[i].pDeviceDesc; - this->pAvailableDevices[i].pDeviceDesc = nullptr; - - delete[] this->pAvailableDevices[i].pDDraw4DevDesc; - this->pAvailableDevices[i].pDDraw4DevDesc = nullptr; - - delete this->pAvailableDevices[i].pDirectDrawGUID; - this->pAvailableDevices[i].pDirectDrawGUID = nullptr; - - delete[] this->pAvailableDevices[i].pName; - this->pAvailableDevices[i].pName = nullptr; - - delete[] this->pAvailableDevices[i].pDescription; - this->pAvailableDevices[i].pDescription = nullptr; - - delete this->pAvailableDevices[i].pGUID; - this->pAvailableDevices[i].pGUID = nullptr; + for (int i = 0; i < 4; i++) + { + if (this->pAvailableDevices[i].pDriverName) + { + delete[] this->pAvailableDevices[i].pDriverName; + this->pAvailableDevices[i].pDriverName = nullptr; + } + + if (this->pAvailableDevices[i].pDeviceDesc) + { + delete[] this->pAvailableDevices[i].pDeviceDesc; + this->pAvailableDevices[i].pDeviceDesc = nullptr; + } + + if (this->pAvailableDevices[i].pDDraw4DevDesc) + { + delete[] this->pAvailableDevices[i].pDDraw4DevDesc; + this->pAvailableDevices[i].pDDraw4DevDesc = nullptr; + } + + if (this->pAvailableDevices[i].pDirectDrawGUID) + { + delete this->pAvailableDevices[i].pDirectDrawGUID; + this->pAvailableDevices[i].pDirectDrawGUID = nullptr; + } + + if (this->pAvailableDevices[i].pName) + { + delete[] this->pAvailableDevices[i].pName; + this->pAvailableDevices[i].pName = nullptr; + } + + if (this->pAvailableDevices[i].pDescription) + { + delete[] this->pAvailableDevices[i].pDescription; + this->pAvailableDevices[i].pDescription = nullptr; + } + + if (this->pAvailableDevices[i].pGUID) + { + delete this->pAvailableDevices[i].pGUID; + this->pAvailableDevices[i].pGUID = nullptr; + } } delete[] this->pAvailableDevices; diff -r 6ab1273bc507 -r 44d9df75dc13 Engine/Graphics/RenderStruct.h --- a/Engine/Graphics/RenderStruct.h Thu May 14 19:16:08 2015 +0600 +++ b/Engine/Graphics/RenderStruct.h Thu May 14 19:16:21 2015 +0600 @@ -105,6 +105,12 @@ #pragma pack(push, 1) struct RenderD3D__DevInfo { + inline RenderD3D__DevInfo(): + bIsDeviceCompatible(false), pName(nullptr), pDescription(nullptr), + pGUID(nullptr), uCaps(0), pDriverName(nullptr), pDeviceDesc(nullptr), + pDDraw4DevDesc(nullptr), pDirectDrawGUID(nullptr), uVideoMem(0) + {} + unsigned int bIsDeviceCompatible; char *pName; char *pDescription; diff -r 6ab1273bc507 -r 44d9df75dc13 Engine/Objects/Player.cpp --- a/Engine/Objects/Player.cpp Thu May 14 19:16:08 2015 +0600 +++ b/Engine/Objects/Player.cpp Thu May 14 19:16:21 2015 +0600 @@ -8118,7 +8118,7 @@ v34 = 5; player->PlaySound(SPEECH_50, 0); } - if (shotting_laser) + else if (shotting_laser) v34 = 7; else { diff -r 6ab1273bc507 -r 44d9df75dc13 GUI/UI/UIPopup.cpp --- a/GUI/UI/UIPopup.cpp Thu May 14 19:16:08 2015 +0600 +++ b/GUI/UI/UIPopup.cpp Thu May 14 19:16:21 2015 +0600 @@ -55,7 +55,7 @@ popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title); popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); - popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0); + popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, popup_window.uFrameY + popup_window.uFrameHeight, 0); } //----- (004151D9) --------------------------------------------------------