Extending masks
by Devil`s Workshop · in Torque Game Engine · 08/09/2003 (7:59 pm) · 3 replies
Hi,
after looking at the shapebase code i'm almost sure my packet problem lies
in shapebase.h or exactly :
How could i extend one of the above masks ?
Thx,
Alexander
after looking at the shapebase code i'm almost sure my packet problem lies
in shapebase.h or exactly :
// Network state masks
enum ShapeBaseMasks {
NameMask = Parent::NextFreeMask,
DamageMask = Parent::NextFreeMask << 1,
NoWarpMask = Parent::NextFreeMask << 2,
MountedMask = Parent::NextFreeMask << 3,
CloakMask = Parent::NextFreeMask << 4,
ShieldMask = Parent::NextFreeMask << 5,
InvincibleMask = Parent::NextFreeMask << 6,
SkinMask = Parent::NextFreeMask << 7,
SoundMaskN = Parent::NextFreeMask << 8, // Extends + MaxSoundThreads bits
ThreadMaskN = SoundMaskN << MaxSoundThreads, // Extends + MaxScriptThreads bits
ImageMaskN = ThreadMaskN << MaxScriptThreads, // Extends + MaxMountedImage bits
NextFreeMask = ImageMaskN << MaxMountedImages
};How could i extend one of the above masks ?
Thx,
Alexander
About the author
#2
looked a little bit at bitwise operations. It's shifting left/right with a specified amount. But currently i'm not really sure how to use your sugguestion at my problem (thanks for your help anyway).
I'm trying to add the "hide node" ressource but since the ressource was written the skinmask has been added i would have to add some changes to the ressource ( HideNodeMask ..to be exactly ;) ).
08/11/2003 (6:46 pm)
Hi and thanks.looked a little bit at bitwise operations. It's shifting left/right with a specified amount. But currently i'm not really sure how to use your sugguestion at my problem (thanks for your help anyway).
I'm trying to add the "hide node" ressource but since the ressource was written the skinmask has been added i would have to add some changes to the ressource ( HideNodeMask ..to be exactly ;) ).
#3
08/13/2003 (7:45 am)
Nobody uses the HideNode Ressource ? How you're got it working with recent HEAD ??
Torque Owner Badguy
enum ShapeBaseMasks { ..... NextFreeMask = ImageMaskN << MaxMountedImages , MyNewMask = NextFreeMask << 1, MyNewMask1 = NextFreeMask << 2, MyNewMask2 = MyNewMask1 << 1you can use either of the two ways to declare new mask's.
to understand what is happening here, one might want to study bitwise operators a bit.
but doing it this way you are not having any "overlap" for the AND OR testing.