Move Game.PXS to ::PXS

stable-5.2
Günther Brammer 2009-06-05 17:20:27 +02:00
parent ab69802140
commit ca62729fa4
10 changed files with 13 additions and 11 deletions

View File

@ -112,7 +112,6 @@ class C4Game
C4GameScriptHost Script;
C4LangStringTable MainSysLangStringTable, ScenarioLangStringTable, ScenarioSysLangStringTable;
C4MassMoverSet MassMover;
C4PXSSystem PXS;
C4ParticleSystem Particles;
C4PlayerList Players;
StdStrBuf PlayerNames;

View File

@ -64,4 +64,5 @@ class C4PXSSystem
C4PXS *New();
};
extern C4PXSSystem PXS;
#endif

View File

@ -436,7 +436,7 @@ void C4ControlSyncCheck::Set()
Random3 = FRndPtr3;
RandomCount = ::RandomCount;
AllCrewPosX = GetAllCrewPosX();
PXSCount = Game.PXS.Count;
PXSCount = ::PXS.Count;
MassMoverIndex = Game.MassMover.CreatePtr;
ObjectCount = Game.Objects.ObjectCount();
ObjectEnumerationIndex = Game.ObjectEnumerationIndex;

View File

@ -798,7 +798,7 @@ void Splash(int32_t tx, int32_t ty, int32_t amt, C4Object *pByObj)
{
BubbleOut(tx+Random(16)-8,ty+Random(16)-6);
if (GBackLiquid(tx,ty) && !GBackSemiSolid(tx, sy))
Game.PXS.Create(Game.Landscape.ExtractMaterial(tx,ty),
::PXS.Create(Game.Landscape.ExtractMaterial(tx,ty),
itofix(tx),itofix(sy),
FIXED100(Random(151)-75),
FIXED100(-Random(200)));

View File

@ -164,7 +164,7 @@ bool C4GameSave::SaveLandscape()
if (!fSuccess) return false;
DBGRECOFF.Clear();
// PXS
if (!Game.PXS.Save(*pSaveGroup)) return false;
if (!::PXS.Save(*pSaveGroup)) return false;
// MassMover (create copy, may not modify running data)
C4MassMoverSet MassMoverSet;
MassMoverSet.Copy(Game.MassMover);

View File

@ -970,7 +970,7 @@ int32_t C4Landscape::ShakeFreePix(int32_t tx, int32_t ty)
if (Game.Material.Map[mat].DigFree)
{
ClearPix(tx,ty);
Game.PXS.Create(mat,itofix(tx),itofix(ty));
::PXS.Create(mat,itofix(tx),itofix(ty));
}
CheckInstabilityRange(tx,ty);
return mat;
@ -1094,7 +1094,7 @@ void C4Landscape::BlastFree(int32_t tx, int32_t ty, int32_t rad, int32_t grade,
tx,ty,iByPlayer);
if (Game.Material.Map[cnt].Blast2PXSRatio != 0)
Game.PXS.Cast(cnt,
::PXS.Cast(cnt,
BlastMatCount[cnt]/Game.Material.Map[cnt].Blast2PXSRatio,
tx,ty,60);
}
@ -1218,7 +1218,7 @@ BOOL C4Landscape::InsertMaterial(int32_t mat, int32_t tx, int32_t ty, int32_t vx
// Try slide
while (FindMatSlide(tx,ty,+1,mdens,Game.Material.Map[mat].MaxSlide))
if (GetDensity(tx,ty+1)<mdens)
{ Game.PXS.Create(mat,itofix(tx),itofix(ty),FIXED10(vx),FIXED10(vy)); return TRUE; }
{ ::PXS.Create(mat,itofix(tx),itofix(ty),FIXED10(vx),FIXED10(vy)); return TRUE; }
// Try reaction with material below
C4MaterialReaction *pReact; int32_t tmat;

View File

@ -699,7 +699,7 @@ bool C4MaterialMap::mrfConvert(C4MaterialReaction *pReaction, int32_t &iX, int32
case meeMassMove: // MassMover-movement
// Conversion-transfer to PXS
Game.PXS.Create(iPxsMat,itofix(iX),itofix(iY));
::PXS.Create(iPxsMat,itofix(iX),itofix(iY));
return true;
}
// not handled

View File

@ -141,7 +141,7 @@ void C4PXS::Deactivate()
AddDbgRec(RCT_ExecPXS, &rc, sizeof(rc));
#endif
Mat=MNone;
Game.PXS.Delete(this);
::PXS.Delete(this);
}
C4PXSSystem::C4PXSSystem()
@ -451,3 +451,5 @@ void C4PXSSystem::Delete(C4PXS *pPXS)
if(cnt < PXSMaxChunk)
iChunkPXS[cnt]--;
}
C4PXSSystem PXS;

View File

@ -2559,7 +2559,7 @@ static bool FnScriptGo(C4AulContext *cthr, bool go)
static bool FnCastPXS(C4AulContext *cthr, C4String *mat_name, long amt, long level, long tx, long ty)
{
if (cthr->Obj) { tx+=cthr->Obj->GetX(); ty+=cthr->Obj->GetY(); }
Game.PXS.Cast(Game.Material.Get(FnStringPar(mat_name)),amt,tx,ty,level);
::PXS.Cast(Game.Material.Get(FnStringPar(mat_name)),amt,tx,ty,level);
return TRUE;
}

View File

@ -1076,7 +1076,7 @@ void C4Viewport::Draw(C4TargetFacet &cgo, bool fDrawOverlay)
// draw PXS (unclipped!)
C4ST_STARTNEW(PXSStat, "C4Viewport::Draw: PXS")
Game.PXS.Draw(cgo);
::PXS.Draw(cgo);
C4ST_STOP(PXSStat)
// draw objects