Remove dead renderer code

based on 0eeacaf51e

remove
- broken viewborder code (if we really want it back for some reason, we should rather port RR´s fixed version of it)
- remove console clipping code for software (this was broken eiherway)
- remove hud message clearing stuff
- remove renderscreen and linesize variables (they just pointed to vid.screen and vid.widht)
This commit is contained in:
NepDisk 2025-10-19 16:34:35 -04:00
parent a06aa1590f
commit df581ae69f
23 changed files with 18 additions and 550 deletions

View file

@ -11,7 +11,7 @@
makedir:=$(makedir)/SDL makedir:=$(makedir)/SDL
sources+=$(call List,sdl/Sourcefile) sources+=$(call List,sdl/Sourcefile)
opts+=-DDIRECTFULLSCREEN -DHAVE_SDL opts+=-DHAVE_SDL
ifndef NOHW ifndef NOHW
sources+=sdl/ogl_sdl.c sources+=sdl/ogl_sdl.c

View file

@ -73,14 +73,9 @@ static boolean consoleready; // console prompt is ready
INT32 con_destlines; // vid lines used by console at final position INT32 con_destlines; // vid lines used by console at final position
static INT32 con_curlines; // vid lines currently used by console static INT32 con_curlines; // vid lines currently used by console
INT32 con_clipviewtop; // (useless)
static INT32 con_hudlines; // number of console heads up message lines static INT32 con_hudlines; // number of console heads up message lines
static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines
INT32 con_clearlines; // top screen lines to refresh when view reduced
boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh
// console text output // console text output
static char *con_line; // console text output current line static char *con_line; // console text output current line
static size_t con_cx; // cursor position in current line static size_t con_cx; // cursor position in current line
@ -440,9 +435,6 @@ void CON_Init(void)
Lock_state(); Lock_state();
//note: CON_Ticker should always execute at least once before D_Display()
con_clipviewtop = -1; // -1 does not clip
con_hudlines = atoi(cons_hudlines.defaultvalue); con_hudlines = atoi(cons_hudlines.defaultvalue);
Unlock_state(); Unlock_state();
@ -724,7 +716,6 @@ void CON_ToggleOff(void)
con_curlines = 0; con_curlines = 0;
CON_ClearHUD(); CON_ClearHUD();
con_forcepic = 0; con_forcepic = 0;
con_clipviewtop = -1; // remove console clipping of view
I_UpdateMouseGrab(); I_UpdateMouseGrab();
@ -773,18 +764,6 @@ void CON_Ticker(void)
CON_ChangeHeight(); CON_ChangeHeight();
} }
// clip the view, so that the part under the console is not drawn
con_clipviewtop = -1;
if (cons_backpic.value) // clip only when using an opaque background
{
if (con_curlines > 0)
con_clipviewtop = con_curlines - viewwindowy - 1 - 10;
// NOTE: BIG HACK::SUBTRACT 10, SO THAT WATER DON'T COPY LINES OF THE CONSOLE
// WINDOW!!! (draw some more lines behind the bottom of the console)
if (con_clipviewtop < 0)
con_clipviewtop = -1; // maybe not necessary, provided it's < 0
}
// check if console ready for prompt // check if console ready for prompt
if (con_destlines >= minheight) if (con_destlines >= minheight)
consoleready = true; consoleready = true;
@ -1111,9 +1090,6 @@ static void CON_Linefeed(void)
con_line = &con_buffer[(con_cy%con_totallines)*con_width]; con_line = &con_buffer[(con_cy%con_totallines)*con_width];
memset(con_line, ' ', con_width); memset(con_line, ' ', con_width);
// make sure the view borders are refreshed if hud messages scroll
con_hudupdate = true; // see HU_Erase()
} }
// Outputs text into the console text buffer // Outputs text into the console text buffer
@ -1486,9 +1462,6 @@ static void CON_DrawHudlines(void)
//V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, true); //V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, true);
y += charheight; y += charheight;
} }
// top screen lines that might need clearing when view is reduced
con_clearlines = y; // this is handled by HU_Erase();
} }
// Lactozilla: Draws the console's background picture. // Lactozilla: Draws the console's background picture.
@ -1554,10 +1527,6 @@ static void CON_DrawConsole(void)
if (con_curlines <= 0) if (con_curlines <= 0)
return; return;
//FIXME: refresh borders only when console bg is translucent
con_clearlines = con_curlines; // clear console draw from view borders
con_hudupdate = true; // always refresh while console is on
// draw console background // draw console background
if (cons_backpic.value || con_forcepic) if (cons_backpic.value || con_forcepic)
CON_DrawBackpic(); CON_DrawBackpic();

View file

@ -60,14 +60,9 @@ typedef enum
extern con_loadprogress_t con_startup_loadprogress; extern con_loadprogress_t con_startup_loadprogress;
// top clip value for view render: do not draw part of view hidden by console
extern INT32 con_clipviewtop;
// 0 means console if off, or moving out // 0 means console if off, or moving out
extern INT32 con_destlines; extern INT32 con_destlines;
extern INT32 con_clearlines; // lines of top of screen to refresh
extern boolean con_hudupdate; // hud messages have changed, need refresh
extern UINT32 con_scalefactor; // console text scale factor extern UINT32 con_scalefactor; // console text scale factor
extern consvar_t cons_backcolor, cons_menuhighlight; extern consvar_t cons_backcolor, cons_menuhighlight;

View file

@ -526,19 +526,16 @@ static void D_Display(void)
case GS_LEVEL: case GS_LEVEL:
if (!gametic) if (!gametic)
break; break;
HU_Erase();
AM_Drawer(); AM_Drawer();
break; break;
case GS_INTERMISSION: case GS_INTERMISSION:
Y_IntermissionDrawer(); Y_IntermissionDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
case GS_VOTING: case GS_VOTING:
Y_VoteDrawer(); Y_VoteDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
@ -556,31 +553,26 @@ static void D_Display(void)
case GS_CUTSCENE: case GS_CUTSCENE:
F_CutsceneDrawer(); F_CutsceneDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
case GS_EVALUATION: case GS_EVALUATION:
F_GameEvaluationDrawer(); F_GameEvaluationDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
case GS_CREDITS: case GS_CREDITS:
F_CreditDrawer(); F_CreditDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
case GS_BLANCREDITS: case GS_BLANCREDITS:
F_BlanCreditDrawer(); F_BlanCreditDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
case GS_SECRETCREDITS: case GS_SECRETCREDITS:
F_SecretCreditsDrawer(); F_SecretCreditsDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
break; break;
@ -590,7 +582,6 @@ static void D_Display(void)
{ {
// I don't think HOM from nothing drawing is independent... // I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer(); F_WaitingPlayersDrawer();
HU_Erase();
HU_Drawer(); HU_Drawer();
} }
case GS_DEDICATEDSERVER: case GS_DEDICATEDSERVER:
@ -770,7 +761,6 @@ static void D_WipeDraw(boolean menu)
I_UpdateNoBlit(); I_UpdateNoBlit();
HU_Erase();
HU_Drawer(); HU_Drawer();
if (menu) if (menu)
{ {
@ -1711,9 +1701,7 @@ void D_SRB2Main(void)
//--------------------------------------------------------- CONFIG.CFG //--------------------------------------------------------- CONFIG.CFG
M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()" M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
#endif
// set user default mode or mode set at cmdline // set user default mode or mode set at cmdline
SCR_CheckDefaultMode(); SCR_CheckDefaultMode();

View file

@ -180,7 +180,7 @@ extern boolean lastdraw;
extern INT32 postimgparam[MAXSPLITSCREENPLAYERS]; extern INT32 postimgparam[MAXSPLITSCREENPLAYERS];
extern INT32 viewwindowx, viewwindowy; extern INT32 viewwindowx, viewwindowy;
extern INT32 viewwidth, scaledviewwidth; extern INT32 viewwidth;
extern boolean gamedataloaded; extern boolean gamedataloaded;

View file

@ -44,7 +44,6 @@ extern "C" {
#define UINT64 uint64_t #define UINT64 uint64_t
#ifdef __APPLE_CC__ #ifdef __APPLE_CC__
#define DIRECTFULLSCREEN 1
#define DEBUG_LOG #define DEBUG_LOG
#define NOIPX #define NOIPX
#endif #endif

View file

@ -33,11 +33,6 @@
#include "../r_plane.h" // R_FlatDimensionsFromLumpSize #include "../r_plane.h" // R_FlatDimensionsFromLumpSize
#include <fcntl.h> #include <fcntl.h>
#include "../i_video.h" // for rendermode != render_glide
#ifndef O_BINARY
#define O_BINARY 0
#endif
typedef struct typedef struct
{ {
@ -57,72 +52,6 @@ static UINT8 softwaretranstogl[11] = { 0, 25, 51, 76,102,127,153,178,204,229
static UINT8 softwaretranstogl_hi[11] = { 0, 51,102,153,204,255,255,255,255,255,255}; static UINT8 softwaretranstogl_hi[11] = { 0, 51,102,153,204,255,255,255,255,255,255};
static UINT8 softwaretranstogl_lo[11] = { 0, 12, 24, 36, 48, 60, 71, 83, 95,111,127}; static UINT8 softwaretranstogl_lo[11] = { 0, 12, 24, 36, 48, 60, 71, 83, 95,111,127};
//
// -----------------+
// HWR_DrawPatch : Draw a 'tile' graphic
// Notes : x,y : positions relative to the original Doom resolution
// : textes(console+score) + menus + status bar
// -----------------+
void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
{
FOutVector v[4];
FBITFIELD flags;
GLPatch_t *hwrPatch;
// 3--2
// | /|
// |/ |
// 0--1
float sdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
float sdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
// make patch ready in hardware cache
HWR_GetPatch(gpatch);
hwrPatch = ((GLPatch_t *)gpatch->hardware);
switch (option & V_SCALEPATCHMASK)
{
case V_NOSCALEPATCH:
pdupx = pdupy = 2.0f;
break;
case V_SMALLSCALEPATCH:
pdupx = 2.0f * FIXED_TO_FLOAT(vid.smalldupx*FRACUNIT);
pdupy = 2.0f * FIXED_TO_FLOAT(vid.smalldupy*FRACUNIT);
break;
case V_MEDSCALEPATCH:
pdupx = 2.0f * FIXED_TO_FLOAT(vid.meddupx*FRACUNIT);
pdupy = 2.0f * FIXED_TO_FLOAT(vid.meddupx*FRACUNIT);
break;
}
if (option & V_NOSCALESTART)
sdupx = sdupy = 2.0f;
v[0].x = v[3].x = (x*sdupx-(gpatch->leftoffset)*pdupx)/vid.width - 1;
v[2].x = v[1].x = (x*sdupx+(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
v[0].y = v[1].y = 1-(y*sdupy-(gpatch->topoffset)*pdupy)/vid.height;
v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].s = v[3].s = 0.0f;
v[2].s = v[1].s = hwrPatch->max_s;
v[0].t = v[1].t = 0.0f;
v[2].t = v[3].t = hwrPatch->max_t;
flags = PF_Translucent|PF_NoDepthTest;
/*if (option & V_WRAPX)
flags |= PF_ForceWrapX;
if (option & V_WRAPY)
flags |= PF_ForceWrapY;*/
// clip it since it is used for bunny scroll in doom I
HWD.pfnDrawPolygon(NULL, v, 4, flags);
}
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap) void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap)
{ {
FOutVector v[4]; FOutVector v[4];
@ -775,137 +704,6 @@ void HWR_DrawTutorialBack(UINT32 color, INT32 boxheight)
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest); HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
} }
// ==========================================================================
// R_DRAW.C STUFF
// ==========================================================================
// ------------------
// HWR_DrawViewBorder
// Fill the space around the view window with a Doom flat texture, draw the
// beveled edges.
// 'clearlines' is useful to clear the heads up messages, when the view
// window is reduced, it doesn't refresh all the view borders.
// ------------------
void HWR_DrawViewBorder(INT32 clearlines)
{
INT32 x, y;
INT32 top, side;
INT32 baseviewwidth, baseviewheight;
INT32 basewindowx, basewindowy;
patch_t *patch;
// if (gl_viewwidth == vid.width)
// return;
if (!clearlines)
clearlines = BASEVIDHEIGHT; // refresh all
// calc view size based on original game resolution
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdupx));
// top
HWR_DrawFlatFill(0, 0,
BASEVIDWIDTH, (top < clearlines ? top : clearlines),
st_borderpatchnum);
// left
if (top < clearlines)
HWR_DrawFlatFill(0, top, side,
(clearlines-top < baseviewheight ? clearlines-top : baseviewheight),
st_borderpatchnum);
// right
if (top < clearlines)
HWR_DrawFlatFill(side + baseviewwidth, top, side,
(clearlines-top < baseviewheight ? clearlines-top : baseviewheight),
st_borderpatchnum);
// bottom
if (top + baseviewheight < clearlines)
HWR_DrawFlatFill(0, top + baseviewheight,
BASEVIDWIDTH, BASEVIDHEIGHT, st_borderpatchnum);
//
// draw the view borders
//
basewindowx = (BASEVIDWIDTH - baseviewwidth)>>1;
if (baseviewwidth == BASEVIDWIDTH)
basewindowy = 0;
else
basewindowy = top;
// top edge
if (clearlines > basewindowy - 8)
{
patch = W_CachePatchNum(viewborderlump[BRDR_T], PU_PATCH);
for (x = 0; x < baseviewwidth; x += 8)
HWR_DrawPatch(patch, basewindowx + x, basewindowy - 8,
0);
}
// bottom edge
if (clearlines > basewindowy + baseviewheight)
{
patch = W_CachePatchNum(viewborderlump[BRDR_B], PU_PATCH);
for (x = 0; x < baseviewwidth; x += 8)
HWR_DrawPatch(patch, basewindowx + x,
basewindowy + baseviewheight, 0);
}
// left edge
if (clearlines > basewindowy)
{
patch = W_CachePatchNum(viewborderlump[BRDR_L], PU_PATCH);
for (y = 0; y < baseviewheight && basewindowy + y < clearlines;
y += 8)
{
HWR_DrawPatch(patch, basewindowx - 8, basewindowy + y,
0);
}
}
// right edge
if (clearlines > basewindowy)
{
patch = W_CachePatchNum(viewborderlump[BRDR_R], PU_PATCH);
for (y = 0; y < baseviewheight && basewindowy+y < clearlines;
y += 8)
{
HWR_DrawPatch(patch, basewindowx + baseviewwidth,
basewindowy + y, 0);
}
}
// Draw beveled corners.
if (clearlines > basewindowy - 8)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TL],
PU_PATCH),
basewindowx - 8, basewindowy - 8, 0);
if (clearlines > basewindowy - 8)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TR],
PU_PATCH),
basewindowx + baseviewwidth, basewindowy - 8, 0);
if (clearlines > basewindowy+baseviewheight)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BL],
PU_PATCH),
basewindowx - 8, basewindowy + baseviewheight, 0);
if (clearlines > basewindowy + baseviewheight)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BR],
PU_PATCH),
basewindowx + baseviewwidth,
basewindowy + baseviewheight, 0);
}
// ========================================================================== // ==========================================================================
// AM_MAP.C DRAWING STUFF // AM_MAP.C DRAWING STUFF
// ========================================================================== // ==========================================================================
@ -1206,7 +1004,7 @@ static inline boolean saveTGA(const char *file_name, void *buffer,
INT32 i; INT32 i;
UINT8 *buf8 = buffer; UINT8 *buf8 = buffer;
fd = open(file_name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); fd = open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd < 0) if (fd < 0)
return false; return false;

View file

@ -38,11 +38,9 @@ void HWR_RenderSkyboxView(player_t *player);
void HWR_RenderPlayerView(void); void HWR_RenderPlayerView(void);
void HWR_ClearSkyDome(void); void HWR_ClearSkyDome(void);
void HWR_BuildSkyDome(void); void HWR_BuildSkyDome(void);
void HWR_DrawViewBorder(INT32 clearlines);
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum); void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);
void HWR_InitTextureMapping(void); void HWR_InitTextureMapping(void);
void HWR_SetViewSize(void); void HWR_SetViewSize(void);
void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option);
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap); void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap);
void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap);

View file

@ -2176,76 +2176,6 @@ void HU_Drawer(void)
} }
} }
//======================================================================
// HUD MESSAGES CLEARING FROM SCREEN
//======================================================================
// Clear old messages from the borders around the view window
// (only for reduced view, refresh the borders when needed)
//
// startline: y coord to start clear,
// clearlines: how many lines to clear.
//
static INT32 oldclearlines;
void HU_Erase(void)
{
INT32 topline, bottomline;
INT32 y, yoffset;
#ifdef HWRENDER
// clear hud msgs on double buffer (OpenGL mode)
boolean secondframe;
static INT32 secondframelines;
#endif
if (con_clearlines == oldclearlines && !con_hudupdate && !chat_on)
return;
#ifdef HWRENDER
// clear the other frame in double-buffer modes
secondframe = (con_clearlines != oldclearlines);
if (secondframe)
secondframelines = oldclearlines;
#endif
// clear the message lines that go away, so use _oldclearlines_
bottomline = oldclearlines;
oldclearlines = con_clearlines;
if (chat_on && OLDCHAT)
if (bottomline < 8)
bottomline = 8; // only do it for consolechat. consolechat is gay.
if (automapactive || viewwindowx == 0) // hud msgs don't need to be cleared
return;
// software mode copies view border pattern & beveled edges from the backbuffer
if (rendermode == render_soft)
{
topline = 0;
for (y = topline, yoffset = y*vid.width; y < bottomline; y++, yoffset += vid.width)
{
if (y < viewwindowy || y >= viewwindowy + viewheight)
R_VideoErase(yoffset, vid.width); // erase entire line
else
{
R_VideoErase(yoffset, viewwindowx); // erase left border
// erase right border
R_VideoErase(yoffset + viewwindowx + viewwidth, viewwindowx);
}
}
con_hudupdate = false; // if it was set..
}
#ifdef HWRENDER
else if (rendermode != render_none)
{
// refresh just what is needed from the view borders
HWR_DrawViewBorder(secondframelines);
con_hudupdate = secondframe;
}
#endif
}
//====================================================================== //======================================================================
// IN-LEVEL MULTIPLAYER RANKINGS // IN-LEVEL MULTIPLAYER RANKINGS
//====================================================================== //======================================================================

View file

@ -131,7 +131,6 @@ void HU_TickSongCredits(void);
void HU_DrawSongCredits(void); void HU_DrawSongCredits(void);
void HU_Drawer(void); void HU_Drawer(void);
char HU_dequeueChatChar(void); char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void); void HU_clearChatChars(void);
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags, boolean icon); void HU_drawPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags, boolean icon);
void HU_drawOldPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags); void HU_drawOldPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags);

View file

@ -108,8 +108,8 @@ void VID_CheckGLLoaded(rendermode_t oldrender);
\return name of video mode \return name of video mode
*/ */
const char *VID_GetModeName(INT32 modenum); const char *VID_GetModeName(INT32 modenum);
void VID_PrepareModeList(void); /// note hack for SDL
void VID_PrepareModeList(void);
/** \brief can video system do fullscreen /** \brief can video system do fullscreen
*/ */

View file

@ -8177,9 +8177,8 @@ INT32 MR_VideoModeMenu(INT32 choice)
memset(modedescs, 0, sizeof(modedescs)); memset(modedescs, 0, sizeof(modedescs));
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // FIXME: hack VID_PrepareModeList(); // FIXME: hack
#endif
vidm_nummodes = 0; vidm_nummodes = 0;
vidm_selected = 0; vidm_selected = 0;
nummodes = VID_NumModes(); nummodes = VID_NumModes();

View file

@ -67,8 +67,7 @@ drawspandata_t g_ds;
/** \brief view info /** \brief view info
*/ */
INT32 linesize, viewwidth, scaledviewwidth, viewheight, viewwindowx, viewwindowy; INT32 viewwidth, viewheight, viewwindowx, viewwindowy;
UINT8 *renderscreen; // haleyjd
UINT8 r8_flatcolor; UINT8 r8_flatcolor;
@ -525,21 +524,13 @@ void R_ResetColumnBuffer(void)
Creates lookup tables for getting the framebuffer address Creates lookup tables for getting the framebuffer address
of a pixel to draw. of a pixel to draw.
\param width witdh of buffer
\param height hieght of buffer
\return void \return void
*/ */
void R_InitViewBuffer(INT32 width, INT32 height) void R_InitViewBuffer(void)
{ {
if (width > MAXVIDWIDTH)
width = MAXVIDWIDTH;
if (height > MAXVIDHEIGHT)
height = MAXVIDHEIGHT;
viewwindowx = 0; viewwindowx = 0;
viewwindowy = 0; viewwindowy = 0;
INT32 bufsize = (vid.width * 8) * sizeof(*temp_dc.buf); INT32 bufsize = (vid.width * 8) * sizeof(*temp_dc.buf);
@ -564,28 +555,6 @@ void R_InitViewBuffer(INT32 width, INT32 height)
#endif #endif
memset(temp_dc.buf, 0, bufsize); memset(temp_dc.buf, 0, bufsize);
linesize = vid.width; // killough 11/98
renderscreen = vid.screens[0]; // haleyjd 07/02/14
}
/** \brief viewborder patches lump numbers
*/
lumpnum_t viewborderlump[8];
/** \brief Store the lumpnumber of the viewborder patches
*/
void R_InitViewBorder(void)
{
viewborderlump[BRDR_T] = W_GetNumForName("brdr_t");
viewborderlump[BRDR_B] = W_GetNumForName("brdr_b");
viewborderlump[BRDR_L] = W_GetNumForName("brdr_l");
viewborderlump[BRDR_R] = W_GetNumForName("brdr_r");
viewborderlump[BRDR_TL] = W_GetNumForName("brdr_tl");
viewborderlump[BRDR_BL] = W_GetNumForName("brdr_bl");
viewborderlump[BRDR_TR] = W_GetNumForName("brdr_tr");
viewborderlump[BRDR_BR] = W_GetNumForName("brdr_br");
} }
/** \brief The R_VideoErase function /** \brief The R_VideoErase function
@ -632,130 +601,6 @@ void R_VideoErase(size_t ofs, INT32 count)
M_Memcpy(vid.screens[0] + ofs, vid.screens[1] + ofs, count); M_Memcpy(vid.screens[0] + ofs, vid.screens[1] + ofs, count);
} }
#if 0
/** \brief R_FillBackScreen
Fills the back screen with a pattern for variable screen sizes
Also draws a beveled edge.
*/
void R_FillBackScreen(void)
{
UINT8 *src, *dest;
patch_t *patch;
INT32 x, y, step, boff;
const INT32 vidheight = vid.height;
const INT32 vidwidth = vid.width;
// quickfix, don't cache lumps in both modes
if (rendermode != render_soft)
return;
// draw pattern around the status bar too (when hires),
// so return only when in full-screen without status bar.
if (scaledviewwidth == vidwidth && viewheight == vidheight)
return;
src = scr_borderpatch;
dest = vid.screens[1];
for (y = 0; y < vidheight; y++)
{
for (x = 0; x < vidwidth/128; x++)
{
M_Memcpy (dest, src+((y&127)<<7), 128);
dest += 128;
}
if (vidwidth&127)
{
M_Memcpy(dest, src+((y&127)<<7), vidwidth&127);
dest += (vidwidth&127);
}
}
// don't draw the borders when viewwidth is full vidwidth.
if (scaledviewwidth == vidwidth)
return;
step = 8;
boff = 8;
patch = W_CacheLumpNum(viewborderlump[BRDR_T], PU_CACHE);
for (x = 0; x < scaledviewwidth; x += step)
V_DrawPatch(viewwindowx + x, viewwindowy - boff, 1, patch);
patch = W_CacheLumpNum(viewborderlump[BRDR_B], PU_CACHE);
for (x = 0; x < scaledviewwidth; x += step)
V_DrawPatch(viewwindowx + x, viewwindowy + viewheight, 1, patch);
patch = W_CacheLumpNum(viewborderlump[BRDR_L], PU_CACHE);
for (y = 0; y < viewheight; y += step)
V_DrawPatch(viewwindowx - boff, viewwindowy + y, 1, patch);
patch = W_CacheLumpNum(viewborderlump[BRDR_R],PU_CACHE);
for (y = 0; y < viewheight; y += step)
V_DrawPatch(viewwindowx + scaledviewwidth, viewwindowy + y, 1,
patch);
// Draw beveled corners.
V_DrawPatch(viewwindowx - boff, viewwindowy - boff, 1,
W_CacheLumpNum(viewborderlump[BRDR_TL], PU_CACHE));
V_DrawPatch(viewwindowx + scaledviewwidth, viewwindowy - boff, 1,
W_CacheLumpNum(viewborderlump[BRDR_TR], PU_CACHE));
V_DrawPatch(viewwindowx - boff, viewwindowy + viewheight, 1,
W_CacheLumpNum(viewborderlump[BRDR_BL], PU_CACHE));
V_DrawPatch(viewwindowx + scaledviewwidth, viewwindowy + viewheight, 1,
W_CacheLumpNum(viewborderlump[BRDR_BR], PU_CACHE));
}
/** \brief The R_DrawViewBorder
Draws the border around the view
for different size windows?
*/
void R_DrawViewBorder(void)
{
INT32 top, side, ofs;
if (rendermode == render_none)
return;
#ifdef HWRENDER
if (rendermode != render_soft)
{
HWR_DrawViewBorder(0);
return;
}
else
#endif
#ifdef DEBUG
fprintf(stderr,"RDVB: vidwidth %d vidheight %d scaledviewwidth %d viewheight %d\n",
vid.width, vidheight, scaledviewwidth, viewheight);
#endif
if (scaledviewwidth == vid.width)
return;
top = (vidheight - viewheight)>>1;
side = (vid.width - scaledviewwidth)>>1;
// copy top and one line of left side
R_VideoErase(0, top*vid.width+side);
// copy one line of right side and bottom
ofs = (viewheight+top)*vid.width - side;
R_VideoErase(ofs, top*vid.width + side);
// copy sides using wraparound
ofs = top*vid.width + vid.width-side;
side <<= 1;
// simpler using our VID_Blit routine
VID_BlitLinearScreen(vid.screens[1] + ofs, vid.screens[0] + ofs, side, viewheight - 1,
vid.width, vid.width);
}
#endif
// ========================================================================== // ==========================================================================
// INCLUDE MAIN DRAWERS CODE HERE // INCLUDE MAIN DRAWERS CODE HERE
// ========================================================================== // ==========================================================================

View file

@ -23,12 +23,10 @@ extern "C" {
// ------------------------------- // -------------------------------
// COMMON STUFF FOR 8bpp AND 16bpp // COMMON STUFF FOR 8bpp AND 16bpp
// ------------------------------- // -------------------------------
extern UINT8 *renderscreen;
extern INT32 linesize;
FUNCINLINE static ATTRINLINE UINT8 *R_Address(INT32 px, INT32 py) FUNCINLINE static ATTRINLINE UINT8 *R_Address(INT32 px, INT32 py)
{ {
return renderscreen + (py + viewwindowy) * linesize + (viewwindowx + px); return vid.screens[0] + (py + viewwindowy) * vid.width + (viewwindowx + px);
} }
extern UINT8 r8_flatcolor; extern UINT8 r8_flatcolor;
@ -56,25 +54,6 @@ void SCR_SetDrawFuncs(enum columncontext_e _columncontext);
void R_ResetColumnBuffer(void); void R_ResetColumnBuffer(void);
/// \brief Top border
#define BRDR_T 0
/// \brief Bottom border
#define BRDR_B 1
/// \brief Left border
#define BRDR_L 2
/// \brief Right border
#define BRDR_R 3
/// \brief Topleft border
#define BRDR_TL 4
/// \brief Topright border
#define BRDR_TR 5
/// \brief Bottomleft border
#define BRDR_BL 6
/// \brief Bottomright border
#define BRDR_BR 7
extern lumpnum_t viewborderlump[8];
// --------------------------------------------- // ---------------------------------------------
// color mode dependent drawer function pointers // color mode dependent drawer function pointers
// --------------------------------------------- // ---------------------------------------------
@ -140,7 +119,7 @@ extern spandrawfunc_t *spanfuncs_bm_npo2[SPANDRAWFUNC_MAX];
extern spandrawfunc_t *spanfuncs_flat[SPANDRAWFUNC_MAX]; extern spandrawfunc_t *spanfuncs_flat[SPANDRAWFUNC_MAX];
// ------------------------------------------------ // ------------------------------------------------
// r_draw.c COMMON ROUTINES FOR BOTH 8bpp and 16bpp // r_draw.c
// ------------------------------------------------ // ------------------------------------------------
#define GTC_CACHE 1 #define GTC_CACHE 1
@ -193,18 +172,9 @@ UINT8 R_InvPaletteRemap(UINT8 color);
// Color ramp modification should force a recache // Color ramp modification should force a recache
extern UINT8 skincolor_modified[]; extern UINT8 skincolor_modified[];
void R_InitViewBuffer(INT32 width, INT32 height); void R_InitViewBuffer(void);
void R_InitViewBorder(void);
void R_VideoErase(size_t ofs, INT32 count); void R_VideoErase(size_t ofs, INT32 count);
// Rendering function.
#if 0
void R_FillBackScreen(void);
// If the view size is not full screen, draws a border around it.
void R_DrawViewBorder(void);
#endif
#define TRANSPARENTPIXEL 255 #define TRANSPARENTPIXEL 255
#define BRIGHTPIXEL 0 #define BRIGHTPIXEL 0

View file

@ -796,7 +796,6 @@ void R_DrawFogSpan(drawspandata_t* ds)
UINT8 *colormap; UINT8 *colormap;
UINT8 *dest; UINT8 *dest;
const INT32 vidwidth = vid.width;
colormap = ds->colormap; colormap = ds->colormap;

View file

@ -965,18 +965,15 @@ void R_ExecuteSetViewSize(void)
// status bar overlay // status bar overlay
st_overlay = cv_showhud.value; st_overlay = cv_showhud.value;
scaledviewwidth = vid.width; viewwidth = vid.width;
viewheight = vid.height; viewheight = vid.height;
if (r_splitscreen) if (r_splitscreen)
viewheight >>= 1; viewheight >>= 1;
viewwidth = scaledviewwidth;
if (r_splitscreen > 1) if (r_splitscreen > 1)
{ {
viewwidth >>= 1; viewwidth >>= 1;
scaledviewwidth >>= 1;
} }
centerx = viewwidth/2; centerx = viewwidth/2;
@ -1009,7 +1006,7 @@ void R_ExecuteSetViewSize(void)
} }
} }
R_InitViewBuffer(scaledviewwidth, viewheight); R_InitViewBuffer();
// thing clipping // thing clipping
for (i = 0; i < viewwidth; i++) for (i = 0; i < viewwidth; i++)
@ -1072,8 +1069,6 @@ void R_Init(void)
CONS_Printf("R_InitColormaps()...\n"); CONS_Printf("R_InitColormaps()...\n");
R_InitColormaps(); R_InitColormaps();
//I_OutputMsg("\nR_InitViewBorder");
R_InitViewBorder();
R_SetViewSize(); // setsizeneeded is set true R_SetViewSize(); // setsizeneeded is set true
//I_OutputMsg("\nR_InitPlanes"); //I_OutputMsg("\nR_InitPlanes");

View file

@ -676,7 +676,7 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc)(drawcolumndata_t*), bo
R_CheckDebugHighlight(SW_HI_SKY); R_CheckDebugHighlight(SW_HI_SKY);
// Reset column drawer function (note: couldn't we just call walldrawerfunc directly?) // Reset column drawer function (note: couldn't we just call colfuncs[BASEDRAWFUNC] directly?)
// (that is, unless we'll need to switch drawers in future for some reason) // (that is, unless we'll need to switch drawers in future for some reason)
R_SetColumnFunc(BASEDRAWFUNC, false); R_SetColumnFunc(BASEDRAWFUNC, false);

View file

@ -30,7 +30,6 @@
#include "m_misc.h" #include "m_misc.h"
#include "p_local.h" // Camera... #include "p_local.h" // Camera...
#include "p_slopes.h" #include "p_slopes.h"
#include "console.h" // con_clipviewtop
#include "taglist.h" #include "taglist.h"
#include "r_draw.h" #include "r_draw.h"
#include "core/memory.h" #include "core/memory.h"
@ -759,8 +758,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
sector_t tempsec; sector_t tempsec;
INT32 templight; INT32 templight;
INT32 i, p; INT32 i, p;
fixed_t bottombounds = viewheight << FRACBITS;
fixed_t topbounds = (con_clipviewtop - 1) << FRACBITS;
fixed_t offsetvalue = 0; fixed_t offsetvalue = 0;
lightlist_t *light; lightlist_t *light;
r_lightlist_t *rlight; r_lightlist_t *rlight;
@ -1086,7 +1083,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
bottom_frac += bottom_step; bottom_frac += bottom_step;
// SoM: If column is out of range, why bother with it?? // SoM: If column is out of range, why bother with it??
if (windowbottom < topbounds || windowtop > bottombounds) if (windowbottom < 0 || windowtop > (viewheight << FRACBITS))
{ {
if (dc->numlights) if (dc->numlights)
{ {

View file

@ -3333,8 +3333,6 @@ void R_InitDrawNodes(void)
// R_DrawSprite // R_DrawSprite
// //
//Fab : 26-04-98: //Fab : 26-04-98:
// NOTE : uses con_clipviewtop, so that when console is on,
// don't draw the part of sprites hidden under the console
static void R_DrawSprite(vissprite_t *spr) static void R_DrawSprite(vissprite_t *spr)
{ {
mfloorclip = spr->clipbot; mfloorclip = spr->clipbot;
@ -3376,7 +3374,7 @@ void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2, portal_t* portal)
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
{ {
spr->clipbot[x] = (INT16)viewheight; spr->clipbot[x] = (INT16)viewheight;
spr->cliptop[x] = (INT16)con_clipviewtop; spr->cliptop[x] = (INT16)-1;
} }
return; return;
} }
@ -3559,7 +3557,7 @@ void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2, portal_t* portal)
if (spr->cliptop[x] == CLIP_UNDEF) if (spr->cliptop[x] == CLIP_UNDEF)
//Fab : 26-04-98: was -1, now clips against console bottom //Fab : 26-04-98: was -1, now clips against console bottom
spr->cliptop[x] = (INT16)con_clipviewtop; spr->cliptop[x] = (INT16)-1;
// Sprite is completely above or below clip plane // Sprite is completely above or below clip plane
if (spr->szt >= spr->clipbot[x] || spr->sz <= spr->cliptop[x]) if (spr->szt >= spr->clipbot[x] || spr->sz <= spr->cliptop[x])

View file

@ -94,10 +94,6 @@ consvar_t cv_accuratefps = CVAR_INIT ("fpssampling", "Accurate", CV_SAVE, accura
// SCREEN VARIABLES // SCREEN VARIABLES
// ========================================================================= // =========================================================================
UINT8 *scr_borderpatch; // flat used to fill the reduced view borders set at ST_Init()
// =========================================================================
void SCR_SetDrawFuncs(enum columncontext_e _columncontext) void SCR_SetDrawFuncs(enum columncontext_e _columncontext)
{ {
// //
@ -478,7 +474,6 @@ void SCR_SetDefaultMode(void)
// Change fullscreen on/off according to cv_fullscreen // Change fullscreen on/off according to cv_fullscreen
void SCR_ChangeFullscreen(void) void SCR_ChangeFullscreen(void)
{ {
#ifdef DIRECTFULLSCREEN
I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup
// allow_fullscreen is set by VID_PrepareModeList // allow_fullscreen is set by VID_PrepareModeList
@ -491,8 +486,8 @@ void SCR_ChangeFullscreen(void)
VID_PrepareModeList(); VID_PrepareModeList();
setmodeneeded = VID_GetModeForSize(vid.width, vid.height) + 1; setmodeneeded = VID_GetModeForSize(vid.width, vid.height) + 1;
} }
return; return;
#endif
} }
void SCR_ChangeRenderer(void) void SCR_ChangeRenderer(void)

View file

@ -95,8 +95,6 @@ void SCR_ChangeRenderer(void);
extern CV_PossibleValue_t cv_renderer_t[]; extern CV_PossibleValue_t cv_renderer_t[];
extern UINT8 *scr_borderpatch; // patch used to fill the view borders
extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_renderhitbox, cv_fullscreen; extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_renderhitbox, cv_fullscreen;
extern consvar_t cv_vhseffect, cv_shittyscreen, cv_votebgscaling; extern consvar_t cv_vhseffect, cv_shittyscreen, cv_votebgscaling;
extern consvar_t cv_parallelsoftware; extern consvar_t cv_parallelsoftware;

View file

@ -71,7 +71,7 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES Windows)
endif() endif()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER) target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER)
target_compile_definitions(SRB2SDL2 PRIVATE -DDIRECTFULLSCREEN -DHAVE_SDL) target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_SDL)
#### Installation #### #### Installation ####
if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin) if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin)

View file

@ -169,10 +169,6 @@ void ST_UnloadGraphics(void)
void ST_LoadGraphics(void) void ST_LoadGraphics(void)
{ {
// SRB2 border patch
// st_borderpatchnum = W_GetNumForName("GFZFLR01");
// scr_borderpatch = W_CacheLumpNum(st_borderpatchnum, PU_HUDGFX);
// the original Doom uses 'STF' as base name for all face graphics // the original Doom uses 'STF' as base name for all face graphics
// Graue 04-08-2004: face/name graphics are now indexed by skins // Graue 04-08-2004: face/name graphics are now indexed by skins
// but load them in R_AddSkins, that gets called // but load them in R_AddSkins, that gets called