mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- fixed: Identification of Doom1 Freedoom IWAD did not work.
- fixed: UDMF did not initialize a sector's light colors. - fixed implementation of DF2_NOAUTOAIM flag. SVN r1356 (trunk)
This commit is contained in:
parent
35cc39f094
commit
b4b76ed4e6
11 changed files with 57 additions and 70 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
January 10, 2009 (Changes by Graf Zahl)
|
||||||
|
- fixed: Identification of Doom1 Freedoom IWAD did not work.
|
||||||
|
- fixed: UDMF did not initialize a sector's light colors.
|
||||||
|
- fixed implementation of DF2_NOAUTOAIM flag.
|
||||||
|
|
||||||
January 7, 2009 (Changes by Graf Zahl)
|
January 7, 2009 (Changes by Graf Zahl)
|
||||||
- copied some 3D floor fixes from GZDoom.
|
- copied some 3D floor fixes from GZDoom.
|
||||||
- fixed: Crushing polyobject did incomplete checks for blocked moves.
|
- fixed: Crushing polyobject did incomplete checks for blocked moves.
|
||||||
|
|
|
@ -479,19 +479,6 @@ CUSTOM_CVAR (Int, dmflags2, 0, CVAR_SERVERINFO)
|
||||||
if (p->cheats & CF_CHASECAM)
|
if (p->cheats & CF_CHASECAM)
|
||||||
cht_DoCheat (p, CHT_CHASECAM);
|
cht_DoCheat (p, CHT_CHASECAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change our autoaim settings if need be.
|
|
||||||
if (dmflags2 & DF2_NOAUTOAIM)
|
|
||||||
{
|
|
||||||
// Save our aimdist and set aimdist to 0.
|
|
||||||
p->userinfo.savedaimdist = p->userinfo.aimdist;
|
|
||||||
p->userinfo.aimdist = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Restore our aimdist.
|
|
||||||
p->userinfo.aimdist = p->userinfo.savedaimdist;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1634,18 +1621,15 @@ static EIWADType ScanIWAD (const char *iwad)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (lumpsfound[Check_FreeDoom])
|
||||||
|
{
|
||||||
|
return IWAD_FreeDoom1;
|
||||||
|
}
|
||||||
for (i = Check_e2m1; i < NUM_CHECKLUMPS; i++)
|
for (i = Check_e2m1; i < NUM_CHECKLUMPS; i++)
|
||||||
{
|
{
|
||||||
if (!lumpsfound[i])
|
if (!lumpsfound[i])
|
||||||
{
|
{
|
||||||
if (lumpsfound[Check_FreeDoom])
|
return IWAD_DoomShareware;
|
||||||
{
|
|
||||||
return IWAD_FreeDoom1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return IWAD_DoomShareware;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == NUM_CHECKLUMPS)
|
if (i == NUM_CHECKLUMPS)
|
||||||
|
|
|
@ -370,17 +370,11 @@ void D_SetupUserInfo ()
|
||||||
}
|
}
|
||||||
if (autoaim > 35.f || autoaim < 0.f)
|
if (autoaim > 35.f || autoaim < 0.f)
|
||||||
{
|
{
|
||||||
if (dmflags & DF2_NOAUTOAIM)
|
coninfo->aimdist = ANGLE_1*35;
|
||||||
coninfo->savedaimdist = ANGLE_1*35;
|
|
||||||
else
|
|
||||||
coninfo->aimdist = ANGLE_1*35;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dmflags & DF2_NOAUTOAIM)
|
coninfo->aimdist = abs ((int)(autoaim * (float)ANGLE_1));
|
||||||
coninfo->savedaimdist = abs ((int)(autoaim * (float)ANGLE_1));
|
|
||||||
else
|
|
||||||
coninfo->aimdist = abs ((int)(autoaim * (float)ANGLE_1));
|
|
||||||
}
|
}
|
||||||
coninfo->color = color;
|
coninfo->color = color;
|
||||||
coninfo->skin = R_FindSkin (skin, 0);
|
coninfo->skin = R_FindSkin (skin, 0);
|
||||||
|
@ -690,16 +684,10 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
|
||||||
angles = atof (value);
|
angles = atof (value);
|
||||||
if (angles > 35.f || angles < 0.f)
|
if (angles > 35.f || angles < 0.f)
|
||||||
{
|
{
|
||||||
if (dmflags & DF2_NOAUTOAIM)
|
|
||||||
info->savedaimdist = ANGLE_1*35;
|
|
||||||
else
|
|
||||||
info->aimdist = ANGLE_1*35;
|
info->aimdist = ANGLE_1*35;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dmflags & DF2_NOAUTOAIM)
|
|
||||||
info->savedaimdist = abs ((int)(angles * (float)ANGLE_1));
|
|
||||||
else
|
|
||||||
info->aimdist = abs ((int)(angles * (float)ANGLE_1));
|
info->aimdist = abs ((int)(angles * (float)ANGLE_1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,8 +804,11 @@ FArchive &operator<< (FArchive &arc, userinfo_t &info)
|
||||||
arc.Read (&info.netname, sizeof(info.netname));
|
arc.Read (&info.netname, sizeof(info.netname));
|
||||||
}
|
}
|
||||||
arc << info.team << info.aimdist << info.color << info.skin << info.gender << info.neverswitch;
|
arc << info.team << info.aimdist << info.color << info.skin << info.gender << info.neverswitch;
|
||||||
if (SaveVersion >= 1333) arc << info.savedaimdist;
|
if (SaveVersion >= 1333 && SaveVersion <= 1355)
|
||||||
else info.savedaimdist = info.aimdist;
|
{
|
||||||
|
int savedaimdist;
|
||||||
|
arc << savedaimdist;
|
||||||
|
}
|
||||||
return arc;
|
return arc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
// is buffered within the player data struct,
|
// is buffered within the player data struct,
|
||||||
// as commands per game tick.
|
// as commands per game tick.
|
||||||
#include "d_ticcmd.h"
|
#include "d_ticcmd.h"
|
||||||
|
#include "doomstat.h"
|
||||||
|
|
||||||
#include "a_artifacts.h"
|
#include "a_artifacts.h"
|
||||||
|
|
||||||
|
@ -195,7 +196,6 @@ struct userinfo_t
|
||||||
{
|
{
|
||||||
char netname[MAXPLAYERNAME+1];
|
char netname[MAXPLAYERNAME+1];
|
||||||
BYTE team;
|
BYTE team;
|
||||||
int savedaimdist;
|
|
||||||
int aimdist;
|
int aimdist;
|
||||||
int color;
|
int color;
|
||||||
int skin;
|
int skin;
|
||||||
|
@ -203,6 +203,8 @@ struct userinfo_t
|
||||||
bool neverswitch;
|
bool neverswitch;
|
||||||
fixed_t MoveBob, StillBob;
|
fixed_t MoveBob, StillBob;
|
||||||
int PlayerClass;
|
int PlayerClass;
|
||||||
|
|
||||||
|
int GetAimDist() const { return (dmflags2 & DF2_NOAUTOAIM)? aimdist : 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
FArchive &operator<< (FArchive &arc, userinfo_t &info);
|
FArchive &operator<< (FArchive &arc, userinfo_t &info);
|
||||||
|
|
|
@ -452,9 +452,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// [RH] bfg can be forced to not use freeaim
|
|
||||||
angle_t storedpitch = self->pitch;
|
|
||||||
int storedaimdist = player->userinfo.aimdist;
|
|
||||||
|
|
||||||
AWeapon *weapon = self->player->ReadyWeapon;
|
AWeapon *weapon = self->player->ReadyWeapon;
|
||||||
if (weapon != NULL)
|
if (weapon != NULL)
|
||||||
|
@ -463,14 +460,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dmflags2 & DF2_NO_FREEAIMBFG)
|
P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindClass("BFGBall"), self->angle, NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG));
|
||||||
{
|
|
||||||
self->pitch = 0;
|
|
||||||
player->userinfo.aimdist = ANGLE_1*35;
|
|
||||||
}
|
|
||||||
P_SpawnPlayerMissile (self, PClass::FindClass("BFGBall"));
|
|
||||||
self->pitch = storedpitch;
|
|
||||||
player->userinfo.aimdist = storedaimdist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -5372,7 +5372,7 @@ int DLevelScript::RunScript ()
|
||||||
switch (STACK(1))
|
switch (STACK(1))
|
||||||
{
|
{
|
||||||
case PLAYERINFO_TEAM: STACK(2) = userinfo->team; break;
|
case PLAYERINFO_TEAM: STACK(2) = userinfo->team; break;
|
||||||
case PLAYERINFO_AIMDIST: STACK(2) = userinfo->aimdist; break;
|
case PLAYERINFO_AIMDIST: STACK(2) = userinfo->GetAimDist(); break;
|
||||||
case PLAYERINFO_COLOR: STACK(2) = userinfo->color; break;
|
case PLAYERINFO_COLOR: STACK(2) = userinfo->color; break;
|
||||||
case PLAYERINFO_GENDER: STACK(2) = userinfo->gender; break;
|
case PLAYERINFO_GENDER: STACK(2) = userinfo->gender; break;
|
||||||
case PLAYERINFO_NEVERSWITCH: STACK(2) = userinfo->neverswitch; break;
|
case PLAYERINFO_NEVERSWITCH: STACK(2) = userinfo->neverswitch; break;
|
||||||
|
|
|
@ -122,7 +122,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl
|
||||||
AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type);
|
AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type);
|
||||||
AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type, angle_t angle);
|
AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type, angle_t angle);
|
||||||
AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, const PClass *type, angle_t angle,
|
AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, const PClass *type, angle_t angle,
|
||||||
AActor **pLineTarget = NULL, AActor **MissileActor = NULL);
|
AActor **pLineTarget = NULL, AActor **MissileActor = NULL, bool nofreeaim = false);
|
||||||
|
|
||||||
void P_CheckFakeFloorTriggers (AActor *mo, fixed_t oldz, bool oldz_has_viewheight=false);
|
void P_CheckFakeFloorTriggers (AActor *mo, fixed_t oldz, bool oldz_has_viewheight=false);
|
||||||
|
|
||||||
|
|
|
@ -1779,11 +1779,6 @@ bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y)
|
||||||
{
|
{
|
||||||
FCheckPosition tm;
|
FCheckPosition tm;
|
||||||
fixed_t newz = thing->z;
|
fixed_t newz = thing->z;
|
||||||
int side;
|
|
||||||
int oldside;
|
|
||||||
line_t* ld;
|
|
||||||
sector_t* oldsec = thing->Sector; // [RH] for sector actions
|
|
||||||
sector_t* newsec;
|
|
||||||
|
|
||||||
if (!P_CheckPosition (thing, x, y, tm))
|
if (!P_CheckPosition (thing, x, y, tm))
|
||||||
{
|
{
|
||||||
|
@ -2925,7 +2920,7 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **p
|
||||||
// vrange of 0 degrees, because then toppitch and bottompitch will
|
// vrange of 0 degrees, because then toppitch and bottompitch will
|
||||||
// be equal, and PTR_AimTraverse will never find anything to shoot at
|
// be equal, and PTR_AimTraverse will never find anything to shoot at
|
||||||
// if it crosses a line.
|
// if it crosses a line.
|
||||||
vrange = clamp (t1->player->userinfo.aimdist, ANGLE_1/2, ANGLE_1*35);
|
vrange = clamp (t1->player->userinfo.GetAimDist(), ANGLE_1/2, ANGLE_1*35);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aim.toppitch = t1->pitch - vrange;
|
aim.toppitch = t1->pitch - vrange;
|
||||||
|
|
|
@ -4796,24 +4796,27 @@ AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type, angle_t angle)
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
||||||
const PClass *type, angle_t angle, AActor **pLineTarget, AActor **pMissileActor)
|
const PClass *type, angle_t angle, AActor **pLineTarget, AActor **pMissileActor,
|
||||||
|
bool nofreeaim)
|
||||||
{
|
{
|
||||||
static const int angdiff[3] = { -1<<26, 1<<26, 0 };
|
static const int angdiff[3] = { -1<<26, 1<<26, 0 };
|
||||||
int i;
|
int i;
|
||||||
angle_t an;
|
angle_t an;
|
||||||
angle_t pitch;
|
angle_t pitch;
|
||||||
AActor *linetarget;
|
AActor *linetarget;
|
||||||
|
int vrange = nofreeaim? ANGLE_1*35 : 0;
|
||||||
|
|
||||||
// see which target is to be aimed at
|
// see which target is to be aimed at
|
||||||
i = 2;
|
i = 2;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
an = angle + angdiff[i];
|
an = angle + angdiff[i];
|
||||||
pitch = P_AimLineAttack (source, an, 16*64*FRACUNIT, &linetarget);
|
pitch = P_AimLineAttack (source, an, 16*64*FRACUNIT, &linetarget, vrange);
|
||||||
|
|
||||||
if (source->player != NULL &&
|
if (source->player != NULL &&
|
||||||
|
!nofreeaim &&
|
||||||
level.IsFreelookAllowed() &&
|
level.IsFreelookAllowed() &&
|
||||||
source->player->userinfo.aimdist <= ANGLE_1/2)
|
source->player->userinfo.GetAimDist() <= ANGLE_1/2)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -648,7 +648,7 @@ angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget)
|
||||||
|
|
||||||
if (mo->player != NULL &&
|
if (mo->player != NULL &&
|
||||||
level.IsFreelookAllowed() &&
|
level.IsFreelookAllowed() &&
|
||||||
mo->player->userinfo.aimdist <= ANGLE_1/2)
|
mo->player->userinfo.GetAimDist() <= ANGLE_1/2)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -950,19 +950,36 @@ struct UDMFParser
|
||||||
sec->ceilingplane.c = -FRACUNIT;
|
sec->ceilingplane.c = -FRACUNIT;
|
||||||
sec->ceilingplane.ic = -FRACUNIT;
|
sec->ceilingplane.ic = -FRACUNIT;
|
||||||
|
|
||||||
// [RH] Sectors default to white light with the default fade.
|
if (lightcolor == -1 && fadecolor == -1 && desaturation == -1)
|
||||||
// If they are outside (have a sky ceiling), they use the outside fog.
|
|
||||||
if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside))
|
|
||||||
{
|
{
|
||||||
if (fogMap == NULL)
|
// [RH] Sectors default to white light with the default fade.
|
||||||
fogMap = GetSpecialLights (PalEntry (255,255,255), level.outsidefog, 0);
|
// If they are outside (have a sky ceiling), they use the outside fog.
|
||||||
sec->ColorMap = fogMap;
|
if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside))
|
||||||
|
{
|
||||||
|
if (fogMap == NULL)
|
||||||
|
fogMap = GetSpecialLights (PalEntry (255,255,255), level.outsidefog, 0);
|
||||||
|
sec->ColorMap = fogMap;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (normMap == NULL)
|
||||||
|
normMap = GetSpecialLights (PalEntry (255,255,255), level.fadeto, NormalLight.Desaturate);
|
||||||
|
sec->ColorMap = normMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (normMap == NULL)
|
if (lightcolor == -1) lightcolor = PalEntry(255,255,255);
|
||||||
normMap = GetSpecialLights (PalEntry (255,255,255), level.fadeto, NormalLight.Desaturate);
|
if (fadecolor == -1)
|
||||||
sec->ColorMap = normMap;
|
{
|
||||||
|
if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside))
|
||||||
|
fadecolor = level.outsidefog;
|
||||||
|
else
|
||||||
|
fadecolor = level.fadeto;
|
||||||
|
}
|
||||||
|
if (desaturation == -1) desaturation = NormalLight.Desaturate;
|
||||||
|
|
||||||
|
sec->ColorMap = GetSpecialLights (lightcolor, fadecolor, desaturation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue