mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 22:33:17 +00:00
Show weapon at full width in SideBySideFull 3D mode.
(cherry picked from commit c42e98c0042937adc05c1f1569d909d58a5b8ffb)
This commit is contained in:
parent
7b8847c6be
commit
a5c27af59b
4 changed files with 17 additions and 1 deletions
|
@ -660,6 +660,9 @@ void FGLRenderer::EndDrawScene(sector_t * viewsector)
|
||||||
framebuffer->Begin2D(false);
|
framebuffer->Begin2D(false);
|
||||||
|
|
||||||
Reset3DViewport();
|
Reset3DViewport();
|
||||||
|
|
||||||
|
s3d::Stereo3DMode::getCurrentMode().AdjustPlayerSprites();
|
||||||
|
|
||||||
// [BB] Only draw the sprites if we didn't render a HUD model before.
|
// [BB] Only draw the sprites if we didn't render a HUD model before.
|
||||||
if ( renderHUDModel == false )
|
if ( renderHUDModel == false )
|
||||||
{
|
{
|
||||||
|
@ -820,7 +823,7 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
|
||||||
clipper.SafeAddClipRangeRealAngles(ViewAngle.BAMs() + a1, ViewAngle.BAMs() - a1);
|
clipper.SafeAddClipRangeRealAngles(ViewAngle.BAMs() + a1, ViewAngle.BAMs() - a1);
|
||||||
|
|
||||||
ProcessScene(toscreen);
|
ProcessScene(toscreen);
|
||||||
if (mainview && toscreen) EndDrawScene(lviewsector); // do not call this for camera textures.
|
if (mainview && toscreen) EndDrawScene(lviewsector); // do not call this for camera textures.
|
||||||
if (mainview && FGLRenderBuffers::IsEnabled())
|
if (mainview && FGLRenderBuffers::IsEnabled())
|
||||||
{
|
{
|
||||||
mBuffers->BlitSceneToTexture();
|
mBuffers->BlitSceneToTexture();
|
||||||
|
|
|
@ -98,4 +98,14 @@ SideBySideFull::SideBySideFull(double ipdMeters)
|
||||||
eye_ptrs.Push(&rightEye);
|
eye_ptrs.Push(&rightEye);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* virtual */
|
||||||
|
void SideBySideFull::AdjustPlayerSprites() const /* override */
|
||||||
|
{
|
||||||
|
// Show weapon at double width, so it would appear normal width after rescaling
|
||||||
|
int w = GLRenderer->mScreenViewport.width;
|
||||||
|
int h = GLRenderer->mScreenViewport.height;
|
||||||
|
gl_RenderState.mProjectionMatrix.ortho(w/2, w + w/2, h, 0, -1.0f, 1.0f);
|
||||||
|
gl_RenderState.ApplyMatrices();
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace s3d */
|
} /* namespace s3d */
|
||||||
|
|
|
@ -82,6 +82,7 @@ class SideBySideFull : public SideBySideBase
|
||||||
public:
|
public:
|
||||||
static const SideBySideFull& getInstance(float ipd);
|
static const SideBySideFull& getInstance(float ipd);
|
||||||
SideBySideFull(double ipdMeters);
|
SideBySideFull(double ipdMeters);
|
||||||
|
virtual void AdjustPlayerSprites() const override;
|
||||||
private:
|
private:
|
||||||
SBSFLeftEyePose leftEye;
|
SBSFLeftEyePose leftEye;
|
||||||
SBSFRightEyePose rightEye;
|
SBSFRightEyePose rightEye;
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
virtual void GetViewShift(float yaw, float outViewShift[3]) const;
|
virtual void GetViewShift(float yaw, float outViewShift[3]) const;
|
||||||
virtual void SetUp() const {};
|
virtual void SetUp() const {};
|
||||||
virtual void TearDown() const {};
|
virtual void TearDown() const {};
|
||||||
|
// virtual void EndDrawScene(sector_t * viewsector) const {GLRenderer->EndDrawScene(viewsector);};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,6 +81,7 @@ public:
|
||||||
|
|
||||||
virtual bool IsMono() const { return false; }
|
virtual bool IsMono() const { return false; }
|
||||||
virtual void AdjustViewports() const {};
|
virtual void AdjustViewports() const {};
|
||||||
|
virtual void AdjustPlayerSprites() const {};
|
||||||
virtual void Present() const = 0;
|
virtual void Present() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue