Make RotatedSolidmasks the default and remove the option

Objects that really need this behaviour can reimplement it with
SetSolidMask.
Günther Brammer 2010-04-20 18:01:40 +02:00
parent 82707f3a3d
commit bd9d2f0466
3 changed files with 13 additions and 20 deletions

View File

@ -140,7 +140,6 @@ void C4Def::DefaultDefCore()
ConSizeOff=0;
NoSell=NoGet=0;
NoFight=0;
RotatedSolidmasks=0;
NeededGfxMode=0;
NoTransferZones=0;
}
@ -381,7 +380,6 @@ void C4Def::CompileFunc(StdCompiler *pComp)
pComp->Value(mkNamingAdapt(NoSell, "NoSell", 0 ));
pComp->Value(mkNamingAdapt(NoGet, "NoGet", 0 ));
pComp->Value(mkNamingAdapt(NoFight, "NoFight", 0 ));
pComp->Value(mkNamingAdapt(RotatedSolidmasks, "RotatedSolidmasks", 0 ));
pComp->Value(mkNamingAdapt(NoTransferZones, "NoTransferZones", 0 ));
pComp->Value(mkNamingAdapt(AutoContextMenu, "AutoContextMenu", 0 ));
pComp->Value(mkNamingAdapt(NeededGfxMode, "NeededGfxMode", 0 ));

View File

@ -213,7 +213,6 @@ public:
int32_t NoSell; // if set, object can't be sold (doesn't even appear in sell-menu)
int32_t NoGet; // if set, object can't be taken out of a containers manually (doesn't appear in get/activate-menus)
int32_t NoFight; // if set, object is never OCF_FightReady
int32_t RotatedSolidmasks;// if set, solidmasks can be rotated
int32_t NeededGfxMode; // if set, the def will only be loaded in given gfx mode
int32_t RotatedEntrance; // 0 entrance not rotateable, 1 entrance always, 2-360 entrance within this rotation
int32_t NoTransferZones;

View File

@ -4932,24 +4932,20 @@ void C4Object::UpdateSolidMask(bool fRestoreAttachedObjects)
// do not reset it!)
if (!Status) return;
// Determine necessity, update cSolidMask, put or remove mask
// Mask if enabled, fullcon, no rotation, not contained
if (SolidMask.Wdt>0)
if (Con>=FullCon)
if (!Contained)
if (!r || Def->RotatedSolidmasks)
{
// Recheck and put mask
if (!pSolidMaskData)
{
pSolidMaskData = new C4SolidMask(this);
}
else
pSolidMaskData->Remove(true, false);
pSolidMaskData->Put(true, NULL, fRestoreAttachedObjects);
return;
}
// Mask if enabled, fullcon, not contained
if (SolidMask.Wdt > 0 && Con >= FullCon && !Contained)
{
// Recheck and put mask
if (!pSolidMaskData)
{
pSolidMaskData = new C4SolidMask(this);
}
else
pSolidMaskData->Remove(true, false);
pSolidMaskData->Put(true, NULL, fRestoreAttachedObjects);
}
// Otherwise, remove and destroy mask
if (pSolidMaskData)
else if (pSolidMaskData)
{
pSolidMaskData->Remove(true, false);
delete pSolidMaskData; pSolidMaskData = NULL;