本文整理汇总了C++中FMaterial::GetLeftOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ FMaterial::GetLeftOffset方法的具体用法?C++ FMaterial::GetLeftOffset怎么用?C++ FMaterial::GetLeftOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FMaterial
的用法示例。
在下文中一共展示了FMaterial::GetLeftOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawDecal
//.........这里部分代码省略.........
blue = clamp<float>(result[2]+blue, 0, 1.0f);
}
else
{
gl_RenderState.SetDynLight(result[0], result[1], result[2]);
}
}
BYTE R = xs_RoundToInt(r * red);
BYTE G = xs_RoundToInt(g * green);
BYTE B = xs_RoundToInt(b * blue);
gl_ModifyColor(R,G,B, Colormap.colormap);
red = R/255.f;
green = G/255.f;
blue = B/255.f;
}
else
{
loadAlpha = false;
red = 1.f;
green = 1.f;
blue = 1.f;
}
a = FIXED2FLOAT(decal->Alpha);
// now clip the decal to the actual polygon
float decalwidth = tex->TextureWidth(GLUSE_PATCH) * FIXED2FLOAT(decal->ScaleX);
float decalheight= tex->TextureHeight(GLUSE_PATCH) * FIXED2FLOAT(decal->ScaleY);
float decallefto = tex->GetLeftOffset(GLUSE_PATCH) * FIXED2FLOAT(decal->ScaleX);
float decaltopo = tex->GetTopOffset(GLUSE_PATCH) * FIXED2FLOAT(decal->ScaleY);
float leftedge = glseg.fracleft * side->TexelLength;
float linelength = glseg.fracright * side->TexelLength - leftedge;
// texel index of the decal's left edge
float decalpixpos = (float)side->TexelLength * decal->LeftDistance / (1<<30) - (flipx? decalwidth-decallefto : decallefto) - leftedge;
float left,right;
float lefttex,righttex;
// decal is off the left edge
if (decalpixpos < 0)
{
left = 0;
lefttex = -decalpixpos;
}
else
{
left = decalpixpos;
lefttex = 0;
}
// decal is off the right edge
if (decalpixpos + decalwidth > linelength)
{
right = linelength;
righttex = right - decalpixpos;
}
else
{
示例2: DrawDecal
//.........这里部分代码省略.........
zpos = decal->Z + frontsector->GetPlaneTexZ(sector_t::floor);
}
else
{
zpos = decal->Z + frontsector->GetPlaneTexZ(sector_t::ceiling);
}
}
if (decal->RenderFlags & RF_FULLBRIGHT)
{
light = 255;
rel = 0;
}
else
{
light = lightlevel;
rel = rellight + getExtraLight();
}
FColormap p = Colormap;
if (glset.nocoloredspritelighting)
{
p.Decolorize();
}
a = decal->Alpha;
// now clip the decal to the actual polygon
float decalwidth = tex->TextureWidth() * decal->ScaleX;
float decalheight= tex->TextureHeight() * decal->ScaleY;
float decallefto = tex->GetLeftOffset() * decal->ScaleX;
float decaltopo = tex->GetTopOffset() * decal->ScaleY;
float leftedge = glseg.fracleft * side->TexelLength;
float linelength = glseg.fracright * side->TexelLength - leftedge;
// texel index of the decal's left edge
float decalpixpos = (float)side->TexelLength * decal->LeftDistance - (flipx? decalwidth-decallefto : decallefto) - leftedge;
float left,right;
float lefttex,righttex;
// decal is off the left edge
if (decalpixpos < 0)
{
left = 0;
lefttex = -decalpixpos;
}
else
{
left = decalpixpos;
lefttex = 0;
}
// decal is off the right edge
if (decalpixpos + decalwidth > linelength)
{
right = linelength;
righttex = right - decalpixpos;
}
else
{