- made adjustments to ZDoom's last changes.

This commit is contained in:
Christoph Oelckers 2016-04-28 17:55:58 +02:00
parent 60a78a0d9b
commit 434e39e62f
7 changed files with 17 additions and 12 deletions

View file

@ -143,12 +143,15 @@ BYTE *gl_WarpBuffer(BYTE *buffer, int Width, int Height, int warp, float Speed)
int xmask = xsize - 1;
int ymask = ysize - 1;
int ds_xbits;
int i, x;
int i;
if (warp == 1)
{
for (ds_xbits = -1, i = Width; i; i >>= 1, ds_xbits++);
// pending consolidation with the software renderer's code.
/*
for (x = xsize - 1; x >= 0; x--)
{
int yt, yf = (finesine[(timebase + (x + 17) * 128)&FINEMASK] >> 13) & ymask;
@ -172,12 +175,14 @@ BYTE *gl_WarpBuffer(BYTE *buffer, int Width, int Height, int warp, float Speed)
}
memcpy(out + y*xsize, linebuffer, xsize * sizeof(DWORD));
}
*/
}
else
{
int ybits;
for (ybits = -1, i = ysize; i; i >>= 1, ybits++);
/*
DWORD timebase = (r_FrameTime * Speed * 40 / 28);
for (x = xsize - 1; x >= 0; x--)
{
@ -194,6 +199,7 @@ BYTE *gl_WarpBuffer(BYTE *buffer, int Width, int Height, int warp, float Speed)
*dest = *source;
}
}
*/
}
delete[] buffer;
return (BYTE*)out;

View file

@ -431,11 +431,11 @@ FTextureID gl_GetSpriteFrame(unsigned sprite, int frame, int rot, angle_t ang, b
{
if (sprframe->Texture[0] == sprframe->Texture[1])
{
rot = (ang + (angle_t)(ANGLE_45/2)*9) >> 28;
rot = (ang + (angle_t)(ANGLE_90/4)*9) >> 28;
}
else
{
rot = (ang + (angle_t)(ANGLE_45/2)*9-(angle_t)(ANGLE_180/16)) >> 28;
rot = (ang + (angle_t)(ANGLE_90/4)*9-(angle_t)(ANGLE_180/16)) >> 28;
}
}
if (mirror) *mirror = !!(sprframe->Flip&(1<<rot));

View file

@ -64,8 +64,8 @@ static float avertexnormals[NUMVERTEXNORMALS][3] = {
static void UnpackVector(unsigned short packed, float vec[3])
{
float yaw = (packed & 511) / 512.0f * 2 * PI;
float pitch = ((packed >> 9) / 127.0f - 0.5f) * PI;
float yaw = (packed & 511) / 512.0f * 2 * M_PI;
float pitch = ((packed >> 9) / 127.0f - 0.5f) * M_PI;
float cosp = (float) cos(pitch);
vec[VX] = (float) cos(yaw) * cosp;

View file

@ -60,8 +60,8 @@ static void UnpackVector(unsigned short packed, float & nx, float & ny, float &
{
double lat = ( packed >> 8 ) & 0xff;
double lng = ( packed & 0xff );
lat *= PI/128;
lng *= PI/128;
lat *= M_PI/128;
lng *= M_PI/128;
nx = cos(lat) * sin(lng);
ny = sin(lat) * sin(lng);

View file

@ -2,7 +2,6 @@
#define __GL_CLIPPER
#include "doomtype.h"
#include "tables.h"
#include "xs_Float.h"
#include "r_utility.h"

View file

@ -229,7 +229,7 @@ struct FDrawInfo
FDrawInfo * next;
GLDrawList drawlists[GLDL_TYPES];
GLDrawList *dldrawlists; // only gets allocated when needed.
GLDrawList *dldrawlists = NULL; // only gets allocated when needed.
FDrawInfo();
~FDrawInfo();

View file

@ -793,7 +793,7 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
SetViewArea();
// We have to scale the pitch to account for the pixel stretching, because the playsim doesn't know about this and treats it as 1:1.
double radPitch = clamp(ViewPitch.Normalized180().Radians(), -PI / 2, PI / 2);
double radPitch = ViewPitch.Normalized180().Radians();
double angx = cos(radPitch);
double angy = sin(radPitch) * glset.pixelstretch;
double alen = sqrt(angx*angx + angy*angy);
@ -922,7 +922,7 @@ void FGLRenderer::RenderView (player_t* player)
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
GLRenderer->mLightCount = ((it.Next()) != NULL);
sector_t * viewsector = RenderViewpoint(player->camera, NULL, FieldOfView * 360.0f / FINEANGLES, ratio, fovratio, true, true);
sector_t * viewsector = RenderViewpoint(player->camera, NULL, FieldOfView.Degrees, ratio, fovratio, true, true);
All.Unclock();
}
@ -952,7 +952,7 @@ void FGLRenderer::WriteSavePic (player_t *player, FILE *file, int width, int hei
GLRenderer->mLightCount = ((it.Next()) != NULL);
sector_t *viewsector = RenderViewpoint(players[consoleplayer].camera, &bounds,
FieldOfView * 360.0f / FINEANGLES, 1.6f, 1.6f, true, false);
FieldOfView.Degrees, 1.6f, 1.6f, true, false);
glDisable(GL_STENCIL_TEST);
gl_RenderState.SetFixedColormap(CM_DEFAULT);
gl_RenderState.SetSoftLightLevel(-1);