- moved most of the texture size maintenance to the FGameTexture class.

This commit is contained in:
Christoph Oelckers 2020-04-17 21:32:09 +02:00
commit 8843761bf8
11 changed files with 96 additions and 73 deletions

View file

@ -517,7 +517,7 @@ void VulkanFrameBuffer::RenderTextureView(FCanvasTexture *tex, AActor *Viewpoint
{
auto BaseLayer = static_cast<VkHardwareTexture*>(tex->GetHardwareTexture(0, 0));
float ratio = (float)tex->GetDisplayWidthDouble() / (float)tex->GetDisplayHeightDouble();
float ratio = tex->aspectRatio;
VkTextureImage *image = BaseLayer->GetImage(tex, 0, 0);
VkTextureImage *depthStencil = BaseLayer->GetDepthStencil(tex);
@ -531,8 +531,8 @@ void VulkanFrameBuffer::RenderTextureView(FCanvasTexture *tex, AActor *Viewpoint
IntRect bounds;
bounds.left = bounds.top = 0;
bounds.width = std::min(tex->GetTexelWidth(), image->Image->width);
bounds.height = std::min(tex->GetTexelHeight(), image->Image->height);
bounds.width = std::min(tex->GetWidth(), image->Image->width);
bounds.height = std::min(tex->GetHeight(), image->Image->height);
FRenderViewpoint texvp;
RenderViewpoint(texvp, Viewpoint, &bounds, FOV, ratio, ratio, false, false);