From 59db1a882fe09983f534d20ba3343c3e9663938f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 16 Feb 2017 11:01:06 +0200 Subject: [PATCH 1/9] Fixed compilation warnings reported by MSVC src\s_sound.cpp(1259): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data src\c_bind.cpp(479): warning C4101: 'c': unreferenced local variable --- src/c_bind.cpp | 2 +- src/s_sound.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c_bind.cpp b/src/c_bind.cpp index e6c76ab064..c21e200d38 100644 --- a/src/c_bind.cpp +++ b/src/c_bind.cpp @@ -476,7 +476,7 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand) { PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings); PARAM_STRING(cmd); - int k1, k2, c; + int k1, k2; self->GetKeysForCommand(cmd.GetChars(), &k1, &k2); if (numret > 0) ret[0].SetInt(k1); if (numret > 1) ret[1].SetInt(k2); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 5c0ae69e27..840559127a 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -1256,7 +1256,7 @@ DEFINE_ACTION_FUNCTION(DObject, S_Sound) PARAM_INT(channel); PARAM_FLOAT_DEF(volume); PARAM_FLOAT_DEF(attn); - S_Sound(channel, id, volume, attn); + S_Sound(channel, id, static_cast(volume), static_cast(attn)); return 0; } From 4d99b58f968157000bfd7bf83b50c3c27adae198 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 17:45:04 +0100 Subject: [PATCH 2/9] - allow using the default menu settings classes when none is specified in MENUDEFS. --- src/dobjgc.cpp | 2 +- src/menu/menu.cpp | 10 ++++++++-- src/menu/menudef.cpp | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index 8ac991aa82..4fe609a5a0 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -544,7 +544,7 @@ void FullGC() void Barrier(DObject *pointing, DObject *pointed) { - assert(pointed->GetClass() < (void*)0x1000000000000000); + assert(pointed->GetClass() != nullptr); assert(pointing == NULL || (pointing->IsBlack() && !pointing->IsDead())); assert(pointed->IsWhite() && !pointed->IsDead()); assert(State != GCS_Finalize && State != GCS_Pause); diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index a8dac6b540..c5b1b40714 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -94,6 +94,8 @@ float BackbuttonAlpha; static bool MenuEnabled = true; void M_InitVideoModes(); +extern PClass *DefaultListMenuClass; +extern PClass *DefaultOptionMenuClass; #define KEY_REPEAT_DELAY (TICRATE*5/12) @@ -623,7 +625,9 @@ void M_SetMenu(FName menu, int param) } else { - const PClass *cls = ld->mClass == nullptr? RUNTIME_CLASS(DListMenu) : ld->mClass; + PClass *cls = ld->mClass; + if (cls == nullptr) cls = DefaultListMenuClass; + if (cls == nullptr) cls = PClass::FindClass("ListMenu"); DListMenu *newmenu = (DListMenu *)cls->CreateNew(); newmenu->Init(DMenu::CurrentMenu, ld); @@ -633,7 +637,9 @@ void M_SetMenu(FName menu, int param) else if ((*desc)->IsKindOf(RUNTIME_CLASS(DOptionMenuDescriptor))) { DOptionMenuDescriptor *ld = static_cast(*desc); - const PClass *cls = ld->mClass == nullptr? PClass::FindClass("OptionMenu") : ld->mClass; + PClass *cls = ld->mClass; + if (cls == nullptr) cls = DefaultOptionMenuClass; + if (cls == nullptr) cls = PClass::FindClass("OptionMenu"); DMenu *newmenu = (DMenu*)cls->CreateNew(); IFVIRTUALPTRNAME(newmenu, "OptionMenu", Init) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 057f544c5e..5ada8a2dca 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -62,6 +62,8 @@ static DOptionMenuDescriptor *DefaultOptionMenuSettings; // contains common sett FOptionMenuSettings OptionSettings; FOptionMap OptionValues; bool mustPrintErrors; +PClass *DefaultListMenuClass; +PClass *DefaultOptionMenuClass; void I_BuildALDeviceList(FOptionValues *opt); @@ -948,7 +950,9 @@ void M_ParseMenuDefs() } } } + DefaultListMenuClass = DefaultListMenuSettings->GetClass(); DefaultListMenuSettings = nullptr; + DefaultOptionMenuClass = DefaultOptionMenuSettings->GetClass(); DefaultOptionMenuSettings = nullptr; } From cfeb1724fea6cc47a5f75db6972be5ced8e6dbab Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 18:35:58 +0100 Subject: [PATCH 3/9] - added a Door_AnimatedClose special. --- src/actionspecials.h | 1 + src/menu/menu.h | 2 +- src/menu/menudef.cpp | 4 ++-- src/p_doors.cpp | 26 +++++++++++++++----------- src/p_lnspec.cpp | 9 ++++++++- src/p_spec.h | 14 +++++++++++--- 6 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index 3edb1671d3..42861b702c 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -259,5 +259,6 @@ DEFINE_SPECIAL(Stairs_BuildDownDoom, 270, 5, 5, 5) DEFINE_SPECIAL(Stairs_BuildUpDoomSync, 271, 4, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoomSync, 272, 4, 4, 4) DEFINE_SPECIAL(Stairs_BuildUpDoomCrush, 273, 5, 5, 5) +DEFINE_SPECIAL(Door_AnimatedClose, 274, 4, 4, 4) #undef DEFINE_SPECIAL diff --git a/src/menu/menu.h b/src/menu/menu.h index ffc15e8808..68367e701b 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -112,7 +112,7 @@ class DMenuDescriptor : public DObject public: FName mMenuName; FString mNetgameMessage; - const PClass *mClass; + PClass *mClass; virtual size_t PropagateMark() { return 0; } }; diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 5ada8a2dca..ec1ae12b56 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -293,7 +293,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc) else if (sc.Compare("Class")) { sc.MustGetString(); - const PClass *cls = PClass::FindClass(sc.String); + PClass *cls = PClass::FindClass(sc.String); if (cls == nullptr || !cls->IsDescendantOf(RUNTIME_CLASS(DListMenu))) { sc.ScriptError("Unknown menu class '%s'", sc.String); @@ -701,7 +701,7 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc) else if (sc.Compare("Class")) { sc.MustGetString(); - const PClass *cls = PClass::FindClass(sc.String); + PClass *cls = PClass::FindClass(sc.String); if (cls == nullptr || !cls->IsDescendantOf("OptionMenu")) { sc.ScriptError("Unknown menu class '%s'", sc.String); diff --git a/src/p_doors.cpp b/src/p_doors.cpp index 3101be1c77..aff66cd740 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -538,7 +538,8 @@ void DAnimatedDoor::Serialize(FSerializer &arc) ("delay", m_Delay) ("dooranim", m_DoorAnim) ("setblock1", m_SetBlocking1) - ("setblock2", m_SetBlocking2); + ("setblock2", m_SetBlocking2) + ("tyoe", m_Type); } //============================================================================ @@ -614,7 +615,6 @@ void DAnimatedDoor::Tick () } m_Timer = m_Delay; - m_Status = Waiting; } else { @@ -631,7 +631,7 @@ void DAnimatedDoor::Tick () case Waiting: // IF DOOR IS DONE WAITING... - if (!m_Timer--) + if (m_Type == adClose || !m_Timer--) { if (!StartClosing()) { @@ -683,7 +683,7 @@ void DAnimatedDoor::Tick () // //============================================================================ -DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim) +DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, DAnimatedDoor::EADType type) : DMovingCeiling (sec, false) { double topdist; @@ -717,7 +717,8 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, topdist = m_Sector->ceilingplane.fD() - topdist * m_Sector->ceilingplane.fC(); - m_Status = Opening; + m_Type = type; + m_Status = type == adClose? Waiting : Opening; m_Speed = speed; m_Delay = delay; m_Timer = m_Speed; @@ -728,9 +729,12 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, m_Line2->flags |= ML_BLOCKING; m_BotDist = m_Sector->ceilingplane.fD(); m_Sector->MoveCeiling (2048., topdist, 1); - if (m_DoorAnim->OpenSound != NAME_None) + if (type == adOpenClose) { - SN_StartSequence (m_Sector, CHAN_INTERIOR, m_DoorAnim->OpenSound, 1); + if (m_DoorAnim->OpenSound != NAME_None) + { + SN_StartSequence(m_Sector, CHAN_INTERIOR, m_DoorAnim->OpenSound, 1); + } } } @@ -741,7 +745,7 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, // //============================================================================ -bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay) +bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay, DAnimatedDoor::EADType type) { sector_t *sec; int secnum; @@ -756,7 +760,7 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay) sec = line->backsector; // Make sure door isn't already being animated - if (sec->ceilingdata != NULL) + if (sec->ceilingdata != NULL ) { if (actor->player == NULL) return false; @@ -774,7 +778,7 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay) FDoorAnimation *anim = TexMan.FindAnimatedDoor (line->sidedef[0]->GetTexture(side_t::top)); if (anim != NULL) { - new DAnimatedDoor (sec, line, speed, delay, anim); + new DAnimatedDoor (sec, line, speed, delay, anim, type); return true; } return false; @@ -799,7 +803,7 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay) if (anim != NULL) { rtn = true; - new DAnimatedDoor (sec, line, speed, delay, anim); + new DAnimatedDoor (sec, line, speed, delay, anim, type); break; } } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 6f44cedcdd..9cbb4aec1d 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -297,7 +297,13 @@ FUNC(LS_Door_Animated) if (arg3 != 0 && !P_CheckKeys (it, arg3, arg0 != 0)) return false; - return EV_SlidingDoor (ln, it, arg0, arg1, arg2); + return EV_SlidingDoor (ln, it, arg0, arg1, arg2, DAnimatedDoor::adOpenClose); +} + +FUNC(LS_Door_AnimatedClose) +// Door_AnimatedClose (tag, speed) +{ + return EV_SlidingDoor(ln, it, arg0, arg1, -1, DAnimatedDoor::adClose); } FUNC(LS_Generic_Door) @@ -3594,6 +3600,7 @@ static lnSpecFunc LineSpecials[] = /* 271 */ LS_Stairs_BuildUpDoomSync, /* 272 */ LS_Stairs_BuildDownDoomSync, /* 273 */ LS_Stairs_BuildUpDoomCrush, + /* 274 */ LS_Door_AnimatedClose, }; diff --git a/src/p_spec.h b/src/p_spec.h index c5e7b2f5c9..5cb8861e44 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -322,8 +322,15 @@ class DAnimatedDoor : public DMovingCeiling { DECLARE_CLASS (DAnimatedDoor, DMovingCeiling) public: + + enum EADType + { + adOpenClose, + adClose + }; + DAnimatedDoor (sector_t *sector); - DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim); + DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, EADType type); void Serialize(FSerializer &arc); void Tick (); @@ -336,6 +343,7 @@ protected: int m_Timer; double m_BotDist; int m_Status; + int m_Type; enum { Opening, @@ -347,12 +355,12 @@ protected: int m_Delay; bool m_SetBlocking1, m_SetBlocking2; - friend bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay); + friend bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay, EADType type); private: DAnimatedDoor (); }; -bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay); +bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay, DAnimatedDoor::EADType type); // // P_CEILNG From ccb083ed25f47ace216399c2ac6125a97c548aaa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 18:55:36 +0100 Subject: [PATCH 4/9] - fixed initialization of joystick menu with bogus MENUDEFS --- src/menu/joystickmenu.cpp | 10 +++++----- src/menu/menu.h | 2 +- src/menu/menudef.cpp | 4 ++-- wadsrc/static/menudef.txt | 7 ++++++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/menu/joystickmenu.cpp b/src/menu/joystickmenu.cpp index f1015b79c1..9b16b90f41 100644 --- a/src/menu/joystickmenu.cpp +++ b/src/menu/joystickmenu.cpp @@ -138,9 +138,13 @@ DEFINE_ACTION_FUNCTION(IJoystickConfig, GetNumAxes) void UpdateJoystickMenu(IJoystickConfig *selected) { DMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_JoystickOptions); + DMenuDescriptor **ddesc = MenuDescriptors.CheckKey("JoystickOptionsDefaults"); + if (ddesc == nullptr) return; // without any data the menu cannot be set up and must remain empty. if (desc != NULL && (*desc)->IsKindOf(RUNTIME_CLASS(DOptionMenuDescriptor))) { DOptionMenuDescriptor *opt = (DOptionMenuDescriptor *)*desc; + DOptionMenuDescriptor *dopt = (DOptionMenuDescriptor *)*ddesc; + if (dopt == nullptr) return; DMenuItemBase *it; int i; @@ -162,11 +166,7 @@ void UpdateJoystickMenu(IJoystickConfig *selected) } } } -#ifdef _WIN32 - opt->mItems.Resize(8); -#else - opt->mItems.Resize(5); -#endif + opt->mItems = dopt->mItems; it = opt->GetItem("ConfigureMessage"); if (it != nullptr) it->SetValue(0, !!Joysticks.Size()); diff --git a/src/menu/menu.h b/src/menu/menu.h index 68367e701b..d272fe242a 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -112,7 +112,7 @@ class DMenuDescriptor : public DObject public: FName mMenuName; FString mNetgameMessage; - PClass *mClass; + PClass *mClass = nullptr; virtual size_t PropagateMark() { return 0; } }; diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index ec1ae12b56..8afed617e4 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -950,9 +950,9 @@ void M_ParseMenuDefs() } } } - DefaultListMenuClass = DefaultListMenuSettings->GetClass(); + DefaultListMenuClass = DefaultListMenuSettings->mClass; DefaultListMenuSettings = nullptr; - DefaultOptionMenuClass = DefaultOptionMenuSettings->GetClass(); + DefaultOptionMenuClass = DefaultOptionMenuSettings->mClass; DefaultOptionMenuSettings = nullptr; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 3fba5fd6a0..d90d1851c9 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -558,7 +558,7 @@ OptionMenu "MouseOptions" // //------------------------------------------------------------------------------------------- -OptionMenu "JoystickOptions" +OptionMenu "JoystickOptionsDefaults" { Title "$JOYMNU_OPTIONS" Option "$JOYMNU_ENABLE", "use_joystick", "YesNo" @@ -576,6 +576,11 @@ OptionMenu "JoystickOptions" // The rest will be filled in by joystick code if devices get connected or disconnected } +OptionMenu "JoystickOptions" +{ + Title "$JOYMNU_OPTIONS" +} + OptionValue "JoyAxisMapNames" { -1, "$OPTVAL_NONE" From 944f2bf266db79349564ada1343ecd961e19142e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 19:29:07 +0100 Subject: [PATCH 5/9] - fixed armor save percentage values in Dehacked. --- src/d_dehacked.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 9cfd745203..7e2b22e277 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -1942,13 +1942,13 @@ static int PatchMisc (int dummy) if (armor!=NULL) { armor->IntVar(NAME_SaveAmount) = 100 * deh.GreenAC; - armor->FloatVar(NAME_SavePercent) = deh.GreenAC == 1 ? 0.33335 : 0.5; + armor->FloatVar(NAME_SavePercent) = deh.GreenAC == 1 ? 33.335 : 50; } armor = GetDefaultByName ("BlueArmor"); if (armor!=NULL) { armor->IntVar(NAME_SaveAmount) = 100 * deh.BlueAC; - armor->FloatVar(NAME_SavePercent) = deh.BlueAC == 1 ? 0.33335 : 0.5; + armor->FloatVar(NAME_SavePercent) = deh.BlueAC == 1 ? 33.335 : 50; } auto barmor = GetDefaultByName ("ArmorBonus"); From 36e5bab657b7fa90ec35de60448a7eeafee2439e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 19:45:03 +0100 Subject: [PATCH 6/9] - removed the fixed search path for FMod on drive E: because this can cause problems with automated builds on unknown systems. This should never have been set up like this. --- src/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84e1f576d7..c4e07aa73a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -103,8 +103,6 @@ if( WIN32 ) set( FMOD_SEARCH_PATHS "C:/Program Files/FMOD SoundSystem/FMOD Programmers API ${WIN_TYPE}/api" "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API ${WIN_TYPE}/api" - # This next one is for Randy. - "E:/Software/Dev/FMOD/${WIN_TYPE}/api" ) set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES inc ) set( FMOD_LIB_PATH_SUFFIXES PATH_SUFFIXES lib ) From 1d5203777935890aaa639b43c9a8d350a8acf9a8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 21:01:52 +0100 Subject: [PATCH 7/9] - skip the Direct3D setup if building with a non-XP toolset on Visual Studio. --- src/CMakeLists.txt | 101 ++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4e07aa73a..b673b2c20e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,55 +107,62 @@ if( WIN32 ) set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES inc ) set( FMOD_LIB_PATH_SUFFIXES PATH_SUFFIXES lib ) - find_path( D3D_INCLUDE_DIR d3d9.h - PATHS ENV DXSDK_DIR - PATH_SUFFIXES Include ) - if( NOT D3D_INCLUDE_DIR ) - # Modern versions of the Windows SDK include d3d9.h. Unfortunately, - # CMake cannot find this file via find_path, so we check for it using - # CHECK_INCLUDE_FILE. - CHECK_INCLUDE_FILE( d3d9.h D3D9_H_FOUND ) - if ( NOT D3D9_H_FOUND ) - message( SEND_ERROR "Could not find DirectX 9 header files" ) - endif() - else() - include_directories( ${D3D_INCLUDE_DIR} ) - endif() - - find_path( XINPUT_INCLUDE_DIR xinput.h - PATHS ENV DXSDK_DIR - PATH_SUFFIXES Include ) - if( NOT XINPUT_INCLUDE_DIR ) - # Modern versions of the Windows SDK include xinput.h. Unfortunately, - # CMake cannot find this file via find_path, so we check for it using - # CHECK_INCLUDE_FILES. windows.h must be included before xinput.h. - CHECK_INCLUDE_FILES( "windows.h;xinput.h" XINPUT_H_FOUND ) - if( NOT XINPUT_H_FOUND ) - message( WARNING "Could not find xinput.h. XInput will be disabled." ) - add_definitions( -DNO_XINPUT ) - endif() - else() - include_directories( ${XINPUT_INCLUDE_DIR} ) - endif() - - find_library( DX_dinput8_LIBRARY dinput8 - PATHS ENV DXSDK_DIR - PATH_SUFFIXES Lib Lib/${XBITS} ) - find_library( DX_dxguid_LIBRARY dxguid - PATHS ENV DXSDK_DIR - PATH_SUFFIXES Lib Lib/${XBITS} ) - - # Modern versions of the Windows SDK include dinput8.lib. Unfortunately, - # CMake cannot find these libraries via find_library. - if( NOT DX_dinput8_LIBRARY ) - # If we got this far, assume dinput8.lib is in the system library path. + if( ( MSVC14 AND NOT CMAKE_GENERATOR_TOOLSET STREQUAL "v140_xp" ) OR # For VS 2015. + ( MSVC15 AND NOT CMAKE_GENERATOR_TOOLSET STREQUAL "v150_xp" ) ) # For VS 2017. + # for modern Windows SDKs the DirectX headers should be available by default. set( DX_dinput8_LIBRARY dinput8 ) - endif() + else() + + find_path( D3D_INCLUDE_DIR d3d9.h + PATHS ENV DXSDK_DIR + PATH_SUFFIXES Include ) + if( NOT D3D_INCLUDE_DIR ) + # Modern versions of the Windows SDK include d3d9.h. Unfortunately, + # CMake cannot find this file via find_path, so we check for it using + # CHECK_INCLUDE_FILE. + CHECK_INCLUDE_FILE( d3d9.h D3D9_H_FOUND ) + if ( NOT D3D9_H_FOUND ) + message( SEND_ERROR "Could not find DirectX 9 header files" ) + endif() + else() + include_directories( ${D3D_INCLUDE_DIR} ) + endif() + + find_path( XINPUT_INCLUDE_DIR xinput.h + PATHS ENV DXSDK_DIR + PATH_SUFFIXES Include ) + if( NOT XINPUT_INCLUDE_DIR ) + # Modern versions of the Windows SDK include xinput.h. Unfortunately, + # CMake cannot find this file via find_path, so we check for it using + # CHECK_INCLUDE_FILES. windows.h must be included before xinput.h. + CHECK_INCLUDE_FILES( "windows.h;xinput.h" XINPUT_H_FOUND ) + if( NOT XINPUT_H_FOUND ) + message( WARNING "Could not find xinput.h. XInput will be disabled." ) + add_definitions( -DNO_XINPUT ) + endif() + else() + include_directories( ${XINPUT_INCLUDE_DIR} ) + endif() - # Modern versions of the Windows SDK do NOT include dxguid.lib. Its contents - # were moved to dinput8.lib. - if( NOT DX_dxguid_LIBRARY ) - message( STATUS "Could not find dxguid.lib. Build may fail on old Windows SDKs.") + find_library( DX_dinput8_LIBRARY dinput8 + PATHS ENV DXSDK_DIR + PATH_SUFFIXES Lib Lib/${XBITS} ) + find_library( DX_dxguid_LIBRARY dxguid + PATHS ENV DXSDK_DIR + PATH_SUFFIXES Lib Lib/${XBITS} ) + + # Modern versions of the Windows SDK include dinput8.lib. Unfortunately, + # CMake cannot find these libraries via find_library. + if( NOT DX_dinput8_LIBRARY ) + # If we got this far, assume dinput8.lib is in the system library path. + set( DX_dinput8_LIBRARY dinput8 ) + endif() + + # Modern versions of the Windows SDK do NOT include dxguid.lib. Its contents + # were moved to dinput8.lib. + if( NOT DX_dxguid_LIBRARY ) + message( STATUS "Could not find dxguid.lib. Build may fail on old Windows SDKs.") + endif() endif() set( ZDOOM_LIBS From b523aa13c8bd1b2aaef8ef05b57c1cf99fcc6f40 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 21:51:32 +0100 Subject: [PATCH 8/9] - fixed crash with bad state labels. --- src/scripting/backend/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index db7d7425fe..252788023a 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -1530,7 +1530,7 @@ FxExpression *FxTypeCast::Resolve(FCompileContext &ctx) SAFE_RESOLVE(basex, ctx); // first deal with the simple types - if (ValueType == TypeError || basex->ValueType == TypeError) + if (ValueType == TypeError || basex->ValueType == TypeError || basex->ValueType == nullptr) { ScriptPosition.Message(MSG_ERROR, "Trying to cast to invalid type."); delete this; From 18925d07beb6cb0f8d2890eb40c7fcc7c2a63c3f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Feb 2017 23:17:19 +0100 Subject: [PATCH 9/9] - fixed a typo. --- src/p_doors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_doors.cpp b/src/p_doors.cpp index aff66cd740..05c93a8989 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -539,7 +539,7 @@ void DAnimatedDoor::Serialize(FSerializer &arc) ("dooranim", m_DoorAnim) ("setblock1", m_SetBlocking1) ("setblock2", m_SetBlocking2) - ("tyoe", m_Type); + ("type", m_Type); } //============================================================================