diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 54570c4f6..950bf6000 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -983,9 +983,9 @@ if( APPLE ) endif() if( WIN32 ) - set( INSTALL_PATH . CACHE STRING "Directory where the demolition executable will be placed during install." ) + set( INSTALL_PATH . CACHE STRING "Directory where the executable will be placed during install." ) else() - set( INSTALL_PATH bin CACHE STRING "Directory where the demolition executable will be placed during install." ) + set( INSTALL_PATH bin CACHE STRING "Directory where the executable will be placed during install." ) endif() install(TARGETS demolition DESTINATION ${INSTALL_PATH} @@ -1008,6 +1008,8 @@ source_group("Code\\Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/commo source_group("Code\\Rendering" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/.+") source_group("Code\\Rendering\\GL_Load" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/gl_load/.+") source_group("Code\\Rendering\\GL\\System" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/gl/system.+") +source_group("Platform" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/platform/.+") +source_group("Platform\\Win32" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/platform/win32/.+") source_group("Utility\\Smackerdec" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/smackerdec/.+") source_group("Utility\\Smackerdec\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libsmackerdec/include/.+") source_group("Utility\\Smackerdec\\Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libsmackerdec/src/.+") diff --git a/source/common/console/c_console.cpp b/source/common/console/c_console.cpp index 024cc2d27..237b64ec0 100644 --- a/source/common/console/c_console.cpp +++ b/source/common/console/c_console.cpp @@ -1051,7 +1051,7 @@ void C_Ticker() lasttic = consoletic; NotifyStrings.Tick(); - if (GUICapture & 1) + if (ConsoleState == c_down) { D_ProcessEvents(); } diff --git a/source/common/menu/menu.cpp b/source/common/menu/menu.cpp index cfd6ba24e..3fe09c1c3 100644 --- a/source/common/menu/menu.cpp +++ b/source/common/menu/menu.cpp @@ -839,7 +839,7 @@ void M_Ticker (void) if (DMenu::MenuTime & 3) return; if (DMenu::CurrentMenu != NULL && menuactive != MENU_Off) { - D_ProcessEvents(); // The main loop is blocked when the menu is open and cannot dispatch the events. + if (DMenu::MenuTime != 0) D_ProcessEvents(); // The main loop is blocked when the menu is open and cannot dispatch the events. if (transition.previous) transition.previous->Ticker(); if (DMenu::CurrentMenu == nullptr) return; // In case one of the sub-screens has closed the menu. DMenu::CurrentMenu->Ticker(); diff --git a/source/exhumed/src/d_menu.cpp b/source/exhumed/src/d_menu.cpp index 2d0da898a..db313ffa2 100644 --- a/source/exhumed/src/d_menu.cpp +++ b/source/exhumed/src/d_menu.cpp @@ -52,6 +52,20 @@ int menu_Menu(int nVal) M_SetMenu(NAME_MainMenu); while (M_Active()) { + auto nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; + int dword_9AB5F = ((int)totalclock / 16) & 3; + + videoClearScreen(blackcol); + + overwritesprite(160, 100, kSkullHead, 32, 3, kPalNormal); + overwritesprite(161, 130, kSkullJaw, 32, 3, kPalNormal); + + overwritesprite(160, 40, nLogoTile, 32, 3, kPalNormal); + + // draw the fire urn/lamp thingies + overwritesprite(50, 150, kTile3512 + dword_9AB5F, 32, 3, kPalNormal); + overwritesprite(270, 150, kTile3512 + ((dword_9AB5F + 2) & 3), 32, 3, kPalNormal); + HandleAsync(); videoNextPage(); @@ -190,8 +204,8 @@ void GameInterface::DrawCenteredTextScreen(const DVector2& origin, const char* t { int height = 11; - auto lines = FString(text).Split("\n"); - int y = 100 - (height * lines.Size() / 2); + auto lines = FString(text).MakeUpper().Split("\n"); + int y = position - (height * lines.Size() / 2); for (auto& l : lines) { int width = MyGetStringWidth(l); @@ -201,6 +215,11 @@ void GameInterface::DrawCenteredTextScreen(const DVector2& origin, const char* t } } +void GameInterface::DrawMenuCaption(const DVector2& origin, const char* text) +{ + DrawCenteredTextScreen(origin, text, 10, false); +} + END_PS_NS diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 77643912e..08846e7b2 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -81,8 +81,6 @@ BEGIN_PS_NS extern const char* s_buildRev; extern const char* s_buildTimestamp; -const char* AppProperName = APPNAME; -const char* AppTechnicalName = APPBASENAME; void FinishLevel(); diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index b5c311d7b..72346782e 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -285,7 +285,8 @@ struct GameInterface : ::GameInterface void StartGame(FGameStartup& gs) override; bool CanSave() override; FSavegameInfo GetSaveSig() override; - void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg); + void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg) override; + void DrawMenuCaption(const DVector2& origin, const char* text) override; FString statFPS() override; //GameStats getStats() override; diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index eb24cdd42..531e5f3db 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -338,7 +338,7 @@ void PlayLocalSound(short nSound, short nRate) // There is exactly one occurence in the entire game which alters the pitch. pASound->snd_channel = soundEngine->StartSound(SOURCE_Unattached, nullptr, nullptr, CHAN_BODY, CHANF_OVERLAP, nSound + 1, 1.f, ATTN_NONE, nullptr); - if (nRate) + if (nRate && pASound->snd_channel) { float ratefac = (11025 + nRate) / 11025.f; soundEngine->SetPitch(pASound->snd_channel, ratefac); diff --git a/source/glbackend/glbackend.h b/source/glbackend/glbackend.h index 5c17afbe9..0598a2254 100644 --- a/source/glbackend/glbackend.h +++ b/source/glbackend/glbackend.h @@ -256,6 +256,15 @@ public: { renderState.IndexBuffer = vb; } + void ClearBufferState() + { + SetVertexBuffer(nullptr, 0, 0); + SetIndexBuffer(nullptr); + // Invalidate the pointers as well to make sure that if another buffer with the same address is used it actually gets bound. + LastVertexBuffer = (IVertexBuffer*)~intptr_t(0); + LastIndexBuffer = (IIndexBuffer*)~intptr_t(0); + } + const VSMatrix &GetMatrix(int num) { return matrices[num]; diff --git a/source/glbackend/hw_draw2d.cpp b/source/glbackend/hw_draw2d.cpp index c9ec925d0..c16b0dece 100644 --- a/source/glbackend/hw_draw2d.cpp +++ b/source/glbackend/hw_draw2d.cpp @@ -118,6 +118,7 @@ void GLInstance::Draw2D(F2DDrawer *drawer) } F2DVertexBuffer vb; vb.UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size()); + assert(vb.GetBufferObjects().first && vb.GetBufferObjects().second); SetVertexBuffer(vb.GetBufferObjects().first, 0, 0); SetIndexBuffer(vb.GetBufferObjects().second); SetFadeDisable(true); @@ -210,8 +211,7 @@ void GLInstance::Draw2D(F2DDrawer *drawer) //state.SetScissor(-1, -1, -1, -1); //state.SetRenderStyle(STYLE_Translucent); - SetVertexBuffer(nullptr, 0, 0); - SetIndexBuffer(nullptr); + ClearBufferState(); UseColorOnly(false); //state.EnableBrightmap(true); //state.SetTextureMode(TM_NORMAL);