Serious-Engine/Sources/EntitiesMP/WorldBase.cpp
2016-03-11 15:57:17 +02:00

1577 lines
65 KiB
C++

/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
#include "StdH.h"
#include "EntitiesMP/BackgroundViewer.h"
#include "EntitiesMP/WorldSettingsController.h"
// for error checking:
#include "EntitiesMP/SoundHolder.h"
#include <EntitiesMP/WorldBase.h>
#include <EntitiesMP/WorldBase_tables.h>
#line 17 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
inline void Clear(EntityStats &es) {es.es_strName.Clear();};
static CDynamicArray<EntityStats> _aes;
static CAnimObject _aoLightningColor;
EntityStats *FindStats(const CTString &strName)
{
{FOREACHINDYNAMICARRAY(_aes, EntityStats, ites) {
EntityStats &es = *ites;
if (es.es_strName==strName) {
return &es;
}
}}
return NULL;
}
static void MakeWorldStatistics(void)
{
// get the world pointer
CWorld *pwo = (CWorld *)_pShell->GetINDEX("pwoCurrentWorld");
// if there is no current world
if (pwo==NULL) {
CPrintF("No current world.\n");
return;
}
// for each entity in the world
{FOREACHINDYNAMICCONTAINER(pwo->wo_cenEntities, CEntity, iten) {
// get its stats
EntityStats esCurrent;
BOOL bHasStats = iten->FillEntityStatistics(&esCurrent);
// if no stats
if (!bHasStats) {
// skip it
continue;
}
// find existing stats with same name
EntityStats *pesOld = FindStats(esCurrent.es_strName);
// if such stats exists
if (pesOld!=NULL) {
// update the existing stats
pesOld->es_ctCount += esCurrent.es_ctCount;
pesOld->es_ctAmmount += esCurrent.es_ctAmmount*esCurrent.es_ctCount;
pesOld->es_fValue += esCurrent.es_fValue*esCurrent.es_ctCount;
pesOld->es_iScore += esCurrent.es_iScore*esCurrent.es_ctCount;
// if this a new name
} else {
// create new stats
EntityStats &esNew = *_aes.New();
esNew.es_strName = esCurrent.es_strName;
esNew.es_ctCount = esCurrent.es_ctCount;
esNew.es_ctAmmount = esCurrent.es_ctAmmount*esCurrent.es_ctCount;
esNew.es_fValue = esCurrent.es_fValue*esCurrent.es_ctCount;
esNew.es_iScore = esCurrent.es_iScore*esCurrent.es_ctCount;
}
}}
// dump all stats
try {
CTFileStream strm;
CTFileName fnm = CTString("Temp\\Statistics.txt");
strm.Create_t(fnm);
CTString strLine;
strLine.PrintF("%-40s: %8s %8s %10s %10s",
"name", "count", "ammount", "health", "score");
strm.PutLine_t(strLine);
{FOREACHINDYNAMICARRAY(_aes, EntityStats, ites) {
EntityStats &es = *ites;
CTString strLine;
strLine.PrintF("%-40s: %8d %8d %10g %10d",
es.es_strName, es.es_ctCount, es.es_ctAmmount, es.es_fValue, es.es_iScore);
strm.PutLine_t(strLine);
}}
CPrintF("Dumped to '%s'\n", CTString(fnm));
} catch (char *strError) {
CPrintF("Error: %s\n", strError);
}
_aes.Clear();
}
static void ReoptimizeAllBrushes(void)
{
// get the world pointer
CWorld *pwo = (CWorld *)_pShell->GetINDEX("pwoCurrentWorld");
// if there is no current world
if (pwo==NULL) {
CPrintF("No current world.\n");
return;
}
// for each brush in the world
FOREACHINDYNAMICARRAY(pwo->wo_baBrushes.ba_abrBrushes, CBrush3D, itbr) {
CBrush3D &br=*itbr;
// for each mip in the brush
FOREACHINLIST(CBrushMip, bm_lnInBrush, itbr->br_lhBrushMips, itbm) {
// reoptimize it
itbm->Reoptimize();
}
}
CPrintF("All brushes reoptimized.\n");
}
static void DoLevelSafetyChecks()
{
BOOL bWorldSettingsControllerExists = FALSE;
CPrintF("\n**** BEGIN Level safety checking ****\n\n");
// get the world pointer
CWorld *pwo = (CWorld *)_pShell->GetINDEX("pwoCurrentWorld");
// if there is no current world
if (pwo==NULL) {
CPrintF("Error - no current world.\n");
return;
}
CPrintF("STEP 1 - Checking model holders...\n");
// for model holder in the world;
{FOREACHINDYNAMICCONTAINER(pwo->wo_cenEntities, CEntity, iten) {
if (IsOfClass(iten, "ModelHolder2")) {
CModelHolder2 *mh = (CModelHolder2*)&*iten;
FLOAT3D vPos = mh->GetPlacement().pl_PositionVector;
if (mh->m_penDestruction == NULL) {
CPrintF(" model holder '%s' at (%2.2f, %2.2f, %2.2f) has no destruction\n", mh->m_strName, vPos(1), vPos(2), vPos(3));
}
}
}}
CPrintF("STEP 2 - Checking sound holders...\n");
// for each sound holder in the world
{FOREACHINDYNAMICCONTAINER(pwo->wo_cenEntities, CEntity, iten) {
if (IsOfClass(iten, "SoundHolder")) {
CSoundHolder *sh = (CSoundHolder *)&*iten;
FLOAT3D vPos = sh->GetPlacement().pl_PositionVector;
if (sh->m_fnSound == CTFILENAME("Sounds\\Default.wav")) {
CPrintF(" sound holder '%s' at (%2.2f, %2.2f, %2.2f) has default sound!\n", sh->m_strName, vPos(1), vPos(2), vPos(3));
}
}
}}
CPrintF("STEP 3 - Checking other important entities...\n");
CWorldSettingsController *pwsc = NULL;
class CBackgroundViewer *penBcgViewer = (CBackgroundViewer *) pwo->GetBackgroundViewer();
if( penBcgViewer != NULL) {
// obtain world settings controller
pwsc = (CWorldSettingsController *) &*penBcgViewer->m_penWorldSettingsController;
}
if (pwsc!=NULL) {
CPrintF("\n OK! World settings controller exists!\n");
} else {
CPrintF("\n ERROR! World settings controller does not exist (or isn't connected to the background viewer)!\n");
}
CPrintF("\n**** END Level safety checking ****\n");
}
void SetPyramidPlateActivateAlpha(CWorld *pwo, INDEX iBlending,
TIME tmActivated, TIME tmDeactivated, BOOL bPulsate)
{
TIME tmNow = _pTimer->CurrentTick();
TIME tmStop = 2.0f;
FLOAT fRatio;
// get alpha
if( tmNow>tmDeactivated)
{
// if plate is deactivated
if( tmNow>tmDeactivated+tmStop)
{
fRatio = 0;
}
// if fading out
else
{
fRatio = CalculateRatio(tmNow, tmDeactivated, tmDeactivated+tmStop, 0.0f, 1.0f);
}
}
else if( tmNow>tmActivated)
{
// if full visible
if( tmNow>tmActivated+tmStop)
{
fRatio = 1;
}
else
{
// fade in
fRatio = CalculateRatio(tmNow, tmActivated, tmActivated+tmStop, 1.0f, 0.0f);
}
}
// not yet activated
else
{
fRatio = 0;
}
FLOAT fSinFactor = 1.0f;
if( bPulsate)
{
fSinFactor = Sin((tmNow-tmActivated) * 720.0f)*0.5f+0.5f;
}
UBYTE ub = UBYTE( fRatio*fSinFactor*255.0f);
// apply blend or add
if( pwo->wo_atbTextureBlendings[iBlending].tb_ubBlendingType == STXF_BLEND_ALPHA)
{
pwo->wo_atbTextureBlendings[iBlending].tb_colMultiply = C_WHITE|ub;
}
else if( pwo->wo_atbTextureBlendings[iBlending].tb_ubBlendingType == STXF_BLEND_ADD)
{
pwo->wo_atbTextureBlendings[iBlending].tb_colMultiply = RGBAToColor(ub,ub,ub,255);
}
}
void SetPyramidMorphRoomAlpha(CWorld *pwo, INDEX iBlending, TIME tmActivated)
{
TIME tmNow = _pTimer->CurrentTick();
TIME tmDelta = tmNow-tmActivated;
FLOAT fRatio;
FLOAT tmAppear=10.0f;
if( tmNow<=tmActivated) { return;}
// get alpha
if( tmNow>=tmActivated+tmAppear)
{
fRatio = 1;
}
else
{
fRatio = CalculateRatio(tmNow, tmActivated, tmActivated+tmAppear, 1.0f, 0.0f);
}
FLOAT fSinFactor = Sin(-90+tmDelta*90*(1.0f+tmDelta/tmAppear*4))*0.5f+0.5f;
//FLOAT fSinFactor = Sin(-90+90*tmDelta)*0.5f+0.5f;
//UBYTE ub = fSinFactor*255.0f;
UBYTE ub = UBYTE((fRatio+(1.0f-fRatio)*fSinFactor)*255.0f);
// apply blend or add
if( pwo->wo_atbTextureBlendings[iBlending].tb_ubBlendingType == STXF_BLEND_ALPHA)
{
pwo->wo_atbTextureBlendings[iBlending].tb_colMultiply = C_WHITE|ub;
}
else if( pwo->wo_atbTextureBlendings[iBlending].tb_ubBlendingType == STXF_BLEND_ADD)
{
pwo->wo_atbTextureBlendings[iBlending].tb_colMultiply = RGBAToColor(ub,ub,ub,255);
}
}
void CWorldBase_OnWorldInit(CWorld *pwo)
{
pwo->wo_attTextureTransformations[0].tt_strName = "None";
pwo->wo_attTextureTransformations[1].tt_strName = "R Extremly Slow";
pwo->wo_attTextureTransformations[2].tt_strName = "R Very Slow";
pwo->wo_attTextureTransformations[3].tt_strName = "R Slow";
pwo->wo_attTextureTransformations[4].tt_strName = "R Medium";
pwo->wo_attTextureTransformations[5].tt_strName = "R Fast";
pwo->wo_attTextureTransformations[6].tt_strName = "R Very Fast";
pwo->wo_attTextureTransformations[7].tt_strName = "R Extremly Fast";
pwo->wo_attTextureTransformations[8].tt_strName = "Dummy 1";
pwo->wo_attTextureTransformations[9].tt_strName = "Dummy 2";
pwo->wo_attTextureTransformations[10].tt_strName = "Dummy 3";
pwo->wo_attTextureTransformations[11].tt_strName = "Water movement extremly slow";
pwo->wo_attTextureTransformations[12].tt_strName = "Water movement very slow";
pwo->wo_attTextureTransformations[13].tt_strName = "Water movement slow";
pwo->wo_attTextureTransformations[14].tt_strName = "Water movement normal";
pwo->wo_attTextureTransformations[15].tt_strName = "Water movement fast";
pwo->wo_attTextureTransformations[16].tt_strName = "Stormy sky appearing";
pwo->wo_attTextureTransformations[17].tt_strName = "Rotation Left 1";
pwo->wo_attTextureTransformations[18].tt_strName = "Rotation Left 2";
pwo->wo_attTextureTransformations[19].tt_strName = "Rotation Left 3";
pwo->wo_attTextureTransformations[20].tt_strName = "Rotation Left 4";
pwo->wo_attTextureTransformations[21].tt_strName = "Rotation Left 5";
pwo->wo_attTextureTransformations[22].tt_strName = "Rotation Left 6";
pwo->wo_attTextureTransformations[23].tt_strName = "Rotation Left 7";
pwo->wo_attTextureTransformations[24].tt_strName = "Rotation Left 8";
pwo->wo_attTextureTransformations[25].tt_strName = "Rotation Left 9";
pwo->wo_attTextureTransformations[26].tt_strName = "Rotation Left 10";
pwo->wo_attTextureTransformations[27].tt_strName = "Rotation Right 1";
pwo->wo_attTextureTransformations[28].tt_strName = "Rotation Right 2";
pwo->wo_attTextureTransformations[29].tt_strName = "Rotation Right 3";
pwo->wo_attTextureTransformations[30].tt_strName = "Rotation Right 4";
pwo->wo_attTextureTransformations[31].tt_strName = "Rotation Right 5";
pwo->wo_attTextureTransformations[32].tt_strName = "Rotation Right 6";
pwo->wo_attTextureTransformations[33].tt_strName = "Rotation Right 7";
pwo->wo_attTextureTransformations[34].tt_strName = "Rotation Right 8";
pwo->wo_attTextureTransformations[35].tt_strName = "Rotation Right 9";
pwo->wo_attTextureTransformations[36].tt_strName = "Rotation Right 10";
pwo->wo_attTextureTransformations[37].tt_strName = "D Extremly Slow";
pwo->wo_attTextureTransformations[38].tt_strName = "D Very Slow";
pwo->wo_attTextureTransformations[39].tt_strName = "D Slow";
pwo->wo_attTextureTransformations[40].tt_strName = "D Medium";
pwo->wo_attTextureTransformations[41].tt_strName = "D Fast";
pwo->wo_attTextureTransformations[42].tt_strName = "D Very Fast";
pwo->wo_attTextureTransformations[43].tt_strName = "D Extremly Fast";
pwo->wo_attTextureTransformations[44].tt_strName = "D Super Fast";
pwo->wo_attTextureTransformations[45].tt_strName = "D Abnormaly Fast";
// static
pwo->wo_atbTextureBlendings[0].tb_strName = "Opaque";
pwo->wo_atbTextureBlendings[0].tb_ubBlendingType = STXF_BLEND_OPAQUE;
pwo->wo_atbTextureBlendings[1].tb_strName = "Shade";
pwo->wo_atbTextureBlendings[1].tb_ubBlendingType = STXF_BLEND_SHADE;
pwo->wo_atbTextureBlendings[2].tb_strName = "Blend";
pwo->wo_atbTextureBlendings[2].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[3].tb_strName = "Add";
pwo->wo_atbTextureBlendings[3].tb_ubBlendingType = STXF_BLEND_ADD;
// pulsating
pwo->wo_atbTextureBlendings[4].tb_strName = "Shade pulsating";
pwo->wo_atbTextureBlendings[4].tb_ubBlendingType = STXF_BLEND_SHADE;
pwo->wo_atbTextureBlendings[4].tb_colMultiply = 0x808080FF;
pwo->wo_atbTextureBlendings[5].tb_strName = "Blend pulsating full";
pwo->wo_atbTextureBlendings[5].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[5].tb_colMultiply = C_WHITE|0x80;
pwo->wo_atbTextureBlendings[6].tb_strName = "Add pulsating";
pwo->wo_atbTextureBlendings[6].tb_ubBlendingType = STXF_BLEND_ADD;
pwo->wo_atbTextureBlendings[6].tb_colMultiply = 0x808080FF;
pwo->wo_atbTextureBlendings[7].tb_strName = "Blend pulsating half";
pwo->wo_atbTextureBlendings[7].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[7].tb_colMultiply = C_WHITE|0xC0;
pwo->wo_atbTextureBlendings[8].tb_strName = "Wsc blend";
pwo->wo_atbTextureBlendings[8].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[8].tb_colMultiply = C_WHITE|0x00;
pwo->wo_atbTextureBlendings[9].tb_strName = "Wsc shade";
pwo->wo_atbTextureBlendings[9].tb_ubBlendingType = STXF_BLEND_SHADE;
pwo->wo_atbTextureBlendings[9].tb_colMultiply = C_WHITE|0xFF;
pwo->wo_atbTextureBlendings[10].tb_strName = "Pyramid plate appearing";
pwo->wo_atbTextureBlendings[10].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[10].tb_colMultiply = C_WHITE|0x00;
pwo->wo_atbTextureBlendings[11].tb_strName = "Activated plate 1";
pwo->wo_atbTextureBlendings[11].tb_ubBlendingType = STXF_BLEND_ADD;
pwo->wo_atbTextureBlendings[11].tb_colMultiply = C_BLACK|CT_OPAQUE;
pwo->wo_atbTextureBlendings[12].tb_strName = "Activated plate 2";
pwo->wo_atbTextureBlendings[12].tb_ubBlendingType = STXF_BLEND_ADD;
pwo->wo_atbTextureBlendings[12].tb_colMultiply = C_BLACK|CT_OPAQUE;
pwo->wo_atbTextureBlendings[13].tb_strName = "Activated plate 3";
pwo->wo_atbTextureBlendings[13].tb_ubBlendingType = STXF_BLEND_ADD;
pwo->wo_atbTextureBlendings[13].tb_colMultiply = C_BLACK|CT_OPAQUE;
pwo->wo_atbTextureBlendings[14].tb_strName = "Activated plate 4";
pwo->wo_atbTextureBlendings[14].tb_ubBlendingType = STXF_BLEND_ADD;
pwo->wo_atbTextureBlendings[14].tb_colMultiply = C_BLACK|CT_OPAQUE;
pwo->wo_atbTextureBlendings[15].tb_strName = "Activate pyramid morph room";
pwo->wo_atbTextureBlendings[15].tb_ubBlendingType = STXF_BLEND_ALPHA;
pwo->wo_atbTextureBlendings[15].tb_colMultiply = C_WHITE|0x00;
pwo->wo_aitIlluminationTypes[0].it_strName = "None";
pwo->wo_aitIlluminationTypes[1].it_strName = "Vitraj 1";
pwo->wo_aitIlluminationTypes[2].it_strName = "Vitraj 2";
pwo->wo_aitIlluminationTypes[3].it_strName = "Vitraj 3";
pwo->wo_aitIlluminationTypes[4].it_strName = "Lava 1";
pwo->wo_aitIlluminationTypes[5].it_strName = "Lava 2";
pwo->wo_aitIlluminationTypes[6].it_strName = "Lava 3";
pwo->wo_aitIlluminationTypes[7].it_strName = "Misc 1";
pwo->wo_aitIlluminationTypes[8].it_strName = "Misc 2";
pwo->wo_aitIlluminationTypes[9].it_strName = "Misc 3";
// surfaces
pwo->wo_astSurfaceTypes[0].st_strName = "Standard";
pwo->wo_astSurfaceTypes[0].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[0].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[0].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[0].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[1].st_strName = "Ice";
pwo->wo_astSurfaceTypes[1].st_fFriction = 0.045f;
pwo->wo_astSurfaceTypes[1].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[1].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[1].st_fClimbSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[2].st_strName = "Standard - no step";
pwo->wo_astSurfaceTypes[2].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[2].st_fStairsHeight = -0.2f;
pwo->wo_astSurfaceTypes[2].st_fJumpSlopeCos = Cos(10.0f);
pwo->wo_astSurfaceTypes[2].st_fClimbSlopeCos = Cos(10.0f);
pwo->wo_astSurfaceTypes[3].st_strName = "Standard - high stairs";
pwo->wo_astSurfaceTypes[3].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[3].st_fStairsHeight = 2.0f;
pwo->wo_astSurfaceTypes[3].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[3].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[4].st_strName = "Ice climbable slope";
pwo->wo_astSurfaceTypes[4].st_fFriction = 0.05f;
pwo->wo_astSurfaceTypes[4].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[4].st_fJumpSlopeCos = Cos(15.0f);
pwo->wo_astSurfaceTypes[4].st_fClimbSlopeCos = Cos(15.0f);
pwo->wo_astSurfaceTypes[5].st_strName = "Ice sliding slope";
pwo->wo_astSurfaceTypes[5].st_fFriction = 0.001f;
pwo->wo_astSurfaceTypes[5].st_fStairsHeight = 0.0f;
pwo->wo_astSurfaceTypes[5].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[5].st_fClimbSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[6].st_strName = "Ice less sliding";
pwo->wo_astSurfaceTypes[6].st_fFriction = 0.06f;
pwo->wo_astSurfaceTypes[6].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[6].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[6].st_fClimbSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[7].st_strName = "Roller coaster";
pwo->wo_astSurfaceTypes[7].st_fFriction = 0.1f;
pwo->wo_astSurfaceTypes[7].st_fStairsHeight = 0.0f;
pwo->wo_astSurfaceTypes[7].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[7].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[7].st_ulFlags = STF_SLIDEDOWNSLOPE;
pwo->wo_astSurfaceTypes[8].st_strName = "Lava";
pwo->wo_astSurfaceTypes[8].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[8].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[8].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[8].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[8].st_iWalkDamageType = DMT_BURNING;
pwo->wo_astSurfaceTypes[8].st_fWalkDamageAmount = 2.0f;
pwo->wo_astSurfaceTypes[8].st_tmWalkDamageFrequency = 0.5f;
ASSERT(9==SURFACE_SAND);
pwo->wo_astSurfaceTypes[9].st_strName = "Sand";
pwo->wo_astSurfaceTypes[9].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[9].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[9].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[9].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[10].st_strName = "Clibamble Slope";
pwo->wo_astSurfaceTypes[10].st_fFriction = 2.0f;
pwo->wo_astSurfaceTypes[10].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[10].st_fJumpSlopeCos = Cos(60.0f);
pwo->wo_astSurfaceTypes[10].st_fClimbSlopeCos = Cos(60.0f);
pwo->wo_astSurfaceTypes[11].st_strName = "Standard - no impact";
pwo->wo_astSurfaceTypes[11].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[11].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[11].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[11].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[11].st_ulFlags = STF_NOIMPACT;
ASSERT(12==SURFACE_WATER);
pwo->wo_astSurfaceTypes[12].st_strName = "Water";
pwo->wo_astSurfaceTypes[12].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[12].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[12].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[12].st_fClimbSlopeCos = Cos(45.0f);
ASSERT(13==SURFACE_RED_SAND);
pwo->wo_astSurfaceTypes[13].st_strName = "Red sand";
pwo->wo_astSurfaceTypes[13].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[13].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[13].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[13].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[14].st_strName = "Ice sliding slope no impact";
pwo->wo_astSurfaceTypes[14].st_fFriction = 0.001f;
pwo->wo_astSurfaceTypes[14].st_fStairsHeight = 0.0f;
pwo->wo_astSurfaceTypes[14].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[14].st_fClimbSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[14].st_ulFlags = STF_NOIMPACT;
pwo->wo_astSurfaceTypes[15].st_strName = "Roller coaster no impact";
pwo->wo_astSurfaceTypes[15].st_fFriction = 0.1f;
pwo->wo_astSurfaceTypes[15].st_fStairsHeight = 0.0f;
pwo->wo_astSurfaceTypes[15].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[15].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[15].st_ulFlags = STF_SLIDEDOWNSLOPE | STF_NOIMPACT;
pwo->wo_astSurfaceTypes[16].st_strName = "Standard - high stairs no impact";
pwo->wo_astSurfaceTypes[16].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[16].st_fStairsHeight = 2.0f;
pwo->wo_astSurfaceTypes[16].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[16].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[16].st_ulFlags = STF_NOIMPACT;
ASSERT(17==SURFACE_GRASS);
pwo->wo_astSurfaceTypes[17].st_strName = "Grass";
pwo->wo_astSurfaceTypes[17].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[17].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[17].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[17].st_fClimbSlopeCos = Cos(45.0f);
ASSERT(18==SURFACE_WOOD);
pwo->wo_astSurfaceTypes[18].st_strName = "Wood";
pwo->wo_astSurfaceTypes[18].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[18].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[18].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[18].st_fClimbSlopeCos = Cos(45.0f);
ASSERT(19==SURFACE_GRASS_SLIDING);
pwo->wo_astSurfaceTypes[19].st_strName = "Grass sliding";
pwo->wo_astSurfaceTypes[19].st_fFriction = 0.1f;
pwo->wo_astSurfaceTypes[19].st_fStairsHeight = 0.0f;
pwo->wo_astSurfaceTypes[19].st_fJumpSlopeCos = Cos(5.0f);
pwo->wo_astSurfaceTypes[19].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[19].st_ulFlags = STF_SLIDEDOWNSLOPE;
ASSERT(20==SURFACE_GRASS_NOIMPACT);
pwo->wo_astSurfaceTypes[20].st_strName = "Grass no impact";
pwo->wo_astSurfaceTypes[20].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[20].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[20].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[20].st_fClimbSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[20].st_ulFlags = STF_NOIMPACT;
ASSERT(21==SURFACE_SNOW);
pwo->wo_astSurfaceTypes[21].st_strName = "Snow";
pwo->wo_astSurfaceTypes[21].st_fFriction = 1.0f;
pwo->wo_astSurfaceTypes[21].st_fStairsHeight = 1.0f;
pwo->wo_astSurfaceTypes[21].st_fJumpSlopeCos = Cos(45.0f);
pwo->wo_astSurfaceTypes[21].st_fClimbSlopeCos = Cos(45.0f);
// contents
pwo->wo_actContentTypes[0].ct_strName = "Air";
pwo->wo_actContentTypes[0].ct_fDensity = 0.0f;
pwo->wo_actContentTypes[0].ct_fFluidFriction = 0.0f;
pwo->wo_actContentTypes[0].ct_fControlMultiplier = 1.0f;
pwo->wo_actContentTypes[0].ct_fSpeedMultiplier = 1.0f;
pwo->wo_actContentTypes[0].ct_fDrowningDamageAmount = 10.0f;
pwo->wo_actContentTypes[0].ct_tmDrowningDamageDelay = 1.0f;
pwo->wo_actContentTypes[0].ct_ulFlags = CTF_FLYABLE|CTF_BREATHABLE_LUNGS;
pwo->wo_actContentTypes[1].ct_strName = "Water";
pwo->wo_actContentTypes[1].ct_fDensity = 1000.0f;
pwo->wo_actContentTypes[1].ct_fFluidFriction = 0.0f;
pwo->wo_actContentTypes[1].ct_fControlMultiplier = 2.0f;
pwo->wo_actContentTypes[1].ct_fSpeedMultiplier = 0.75f;
pwo->wo_actContentTypes[1].ct_fDrowningDamageAmount = 10.0f;
pwo->wo_actContentTypes[1].ct_tmDrowningDamageDelay = 1.0f;
pwo->wo_actContentTypes[1].ct_ulFlags = CTF_BREATHABLE_GILLS|CTF_SWIMABLE|CTF_FADESPINNING;
pwo->wo_actContentTypes[2].ct_strName = "Lava";
pwo->wo_actContentTypes[2].ct_fDensity = 800.0f;
pwo->wo_actContentTypes[2].ct_fFluidFriction = 1.0f;
pwo->wo_actContentTypes[2].ct_fControlMultiplier = 2.0f;
pwo->wo_actContentTypes[2].ct_fSpeedMultiplier = 0.5f;
pwo->wo_actContentTypes[2].ct_fDrowningDamageAmount = 0.0f;
pwo->wo_actContentTypes[2].ct_tmDrowningDamageDelay = 1.0f;
pwo->wo_actContentTypes[2].ct_iSwimDamageType = DMT_BURNING;
pwo->wo_actContentTypes[2].ct_fSwimDamageAmount = 50.0f;
pwo->wo_actContentTypes[2].ct_tmSwimDamageFrequency = 0.25f;
pwo->wo_actContentTypes[2].ct_ulFlags = CTF_FADESPINNING;
pwo->wo_actContentTypes[3].ct_strName = "Cold Water";
pwo->wo_actContentTypes[3].ct_fDensity = 1000.0f;
pwo->wo_actContentTypes[3].ct_fFluidFriction = 0.0f;
pwo->wo_actContentTypes[3].ct_fControlMultiplier = 2.0f;
pwo->wo_actContentTypes[3].ct_fSpeedMultiplier = 0.75f;
pwo->wo_actContentTypes[3].ct_fDrowningDamageAmount = 10.0f;
pwo->wo_actContentTypes[3].ct_tmDrowningDamageDelay = 1.0f;
pwo->wo_actContentTypes[3].ct_iSwimDamageType = DMT_FREEZING;
pwo->wo_actContentTypes[3].ct_fSwimDamageAmount = 1.0f;
pwo->wo_actContentTypes[3].ct_tmSwimDamageDelay = 5.0f;
pwo->wo_actContentTypes[3].ct_tmSwimDamageFrequency = 1.0f;
pwo->wo_actContentTypes[3].ct_ulFlags = CTF_BREATHABLE_GILLS|CTF_SWIMABLE|CTF_FADESPINNING;
pwo->wo_actContentTypes[4].ct_strName = "Spikes";
pwo->wo_actContentTypes[4].ct_fDensity = 500.0f;
pwo->wo_actContentTypes[4].ct_fFluidFriction = 0.5f;
pwo->wo_actContentTypes[4].ct_fControlMultiplier = 1.0f;
pwo->wo_actContentTypes[4].ct_fSpeedMultiplier = 0.75f;
pwo->wo_actContentTypes[4].ct_iKillDamageType = DMT_SPIKESTAB;
pwo->wo_actContentTypes[4].ct_fKillImmersion = 0.5f;
pwo->wo_actContentTypes[4].ct_ulFlags = CTF_BREATHABLE_LUNGS|CTF_FADESPINNING;
pwo->wo_actContentTypes[5].ct_strName = "Desert heat";
pwo->wo_actContentTypes[5].ct_fDensity = 0.0f;
pwo->wo_actContentTypes[5].ct_fFluidFriction = 0.0f;
pwo->wo_actContentTypes[5].ct_fControlMultiplier = 1.0f;
pwo->wo_actContentTypes[5].ct_fSpeedMultiplier = 1.0f;
pwo->wo_actContentTypes[5].ct_iSwimDamageType = DMT_HEAT;
pwo->wo_actContentTypes[5].ct_fSwimDamageAmount = 10.0f;
pwo->wo_actContentTypes[5].ct_tmSwimDamageDelay = 10.0f;
pwo->wo_actContentTypes[5].ct_tmSwimDamageFrequency = 2.0f;
pwo->wo_actContentTypes[5].ct_ulFlags = CTF_FLYABLE|CTF_BREATHABLE_LUNGS;
pwo->wo_actContentTypes[6].ct_strName = "Lava (-10HP/SEC)";
pwo->wo_actContentTypes[6].ct_fDensity = 1000.0f;
pwo->wo_actContentTypes[6].ct_fFluidFriction = 0.0f;
pwo->wo_actContentTypes[6].ct_fControlMultiplier = 2.0f;
pwo->wo_actContentTypes[6].ct_fSpeedMultiplier = 0.75f;
pwo->wo_actContentTypes[6].ct_fDrowningDamageAmount = 0.0f;
pwo->wo_actContentTypes[6].ct_tmDrowningDamageDelay = 1.0f;
pwo->wo_actContentTypes[6].ct_iSwimDamageType = DMT_BURNING;
pwo->wo_actContentTypes[6].ct_fSwimDamageAmount = 5.0f;
pwo->wo_actContentTypes[6].ct_tmSwimDamageFrequency = 0.5f;
pwo->wo_actContentTypes[6].ct_ulFlags = CTF_SWIMABLE|CTF_FADESPINNING;
// environments
pwo->wo_aetEnvironmentTypes[ 0].et_strName = "Normal";
pwo->wo_aetEnvironmentTypes[ 0].et_iType = 1;
pwo->wo_aetEnvironmentTypes[ 0].et_fSize = 1.4f;
pwo->wo_aetEnvironmentTypes[ 1].et_strName = "Generic";
pwo->wo_aetEnvironmentTypes[ 1].et_iType = 0;
pwo->wo_aetEnvironmentTypes[ 1].et_fSize = 7.5f;
pwo->wo_aetEnvironmentTypes[ 2].et_strName = "Small room";
pwo->wo_aetEnvironmentTypes[ 2].et_iType = EAX_ENVIRONMENT_LIVINGROOM;
pwo->wo_aetEnvironmentTypes[ 2].et_fSize = 2.5f;
pwo->wo_aetEnvironmentTypes[ 3].et_strName = "Medium room";
pwo->wo_aetEnvironmentTypes[ 3].et_iType = EAX_ENVIRONMENT_STONEROOM;
pwo->wo_aetEnvironmentTypes[ 3].et_fSize = 11.6f;
pwo->wo_aetEnvironmentTypes[ 4].et_strName = "Big room";
pwo->wo_aetEnvironmentTypes[ 4].et_iType = EAX_ENVIRONMENT_AUDITORIUM;
pwo->wo_aetEnvironmentTypes[ 4].et_fSize = 21.6f;
pwo->wo_aetEnvironmentTypes[ 5].et_strName = "Corridor";
pwo->wo_aetEnvironmentTypes[ 5].et_iType = EAX_ENVIRONMENT_HALLWAY;
pwo->wo_aetEnvironmentTypes[ 5].et_fSize = 1.8f;
pwo->wo_aetEnvironmentTypes[ 6].et_strName = "Arena";
pwo->wo_aetEnvironmentTypes[ 6].et_iType = EAX_ENVIRONMENT_ARENA;
pwo->wo_aetEnvironmentTypes[ 6].et_fSize = 36.2f;
pwo->wo_aetEnvironmentTypes[ 7].et_strName = "Long corridor";
pwo->wo_aetEnvironmentTypes[ 7].et_iType = EAX_ENVIRONMENT_STONECORRIDOR;
pwo->wo_aetEnvironmentTypes[ 7].et_fSize = 13.5f;
pwo->wo_aetEnvironmentTypes[ 8].et_strName = "Small canyon";
pwo->wo_aetEnvironmentTypes[ 8].et_iType = EAX_ENVIRONMENT_QUARRY;
pwo->wo_aetEnvironmentTypes[ 8].et_fSize = 17.5f;
pwo->wo_aetEnvironmentTypes[ 9].et_strName = "Big canyon";
pwo->wo_aetEnvironmentTypes[ 9].et_iType = EAX_ENVIRONMENT_MOUNTAINS;
pwo->wo_aetEnvironmentTypes[ 9].et_fSize = 100.0f;
pwo->wo_aetEnvironmentTypes[10].et_strName = "Open space";
pwo->wo_aetEnvironmentTypes[10].et_iType = EAX_ENVIRONMENT_PLAIN;
pwo->wo_aetEnvironmentTypes[10].et_fSize = 42.5f;
pwo->wo_aetEnvironmentTypes[11].et_strName = "Cave";
pwo->wo_aetEnvironmentTypes[11].et_iType = EAX_ENVIRONMENT_CAVE;
pwo->wo_aetEnvironmentTypes[11].et_fSize = 14.6f;
pwo->wo_aetEnvironmentTypes[12].et_strName = "Sewers";
pwo->wo_aetEnvironmentTypes[12].et_iType = EAX_ENVIRONMENT_SEWERPIPE;
pwo->wo_aetEnvironmentTypes[12].et_fSize = 1.7f;
pwo->wo_aetEnvironmentTypes[13].et_strName = "Underwater";
pwo->wo_aetEnvironmentTypes[13].et_iType = EAX_ENVIRONMENT_UNDERWATER;
pwo->wo_aetEnvironmentTypes[13].et_fSize = 1.8f;
// declare console variables
_pShell->DeclareSymbol("user void MakeWorldStatistics(void);", &MakeWorldStatistics);
_pShell->DeclareSymbol("user void ReoptimizeAllBrushes(void);", &ReoptimizeAllBrushes);
_pShell->DeclareSymbol("user void DoLevelSafetyChecks(void);", &DoLevelSafetyChecks);
}
void CWorldBase_OnWorldRender(CWorld *pwo)
{
// get current tick
TIME tmNow = _pTimer->GetLerpedCurrentTick();
// wrap time to prevent texture coordinates to get unprecise
tmNow = fmod(tmNow, 600.0f); // (wrap every 10 minutes)
// transformations
// right
pwo->wo_attTextureTransformations[1].tt_mdTransformation.md_fUOffset= 128/1024.0f*tmNow;
pwo->wo_attTextureTransformations[2].tt_mdTransformation.md_fUOffset= 256/1024.0f*tmNow;
pwo->wo_attTextureTransformations[3].tt_mdTransformation.md_fUOffset= 512/1024.0f*tmNow;
pwo->wo_attTextureTransformations[4].tt_mdTransformation.md_fUOffset=1024/1024.0f*tmNow;
pwo->wo_attTextureTransformations[5].tt_mdTransformation.md_fUOffset=2048/1024.0f*tmNow;
pwo->wo_attTextureTransformations[6].tt_mdTransformation.md_fUOffset=4096/1024.0f*tmNow;
pwo->wo_attTextureTransformations[7].tt_mdTransformation.md_fUOffset=8192/1024.0f*tmNow;
// down
pwo->wo_attTextureTransformations[37].tt_mdTransformation.md_fVOffset= 128/1024.0f*tmNow;
pwo->wo_attTextureTransformations[38].tt_mdTransformation.md_fVOffset= 256/1024.0f*tmNow;
pwo->wo_attTextureTransformations[39].tt_mdTransformation.md_fVOffset= 512/1024.0f*tmNow;
pwo->wo_attTextureTransformations[40].tt_mdTransformation.md_fVOffset=1024/1024.0f*tmNow;
pwo->wo_attTextureTransformations[41].tt_mdTransformation.md_fVOffset=2048/1024.0f*tmNow;
pwo->wo_attTextureTransformations[42].tt_mdTransformation.md_fVOffset=4096/1024.0f*tmNow;
pwo->wo_attTextureTransformations[43].tt_mdTransformation.md_fVOffset=8192/1024.0f*tmNow;
pwo->wo_attTextureTransformations[44].tt_mdTransformation.md_fVOffset=8192*2/1024.0f*tmNow;
pwo->wo_attTextureTransformations[45].tt_mdTransformation.md_fVOffset=8192*4/1024.0f*tmNow;
CMappingDefinitionUI mdui;
mdui.mdui_fUStretch = 1.0f;
mdui.mdui_fVStretch = 1.0f;
mdui.mdui_fUOffset = 0.0f;
mdui.mdui_fVOffset = 0.0f;
// rotations left
mdui.mdui_aURotation = 8192*1/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*1/1024.0f*tmNow;
pwo->wo_attTextureTransformations[17].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*2/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*2/1024.0f*tmNow;
pwo->wo_attTextureTransformations[18].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*4/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*4/1024.0f*tmNow;
pwo->wo_attTextureTransformations[19].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*8/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*8/1024.0f*tmNow;
pwo->wo_attTextureTransformations[20].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*16/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*16/1024.0f*tmNow;
pwo->wo_attTextureTransformations[21].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*32/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*32/1024.0f*tmNow;
pwo->wo_attTextureTransformations[22].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*64/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*64/1024.0f*tmNow;
pwo->wo_attTextureTransformations[23].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*128/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*128/1024.0f*tmNow;
pwo->wo_attTextureTransformations[24].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = 8192*256/1024.0f*tmNow;
mdui.mdui_aVRotation = 8192*256/1024.0f*tmNow;
pwo->wo_attTextureTransformations[25].tt_mdTransformation.FromUI(mdui);
// rotations right
mdui.mdui_aURotation = -8192*1/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*1/1024.0f*tmNow;
pwo->wo_attTextureTransformations[27].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*2/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*2/1024.0f*tmNow;
pwo->wo_attTextureTransformations[28].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*4/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*4/1024.0f*tmNow;
pwo->wo_attTextureTransformations[29].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*8/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*8/1024.0f*tmNow;
pwo->wo_attTextureTransformations[30].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*16/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*16/1024.0f*tmNow;
pwo->wo_attTextureTransformations[31].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*32/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*32/1024.0f*tmNow;
pwo->wo_attTextureTransformations[32].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*64/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*64/1024.0f*tmNow;
pwo->wo_attTextureTransformations[33].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*128/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*128/1024.0f*tmNow;
pwo->wo_attTextureTransformations[34].tt_mdTransformation.FromUI(mdui);
mdui.mdui_aURotation = -8192*256/1024.0f*tmNow;
mdui.mdui_aVRotation = -8192*256/1024.0f*tmNow;
pwo->wo_attTextureTransformations[35].tt_mdTransformation.FromUI(mdui);
// blendings
FLOAT f = Abs(Sin(tmNow*AngleDeg(180.0f)));
pwo->wo_atbTextureBlendings[4].tb_colMultiply = RGBAToColor(f*255, f*255, f*255, 255);
pwo->wo_atbTextureBlendings[5].tb_colMultiply = C_WHITE|UBYTE(255*f);
pwo->wo_atbTextureBlendings[6].tb_colMultiply = RGBAToColor(f*255, f*255, f*255, 255);
pwo->wo_atbTextureBlendings[7].tb_colMultiply = C_WHITE|UBYTE(255*Lerp(0.5f, 1.0f, f));
pwo->wo_attTextureTransformations[11].tt_mdTransformation.md_fUOffset=Sin( tmNow*22)/30;
pwo->wo_attTextureTransformations[11].tt_mdTransformation.md_fVOffset=Cos( tmNow*26)/35;
pwo->wo_attTextureTransformations[12].tt_mdTransformation.md_fUOffset=Sin( tmNow*32)/10;
pwo->wo_attTextureTransformations[12].tt_mdTransformation.md_fVOffset=Cos( tmNow*22)/15;
pwo->wo_attTextureTransformations[13].tt_mdTransformation.md_fUOffset=Sin( tmNow*15)/7;
pwo->wo_attTextureTransformations[13].tt_mdTransformation.md_fVOffset=Cos( tmNow*25)/8;
pwo->wo_attTextureTransformations[14].tt_mdTransformation.md_fUOffset=Sin( tmNow*32)/3;
pwo->wo_attTextureTransformations[14].tt_mdTransformation.md_fVOffset=Cos( tmNow*22)/3;
pwo->wo_attTextureTransformations[15].tt_mdTransformation.md_fUOffset=Sin( tmNow*15);
pwo->wo_attTextureTransformations[15].tt_mdTransformation.md_fVOffset=Cos( tmNow*25);
// ----------- Obtain world settings controller
CWorldSettingsController *pwsc = NULL;
// obtain bcg viewer
CBackgroundViewer *penBcgViewer = (CBackgroundViewer *) pwo->GetBackgroundViewer();
if( penBcgViewer != NULL)
{
// obtain world settings controller
pwsc = (CWorldSettingsController *) &*penBcgViewer->m_penWorldSettingsController;
}
// ***** Storm effects
// if world settings controller is valid
if( pwsc != NULL)
{
FLOAT fStormFactor = pwsc->GetStormFactor();
COLOR colBlend = LerpColor( pwsc->m_colBlendStart, pwsc->m_colBlendStop, fStormFactor);
pwo->wo_atbTextureBlendings[8].tb_colMultiply = colBlend;
// set world polygon shading multiplier
COLOR colShade = LerpColor( pwsc->m_colShadeStart, pwsc->m_colShadeStop, fStormFactor);
// apply lightning FX
if( pwsc->m_tmLightningStart != -1)
{
FLOAT tmLightningLife = tmNow-pwsc->m_tmLightningStart;
_aoLightningColor.ao_tmAnimStart = pwsc->m_tmLightningStart;
COLOR colLightning = _aoLightningColor.GetFrame();
// calculate lightning power factor
UBYTE ub = UBYTE( pwsc->m_fLightningPower*255);
COLOR colFactor = RGBToColor( ub, ub, ub) | CT_OPAQUE;
colLightning = MulColors( colLightning, colFactor);
colShade = AddColors( colShade, colLightning);
}
pwo->wo_atbTextureBlendings[9].tb_colMultiply = colShade;
}
// ***** Pyramid blending effects
// if world settings controller is valid
if( pwsc != NULL)
{
// set alpha values for switch-controlled pyramid plate activating
SetPyramidPlateActivateAlpha(pwo, 10, pwsc->m_tmPyramidPlatesStart, 1e6, FALSE);
SetPyramidPlateActivateAlpha(pwo, 11, pwsc->m_tmActivatedPlate1, pwsc->m_tmDeactivatedPlate1, TRUE);
SetPyramidPlateActivateAlpha(pwo, 12, pwsc->m_tmActivatedPlate2, pwsc->m_tmDeactivatedPlate2, TRUE);
SetPyramidPlateActivateAlpha(pwo, 13, pwsc->m_tmActivatedPlate3, pwsc->m_tmDeactivatedPlate3, TRUE);
SetPyramidPlateActivateAlpha(pwo, 14, pwsc->m_tmActivatedPlate4, pwsc->m_tmDeactivatedPlate4, TRUE);
// pyramid morph room
SetPyramidMorphRoomAlpha(pwo, 15, pwsc->m_tmPyramidMorphRoomActivated);
}
};
void CWorldBase_OnInitClass(void)
{
// init particle effects
InitParticles();
try
{
// setup simple model shadow texture
_toSimpleModelShadow.SetData_t( CTFILENAME("Textures\\Effects\\Shadow\\SimpleModelShadow.tex"));
_aoLightningColor.SetData_t( CTFILENAME("Animations\\Lightning.ani"));
// we will use first animation in .ani file for lightning
_aoLightningColor.PlayAnim(0, AOF_NORESTART);
}
catch(char *strError)
{
FatalError(TRANS("Cannot load shadow texture: \n%s"), strError);
}
}
void CWorldBase_OnEndClass(void)
{
// close particle effects
CloseParticles();
}
class CFixedForce {
public:
CTString ff_strName;
class CForceStrength ff_fsGravity;
class CForceStrength ff_fsField;
inline CFixedForce(CTString strName,
FLOAT3D vDirection,
FLOAT fAcceleration,
FLOAT fVelocity)
{
ff_strName = strName;
ff_fsGravity.fs_vDirection =vDirection;
ff_fsGravity.fs_fAcceleration =fAcceleration;
ff_fsGravity.fs_fVelocity =fVelocity;
}
};
static CFixedForce affFixedForces[] =
{
CFixedForce ("Normal D", FLOAT3D( 0,-1, 0), 30, 70),
CFixedForce ("Normal U", FLOAT3D( 0,+1, 0), 30, 70),
CFixedForce ("Normal N", FLOAT3D( 0, 0,-1), 30, 70),
CFixedForce ("Normal S", FLOAT3D( 0, 0,+1), 30, 70),
CFixedForce ("Normal E", FLOAT3D(-1, 0, 0), 30, 70),
CFixedForce ("Normal W", FLOAT3D(+1, 0, 0), 30, 70),
CFixedForce ("ZeroG", FLOAT3D(+1, 0, 0), 0, 0),
CFixedForce ("Unused", FLOAT3D(+1, 0, 0), 0, 0),
CFixedForce ("Unused", FLOAT3D(+1, 0, 0), 0, 0),
CFixedForce ("Unused", FLOAT3D(+1, 0, 0), 0, 0),
};
static INDEX ctFixedForces = ARRAYCOUNT(affFixedForces);
extern void GetDefaultForce(INDEX iForce, const FLOAT3D &vPoint,
CForceStrength &fsGravity, CForceStrength &fsField)
{
if (iForce<ctFixedForces) {
fsGravity = affFixedForces[iForce].ff_fsGravity;
}
}
void CWorldBase::SetDefaultProperties(void) {
m_strName = "World Base";
m_strDescription = "";
m_bZoning = FALSE ;
m_bBackground = FALSE ;
m_bAnchored = FALSE ;
m_penGravity0 = NULL;
m_penGravity1 = NULL;
m_penGravity2 = NULL;
m_penGravity3 = NULL;
m_penGravity4 = NULL;
m_penGravity5 = NULL;
m_penGravity6 = NULL;
m_penGravity7 = NULL;
m_penGravity8 = NULL;
m_penGravity9 = NULL;
m_penFog0 = NULL;
m_penFog1 = NULL;
m_penFog2 = NULL;
m_penFog3 = NULL;
m_penFog4 = NULL;
m_penFog5 = NULL;
m_penFog6 = NULL;
m_penFog7 = NULL;
m_penFog8 = NULL;
m_penFog9 = NULL;
m_penHaze0 = NULL;
m_penHaze1 = NULL;
m_penHaze2 = NULL;
m_penHaze3 = NULL;
m_penHaze4 = NULL;
m_penMirror0 = NULL;
m_penMirror1 = NULL;
m_penMirror2 = NULL;
m_penMirror3 = NULL;
m_penMirror4 = NULL;
m_penGradient0 = NULL;
m_penGradient1 = NULL;
m_penGradient2 = NULL;
m_penGradient3 = NULL;
m_penGradient4 = NULL;
m_penGradient5 = NULL;
m_penGradient6 = NULL;
m_penGradient7 = NULL;
m_penGradient8 = NULL;
m_penGradient9 = NULL;
m_penGradient10 = NULL;
m_penGradient11 = NULL;
m_penGradient12 = NULL;
m_penGradient13 = NULL;
m_penGradient14 = NULL;
m_penGradient15 = NULL;
m_penGradient16 = NULL;
m_penGradient17 = NULL;
m_penGradient18 = NULL;
m_penGradient19 = NULL;
m_cbClassificationBits = 0;
m_vbVisibilityBits = 0;
m_fOpacity = 1.0f;
CEntity::SetDefaultProperties();
}
#line 1003 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ULONG CWorldBase::GetVisTweaks(void)
#line 1004 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1005 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return m_cbClassificationBits | m_vbVisibilityBits ;
#line 1006 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1009 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::IsTargetValid(SLONG slPropertyOffset,CEntity * penTarget)
#line 1010 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1011 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(penTarget == NULL )
#line 1012 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1013 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1014 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1016 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ULONG ulFirst , ulLast ;
#line 1017 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CTString strClass ;
#line 1020 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulFirst = offsetof (CWorldBase , m_penGradient0 );
#line 1021 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulLast = offsetof (CWorldBase , m_penGradient19 );
#line 1022 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
strClass = "Gradient Marker";
#line 1023 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((slPropertyOffset >= ulFirst ) && (slPropertyOffset <= ulLast )){
#line 1024 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return (IsDerivedFromClass (penTarget , strClass ));
#line 1025 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1028 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulFirst = offsetof (CWorldBase , m_penGravity0 );
#line 1029 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulLast = offsetof (CWorldBase , m_penGravity9 );
#line 1030 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((slPropertyOffset >= ulFirst ) && (slPropertyOffset <= ulLast )){
#line 1031 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return
#line 1032 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
IsDerivedFromClass (penTarget , "Gravity Marker") ||
#line 1033 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
IsDerivedFromClass (penTarget , "Gravity Router");
#line 1034 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1037 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulFirst = offsetof (CWorldBase , m_penMirror0 );
#line 1038 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulLast = offsetof (CWorldBase , m_penMirror4 );
#line 1039 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
strClass = "Mirror Marker";
#line 1040 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((slPropertyOffset >= ulFirst ) && (slPropertyOffset <= ulLast )){
#line 1041 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return (IsDerivedFromClass (penTarget , strClass ));
#line 1042 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1045 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulFirst = offsetof (CWorldBase , m_penFog0 );
#line 1046 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulLast = offsetof (CWorldBase , m_penFog9 );
#line 1047 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
strClass = "Fog Marker";
#line 1048 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((slPropertyOffset >= ulFirst ) && (slPropertyOffset <= ulLast )){
#line 1049 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return (IsDerivedFromClass (penTarget , strClass ));
#line 1050 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1053 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulFirst = offsetof (CWorldBase , m_penHaze0 );
#line 1054 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
ulLast = offsetof (CWorldBase , m_penHaze4 );
#line 1055 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
strClass = "Haze Marker";
#line 1056 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((slPropertyOffset >= ulFirst ) && (slPropertyOffset <= ulLast )){
#line 1057 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return (IsDerivedFromClass (penTarget , strClass ));
#line 1058 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1060 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return CEntity :: IsTargetValid (slPropertyOffset , penTarget );
#line 1061 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1064 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
const CTString & CWorldBase::GetForceName(INDEX iForce)
#line 1065 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1066 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strDummyName ("");
#line 1067 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strMarkerUnused ("Marker not set");
#line 1068 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGravityMarkers = & m_penGravity9 - & m_penGravity0 + 1;
#line 1070 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce < ctFixedForces ){
#line 1071 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return affFixedForces [ iForce ] . ff_strName ;
#line 1072 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1073 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce - ctFixedForces <= ctGravityMarkers ){
#line 1074 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CEntity * pen = & * (& m_penGravity0 ) [ iForce - ctFixedForces ];
#line 1075 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pen != NULL ){
#line 1076 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pen -> GetForceName (0);
#line 1077 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1078 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strMarkerUnused ;
#line 1079 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1081 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1082 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1083 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1084 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1086 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
void CWorldBase::GetForce(INDEX iForce,const FLOAT3D & vPoint,
#line 1087 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CForceStrength & fsGravity,CForceStrength & fsField)
#line 1088 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1089 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGravityMarkers = & m_penGravity9 - & m_penGravity0 + 1;
#line 1090 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce < ctFixedForces ){
#line 1091 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsGravity = affFixedForces [ iForce ] . ff_fsGravity ;
#line 1092 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1093 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce - ctFixedForces < ctGravityMarkers ){
#line 1094 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CEntity * pen = & * (& m_penGravity0 ) [ iForce - ctFixedForces ];
#line 1095 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pen != NULL ){
#line 1096 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
pen -> GetForce (0 , vPoint , fsGravity , fsField );
#line 1097 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return ;
#line 1098 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1099 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1100 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsGravity . fs_fAcceleration = 30;
#line 1101 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsGravity . fs_fVelocity = 70;
#line 1102 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsGravity . fs_vDirection = FLOAT3D (1 , 0 , 0);
#line 1103 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1104 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsField . fs_fAcceleration = 0;
#line 1105 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
fsField . fs_fVelocity = 0;
#line 1106 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1109 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CEntity * CWorldBase::GetForceController(INDEX iForce)
#line 1110 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1111 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGravityMarkers = & m_penGravity9 - & m_penGravity0 + 1;
#line 1112 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce < ctFixedForces ){
#line 1113 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return NULL ;
#line 1114 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1115 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iForce - ctFixedForces < ctGravityMarkers ){
#line 1116 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CEntity * pen = & * (& m_penGravity0 ) [ iForce - ctFixedForces ];
#line 1117 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pen != NULL ){
#line 1118 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pen -> GetForceController (0);
#line 1119 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1120 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1121 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1122 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return NULL ;
#line 1123 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1125 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
const CTString & CWorldBase::GetFogName(INDEX iFog)
#line 1126 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1127 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctFogMarkers = & m_penFog9 - & m_penFog0 + 1;
#line 1128 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strDummyName ("");
#line 1129 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strMarkerUnused ("Marker not set");
#line 1130 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iFog < ctFogMarkers ){
#line 1131 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CFogMarker * pfm = (CFogMarker *) & * (& m_penFog0 ) [ iFog ];
#line 1132 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pfm != NULL ){
#line 1133 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pfm -> GetFogName ();
#line 1134 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1135 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strMarkerUnused ;
#line 1136 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1137 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1138 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1139 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1141 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::GetFog(INDEX iFog,class CFogParameters & fpFog)
#line 1142 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1143 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctFogMarkers = & m_penFog8 - & m_penFog0 + 1;
#line 1144 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iFog < ctFogMarkers ){
#line 1145 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CFogMarker * pfm = (CFogMarker *) & * (& m_penFog0 ) [ iFog ];
#line 1146 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pfm != NULL ){
#line 1147 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
pfm -> GetFog (fpFog );
#line 1148 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE ;
#line 1149 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1150 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1151 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1152 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1155 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
const CTString & CWorldBase::GetHazeName(INDEX iHaze)
#line 1156 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1157 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctHazeMarkers = & m_penHaze4 - & m_penHaze0 + 1;
#line 1158 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strDummyName ("");
#line 1159 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strMarkerUnused ("Marker not set");
#line 1160 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iHaze < ctHazeMarkers ){
#line 1161 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CHazeMarker * pfm = (CHazeMarker *) & * (& m_penHaze0 ) [ iHaze ];
#line 1162 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pfm != NULL ){
#line 1163 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pfm -> GetHazeName ();
#line 1164 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1165 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strMarkerUnused ;
#line 1166 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1167 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1168 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1169 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1172 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::GetHaze(INDEX iHaze,class CHazeParameters & hpHaze,FLOAT3D & vViewDir)
#line 1173 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1174 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctHazeMarkers = & m_penHaze4 - & m_penHaze0 + 1;
#line 1175 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iHaze < ctHazeMarkers ){
#line 1176 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CHazeMarker * phm = (CHazeMarker *) & * (& m_penHaze0 ) [ iHaze ];
#line 1177 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(phm != NULL ){
#line 1178 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
phm -> GetHaze (hpHaze , vViewDir );
#line 1179 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE ;
#line 1180 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1181 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1182 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1183 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1186 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
const CTString & CWorldBase::GetMirrorName(INDEX iMirror)
#line 1187 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1188 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strDummyName ("");
#line 1189 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strMarkerUnused ("Marker not set");
#line 1190 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iMirror == 0){
#line 1191 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1192 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1194 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
switch(iMirror ){
#line 1195 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 1: {static const CTString str ("std mirror 1");return str ;};break ;
#line 1196 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 2: {static const CTString str ("std mirror 2");return str ;};break ;
#line 1197 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 3: {static const CTString str ("std mirror 3");return str ;};break ;
#line 1198 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 4: {static const CTString str ("std mirror 4");return str ;};break ;
#line 1199 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 5: {static const CTString str ("std mirror 5");return str ;};break ;
#line 1200 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 6: {static const CTString str ("std mirror 6");return str ;};break ;
#line 1201 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 7: {static const CTString str ("std mirror 7");return str ;};break ;
#line 1202 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
case 8: {static const CTString str ("std mirror 8");return str ;};break ;
#line 1203 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
default :{
#line 1204 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
iMirror -= 9;
#line 1205 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctMirrorMarkers = & m_penMirror4 - & m_penMirror0 + 1;
#line 1206 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iMirror < ctMirrorMarkers ){
#line 1207 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CMirrorMarker * pfm = (CMirrorMarker *) & * (& m_penMirror0 ) [ iMirror ];
#line 1208 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pfm != NULL ){
#line 1209 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pfm -> GetMirrorName ();
#line 1210 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1211 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strMarkerUnused ;
#line 1212 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1213 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1214 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1215 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1216 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1217 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1220 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::GetMirror(INDEX iMirror,class CMirrorParameters & mpMirror)
#line 1221 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1222 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iMirror == 0){
#line 1223 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1224 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1225 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iMirror >= 1 && iMirror <= 8){
#line 1226 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
mpMirror . mp_ulFlags = 0;
#line 1227 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE ;
#line 1228 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1229 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
iMirror -= 9;
#line 1230 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctMirrorMarkers = & m_penMirror4 - & m_penMirror0 + 1;
#line 1231 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iMirror < ctMirrorMarkers ){
#line 1232 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CMirrorMarker * pmm = (CMirrorMarker *) & * (& m_penMirror0 ) [ iMirror ];
#line 1233 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pmm != NULL ){
#line 1234 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
pmm -> GetMirror (mpMirror );
#line 1235 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE ;
#line 1236 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1237 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1238 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1239 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1242 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
const CTString & CWorldBase::GetGradientName(INDEX iGradient)
#line 1243 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1244 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGradientMarkers = & m_penGradient19 - & m_penGradient0 + 1;
#line 1245 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strDummyName ("");
#line 1246 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
static const CTString strMarkerUnused ("Marker not set");
#line 1247 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(iGradient < ctGradientMarkers ){
#line 1248 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CGradientMarker * pgm = (CGradientMarker *) & * (& m_penGradient0 ) [ iGradient ];
#line 1249 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pgm != NULL ){
#line 1250 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pgm -> GetGradientName ();
#line 1251 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1252 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strMarkerUnused ;
#line 1253 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1254 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1255 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return strDummyName ;
#line 1256 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1258 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
void CWorldBase::UncacheShadowsForGradient(class CGradientMarker * penDiscard)
#line 1259 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1260 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGradientMarkers = & m_penGradient19 - & m_penGradient0 + 1;
#line 1261 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
for(INDEX iGradient = 0;iGradient < ctGradientMarkers ;iGradient ++)
#line 1262 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1263 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CGradientMarker * pgm = (CGradientMarker *) & * (& m_penGradient0 ) [ iGradient ];
#line 1264 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pgm == penDiscard )
#line 1265 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1266 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CEntity :: UncacheShadowsForGradient (iGradient + 1);
#line 1267 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1268 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1269 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1272 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::GetGradient(INDEX iGradient,class CGradientParameters & fpGradient)
#line 1273 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1274 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
INDEX ctGradientMarkers = & m_penGradient19 - & m_penGradient0 + 1;
#line 1275 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if((iGradient < ctGradientMarkers ) && (iGradient > 0)){
#line 1276 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
CGradientMarker * pgm = (CGradientMarker *) & * (& m_penGradient0 ) [ iGradient - 1 ];
#line 1277 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(pgm != NULL ){
#line 1278 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return pgm -> GetGradient (0 , fpGradient );
#line 1279 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1280 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1281 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1282 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1285 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
BOOL CWorldBase::HandleEvent(const CEntityEvent & ee)
#line 1286 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1288 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(ee . ee_slEvent == EVENTCODE_EFirstWorldBase ){
#line 1289 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () | ENF_ZONING );
#line 1290 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_bZoning = TRUE ;
#line 1291 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () | ENF_ANCHORED );
#line 1292 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_bAnchored = TRUE ;
#line 1293 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE ;
#line 1294 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1295 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return FALSE ;
#line 1296 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1300 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SLONG CWorldBase::GetUsedMemory(void)
#line 1301 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1303 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SLONG slUsedMemory = sizeof (CWorldBase ) - sizeof (CEntity ) + CEntity :: GetUsedMemory ();
#line 1305 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
slUsedMemory += m_strName . Length ();
#line 1306 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
slUsedMemory += m_strDescription . Length ();
#line 1307 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return slUsedMemory ;
#line 1308 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1312 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
FLOAT CWorldBase::GetOpacity(void)
#line 1313 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
{
#line 1314 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return m_fOpacity ;
#line 1315 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
BOOL CWorldBase::
#line 1322 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CWorldBase_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CWorldBase::Main expects 'EVoid' as input!"); const EVoid &evoid = (const EVoid &)__eeInput;
#line 1325 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
InitAsBrush ();
#line 1326 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetPhysicsFlags (EPF_BRUSH_FIXED );
#line 1327 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetCollisionFlags (ECF_BRUSH );
#line 1330 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(m_bZoning ){
#line 1331 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_strDescription = "zoning";
#line 1332 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () | ENF_ZONING );
#line 1333 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1334 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_strDescription = "non zoning";
#line 1335 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () & ~ ENF_ZONING );
#line 1336 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1339 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(m_bBackground ){
#line 1340 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_strDescription += " background";
#line 1341 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () | ENF_BACKGROUND );
#line 1342 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1343 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () & ~ ENF_BACKGROUND );
#line 1344 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1347 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
if(m_bAnchored ){
#line 1348 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
m_strDescription += " anchored";
#line 1349 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () | ENF_ANCHORED );
#line 1350 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}else {
#line 1351 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
SetFlags (GetFlags () & ~ ENF_ANCHORED );
#line 1352 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
}
#line 1354 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
Return(STATE_CURRENT,EVoid());
#line 1354 "D:/SE1_GPL/Sources/EntitiesMP/WorldBase.es"
return TRUE; ASSERT(FALSE); return TRUE;};