当前位置: 首页>>代码示例>>C++>>正文


C++ FTexture::SetScaledSize方法代码示例

本文整理汇总了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);
}
开发者ID:Quaker540,项目名称:gzdoom,代码行数:58,代码来源:animations.cpp

示例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();
			}
		}
	}
}
开发者ID:JohnnyonFlame,项目名称:ecwolf,代码行数:58,代码来源:texturemanager.cpp

示例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);
			}
		}
	}
}
开发者ID:Xeomuz,项目名称:Doom-Port-Source-Code,代码行数:101,代码来源:r_anim.cpp


注:本文中的FTexture::SetScaledSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。