mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 23:32:04 +00:00
This commit is contained in:
commit
0af86efb17
18 changed files with 115 additions and 75 deletions
|
@ -1318,6 +1318,14 @@ public:
|
||||||
{
|
{
|
||||||
return Prev + (ticFrac * (Pos() - Prev));
|
return Prev + (ticFrac * (Pos() - Prev));
|
||||||
}
|
}
|
||||||
|
DRotator InterpolatedAngles(double ticFrac) const
|
||||||
|
{
|
||||||
|
DRotator result;
|
||||||
|
result.Yaw = PrevAngles.Yaw + deltaangle(PrevAngles.Yaw, Angles.Yaw) * ticFrac;
|
||||||
|
result.Pitch = PrevAngles.Pitch + deltaangle(PrevAngles.Pitch, Angles.Pitch) * ticFrac;
|
||||||
|
result.Roll = PrevAngles.Roll + deltaangle(PrevAngles.Roll, Angles.Roll) * ticFrac;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
DVector3 PosPlusZ(double zadd) const
|
DVector3 PosPlusZ(double zadd) const
|
||||||
{
|
{
|
||||||
return { X(), Y(), Z() + zadd };
|
return { X(), Y(), Z() + zadd };
|
||||||
|
|
|
@ -404,9 +404,9 @@ CCMD (give)
|
||||||
Net_WriteByte (DEM_GIVECHEAT);
|
Net_WriteByte (DEM_GIVECHEAT);
|
||||||
Net_WriteString (argv[1]);
|
Net_WriteString (argv[1]);
|
||||||
if (argv.argc() > 2)
|
if (argv.argc() > 2)
|
||||||
Net_WriteWord (clamp (atoi (argv[2]), 1, 32767));
|
Net_WriteLong(atoi(argv[2]));
|
||||||
else
|
else
|
||||||
Net_WriteWord (0);
|
Net_WriteLong(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CCMD (take)
|
CCMD (take)
|
||||||
|
@ -417,9 +417,9 @@ CCMD (take)
|
||||||
Net_WriteByte (DEM_TAKECHEAT);
|
Net_WriteByte (DEM_TAKECHEAT);
|
||||||
Net_WriteString (argv[1]);
|
Net_WriteString (argv[1]);
|
||||||
if (argv.argc() > 2)
|
if (argv.argc() > 2)
|
||||||
Net_WriteWord (clamp (atoi (argv[2]), 1, 32767));
|
Net_WriteLong(atoi (argv[2]));
|
||||||
else
|
else
|
||||||
Net_WriteWord (0);
|
Net_WriteLong (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CCMD (gameversion)
|
CCMD (gameversion)
|
||||||
|
|
|
@ -2198,12 +2198,12 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
||||||
|
|
||||||
case DEM_GIVECHEAT:
|
case DEM_GIVECHEAT:
|
||||||
s = ReadString (stream);
|
s = ReadString (stream);
|
||||||
cht_Give (&players[player], s, ReadWord (stream));
|
cht_Give (&players[player], s, ReadLong (stream));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEM_TAKECHEAT:
|
case DEM_TAKECHEAT:
|
||||||
s = ReadString (stream);
|
s = ReadString (stream);
|
||||||
cht_Take (&players[player], s, ReadWord (stream));
|
cht_Take (&players[player], s, ReadLong (stream));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEM_WARPCHEAT:
|
case DEM_WARPCHEAT:
|
||||||
|
@ -2721,7 +2721,7 @@ void Net_SkipCommand (int type, BYTE **stream)
|
||||||
|
|
||||||
case DEM_GIVECHEAT:
|
case DEM_GIVECHEAT:
|
||||||
case DEM_TAKECHEAT:
|
case DEM_TAKECHEAT:
|
||||||
skip = strlen ((char *)(*stream)) + 3;
|
skip = strlen ((char *)(*stream)) + 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEM_SUMMON2:
|
case DEM_SUMMON2:
|
||||||
|
|
|
@ -3194,34 +3194,37 @@ void PClass::Derive(PClass *newclass, FName name)
|
||||||
|
|
||||||
void PClass::InitializeDefaults()
|
void PClass::InitializeDefaults()
|
||||||
{
|
{
|
||||||
assert(Defaults == NULL);
|
if (IsKindOf(RUNTIME_CLASS(PClassActor)))
|
||||||
Defaults = (BYTE *)M_Malloc(Size);
|
|
||||||
|
|
||||||
// run the constructor on the defaults to set the vtbl pointer which is needed to run class-aware functions on them.
|
|
||||||
// Temporarily setting bSerialOverride prevents linking into the thinker chains.
|
|
||||||
auto s = DThinker::bSerialOverride;
|
|
||||||
DThinker::bSerialOverride = true;
|
|
||||||
ConstructNative(Defaults);
|
|
||||||
DThinker::bSerialOverride = s;
|
|
||||||
// We must unlink the defaults from the class list because it's just a static block of data to the engine.
|
|
||||||
DObject *optr = (DObject*)Defaults;
|
|
||||||
GC::Root = optr->ObjNext;
|
|
||||||
optr->ObjNext = nullptr;
|
|
||||||
optr->SetClass(this);
|
|
||||||
|
|
||||||
|
|
||||||
// Copy the defaults from the parent but leave the DObject part alone because it contains important data.
|
|
||||||
if (ParentClass->Defaults != NULL)
|
|
||||||
{
|
{
|
||||||
memcpy(Defaults + sizeof(DObject), ParentClass->Defaults + sizeof(DObject), ParentClass->Size - sizeof(DObject));
|
assert(Defaults == NULL);
|
||||||
if (Size > ParentClass->Size)
|
Defaults = (BYTE *)M_Malloc(Size);
|
||||||
|
|
||||||
|
// run the constructor on the defaults to set the vtbl pointer which is needed to run class-aware functions on them.
|
||||||
|
// Temporarily setting bSerialOverride prevents linking into the thinker chains.
|
||||||
|
auto s = DThinker::bSerialOverride;
|
||||||
|
DThinker::bSerialOverride = true;
|
||||||
|
ConstructNative(Defaults);
|
||||||
|
DThinker::bSerialOverride = s;
|
||||||
|
// We must unlink the defaults from the class list because it's just a static block of data to the engine.
|
||||||
|
DObject *optr = (DObject*)Defaults;
|
||||||
|
GC::Root = optr->ObjNext;
|
||||||
|
optr->ObjNext = nullptr;
|
||||||
|
optr->SetClass(this);
|
||||||
|
|
||||||
|
|
||||||
|
// Copy the defaults from the parent but leave the DObject part alone because it contains important data.
|
||||||
|
if (ParentClass->Defaults != NULL)
|
||||||
{
|
{
|
||||||
memset(Defaults + ParentClass->Size, 0, Size - ParentClass->Size);
|
memcpy(Defaults + sizeof(DObject), ParentClass->Defaults + sizeof(DObject), ParentClass->Size - sizeof(DObject));
|
||||||
|
if (Size > ParentClass->Size)
|
||||||
|
{
|
||||||
|
memset(Defaults + ParentClass->Size, 0, Size - ParentClass->Size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset(Defaults + sizeof(DObject), 0, Size - sizeof(DObject));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memset(Defaults + sizeof(DObject), 0, Size - sizeof(DObject));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bRuntimeClass)
|
if (bRuntimeClass)
|
||||||
|
|
|
@ -710,8 +710,12 @@ class DThinkerIterator : public DObject, public FThinkerIterator
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DThinkerIterator, DObject)
|
DECLARE_CLASS(DThinkerIterator, DObject)
|
||||||
|
|
||||||
|
DThinkerIterator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DThinkerIterator(PClass *cls = nullptr, int statnum = MAX_STATNUM + 1)
|
DThinkerIterator(PClass *cls, int statnum = MAX_STATNUM + 1)
|
||||||
: FThinkerIterator(cls, statnum)
|
: FThinkerIterator(cls, statnum)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,9 @@ public:
|
||||||
FThinkerIterator (const PClass *type, int statnum, DThinker *prev);
|
FThinkerIterator (const PClass *type, int statnum, DThinker *prev);
|
||||||
DThinker *Next (bool exact = false);
|
DThinker *Next (bool exact = false);
|
||||||
void Reinit ();
|
void Reinit ();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
FThinkerIterator() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T> class TThinkerIterator : public FThinkerIterator
|
template <class T> class TThinkerIterator : public FThinkerIterator
|
||||||
|
|
|
@ -1597,7 +1597,7 @@ void DSBarInfoWrapper::OnDestroy()
|
||||||
void DSBarInfoWrapper::SetScaled(bool scale, bool force)
|
void DSBarInfoWrapper::SetScaled(bool scale, bool force)
|
||||||
{
|
{
|
||||||
Super::SetScaled(scale, force);
|
Super::SetScaled(scale, force);
|
||||||
core->_SetScaled(scale);
|
core->_SetScaled(Scaled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSBarInfoWrapper::AttachToPlayer(player_t *player)
|
void DSBarInfoWrapper::AttachToPlayer(player_t *player)
|
||||||
|
|
|
@ -208,7 +208,7 @@ void ADynamicLight::Activate(AActor *activator)
|
||||||
m_cycler.SetCycleType(CYCLE_Sin);
|
m_cycler.SetCycleType(CYCLE_Sin);
|
||||||
m_currentRadius = m_cycler.GetVal();
|
m_currentRadius = m_cycler.GetVal();
|
||||||
}
|
}
|
||||||
assert(m_currentRadius > 0);
|
if (m_currentRadius <= 0) m_currentRadius = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,6 +329,7 @@ void ADynamicLight::Tick()
|
||||||
m_currentRadius = float(args[LIGHT_INTENSITY]);
|
m_currentRadius = float(args[LIGHT_INTENSITY]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (m_currentRadius <= 0) m_currentRadius = 1;
|
||||||
UpdateLocation();
|
UpdateLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,7 @@ void FLightDefaults::ApplyProperties(ADynamicLight * light) const
|
||||||
light->m_cycler.ShouldCycle(true);
|
light->m_cycler.ShouldCycle(true);
|
||||||
light->m_cycler.SetCycleType(CYCLE_Sin);
|
light->m_cycler.SetCycleType(CYCLE_Sin);
|
||||||
light->m_currentRadius = light->m_cycler.GetVal();
|
light->m_currentRadius = light->m_cycler.GetVal();
|
||||||
|
if (light->m_currentRadius <= 0) light->m_currentRadius = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_attenuate)
|
switch (m_attenuate)
|
||||||
|
@ -369,7 +370,7 @@ void gl_ParsePointLight(FScanner &sc)
|
||||||
defaults->SetOffset(floatTriple);
|
defaults->SetOffset(floatTriple);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SIZE:
|
case LIGHTTAG_SIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SUBTRACTIVE:
|
case LIGHTTAG_SUBTRACTIVE:
|
||||||
|
@ -446,11 +447,11 @@ void gl_ParsePulseLight(FScanner &sc)
|
||||||
defaults->SetOffset(floatTriple);
|
defaults->SetOffset(floatTriple);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SIZE:
|
case LIGHTTAG_SIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 1024);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SECSIZE:
|
case LIGHTTAG_SECSIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 1024);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_INTERVAL:
|
case LIGHTTAG_INTERVAL:
|
||||||
|
@ -536,11 +537,11 @@ void gl_ParseFlickerLight(FScanner &sc)
|
||||||
defaults->SetOffset(floatTriple);
|
defaults->SetOffset(floatTriple);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SIZE:
|
case LIGHTTAG_SIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SECSIZE:
|
case LIGHTTAG_SECSIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_CHANCE:
|
case LIGHTTAG_CHANCE:
|
||||||
|
@ -618,11 +619,11 @@ void gl_ParseFlickerLight2(FScanner &sc)
|
||||||
defaults->SetOffset(floatTriple);
|
defaults->SetOffset(floatTriple);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SIZE:
|
case LIGHTTAG_SIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SECSIZE:
|
case LIGHTTAG_SECSIZE:
|
||||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
intVal = clamp<int>(gl_ParseInt(sc), 1, 1024);
|
||||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_INTERVAL:
|
case LIGHTTAG_INTERVAL:
|
||||||
|
@ -707,7 +708,7 @@ void gl_ParseSectorLight(FScanner &sc)
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SCALE:
|
case LIGHTTAG_SCALE:
|
||||||
floatVal = gl_ParseFloat(sc);
|
floatVal = gl_ParseFloat(sc);
|
||||||
defaults->SetArg(LIGHT_SCALE, (BYTE)(floatVal * 255));
|
defaults->SetArg(LIGHT_SCALE, clamp((int)(floatVal * 255), 1, 1024));
|
||||||
break;
|
break;
|
||||||
case LIGHTTAG_SUBTRACTIVE:
|
case LIGHTTAG_SUBTRACTIVE:
|
||||||
defaults->SetSubtractive(gl_ParseInt(sc) != 0);
|
defaults->SetSubtractive(gl_ParseInt(sc) != 0);
|
||||||
|
|
|
@ -306,12 +306,12 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
|
||||||
}
|
}
|
||||||
else if (sectorfogdensity != 0)
|
else if (sectorfogdensity != 0)
|
||||||
{
|
{
|
||||||
// case 2: Sector has an explicit fog density set.
|
// case 1: Sector has an explicit fog density set.
|
||||||
density = sectorfogdensity;
|
density = sectorfogdensity;
|
||||||
}
|
}
|
||||||
else if ((fogcolor.d & 0xffffff) == 0)
|
else if ((fogcolor.d & 0xffffff) == 0)
|
||||||
{
|
{
|
||||||
// case 1: black fog
|
// case 2: black fog
|
||||||
if (glset.lightmode != 8)
|
if (glset.lightmode != 8)
|
||||||
{
|
{
|
||||||
density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];
|
density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];
|
||||||
|
|
|
@ -379,7 +379,8 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
case GLPASS_ALL: // Same, but also creates the dynlight data.
|
case GLPASS_ALL: // Same, but also creates the dynlight data.
|
||||||
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
||||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||||
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
if (!gltexture->tex->isFullbright())
|
||||||
|
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||||
if (sector->special != GLSector_Skybox)
|
if (sector->special != GLSector_Skybox)
|
||||||
{
|
{
|
||||||
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
||||||
|
@ -406,7 +407,8 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
||||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||||
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
if (!gltexture || !gltexture->tex->isFullbright())
|
||||||
|
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||||
if (!gltexture)
|
if (!gltexture)
|
||||||
{
|
{
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
||||||
|
|
|
@ -119,11 +119,11 @@ void GLSprite::CalculateVertices(FVector3 *v)
|
||||||
// Tilt the actor up or down based on pitch (increase 'somersaults' forward).
|
// Tilt the actor up or down based on pitch (increase 'somersaults' forward).
|
||||||
// Then counteract the roll and DO A BARREL ROLL.
|
// Then counteract the roll and DO A BARREL ROLL.
|
||||||
|
|
||||||
FAngle pitch = (float)-actor->Angles.Pitch.Degrees;
|
FAngle pitch = (float)-Angles.Pitch.Degrees;
|
||||||
pitch.Normalized180();
|
pitch.Normalized180();
|
||||||
|
|
||||||
mat.Translate(x, z, y);
|
mat.Translate(x, z, y);
|
||||||
mat.Rotate(0, 1, 0, 270. - actor->Angles.Yaw.Degrees);
|
mat.Rotate(0, 1, 0, 270. - Angles.Yaw.Degrees);
|
||||||
mat.Rotate(1, 0, 0, pitch.Degrees);
|
mat.Rotate(1, 0, 0, pitch.Degrees);
|
||||||
|
|
||||||
if (actor->renderflags & RF_ROLLCENTER)
|
if (actor->renderflags & RF_ROLLCENTER)
|
||||||
|
@ -132,12 +132,12 @@ void GLSprite::CalculateVertices(FVector3 *v)
|
||||||
float cy = (y1 + y2) * 0.5;
|
float cy = (y1 + y2) * 0.5;
|
||||||
|
|
||||||
mat.Translate(cx - x, 0, cy - y);
|
mat.Translate(cx - x, 0, cy - y);
|
||||||
mat.Rotate(0, 1, 0, - actor->Angles.Roll.Degrees);
|
mat.Rotate(0, 1, 0, - Angles.Roll.Degrees);
|
||||||
mat.Translate(-cx, -z, -cy);
|
mat.Translate(-cx, -z, -cy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mat.Rotate(0, 1, 0, - actor->Angles.Roll.Degrees);
|
mat.Rotate(0, 1, 0, - Angles.Roll.Degrees);
|
||||||
mat.Translate(-x, -z, -y);
|
mat.Translate(-x, -z, -y);
|
||||||
}
|
}
|
||||||
v[0] = mat * FVector3(x2, z, y2);
|
v[0] = mat * FVector3(x2, z, y2);
|
||||||
|
@ -199,11 +199,11 @@ void GLSprite::CalculateVertices(FVector3 *v)
|
||||||
// [fgsfds] calculate yaw vectors
|
// [fgsfds] calculate yaw vectors
|
||||||
float yawvecX = 0, yawvecY = 0, rollDegrees = 0;
|
float yawvecX = 0, yawvecY = 0, rollDegrees = 0;
|
||||||
float angleRad = (270. - GLRenderer->mAngles.Yaw).Radians();
|
float angleRad = (270. - GLRenderer->mAngles.Yaw).Radians();
|
||||||
if (actor) rollDegrees = actor->Angles.Roll.Degrees;
|
if (actor) rollDegrees = Angles.Roll.Degrees;
|
||||||
if (isFlatSprite)
|
if (isFlatSprite)
|
||||||
{
|
{
|
||||||
yawvecX = actor->Angles.Yaw.Cos();
|
yawvecX = Angles.Yaw.Cos();
|
||||||
yawvecY = actor->Angles.Yaw.Sin();
|
yawvecY = Angles.Yaw.Sin();
|
||||||
}
|
}
|
||||||
|
|
||||||
// [fgsfds] Rotate the sprite about the sight vector (roll)
|
// [fgsfds] Rotate the sprite about the sight vector (roll)
|
||||||
|
@ -326,12 +326,16 @@ void GLSprite::Draw(int pass)
|
||||||
{
|
{
|
||||||
gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL);
|
gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL);
|
||||||
}
|
}
|
||||||
PalEntry finalcol(ThingColor.a,
|
sector_t *cursec = actor ? actor->Sector : particle ? particle->subsector->sector : nullptr;
|
||||||
ThingColor.r * actor->Sector->SpecialColors[sector_t::sprites].r / 255,
|
if (cursec != nullptr)
|
||||||
ThingColor.g * actor->Sector->SpecialColors[sector_t::sprites].g / 255,
|
{
|
||||||
ThingColor.b * actor->Sector->SpecialColors[sector_t::sprites].b / 255);
|
PalEntry finalcol(ThingColor.a,
|
||||||
|
ThingColor.r * cursec->SpecialColors[sector_t::sprites].r / 255,
|
||||||
|
ThingColor.g * cursec->SpecialColors[sector_t::sprites].g / 255,
|
||||||
|
ThingColor.b * cursec->SpecialColors[sector_t::sprites].b / 255);
|
||||||
|
|
||||||
gl_RenderState.SetObjectColor(finalcol);
|
gl_RenderState.SetObjectColor(finalcol);
|
||||||
|
}
|
||||||
gl_SetColor(lightlevel, rel, Colormap, trans);
|
gl_SetColor(lightlevel, rel, Colormap, trans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,10 +716,6 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (thing == camera)
|
|
||||||
{
|
|
||||||
int a = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// don't draw first frame of a player missile
|
// don't draw first frame of a player missile
|
||||||
if (thing->flags&MF_MISSILE)
|
if (thing->flags&MF_MISSILE)
|
||||||
|
@ -737,6 +737,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
int clipres = GLRenderer->mClipPortal->ClipPoint(thingpos);
|
int clipres = GLRenderer->mClipPortal->ClipPoint(thingpos);
|
||||||
if (clipres == GLPortal::PClip_InFront) return;
|
if (clipres == GLPortal::PClip_InFront) return;
|
||||||
}
|
}
|
||||||
|
Angles = thing->InterpolatedAngles(r_TicFracF);
|
||||||
|
|
||||||
player_t *player = &players[consoleplayer];
|
player_t *player = &players[consoleplayer];
|
||||||
FloatRect r;
|
FloatRect r;
|
||||||
|
@ -783,7 +784,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
}
|
}
|
||||||
else if (!(thing->renderflags & RF_FLATSPRITE))
|
else if (!(thing->renderflags & RF_FLATSPRITE))
|
||||||
{
|
{
|
||||||
patch = gl_GetSpriteFrame(spritenum, thing->frame, -1, (ang - (thing->Angles.Yaw + thing->SpriteRotation)).BAMs(), &mirror);
|
patch = gl_GetSpriteFrame(spritenum, thing->frame, -1, (ang - (Angles.Yaw + thing->SpriteRotation)).BAMs(), &mirror);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -854,8 +855,8 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RF_WALLSPRITE:
|
case RF_WALLSPRITE:
|
||||||
viewvecX = thing->Angles.Yaw.Cos();
|
viewvecX = Angles.Yaw.Cos();
|
||||||
viewvecY = thing->Angles.Yaw.Sin();
|
viewvecY = Angles.Yaw.Sin();
|
||||||
|
|
||||||
x1 = x + viewvecY*leftfac;
|
x1 = x + viewvecY*leftfac;
|
||||||
x2 = x + viewvecY*rightfac;
|
x2 = x + viewvecY*rightfac;
|
||||||
|
|
|
@ -376,6 +376,7 @@ public:
|
||||||
AActor * actor;
|
AActor * actor;
|
||||||
particle_t * particle;
|
particle_t * particle;
|
||||||
TArray<lightlist_t> *lightlist;
|
TArray<lightlist_t> *lightlist;
|
||||||
|
DRotator Angles;
|
||||||
|
|
||||||
void SplitSprite(sector_t * frontsector, bool translucent);
|
void SplitSprite(sector_t * frontsector, bool translucent);
|
||||||
void SetLowerParam();
|
void SetLowerParam();
|
||||||
|
|
|
@ -1177,6 +1177,11 @@ class DBlockThingsIterator : public DObject, public FMultiBlockThingsIterator
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DBlockThingsIterator, DObject);
|
DECLARE_CLASS(DBlockThingsIterator, DObject);
|
||||||
FPortalGroupArray check;
|
FPortalGroupArray check;
|
||||||
|
protected:
|
||||||
|
DBlockThingsIterator()
|
||||||
|
:FMultiBlockThingsIterator(check)
|
||||||
|
{
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
FMultiBlockThingsIterator::CheckResult cres;
|
FMultiBlockThingsIterator::CheckResult cres;
|
||||||
|
|
||||||
|
@ -1186,7 +1191,7 @@ public:
|
||||||
return FMultiBlockThingsIterator::Next(&cres);
|
return FMultiBlockThingsIterator::Next(&cres);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBlockThingsIterator(AActor *origin = nullptr, double checkradius = -1, bool ignorerestricted = false)
|
DBlockThingsIterator(AActor *origin, double checkradius = -1, bool ignorerestricted = false)
|
||||||
: FMultiBlockThingsIterator(check, origin, checkradius, ignorerestricted)
|
: FMultiBlockThingsIterator(check, origin, checkradius, ignorerestricted)
|
||||||
{
|
{
|
||||||
cres.thing = nullptr;
|
cres.thing = nullptr;
|
||||||
|
|
|
@ -327,6 +327,8 @@ class FMultiBlockThingsIterator
|
||||||
|
|
||||||
void startIteratorForGroup(int group);
|
void startIteratorForGroup(int group);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
FMultiBlockThingsIterator(FPortalGroupArray &check) : checklist(check) {}
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct CheckResult
|
struct CheckResult
|
||||||
|
|
|
@ -4602,8 +4602,10 @@ bool AActor::UpdateWaterLevel (bool dosplash)
|
||||||
for(auto rover : Sector->e->XFloor.ffloors)
|
for(auto rover : Sector->e->XFloor.ffloors)
|
||||||
{
|
{
|
||||||
if (!(rover->flags & FF_EXISTS)) continue;
|
if (!(rover->flags & FF_EXISTS)) continue;
|
||||||
if(!(rover->flags & FF_SWIMMABLE) || rover->flags & FF_SOLID) continue;
|
if (rover->flags & FF_SOLID) continue;
|
||||||
|
|
||||||
|
reset = !(rover->flags & FF_SWIMMABLE);
|
||||||
|
if (reset && rover->alpha == 0) continue;
|
||||||
double ff_bottom=rover->bottom.plane->ZatPoint(this);
|
double ff_bottom=rover->bottom.plane->ZatPoint(this);
|
||||||
double ff_top=rover->top.plane->ZatPoint(this);
|
double ff_top=rover->top.plane->ZatPoint(this);
|
||||||
|
|
||||||
|
@ -6251,7 +6253,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, const DVector3 &pos, bool check
|
||||||
double planez = rover->top.plane->ZatPoint(pos);
|
double planez = rover->top.plane->ZatPoint(pos);
|
||||||
if (pos.Z > planez - 0.5 && pos.Z < planez + 0.5) // allow minor imprecisions
|
if (pos.Z > planez - 0.5 && pos.Z < planez + 0.5) // allow minor imprecisions
|
||||||
{
|
{
|
||||||
if (rover->flags & (FF_SOLID | FF_SWIMMABLE))
|
if ((rover->flags & (FF_SOLID | FF_SWIMMABLE)) || rover->alpha > 0)
|
||||||
{
|
{
|
||||||
terrainnum = rover->model->GetTerrain(rover->top.isceiling);
|
terrainnum = rover->model->GetTerrain(rover->top.isceiling);
|
||||||
goto foundone;
|
goto foundone;
|
||||||
|
|
|
@ -1461,23 +1461,23 @@ public:
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case NAME_Color_Floor:
|
case NAME_Color_Floor:
|
||||||
sec->SpecialColors[sector_t::floor] = CheckInt(key) || 0xff000000;
|
sec->SpecialColors[sector_t::floor] = CheckInt(key) | 0xff000000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Color_Ceiling:
|
case NAME_Color_Ceiling:
|
||||||
sec->SpecialColors[sector_t::ceiling] = CheckInt(key) || 0xff000000;
|
sec->SpecialColors[sector_t::ceiling] = CheckInt(key) | 0xff000000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Color_Walltop:
|
case NAME_Color_Walltop:
|
||||||
sec->SpecialColors[sector_t::walltop] = CheckInt(key) || 0xff000000;
|
sec->SpecialColors[sector_t::walltop] = CheckInt(key) | 0xff000000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Color_Wallbottom:
|
case NAME_Color_Wallbottom:
|
||||||
sec->SpecialColors[sector_t::wallbottom] = CheckInt(key) || 0xff000000;
|
sec->SpecialColors[sector_t::wallbottom] = CheckInt(key) | 0xff000000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Color_Sprites:
|
case NAME_Color_Sprites:
|
||||||
sec->SpecialColors[sector_t::sprites] = CheckInt(key) || 0xff000000;
|
sec->SpecialColors[sector_t::sprites] = CheckInt(key) | 0xff000000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Desaturation:
|
case NAME_Desaturation:
|
||||||
|
|
|
@ -1874,7 +1874,14 @@ void ZCCCompiler::InitDefaults()
|
||||||
if (!c->Type()->IsDescendantOf(RUNTIME_CLASS(AActor)))
|
if (!c->Type()->IsDescendantOf(RUNTIME_CLASS(AActor)))
|
||||||
{
|
{
|
||||||
if (c->Defaults.Size()) Error(c->cls, "%s: Non-actor classes may not have defaults", c->Type()->TypeName.GetChars());
|
if (c->Defaults.Size()) Error(c->cls, "%s: Non-actor classes may not have defaults", c->Type()->TypeName.GetChars());
|
||||||
if (c->Type()->ParentClass) c->Type()->ParentClass->DeriveData(c->Type());
|
if (c->Type()->ParentClass)
|
||||||
|
{
|
||||||
|
auto ti = static_cast<PClassActor *>(c->Type());
|
||||||
|
FString mename = ti->TypeName.GetChars();
|
||||||
|
|
||||||
|
ti->InitializeDefaults();
|
||||||
|
ti->ParentClass->DeriveData(ti);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue