Skip to content

Commit

Permalink
Merge ../gzdoom-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Mar 12, 2017
2 parents 1674aa8 + b398c74 commit 8a3443a
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 123 deletions.
5 changes: 3 additions & 2 deletions src/gl/compatibility/gl_20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "gl/system/gl_cvars.h"
#include "gl/renderer/gl_renderstate.h"
#include "gl/scene/gl_drawinfo.h"
#include "gl/scene/gl_scenedrawer.h"
#include "gl/data/gl_vertexbuffer.h"


Expand Down Expand Up @@ -756,7 +757,7 @@ void GLWall::RenderLightsCompat(int pass)
//
//==========================================================================

void FGLRenderer::RenderMultipassStuff()
void GLSceneDrawer::RenderMultipassStuff()
{
// First pass: empty background with sector light only

Expand Down Expand Up @@ -790,7 +791,7 @@ void FGLRenderer::RenderMultipassStuff()

// second pass: draw lights
glDepthMask(false);
if (mLightCount && !gl_fixedcolormap)
if (GLRenderer->mLightCount && !gl_fixedcolormap)
{
if (gl_SetupLightTexture())
{
Expand Down
21 changes: 0 additions & 21 deletions src/gl/renderer/gl_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,8 @@ class FGLRenderer
int ScreenToWindowX(int x);
int ScreenToWindowY(int y);

angle_t FrustumAngle();
void SetViewArea();
void Set3DViewport(bool mainview);
void Reset3DViewport();
sector_t *RenderViewpoint (AActor * camera, GL_IRECT * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen);
void RenderView(player_t *player);
void SetViewAngle(DAngle viewangle);
void SetupView(float viewx, float viewy, float viewz, DAngle viewangle, bool mirror, bool planemirror);

void Initialize(int width, int height);

void RenderMultipassStuff();
void RenderScene(int recursion);
void RenderTranslucent();
void DrawScene(int drawmode);
void DrawBlend(sector_t * viewsector);

void DrawPSprite (player_t * player,DPSprite *psp,float sx, float sy, bool hudModelStep, int OverrideShader, bool alphatexture);
void DrawPlayerSprites(sector_t * viewsector, bool hudModelStep);
Expand All @@ -191,9 +177,6 @@ class FGLRenderer
void SetupLevel();

void RenderScreenQuad();
void SetFixedColormap (player_t *player);
void WriteSavePic (player_t *player, FileWriter *file, int width, int height);
void EndDrawScene(sector_t * viewsector);
void PostProcessScene();
void AmbientOccludeScene();
void UpdateCameraExposure();
Expand All @@ -208,10 +191,6 @@ class FGLRenderer
void DrawPresentTexture(const GL_IRECT &box, bool applyGamma);
void Flush();

void SetProjection(float fov, float ratio, float fovratio);
void SetProjection(VSMatrix matrix); // raw matrix input from stereo 3d modes
void SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror);
void ProcessScene(bool toscreen = false);

bool StartOffscreen();
void EndOffscreen();
Expand Down
30 changes: 15 additions & 15 deletions src/gl/scene/gl_portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ inline void GLPortal::ClearClipper()
}

// and finally clip it to the visible area
angle_t a1 = GLRenderer->FrustumAngle();
angle_t a1 = drawer->FrustumAngle();
if (a1 < ANGLE_180) drawer->clipper.SafeAddClipRangeRealAngles(r_viewpoint.Angles.Yaw.BAMs() + a1, r_viewpoint.Angles.Yaw.BAMs() - a1);

// lock the parts that have just been clipped out.
Expand Down Expand Up @@ -363,7 +363,7 @@ void GLPortal::End(bool usestencil)
GLRenderer->mViewActor=savedviewactor;
in_area=savedviewarea;
if (r_viewpoint.camera != nullptr) r_viewpoint.camera->renderflags = (r_viewpoint.camera->renderflags & ~RF_MAYBEINVISIBLE) | savedvisibility;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));

{
ScopedColorMask colorMask(0, 0, 0, 0); // glColorMask(0, 0, 0, 0); // no graphics
Expand Down Expand Up @@ -422,7 +422,7 @@ void GLPortal::End(bool usestencil)
GLRenderer->mViewActor=savedviewactor;
in_area=savedviewarea;
if (r_viewpoint.camera != nullptr) r_viewpoint.camera->renderflags |= savedvisibility;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));

// This draws a valid z-buffer into the stencil's contents to ensure it
// doesn't get overwritten by the level's geometry.
Expand Down Expand Up @@ -648,16 +648,16 @@ void GLSkyboxPortal::DrawContents()
GLRenderer->mViewActor = origin;

inskybox = true;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
GLRenderer->SetViewArea();
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
drawer->SetViewArea();
ClearClipper();

int mapsection = R_PointInSubsector(r_viewpoint.Pos)->mapsection;

SaveMapSection();
currentmapsection[mapsection >> 3] |= 1 << (mapsection & 7);

GLRenderer->DrawScene(DM_SKYPORTAL);
drawer->DrawScene(DM_SKYPORTAL);
portal->mFlags &= ~PORTSF_INSKYBOX;
inskybox = false;
gl_RenderState.SetDepthClamp(oldclamp);
Expand Down Expand Up @@ -744,7 +744,7 @@ void GLSectorStackPortal::DrawContents()
// avoid recursions!
if (origin->plane != -1) instack[origin->plane]++;

GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
SaveMapSection();
SetupCoverage();
ClearClipper();
Expand All @@ -758,7 +758,7 @@ void GLSectorStackPortal::DrawContents()
drawer->clipper.SetBlocked(true);
}

GLRenderer->DrawScene(DM_PORTAL);
drawer->DrawScene(DM_PORTAL);
RestoreMapSection();

if (origin->plane != -1) instack[origin->plane]--;
Expand Down Expand Up @@ -801,11 +801,11 @@ void GLPlaneMirrorPortal::DrawContents()
PlaneMirrorMode = origin->fC() < 0 ? -1 : 1;

PlaneMirrorFlag++;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
ClearClipper();

gl_RenderState.SetClipHeight(planez, PlaneMirrorMode < 0 ? -1.f : 1.f);
GLRenderer->DrawScene(DM_PORTAL);
drawer->DrawScene(DM_PORTAL);
gl_RenderState.SetClipHeight(0.f, 0.f);
PlaneMirrorFlag--;
PlaneMirrorMode = old_pm;
Expand Down Expand Up @@ -967,11 +967,11 @@ void GLMirrorPortal::DrawContents()
GLRenderer->mViewActor = NULL;

MirrorFlag++;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));

drawer->clipper.Clear();

angle_t af = GLRenderer->FrustumAngle();
angle_t af = drawer->FrustumAngle();
if (af<ANGLE_180) drawer->clipper.SafeAddClipRangeRealAngles(r_viewpoint.Angles.Yaw.BAMs()+af, r_viewpoint.Angles.Yaw.BAMs()-af);

angle_t a2 = linedef->v1->GetClipAngle();
Expand All @@ -980,7 +980,7 @@ void GLMirrorPortal::DrawContents()

gl_RenderState.SetClipLine(linedef);
gl_RenderState.EnableClipLine(true);
GLRenderer->DrawScene(DM_PORTAL);
drawer->DrawScene(DM_PORTAL);
gl_RenderState.EnableClipLine(false);

MirrorFlag--;
Expand Down Expand Up @@ -1049,12 +1049,12 @@ void GLLineToLinePortal::DrawContents()
}

GLRenderer->mViewActor = nullptr;
GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));

ClearClipper();
gl_RenderState.SetClipLine(glport->lines[0]->mDestination);
gl_RenderState.EnableClipLine(true);
GLRenderer->DrawScene(DM_PORTAL);
drawer->DrawScene(DM_PORTAL);
gl_RenderState.EnableClipLine(false);
RestoreMapSection();
}
Expand Down
Loading

0 comments on commit 8a3443a

Please sign in to comment.