本文整理汇总了C++中FTexture::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ FTexture::isValid方法的具体用法?C++ FTexture::isValid怎么用?C++ FTexture::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTexture
的用法示例。
在下文中一共展示了FTexture::isValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
FSoftwareTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool &flipX)
{
const auto &viewpoint = PolyRenderer::Instance()->Viewpoint;
flipX = false;
if (thing->renderflags & RF_FLATSPRITE)
return nullptr; // do not draw flat sprites.
if (thing->picnum.isValid())
{
FTexture *ttex = TexMan.GetPalettedTexture(thing->picnum, true);
if (!ttex || !ttex->isValid())
{
return nullptr;
}
FSoftwareTexture *tex = ttex->GetSoftwareTexture();
if (ttex->GetRotations() != 0xFFFF)
{
// choose a different rotation based on player view
spriteframe_t *sprframe = &SpriteFrames[ttex->GetRotations()];
DVector3 pos = thing->InterpolatedPosition(viewpoint.TicFrac);
pos.Z += thing->GetBobOffset(viewpoint.TicFrac);
DAngle ang = (pos - viewpoint.Pos).Angle();
angle_t rot;
if (sprframe->Texture[0] == sprframe->Texture[1])
{
rot = (ang - thing->Angles.Yaw + 45.0 / 2 * 9).BAMs() >> 28;
}
示例2: DoOneSectorLower
//==========================================================================
//
//
//
//==========================================================================
bool HWDrawInfo::DoOneSectorLower(subsector_t * subsec, float Planez, area_t in_area)
{
// Is there a one-sided wall in this subsector?
// Do this first to avoid unnecessary recursion
for (uint32_t i = 0; i < subsec->numlines; i++)
{
if (subsec->firstline[i].backsector == NULL) return false;
if (subsec->firstline[i].PartnerSeg == NULL) return false;
}
for (uint32_t i = 0; i < subsec->numlines; i++)
{
seg_t * seg = subsec->firstline + i;
subsector_t * backsub = seg->PartnerSeg->Subsector;
// already checked?
if (backsub->validcount == validcount) continue;
backsub->validcount = validcount;
if (seg->frontsector != seg->backsector && seg->linedef)
{
// Note: if this is a real line between sectors
// we can be sure that render_sector is the real sector!
sector_t * sec = hw_FakeFlat(seg->backsector, in_area, true);
// Don't bother with slopes
if (sec->floorplane.isSlope()) return false;
// Is the neighboring floor higher than the desired height?
if (sec->GetPlaneTexZ(sector_t::floor) > Planez)
{
// todo: check for missing textures.
return false;
}
// This is an exact height match which means we don't have to do any further checks for this sector
if (sec->GetPlaneTexZ(sector_t::floor) == Planez)
{
// If there's a texture abort
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || !tex->isValid()) continue;
else return false;
}
}
if (!DoOneSectorLower(backsub, Planez, in_area)) return false;
}
// all checked ok. This sector is part of the current fake plane
HandledSubsectors.Push(subsec);
return 1;
}