mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 13:21:04 +00:00
- camtex transition
This commit is contained in:
parent
c26b6cdf59
commit
ab2686db34
5 changed files with 10 additions and 11 deletions
|
@ -5392,7 +5392,7 @@ void renderSetTarget(int16_t tilenume, int32_t xsiz, int32_t ysiz)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OpenGLRenderer::GLRenderer->StartOffscreen();
|
OpenGLRenderer::GLRenderer->StartOffscreen();
|
||||||
OpenGLRenderer::GLRenderer->BindToFrameBuffer(tileGetTexture(tilenume));
|
OpenGLRenderer::GLRenderer->BindToFrameBuffer(tileGetTexture(tilenume)->GetTexture());
|
||||||
|
|
||||||
//DRAWROOMS TO TILE BACKUP&SET CODE
|
//DRAWROOMS TO TILE BACKUP&SET CODE
|
||||||
bakxsiz = xdim; bakysiz = ydim;
|
bakxsiz = xdim; bakysiz = ydim;
|
||||||
|
|
|
@ -217,7 +217,6 @@ void OpenGLFrameBuffer::CopyScreenToBuffer(int width, int height, uint8_t* scr)
|
||||||
|
|
||||||
void OpenGLFrameBuffer::RenderTextureView(FCanvasTexture* tex, std::function<void(IntRect &)> renderFunc)
|
void OpenGLFrameBuffer::RenderTextureView(FCanvasTexture* tex, std::function<void(IntRect &)> renderFunc)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
GLRenderer->StartOffscreen();
|
GLRenderer->StartOffscreen();
|
||||||
GLRenderer->BindToFrameBuffer(tex);
|
GLRenderer->BindToFrameBuffer(tex);
|
||||||
|
|
||||||
|
@ -231,7 +230,6 @@ void OpenGLFrameBuffer::RenderTextureView(FCanvasTexture* tex, std::function<voi
|
||||||
|
|
||||||
tex->SetUpdated(true);
|
tex->SetUpdated(true);
|
||||||
static_cast<OpenGLFrameBuffer*>(screen)->camtexcount++;
|
static_cast<OpenGLFrameBuffer*>(screen)->camtexcount++;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
#include "model.h"
|
#include "model.h"
|
||||||
#include "gl_postprocessstate.h"
|
#include "gl_postprocessstate.h"
|
||||||
#include "gl_buffers.h"
|
#include "gl_buffers.h"
|
||||||
#include "gl_hwtexture.h"
|
|
||||||
#include "texturemanager.h"
|
#include "texturemanager.h"
|
||||||
|
|
||||||
EXTERN_CVAR(Int, screenblocks)
|
EXTERN_CVAR(Int, screenblocks)
|
||||||
|
@ -159,19 +158,19 @@ void FGLRenderer::EndOffscreen()
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void FGLRenderer::BindToFrameBuffer(FGameTexture *mat)
|
void FGLRenderer::BindToFrameBuffer(FTexture *tex)
|
||||||
{
|
{
|
||||||
auto pBaseLayer = mat->GetTexture()->SystemTextures.GetHardwareTexture(0, false);
|
auto pBaseLayer = tex->SystemTextures.GetHardwareTexture(0, false);
|
||||||
auto BaseLayer = pBaseLayer ? (OpenGLRenderer::FHardwareTexture*)pBaseLayer : nullptr;
|
auto BaseLayer = pBaseLayer ? (OpenGLRenderer::FHardwareTexture*)pBaseLayer : nullptr;
|
||||||
|
|
||||||
if (BaseLayer == nullptr)
|
if (BaseLayer == nullptr)
|
||||||
{
|
{
|
||||||
// must create the hardware texture first
|
// must create the hardware texture first
|
||||||
BaseLayer = new FHardwareTexture(4);
|
BaseLayer = new FHardwareTexture(4);
|
||||||
BaseLayer->CreateTexture(nullptr, mat->GetTexelWidth() * 4, mat->GetTexelHeight() * 4, 15, false, "Camtex");
|
BaseLayer->CreateTexture(nullptr, tex->GetWidth(), tex->GetHeight(), 15, false, "Camtex");
|
||||||
mat->GetTexture()->SystemTextures.AddHardwareTexture(0, false, BaseLayer);
|
tex->SystemTextures.AddHardwareTexture(0, false, BaseLayer);
|
||||||
}
|
}
|
||||||
BaseLayer->BindToFrameBuffer(mat->GetTexelWidth()*4, mat->GetTexelHeight()*4);
|
BaseLayer->BindToFrameBuffer(tex->GetWidth(), tex->GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -84,7 +84,7 @@ public:
|
||||||
bool StartOffscreen();
|
bool StartOffscreen();
|
||||||
void EndOffscreen();
|
void EndOffscreen();
|
||||||
|
|
||||||
void BindToFrameBuffer(FGameTexture* tex);
|
void BindToFrameBuffer(FTexture* tex);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,9 @@ void BuildTiles::InvalidateTile(int num)
|
||||||
void BuildTiles::MakeCanvas(int tilenum, int width, int height)
|
void BuildTiles::MakeCanvas(int tilenum, int width, int height)
|
||||||
{
|
{
|
||||||
auto canvas = ValidateCustomTile(tilenum, ReplacementType::Canvas);
|
auto canvas = ValidateCustomTile(tilenum, ReplacementType::Canvas);
|
||||||
canvas->SetSize(width, height);
|
canvas->SetSize(width*4, height*4);
|
||||||
|
canvas->SetDisplaySize(width, height);
|
||||||
|
canvas->GetTexture()->SetSize(width * 4, height * 4);
|
||||||
static_cast<FCanvasTexture*>(canvas->GetTexture())->aspectRatio = (float)width / height;
|
static_cast<FCanvasTexture*>(canvas->GetTexture())->aspectRatio = (float)width / height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue