本文整理汇总了C++中FTexture::GetDisplayTopOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ FTexture::GetDisplayTopOffset方法的具体用法?C++ FTexture::GetDisplayTopOffset怎么用?C++ FTexture::GetDisplayTopOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTexture
的用法示例。
在下文中一共展示了FTexture::GetDisplayTopOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: path
//.........这里部分代码省略.........
}
}
}
}
if (folderdata.Size() > 0)
{
// all valid lumps must be named with a hex number that represents its Unicode character index.
for (auto &entry : folderdata)
{
char *endp;
auto base = ExtractFileBase(entry.name);
auto position = strtoll(base.GetChars(), &endp, 16);
if ((*endp == 0 || (*endp == '.' && position >= '!' && position < 0xffff)))
{
auto lump = TexMan.CheckForTexture(entry.name, ETextureType::MiscPatch);
if (lump.isValid())
{
if ((int)position < minchar) minchar = (int)position;
if ((int)position > maxchar) maxchar = (int)position;
auto tex = TexMan.GetTexture(lump);
tex->SetScale(Scale);
charMap.Insert((int)position, tex);
Type = Folder;
}
}
}
}
FirstChar = minchar;
LastChar = maxchar;
auto count = maxchar - minchar + 1;
Chars.Resize(count);
int fontheight = 0;
for (i = 0; i < count; i++)
{
auto lump = charMap.CheckKey(FirstChar + i);
if (lump != nullptr)
{
FTexture *pic = *lump;
if (pic != nullptr)
{
int height = pic->GetDisplayHeight();
int yoffs = pic->GetDisplayTopOffset();
if (yoffs > maxyoffs)
{
maxyoffs = yoffs;
}
height += abs(yoffs);
if (height > fontheight)
{
fontheight = height;
}
}
pic->SetUseType(ETextureType::FontChar);
if (!noTranslate)
{
Chars[i].OriginalPic = pic;
Chars[i].TranslatedPic = new FImageTexture(new FFontChar1(pic->GetImage()), "");
Chars[i].TranslatedPic->CopySize(pic);
Chars[i].TranslatedPic->SetUseType(ETextureType::FontChar);
TexMan.AddTexture(Chars[i].TranslatedPic);
}
else
{
Chars[i].TranslatedPic = pic;
}
Chars[i].XMove = Chars[i].TranslatedPic->GetDisplayWidth();
}
else
{
Chars[i].TranslatedPic = nullptr;
Chars[i].XMove = INT_MIN;
}
}
if (SpaceWidth == 0) // An explicit override from the .inf file must always take precedence
{
if (spacewidth != -1)
{
SpaceWidth = spacewidth;
}
else if ('N' - FirstChar >= 0 && 'N' - FirstChar < count && Chars['N' - FirstChar].TranslatedPic != nullptr)
{
SpaceWidth = (Chars['N' - FirstChar].XMove + 1) / 2;
}
else
{
SpaceWidth = 4;
}
}
if (FontHeight == 0) FontHeight = fontheight;
FixXMoves();
}
if (!noTranslate) LoadTranslations();
}