- started cleaning up the contents of the g_shared directory, starting with a_dynlight.cpp

This is supposed to be come the place where all pure play code should be placed, but for that all CVARs and CCMDs and other things that do not directly handle play data should be taken out to make code reviewing easier. These now get collected in two separate files, g_cvars.cpp and g_dumpinfo.cpp respectively.
The sole ZScript property in here has also been moved - to thingdef_properties.cpp.
This commit is contained in:
Christoph Oelckers 2019-01-31 02:05:16 +01:00
commit 0f2938089d
11 changed files with 185 additions and 95 deletions

View file

@ -54,6 +54,7 @@
#include "a_keys.h"
#include "g_levellocals.h"
#include "types.h"
#include "a_dynlight.h"
//==========================================================================
//
@ -1789,3 +1790,21 @@ DEFINE_CLASS_PROPERTY(unmorphflash, S, PowerMorph)
defaults->PointerVar<PClassActor>(NAME_UnMorphFlash) = FindClassTentative(str, RUNTIME_CLASS(AActor), bag.fromDecorate);
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY(type, S, DynamicLight)
{
PROP_STRING_PARM(str, 0);
static const char * ltype_names[]={
"Point","Pulse","Flicker","Sector","RandomFlicker", "ColorPulse", "ColorFlicker", "RandomColorFlicker", nullptr};
static const int ltype_values[]={
PointLight, PulseLight, FlickerLight, SectorLight, RandomFlickerLight, ColorPulseLight, ColorFlickerLight, RandomColorFlickerLight };
int style = MatchString(str, ltype_names);
if (style < 0) I_Error("Unknown light type '%s'", str);
defaults->IntVar(NAME_lighttype) = ltype_values[style];
}