mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
Merge branch 'master' of https://github.com/raa-eruanna/qzdoom into qzdoom
This commit is contained in:
commit
cd2179e62a
15 changed files with 121 additions and 81 deletions
|
@ -103,12 +103,16 @@ 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 )
|
||||
|
||||
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 )
|
||||
else()
|
||||
|
||||
find_path( D3D_INCLUDE_DIR d3d9.h
|
||||
PATHS ENV DXSDK_DIR
|
||||
PATH_SUFFIXES Include )
|
||||
|
@ -159,6 +163,7 @@ if( WIN32 )
|
|||
if( NOT DX_dxguid_LIBRARY )
|
||||
message( STATUS "Could not find dxguid.lib. Build may fail on old Windows SDKs.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set( ZDOOM_LIBS
|
||||
opengl32
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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<DOptionMenuDescriptor*>(*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)
|
||||
|
|
|
@ -112,7 +112,7 @@ class DMenuDescriptor : public DObject
|
|||
public:
|
||||
FName mMenuName;
|
||||
FString mNetgameMessage;
|
||||
const PClass *mClass;
|
||||
PClass *mClass = nullptr;
|
||||
|
||||
virtual size_t PropagateMark() { return 0; }
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -291,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);
|
||||
|
@ -699,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);
|
||||
|
@ -948,7 +950,9 @@ void M_ParseMenuDefs()
|
|||
}
|
||||
}
|
||||
}
|
||||
DefaultListMenuClass = DefaultListMenuSettings->mClass;
|
||||
DefaultListMenuSettings = nullptr;
|
||||
DefaultOptionMenuClass = DefaultOptionMenuSettings->mClass;
|
||||
DefaultOptionMenuSettings = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -538,7 +538,8 @@ void DAnimatedDoor::Serialize(FSerializer &arc)
|
|||
("delay", m_Delay)
|
||||
("dooranim", m_DoorAnim)
|
||||
("setblock1", m_SetBlocking1)
|
||||
("setblock2", m_SetBlocking2);
|
||||
("setblock2", m_SetBlocking2)
|
||||
("type", 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,11 +729,14 @@ 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 (type == adOpenClose)
|
||||
{
|
||||
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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
||||
};
|
||||
|
||||
|
|
14
src/p_spec.h
14
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
|
||||
|
|
|
@ -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<float>(volume), static_cast<float>(attn));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -559,7 +559,7 @@ OptionMenu "MouseOptions"
|
|||
//
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
OptionMenu "JoystickOptions"
|
||||
OptionMenu "JoystickOptionsDefaults"
|
||||
{
|
||||
Title "$JOYMNU_OPTIONS"
|
||||
Option "$JOYMNU_ENABLE", "use_joystick", "YesNo"
|
||||
|
@ -577,6 +577,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"
|
||||
|
|
Loading…
Reference in a new issue