- moved several members from FTexture to FGameTexture.
This commit is contained in:
parent
42304d9680
commit
7641da8b7b
7 changed files with 59 additions and 46 deletions
|
|
@ -227,6 +227,8 @@ void FSoftwareRenderer::SetClearColor(int color)
|
|||
mScene.SetClearColor(color);
|
||||
}
|
||||
|
||||
FSWCanvasTexture* GetSWCamTex(FCanvasTexture* camtex);
|
||||
|
||||
void FSoftwareRenderer::RenderTextureView (FCanvasTexture *camtex, AActor *viewpoint, double fov)
|
||||
{
|
||||
auto renderTarget = mScene.MainThread()->Viewport->RenderTarget;
|
||||
|
|
@ -237,7 +239,7 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *camtex, AActor *viewp
|
|||
cameraViewpoint = r_viewpoint;
|
||||
cameraViewwindow = r_viewwindow;
|
||||
|
||||
auto tex = static_cast<FSWCanvasTexture*>(camtex->GetSoftwareTexture());
|
||||
auto tex = GetSWCamTex(camtex);
|
||||
|
||||
DCanvas *Canvas = renderTarget->IsBgra() ? tex->GetCanvasBgra() : tex->GetCanvas();
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class FSWCanvasTexture : public FSoftwareTexture
|
|||
|
||||
public:
|
||||
|
||||
FSWCanvasTexture(FGameTexture *source) : FSoftwareTexture(source) {}
|
||||
FSWCanvasTexture(FGameTexture* source);
|
||||
~FSWCanvasTexture();
|
||||
|
||||
// Returns the whole texture, stored in column-major order
|
||||
|
|
|
|||
|
|
@ -39,6 +39,21 @@
|
|||
#include "m_alloc.h"
|
||||
#include "imagehelpers.h"
|
||||
|
||||
static TMap<FCanvasTexture*, FSWCanvasTexture*> canvasMap;
|
||||
|
||||
FSWCanvasTexture* GetSWCamTex(FCanvasTexture* camtex)
|
||||
{
|
||||
auto p = canvasMap.CheckKey(camtex);
|
||||
return p ? *p : nullptr;
|
||||
}
|
||||
|
||||
FSWCanvasTexture::FSWCanvasTexture(FGameTexture* source) : FSoftwareTexture(source)
|
||||
{
|
||||
// The SW renderer needs to link the canvas textures, but let's do that outside the texture manager.
|
||||
auto camtex = static_cast<FCanvasTexture*>(source->GetTexture());
|
||||
canvasMap.Insert(camtex, this);
|
||||
}
|
||||
|
||||
|
||||
FSWCanvasTexture::~FSWCanvasTexture()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue