- removed some inactive pieces of code.

This commit is contained in:
Christoph Oelckers 2020-07-28 00:05:56 +02:00
parent 92d94543e5
commit e345bf389f
6 changed files with 11 additions and 111 deletions

View file

@ -358,38 +358,13 @@ void PreloadCache(void)
if (videoGetRenderMode() < REND_POLYMOST)
tileLoad(i);
#ifdef USE_OPENGL
if (r_precache) PrecacheHardwareTextures(i);
#endif
if ((++cnt & 7) == 0)
gameHandleEvents();
#if 0
if (videoGetRenderMode() != REND_CLASSIC && totalclock - clock > (kTicRate>>2))
{
int const percentComplete = min(100, Scale(100 * cnt, nPrecacheCount));
// this just prevents the loading screen percentage bar from making large jumps
while (percentDisplayed < percentComplete)
{
gameHandleEvents();
Bsprintf(tempbuf, "Loaded %d%% (%d/%d textures)\n", percentDisplayed, cnt, nPrecacheCount);
viewLoadingScreenUpdate(tempbuf, percentDisplayed);
videoNextPage();
if (totalclock - clock >= 1)
{
clock = totalclock;
percentDisplayed++;
}
}
clock = totalclock;
}
#endif
}
}
memset(gotpic,0,sizeof(gotpic));
}
@ -403,28 +378,6 @@ void EndLevel(void)
seqKillAll();
}
#ifdef POLYMER
void G_RefreshLights(void)
{
if (Numsprites && videoGetRenderMode() == REND_POLYMER)
{
int statNum = 0;
do
{
int spriteNum = headspritestat[statNum++];
while (spriteNum >= 0)
{
actDoLight(spriteNum);
spriteNum = nextspritestat[spriteNum];
}
}
while (statNum < MAXSTATUS);
}
}
#endif // POLYMER
PLAYER gPlayerTemp[kMaxPlayers];
int gHealthTemp[kMaxPlayers];
@ -717,22 +670,7 @@ void LocalKeys(void)
buttonMap.ClearButton(gamefunc_Third_Person_View);
return;
}
#if 0
switch (key)
{
case sc_kpad_Period:
case sc_Delete:
if (ctrl && alt)
{
gQuitGame = 1; // uh, what?
return;
}
break;
case default:
break;
}
#endif
}
}
bool gRestartGame = false;
@ -950,7 +888,7 @@ int GameInterface::app_main()
HookReplaceFunctions();
Printf("Initializing Build 3D engine\n");
scrInit();
engineInit();
Printf("Loading tiles\n");
if (pUserTiles)
@ -997,7 +935,7 @@ int GameInterface::app_main()
Printf("Initializing network users\n");
netInitialize(true);
scrSetGameMode(0, 0, 0, 0);
videoInit();
hud_size.Callback();
Printf("Initializing sound system\n");
sndInit();
@ -1050,7 +988,7 @@ RESTART:
{
bool bDraw;
D_ProcessEvents();
if (gGameStarted)
if (gGameStarted) // gGameStarted: gameState == GS_LEVEL
{
char gameUpdate = false;
double const gameUpdateStartTime = timerGetHiTicks();
@ -1099,8 +1037,9 @@ RESTART:
}
}
}
else
else // gameState == GS_DEMOSCREEN
{
// Menu background
bDraw = G_FPSLimit() != 0;
if (bDraw)
{
@ -1169,20 +1108,8 @@ RESTART:
gRestartGame = 0;
gGameStarted = 0;
levelSetupOptions(0,0);
#if 0
// What's this loop for? Needs checking
while (gGameMenuMgr.m_bActive)
{
gGameMenuMgr.Process();
if (G_FPSLimit())
{
gameHandleEvents();
videoClearScreen(0);
gGameMenuMgr.Draw();
videoNextPage();
}
}
#endif
if (gGameOptions.nGameType != 0)
{
videoSetViewableArea(0,0,xdim-1,ydim-1);

View file

@ -155,6 +155,7 @@ void sub_2541C(int x, int y, int z, short a)
GetSpriteExtents(pSprite, &nTop, &nBottom);
int nScale = mulscale((pSprite->yrepeat+((floorZ-nBottom)>>8))*z, yxaspect, 16);
nScale = ClipRange(nScale, 8000, 65536<<1);
// Players on automap
rotatesprite((xdim<<15)+(x1<<4), (ydim<<15)+(y1<<4), nScale, pa, nTile, pSprite->shade, pSprite->pal, (pSprite->cstat&2)>>1,
windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
}

View file

@ -342,10 +342,6 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int
{
renderPrepareMirror(x,y,z,a,horiz,nWall,&cx,&cy,&ca);
}
#ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER)
polymer_setanimatesprites(viewProcessSprites, cx, cy, z, fix16_to_int(ca), smooth);
#endif
yax_preparedrawrooms();
int32_t didmirror = renderDrawRoomsQ16(cx, cy, z, ca,horiz,mirrorsector|MAXSECTORS);
yax_drawrooms(viewProcessSprites, mirrorsector, didmirror, smooth);
@ -378,10 +374,6 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int
gPlayer[viewPlayer].pSprite->cstat |= 514;
}
}
#ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER)
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
#endif
yax_preparedrawrooms();
renderDrawRoomsQ16(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, a, horiz, nSector|MAXSECTORS);
yax_drawrooms(viewProcessSprites, nSector, 0, smooth);
@ -420,10 +412,6 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int
gPlayer[viewPlayer].pSprite->cstat |= 514;
}
}
#ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER)
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
#endif
yax_preparedrawrooms();
renderDrawRoomsQ16(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, a, horiz, nSector|MAXSECTORS);
yax_drawrooms(viewProcessSprites, nSector, 0, smooth);

View file

@ -119,18 +119,4 @@ void scrSetPalette(int palId)
curPalette = palId;
}
void scrInit(void)
{
glrendmode = REND_POLYMOST;
engineInit();
curPalette = 0;
}
void scrSetGameMode(int vidMode, int XRes, int YRes, int nBits)
{
videoInit();
videoClearViewableArea(0);
videoNextPage();
}
END_BLD_NS

View file

@ -36,13 +36,9 @@ struct RGB {
#pragma pack(pop)
extern bool gFogMode;
void scrCreateStdColors(void);
void scrResetPalette(void);
void scrLoadPLUs(void);
void scrLoadPalette(void);
void scrSetPalette(int palId);
void scrSetGamma(int nGamma);
void scrInit(void);
void scrSetGameMode(int vidMode, int XRes, int YRes, int nBits);
END_BLD_NS

View file

@ -1051,6 +1051,7 @@ void viewDrawText(int nFont, const char *pString, int x, int y, int nShade, int
}
}
// for the screen border
void viewTileSprite(int nTile, int nShade, int nPalette, int x1, int y1, int x2, int y2)
{
Rect rect1 = Rect(x1, y1, x2, y2);
@ -2843,6 +2844,7 @@ struct {
{ 2101, 2, 0, 122880, 310, 220 }
};
// PSP
void viewBurnTime(int gScale)
{
if (!gScale) return;