Add a 2d drawer to canvas textures

This commit is contained in:
Magnus Norddahl 2022-07-23 18:18:54 +02:00 committed by Christoph Oelckers
commit 4f0b02b396
11 changed files with 354 additions and 2 deletions

View file

@ -110,6 +110,21 @@ void SetCameraToTexture(AActor *viewpoint, const FString &texturename, double fo
}
}
void SetCanvasToTexture(FCanvas* canvas, const FString& texturename)
{
FTextureID textureid = TexMan.CheckForTexture(texturename, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
if (textureid.isValid())
{
// Only proceed if the texture actually has a canvas.
auto tex = TexMan.GetGameTexture(textureid);
if (tex && tex->GetTexture()->isCanvas())
{
FCanvasTexture* canvasTex = static_cast<FCanvasTexture*>(tex->GetTexture());
canvasTex->Drawer = canvas->Drawer;
}
}
}
//==========================================================================
//
// FCanvasTextureInfo :: UpdateAll