MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / SetCameraTextureAspectRatio

Function SetCameraTextureAspectRatio

src/scripting/vmthunks.cpp:81–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static void SetCameraTextureAspectRatio(const FString &texturename, double aspectScale, bool useTextureRatio)
82{
83 FTextureID textureid = TexMan.CheckForTexture(texturename.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
84 if (textureid.isValid())
85 {
86 // Only proceed if the texture actually has a canvas.
87 auto tex = TexMan.GetGameTexture(textureid);
88 if (tex && tex->isHardwareCanvas())
89 {
90 static_cast<FCanvasTexture *>(tex->GetTexture())->SetAspectRatio(aspectScale, useTextureRatio);
91 }
92 }
93}
94
95DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, SetCameraTextureAspectRatio, SetCameraTextureAspectRatio)
96{

Callers 1

Calls 7

CheckForTextureMethod · 0.80
GetGameTextureMethod · 0.80
SetAspectRatioMethod · 0.80
GetCharsMethod · 0.45
isValidMethod · 0.45
isHardwareCanvasMethod · 0.45
GetTextureMethod · 0.45

Tested by

no test coverage detected