| 79 | } |
| 80 | |
| 81 | static 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 | |
| 95 | DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, SetCameraTextureAspectRatio, SetCameraTextureAspectRatio) |
| 96 | { |
no test coverage detected