From aa3a03a8855dc581f46e6b28ffff57a71ee5de05 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Tue, 28 Nov 2023 14:37:12 -0300 Subject: [PATCH] Delete remaining traces of ylookup and columnofs --- src/d_main.c | 2 -- src/r_draw.c | 30 +----------------------------- src/r_draw.h | 4 ---- src/r_draw8.c | 8 -------- 4 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index e363642e2..6653fd2b3 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -506,14 +506,12 @@ static void D_Display(void) if (rendermode != render_none) { viewwindowy = vid.height / 2; - M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0])); topleft = screens[0] + viewwindowx*vid.height + viewwindowy; R_RenderPlayerView(&players[secondarydisplayplayer]); viewwindowy = 0; - M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0])); } } diff --git a/src/r_draw.c b/src/r_draw.c index a38197ea7..9060ac2ed 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -39,23 +39,6 @@ */ INT32 viewwidth, scaledviewwidth, viewheight, viewwindowx, viewwindowy; -/** \brief pointer to the start of each line of the screen, -*/ -UINT8 *ylookup[MAXVIDHEIGHT*4]; - -/** \brief pointer to the start of each line of the screen, for view1 (splitscreen) -*/ -UINT8 *ylookup1[MAXVIDHEIGHT*4]; - -/** \brief pointer to the start of each line of the screen, for view2 (splitscreen) -*/ -UINT8 *ylookup2[MAXVIDHEIGHT*4]; - -/** \brief x byte offset for columns inside the viewwindow, - so the first column starts at (SCRWIDTH - VIEWWIDTH)/2 -*/ -INT32 columnofs[MAXVIDWIDTH*4]; - UINT8 *topleft; // ========================================================================= @@ -690,7 +673,7 @@ UINT16 R_GetSuperColorByName(const char *name) void R_InitViewBuffer(INT32 width, INT32 height) { - INT32 i, bytesperpixel = vid.bpp; + INT32 bytesperpixel = vid.bpp; if (width > MAXVIDWIDTH) width = MAXVIDWIDTH; @@ -702,22 +685,11 @@ void R_InitViewBuffer(INT32 width, INT32 height) // Handle resize, e.g. smaller view windows with border and/or status bar. viewwindowx = (vid.width - width) >> 1; - // Column offset for those columns of the view window, but relative to the entire screen - for (i = 0; i < width; i++) - columnofs[i] = (viewwindowx + i) * bytesperpixel; - // Same with base row offset. if (width == vid.width) viewwindowy = 0; else viewwindowy = (vid.height - height) >> 1; - - // Precalculate all row offsets. - for (i = 0; i < height; i++) - { - ylookup[i] = ylookup1[i] = screens[0] + (i+viewwindowy)*vid.width*bytesperpixel; - ylookup2[i] = screens[0] + (i+(vid.height>>1))*vid.width*bytesperpixel; // for splitscreen - } } /** \brief The R_VideoErase function diff --git a/src/r_draw.h b/src/r_draw.h index 109a2a014..ef2519e57 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -19,10 +19,6 @@ // ------------------------------- // COMMON STUFF FOR 8bpp AND 16bpp // ------------------------------- -extern UINT8 *ylookup[MAXVIDHEIGHT*4]; -extern UINT8 *ylookup1[MAXVIDHEIGHT*4]; -extern UINT8 *ylookup2[MAXVIDHEIGHT*4]; -extern INT32 columnofs[MAXVIDWIDTH*4]; extern UINT8 *topleft; // ------------------------- diff --git a/src/r_draw8.c b/src/r_draw8.c index 30b0dba98..ef01cb097 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -40,8 +40,6 @@ void R_DrawColumn_8(void) #endif // Framebuffer destination address. - // Use ylookup LUT to avoid multiply with ScreenWidth. - // Use columnofs LUT for subwindows? dest = &topleft[dc_x*vid.height + dc_yl]; count++; @@ -118,8 +116,6 @@ void R_Draw2sMultiPatchColumn_8(void) #endif // Framebuffer destination address. - // Use ylookup LUT to avoid multiply with ScreenWidth. - // Use columnofs LUT for subwindows? dest = &topleft[dc_x*vid.height + dc_yl]; count++; @@ -212,8 +208,6 @@ void R_Draw2sMultiPatchTranslucentColumn_8(void) #endif // Framebuffer destination address. - // Use ylookup LUT to avoid multiply with ScreenWidth. - // Use columnofs LUT for subwindows? dest = &topleft[dc_x*vid.height + dc_yl]; count++; @@ -1776,8 +1770,6 @@ void R_DrawFogColumn_8(void) #endif // Framebuffer destination address. - // Use ylookup LUT to avoid multiply with ScreenWidth. - // Use columnofs LUT for subwindows? dest = &topleft[dc_x*vid.height + dc_yl]; // Determine scaling, which is the only mapping to be done.