mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- made adjustments to ZDoom's last changes.
This commit is contained in:
parent
60a78a0d9b
commit
434e39e62f
7 changed files with 17 additions and 12 deletions
|
@ -143,12 +143,15 @@ BYTE *gl_WarpBuffer(BYTE *buffer, int Width, int Height, int warp, float Speed)
|
||||||
int xmask = xsize - 1;
|
int xmask = xsize - 1;
|
||||||
int ymask = ysize - 1;
|
int ymask = ysize - 1;
|
||||||
int ds_xbits;
|
int ds_xbits;
|
||||||
int i, x;
|
int i;
|
||||||
|
|
||||||
if (warp == 1)
|
if (warp == 1)
|
||||||
{
|
{
|
||||||
for (ds_xbits = -1, i = Width; i; i >>= 1, ds_xbits++);
|
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--)
|
for (x = xsize - 1; x >= 0; x--)
|
||||||
{
|
{
|
||||||
int yt, yf = (finesine[(timebase + (x + 17) * 128)&FINEMASK] >> 13) & ymask;
|
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));
|
memcpy(out + y*xsize, linebuffer, xsize * sizeof(DWORD));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int ybits;
|
int ybits;
|
||||||
for (ybits = -1, i = ysize; i; i >>= 1, ybits++);
|
for (ybits = -1, i = ysize; i; i >>= 1, ybits++);
|
||||||
|
|
||||||
|
/*
|
||||||
DWORD timebase = (r_FrameTime * Speed * 40 / 28);
|
DWORD timebase = (r_FrameTime * Speed * 40 / 28);
|
||||||
for (x = xsize - 1; x >= 0; x--)
|
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;
|
*dest = *source;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
return (BYTE*)out;
|
return (BYTE*)out;
|
||||||
|
|
|
@ -431,11 +431,11 @@ FTextureID gl_GetSpriteFrame(unsigned sprite, int frame, int rot, angle_t ang, b
|
||||||
{
|
{
|
||||||
if (sprframe->Texture[0] == sprframe->Texture[1])
|
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
|
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));
|
if (mirror) *mirror = !!(sprframe->Flip&(1<<rot));
|
||||||
|
|
|
@ -64,8 +64,8 @@ static float avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||||
|
|
||||||
static void UnpackVector(unsigned short packed, float vec[3])
|
static void UnpackVector(unsigned short packed, float vec[3])
|
||||||
{
|
{
|
||||||
float yaw = (packed & 511) / 512.0f * 2 * PI;
|
float yaw = (packed & 511) / 512.0f * 2 * M_PI;
|
||||||
float pitch = ((packed >> 9) / 127.0f - 0.5f) * PI;
|
float pitch = ((packed >> 9) / 127.0f - 0.5f) * M_PI;
|
||||||
float cosp = (float) cos(pitch);
|
float cosp = (float) cos(pitch);
|
||||||
|
|
||||||
vec[VX] = (float) cos(yaw) * cosp;
|
vec[VX] = (float) cos(yaw) * cosp;
|
||||||
|
|
|
@ -60,8 +60,8 @@ static void UnpackVector(unsigned short packed, float & nx, float & ny, float &
|
||||||
{
|
{
|
||||||
double lat = ( packed >> 8 ) & 0xff;
|
double lat = ( packed >> 8 ) & 0xff;
|
||||||
double lng = ( packed & 0xff );
|
double lng = ( packed & 0xff );
|
||||||
lat *= PI/128;
|
lat *= M_PI/128;
|
||||||
lng *= PI/128;
|
lng *= M_PI/128;
|
||||||
|
|
||||||
nx = cos(lat) * sin(lng);
|
nx = cos(lat) * sin(lng);
|
||||||
ny = sin(lat) * sin(lng);
|
ny = sin(lat) * sin(lng);
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define __GL_CLIPPER
|
#define __GL_CLIPPER
|
||||||
|
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "tables.h"
|
|
||||||
#include "xs_Float.h"
|
#include "xs_Float.h"
|
||||||
#include "r_utility.h"
|
#include "r_utility.h"
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ struct FDrawInfo
|
||||||
|
|
||||||
FDrawInfo * next;
|
FDrawInfo * next;
|
||||||
GLDrawList drawlists[GLDL_TYPES];
|
GLDrawList drawlists[GLDL_TYPES];
|
||||||
GLDrawList *dldrawlists; // only gets allocated when needed.
|
GLDrawList *dldrawlists = NULL; // only gets allocated when needed.
|
||||||
|
|
||||||
FDrawInfo();
|
FDrawInfo();
|
||||||
~FDrawInfo();
|
~FDrawInfo();
|
||||||
|
|
|
@ -793,7 +793,7 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
|
||||||
SetViewArea();
|
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.
|
// 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 angx = cos(radPitch);
|
||||||
double angy = sin(radPitch) * glset.pixelstretch;
|
double angy = sin(radPitch) * glset.pixelstretch;
|
||||||
double alen = sqrt(angx*angx + angy*angy);
|
double alen = sqrt(angx*angx + angy*angy);
|
||||||
|
@ -922,7 +922,7 @@ void FGLRenderer::RenderView (player_t* player)
|
||||||
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
|
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
|
||||||
GLRenderer->mLightCount = ((it.Next()) != NULL);
|
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();
|
All.Unclock();
|
||||||
}
|
}
|
||||||
|
@ -952,7 +952,7 @@ void FGLRenderer::WriteSavePic (player_t *player, FILE *file, int width, int hei
|
||||||
GLRenderer->mLightCount = ((it.Next()) != NULL);
|
GLRenderer->mLightCount = ((it.Next()) != NULL);
|
||||||
|
|
||||||
sector_t *viewsector = RenderViewpoint(players[consoleplayer].camera, &bounds,
|
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);
|
glDisable(GL_STENCIL_TEST);
|
||||||
gl_RenderState.SetFixedColormap(CM_DEFAULT);
|
gl_RenderState.SetFixedColormap(CM_DEFAULT);
|
||||||
gl_RenderState.SetSoftLightLevel(-1);
|
gl_RenderState.SetSoftLightLevel(-1);
|
||||||
|
|
Loading…
Reference in a new issue