Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Testing
This commit is contained in:
commit
19b9ec0521
10 files changed
+45
-102
No files matched your search
@@ -10,12 +10,8 @@
|
||||
|
||||
rendermode_t rendermode = render_soft;
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
boolean allow_fullscreen = false;
|
||||
|
||||
|
||||
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
void I_StartupGraphics(void){}
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
rendermode_t rendermode = render_none;
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
// synchronize page flipping with screen refresh
|
||||
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -153,7 +151,7 @@ boolean I_UseNativeKeyboard(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_SetBorderlessWindow(void)
|
||||
void I_SetBorderlessWindow(void)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -3144,8 +3144,8 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
return;
|
||||
|
||||
// X/Y stretch fix for all resolutions(!)
|
||||
xfix = (float)(screen_texsizew)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)(screen_texsizeh)/((float)((screen_height)/(float)(SCREENVERTS-1)));
|
||||
xfix = (float)screen_texsizew/((float)(screen_width/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)screen_texsizeh/((float)(screen_height/(float)(SCREENVERTS-1)));
|
||||
|
||||
pglDisable(GL_DEPTH_TEST);
|
||||
pglDisable(GL_BLEND);
|
||||
@@ -3232,12 +3232,9 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
// float fix[8];
|
||||
fix[0] = 0.0f;
|
||||
fix[1] = 0.0f;
|
||||
fix[2] = 0.0f;
|
||||
@@ -3291,12 +3288,9 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
// float fix[8];
|
||||
fix[0] = 0.0f;
|
||||
fix[1] = 0.0f;
|
||||
fix[2] = 0.0f;
|
||||
@@ -3350,7 +3344,6 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
|
||||
void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
|
||||
{
|
||||
int tex = HWD_SCREENTEXTURE_VHS;
|
||||
float xfix, yfix;
|
||||
float fix[8];
|
||||
GLubyte color[4] = {255, 255, 255, 255};
|
||||
@@ -3367,17 +3360,22 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
const GLfloat scrwf = (float)screen_width;
|
||||
const GLfloat scrwh = (float)screen_height;
|
||||
|
||||
// Slight fuzziness
|
||||
GL_MakeScreenTexture(tex);
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
GL_SetBlend(PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
for (i = 0; i < 1; i += 2.f/vid.height)
|
||||
const float stride = 2.f/scrwh;
|
||||
|
||||
for (i = 0; i < 1; i += stride)
|
||||
{
|
||||
fix[2] = (float)(rand() % 128) / -22000 * xfix;
|
||||
fix[2] = (float)(rand() % 128) / -22000.f * xfix;
|
||||
fix[0] = fix[2];
|
||||
fix[6] = fix[0] + xfix;
|
||||
fix[4] = fix[2] + xfix;
|
||||
@@ -3395,8 +3393,8 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
}
|
||||
|
||||
// Upward bar
|
||||
GL_MakeScreenTexture(tex);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
//GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
//pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
color[0] = color[1] = color[2] = 190;
|
||||
color[3] = 250;
|
||||
@@ -3404,14 +3402,14 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
|
||||
fix[0] = 0.0f;
|
||||
fix[6] = xfix;
|
||||
fix[2] = (float)updistort / screen_width * xfix;
|
||||
fix[2] = (float)updistort / scrwf * xfix;
|
||||
fix[4] = fix[2] + fix[6];
|
||||
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*upbary/screen_height - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/screen_height;
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*upbary/scrwh - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/scrwh;
|
||||
|
||||
fix[1] = fix[7] = (float)upbary/screen_height * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/screen_height * yfix;
|
||||
fix[1] = fix[7] = (float)upbary/scrwh * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/scrwh * yfix;
|
||||
|
||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
||||
@@ -3424,19 +3422,19 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
// Downward bar
|
||||
GL_MakeScreenTexture(tex);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
//GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
//pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
fix[0] = 0.0f;
|
||||
fix[6] = xfix;
|
||||
fix[2] = (float)downdistort / screen_width * -xfix;
|
||||
fix[2] = (float)downdistort / scrwf * -xfix;
|
||||
fix[4] = fix[2] + fix[6];
|
||||
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*downbary/screen_height - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/screen_height;
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*downbary/scrwh - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/scrwh;
|
||||
|
||||
fix[1] = fix[7] = (float)downbary/screen_height * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/screen_height * yfix;
|
||||
fix[1] = fix[7] = (float)downbary/scrwh * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/scrwh * yfix;
|
||||
|
||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
||||
@@ -3452,11 +3450,13 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
// Create a texture from the screen.
|
||||
void GL_MakeScreenTexture(int tex)
|
||||
{
|
||||
boolean firstTime = (screenTextures[tex] == 0);
|
||||
boolean firstTime;
|
||||
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
firstTime = (screenTextures[tex] == 0);
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
pglGenTextures(1, &screenTextures[tex]);
|
||||
@@ -3490,8 +3490,8 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
origaspect = (float)screen_width / screen_height;
|
||||
newaspect = (float)width / height;
|
||||
@@ -3541,7 +3541,7 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
|
||||
if (useshader)
|
||||
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // palette postprocess shader
|
||||
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // Final postprocess step of palette rendering, after everything else has been drawn.
|
||||
|
||||
pglColor4ubv(white);
|
||||
|
||||
@@ -3559,6 +3559,7 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
void GL_SetPaletteLookup(UINT8 *lut)
|
||||
{
|
||||
GLenum internalFormat;
|
||||
|
||||
if (gl_version[0] == '1' || gl_version[0] == '2')
|
||||
{
|
||||
// if the OpenGL version is below 3.0, then the GL_R8 format may not be available.
|
||||
@@ -3586,6 +3587,7 @@ void GL_SetPaletteLookup(UINT8 *lut)
|
||||
UINT32 GL_CreateLightTable(RGBA_t *hw_lighttable)
|
||||
{
|
||||
LTListItem *item = malloc(sizeof(LTListItem));
|
||||
|
||||
if (!LightTablesTail)
|
||||
{
|
||||
LightTablesHead = LightTablesTail = item;
|
||||
@@ -3595,6 +3597,7 @@ UINT32 GL_CreateLightTable(RGBA_t *hw_lighttable)
|
||||
LightTablesTail->next = item;
|
||||
LightTablesTail = item;
|
||||
}
|
||||
|
||||
item->next = NULL;
|
||||
pglGenTextures(1, &item->id);
|
||||
pglBindTexture(GL_TEXTURE_2D, item->id);
|
||||
|
||||
@@ -40,11 +40,6 @@ typedef enum
|
||||
*/
|
||||
extern rendermode_t rendermode;
|
||||
|
||||
|
||||
/** \brief use highcolor modes if true
|
||||
*/
|
||||
extern boolean highcolor;
|
||||
|
||||
/** \brief setup video mode
|
||||
*/
|
||||
void I_StartupGraphics(void);
|
||||
|
||||
@@ -121,10 +121,6 @@ UINT8 invertmap[256];
|
||||
// for debugging/info purposes
|
||||
size_t flatmemory, spritememory, texturememory; // gotta play by 2.2 rules to get this to work
|
||||
|
||||
// highcolor stuff
|
||||
INT16 color8to16[256]; // remap color index to highcolor rgb value
|
||||
INT16 *hicolormaps; // test a 32k colormap remaps high -> high
|
||||
|
||||
// Blends two pixels together, using the equation
|
||||
// that matches the specified alpha style.
|
||||
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha)
|
||||
@@ -1753,40 +1749,6 @@ const char *R_ColormapNameForNum(INT32 num)
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// build a table for quick conversion from 8bpp to 15bpp
|
||||
//
|
||||
|
||||
//
|
||||
// added "static inline" keywords, linking with the debug version
|
||||
// of allegro, it have a makecol15 function of it's own, now
|
||||
// with "static inline" keywords,it sloves this problem ;)
|
||||
//
|
||||
FUNCMATH static inline int makecol15(int r, int g, int b)
|
||||
{
|
||||
return (((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3)));
|
||||
}
|
||||
|
||||
static void R_Init8to16(void)
|
||||
{
|
||||
UINT8 *palette;
|
||||
int i;
|
||||
|
||||
palette = W_CacheLumpName("PLAYPAL",PU_CACHE);
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
// PLAYPAL uses 8 bit values
|
||||
color8to16[i] = (INT16)makecol15(palette[0], palette[1], palette[2]);
|
||||
palette += 3;
|
||||
}
|
||||
|
||||
// test a big colormap
|
||||
hicolormaps = Z_Malloc(16384*sizeof(*hicolormaps), PU_STATIC, NULL);
|
||||
for (i = 0; i < 16384; i++)
|
||||
hicolormaps[i] = (INT16)(i<<1);
|
||||
}
|
||||
|
||||
//
|
||||
// R_InitData
|
||||
//
|
||||
@@ -1795,12 +1757,6 @@ static void R_Init8to16(void)
|
||||
//
|
||||
void R_InitData(void)
|
||||
{
|
||||
if (highcolor)
|
||||
{
|
||||
CONS_Printf("InitHighColor...\n");
|
||||
R_Init8to16();
|
||||
}
|
||||
|
||||
CONS_Printf("R_LoadTextures()...\n");
|
||||
R_LoadTextures();
|
||||
|
||||
|
||||
@@ -70,9 +70,6 @@ extern fixed_t *textureheight; // needed for texture pegging
|
||||
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||
UINT32 ASTBlendTexturePixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||
|
||||
extern INT16 color8to16[256]; // remap color index to highcolor
|
||||
extern INT16 *hicolormaps; // remap high colors to high colors..
|
||||
|
||||
extern CV_PossibleValue_t Color_cons_t[];
|
||||
|
||||
// Load TEXTURE1/TEXTURE2/PNAMES definitions, create lookup tables
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 22050, N
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t audbuffersize_cons_t[] = {{128, "128"}, {256, "256"}, {512, "512"}, {1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}};
|
||||
consvar_t cv_audbuffersize = {"audiobuffersize", "2048", CV_SAVE, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_audbuffersize = {"audiobuffersize", "2048", CV_SAVE|CV_CALL, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// stereo reverse
|
||||
consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file screen.c
|
||||
/// \brief Handles multiple resolutions, 8bpp/16bpp(highcolor) modes
|
||||
/// \brief Handles multiple resolutions
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
@@ -37,7 +37,7 @@
|
||||
// global video state
|
||||
// ------------------
|
||||
viddef_t vid;
|
||||
INT32 setmodeneeded; //video mode change needed if > 0 (the mode number to set + 1)
|
||||
INT32 setmodeneeded; // video mode change needed if > 0 (the mode number to set + 1)
|
||||
|
||||
static CV_PossibleValue_t shittyscreen_cons_t[] = {{0, "Okay"}, {1, "Shitty"}, {2, "Extra Shitty"}, {0, NULL}};
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file screen.h
|
||||
/// \brief Handles multiple resolutions, 8bpp/16bpp(highcolor) modes
|
||||
/// \brief Handles multiple resolutions
|
||||
|
||||
#ifndef __SCREEN_H__
|
||||
#define __SCREEN_H__
|
||||
|
||||
@@ -113,8 +113,6 @@ unsigned msaa = 0;
|
||||
boolean a2c = false;
|
||||
#endif
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
static void KeyboardLayout_OnChange(void)
|
||||
{
|
||||
if (cv_keyboardlayout.value == 2)
|
||||
|
||||
Reference in new issue
Block a user