- dead code removal.

This commit is contained in:
Christoph Oelckers 2019-11-07 00:49:19 +01:00
parent 51658de730
commit e4735fdff1
5 changed files with 1 additions and 273 deletions

View file

@ -836,8 +836,6 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnu
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
void renderDrawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint8_t col);
void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, palette_t p);
int32_t printext16(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol,
const char *name, char fontsize) ATTRIBUTE((nonnull(5)));
void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol,
const char *name, char fontsize) ATTRIBUTE((nonnull(5)));

View file

@ -114,44 +114,6 @@ int32_t FindDistance3D(int32_t x, int32_t y, int32_t z)
}
// Clear OSD background
void COMMON_doclearbackground(int numcols, int height)
{
GLInterface.UseColorOnly(true);
polymostSet2dView();
VSMatrix identity(0);
GLInterface.SetMatrix(Matrix_ModelView, &identity);
auto vert = GLInterface.AllocVertices(8);
auto vt = vert.second;
auto h4 = height - 4;
GLInterface.EnableBlend(true);
vt[0].Set(0, 0); //top-left
vt[1].Set(0, h4); //bottom-left
vt[2].Set(xdim, 0); //top-right
vt[3].Set(xdim, h4); //bottom-right
GLInterface.SetColor(0.f, 0.f, 0.f, 0.67f);
GLInterface.Draw(DT_TRIANGLE_STRIP, vert.first, 4);
vt[0].Set(0, h4); //top-left
vt[1].Set(0, height); //bottom-left
vt[2].Set(xdim, h4); //top-right
vt[3].Set(xdim, height); //bottom-right
GLInterface.SetColor(0.f, 0.f, 0.f, 1.f);
GLInterface.Draw(DT_TRIANGLE_STRIP, vert.first+4, 4);
GLInterface.UseColorOnly(false);
}
void COMMON_clearbackground(int numcols, int numrows)
{
COMMON_doclearbackground(numcols, 8 * numrows + 8);
}
#if defined _WIN32 && !defined EDUKE32_STANDALONE
# define NEED_SHLWAPI_H
# include "windows_inc.h"

View file

@ -12566,157 +12566,6 @@ static int32_t printext_checkypos(int32_t ypos, int32_t *yminptr, int32_t *ymaxp
return 0;
}
//
// printext16
//
int32_t printext16(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize)
{
int32_t ymin, ymax;
if (printext_checkypos(ypos, &ymin, &ymax))
return 0;
if (fontsize & 2) printext16(xpos+1, ypos+1, 0, -1, name, (fontsize & ~2) | 4);
int32_t const ocol = col, obackcol = backcol;
char smallbuf[4];
int32_t stx = xpos;
const int32_t xpos0 = xpos;
char const * const fontptr = (fontsize & 1) ? smalltextfont : textfont;
int const charxsiz = 8 - ((fontsize & 1)<<2);
for (bssize_t i=0; name[i]; i++)
{
if (name[i] == '^')
{
i++;
if (name[i] == 'O') // ^O resets formatting
{
if (fontsize & 4) continue;
col = ocol;
backcol = obackcol;
continue;
}
if (isdigit(name[i]))
{
if (isdigit(name[i+1]))
{
if (isdigit(name[i+2]))
{
Bmemcpy(&smallbuf[0],&name[i],3);
i += 2;
smallbuf[3] = '\0';
}
else
{
Bmemcpy(&smallbuf[0],&name[i],2);
i++;
smallbuf[2] = '\0';
}
}
else
{
smallbuf[0] = name[i];
smallbuf[1] = '\0';
}
if (!(fontsize & 4))
col = editorcolors[Batol(smallbuf)];
if (name[i+1] == ',' && isdigit(name[i+2]))
{
i+=2;
if (isdigit(name[i+1]))
{
if (isdigit(name[i+2]))
{
Bmemcpy(&smallbuf[0],&name[i],3);
i += 2;
smallbuf[3] = '\0';
}
else
{
Bmemcpy(&smallbuf[0],&name[i],2);
i++;
smallbuf[2] = '\0';
}
}
else
{
smallbuf[0] = name[i];
smallbuf[1] = '\0';
}
if (!(fontsize & 4))
backcol = editorcolors[Batol(smallbuf)];
}
continue;
}
}
if (name[i] == '\n')
{
xpos = stx = xpos0;
ypos += 8;
if (printext_checkypos(ypos, &ymin, &ymax))
return 0;
continue;
}
if (stx<0)
{
stx += charxsiz;
continue;
}
char const * const letptr = &fontptr[name[i]<<3];
videoBeginDrawing(); //{{{
char *ptr = (char *)(bytesperline*ypos + (stx-(fontsize&1)) + frameplace);
int const trans = (obackcol < -1);
if (trans && backcol < 0)
backcol = -backcol;
if (backcol >= 0)
{
for (bssize_t y=ymin; y<=ymax; y++)
{
for (bssize_t x=0; x<charxsiz; x++)
{
if ((unsigned) (stx+x) >= (unsigned)xdim || ptr < (char *) frameplace) break;
ptr[x] = (letptr[y] & pow2char[7 - (fontsize & 1) - x]) ?
(uint8_t)col :
trans ? (uint8_t)blendtable[0][(ptr[x] * 256) + backcol] : backcol;
}
ptr += bytesperline;
}
}
else
{
for (bssize_t y=ymin; y<=ymax; y++)
{
for (bssize_t x=0; x<charxsiz; x++)
{
if ((unsigned) (stx+x) >= (unsigned)xdim || ptr < (char *) frameplace) break;
if (letptr[y]&pow2char[7-(fontsize&1)-x]) ptr[x] = (uint8_t) col;
}
ptr += bytesperline;
}
}
videoEndDrawing(); //}}}
stx += charxsiz;
if (stx >= xdim)
break;
}
return stx;
}
//
// printext256

View file

@ -669,44 +669,6 @@ static void G_PrintCoords(int32_t snum)
printext256(x, y+72, COLOR_WHITE, -1, tempbuf, 0);
}
static void G_ShowCacheLocks(void)
{
if (offscreenrendering)
return;
int k = 0;
if (k < ydim-12)
k += 6;
if (k >= ydim-12 && k<ydim-6)
printext256(0, k, COLOR_WHITE, -1, "(MORE . . .)", 1);
// sounds
if (xdim < 640)
return;
k = 0;
for (int i=0; i<=g_highestSoundIdx; i++)
{
if (g_sounds[i].num > 0)
{
for (int j = 0, n = g_sounds[i].num; j < n; j++)
{
if (k >= ydim-12)
return;
Bsprintf(tempbuf, "snd %d_%d: voice %d, ow %d", i, j, g_sounds[i].voices[j].id, g_sounds[i].voices[j].owner);
printext256(160, k, COLOR_WHITE, -1, tempbuf, 1);
k += 6;
}
}
}
}
#define LOW_FPS ((videoGetRenderMode() == REND_CLASSIC) ? 35 : 50)
#define SLOW_FRAME_TIME 20
@ -1213,8 +1175,6 @@ void G_DisplayRest(int32_t smoothratio)
if (buttonMap.ButtonDown(gamefunc_Show_DukeMatch_Scores))
G_ShowScores();
if (g_Debug)
G_ShowCacheLocks();
#ifdef LUNATIC
El_DisplayErrors();

View file

@ -664,44 +664,6 @@ static void G_PrintCoords(int32_t snum)
printext256(x, y+90, COLOR_WHITE, -1, tempbuf, 0);
}
static void G_ShowCacheLocks(void)
{
int16_t i, k;
if (offscreenrendering)
return;
k = 0;
if (k < ydim-12)
k += 6;
if (k >= ydim-12 && k<ydim-6)
printext256(0, k, COLOR_WHITE, -1, "(MORE . . .)", 1);
// sounds
if (xdim < 640)
return;
k = 18;
for (i=0; i<=g_highestSoundIdx; i++)
if (g_sounds[i].num > 0)
{
int32_t j, n=g_sounds[i].num;
for (j=0; j<n; j++)
{
if (k >= ydim-12)
break;
Bsprintf(tempbuf, "snd #%d inst %d: voice %d, ow %d", i, j,
g_sounds[i].voices[j].id, g_sounds[i].voices[j].owner);
printext256(240, k, COLOR_WHITE, -1, tempbuf, 0);
k += 9;
}
}
}
#define LOW_FPS 30
#define SLOW_FRAME_TIME 33
@ -1223,9 +1185,6 @@ void G_DisplayRest(int32_t smoothratio)
if (buttonMap.ButtonDown(gamefunc_Show_DukeMatch_Scores))
G_ShowScores();
if (g_Debug)
G_ShowCacheLocks();
Net_DisplaySyncMsg();
#ifndef EDUKE32_TOUCH_DEVICES