mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 06:41:41 +00:00
Merge branch 'master' of https://github.com/coelckers/gzdoom into stereo3d
Conflicts: src/win32/i_system.cpp
This commit is contained in:
commit
10088544c3
50 changed files with 2403 additions and 2041 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -40,3 +40,4 @@
|
|||
/zlib/x64/
|
||||
/build_vc2013_64bit
|
||||
/build_vc2015
|
||||
build_cmake
|
||||
|
|
|
@ -27,7 +27,8 @@ II. Implementation Semantics
|
|||
II.A : Storage and Retrieval of Data
|
||||
------------------------------------
|
||||
|
||||
No changes.
|
||||
Any TEXTMAP lump in the described namespaces must be encoded in ISO 8859-1 which
|
||||
as of this writing is the only character encoding supported by ZDoom.
|
||||
|
||||
-----------------------------------
|
||||
II.B : Storage Within Archive Files
|
||||
|
@ -237,6 +238,7 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
|||
scalex = <float>; // Vertical scaling on thing. Default = 0 (ignored).
|
||||
scaley = <float>; // Horizontal scaling on thing. Default = 0 (ignored).
|
||||
scale = <float>; // Vertical and horizontal scaling on thing. Default = 0 (ignored).
|
||||
floatbobphase = <int>; // Sets the thing's floatbobphase. Valid phase values are 0-63. Default = -1 (use actor class default).
|
||||
|
||||
* Note about arg0str
|
||||
|
||||
|
|
|
@ -509,6 +509,11 @@ if( NOT MSVC )
|
|||
add_definitions( -D__forceinline=inline )
|
||||
endif( NOT MSVC )
|
||||
|
||||
# Fix stat in v140_xp (broken in RTM and Update 1 so far)
|
||||
if( MSVC AND MSVC_VERSION EQUAL 1900 AND CMAKE_GENERATOR_TOOLSET STREQUAL "v140_xp" )
|
||||
add_definitions( -D_stat64i32=VS14Stat )
|
||||
endif( MSVC AND MSVC_VERSION EQUAL 1900 AND CMAKE_GENERATOR_TOOLSET STREQUAL "v140_xp" )
|
||||
|
||||
if( UNIX )
|
||||
CHECK_LIBRARY_EXISTS( rt clock_gettime "" CLOCK_GETTIME_IN_RT )
|
||||
if( NOT CLOCK_GETTIME_IN_RT )
|
||||
|
|
|
@ -2328,7 +2328,9 @@ void AM_drawWalls (bool allmap)
|
|||
AM_drawMline (&l, AMColors.LockedColor); // locked special
|
||||
}
|
||||
}
|
||||
else if (am_showtriggerlines && AMColors.isValid(AMColors.SpecialWallColor) && lines[i].special != 0
|
||||
else if (am_showtriggerlines && AMColors.isValid(AMColors.SpecialWallColor)
|
||||
&& LineSpecialsInfo[lines[i].special] != NULL
|
||||
&& LineSpecialsInfo[lines[i].special]->max_args >= 0
|
||||
&& lines[i].special != Door_Open
|
||||
&& lines[i].special != Door_Close
|
||||
&& lines[i].special != Door_CloseWaitOpen
|
||||
|
|
|
@ -368,8 +368,7 @@ bool FConfigFile::DeleteCurrentSection()
|
|||
LastSectionPtr = &sec->Next;
|
||||
}
|
||||
|
||||
CurrentSection->~FConfigSection();
|
||||
delete[] (char *)CurrentSection;
|
||||
delete CurrentSection;
|
||||
|
||||
CurrentSection = sec->Next;
|
||||
return CurrentSection != NULL;
|
||||
|
|
|
@ -973,7 +973,7 @@ void NetUpdate (void)
|
|||
{
|
||||
I_StartTic ();
|
||||
D_ProcessEvents ();
|
||||
if ((maketic - gametic) / ticdup >= BACKUPTICS/2-1)
|
||||
if (pauseext || (maketic - gametic) / ticdup >= BACKUPTICS/2-1)
|
||||
break; // can't hold any more
|
||||
|
||||
//Printf ("mk:%i ",maketic);
|
||||
|
@ -1204,7 +1204,7 @@ void NetUpdate (void)
|
|||
|
||||
// Send current network delay
|
||||
// The number of tics we just made should be removed from the count.
|
||||
netbuffer[k++] = ((maketic - newtics - gametic) / ticdup);
|
||||
netbuffer[k++] = ((maketic - numtics - gametic) / ticdup);
|
||||
|
||||
if (numtics > 0)
|
||||
{
|
||||
|
@ -1810,7 +1810,8 @@ void TryRunTics (void)
|
|||
|
||||
// If paused, do not eat more CPU time than we need, because it
|
||||
// will all be wasted anyway.
|
||||
if (pauseext) r_NoInterpolate = true;
|
||||
if (pauseext)
|
||||
r_NoInterpolate = true;
|
||||
bool doWait = cl_capfps || r_NoInterpolate /*|| netgame*/;
|
||||
|
||||
// get real tics
|
||||
|
@ -1828,6 +1829,9 @@ void TryRunTics (void)
|
|||
// get available tics
|
||||
NetUpdate ();
|
||||
|
||||
if (pauseext)
|
||||
return;
|
||||
|
||||
lowtic = INT_MAX;
|
||||
numplaying = 0;
|
||||
for (i = 0; i < doomcom.numnodes; i++)
|
||||
|
@ -1935,7 +1939,7 @@ void TryRunTics (void)
|
|||
C_Ticker ();
|
||||
M_Ticker ();
|
||||
I_GetTime (true);
|
||||
if (!pauseext) G_Ticker();
|
||||
G_Ticker();
|
||||
gametic++;
|
||||
|
||||
NetUpdate (); // check for new console commands
|
||||
|
|
|
@ -432,7 +432,7 @@ WORD FDecalLib::GetDecalID (FScanner &sc)
|
|||
unsigned long num = strtoul (sc.String, NULL, 10);
|
||||
if (num < 1 || num > 65535)
|
||||
{
|
||||
sc.MustGetStringName ("Decal ID must be between 1 and 65535");
|
||||
sc.ScriptError ("Decal ID must be between 1 and 65535");
|
||||
}
|
||||
return (WORD)num;
|
||||
}
|
||||
|
@ -603,16 +603,18 @@ void FDecalLib::ParseGenerator (FScanner &sc)
|
|||
{
|
||||
const PClass *type;
|
||||
FDecalBase *decal;
|
||||
AActor *actor;
|
||||
bool optional = false;
|
||||
|
||||
// Get name of generator (actor)
|
||||
sc.MustGetString ();
|
||||
optional = sc.Compare("optional");
|
||||
if (optional) sc.MustGetString();
|
||||
|
||||
type = PClass::FindClass (sc.String);
|
||||
if (type == NULL || type->ActorInfo == NULL)
|
||||
{
|
||||
sc.ScriptError ("%s is not an actor.", sc.String);
|
||||
if (!optional) sc.ScriptError ("%s is not an actor.", sc.String);
|
||||
}
|
||||
actor = (AActor *)type->Defaults;
|
||||
|
||||
// Get name of generated decal
|
||||
sc.MustGetString ();
|
||||
|
@ -625,14 +627,17 @@ void FDecalLib::ParseGenerator (FScanner &sc)
|
|||
decal = ScanTreeForName (sc.String, Root);
|
||||
if (decal == NULL)
|
||||
{
|
||||
sc.ScriptError ("%s has not been defined.", sc.String);
|
||||
if (!optional) sc.ScriptError ("%s has not been defined.", sc.String);
|
||||
}
|
||||
}
|
||||
|
||||
actor->DecalGenerator = decal;
|
||||
if (decal != NULL)
|
||||
if (type != NULL)
|
||||
{
|
||||
decal->Users.Push (type);
|
||||
AActor *actor = (AActor *)type->Defaults;
|
||||
actor->DecalGenerator = decal;
|
||||
if (decal != NULL)
|
||||
{
|
||||
decal->Users.Push(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -365,6 +365,7 @@ struct FMapThing
|
|||
short pitch;
|
||||
short roll;
|
||||
DWORD RenderStyle;
|
||||
int FloatbobPhase;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -698,6 +698,13 @@ void G_DoCompleted (void)
|
|||
|
||||
gameaction = ga_nothing;
|
||||
|
||||
if ( gamestate == GS_DEMOSCREEN
|
||||
|| gamestate == GS_FULLCONSOLE
|
||||
|| gamestate == GS_STARTUP)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (gamestate == GS_TITLELEVEL)
|
||||
{
|
||||
level.MapName = nextlevel;
|
||||
|
|
|
@ -339,7 +339,7 @@ struct level_info_t
|
|||
TArray<FSpecialAction> specialactions;
|
||||
|
||||
TArray<FSoundID> PrecacheSounds;
|
||||
TArray<FTextureID> PrecacheTextures;
|
||||
TArray<FString> PrecacheTextures;
|
||||
|
||||
level_info_t()
|
||||
{
|
||||
|
@ -563,8 +563,10 @@ enum ESkillProperty
|
|||
SKILLP_FriendlyHealth,
|
||||
SKILLP_NoPain,
|
||||
SKILLP_ArmorFactor,
|
||||
SKILLP_HealthFactor,
|
||||
SKILLP_EasyKey,
|
||||
SKILLP_SlowMonsters,
|
||||
SKILLP_Infight,
|
||||
};
|
||||
int G_SkillProperty(ESkillProperty prop);
|
||||
const char * G_SkillName();
|
||||
|
@ -602,7 +604,9 @@ struct FSkillInfo
|
|||
fixed_t MonsterHealth;
|
||||
fixed_t FriendlyHealth;
|
||||
bool NoPain;
|
||||
int Infighting;
|
||||
fixed_t ArmorFactor;
|
||||
fixed_t HealthFactor;
|
||||
|
||||
FSkillInfo() {}
|
||||
FSkillInfo(const FSkillInfo &other)
|
||||
|
|
|
@ -1077,15 +1077,8 @@ DEFINE_MAP_OPTION(PrecacheTextures, true)
|
|||
do
|
||||
{
|
||||
parse.sc.MustGetString();
|
||||
FTextureID tex = TexMan.CheckForTexture(parse.sc.String, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_ReturnFirst);
|
||||
if (!tex.isValid())
|
||||
{
|
||||
parse.sc.ScriptMessage("Unknown texture \"%s\"", parse.sc.String);
|
||||
}
|
||||
else
|
||||
{
|
||||
info->PrecacheTextures.Push(tex);
|
||||
}
|
||||
//the texture manager is not initialized here so all we can do is store the texture's name.
|
||||
info->PrecacheTextures.Push(parse.sc.String);
|
||||
} while (parse.sc.CheckString(","));
|
||||
}
|
||||
|
||||
|
|
|
@ -236,10 +236,12 @@ bool P_GiveBody (AActor *actor, int num, int max)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (num > 0)
|
||||
{
|
||||
if (player->health < max)
|
||||
{
|
||||
num = FixedMul(num, G_SkillProperty(SKILLP_HealthFactor));
|
||||
if (num < 1) num = 1;
|
||||
player->health += num;
|
||||
if (player->health > max)
|
||||
{
|
||||
|
@ -680,6 +682,7 @@ AInventory *AInventory::CreateCopy (AActor *other)
|
|||
{
|
||||
AInventory *copy;
|
||||
|
||||
Amount = MIN(Amount, MaxAmount);
|
||||
if (GoAway ())
|
||||
{
|
||||
copy = static_cast<AInventory *>(Spawn (GetClass(), 0, 0, 0, NO_REPLACE));
|
||||
|
|
|
@ -186,10 +186,12 @@ void ASkyPicker::PostBeginPlay ()
|
|||
if (0 == (args[1] & 2))
|
||||
{
|
||||
Sector->CeilingSkyBox = box;
|
||||
if (box == NULL) Sector->MoreFlags |= SECF_NOCEILINGSKYBOX; // sector should ignore the level's default skybox
|
||||
}
|
||||
if (0 == (args[1] & 1))
|
||||
{
|
||||
Sector->FloorSkyBox = box;
|
||||
if (box == NULL) Sector->MoreFlags |= SECF_NOFLOORSKYBOX; // sector should ignore the level's default skybox
|
||||
}
|
||||
}
|
||||
Destroy ();
|
||||
|
|
|
@ -134,6 +134,7 @@ DHUDMessage::DHUDMessage (FFont *font, const char *text, float x, float y, int h
|
|||
NoWrap = false;
|
||||
ClipX = ClipY = ClipWidth = ClipHeight = 0;
|
||||
WrapWidth = 0;
|
||||
HandleAspect = true;
|
||||
Top = y;
|
||||
Next = NULL;
|
||||
Lines = NULL;
|
||||
|
@ -196,6 +197,14 @@ void DHUDMessage::Serialize (FArchive &arc)
|
|||
NoWrap = false;
|
||||
ClipX = ClipY = ClipWidth = ClipHeight = WrapWidth = 0;
|
||||
}
|
||||
if (SaveVersion >= 4525)
|
||||
{
|
||||
arc << HandleAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleAspect = true;
|
||||
}
|
||||
if (arc.IsLoading ())
|
||||
{
|
||||
Lines = NULL;
|
||||
|
@ -257,7 +266,7 @@ void DHUDMessage::CalcClipCoords(int hudheight)
|
|||
else
|
||||
{
|
||||
screen->VirtualToRealCoordsInt(x, y, w, h,
|
||||
HUDWidth, hudheight, false, true);
|
||||
HUDWidth, hudheight, false, HandleAspect);
|
||||
ClipLeft = x;
|
||||
ClipTop = y;
|
||||
ClipRight = x + w;
|
||||
|
|
|
@ -94,12 +94,13 @@ public:
|
|||
NoWrap = nowrap;
|
||||
ResetText(SourceText);
|
||||
}
|
||||
void SetClipRect(int x, int y, int width, int height)
|
||||
void SetClipRect(int x, int y, int width, int height, bool aspect)
|
||||
{
|
||||
ClipX = x;
|
||||
ClipY = y;
|
||||
ClipWidth = width;
|
||||
ClipHeight = height;
|
||||
HandleAspect = aspect;
|
||||
}
|
||||
void SetWrapWidth(int wrap)
|
||||
{
|
||||
|
@ -119,6 +120,7 @@ protected:
|
|||
int HUDWidth, HUDHeight;
|
||||
int ClipX, ClipY, ClipWidth, ClipHeight, WrapWidth; // in HUD coords
|
||||
int ClipLeft, ClipTop, ClipRight, ClipBot; // in screen coords
|
||||
bool HandleAspect;
|
||||
EColorRange TextColor;
|
||||
FFont *Font;
|
||||
FRenderStyle Style;
|
||||
|
|
|
@ -1338,17 +1338,17 @@ void DBaseStatusBar::Draw (EHudState state)
|
|||
{
|
||||
if (Scaled)
|
||||
{
|
||||
y -= Scale (10, SCREENHEIGHT, 200);
|
||||
y -= Scale (11, SCREENHEIGHT, 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SCREENWIDTH < 640)
|
||||
{
|
||||
y -= 11;
|
||||
y -= 12;
|
||||
}
|
||||
else
|
||||
{ // Get past the tops of the gargoyles' wings
|
||||
y -= 26;
|
||||
y -= 28;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,6 +83,8 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.FriendlyHealth = FRACUNIT;
|
||||
skill.NoPain = false;
|
||||
skill.ArmorFactor = FRACUNIT;
|
||||
skill.Infighting = 0;
|
||||
skill.HealthFactor = FRACUNIT;
|
||||
|
||||
sc.MustGetString();
|
||||
skill.Name = sc.String;
|
||||
|
@ -266,6 +268,20 @@ void FMapInfoParser::ParseSkill ()
|
|||
sc.MustGetFloat();
|
||||
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
|
||||
}
|
||||
else if (sc.Compare("HealthFactor"))
|
||||
{
|
||||
ParseAssign();
|
||||
sc.MustGetFloat();
|
||||
skill.HealthFactor = FLOAT2FIXED(sc.Float);
|
||||
}
|
||||
else if (sc.Compare("NoInfighting"))
|
||||
{
|
||||
skill.Infighting = LEVEL2_NOINFIGHTING;
|
||||
}
|
||||
else if (sc.Compare("TotalInfighting"))
|
||||
{
|
||||
skill.Infighting = LEVEL2_TOTALINFIGHTING;
|
||||
}
|
||||
else if (sc.Compare("DefaultSkill"))
|
||||
{
|
||||
if (DefaultSkill >= 0)
|
||||
|
@ -384,6 +400,17 @@ int G_SkillProperty(ESkillProperty prop)
|
|||
|
||||
case SKILLP_ArmorFactor:
|
||||
return AllSkills[gameskill].ArmorFactor;
|
||||
|
||||
case SKILLP_HealthFactor:
|
||||
return AllSkills[gameskill].HealthFactor;
|
||||
|
||||
case SKILLP_Infight:
|
||||
// This property also needs to consider the level flags for the same info.
|
||||
if (level.flags2 & LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (level.flags2 & LEVEL2_NOINFIGHTING) return -1;
|
||||
if (AllSkills[gameskill].Infighting == LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (AllSkills[gameskill].Infighting == LEVEL2_NOINFIGHTING) return -1;
|
||||
return infighting;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -463,7 +490,9 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
|
|||
MonsterHealth = other.MonsterHealth;
|
||||
FriendlyHealth = other.FriendlyHealth;
|
||||
NoPain = other.NoPain;
|
||||
Infighting = other.Infighting;
|
||||
ArmorFactor = other.ArmorFactor;
|
||||
HealthFactor = other.HealthFactor;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool bac
|
|||
|
||||
if (in_area==area_above)
|
||||
{
|
||||
if (sec->heightsec->MoreFlags&SECF_FAKEFLOORONLY || sec->GetTexture(sector_t::ceiling)==skyflatnum) in_area=area_normal;
|
||||
if (sec->heightsec->MoreFlags&SECF_FAKEFLOORONLY /*|| sec->GetTexture(sector_t::ceiling)==skyflatnum*/) in_area=area_normal;
|
||||
}
|
||||
|
||||
int diffTex = (sec->heightsec->MoreFlags & SECF_CLIPFAKEPLANES);
|
||||
|
|
|
@ -80,8 +80,7 @@ void GLWall::SkyPlane(sector_t *sector, int plane, bool allowreflect)
|
|||
else if (sector->GetTexture(plane)==skyflatnum)
|
||||
{
|
||||
GLSkyInfo skyinfo;
|
||||
ASkyViewpoint * skyboxx = plane == sector_t::floor? sector->FloorSkyBox : sector->CeilingSkyBox;
|
||||
if (skyboxx == NULL) skyboxx = level.DefaultSkybox;
|
||||
ASkyViewpoint * skyboxx = sector->GetSkyBox(plane);
|
||||
|
||||
// JUSTHIT is used as an indicator that a skybox is in use.
|
||||
// This is to avoid recursion
|
||||
|
|
|
@ -1420,7 +1420,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
|
|||
sector_t * realback;
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (seg->linedef-lines==4)
|
||||
if (seg->linedef-lines==5835)
|
||||
{
|
||||
int a = 0;
|
||||
}
|
||||
|
|
|
@ -1045,6 +1045,19 @@ public:
|
|||
return text;
|
||||
}
|
||||
|
||||
int Draw(FOptionMenuDescriptor*desc, int y, int indent, bool selected)
|
||||
{
|
||||
if (mEntering)
|
||||
{
|
||||
// reposition the text so that the cursor is visible when in entering mode.
|
||||
FString text = Represent();
|
||||
int tlen = SmallFont->StringWidth(text) * CleanXfac_1;
|
||||
int newindent = screen->GetWidth() - tlen - CURSORSPACE;
|
||||
if (newindent < indent) indent = newindent;
|
||||
}
|
||||
return FOptionMenuFieldBase::Draw(desc, y, indent, selected);
|
||||
}
|
||||
|
||||
bool MenuEvent ( int mkey, bool fromcontroller )
|
||||
{
|
||||
if ( mkey == MKEY_Enter )
|
||||
|
|
|
@ -396,6 +396,7 @@ xx(Roll)
|
|||
xx(Scale)
|
||||
xx(ScaleX)
|
||||
xx(ScaleY)
|
||||
xx(Floatbobphase)
|
||||
|
||||
xx(Blocking)
|
||||
xx(Blockmonsters)
|
||||
|
|
|
@ -133,6 +133,16 @@ enum
|
|||
ARMORINFO_ACTUALSAVEAMOUNT,
|
||||
};
|
||||
|
||||
// PickActor
|
||||
// [JP] I've renamed these flags to something else to avoid confusion with the other PAF_ flags
|
||||
enum
|
||||
{
|
||||
// PAF_FORCETID,
|
||||
// PAF_RETURNTID
|
||||
PICKAF_FORCETID = 1,
|
||||
PICKAF_RETURNTID = 2,
|
||||
};
|
||||
|
||||
struct CallReturn
|
||||
{
|
||||
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
|
||||
|
@ -5305,6 +5315,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
|
|||
ClipRectWidth = argCount > 2 ? args[2] : 0;
|
||||
ClipRectHeight = argCount > 3 ? args[3] : 0;
|
||||
WrapWidth = argCount > 4 ? args[4] : 0;
|
||||
HandleAspect = argCount > 5 ? !!args[5] : true;
|
||||
break;
|
||||
|
||||
case ACSF_SetHUDWrapWidth:
|
||||
|
@ -5779,11 +5790,10 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
wallMask = args[6];
|
||||
}
|
||||
|
||||
bool forceTID = 0;
|
||||
int flags = 0;
|
||||
if (argCount >= 8)
|
||||
{
|
||||
if (args[7] != 0)
|
||||
forceTID = 1;
|
||||
flags = args[7];
|
||||
}
|
||||
|
||||
AActor* pickedActor = P_LinePickActor(actor, args[1] << 16, args[3], args[2] << 16, actorMask, wallMask);
|
||||
|
@ -5791,15 +5801,19 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!(forceTID) && (args[4] == 0) && (pickedActor->tid == 0))
|
||||
if (!(flags & PICKAF_FORCETID) && (args[4] == 0) && (pickedActor->tid == 0))
|
||||
return 0;
|
||||
|
||||
if ((pickedActor->tid == 0) || (forceTID))
|
||||
if ((pickedActor->tid == 0) || (flags & PICKAF_FORCETID))
|
||||
{
|
||||
pickedActor->RemoveFromHash();
|
||||
pickedActor->tid = args[4];
|
||||
pickedActor->AddToHash();
|
||||
}
|
||||
if (flags & PICKAF_RETURNTID)
|
||||
{
|
||||
return pickedActor->tid;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
@ -5906,6 +5920,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -7841,7 +7856,7 @@ scriptwait:
|
|||
}
|
||||
break;
|
||||
}
|
||||
msg->SetClipRect(ClipRectLeft, ClipRectTop, ClipRectWidth, ClipRectHeight);
|
||||
msg->SetClipRect(ClipRectLeft, ClipRectTop, ClipRectWidth, ClipRectHeight, HandleAspect);
|
||||
if (WrapWidth != 0)
|
||||
{
|
||||
msg->SetWrapWidth(WrapWidth);
|
||||
|
@ -9453,6 +9468,7 @@ DLevelScript::DLevelScript (AActor *who, line_t *where, int num, const ScriptPtr
|
|||
activefont = SmallFont;
|
||||
hudwidth = hudheight = 0;
|
||||
ClipRectLeft = ClipRectTop = ClipRectWidth = ClipRectHeight = WrapWidth = 0;
|
||||
HandleAspect = true;
|
||||
state = SCRIPT_Running;
|
||||
|
||||
// Hexen waited one second before executing any open scripts. I didn't realize
|
||||
|
|
|
@ -891,6 +891,7 @@ protected:
|
|||
int hudwidth, hudheight;
|
||||
int ClipRectLeft, ClipRectTop, ClipRectWidth, ClipRectHeight;
|
||||
int WrapWidth;
|
||||
bool HandleAspect;
|
||||
FBehavior *activeBehavior;
|
||||
int InModuleScriptNumber;
|
||||
|
||||
|
|
|
@ -707,6 +707,7 @@ static int LoadSprites (spritetype *sprites, Xsprite *xsprites, int numsprites,
|
|||
mapthings[count].RenderStyle = STYLE_Count;
|
||||
mapthings[count].alpha = -1;
|
||||
mapthings[count].health = -1;
|
||||
mapthings[count].FloatbobPhase = -1;
|
||||
|
||||
if (xsprites != NULL && sprites[i].lotag == 710)
|
||||
{ // Blood ambient sound
|
||||
|
|
|
@ -1639,10 +1639,8 @@ bool AActor::OkayToSwitchTarget (AActor *other)
|
|||
|
||||
int infight;
|
||||
if (flags5 & MF5_NOINFIGHTING) infight=-1;
|
||||
else if (level.flags2 & LEVEL2_TOTALINFIGHTING) infight=1;
|
||||
else if (level.flags2 & LEVEL2_NOINFIGHTING) infight=-1;
|
||||
else infight = infighting;
|
||||
|
||||
else infight = G_SkillProperty(SKILLP_Infight);
|
||||
|
||||
if (infight < 0 && other->player == NULL && !IsHostile (other))
|
||||
{
|
||||
return false; // infighting off: Non-friendlies don't target other non-friendlies
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "p_3dmidtex.h"
|
||||
#include "d_net.h"
|
||||
#include "d_event.h"
|
||||
#include "gstrings.h"
|
||||
#include "r_data/colormaps.h"
|
||||
|
||||
#define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \
|
||||
|
@ -1599,6 +1600,11 @@ FUNC(LS_Thing_Move) // [BC]
|
|||
return P_Thing_Move (arg0, it, arg1, arg2 ? false : true);
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
TRANSLATION_ICE = 0x100007
|
||||
};
|
||||
|
||||
FUNC(LS_Thing_SetTranslation)
|
||||
// Thing_SetTranslation (tid, range)
|
||||
{
|
||||
|
@ -1615,6 +1621,10 @@ FUNC(LS_Thing_SetTranslation)
|
|||
{
|
||||
range = TRANSLATION(TRANSLATION_LevelScripted, (arg1-1));
|
||||
}
|
||||
else if (arg1 == TRANSLATION_ICE)
|
||||
{
|
||||
range = TRANSLATION(TRANSLATION_Standard, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
range = 0;
|
||||
|
@ -2985,13 +2995,14 @@ FUNC(LS_SendToCommunicator)
|
|||
{
|
||||
S_StopSound (CHAN_VOICE);
|
||||
S_Sound (CHAN_VOICE, name, 1, ATTN_NORM);
|
||||
if (arg2 == 0)
|
||||
|
||||
// Get the message from the LANGUAGE lump.
|
||||
FString msg;
|
||||
msg.Format("TXT_COMM%d", arg2);
|
||||
const char *str = GStrings[msg];
|
||||
if (str != NULL)
|
||||
{
|
||||
Printf (PRINT_CHAT, "Incoming Message\n");
|
||||
}
|
||||
else if (arg2 == 1)
|
||||
{
|
||||
Printf (PRINT_CHAT, "Incoming Message from BlackBird\n");
|
||||
Printf (PRINT_CHAT, "%s\n", str);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -938,10 +938,7 @@ static bool CanAttackHurt(AActor *victim, AActor *shooter)
|
|||
// to harm / be harmed by anything.
|
||||
if (!victim->player && !shooter->player)
|
||||
{
|
||||
int infight;
|
||||
if (level.flags2 & LEVEL2_TOTALINFIGHTING) infight = 1;
|
||||
else if (level.flags2 & LEVEL2_NOINFIGHTING) infight = -1;
|
||||
else infight = infighting;
|
||||
int infight = G_SkillProperty(SKILLP_Infight);
|
||||
|
||||
if (infight < 0)
|
||||
{
|
||||
|
|
|
@ -4917,6 +4917,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
mobj->SpawnPoint[2] = mthing->z;
|
||||
mobj->SpawnAngle = mthing->angle;
|
||||
mobj->SpawnFlags = mthing->flags;
|
||||
if (mthing->FloatbobPhase >= 0 && mthing->FloatbobPhase < 64) mobj->FloatBobPhase = mthing->FloatbobPhase;
|
||||
if (mthing->gravity < 0) mobj->gravity = -mthing->gravity;
|
||||
else if (mthing->gravity > 0) mobj->gravity = FixedMul(mobj->gravity, mthing->gravity);
|
||||
else mobj->flags &= ~MF_NOGRAVITY;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "po_man.h"
|
||||
#include "farchive.h"
|
||||
#include "r_utility.h"
|
||||
#include "a_sharedglobal.h"
|
||||
#include "r_data/colormaps.h"
|
||||
|
||||
|
||||
|
@ -800,6 +801,23 @@ int sector_t::GetCeilingLight () const
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
ASkyViewpoint *sector_t::GetSkyBox(int which)
|
||||
{
|
||||
if (which == floor)
|
||||
{
|
||||
if (FloorSkyBox != NULL) return FloorSkyBox;
|
||||
if (MoreFlags & SECF_NOFLOORSKYBOX) return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CeilingSkyBox != NULL) return CeilingSkyBox;
|
||||
if (MoreFlags & SECF_NOCEILINGSKYBOX) return NULL;
|
||||
}
|
||||
return level.DefaultSkybox;
|
||||
}
|
||||
|
||||
|
||||
sector_t *sector_t::GetHeightSec() const
|
||||
{
|
||||
if (heightsec == NULL)
|
||||
|
|
|
@ -1758,6 +1758,7 @@ void P_LoadThings (MapData * map)
|
|||
mti[i].RenderStyle = STYLE_Count;
|
||||
mti[i].alpha = -1;
|
||||
mti[i].health = 1;
|
||||
mti[i].FloatbobPhase = -1;
|
||||
flags &= ~MTF_SKILLMASK;
|
||||
mti[i].flags = (short)((flags & 0xf) | 0x7e0);
|
||||
if (gameinfo.gametype == GAME_Strife)
|
||||
|
@ -1842,6 +1843,7 @@ void P_LoadThings2 (MapData * map)
|
|||
mti[i].RenderStyle = STYLE_Count;
|
||||
mti[i].alpha = -1;
|
||||
mti[i].health = 1;
|
||||
mti[i].FloatbobPhase = -1;
|
||||
}
|
||||
delete[] mtp;
|
||||
}
|
||||
|
|
|
@ -177,10 +177,47 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
|
|||
|
||||
if ((TexMan.FindSwitch(side->GetTexture(side_t::top))) != NULL)
|
||||
{
|
||||
|
||||
// Check 3D floors on back side
|
||||
{
|
||||
sector_t * back = line->sidedef[1 - sideno]->sector;
|
||||
for (unsigned i = 0; i < back->e->XFloor.ffloors.Size(); i++)
|
||||
{
|
||||
F3DFloor *rover = back->e->XFloor.ffloors[i];
|
||||
if (!(rover->flags & FF_EXISTS)) continue;
|
||||
if (!(rover->flags & FF_UPPERTEXTURE)) continue;
|
||||
|
||||
if (user->z > rover->top.plane->ZatPoint(checkx, checky) ||
|
||||
user->z + user->height < rover->bottom.plane->ZatPoint(checkx, checky))
|
||||
continue;
|
||||
|
||||
// This 3D floor depicts a switch texture in front of the player's eyes
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return (user->z + user->height > open.top);
|
||||
}
|
||||
else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL)
|
||||
{
|
||||
// Check 3D floors on back side
|
||||
{
|
||||
sector_t * back = line->sidedef[1 - sideno]->sector;
|
||||
for (unsigned i = 0; i < back->e->XFloor.ffloors.Size(); i++)
|
||||
{
|
||||
F3DFloor *rover = back->e->XFloor.ffloors[i];
|
||||
if (!(rover->flags & FF_EXISTS)) continue;
|
||||
if (!(rover->flags & FF_LOWERTEXTURE)) continue;
|
||||
|
||||
if (user->z > rover->top.plane->ZatPoint(checkx, checky) ||
|
||||
user->z + user->height < rover->bottom.plane->ZatPoint(checkx, checky))
|
||||
continue;
|
||||
|
||||
// This 3D floor depicts a switch texture in front of the player's eyes
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return (user->z < open.bottom);
|
||||
}
|
||||
else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL)
|
||||
|
|
|
@ -474,6 +474,7 @@ public:
|
|||
th->RenderStyle = STYLE_Count;
|
||||
th->alpha = -1;
|
||||
th->health = 1;
|
||||
th->FloatbobPhase = -1;
|
||||
sc.MustGetToken('{');
|
||||
while (!sc.CheckToken('}'))
|
||||
{
|
||||
|
@ -631,6 +632,11 @@ public:
|
|||
Flag(th->flags, MTF_SECRET, key);
|
||||
break;
|
||||
|
||||
case NAME_Floatbobphase:
|
||||
CHECK_N(Zd | Zdt)
|
||||
th->FloatbobPhase = CheckInt(key);
|
||||
break;
|
||||
|
||||
case NAME_Renderstyle:
|
||||
{
|
||||
FName style = CheckString(key);
|
||||
|
|
|
@ -1087,7 +1087,8 @@ void R_Subsector (subsector_t *sub)
|
|||
basecolormap = frontsector->ColorMap;
|
||||
}
|
||||
|
||||
skybox = frontsector->CeilingSkyBox != NULL ? frontsector->CeilingSkyBox : level.DefaultSkybox;
|
||||
skybox = frontsector->GetSkyBox(sector_t::ceiling);
|
||||
|
||||
ceilingplane = frontsector->ceilingplane.PointOnSide(viewx, viewy, viewz) > 0 ||
|
||||
frontsector->GetTexture(sector_t::ceiling) == skyflatnum ||
|
||||
(skybox != NULL && skybox->bAlways) ||
|
||||
|
@ -1127,7 +1128,7 @@ void R_Subsector (subsector_t *sub)
|
|||
// killough 3/7/98: Add (x,y) offsets to flats, add deep water check
|
||||
// killough 3/16/98: add floorlightlevel
|
||||
// killough 10/98: add support for skies transferred from sidedefs
|
||||
skybox = frontsector->FloorSkyBox != NULL ? frontsector->FloorSkyBox : level.DefaultSkybox;
|
||||
skybox = frontsector->GetSkyBox(sector_t::floor);
|
||||
floorplane = frontsector->floorplane.PointOnSide(viewx, viewy, viewz) > 0 || // killough 3/7/98
|
||||
frontsector->GetTexture(sector_t::floor) == skyflatnum ||
|
||||
(skybox != NULL && skybox->bAlways) ||
|
||||
|
|
|
@ -377,6 +377,8 @@ enum
|
|||
SECF_UNDERWATERMASK = 32+64,
|
||||
SECF_DRAWN = 128, // sector has been drawn at least once
|
||||
SECF_HIDDEN = 256, // Do not draw on textured automap
|
||||
SECF_NOFLOORSKYBOX = 512, // force use of regular sky
|
||||
SECF_NOCEILINGSKYBOX = 1024, // force use of regular sky
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -490,6 +492,8 @@ struct sector_t
|
|||
DInterpolation *SetInterpolation(int position, bool attach);
|
||||
void StopInterpolation(int position);
|
||||
|
||||
ASkyViewpoint *GetSkyBox(int which);
|
||||
|
||||
enum
|
||||
{
|
||||
floor,
|
||||
|
|
|
@ -254,7 +254,7 @@ void R_InitTextureMapping ()
|
|||
void R_SetVisibility (float vis)
|
||||
{
|
||||
// Allow negative visibilities, just for novelty's sake
|
||||
//vis = clamp (vis, -204.7f, 204.7f);
|
||||
vis = clamp (vis, -204.7f, 204.7f); // (205 and larger do not work in 5:4 aspect ratio)
|
||||
|
||||
CurrentVisibility = vis;
|
||||
|
||||
|
|
|
@ -2375,6 +2375,16 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
}
|
||||
}
|
||||
|
||||
FName *aliasp = MusicAliases.CheckKey(musicname);
|
||||
if (aliasp != NULL)
|
||||
{
|
||||
if (*aliasp == NAME_None)
|
||||
{
|
||||
return true; // flagged to be ignored
|
||||
}
|
||||
musicname = aliasp->GetChars();
|
||||
}
|
||||
|
||||
if (!mus_playing.name.IsEmpty() &&
|
||||
mus_playing.handle != NULL &&
|
||||
stricmp (mus_playing.name, musicname) == 0 &&
|
||||
|
@ -2413,16 +2423,8 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
int length = 0;
|
||||
int device = MDEV_DEFAULT;
|
||||
MusInfo *handle = NULL;
|
||||
FName musicasname = musicname;
|
||||
|
||||
FName *aliasp = MusicAliases.CheckKey(musicasname);
|
||||
if (aliasp != NULL)
|
||||
{
|
||||
musicname = (musicasname = *aliasp).GetChars();
|
||||
if (musicasname == NAME_None) return true;
|
||||
}
|
||||
|
||||
int *devp = MidiDevices.CheckKey(musicasname);
|
||||
int *devp = MidiDevices.CheckKey(musicname);
|
||||
if (devp != NULL) device = *devp;
|
||||
|
||||
// Strip off any leading file:// component.
|
||||
|
|
|
@ -713,11 +713,11 @@ BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode)
|
|||
|
||||
if ( hRT )
|
||||
{
|
||||
// Must wait process to terminate to guarantee that it has exited...
|
||||
WaitForSingleObject(hProcess, INFINITE);
|
||||
|
||||
// Must wait for process to terminate to guarantee that it has exited...
|
||||
DWORD res = WaitForSingleObject(hProcess, 1000);
|
||||
CloseHandle(hRT);
|
||||
bSuccess = TRUE;
|
||||
bSuccess = (res == WAIT_OBJECT_0);
|
||||
dwErr = WAIT_TIMEOUT;
|
||||
}
|
||||
|
||||
if ( !bSuccess )
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1248,7 +1248,8 @@ void FTextureManager::PrecacheLevel (void)
|
|||
|
||||
for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++)
|
||||
{
|
||||
hitlist[level.info->PrecacheTextures[i].GetIndex()] |= FTextureManager::HIT_Wall;
|
||||
FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_ReturnFirst);
|
||||
if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall;
|
||||
}
|
||||
|
||||
for (int i = cnt - 1; i >= 0; i--)
|
||||
|
|
|
@ -1414,6 +1414,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
ACTION_PARAM_FIXED(LifeSteal, 5);
|
||||
ACTION_PARAM_INT(lifestealmax, 6);
|
||||
ACTION_PARAM_CLASS(armorbonustype, 7);
|
||||
ACTION_PARAM_SOUND(MeleeSound, 8);
|
||||
ACTION_PARAM_SOUND(MissSound, 9);
|
||||
|
||||
if (!self->player) return;
|
||||
|
||||
|
@ -1443,7 +1445,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
|
||||
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
|
||||
|
||||
if (linetarget)
|
||||
if (!linetarget)
|
||||
{
|
||||
if (MissSound) S_Sound(self, CHAN_WEAPON, MissSound, 1, ATTN_NORM);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN))
|
||||
{
|
||||
|
@ -1474,7 +1480,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
|
||||
if (weapon != NULL)
|
||||
{
|
||||
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
||||
if (MeleeSound) S_Sound(self, CHAN_WEAPON, MeleeSound, 1, ATTN_NORM);
|
||||
else S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
if (!(flags & CPF_NOTURN))
|
||||
|
@ -4884,17 +4891,19 @@ enum RadiusGiveFlags
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
||||
{
|
||||
ACTION_PARAM_START(6);
|
||||
ACTION_PARAM_START(7);
|
||||
ACTION_PARAM_CLASS(item, 0);
|
||||
ACTION_PARAM_FIXED(distance, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
ACTION_PARAM_INT(amount, 3);
|
||||
ACTION_PARAM_CLASS(filter, 4);
|
||||
ACTION_PARAM_NAME(species, 5);
|
||||
ACTION_PARAM_FIXED(mindist, 6);
|
||||
|
||||
// We need a valid item, valid targets, and a valid range
|
||||
if (item == NULL || (flags & RGF_MASK) == 0 || !flags || distance <= 0)
|
||||
if (item == NULL || (flags & RGF_MASK) == 0 || !flags || distance <= 0 || mindist >= distance)
|
||||
{
|
||||
ACTION_SET_RESULT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4903,9 +4912,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
|||
amount = 1;
|
||||
}
|
||||
FBlockThingsIterator it(FBoundingBox(self->x, self->y, distance));
|
||||
double distsquared = double(distance) * double(distance);
|
||||
|
||||
AActor *thing;
|
||||
bool given = false;
|
||||
while ((thing = it.Next()))
|
||||
{
|
||||
//[MC] Check for a filter, species, and the related exfilter/expecies/either flag(s).
|
||||
|
@ -4950,7 +4959,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
|||
bool corpsePass = !!((flags & RGF_CORPSES) && thing->flags & MF_CORPSE);
|
||||
bool killedPass = !!((flags & RGF_KILLED) && thing->flags6 & MF6_KILLED);
|
||||
bool monsterPass = !!((flags & RGF_MONSTERS) && thing->flags3 & MF3_ISMONSTER);
|
||||
bool objectPass = !!((flags & RGF_OBJECTS) && ((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE)));
|
||||
bool objectPass = !!((flags & RGF_OBJECTS) && (thing->player == NULL) && (!(thing->flags3 & MF3_ISMONSTER))
|
||||
&& ((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE)));
|
||||
bool playerPass = !!((flags & RGF_PLAYERS) && (thing->player != NULL) && (thing->player->mo == thing));
|
||||
bool voodooPass = !!((flags & RGF_VOODOO) && (thing->player != NULL) && (thing->player->mo != thing));
|
||||
//Self calls priority over the rest of this.
|
||||
|
@ -4973,20 +4983,26 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
|||
|
||||
if (selfPass || monsterPass || corpsePass || killedPass || itemPass || objectPass || missilePass || playerPass || voodooPass)
|
||||
{
|
||||
|
||||
if (flags & RGF_CUBE)
|
||||
{ // check if inside a cube
|
||||
if (fabs((double)thing->x - self->x) > (double)distance ||
|
||||
fabs((double)thing->y - self->y) > (double)distance ||
|
||||
fabs((double)(thing->z + thing->height / 2) - (self->z + self->height / 2)) > (double)distance)
|
||||
double dx = fabs((double)(thing->x - self->x));
|
||||
double dy = fabs((double)(thing->y - self->y));
|
||||
double dz = fabs((double)(thing->z + thing->height / 2) - (self->z + self->height / 2));
|
||||
double dist = (double)distance;
|
||||
double min = (double)mindist;
|
||||
if ((dx > dist || dy > dist || dz > dist) || (min && (dx < min && dy < min && dz < min)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // check if inside a sphere
|
||||
double distsquared = double(distance) * double(distance);
|
||||
double minsquared = double(mindist) * double(mindist);
|
||||
TVector3<double> tpos(thing->x, thing->y, thing->z + thing->height / 2);
|
||||
TVector3<double> spos(self->x, self->y, self->z + self->height / 2);
|
||||
if ((tpos - spos).LengthSquared() > distsquared)
|
||||
if ((tpos - spos).LengthSquared() > distsquared || (minsquared && ((tpos - spos).LengthSquared() < minsquared)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -5009,9 +5025,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
|||
{
|
||||
gift->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
given = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ACTION_SET_RESULT(given);
|
||||
}
|
||||
|
||||
|
||||
|
@ -5872,6 +5893,103 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMax)
|
|||
self->RipLevelMax = max;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// A_CheckProximity(jump, classname, distance, count, flags, ptr)
|
||||
//
|
||||
// Checks to see if a certain actor class is close to the
|
||||
// actor/pointer within distance, in numbers.
|
||||
//==========================================================================
|
||||
enum CPXFflags
|
||||
{
|
||||
CPXF_ANCESTOR = 1,
|
||||
CPXF_LESSOREQUAL = 1 << 1,
|
||||
CPXF_NOZ = 1 << 2,
|
||||
CPXF_COUNTDEAD = 1 << 3,
|
||||
CPXF_DEADONLY = 1 << 4,
|
||||
CPXF_EXACT = 1 << 5,
|
||||
};
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity)
|
||||
{
|
||||
ACTION_PARAM_START(6);
|
||||
ACTION_PARAM_STATE(jump, 0);
|
||||
ACTION_PARAM_CLASS(classname, 1);
|
||||
ACTION_PARAM_FIXED(distance, 2);
|
||||
ACTION_PARAM_INT(count, 3);
|
||||
ACTION_PARAM_INT(flags, 4);
|
||||
ACTION_PARAM_INT(ptr, 5);
|
||||
|
||||
ACTION_SET_RESULT(false); //No inventory chain results please.
|
||||
AActor *ref = COPY_AAPTR(self, ptr);
|
||||
|
||||
//We need these to check out.
|
||||
if (!ref || !jump || !classname || distance <= 0)
|
||||
return;
|
||||
|
||||
int counter = 0;
|
||||
bool result = false;
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * mo;
|
||||
|
||||
//[MC] Process of elimination, I think, will get through this as quickly and
|
||||
//efficiently as possible.
|
||||
while ((mo = it.Next()))
|
||||
{
|
||||
if (mo == ref) //Don't count self.
|
||||
continue;
|
||||
|
||||
//Check inheritance for the classname. Taken partly from CheckClass DECORATE function.
|
||||
if (flags & CPXF_ANCESTOR)
|
||||
{
|
||||
if (!(mo->GetClass()->IsAncestorOf(classname)))
|
||||
continue;
|
||||
}
|
||||
//Otherwise, just check for the regular class name.
|
||||
else if (classname != mo->GetClass())
|
||||
continue;
|
||||
|
||||
//Make sure it's in range and respect the desire for Z or not.
|
||||
if (P_AproxDistance(ref->x - mo->x, ref->y - mo->y) < distance &&
|
||||
((flags & CPXF_NOZ) ||
|
||||
((ref->z > mo->z && ref->z - (mo->z + mo->height) < distance) ||
|
||||
(ref->z <= mo->z && mo->z - (ref->z + ref->height) < distance))))
|
||||
{
|
||||
if (mo->flags6 & MF6_KILLED)
|
||||
{
|
||||
if (!(flags & (CPXF_COUNTDEAD | CPXF_DEADONLY)))
|
||||
continue;
|
||||
counter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flags & CPXF_DEADONLY)
|
||||
continue;
|
||||
counter++;
|
||||
}
|
||||
|
||||
//Abort if the number of matching classes nearby is greater, we have obviously succeeded in our goal.
|
||||
if (counter > count)
|
||||
{
|
||||
result = (flags & (CPXF_LESSOREQUAL | CPXF_EXACT)) ? false : true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (counter == count)
|
||||
result = true;
|
||||
else if (counter < count)
|
||||
result = !!((flags & CPXF_LESSOREQUAL) && !(flags & CPXF_EXACT));
|
||||
|
||||
|
||||
|
||||
if (result)
|
||||
{
|
||||
ACTION_JUMP(jump);
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
A_CheckBlock
|
||||
(state block, int flags, int ptr)
|
||||
|
@ -5930,4 +6048,4 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
|
|||
{
|
||||
ACTION_JUMP(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ const char *GetVersionString();
|
|||
|
||||
// Use 4500 as the base git save version, since it's higher than the
|
||||
// SVN revision ever got.
|
||||
#define SAVEVER 4524
|
||||
#define SAVEVER 4525
|
||||
|
||||
#define SAVEVERSTRINGIFY2(x) #x
|
||||
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
||||
|
|
|
@ -1726,3 +1726,36 @@ FString I_GetLongPathName(FString shortpath)
|
|||
delete[] buff;
|
||||
return longpath;
|
||||
}
|
||||
|
||||
#if _MSC_VER == 1900 && defined(_USING_V110_SDK71_)
|
||||
//==========================================================================
|
||||
//
|
||||
// VS14Stat
|
||||
//
|
||||
// Work around an issue where stat doesn't work with v140_xp. This was
|
||||
// supposedly fixed, but as of Update 1 continues to not function on XP.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
int VS14Stat(const char *path, struct _stat64i32 *buffer)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA data;
|
||||
if(!GetFileAttributesEx(path, GetFileExInfoStandard, &data))
|
||||
return -1;
|
||||
|
||||
buffer->st_ino = 0;
|
||||
buffer->st_mode = ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? S_IFDIR : S_IFREG)|
|
||||
((data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? S_IREAD : S_IREAD|S_IWRITE);
|
||||
buffer->st_dev = buffer->st_rdev = 0;
|
||||
buffer->st_nlink = 1;
|
||||
buffer->st_uid = 0;
|
||||
buffer->st_gid = 0;
|
||||
buffer->st_size = data.nFileSizeLow;
|
||||
buffer->st_atime = (*(QWORD*)&data.ftLastAccessTime) / 10000000 - 11644473600LL;
|
||||
buffer->st_mtime = (*(QWORD*)&data.ftLastWriteTime) / 10000000 - 11644473600LL;
|
||||
buffer->st_ctime = (*(QWORD*)&data.ftCreationTime) / 10000000 - 11644473600LL;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3061,6 +3061,7 @@ struct lemon *lemp;
|
|||
FILE *in;
|
||||
char *tpltname;
|
||||
char *cp;
|
||||
Boolean tpltnameinbuf;
|
||||
|
||||
cp = strrchr(lemp->filename,'.');
|
||||
if( cp ){
|
||||
|
@ -3070,10 +3071,13 @@ struct lemon *lemp;
|
|||
}
|
||||
if( access(buf,004)==0 ){
|
||||
tpltname = buf;
|
||||
tpltnameinbuf = LEMON_TRUE;
|
||||
}else if( access(templatename,004)==0 ){
|
||||
tpltname = templatename;
|
||||
tpltnameinbuf = LEMON_TRUE;
|
||||
}else{
|
||||
tpltname = pathsearch(lemp->argv0,templatename,0);
|
||||
tpltnameinbuf = LEMON_FALSE;
|
||||
}
|
||||
if( tpltname==0 ){
|
||||
fprintf(stderr,"Can't find the parser driver template file \"%s\".\n",
|
||||
|
@ -3084,11 +3088,11 @@ struct lemon *lemp;
|
|||
in = fopen(tpltname,"rb");
|
||||
if( in==0 ){
|
||||
fprintf(stderr,"Can't open the template file \"%s\".\n",templatename);
|
||||
free(tpltname);
|
||||
if (tpltnameinbuf == LEMON_FALSE) free(tpltname);
|
||||
lemp->errorcnt++;
|
||||
return 0;
|
||||
}
|
||||
free(tpltname);
|
||||
if (tpltnameinbuf == LEMON_FALSE) free(tpltname);
|
||||
return in;
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT);
|
||||
action native A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT);
|
||||
action native A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT);
|
||||
action native A_RadiusGive(class<Inventory> itemtype, int distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None");
|
||||
action native A_RadiusGive(class<Inventory> itemtype, int distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None", int mindist = 0);
|
||||
action native A_CountdownArg(int argnum, state targstate = "");
|
||||
action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
|
||||
action native A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true);
|
||||
|
@ -337,6 +337,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_SetRipperLevel(int level);
|
||||
action native A_SetRipMin(int min);
|
||||
action native A_SetRipMax(int max);
|
||||
action native A_CheckProximity(state jump, class<Actor> classname, float distance, int count = 1, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
action native A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
action native A_CheckSightOrRange(float distance, state label, bool two_dimension = false);
|
||||
action native A_CheckRange(float distance, state label, bool two_dimension = false);
|
||||
|
|
|
@ -484,6 +484,17 @@ enum
|
|||
QF_WAVE = 1 << 5,
|
||||
};
|
||||
|
||||
// A_CheckProximity flags
|
||||
enum
|
||||
{
|
||||
CPXF_ANCESTOR = 1,
|
||||
CPXF_LESSOREQUAL = 1 << 1,
|
||||
CPXF_NOZ = 1 << 2,
|
||||
CPXF_COUNTDEAD = 1 << 3,
|
||||
CPXF_DEADONLY = 1 << 4,
|
||||
CPXF_EXACT = 1 << 5,
|
||||
};
|
||||
|
||||
// Flags for A_CheckBlock
|
||||
// These flags only affect the calling actor('s pointer), not the ones being searched.
|
||||
enum
|
||||
|
|
|
@ -8,7 +8,7 @@ ACTOR Inventory native
|
|||
Inventory.PickupMessage "$TXT_DEFAULTPICKUPMSG"
|
||||
|
||||
action native A_JumpIfNoAmmo(state label);
|
||||
action native A_CustomPunch(int damage, bool norandom = false, int flags = CPF_USEAMMO, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus");
|
||||
action native A_CustomPunch(int damage, bool norandom = false, int flags = CPF_USEAMMO, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus", sound MeleeSound = "", sound MissSound = "");
|
||||
action native A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", int flags = 1, float range = 0);
|
||||
action native A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, int spawnofs_xy = 0, float spawnheight = 0, int flags = 0, float pitch = 0);
|
||||
action native A_RailAttack(int damage, int spawnofs_xy = 0, int useammo = true, color color1 = "", color color2 = "", int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270);
|
||||
|
|
|
@ -44,7 +44,7 @@ ACTOR Macil1
|
|||
Death:
|
||||
LEAD E 2 A_FaceTarget
|
||||
LEAD F 2 BRIGHT A_ShootGun
|
||||
LEAD E 2 A_SentinelRefire
|
||||
LEAD E 1 A_SentinelRefire
|
||||
Loop
|
||||
Pain:
|
||||
LEAD Y 3
|
||||
|
@ -80,7 +80,7 @@ ACTOR Macil2 : Macil1
|
|||
LEAD K 3
|
||||
LEAD L 3 A_NoBlocking
|
||||
LEAD MNOPQRSTUV 3
|
||||
LEAD W 4 Bright A_SpawnItemEx("AlienSpectre4", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION)
|
||||
LEAD W 3 A_SpawnItemEx("AlienSpectre4", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION)
|
||||
LEAD X -1
|
||||
Stop
|
||||
}
|
||||
|
|
|
@ -1550,6 +1550,10 @@ TXT_RANDOMGOODBYE_3 = "See you later!";
|
|||
TXT_HAVEENOUGH = "You seem to have enough!";
|
||||
TXT_GOAWAY = "Go away!";
|
||||
|
||||
TXT_COMM0 = "Incoming Message";
|
||||
TXT_COMM1 = "Incoming Message from BlackBird";
|
||||
|
||||
|
||||
// Skills:
|
||||
|
||||
SKILL_BABY = "I'm too young to die";
|
||||
|
|
|
@ -1602,10 +1602,24 @@ OptionMenu AdvSoundOptions
|
|||
Option "OPL Emulator Core", "opl_core", "OplCores"
|
||||
StaticText " "
|
||||
StaticText "GUS Emulation", 1
|
||||
TextField "GUS config file", "midi_config"
|
||||
Slider "MIDI voices", "midi_voices", 16, 256, 4, 0
|
||||
Option "Emulate TiMidity", "midi_timiditylike", "OnOff"
|
||||
Option "Read DMXGUS lumps", "midi_dmxgus", "OnOff"
|
||||
Option "GUS memory size", "gus_memsize", "GusMemory"
|
||||
StaticText " "
|
||||
StaticText "FluidSynth", 1
|
||||
TextField "Patch set", "fluid_patchset"
|
||||
Slider "Gain", "fluid_gain", 0, 10, 0.5, 1
|
||||
Option "Reverb", "fluid_reverb", "OnOff"
|
||||
Slider "MIDI voices", "fluid_voices", 16, 4096, 16, 1
|
||||
// Leaving out the more advanced stuff for now.
|
||||
StaticText " "
|
||||
StaticText "Timidity++", 1
|
||||
TextField "Path for executable", "timidity_exe"
|
||||
Option "Reverb", "timidity_reverb", "OnOff"
|
||||
Option "Chorus", "timidity_chorus", "OnOff"
|
||||
Slider "Relative volume", "timidity_mastervolume", 0, 4, 0.2, 1
|
||||
}
|
||||
|
||||
/*=======================================
|
||||
|
|
Loading…
Reference in a new issue