本文整理汇总了C++中FTexture::SetScaledSize方法的典型用法代码示例。如果您正苦于以下问题:C++ FTexture::SetScaledSize方法的具体用法?C++ FTexture::SetScaledSize怎么用?C++ FTexture::SetScaledSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTexture
的用法示例。
在下文中一共展示了FTexture::SetScaledSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseCameraTexture
void FTextureManager::ParseCameraTexture(FScanner &sc)
{
const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny | TEXMAN_ShortNameOnly;
int width, height;
int fitwidth, fitheight;
FString picname;
sc.MustGetString ();
picname = sc.String;
sc.MustGetNumber ();
width = sc.Number;
sc.MustGetNumber ();
height = sc.Number;
FTextureID picnum = CheckForTexture (picname, FTexture::TEX_Flat, texflags);
FTexture *viewer = new FCanvasTexture (picname, width, height);
if (picnum.Exists())
{
FTexture *oldtex = Texture(picnum);
fitwidth = oldtex->GetScaledWidth ();
fitheight = oldtex->GetScaledHeight ();
viewer->UseType = oldtex->UseType;
ReplaceTexture (picnum, viewer, true);
}
else
{
fitwidth = width;
fitheight = height;
// [GRB] No need for oldtex
viewer->UseType = FTexture::TEX_Wall;
AddTexture (viewer);
}
if (sc.GetString())
{
if (sc.Compare ("fit"))
{
sc.MustGetNumber ();
fitwidth = sc.Number;
sc.MustGetNumber ();
fitheight = sc.Number;
}
else
{
sc.UnGet ();
}
}
if (sc.GetString())
{
if (sc.Compare("WorldPanning"))
{
viewer->bWorldPanning = true;
}
else
{
sc.UnGet();
}
}
viewer->SetScaledSize(fitwidth, fitheight);
}
示例2: AddHiresTextures
void FTextureManager::AddHiresTextures (int wadnum)
{
int firsttx = Wads.GetFirstLump(wadnum);
int lasttx = Wads.GetLastLump(wadnum);
char name[9];
TArray<FTextureID> tlist;
if (firsttx == -1 || lasttx == -1)
{
return;
}
name[8] = 0;
for (;firsttx <= lasttx; ++firsttx)
{
if (Wads.GetLumpNamespace(firsttx) == ns_hires)
{
Wads.GetLumpName (name, firsttx);
if (Wads.CheckNumForName (name, ns_hires) == firsttx)
{
tlist.Clear();
int amount = ListTextures(name, tlist);
if (amount == 0)
{
// A texture with this name does not yet exist
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any);
if (newtex != NULL)
{
newtex->UseType=FTexture::TEX_Override;
AddTexture(newtex);
}
}
else
{
for(unsigned int i = 0; i < tlist.Size(); i++)
{
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any);
if (newtex != NULL)
{
FTexture * oldtex = Textures[tlist[i].GetIndex()].Texture;
// Replace the entire texture and adjust the scaling and offset factors.
newtex->bWorldPanning = true;
newtex->SetScaledSize(oldtex->GetScaledWidth(), oldtex->GetScaledHeight());
newtex->LeftOffset = FixedMul(oldtex->GetScaledLeftOffset(), newtex->xScale);
newtex->TopOffset = FixedMul(oldtex->GetScaledTopOffset(), newtex->yScale);
ReplaceTexture(tlist[i], newtex, true);
}
}
}
//StartScreen->Progress();
}
}
}
}
示例3: R_InitAnimDefs
//.........这里部分代码省略.........
// don't warp a texture more than once
if (!warper->bWarped)
{
if (type2) // [GRB]
warper = new FWarp2Texture (warper);
else
warper = new FWarpTexture (warper);
TexMan.ReplaceTexture (picnum, warper, false);
}
if (sc.CheckFloat())
{
static_cast<FWarpTexture*>(warper)->SetSpeed(float(sc.Float));
}
// No decals on warping textures, by default.
// Warping information is taken from the last warp
// definition for this texture.
warper->bNoDecals = true;
if (sc.GetString ())
{
if (sc.Compare ("allowdecals"))
{
warper->bNoDecals = false;
}
else
{
sc.UnGet ();
}
}
}
}
else if (sc.Compare ("cameratexture"))
{
int width, height;
int fitwidth, fitheight;
FString picname;
sc.MustGetString ();
picname = sc.String;
sc.MustGetNumber ();
width = sc.Number;
sc.MustGetNumber ();
height = sc.Number;
FTextureID picnum = TexMan.CheckForTexture (picname, FTexture::TEX_Flat, texflags);
FTexture *viewer = new FCanvasTexture (picname, width, height);
if (picnum.Exists())
{
FTexture *oldtex = TexMan[picnum];
fitwidth = oldtex->GetScaledWidth ();
fitheight = oldtex->GetScaledHeight ();
viewer->UseType = oldtex->UseType;
TexMan.ReplaceTexture (picnum, viewer, true);
}
else
{
fitwidth = width;
fitheight = height;
// [GRB] No need for oldtex
viewer->UseType = FTexture::TEX_Wall;
TexMan.AddTexture (viewer);
}
if (sc.GetString())
{
if (sc.Compare ("fit"))
{
sc.MustGetNumber ();
fitwidth = sc.Number;
sc.MustGetNumber ();
fitheight = sc.Number;
}
else
{
sc.UnGet ();
}
}
viewer->SetScaledSize(fitwidth, fitheight);
}
else if (sc.Compare ("animatedDoor"))
{
P_ParseAnimatedDoor (sc);
}
else if (sc.Compare("skyoffset"))
{
sc.MustGetString ();
FTextureID picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags);
sc.MustGetNumber();
if (picnum.Exists())
{
FTexture *tex = TexMan[picnum];
tex->SkyOffset = sc.Number;
}
}
else
{
sc.ScriptError (NULL);
}
}
}
}