diff --git a/.appveyor.yml b/.appveyor.yml index 4bf214251..50ab5538f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,21 +8,24 @@ clone_depth: 10 image: - Visual Studio 2019 - - Visual Studio 2015 environment: matrix: - ARCH: x64 + CONFIG: Release - ARCH: Win32 + CONFIG: Release + - ARCH: x64 + CONFIG: Debug build_script: - md build - cd build - cmake -A %ARCH% -DPK3_QUIET_ZIPDIR=YES .. - - cmake --build . --config Release -- -maxcpucount -verbosity:minimal + - cmake --build . --config %CONFIG% -- -maxcpucount -verbosity:minimal after_build: - - set OUTPUT_DIR=%APPVEYOR_BUILD_FOLDER%\build\Release\ + - set OUTPUT_DIR=%APPVEYOR_BUILD_FOLDER%\build\%CONFIG%\ - 7z a ..\gzdoom.zip "%OUTPUT_DIR%gzdoom.exe" "%OUTPUT_DIR%*.pk3" artifacts: diff --git a/.travis.yml b/.travis.yml index d514c268f..48ce4cfdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,14 @@ matrix: env: - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9" + - os: windows + env: + - CMAKE_OPTIONS="-A Win32" + + - os: windows + env: + - CMAKE_OPTIONS="-A x64" + - os: linux compiler: gcc env: @@ -86,18 +94,31 @@ matrix: - libsdl2-dev - libgtk-3-dev + - os: linux + compiler: gcc + env: + - GCC_VERSION=9 + - CMAKE_OPTIONS="-DCMAKE_CXX_FLAGS=-Wno-implicit-fallthrough" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-9 + - libsdl2-dev + - os: linux compiler: clang env: - - CLANG_VERSION=7 + - CLANG_VERSION=8 - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -DDYN_OPENAL=NO -DDYN_SNDFILE=NO -DDYN_MPG123=NO -DDYN_FLUIDSYNTH=NO" addons: apt: sources: - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-7 + - llvm-toolchain-xenial-8 packages: - - clang-7 + - clang-8 - libsdl2-dev - libgme-dev - libopenal-dev @@ -106,14 +127,6 @@ matrix: - libfluidsynth-dev - libgtk-3-dev - - os: windows - env: - - CMAKE_OPTIONS="-A Win32" - - - os: windows - env: - - CMAKE_OPTIONS="-A x64" - before_install: - if [ -n "$GCC_VERSION" ]; then export CC="gcc-${GCC_VERSION}" CXX="g++-${GCC_VERSION}"; fi - if [ -n "$CLANG_VERSION" ]; then export CC="clang-${CLANG_VERSION}" CXX="clang++-${CLANG_VERSION}"; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index c14c24816..9e04684de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,9 +182,9 @@ if( MSVC ) # Function-level linking # Disable run-time type information if ( HAVE_VULKAN ) - set( ALL_C_FLAGS "/GF /Gy /GR- /DHAVE_VULKAN" ) + set( ALL_C_FLAGS "/GF /Gy /GR- /permissive- /DHAVE_VULKAN" ) else() - set( ALL_C_FLAGS "/GF /Gy /GR-" ) + set( ALL_C_FLAGS "/GF /Gy /GR- /permissive-" ) endif() # Use SSE 2 as minimum always as the true color drawers needs it for __vectorcall diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 2e312c4d9..d817f4e1b 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -224,16 +224,16 @@ Note: All fields default to false unless mentioned otherwise. ceilingplane_a = ; // Define the plane equation for the sector's ceiling. Default is a horizontal plane at 'heightceiling'. ceilingplane_b = ; // 'heightceiling' will still be used to calculate texture alignment. ceilingplane_c = ; // The plane equation will only be used if all 4 values are given. - ceilingplane_d = ; + ceilingplane_d = ; // The plane is defined as a*x + b*y + c*z + d = 0 with the normal vector pointing downward. floorplane_a = ; // Define the plane equation for the sector's floor. Default is a horizontal plane at 'heightfloor'. floorplane_b = ; // 'heightfloor' will still be used to calculate texture alignment. floorplane_c = ; // The plane equation will only be used if all 4 values are given. - floorplane_d = ; + floorplane_d = ; // The plane is defined as a*x + b*y + c*z + d = 0 with the normal vector pointing upward. lightfloor = ; // The floor's light level. Default is 0. lightceiling = ; // The ceiling's light level. Default is 0. - lightfloorabsolute = ; // true = 'lightfloor' is an absolute value. Default is + lightfloorabsolute = ; // true = 'lightfloor' is an absolute value. Default is // relative to the owning sector's light level. - lightceilingabsolute = ; // true = 'lightceiling' is an absolute value. Default is + lightceilingabsolute = ; // true = 'lightceiling' is an absolute value. Default is // relative to the owning sector's light level. alphafloor = ; // translucency of floor plane (only has meaning with Sector_SetPortal) Default is 1.0. alphaceiling = ; // translucency of ceiling plane (only has meaning with Sector_SetPortal) Default is 1.0. diff --git a/src/doomdata.h b/src/doomdata.h index 05bcfbfc1..8e992a812 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -441,7 +441,7 @@ struct FPlayerStart DVector3 pos; int16_t angle, type; - FPlayerStart() { } + FPlayerStart() = default; FPlayerStart(const FMapThing *mthing, int pnum) : pos(mthing->pos), angle(mthing->angle), diff --git a/src/g_level.cpp b/src/g_level.cpp index 0475571f7..e51ce4e1f 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -744,12 +744,39 @@ void FLevelLocals::ExitLevel (int position, bool keepFacing) ChangeLevel(NextMap, position, keepFacing ? CHANGELEVEL_KEEPFACING : 0); } +static void LevelLocals_ExitLevel(FLevelLocals *self, int position, bool keepFacing) +{ + self->ExitLevel(position, keepFacing); +} + +DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ExitLevel, LevelLocals_ExitLevel) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + PARAM_INT(position); + PARAM_INT(keepFacing); + self->ExitLevel(position, keepFacing); + return 0; +} + void FLevelLocals::SecretExitLevel (int position) { flags3 |= LEVEL3_EXITSECRETUSED; ChangeLevel(GetSecretExitMap(), position, 0); } +static void LevelLocals_SecretExitLevel(FLevelLocals *self, int position) +{ + self->SecretExitLevel(position); +} + +DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, SecretExitLevel, LevelLocals_SecretExitLevel) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + PARAM_INT(position); + self->SecretExitLevel(position); + return 0; +} + //========================================================================== // // @@ -1248,7 +1275,7 @@ void FLevelLocals::WorldDone (void) ext->mDefined & FExitText::DEF_LOOKUP, true, endsequence); } - else + else if (!(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { F_StartFinale(thiscluster->MessageMusic, thiscluster->musicorder, thiscluster->cdtrack, thiscluster->cdid, @@ -1259,7 +1286,7 @@ void FLevelLocals::WorldDone (void) true, endsequence); } } - else + else if (!deathmatch) { FExitText *ext = nullptr; @@ -1286,7 +1313,7 @@ void FLevelLocals::WorldDone (void) nextcluster = FindClusterInfo (FindLevelInfo (nextlevel)->cluster); - if (nextcluster->cluster != cluster && !deathmatch) + if (nextcluster->cluster != cluster && !(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { // Only start the finale if the next level's cluster is different // than the current one and we're not in deathmatch. diff --git a/src/g_shared/dthinker.h b/src/g_shared/dthinker.h index 26b4e06ac..07d884fc4 100644 --- a/src/g_shared/dthinker.h +++ b/src/g_shared/dthinker.h @@ -142,9 +142,6 @@ public: FThinkerIterator (FLevelLocals *Level, const PClass *type, int statnum, DThinker *prev); DThinker *Next (bool exact = false); void Reinit (); - -protected: - FThinkerIterator() {} }; template class TThinkerIterator : public FThinkerIterator diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 42e06e2ba..09e8cb485 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1620,6 +1620,8 @@ MapFlagHandlers[] = { "rememberstate", MITYPE_CLRFLAG2, LEVEL2_FORGETSTATE, 0 }, { "unfreezesingleplayerconversations",MITYPE_SETFLAG2, LEVEL2_CONV_SINGLE_UNFREEZE, 0 }, { "spawnwithweaponraised", MITYPE_SETFLAG2, LEVEL2_PRERAISEWEAPON, 0 }, + { "needclustertext", MITYPE_SETFLAG2, LEVEL2_NEEDCLUSTERTEXT, 0 }, + { "noclustertext", MITYPE_SETFLAG2, LEVEL2_NOCLUSTERTEXT, 0 }, // Normally there shouldn't be a need to explicitly set this { "forcefakecontrast", MITYPE_SETFLAG3, LEVEL3_FORCEFAKECONTRAST, 0 }, { "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 }, { "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 }, diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index f4c74de08..f105d3f0c 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -201,7 +201,7 @@ enum ELevelFlags : unsigned int LEVEL2_LAXACTIVATIONMAPINFO = 0x00000008, // LEVEL_LAXMONSTERACTIVATION is not a default. LEVEL2_MISSILESACTIVATEIMPACT=0x00000010, // Missiles are the activators of SPAC_IMPACT events, not their shooters - // = 0x00000020, // unused + LEVEL2_NEEDCLUSTERTEXT = 0x00000020, // A map with this flag needs to retain its cluster intermission texts when being redefined in UMAPINFO LEVEL2_KEEPFULLINVENTORY = 0x00000040, // doesn't reduce the amount of inventory items to 1 @@ -225,7 +225,7 @@ enum ELevelFlags : unsigned int LEVEL2_FORCETEAMPLAYOFF = 0x00080000, LEVEL2_CONV_SINGLE_UNFREEZE = 0x00100000, - // = 0x00200000, // unused, was LEVEL2_RAILINGHACK + LEVEL2_NOCLUSTERTEXT = 0x00200000, // ignore intermission texts fro clusters. This gets set when UMAPINFO is used to redefine its properties. LEVEL2_DUMMYSWITCHES = 0x00400000, LEVEL2_HEXENHACK = 0x00800000, // Level was defined in a Hexen style MAPINFO @@ -528,7 +528,7 @@ struct FSkillInfo int Infighting; bool PlayerRespawn; - FSkillInfo() {} + FSkillInfo() = default; FSkillInfo(const FSkillInfo &other) { operator=(other); diff --git a/src/gamedata/info.h b/src/gamedata/info.h index df294ec78..622ffe6a0 100644 --- a/src/gamedata/info.h +++ b/src/gamedata/info.h @@ -267,7 +267,7 @@ struct FActorInfo uint8_t DefaultStateUsage = 0; // state flag defaults for blocks without a qualifier. - FActorInfo() {} + FActorInfo() = default; FActorInfo(const FActorInfo & other) { // only copy the fields that get inherited diff --git a/src/gamedata/umapinfo.cpp b/src/gamedata/umapinfo.cpp index 39b91efd3..eadfa6b00 100644 --- a/src/gamedata/umapinfo.cpp +++ b/src/gamedata/umapinfo.cpp @@ -216,15 +216,7 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape) if (Episode.IsEmpty()) return 0; if (Episode.Compare("-") == 0) { - // clear the given episode - for (unsigned i = 0; i < AllEpisodes.Size(); i++) - { - if (AllEpisodes[i].mEpisodeMap.CompareNoCase(mape->MapName) == 0) - { - AllEpisodes.Delete(i); - break; - } - } + AllEpisodes.Clear(); } else { @@ -236,6 +228,7 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape) epi.mEpisodeMap = mape->MapName; epi.mPicName = split[0]; epi.mShortcut = split[2][0]; + epi.mNoSkill = false; unsigned i; for (i = 0; i < AllEpisodes.Size(); i++) @@ -364,7 +357,7 @@ int ParseUMapInfo(int lumpnum) if (!parsed.MapName.Compare(Maps[i].MapName)) { Maps[i] = parsed; - return 1; + continue; } } // Not found so create a new one. @@ -380,7 +373,7 @@ void CommitUMapinfo(level_info_t *defaultinfo) { for (auto &map : Maps) { - auto levelinfo = FindLevelInfo(map.MapName); + auto levelinfo = FindLevelInfo(map.MapName, false); if (levelinfo == nullptr) { // Map did not exist yet. @@ -462,6 +455,7 @@ void CommitUMapinfo(level_info_t *defaultinfo) levelinfo->ExitMapTexts[NAME_Secret] = { 0, 0 }; } if (map.nointermission) levelinfo->flags |= LEVEL_NOINTERMISSION; + if (!(levelinfo->flags2 & LEVEL2_NEEDCLUSTERTEXT)) levelinfo->flags2 |= LEVEL2_NOCLUSTERTEXT; // UMAPINFO should ignore cluster intermission texts. } diff --git a/src/menu/messagebox.cpp b/src/menu/messagebox.cpp index 8a2335fa7..c58b2ab94 100644 --- a/src/menu/messagebox.cpp +++ b/src/menu/messagebox.cpp @@ -135,7 +135,8 @@ void ActivateEndGameMenu() M_ClearMenus(); if (!netgame) { - G_CheckDemoStatus(); + if (demorecording) + G_CheckDemoStatus(); D_StartTitle(); } }); diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 1779d2d94..4d4471717 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -251,13 +251,13 @@ void FModelRenderer::RenderFrameModels(FLevelLocals *Level, const FSpriteModelFr inter /= 2.; inter += 0.5; } - if ((curState->sprite == nextState->sprite) && (curState->Frame == nextState->Frame)) + if (nextState && ((curState->sprite == nextState->sprite) && (curState->Frame == nextState->Frame))) { inter /= 2.; nextState = nextState->GetNextState(); } } - if (inter != 0.0) + if (nextState && inter != 0.0) smfNext = FindModelFrame(ti, nextState->sprite, nextState->Frame, false); } } diff --git a/src/rendering/gl/renderer/gl_postprocess.cpp b/src/rendering/gl/renderer/gl_postprocess.cpp index 4e0744fb4..43983b140 100644 --- a/src/rendering/gl/renderer/gl_postprocess.cpp +++ b/src/rendering/gl/renderer/gl_postprocess.cpp @@ -68,18 +68,10 @@ void FGLRenderer::PostProcessScene(int fixedcm, const std::function &aft GLPPRenderState renderstate(mBuffers); - hw_postprocess.exposure.Render(&renderstate, sceneWidth, sceneHeight); - hw_postprocess.customShaders.Run(&renderstate, "beforebloom"); - hw_postprocess.bloom.RenderBloom(&renderstate, sceneWidth, sceneHeight, fixedcm); - + hw_postprocess.Pass1(&renderstate, fixedcm, sceneWidth, sceneHeight); mBuffers->BindCurrentFB(); afterBloomDrawEndScene2D(); - - hw_postprocess.tonemap.Render(&renderstate); - hw_postprocess.colormap.Render(&renderstate, fixedcm); - hw_postprocess.lens.Render(&renderstate); - hw_postprocess.fxaa.Render(&renderstate); - hw_postprocess.customShaders.Run(&renderstate, "scene"); + hw_postprocess.Pass2(&renderstate, fixedcm, sceneWidth, sceneHeight); } //----------------------------------------------------------------------------- diff --git a/src/rendering/hwrenderer/data/hw_viewpointbuffer.cpp b/src/rendering/hwrenderer/data/hw_viewpointbuffer.cpp index 576b4c576..268bd4902 100644 --- a/src/rendering/hwrenderer/data/hw_viewpointbuffer.cpp +++ b/src/rendering/hwrenderer/data/hw_viewpointbuffer.cpp @@ -78,7 +78,7 @@ void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height) if (width != m2DWidth || height != m2DHeight) { HWViewpointUniforms matrices; - matrices.SetDefaults(); + matrices.SetDefaults(nullptr); matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f); matrices.CalcDependencies(); mBuffer->Map(); diff --git a/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp b/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp index 9eb64a1d0..532f2ca35 100644 --- a/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp @@ -1081,3 +1081,20 @@ void PPCustomShaderInstance::AddUniformField(size_t &offset, const FString &name offset += alignment - fieldsize; } } + + +void Postprocess::Pass1(PPRenderState* state, int fixedcm, int sceneWidth, int sceneHeight) +{ + exposure.Render(state, sceneWidth, sceneHeight); + customShaders.Run(state, "beforebloom"); + bloom.RenderBloom(state, sceneWidth, sceneHeight, fixedcm); +} + +void Postprocess::Pass2(PPRenderState* state, int fixedcm, int sceneWidth, int sceneHeight) +{ + tonemap.Render(state); + colormap.Render(state, fixedcm); + lens.Render(state); + fxaa.Render(state); + customShaders.Run(state, "scene"); +} diff --git a/src/rendering/hwrenderer/postprocessing/hw_postprocess.h b/src/rendering/hwrenderer/postprocessing/hw_postprocess.h index aa9a26e5c..8c74af83e 100644 --- a/src/rendering/hwrenderer/postprocessing/hw_postprocess.h +++ b/src/rendering/hwrenderer/postprocessing/hw_postprocess.h @@ -834,6 +834,10 @@ public: PPPresent present; PPShadowMap shadowmap; PPCustomShaders customShaders; + + + void Pass1(PPRenderState *state, int fixedcm, int sceneWidth, int sceneHeight); + void Pass2(PPRenderState* state, int fixedcm, int sceneWidth, int sceneHeight); }; extern Postprocess hw_postprocess; diff --git a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp index 63dc1234e..db74848b2 100644 --- a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp @@ -135,7 +135,7 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni VPUniforms.mClipLine.X = -1000001.f; VPUniforms.mClipHeight = 0; } - else VPUniforms.SetDefaults(); + else VPUniforms.SetDefaults(this); mClipper->SetViewpoint(Viewpoint); ClearBuffers(); @@ -387,14 +387,15 @@ HWPortal * HWDrawInfo::FindPortal(const void * src) // //----------------------------------------------------------------------------- -void HWViewpointUniforms::SetDefaults() +void HWViewpointUniforms::SetDefaults(HWDrawInfo *drawInfo) { mProjectionMatrix.loadIdentity(); mViewMatrix.loadIdentity(); mNormalViewMatrix.loadIdentity(); mViewHeight = viewheight; mGlobVis = (float)R_GetGlobVis(r_viewwindow, r_visibility) / 32.f; - mPalLightLevels = static_cast(gl_bandedswlight) | (static_cast(gl_fogmode) << 8) | (static_cast(gl_lightmode) << 16); + const int lightMode = drawInfo == nullptr ? static_cast(*gl_lightmode) : static_cast(drawInfo->lightmode); + mPalLightLevels = static_cast(gl_bandedswlight) | (static_cast(gl_fogmode) << 8) | (lightMode << 16); mClipLine.X = -10000000.0f; mShadowmapFilter = gl_shadowmap_filter; diff --git a/src/rendering/hwrenderer/scene/hw_viewpointuniforms.h b/src/rendering/hwrenderer/scene/hw_viewpointuniforms.h index 1bd57faa0..8752c76aa 100644 --- a/src/rendering/hwrenderer/scene/hw_viewpointuniforms.h +++ b/src/rendering/hwrenderer/scene/hw_viewpointuniforms.h @@ -3,6 +3,8 @@ #include "r_data/matrix.h" #include "r_utility.h" +struct HWDrawInfo; + struct HWViewpointUniforms { VSMatrix mProjectionMatrix; @@ -23,7 +25,7 @@ struct HWViewpointUniforms mNormalViewMatrix.computeNormalMatrix(mViewMatrix); } - void SetDefaults(); + void SetDefaults(HWDrawInfo *drawInfo); }; diff --git a/src/rendering/vulkan/renderer/vk_postprocess.cpp b/src/rendering/vulkan/renderer/vk_postprocess.cpp index fc8a0a6f2..9aab746f2 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.cpp +++ b/src/rendering/vulkan/renderer/vk_postprocess.cpp @@ -46,18 +46,10 @@ void VkPostprocess::PostProcessScene(int fixedcm, const std::function &a VkPPRenderState renderstate; - hw_postprocess.exposure.Render(&renderstate, sceneWidth, sceneHeight); - hw_postprocess.customShaders.Run(&renderstate, "beforebloom"); - hw_postprocess.bloom.RenderBloom(&renderstate, sceneWidth, sceneHeight, fixedcm); - + hw_postprocess.Pass1(&renderstate, fixedcm, sceneWidth, sceneHeight); SetActiveRenderTarget(); afterBloomDrawEndScene2D(); - - hw_postprocess.tonemap.Render(&renderstate); - hw_postprocess.colormap.Render(&renderstate, fixedcm); - hw_postprocess.lens.Render(&renderstate); - hw_postprocess.fxaa.Render(&renderstate); - hw_postprocess.customShaders.Run(&renderstate, "scene"); + hw_postprocess.Pass2(&renderstate, fixedcm, sceneWidth, sceneHeight); } void VkPostprocess::BlitSceneToPostprocess() diff --git a/src/rendering/vulkan/renderer/vk_renderstate.cpp b/src/rendering/vulkan/renderer/vk_renderstate.cpp index c2fc30875..07425ad08 100644 --- a/src/rendering/vulkan/renderer/vk_renderstate.cpp +++ b/src/rendering/vulkan/renderer/vk_renderstate.cpp @@ -168,13 +168,13 @@ void VkRenderState::Apply(int dt) mApplyCount = 0; } + ApplyStreamData(); + ApplyMatrices(); ApplyRenderPass(dt); ApplyScissor(); ApplyViewport(); ApplyStencilRef(); ApplyDepthBias(); - ApplyStreamData(); - ApplyMatrices(); ApplyPushConstants(); ApplyVertexBuffers(); ApplyDynamicSet(); @@ -327,6 +327,9 @@ void VkRenderState::ApplyStreamData() { mDataIndex = 0; mStreamDataOffset += sizeof(StreamUBO); + + if (mStreamDataOffset + sizeof(StreamUBO) >= fb->StreamUBO->Size()) + WaitForStreamBuffers(); } uint8_t *ptr = (uint8_t*)fb->StreamUBO->Memory(); memcpy(ptr + mStreamDataOffset + sizeof(StreamData) * mDataIndex, &mStreamData, sizeof(StreamData)); @@ -420,11 +423,11 @@ void VkRenderState::ApplyMatrices() { auto fb = GetVulkanFrameBuffer(); - if (mMatricesOffset + (fb->UniformBufferAlignedSize() << 1) < fb->MatricesUBO->Size()) - { - mMatricesOffset += fb->UniformBufferAlignedSize(); - memcpy(static_cast(fb->MatricesUBO->Memory()) + mMatricesOffset, &mMatrices, sizeof(MatricesUBO)); - } + if (mMatricesOffset + (fb->UniformBufferAlignedSize() << 1) >= fb->MatricesUBO->Size()) + WaitForStreamBuffers(); + + mMatricesOffset += fb->UniformBufferAlignedSize(); + memcpy(static_cast(fb->MatricesUBO->Memory()) + mMatricesOffset, &mMatrices, sizeof(MatricesUBO)); } } @@ -481,6 +484,16 @@ void VkRenderState::ApplyDynamicSet() } } +void VkRenderState::WaitForStreamBuffers() +{ + EndRenderPass(); + GetVulkanFrameBuffer()->WaitForCommands(false); + mApplyCount = 0; + mStreamDataOffset = 0; + mDataIndex = 0; + mMatricesOffset = 0; +} + void VkRenderState::Bind(int bindingpoint, uint32_t offset) { if (bindingpoint == VIEWPOINT_BINDINGPOINT) diff --git a/src/rendering/vulkan/renderer/vk_renderstate.h b/src/rendering/vulkan/renderer/vk_renderstate.h index ef58804b7..6848d15a5 100644 --- a/src/rendering/vulkan/renderer/vk_renderstate.h +++ b/src/rendering/vulkan/renderer/vk_renderstate.h @@ -63,6 +63,7 @@ protected: void ApplyVertexBuffers(); void ApplyMaterial(); + void WaitForStreamBuffers(); void BeginRenderPass(VulkanCommandBuffer *cmdbuffer); bool mDepthClamp = true; diff --git a/src/rendering/vulkan/textures/vk_imagetransition.h b/src/rendering/vulkan/textures/vk_imagetransition.h index c12918d04..916f20c24 100644 --- a/src/rendering/vulkan/textures/vk_imagetransition.h +++ b/src/rendering/vulkan/textures/vk_imagetransition.h @@ -12,6 +12,8 @@ public: { AspectMask = VK_IMAGE_ASPECT_COLOR_BIT; Layout = VK_IMAGE_LAYOUT_UNDEFINED; + PPFramebuffer.reset(); + RSFramebuffers.clear(); DepthOnlyView.reset(); View.reset(); Image.reset(); diff --git a/src/scripting/vm/jitintern.h b/src/scripting/vm/jitintern.h index aa6dbfc09..ac3d8acf5 100644 --- a/src/scripting/vm/jitintern.h +++ b/src/scripting/vm/jitintern.h @@ -135,8 +135,23 @@ private: cc.movsd(epsilonXmm, epsilon); cc.ucomisd(epsilonXmm, tmp); - if (check) cc.ja(fail); - else cc.jna(fail); + if (check) + { + cc.jp(success); + if (i == (N - 1)) + { + cc.ja(fail); + } + else + { + cc.jna(success); + } + } + else + { + cc.jp(fail); + cc.jna(fail); + } } } } diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 689e8a2b3..52daf378d 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -511,7 +511,7 @@ HANDLE WriteLogFile(HWND edit) // //========================================================================== -void CreateCrashLog (char *custominfo, DWORD customsize, HWND richlog) +void CreateCrashLog (const char *custominfo, DWORD customsize, HWND richlog) { // Do not collect information more than once. if (NumFiles != 0) diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 0bfcc2e0c..de4b5e2c9 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -98,7 +98,7 @@ // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); -void CreateCrashLog (char *custominfo, DWORD customsize, HWND richedit); +void CreateCrashLog (const char *custominfo, DWORD customsize, HWND richedit); void DisplayCrashLog (); extern uint8_t *ST_Util_BitsForBitmap (BITMAPINFO *bitmap_info); void I_FlushBufferedConsoleStuff(); diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 59e7f9149..1c2c4104b 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -253,6 +253,7 @@ C98F79709BD7E0E4C19026AB9575EC6F // cc-cod.zip:codlev.wad map07 D7F6E9F08C39A17026349A04F8C0B0BE // Return to Hadron, e1m9 19D03FFC875589E21EDBB7AB74EF4AEF // Return to Hadron, e1m9, 2016.01.03 update +5BDA34DA60C0530794CC1EA2DA017976 // doom2.wad map14 { pointonline } diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 6213e4c44..5839ad150 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -256,6 +256,7 @@ map E1M5 lookup "CHUSTR_E1M5" cluster = 1 par = 165 music = "$MUSIC_E1M5" + needclustertext } // Clusters (correspond with same-numbered episode) diff --git a/wadsrc/static/mapinfo/doom1.txt b/wadsrc/static/mapinfo/doom1.txt index 738c93c4a..c28186c55 100644 --- a/wadsrc/static/mapinfo/doom1.txt +++ b/wadsrc/static/mapinfo/doom1.txt @@ -152,6 +152,7 @@ map E1M8 lookup "HUSTR_E1M8" baronspecial specialaction_lowerfloor music = "$MUSIC_E1M8" + needclustertext } map E1M9 lookup "HUSTR_E1M9" @@ -266,6 +267,7 @@ map E2M8 lookup "HUSTR_E2M8" cyberdemonspecial specialaction_exitlevel music = "$MUSIC_E2M8" + needclustertext } map E2M9 lookup "HUSTR_E2M9" @@ -380,6 +382,7 @@ map E3M8 lookup "HUSTR_E3M8" spidermastermindspecial specialaction_exitlevel music = "$MUSIC_E3M8" + needclustertext } map E3M9 lookup "HUSTR_E3M9" @@ -496,6 +499,7 @@ map E4M8 lookup "HUSTR_E4M8" spidermastermindspecial specialaction_lowerfloor music = "$MUSIC_E2M5" + needclustertext } map E4M9 lookup "HUSTR_E4M9" diff --git a/wadsrc/static/mapinfo/doom2.txt b/wadsrc/static/mapinfo/doom2.txt index 032518aa7..8edba1719 100644 --- a/wadsrc/static/mapinfo/doom2.txt +++ b/wadsrc/static/mapinfo/doom2.txt @@ -85,6 +85,7 @@ map MAP06 lookup "HUSTR_6" par = 150 sucktime = 1 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "HUSTR_7" @@ -141,6 +142,7 @@ map MAP11 lookup "HUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "HUSTR_12" @@ -185,6 +187,7 @@ map MAP15 lookup "HUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "HUSTR_16" @@ -240,6 +243,7 @@ map MAP20 lookup "HUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "HUSTR_21" @@ -351,6 +355,7 @@ map MAP30 lookup "HUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "HUSTR_31" @@ -362,6 +367,7 @@ map MAP31 lookup "HUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "HUSTR_32" @@ -515,6 +521,7 @@ map LEVEL08 lookup "NHUSTR_8" cluster = 11 par = 105 music = "$MUSIC_SHAWN" + needclustertext } map LEVEL09 lookup "NHUSTR_9" diff --git a/wadsrc/static/mapinfo/doom2bfg.txt b/wadsrc/static/mapinfo/doom2bfg.txt index 840f3c6c9..b53d7944f 100644 --- a/wadsrc/static/mapinfo/doom2bfg.txt +++ b/wadsrc/static/mapinfo/doom2bfg.txt @@ -53,6 +53,7 @@ map MAP31 lookup "HUSTR_31B" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "HUSTR_32B" diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index 377143f4f..a936c468c 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -421,6 +421,7 @@ map E1M8 lookup "HHUSTR_E1M8" ironlichspecial specialaction_lowerfloortohighest music = "MUS_E1M8" + needclustertext } map E1M9 lookup "HHUSTR_E1M9" @@ -508,6 +509,7 @@ map E2M8 lookup "HHUSTR_E2M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E2M8" + needclustertext } map E2M9 lookup "HHUSTR_E2M9" @@ -595,6 +597,7 @@ map E3M8 lookup "HHUSTR_E3M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E1M9" + needclustertext } map E3M9 lookup "HHUSTR_E3M9" @@ -682,6 +685,7 @@ map E4M8 lookup "HHUSTR_E4M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E1M8" + needclustertext } map E4M9 lookup "HHUSTR_E4M9" @@ -769,6 +773,7 @@ map E5M8 lookup "HHUSTR_E5M8" specialaction_killmonsters specialaction_lowerfloortohighest music = "MUS_E2M8" + needclustertext } map E5M9 lookup "HHUSTR_E5M9" diff --git a/wadsrc/static/mapinfo/plutonia.txt b/wadsrc/static/mapinfo/plutonia.txt index d248377f6..4b0fc478b 100644 --- a/wadsrc/static/mapinfo/plutonia.txt +++ b/wadsrc/static/mapinfo/plutonia.txt @@ -79,6 +79,7 @@ map MAP06 lookup "PHUSTR_6" cluster = 5 par = 150 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "PHUSTR_7" @@ -135,6 +136,7 @@ map MAP11 lookup "PHUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "PHUSTR_12" @@ -179,6 +181,7 @@ map MAP15 lookup "PHUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "PHUSTR_16" @@ -234,6 +237,7 @@ map MAP20 lookup "PHUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "PHUSTR_21" @@ -345,6 +349,7 @@ map MAP30 lookup "PHUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "PHUSTR_31" @@ -356,6 +361,7 @@ map MAP31 lookup "PHUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "PHUSTR_32" diff --git a/wadsrc/static/mapinfo/tnt.txt b/wadsrc/static/mapinfo/tnt.txt index df10bfa7e..b4b94463b 100644 --- a/wadsrc/static/mapinfo/tnt.txt +++ b/wadsrc/static/mapinfo/tnt.txt @@ -79,6 +79,7 @@ map MAP06 lookup "THUSTR_6" cluster = 5 par = 150 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "THUSTR_7" @@ -135,6 +136,7 @@ map MAP11 lookup "THUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "THUSTR_12" @@ -179,6 +181,7 @@ map MAP15 lookup "THUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "THUSTR_16" @@ -234,6 +237,7 @@ map MAP20 lookup "THUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "THUSTR_21" @@ -345,6 +349,7 @@ map MAP30 lookup "THUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "THUSTR_31" @@ -356,6 +361,7 @@ map MAP31 lookup "THUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "THUSTR_32" diff --git a/wadsrc/static/newconsolefont.hex b/wadsrc/static/newconsolefont.hex index 0b5670093..b54c844ea 100644 --- a/wadsrc/static/newconsolefont.hex +++ b/wadsrc/static/newconsolefont.hex @@ -1,4 +1,6 @@ -000b:00007f7f7f7f7f7f7f7f7f7f7f7f0000 +000a:00000008142200000008142200000000 +000b:ffffffffffffffffffffffffffffffff +000c:0000002A1C2A00000008142200000000 001c:00000070101010101010101010107000 0021:0000183C3C3C18181800181800000000 0022:00666666240000000000000000000000 diff --git a/wadsrc/static/shaders/glsl/fxaa.fp b/wadsrc/static/shaders/glsl/fxaa.fp index 220095ae1..0cb919069 100644 --- a/wadsrc/static/shaders/glsl/fxaa.fp +++ b/wadsrc/static/shaders/glsl/fxaa.fp @@ -52,6 +52,8 @@ void main() // NVIDIA FXAA 3.11 by TIMOTHY LOTTES //============================================================================ +#define FXAA_DISCARD 0 + #define FXAA_GREEN_AS_LUMA 0 #define FxaaBool bool diff --git a/wadsrc/static/zscript/actors/doom/bossbrain.zs b/wadsrc/static/zscript/actors/doom/bossbrain.zs index a3b96d7fa..d45f85cf7 100644 --- a/wadsrc/static/zscript/actors/doom/bossbrain.zs +++ b/wadsrc/static/zscript/actors/doom/bossbrain.zs @@ -214,7 +214,7 @@ extend class Actor } } while (count != 0); } - Exit_Normal(0); + Level.ExitLevel(0, false); } void A_BrainSpit(class spawntype = null) diff --git a/wadsrc/static/zscript/actors/strife/entityboss.zs b/wadsrc/static/zscript/actors/strife/entityboss.zs index 6905b36fc..107442e28 100644 --- a/wadsrc/static/zscript/actors/strife/entityboss.zs +++ b/wadsrc/static/zscript/actors/strife/entityboss.zs @@ -289,7 +289,7 @@ class EntitySecond : SpectralMonster { if (CheckBossDeath ()) { - Exit_Normal(0); + Level.ExitLevel(0, false); } } } diff --git a/wadsrc/static/zscript/actors/strife/programmer.zs b/wadsrc/static/zscript/actors/strife/programmer.zs index a3af76a71..c835a5ba8 100644 --- a/wadsrc/static/zscript/actors/strife/programmer.zs +++ b/wadsrc/static/zscript/actors/strife/programmer.zs @@ -211,7 +211,7 @@ class ProgLevelEnder : Inventory { special1 = 255; special2 = 1; - Exit_Normal(0); + Level.ExitLevel(0, false); } } else diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs index 3d1af52a3..792f105f5 100644 --- a/wadsrc/static/zscript/base.zs +++ b/wadsrc/static/zscript/base.zs @@ -784,6 +784,8 @@ struct LevelLocals native native play bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = 0 /*Floor.crushDoom*/); native play bool CreateFloor(sector sec, int floortype, line ln, double speed, double height = 0, int crush = -1, int change = 0, bool crushmode = false, bool hereticlower = false); + native void ExitLevel(int position, bool keepFacing); + native void SecretExitLevel(int position); } struct StringTable native diff --git a/wadsrc/static/zscript/ui/menu/search/menu.zs b/wadsrc/static/zscript/ui/menu/search/menu.zs index 423be0250..46efc0c6a 100644 --- a/wadsrc/static/zscript/ui/menu/search/menu.zs +++ b/wadsrc/static/zscript/ui/menu/search/menu.zs @@ -89,7 +89,7 @@ class os_Menu : OptionMenu string actionN = item.GetAction(); let textItem = ListMenuItemTextItem(item); string newPath = textItem - ? makePath(path, textItem.mText) + ? makePath(path, StringTable.Localize(textItem.mText)) : path; found |= listOptions(targetDesc, actionN, query, newPath, isAnyTermMatches);