mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-25 21:31:10 +00:00
Merge ../qzdoom
This commit is contained in:
commit
65d67b704c
5 changed files with 30 additions and 17 deletions
|
@ -1076,7 +1076,7 @@ void OpenGLSWFrameBuffer::CalcFullscreenCoords(FBVERTEX verts[4], bool viewarea_
|
|||
|
||||
int OpenGLSWFrameBuffer::GetPageCount()
|
||||
{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -955,7 +955,7 @@ DEFINE_ACTION_FUNCTION(DBlockLinesIterator, CreateFromPos)
|
|||
ACTION_RETURN_OBJECT(new DBlockLinesIterator(x, y, z, h, radius, sec));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DBlockThingsIterator, Next)
|
||||
DEFINE_ACTION_FUNCTION(DBlockLinesIterator, Next)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DBlockLinesIterator);
|
||||
ACTION_RETURN_BOOL(self->Next());
|
||||
|
@ -1294,9 +1294,9 @@ DEFINE_ACTION_FUNCTION(DBlockThingsIterator, CreateFromPos)
|
|||
ACTION_RETURN_OBJECT(new DBlockThingsIterator(x, y, z, h, radius, ignore, nullptr));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DBlockLinesIterator, Next)
|
||||
DEFINE_ACTION_FUNCTION(DBlockThingsIterator, Next)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DBlockLinesIterator);
|
||||
PARAM_SELF_PROLOGUE(DBlockThingsIterator);
|
||||
ACTION_RETURN_BOOL(self->Next());
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ bool SightCheck::P_SightPathTraverse ()
|
|||
// step through map blocks
|
||||
// Count is present to prevent a round off error from skipping the break
|
||||
|
||||
int itres;
|
||||
int itres = -1;
|
||||
for (count = 0 ; count < 1000 ; count++)
|
||||
{
|
||||
// end traversing when reaching the end of the blockmap
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace swrenderer
|
|||
{
|
||||
double cosine = cos(planeang), sine = sin(planeang);
|
||||
pviewx = pl->xform.xOffs + ViewPos.X * cosine - ViewPos.Y * sine;
|
||||
pviewy = pl->xform.yOffs - ViewPos.X * sine - ViewPos.Y * cosine;
|
||||
pviewy = pl->xform.yOffs + pl->xform.baseyOffs - ViewPos.X * sine - ViewPos.Y * cosine;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -209,19 +209,27 @@ namespace swrenderer
|
|||
drawerargs.dc_viewpos.Z = (float)((viewport->CenterY - y - 0.5) / viewport->InvZtoScale * zspan);
|
||||
drawerargs.dc_viewpos_step.X = (float)(zspan / viewport->CenterX);
|
||||
|
||||
static DrawerLight lightbuffer[64 * 1024];
|
||||
static int nextlightindex = 0;
|
||||
|
||||
// Plane normal
|
||||
drawerargs.dc_normal.X = 0.0f;
|
||||
drawerargs.dc_normal.Y = 0.0f;
|
||||
drawerargs.dc_normal.Z = (y >= viewport->CenterY) ? 1.0f : -1.0f;
|
||||
|
||||
// Setup lights for row
|
||||
drawerargs.dc_num_lights = 0;
|
||||
drawerargs.dc_lights = lightbuffer + nextlightindex;
|
||||
// Calculate max lights that can touch the row so we can allocate memory for the list
|
||||
int max_lights = 0;
|
||||
VisiblePlaneLight *cur_node = light_list;
|
||||
while (cur_node && nextlightindex < 64 * 1024)
|
||||
while (cur_node)
|
||||
{
|
||||
if (!(cur_node->lightsource->flags2&MF2_DORMANT))
|
||||
max_lights++;
|
||||
cur_node = cur_node->next;
|
||||
}
|
||||
|
||||
drawerargs.dc_num_lights = 0;
|
||||
drawerargs.dc_lights = Thread->FrameMemory->AllocMemory<DrawerLight>(max_lights);
|
||||
|
||||
// Setup lights for row
|
||||
cur_node = light_list;
|
||||
while (cur_node)
|
||||
{
|
||||
double lightX = cur_node->lightsource->X() - ViewPos.X;
|
||||
double lightY = cur_node->lightsource->Y() - ViewPos.Y;
|
||||
|
@ -244,7 +252,6 @@ namespace swrenderer
|
|||
uint32_t green = cur_node->lightsource->GetGreen();
|
||||
uint32_t blue = cur_node->lightsource->GetBlue();
|
||||
|
||||
nextlightindex++;
|
||||
auto &light = drawerargs.dc_lights[drawerargs.dc_num_lights++];
|
||||
light.x = lx;
|
||||
light.y = lconstant;
|
||||
|
@ -255,9 +262,6 @@ namespace swrenderer
|
|||
|
||||
cur_node = cur_node->next;
|
||||
}
|
||||
|
||||
if (nextlightindex == 64 * 1024)
|
||||
nextlightindex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -110,6 +110,13 @@ void SWCanvas::DrawTexture(DCanvas *canvas, FTexture *img, DrawParms &parms)
|
|||
double centeryback = viewport->CenterY;
|
||||
viewport->CenterY = 0;
|
||||
|
||||
int oldviewwindowx = 0;
|
||||
int oldviewwindowy = 0;
|
||||
oldviewwindowx = viewwindowx;
|
||||
oldviewwindowy = viewwindowy;
|
||||
viewwindowx = 0;
|
||||
viewwindowy = 0;
|
||||
|
||||
// There is not enough precision in the drawing routines to keep the full
|
||||
// precision for y0. :(
|
||||
double sprtopscreen;
|
||||
|
@ -187,6 +194,8 @@ void SWCanvas::DrawTexture(DCanvas *canvas, FTexture *img, DrawParms &parms)
|
|||
}
|
||||
|
||||
viewport->CenterY = centeryback;
|
||||
viewwindowx = oldviewwindowx;
|
||||
viewwindowy = oldviewwindowy;
|
||||
}
|
||||
|
||||
viewport->RenderTarget->Unlock();
|
||||
|
|
Loading…
Reference in a new issue