- merged all portals with the same displacement together. While this provides

a mild performance increase it's not what I hoped it would do...
- Moved portal initialization for the portal things to P_SpawnSpecials
  instead of having the things self-initialize in PostBeginPlay. This was
  done to ensure that the portals are fully set up when the game begins.
  Otherwise there is no decent way to let the renderer post-process this
  information during setup.
- Changed: For 800x600 the default scaling handling of the options menu
  makes it become too small so for any resolution with a width between 
  800 and 959 it has been reverted to the regular clean scaling factor.


SVN r2055 (trunk)
This commit is contained in:
Christoph Oelckers 2009-12-28 17:13:30 +00:00
parent b6557a82ff
commit 3d40dbb659
6 changed files with 119 additions and 50 deletions

View file

@ -1,3 +1,15 @@
December 28, 2009 (Changes by Graf Zahl)
- merged all portals with the same displacement together. While this provides
a mild performance increase it's not what I hoped it would do...
- Moved portal initialization for the portal things to P_SpawnSpecials
instead of having the things self-initialize in PostBeginPlay. This was
done to ensure that the portals are fully set up when the game begins.
Otherwise there is no decent way to let the renderer post-process this
information during setup.
- Changed: For 800x600 the default scaling handling of the options menu
makes it become too small so for any resolution with a width between
800 and 959 it has been reverted to the regular clean scaling factor.
December 27, 2009 (Changes by Graf Zahl) December 27, 2009 (Changes by Graf Zahl)
- added Hirogen2's Backpack fix for sv_unlimited_pickup. - added Hirogen2's Backpack fix for sv_unlimited_pickup.
- added a linedef based method to define portals. Portals defined this way - added a linedef based method to define portals. Portals defined this way

View file

@ -156,50 +156,6 @@ void AStackPoint::BeginPlay ()
bAlways = true; bAlways = true;
} }
//---------------------------------------------------------------------------
// Upper stacks go in the top sector. Lower stacks go in the bottom sector.
class AUpperStackLookOnly : public AStackPoint
{
DECLARE_CLASS (AUpperStackLookOnly, AStackPoint)
public:
void PostBeginPlay ();
};
class ALowerStackLookOnly : public AStackPoint
{
DECLARE_CLASS (ALowerStackLookOnly, AStackPoint)
public:
void PostBeginPlay ();
};
IMPLEMENT_CLASS (AUpperStackLookOnly)
IMPLEMENT_CLASS (ALowerStackLookOnly)
void AUpperStackLookOnly::PostBeginPlay ()
{
Super::PostBeginPlay ();
TActorIterator<ALowerStackLookOnly> it (tid);
Sector->FloorSkyBox = it.Next();
if (Sector->FloorSkyBox != NULL)
{
Sector->FloorSkyBox->Mate = this;
Sector->FloorSkyBox->PlaneAlpha = Scale (args[0], OPAQUE, 255);
}
}
void ALowerStackLookOnly::PostBeginPlay ()
{
Super::PostBeginPlay ();
TActorIterator<AUpperStackLookOnly> it (tid);
Sector->CeilingSkyBox = it.Next();
if (Sector->CeilingSkyBox != NULL)
{
Sector->CeilingSkyBox->Mate = this;
Sector->CeilingSkyBox->PlaneAlpha = Scale (args[0], OPAQUE, 255);
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class ASectorSilencer : public AActor class ASectorSilencer : public AActor

View file

@ -64,6 +64,9 @@ xx(Wind)
xx(PointPusher) xx(PointPusher)
xx(PointPuller) xx(PointPuller)
xx(UpperStackLookOnly)
xx(LowerStackLookOnly)
xx(BulletPuff) xx(BulletPuff)
xx(StrifePuff) xx(StrifePuff)
xx(MaulerPuff) xx(MaulerPuff)

View file

@ -69,6 +69,8 @@
#include "r_interpolate.h" #include "r_interpolate.h"
static FRandom pr_playerinspecialsector ("PlayerInSpecialSector"); static FRandom pr_playerinspecialsector ("PlayerInSpecialSector");
void P_SetupPortals();
// [GrafZahl] Make this message changable by the user! ;) // [GrafZahl] Make this message changable by the user! ;)
CVAR(String, secretmessage, "A Secret is revealed!", CVAR_ARCHIVE) CVAR(String, secretmessage, "A Secret is revealed!", CVAR_ARCHIVE)
@ -828,6 +830,89 @@ void DWallLightTransfer::DoTransfer (BYTE lightlevel, int target, BYTE flags)
} }
} }
//-----------------------------------------------------------------------------
//
// Portals
//
//-----------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Upper stacks go in the top sector. Lower stacks go in the bottom sector.
static void SetupFloorPortal (AStackPoint *point)
{
NActorIterator it (NAME_LowerStackLookOnly, point->tid);
sector_t *Sector = point->Sector;
Sector->FloorSkyBox = static_cast<ASkyViewpoint*>(it.Next());
if (Sector->FloorSkyBox != NULL)
{
Sector->FloorSkyBox->Mate = point;
Sector->FloorSkyBox->PlaneAlpha = Scale (point->args[0], OPAQUE, 255);
}
}
static void SetupCeilingPortal (AStackPoint *point)
{
NActorIterator it (NAME_UpperStackLookOnly, point->tid);
sector_t *Sector = point->Sector;
Sector->CeilingSkyBox = static_cast<ASkyViewpoint*>(it.Next());
if (Sector->CeilingSkyBox != NULL)
{
Sector->CeilingSkyBox->Mate = point;
Sector->CeilingSkyBox->PlaneAlpha = Scale (point->args[0], OPAQUE, 255);
}
}
void P_SetupPortals()
{
TThinkerIterator<AStackPoint> it;
AStackPoint *pt;
TArray<AStackPoint *> points;
while ((pt = it.Next()))
{
FName nm = pt->GetClass()->TypeName;
if (nm == NAME_UpperStackLookOnly)
{
SetupFloorPortal(pt);
}
else if (nm == NAME_LowerStackLookOnly)
{
SetupCeilingPortal(pt);
}
pt->special1 = 0;
points.Push(pt);
}
for(unsigned i=0;i<points.Size(); i++)
{
if (points[i]->special1 == 0 && points[i]->Mate != NULL)
{
for(unsigned j=1;j<points.Size(); j++)
{
if (points[j]->special1 == 0 && points[j]->Mate != NULL && points[i]->GetClass() == points[j]->GetClass())
{
fixed_t deltax1 = points[i]->Mate->x - points[i]->x;
fixed_t deltay1 = points[i]->Mate->y - points[i]->y;
fixed_t deltax2 = points[j]->Mate->x - points[j]->x;
fixed_t deltay2 = points[j]->Mate->y - points[j]->y;
if (deltax1 == deltax2 && deltay1 == deltay2)
{
if (points[j]->Sector->FloorSkyBox == points[j])
points[j]->Sector->FloorSkyBox == points[i];
if (points[j]->Sector->CeilingSkyBox == points[j])
points[j]->Sector->CeilingSkyBox == points[i];
points[j]->special1 = 1;
break;
}
}
}
}
}
}
inline void SetPortal(sector_t *sector, INTBOOL ceiling, AStackPoint *portal) inline void SetPortal(sector_t *sector, INTBOOL ceiling, AStackPoint *portal)
{ {
@ -914,6 +999,8 @@ void P_SpawnSpecials (void)
sector_t *sector; sector_t *sector;
int i; int i;
P_SetupPortals();
// Init special SECTORs. // Init special SECTORs.
sector = sectors; sector = sectors;
for (i = 0; i < numsectors; i++, sector++) for (i = 0; i < numsectors; i++, sector++)

View file

@ -1398,10 +1398,21 @@ bool V_DoModeSetup (int width, int height, int bits)
assert(CleanWidth >= 320); assert(CleanWidth >= 320);
assert(CleanHeight >= 200); assert(CleanHeight >= 200);
CleanXfac_1 = MAX(CleanXfac - 1, 1); if (width < 800 || width >= 960)
CleanYfac_1 = MAX(CleanYfac - 1, 1); {
CleanWidth_1 = width / CleanXfac_1; CleanXfac_1 = MAX(CleanXfac - 1, 1);
CleanHeight_1 = height / CleanYfac_1; CleanYfac_1 = MAX(CleanYfac - 1, 1);
CleanWidth_1 = width / CleanXfac_1;
CleanHeight_1 = height / CleanYfac_1;
}
else // if the width is between 800 and 960 the ratio between the screensize and CleanXFac-1 becomes too large.
{
CleanXfac_1 = CleanXfac;
CleanYfac_1 = CleanYfac;
CleanWidth_1 = CleanWidth;
CleanHeight_1 = CleanHeight;
}
DisplayWidth = width; DisplayWidth = width;
DisplayHeight = height; DisplayHeight = height;

View file

@ -19,11 +19,11 @@ ACTOR StackPoint : SkyViewpoint native
{ {
} }
ACTOR UpperStackLookOnly : StackPoint 9077 native ACTOR UpperStackLookOnly : StackPoint 9077
{ {
} }
ACTOR LowerStackLookOnly : StackPoint 9078 native ACTOR LowerStackLookOnly : StackPoint 9078
{ {
} }