Help using Flags
Hi q3's Texture Class Looks like this
TEXTURE
{
char name;
int surface;
int content;
}
// Here is the Flags for the content
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
#define CONTENTS_LAVA 8
#define CONTENTS_SLIME 16
#define CONTENTS_WATER 32
#define CONTENTS_FOG 64
#define CONTENTS_AREAPORTAL 0x8000
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
//bot specific contents types
#define CONTENTS_TELEPORTER 0x40000
#define CONTENTS_JUMPPAD 0x80000
#define CONTENTS_CLUSTERPORTAL 0x100000
#define CONTENTS_DONOTENTER 0x200000
#define CONTENTS_BOTCLIP 0x400000
// the surface
#define SURF_METALSTEPS 0x1000 // clanking footsteps
#define SURF_NOSTEPS 0x2000 // no footstep sounds
#define SURF_NONSOLID 0x4000 // don't collide against curves with this set
#define SURF_LIGHTFILTER 0x8000 // act as a light filter during q3map -light
#define SURF_ALPHASHADOW 0x10000 // do per-pixel light shadow casting in q3map
#define SURF_NODLIGHT 0x20000 // don't dlight even if solid (solid lava, skies)
#define SURF_DUST 0x40000 // leave a dust trail when walking on this surface
i understand it can be equal to more than one of those settings,
can sum1 just please help me with my if statement, im farely new to c++
if ((ContentFlag == CONTENTS_SOLID) && (ContentFlag == CONTENTS_PLAYERCLIP))
{
...
}
thanxs
----------------------------http://djoubert.co.uk
You have to mask out and check the bits separately. Instead of using ORing the bits togheter when building the flag variable you isolate a single one by ANDing with it's value.
if((ContentFlag & CONTENTS_SOLID) && (ContentFlag & CONTENTS_PLAYERCLIP)){}
Thanks
Could some1 just help me recap, i want to make the water 50% transparent so i go
glEnable(GL_BLEND);
glColor4f(1,1,1,0.5);
glBlendFunc(?,?);
glBegin(Equads)
glEend()
glDisable(GL_BLEND);
Could some1 just help me recap, i want to make the water 50% transparent so i go
glEnable(GL_BLEND);
glColor4f(1,1,1,0.5);
glBlendFunc(?,?);
glBegin(Equads)
glEend()
glDisable(GL_BLEND);
----------------------------http://djoubert.co.uk
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement