本文整理汇总了C++中LocalPlayer::getFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalPlayer::getFlag方法的具体用法?C++ LocalPlayer::getFlag怎么用?C++ LocalPlayer::getFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalPlayer
的用法示例。
在下文中一共展示了LocalPlayer::getFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void RadarRenderer::render(SceneRenderer& renderer,
bool blank)
{
const int ox = renderer.getWindow().getOriginX();
const int oy = renderer.getWindow().getOriginY();
float opacity = renderer.getPanelOpacity();
if ((opacity < 1.0f) && (opacity > 0.0f)) {
glScissor(ox + x - 2, oy + y - 2, w + 4, h + 4);
glColor4f(0.0f, 0.0f, 0.0f, opacity);
glRectf((float) x, (float) y, (float)(x + w), (float)(y + h));
}
glScissor(ox + x, oy + y, w, h);
LocalPlayer *myTank = LocalPlayer::getMyTank();
if (opacity == 1.0f)
{
// glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
// glClear(GL_COLOR_BUFFER_BIT);
}
if (blank)
return;
// prepare transforms
float worldSize = BZDB.eval(StateDatabase::BZDB_WORLDSIZE);
float range = BZDB.eval("displayRadarRange") * worldSize;
// when burrowed, limit radar range
if (myTank && (myTank->getFlag() == Flags::Burrow) &&
(myTank->getPosition()[2] < 0.0f)) {
#ifdef _MSC_VER
range = min(range, worldSize / 4.0f);
#else
range = std::min(range, worldSize / 4.0f);
#endif
}
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
const int xSize = renderer.getWindow().getWidth();
const int ySize = renderer.getWindow().getHeight();
const double xCenter = double(x) + 0.5 * double(w);
const double yCenter = double(y) + 0.5 * double(h);
const double xUnit = 2.0 * range / double(w);
const double yUnit = 2.0 * range / double(h);
glOrtho(-xCenter * xUnit, (xSize - xCenter) * xUnit, -yCenter * yUnit, (ySize - yCenter) * yUnit, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
OpenGLGState::resetState();
TextureManager &tm = TextureManager::instance();
int noiseTexture = tm.getTextureID( "noise" );
// if jammed then draw white noise. occasionally draw a good frame.
if (jammed && bzfrand() > decay)
{
glColor3f(1.0,1.0,1.0);
if (noiseTexture >= 0 && renderer.useQuality() > 0)
{
const int sequences = 10;
static float np[] = { 0, 0, 1, 1,
1, 1, 0, 0,
0.5f, 0.5f, 1.5f, 1.5f,
1.5f, 1.5f, 0.5f, 0.5f,
0.25f, 0.25f, 1.25f, 1.25f,
1.25f, 1.25f, 0.25f, 0.25f,
0, 0.5f, 1, 1.5f,
1, 1.5f, 0, 0.5f,
0.5f, 0, 1.5f, 1,
1.4f, 1, 0.5f, 0,
0.75f, 0.75f, 1.75f, 1.75f,
1.75f, 1.75f, 0.75f, 0.75f,
};
int noisePattern = 4 * int(floor(sequences * bzfrand()));
glEnable(GL_TEXTURE_2D);
tm.bind(noiseTexture);
glBegin(GL_QUADS);
glTexCoord2f(np[noisePattern+0],np[noisePattern+1]);
glVertex2f(-range,-range);
glTexCoord2f(np[noisePattern+2],np[noisePattern+1]);
glVertex2f( range,-range);
glTexCoord2f(np[noisePattern+2],np[noisePattern+3]);
glVertex2f( range, range);
glTexCoord2f(np[noisePattern+0],np[noisePattern+3]);
glVertex2f(-range, range);
glEnd();
glDisable(GL_TEXTURE_2D);
}
else if (noiseTexture >= 0 && BZDBCache::texture && renderer.useQuality() == 0)
{
glEnable(GL_TEXTURE_2D);
tm.bind(noiseTexture);
//.........这里部分代码省略.........