This commit is contained in:
Christoph Oelckers 2015-11-25 11:51:11 +01:00
commit 4ed78d78cc
6 changed files with 49 additions and 7 deletions

View File

@ -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;

View File

@ -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 ();

View File

@ -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)
@ -5779,11 +5789,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 +5800,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;

View File

@ -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,20 @@ int sector_t::GetCeilingLight () const
}
}
ASkyViewpoint *sector_t::GetSkyBox(int which)
{
if (which == floor)
{
return FloorSkyBox != NULL ? FloorSkyBox : (MoreFlags & SECF_NOFLOORSKYBOX)? (ASkyViewpoint*)NULL : level.DefaultSkybox;
}
else
{
return CeilingSkyBox != NULL ? CeilingSkyBox : (MoreFlags & SECF_NOCEILINGSKYBOX)? (ASkyViewpoint*)NULL : level.DefaultSkybox;
}
}
sector_t *sector_t::GetHeightSec() const
{
if (heightsec == NULL)

View File

@ -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) ||

View File

@ -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,