Remove SetWindow from FRenderer interface
This commit is contained in:
parent
1e7015643d
commit
4c12ba740f
8 changed files with 77 additions and 50 deletions
|
|
@ -30,10 +30,13 @@
|
|||
#include "gl/data/gl_data.h"
|
||||
#include "d_net.h"
|
||||
#include "po_man.h"
|
||||
#include "st_stuff.h"
|
||||
#include "swrenderer/scene/r_scene.h"
|
||||
#include "swrenderer/scene/r_viewport.h"
|
||||
#include "swrenderer/scene/r_light.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
|
||||
EXTERN_CVAR(Bool, r_shadercolormaps)
|
||||
EXTERN_CVAR(Int, screenblocks)
|
||||
void InitGLRMapinfoData();
|
||||
extern bool r_showviewer;
|
||||
|
|
@ -46,6 +49,33 @@ PolyRenderer *PolyRenderer::Instance()
|
|||
return &scene;
|
||||
}
|
||||
|
||||
void PolyRenderer::RenderView(player_t *player)
|
||||
{
|
||||
using namespace swrenderer;
|
||||
|
||||
bool saved_swtruecolor = r_swtruecolor;
|
||||
r_swtruecolor = screen->IsBgra();
|
||||
|
||||
int width = SCREENWIDTH;
|
||||
int height = SCREENHEIGHT;
|
||||
int stHeight = ST_Y;
|
||||
float trueratio;
|
||||
ActiveRatio(width, height, &trueratio);
|
||||
R_SWRSetWindow(setblocks, width, height, stHeight, trueratio);
|
||||
|
||||
RenderActorView(player->mo, false);
|
||||
|
||||
// Apply special colormap if the target cannot do it
|
||||
if (realfixedcolormap && r_swtruecolor && !(r_shadercolormaps && screen->Accel2D))
|
||||
{
|
||||
R_BeginDrawerCommands();
|
||||
DrawerCommandQueue::QueueCommand<ApplySpecialColormapRGBACommand>(realfixedcolormap, screen);
|
||||
R_EndDrawerCommands();
|
||||
}
|
||||
|
||||
r_swtruecolor = saved_swtruecolor;
|
||||
}
|
||||
|
||||
void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int y, int width, int height, bool dontmaplines)
|
||||
{
|
||||
const bool savedviewactive = viewactive;
|
||||
|
|
@ -55,6 +85,7 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
|
|||
RenderTarget = canvas;
|
||||
swrenderer::bRenderingToCanvas = true;
|
||||
R_SetWindow(12, width, height, height, true);
|
||||
swrenderer::R_SWRSetWindow(12, width, height, height, WidescreenRatio);
|
||||
viewwindowx = x;
|
||||
viewwindowy = y;
|
||||
viewactive = true;
|
||||
|
|
@ -69,6 +100,9 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
|
|||
RenderTarget = screen;
|
||||
swrenderer::bRenderingToCanvas = false;
|
||||
R_ExecuteSetViewSize();
|
||||
float trueratio;
|
||||
ActiveRatio(width, height, &trueratio);
|
||||
swrenderer::R_SWRSetWindow(setblocks, width, height, height, WidescreenRatio);
|
||||
viewactive = savedviewactive;
|
||||
swrenderer::r_swtruecolor = savedoutputformat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue