SW: Update calls to functions that have been renamed.

Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@7509 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-04-08 06:26:36 +00:00 committed by Christoph Oelckers
parent 864ab5cac5
commit b242259be1
21 changed files with 209 additions and 200 deletions

View file

@ -243,7 +243,7 @@ unsigned char *LoadAnm(short anim_num)
return NULL;
length = kfilelength(handle);
allocache((intptr_t *) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]);
cacheAllocateBlock((intptr_t *) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]);
animbuf = (unsigned char *)((intptr_t)anm_ptr[anim_num] + sizeof(anim_t));
kread(handle, animbuf, length);
@ -299,14 +299,15 @@ playanm(short anim_num)
tilesiz[ANIM_TILE(ANIMnum)].x = 200;
tilesiz[ANIM_TILE(ANIMnum)].y = 320;
clearview(0);
videoClearViewableArea(0L);
setbrightness(gs.Brightness,ANIMvesapal,2);
paletteSetColorTable(0, ANIMvesapal);
videoSetPalette(gs.Brightness,0,2);
if (ANIMnum == 1)
{
// draw the first frame
waloff[ANIM_TILE(ANIMnum)] = (intptr_t)ANIM_DrawFrame(1);
invalidatetile(ANIM_TILE(ANIMnum), 0, 1<<4);
tileInvalidate(ANIM_TILE(ANIMnum), 0, 1<<4);
rotatesprite(0 << 16, 0 << 16, 65536L, 512, ANIM_TILE(ANIMnum), 0, 0, 2 + 4 + 8 + 16 + 64, 0, 0, xdim - 1, ydim - 1);
}
@ -353,10 +354,10 @@ playanm(short anim_num)
}
waloff[ANIM_TILE(ANIMnum)] = (intptr_t)ANIM_DrawFrame(i);
invalidatetile(ANIM_TILE(ANIMnum), 0, 1<<4);
tileInvalidate(ANIM_TILE(ANIMnum), 0, 1<<4);
rotatesprite(0 << 16, 0 << 16, 65536L, 512, ANIM_TILE(ANIMnum), 0, 0, 2 + 4 + 8 + 16 + 64, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
}
// pause on final frame
@ -368,10 +369,12 @@ playanm(short anim_num)
ENDOFANIMLOOP:
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
palookup[0] = palook_bak;
setbrightness(gs.Brightness, (unsigned char *)palette_data, 2);
paletteSetColorTable(0, (unsigned char *)palette_data);
videoSetPalette(gs.Brightness, 0, 2);
KB_FlushKeyboardQueue();
KB_ClearKeysDown();

View file

@ -441,7 +441,7 @@ void BorderSetView(PLAYERp UNUSED(pp), int *Xdim, int *Ydim, int *ScreenSize)
}
// global windowxy1, windowxy2 coords set here
setview(x, y, x2, y2);
videoSetViewableArea(x, y, x2, y2);
SetCrosshair();
}

View file

@ -694,7 +694,7 @@ DrawOverlapRoom(int tx, int ty, int tz, short tang, int thoriz, short tsectnum)
}
drawrooms(tx, ty, tz, tang, thoriz, tsectnum);
drawmasks();
renderDrawMasks();
// reset Z's
for (i = 0; i < save.zcount; i++)
@ -719,7 +719,7 @@ DrawOverlapRoom(int tx, int ty, int tz, short tang, int thoriz, short tsectnum)
}
drawrooms(tx, ty, tz, tang, thoriz, tsectnum);
drawmasks();
renderDrawMasks();
// reset Z's
for (i = 0; i < save.zcount; i++)

View file

@ -630,7 +630,7 @@ void DoTheCache(void)
{
if ((TEST(gotpic[i>>3], 1<<(i&7))) && (!waloff[i]))
{
loadtile(i);
tileLoad(i);
cnt++;
if (!(cnt&7))
{

View file

@ -278,32 +278,32 @@ InitPalette(void)
for (i = 0; i < 256; i++)
tempbuf[i] = i;
// palette for underwater
makepalookup(PALETTE_DIVE, tempbuf, 0, 0, 60, TRUE);
paletteMakeLookupTable(PALETTE_DIVE, tempbuf, 0, 0, 60, TRUE);
#define FOG_AMT 60
for (i = 0; i < 256; i++)
tempbuf[i] = i;
makepalookup(PALETTE_FOG, tempbuf, FOG_AMT, FOG_AMT, FOG_AMT, TRUE);
paletteMakeLookupTable(PALETTE_FOG, tempbuf, FOG_AMT, FOG_AMT, FOG_AMT, TRUE);
for (i = 0; i < 256; i++)
tempbuf[i] = i;
makepalookup(PALETTE_DIVE_LAVA, tempbuf, 44, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_DIVE_LAVA, tempbuf, 44, 0, 0, TRUE);
//
// 1 Range changes
//
MapColors(PALETTE_BROWN_RIPPER, BrownRipper, TRUE);
makepalookup(PALETTE_BROWN_RIPPER, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_BROWN_RIPPER, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_SKEL_GORE, SkelGore, TRUE);
makepalookup(PALETTE_SKEL_GORE, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_SKEL_GORE, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_ELECTRO_GORE, ElectroGore, TRUE);
makepalookup(PALETTE_ELECTRO_GORE, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_ELECTRO_GORE, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_MENU_HIGHLIGHT, MenuHighlight, TRUE);
makepalookup(PALETTE_MENU_HIGHLIGHT, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_MENU_HIGHLIGHT, tempbuf, 0, 0, 0, TRUE);
//
// Multiple range changes
@ -312,44 +312,44 @@ InitPalette(void)
MapColors(PALETTE_BASIC_NINJA, NinjaBasic[0], TRUE);
for (i = 1; i < SIZ(NinjaBasic); i++)
MapColors(PALETTE_BASIC_NINJA, NinjaBasic[i], FALSE);
makepalookup(PALETTE_BASIC_NINJA, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_BASIC_NINJA, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_RED_NINJA, NinjaRed[0], TRUE);
for (i = 1; i < SIZ(NinjaRed); i++)
MapColors(PALETTE_RED_NINJA, NinjaRed[i], FALSE);
makepalookup(PALETTE_RED_NINJA, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_RED_NINJA, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_GREEN_NINJA, NinjaGreen[0], TRUE);
for (i = 1; i < SIZ(NinjaGreen); i++)
MapColors(PALETTE_GREEN_NINJA, NinjaGreen[i], FALSE);
makepalookup(PALETTE_GREEN_NINJA, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_GREEN_NINJA, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_GREEN_LIGHTING, AllToGreen[0], TRUE);
for (i = 1; i < SIZ(AllToGreen); i++)
MapColors(PALETTE_GREEN_LIGHTING, AllToGreen[i], FALSE);
makepalookup(PALETTE_GREEN_LIGHTING, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_GREEN_LIGHTING, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_RED_LIGHTING, AllToRed[0], TRUE);
for (i = 1; i < SIZ(AllToRed); i++)
MapColors(PALETTE_RED_LIGHTING, AllToRed[i], FALSE);
makepalookup(PALETTE_RED_LIGHTING, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_RED_LIGHTING, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_BLUE_LIGHTING, AllToBlue[0], TRUE);
for (i = 1; i < SIZ(AllToBlue); i++)
MapColors(PALETTE_BLUE_LIGHTING, AllToBlue[i], FALSE);
makepalookup(PALETTE_BLUE_LIGHTING, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_BLUE_LIGHTING, tempbuf, 0, 0, 0, TRUE);
MapColors(PALETTE_ILLUMINATE, Illuminate[0], TRUE);
for (i = 1; i < SIZ(Illuminate); i++)
MapColors(PALETTE_ILLUMINATE, Illuminate[i], FALSE);
makepalookup(PALETTE_ILLUMINATE, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_ILLUMINATE, tempbuf, 0, 0, 0, TRUE);
// PLAYER COLORS - ALSO USED FOR OTHER THINGS
for (play = 0; play < PLAYER_COLOR_MAPS; play++)
{
MapColors(PALETTE_PLAYER0 + play, PlayerColorMap[play][0], TRUE);
MapColors(PALETTE_PLAYER0 + play, PlayerColorMap[play][0], FALSE);
makepalookup(PALETTE_PLAYER0 + play, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_PLAYER0 + play, tempbuf, 0, 0, 0, TRUE);
}
//
@ -361,7 +361,7 @@ InitPalette(void)
// invert the brown palette
for (i = 0; i < 32; i++)
tempbuf[LT_BROWN + i] = (LT_BROWN + 32) - i;
makepalookup(PALETTE_SLUDGE, tempbuf, 0, 0, 0, TRUE);
paletteMakeLookupTable(PALETTE_SLUDGE, tempbuf, 0, 0, 0, TRUE);
}
@ -431,7 +431,8 @@ void SetPaletteToVESA(unsigned char *pal)
VBE_setPalette(0, 256, pal_buff);
*/
setbrightness(0,pal,4|2);
paletteSetColorTable(0, pal);
videoSetPalette(0,0,4|2);
// fprintf(stderr,"SetPaletteToVESA() called\n");
}

View file

@ -43,7 +43,7 @@ const char *G_DefFile(void)
void SW_InitMultiPsky(void)
{
// default
psky_t * const defaultsky = E_DefinePsky(DEFAULTPSKY);
psky_t * const defaultsky = tileSetupSky(DEFAULTPSKY);
defaultsky->lognumtiles = 1;
defaultsky->horizfrac = 8192;
}

View file

@ -555,7 +555,7 @@ int32_t CONFIG_ReadSetup(void)
CONTROL_ClearAssignments();
CONFIG_SetDefaults();
if (SafeFileExists(setupfilename))
if (buildvfs_exists(setupfilename))
scripthandle = SCRIPT_Load(setupfilename);
if (scripthandle < 0) return -1;

View file

@ -1545,7 +1545,8 @@ int COVERsetgamemode(int mode, int xdim, int ydim, int bpp)
ScreenMode = mode;
ScreenBPP = bpp;
return (int)setgamemode(mode,xdim,ydim,bpp);
// [JM] Should I be using upscalefactor here, or some SW equivalent to Duke's ud.detail? !CHECKME!
return (int)videoSetGameMode(mode,xdim,ydim,bpp,upscalefactor);
}
void CheatResChange(void)
@ -1674,7 +1675,7 @@ void ScreenCaptureKeys(void)
{
KEY_PRESSED(KEYSC_F12) = 0;
PauseAction();
screencapture("swcpxxxx.tga", KEY_PRESSED(KEYSC_LSHIFT) | KEY_PRESSED(KEYSC_RSHIFT));
videoCaptureScreenTGA("swcpxxxx.tga", KEY_PRESSED(KEYSC_LSHIFT) | KEY_PRESSED(KEYSC_RSHIFT));
ResumeAction();
PutStringInfo(Player + myconnectindex, "Screen Captured");
}
@ -2262,13 +2263,13 @@ drawscreen(PLAYERp pp)
if (HelpInputMode)
{
flushperms();
renderFlushPerms();
// note - could put Order Info Pages at the top like this also
rotatesprite(0,0,65536L,0,HelpPagePic[HelpPage],0,0,
(ROTATE_SPRITE_CORNER|ROTATE_SPRITE_SCREEN_CLIP|ROTATE_SPRITE_NON_MASK|ROTATE_SPRITE_IGNORE_START_MOST),
0, 0, xdim-1, ydim-1);
nextpage();
videoNextPage();
return;
}
@ -2289,7 +2290,7 @@ drawscreen(PLAYERp pp)
}
#endif
if (getrendermode() >= 3)
if (videoGetRenderMode() >= REND_POLYMOST)
RedrawScreen = TRUE;
DrawScreen = TRUE;
@ -2300,7 +2301,7 @@ drawscreen(PLAYERp pp)
RedrawCompass = TRUE;
RedrawScreen = FALSE;
// get rid of all PERM sprites!
flushperms();
renderFlushPerms();
// get rid of all PANF_KILL_AFTER_SHOW sprites!
pFlushPerms(pp);
SetBorder(pp,gs.BorderNum);
@ -2420,7 +2421,7 @@ drawscreen(PLAYERp pp)
}
if (FAF_DebugView)
clearview(255);
videoClearViewableArea(255L);
OverlapDraw = TRUE;
DrawOverlapRoom(tx, ty, tz, tang, thoriz, tsectnum);
@ -2441,7 +2442,7 @@ drawscreen(PLAYERp pp)
analyzesprites(tx, ty, tz, FALSE);
post_analyzesprites();
drawmasks();
renderDrawMasks();
UpdatePanel();
@ -2499,8 +2500,8 @@ drawscreen(PLAYERp pp)
if (dimensionmode == 6)
{
clearview(0L);
drawmapview(tx, ty, zoom, tang);
videoClearViewableArea(0L);
renderDrawMapView(tx, ty, zoom, tang);
}
// Draw the line map on top of texture 2d map or just stand alone
@ -2555,7 +2556,7 @@ drawscreen(PLAYERp pp)
else
SecretInfo(pp);
nextpage();
videoNextPage();
#if SYNC_TEST
SyncStatMessage();
@ -2689,7 +2690,7 @@ ScreenLoadSaveSetup(PLAYERp pp)
ScreenTileLock();
if (!waloff[SAVE_SCREEN_TILE])
allocache((intptr_t*)&waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, &walock[SAVE_SCREEN_TILE]);
cacheAllocateBlock((intptr_t*)&waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, &walock[SAVE_SCREEN_TILE]);
tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_XSIZE;
tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_YSIZE;
@ -2704,13 +2705,13 @@ ScreenSaveSetup(PLAYERp pp)
ScreenLoadSaveSetup(Player + myconnectindex);
setviewtotile(SAVE_SCREEN_TILE, SAVE_SCREEN_YSIZE, SAVE_SCREEN_XSIZE);
renderSetTarget(SAVE_SCREEN_TILE, SAVE_SCREEN_YSIZE, SAVE_SCREEN_XSIZE);
ScreenSavePic = TRUE;
drawscreen(Player + myconnectindex);
ScreenSavePic = FALSE;
setviewback();
renderRestoreTarget();
return SAVE_SCREEN_TILE;
}

View file

@ -676,13 +676,13 @@ TerminateGame(void)
//uninitkeys();
KB_Shutdown();
uninitengine();
engineUnInit();
TermSetup();
//Terminate3DSounds(); // Kill the sounds linked list
UnInitSound();
uninittimer();
timerUninit();
if (CleanExit)
DosScreen();
@ -695,7 +695,7 @@ LoadLevel(const char *filename)
{
int pos;
if (loadboard(filename, SW_SHAREWARE ? 1 : 0, (vec3_t *)&Player[0], &Player[0].pang, &Player[0].cursectnum) == -1)
if (engineLoadBoard(filename, SW_SHAREWARE ? 1 : 0, (vec3_t *)&Player[0], &Player[0].pang, &Player[0].cursectnum) == -1)
{
TerminateGame();
#ifdef RENDERTYPEWIN
@ -717,7 +717,7 @@ LoadImages(const char *filename)
short ndx;
FILE *fin;
if (loadpics(filename, 32*1048576) == -1)
if (artLoadFiles(filename, 32*1048576) == -1)
{
TerminateGame();
#ifdef RENDERTYPEWIN
@ -803,10 +803,10 @@ void Set_GameMode(void)
uninitmultiplayers();
//uninitkeys();
KB_Shutdown();
uninitengine();
engineUnInit();
TermSetup();
UnInitSound();
uninittimer();
timerUninit();
DosScreen();
uninitgroupfile();
exit(0);
@ -830,10 +830,10 @@ void MultiSharewareCheck(void)
uninitmultiplayers();
//uninitkeys();
KB_Shutdown();
uninitengine();
engineUnInit();
TermSetup();
UnInitSound();
uninittimer();
timerUninit();
uninitgroupfile();
exit(0);
}
@ -889,7 +889,8 @@ void AnimateCacheCursor(void)
void COVERsetbrightness(int bright, unsigned char *pal)
{
setbrightness(bright, pal, 0);
paletteSetColorTable(0, pal);
videoSetPalette(bright, 0, 0);
}
@ -915,7 +916,7 @@ InitGame(int32_t argc, char const * const * argv)
DSPRINTF(ds,"InitGame...");
MONO_PRINT(ds);
if (initengine())
if (engineInit())
SW_FatalEngineError();
//initgroupfile(G_GrpFile()); // JBF: moving this close to start of program to detect shareware
@ -923,7 +924,7 @@ InitGame(int32_t argc, char const * const * argv)
InitAutoNet();
inittimer(120);
timerInit(120);
CON_InitConsole(); // Init console command list
@ -1036,7 +1037,7 @@ InitGame(int32_t argc, char const * const * argv)
free(m);
g_defModules.clear();
if (E_PostInit())
if (enginePostInit())
SW_FatalEngineError();
DemoModeMenuInit = TRUE;
@ -1739,7 +1740,9 @@ LogoLevel(void)
{
kread(fin, pal, PAL_SIZE);
kclose(fin);
setbrightness(gs.Brightness, pal, 2);
paletteSetColorTable(1, pal);
videoSetPalette(gs.Brightness, 1, 2);
}
DSPRINTF(ds,"Just read in 3drealms.pal...");
MONO_PRINT(ds);
@ -1752,9 +1755,9 @@ LogoLevel(void)
DSPRINTF(ds,"About to display 3drealms pic...");
MONO_PRINT(ds);
clearview(0);
videoClearViewableArea(0L);
rotatesprite(0, 0, RS_SCALE, 0, THREED_REALMS_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
//FadeIn(0, 3);
ResetKeys();
@ -1780,10 +1783,11 @@ LogoLevel(void)
palookup[0] = palook_bak;
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
//SetPaletteToVESA(backup_pal);
setbrightness(gs.Brightness, &palette_data[0][0], 2);
paletteSetColorTable(0, &palette_data[0][0]);
videoSetPalette(gs.Brightness, 0, 2);
// put up a blank screen while loading
@ -1809,13 +1813,13 @@ CreditsLevel(void)
// put up a blank screen while loading
// get rid of all PERM sprites!
flushperms();
renderFlushPerms();
save = gs.BorderNum;
SetBorder(Player + myconnectindex,0);
ClearStartMost();
gs.BorderNum = save;
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
// Lo Wang feel like singing!
handle = PlaySound(DIGI_JG95012,&zero,&zero,&zero,v3df_none);
@ -1854,7 +1858,7 @@ CreditsLevel(void)
rotatesprite(0, 0, RS_SCALE, 0, curpic, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
if (timer > 8*120)
{
@ -1876,8 +1880,8 @@ CreditsLevel(void)
}
// put up a blank screen while loading
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
ResetKeys();
StopSong();
}
@ -1892,7 +1896,7 @@ SybexScreen(void)
return;
rotatesprite(0, 0, RS_SCALE, 0, 5261, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
ResetKeys();
while (!KeyPressed() && !quitevent) handleevents();
@ -1987,8 +1991,8 @@ TitleLevel(void)
//GetPaletteFromVESA(pal);
//memcpy(backup_pal, pal, PAL_SIZE);
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
// if ((fin = kopen4load("title.pal", 0)) != -1)
// {
@ -2006,7 +2010,7 @@ TitleLevel(void)
ototalclock = 0;
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
//FadeIn(0, 3);
ResetKeys();
@ -2031,7 +2035,7 @@ TitleLevel(void)
//drawscreen as fast as you can
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
if (totalclock > 5*120 || KeyPressed())
{
@ -2055,22 +2059,22 @@ TitleLevel(void)
void DrawMenuLevelScreen(void)
{
flushperms();
clearview(0);
renderFlushPerms();
videoClearViewableArea(0L);
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
}
void DrawStatScreen(void)
{
flushperms();
clearview(0);
renderFlushPerms();
videoClearViewableArea(0L);
rotatesprite(0, 0, RS_SCALE, 0, STAT_SCREEN_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
}
void DrawLoadLevelScreen(void)
{
flushperms();
clearview(0);
renderFlushPerms();
videoClearViewableArea(0L);
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
}
@ -2116,7 +2120,7 @@ MenuLevel(void)
MNU_DrawString(TEXT_TEST_COL(w), 180, ds, 1, 16);
}
nextpage();
videoNextPage();
waitforeverybody();
FirstTimeIntoGame = TRUE;
@ -2146,8 +2150,8 @@ MenuLevel(void)
DemoMode = FALSE;
DemoPlaying = FALSE;
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
//FadeOut(0, 0);
ready2send = 0;
@ -2169,7 +2173,7 @@ MenuLevel(void)
MNU_DrawString(TEXT_TEST_COL(w), 180, ds, 1, 16);
}
nextpage();
videoNextPage();
//FadeIn(0, 3);
waitforeverybody();
@ -2259,7 +2263,7 @@ MenuLevel(void)
if (UsingMenus)
MNU_DrawMenu();
nextpage();
videoNextPage();
}
BorderAdjust = TRUE;
@ -2269,8 +2273,8 @@ MenuLevel(void)
//ExitMenus();
UsingMenus = FALSE;
InMenuLevel = FALSE;
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
}
void
@ -2328,7 +2332,7 @@ LoadingLevelScreen(char *level_name)
MNU_MeasureString(ds, &w, &h);
MNU_DrawString(TEXT_TEST_COL(w), 180, ds,1,16);
nextpage();
videoNextPage();
}
void
@ -2502,8 +2506,8 @@ BonusScreen(PLAYERp pp)
if (Level < 0) Level = 0;
clearview(0);
nextpage();
videoClearViewableArea(0L);
videoNextPage();
KB_ClearKeysDown();
@ -2518,10 +2522,10 @@ BonusScreen(PLAYERp pp)
// special case code because I don't care any more!
if (FinishAnim)
{
flushperms();
renderFlushPerms();
rotatesprite(0, 0, RS_SCALE, 0, 5120, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
rotatesprite(158<<16, 86<<16, RS_SCALE, 0, State->Pic, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
nextpage();
videoNextPage();
FadeIn(0,0);
}
@ -2612,7 +2616,7 @@ BonusScreen(PLAYERp pp)
MNU_MeasureString(ds, &w, &h);
MNU_DrawString(TEXT_TEST_COL(w), 185, ds,1,19);
nextpage();
videoNextPage();
ScreenCaptureKeys();
if (State == State->NextState)
@ -2712,7 +2716,7 @@ StatScreen(PLAYERp mpp)
return;
}
flushperms();
renderFlushPerms();
DrawStatScreen();
memset(death_total,0,sizeof(death_total));
@ -2818,7 +2822,7 @@ StatScreen(PLAYERp mpp)
y += STAT_OFF_Y;
}
nextpage();
videoNextPage();
if (KeyPressed())
{
@ -3550,7 +3554,7 @@ int32_t app_main(int32_t argc, char const * const * argv)
}
wm_setapptitle("Shadow Warrior");
if (preinitengine())
if (enginePreInit())
{
wm_msgbox("Build Engine Initialisation Error",
"There was a problem initialising the Build engine: %s", engineerrstr);
@ -3564,7 +3568,7 @@ int32_t app_main(int32_t argc, char const * const * argv)
{
if (quitevent || !startwin_run())
{
uninitengine();
engineUnInit();
exit(0);
}
}
@ -5570,7 +5574,7 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect);
y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2);
drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), col);
renderDrawLine(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), col);
}
}
@ -5637,12 +5641,12 @@ SHOWSPRITE:
x3 = mulscale16(x2, yxaspect);
y3 = mulscale16(y2, yxaspect);
drawline256(x1 - x2 + (xdim << 11), y1 - y3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
drawline256(x1 - y2 + (xdim << 11), y1 + x3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
drawline256(x1 + y2 + (xdim << 11), y1 - x3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
renderDrawLine(x1 - x2 + (xdim << 11), y1 - y3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
renderDrawLine(x1 - y2 + (xdim << 11), y1 + x3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
renderDrawLine(x1 + y2 + (xdim << 11), y1 - x3 + (ydim << 11),
x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col);
}
else
{
@ -5699,8 +5703,8 @@ SHOWSPRITE:
x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect);
y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2);
drawline256(x1 + (xdim << 11), y1 + (ydim << 11),
x2 + (xdim << 11), y2 + (ydim << 11), col);
renderDrawLine(x1 + (xdim << 11), y1 + (ydim << 11),
x2 + (xdim << 11), y2 + (ydim << 11), col);
break;
case 32: // Floor sprite
@ -5757,17 +5761,17 @@ SHOWSPRITE:
x4 = mulscale16(ox, xvect) - mulscale16(oy, yvect);
y4 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2);
drawline256(x1 + (xdim << 11), y1 + (ydim << 11),
x2 + (xdim << 11), y2 + (ydim << 11), col);
renderDrawLine(x1 + (xdim << 11), y1 + (ydim << 11),
x2 + (xdim << 11), y2 + (ydim << 11), col);
drawline256(x2 + (xdim << 11), y2 + (ydim << 11),
x3 + (xdim << 11), y3 + (ydim << 11), col);
renderDrawLine(x2 + (xdim << 11), y2 + (ydim << 11),
x3 + (xdim << 11), y3 + (ydim << 11), col);
drawline256(x3 + (xdim << 11), y3 + (ydim << 11),
x4 + (xdim << 11), y4 + (ydim << 11), col);
renderDrawLine(x3 + (xdim << 11), y3 + (ydim << 11),
x4 + (xdim << 11), y4 + (ydim << 11), col);
drawline256(x4 + (xdim << 11), y4 + (ydim << 11),
x1 + (xdim << 11), y1 + (ydim << 11), col);
renderDrawLine(x4 + (xdim << 11), y4 + (ydim << 11),
x1 + (xdim << 11), y1 + (ydim << 11), col);
}
break;
@ -5804,7 +5808,7 @@ SHOWSPRITE:
x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect);
y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2);
drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), 24);
renderDrawLine(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), 24);
}
}

View file

@ -627,10 +627,10 @@ DoPlayerNightVisionPalette(PLAYERp pp)
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
memcpy(palookup[PALETTE_DEFAULT], DefaultPalette, 256 * 32);
pp->FadeAmt = 0;
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness, &palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
}
pp->NightVision = FALSE;
}

View file

@ -752,14 +752,14 @@ ExtInit(void)
Bmemcpy((void *)buildkeys,(void *)default_buildkeys,NUMBUILDKEYS); //Trick to make build use setup.dat keys
if (option[4] > 0)
option[4] = 0;
if (initengine())
if (engineInit())
{
wm_msgbox("Build Engine Initialisation Error",
"There was a problem initialising the Build engine: %s", engineerrstr);
return -1;
}
initinput();
initmouse();
mouseInit();
InitPalette();
SW_InitMultiPsky();
@ -2769,13 +2769,13 @@ DrawClipBox(short spritenum)
#define BOX_COLOR 3
// upper
drawline16(x - radius, y - radius, x + radius, y - radius, BOX_COLOR);
editorDraw2dLine(x - radius, y - radius, x + radius, y - radius, BOX_COLOR);
// lower
drawline16(x - radius, y + radius, x + radius, y + radius, BOX_COLOR);
editorDraw2dLine(x - radius, y + radius, x + radius, y + radius, BOX_COLOR);
// left
drawline16(x - radius, y - radius, x - radius, y + radius, BOX_COLOR);
editorDraw2dLine(x - radius, y - radius, x - radius, y + radius, BOX_COLOR);
// right
drawline16(x + radius, y - radius, x + radius, y + radius, BOX_COLOR);
editorDraw2dLine(x + radius, y - radius, x + radius, y + radius, BOX_COLOR);
}
void
@ -3017,7 +3017,7 @@ ExtEditSpriteData(short spritenum) // F8
printext16(8, ydim16+32 + 8, 11, -1, "(2) Multi-Player Item Toggle", 0);
printext16(8, ydim16+32 + 16, 11, -1, "(3) Find Sprite", 0);
printext16(8, ydim16+32 + 24, 11, -1, "(4) Dbug Toggle (* Programming use only *) ", 0);
showframe(1);
videoShowFrame(1);
while (KEY_PRESSED(KEYSC_F8)) handleevents();
@ -3074,7 +3074,7 @@ DISPLAY:
printext16(8 + 240, ydim16+32 + 32, 11, -1, "TRUE", 0);
else
printext16(8 + 240, ydim16+32 + 32, 11, -1, "FALSE", 0);
showframe(1);
videoShowFrame(1);
// Disallow invalid settings
if (!bFindPicNum && !bFindHiTag && !bFindLowTag)
@ -3619,7 +3619,7 @@ ShadeMenu(void) // F8
void faketimerhandler(void)
{
sampletimer();
timerUpdate();
}
//Just thought you might want my getnumber16 code

View file

@ -488,21 +488,21 @@ void drawroomstotile(int daposx, int daposy, int daposz,
short daang, int dahoriz, short dacursectnum, short tilenume)
{
if (waloff[tilenume] == 0)
loadtile(tilenume);
tileLoad(tilenume);
PRODUCTION_ASSERT(waloff[tilenume]);
setviewtotile(tilenume, tilesiz[tilenume].x, tilesiz[tilenume].y);
renderSetTarget(tilenume, tilesiz[tilenume].x, tilesiz[tilenume].y);
drawrooms(daposx, daposy, daposz, daang, dahoriz, dacursectnum);
analyzesprites(daposx, daposy, daposz, FALSE);
drawmasks();
renderDrawMasks();
setviewback();
renderRestoreTarget();
squarerotatetile(tilenume);
invalidatetile(tilenume, -1, -1);
tileInvalidate(tilenume, -1, -1);
}
#else
void
@ -542,7 +542,7 @@ drawroomstotile(int daposx, int daposy, int daposz,
// DRAWS TO TILE HERE
drawrooms(daposx, daposy, daposz, daang, dahoriz, dacursectnum + MAXSECTORS);
analyzesprites(daposx, daposy, daposz, FALSE);
drawmasks();
renderDrawMasks();
setviewback();
@ -647,7 +647,7 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
int tposx, tposy, thoriz;
int tcx, tcy, tcz; // Camera
int tiltlock, *longptr;
short tang;
fix16_t tang;
char ch, *ptr, *ptr2, *ptr3, *ptr4;
char tvisibility, palok;
@ -791,7 +791,7 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
tilesiz[mirror[cnt].campic].x = tilesiz[mirror[cnt].campic].y = 0;
drawrooms(dx, dy, dz, tpang, tphoriz, sp->sectnum + MAXSECTORS);
analyzesprites(dx, dy, dz, FALSE);
drawmasks();
renderDrawMasks();
}
else
{
@ -889,15 +889,15 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
// Must call preparemirror before drawrooms and
// completemirror after drawrooms
preparemirror(tx, ty, /*tz,*/ tpang, /*tphoriz,*/
renderPrepareMirror(tx, ty, /*tz,*/ fix16_from_int(tpang), /*tphoriz,*/
mirror[cnt].mirrorwall, /*mirror[cnt].mirrorsector,*/ &tposx, &tposy, &tang);
drawrooms(tposx, tposy, tz, tang, tphoriz, mirror[cnt].mirrorsector + MAXSECTORS);
drawrooms(tposx, tposy, tz, fix16_to_int(tang), tphoriz, mirror[cnt].mirrorsector + MAXSECTORS);
analyzesprites(tposx, tposy, tz, TRUE);
drawmasks();
renderDrawMasks();
completemirror(); // Reverse screen x-wise in this
renderCompleteMirror(); // Reverse screen x-wise in this
// function
}
@ -1081,7 +1081,7 @@ JAnalyzeSprites(uspritetype * tspr)
// Take care of autosizing
DoAutoSize(tspr);
if (getrendermode() == 3 && md_tilehasmodel(tspr->picnum, 0) >= 0 && usemodels) return;
if (videoGetRenderMode() >= REND_POLYMOST && md_tilehasmodel(tspr->picnum, 0) >= 0 && usemodels) return;
// Check for voxels
//if (bVoxelsOn)

View file

@ -170,8 +170,8 @@ static SWBOOL ApplyModeSettings(void)
if (lastx == newx && lasty == newy && lastbpp == newbpp && lastfs == newfs) return FALSE;
if (setgamemode(newfs, newx, newy, newbpp))
setgamemode(lastfs, lastx, lasty, lastbpp);
if (videoSetGameMode(newfs, newx, newy, newbpp, upscalefactor))
videoSetGameMode(lastfs, lastx, lasty, lastbpp, upscalefactor);
else
{
extern int32_t ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP; // Because I'm too lazy to include config.h
@ -741,8 +741,8 @@ MNU_ParentalCustom(void)
// clear keyboard buffer
while (KB_KeyWaiting())
{
if (KB_Getch() == 0)
KB_Getch();
if (KB_GetCh() == 0)
KB_GetCh();
}
// toggle edit mode
@ -925,14 +925,14 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
j = OPT_LINE(0)+(i-topitem)*8;
MNU_DrawSmallString(OPT_XS, j, ds, (i==currentkey) ? 0 : 12, 16);
p = getkeyname(KeyboardKeys[i][0]);
p = keyGetName(KeyboardKeys[i][0]);
if (!p || KeyboardKeys[i][0]==0xff) p = " -";
MNU_DrawSmallString(OPT_XSIDE, j, (char *)p, (i==currentkey) ? -5 : 12,
(i==currentkey && currentcol==0) ? 14 : 16);
if (i == gamefunc_Show_Console) continue;
p = getkeyname(KeyboardKeys[i][1]);
p = keyGetName(KeyboardKeys[i][1]);
if (!p || KeyboardKeys[i][1]==0xff) p = " -";
MNU_DrawSmallString(OPT_XSIDE + 4*14, j, (char *)p, (i==currentkey) ? -5 : 12,
(i==currentkey && currentcol==1) ? 14 : 16);
@ -1274,13 +1274,13 @@ static SWBOOL MNU_JoystickButtonsInitialise(MenuItem_p mitem)
joybuttonssetupgroup.items = joybuttons_i[0];
item = &joybuttons_i[0][0];
for (button = 0; button < joynumbuttons * 2 + (joynumhats > 0) * 4; )
for (button = 0; button < joystick.numButtons * 2 + (joystick.numHats > 0) * 4; )
{
if (button < joynumbuttons * 2)
if (button < joystick.numButtons * 2)
{
int dbutton = button / 2;
strcpy(JoystickButtonNames[dbutton], getjoyname(1, dbutton));
strcpy(JoystickButtonNames[dbutton], joyGetName(1, dbutton));
templayer.text = JoystickButtonNames[dbutton];
templayer.y = OPT_LINE(pageitem);
@ -1297,7 +1297,7 @@ static SWBOOL MNU_JoystickButtonsInitialise(MenuItem_p mitem)
pageitem++;
strcpy(JoystickButtonNames[dbutton + MAXJOYBUTTONS], "Double ");
strcat(JoystickButtonNames[dbutton + MAXJOYBUTTONS], getjoyname(1, dbutton));
strcat(JoystickButtonNames[dbutton + MAXJOYBUTTONS], joyGetName(1, dbutton));
templayer.text = JoystickButtonNames[dbutton + MAXJOYBUTTONS];
templayer.y = OPT_LINE(pageitem);
@ -1317,10 +1317,10 @@ static SWBOOL MNU_JoystickButtonsInitialise(MenuItem_p mitem)
}
else
{
int dir = button - joynumbuttons * 2;
int dbutton = joynumbuttons + dir;
int dir = button - joystick.numButtons * 2;
int dbutton = joystick.numButtons + dir;
strcpy(JoystickButtonNames[dbutton], getjoyname(2, 0));
strcpy(JoystickButtonNames[dbutton], joyGetName(2, 0));
strcat(JoystickButtonNames[dbutton], hatdirs[dir]);
templayer.text = JoystickButtonNames[dbutton];
@ -1339,11 +1339,11 @@ static SWBOOL MNU_JoystickButtonsInitialise(MenuItem_p mitem)
button++;
}
if (pageitem == JOYSTICKITEMSPERPAGE || button == joynumbuttons * 2 + (joynumhats > 0) * 4)
if (pageitem == JOYSTICKITEMSPERPAGE || button == joystick.numButtons * 2 + (joystick.numHats > 0) * 4)
{
// next page
sprintf(JoystickButtonPageName[page], "Page %d / %d", page+1,
((joynumbuttons * 2 + (joynumhats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
((joystick.numButtons * 2 + (joystick.numHats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
temppagename.text = JoystickButtonPageName[page];
memcpy(item, &temppagename, sizeof(MenuItem));
@ -1435,7 +1435,7 @@ static SWBOOL MNU_JoystickButtonSetupCustom(UserCall call, MenuItem *item)
static SWBOOL MNU_JoystickButtonNextPage(void)
{
JoystickButtonPage = (JoystickButtonPage + 1) % (((joynumbuttons * 2 + (joynumhats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
JoystickButtonPage = (JoystickButtonPage + 1) % (((joystick.numButtons * 2 + (joystick.numHats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
joybuttonssetupgroup.items = &joybuttons_i[JoystickButtonPage][0];
joybuttonssetupgroup.cursor = 0;
MNU_ItemPreProcess(&joybuttonssetupgroup);
@ -1484,13 +1484,13 @@ static SWBOOL MNU_JoystickAxesInitialise(MenuItem_p mitem)
{
return TRUE;
}
if (JoystickAxisPage < 0 || JoystickAxisPage >= joynumaxes)
if (JoystickAxisPage < 0 || JoystickAxisPage >= joystick.numAxes)
{
JoystickAxisPage = 0;
}
strcpy(JoystickAxisName, getjoyname(0, JoystickAxisPage));
sprintf(JoystickAxisPageName, "Page %d / %d", JoystickAxisPage+1, joynumaxes);
strcpy(JoystickAxisName, joyGetName(0, JoystickAxisPage));
sprintf(JoystickAxisPageName, "Page %d / %d", JoystickAxisPage+1, joystick.numAxes);
slidersettings[sldr_joyaxisanalog] = MNU_ControlAxisOffset(JoystickAnalogAxes[JoystickAxisPage]);
slidersettings[sldr_joyaxisscale] = JoystickAnalogScale[JoystickAxisPage] >> 13;
slidersettings[sldr_joyaxisdead] = JoystickAnalogDead[JoystickAxisPage] >> 10;
@ -2201,7 +2201,7 @@ MNU_InitMenus(void)
if (validbpps[i] == bpp)
slidersettings[sldr_videobpp] = i;
i = checkvideomode(&newx, &newy, bpp, fullscreen, 1);
i = videoCheckMode(&newx, &newy, bpp, fullscreen, 1);
if (i != 0x7fffffff && i >= 0)
for (i=0; i<numvalidresolutions; i++)
if (validresolutions[i].xdim == newx && validresolutions[i].ydim == newy)
@ -2551,12 +2551,12 @@ MNU_InputSmallString(char *name, short pix_width)
while (KB_KeyWaiting())
{
ch = KB_Getch();
ch = KB_GetCh();
// skip any extended key
if (ch == 0)
{
ch = KB_Getch();
ch = KB_GetCh();
if (ch == 104) // extended enter
ch = ascii_return;
else
@ -2644,7 +2644,7 @@ MNU_InputString(char *name, short pix_width)
while (KB_KeyWaiting())
{
ch = KB_Getch();
ch = KB_GetCh();
////DSPRINTF(ds, "%c %d", ch, ch);
//MONO_PRINT(ds);
@ -2652,7 +2652,7 @@ MNU_InputString(char *name, short pix_width)
// skip most extended keys
if (ch == 0)
{
ch = KB_Getch();
ch = KB_GetCh();
////DSPRINTF(ds, "extended key %c %d", ch, ch);
//MONO_PRINT(ds);
@ -2698,12 +2698,12 @@ void LoadSaveMsg(const char *msg)
{
short w,h;
flushperms();
renderFlushPerms();
DrawMenuLevelScreen();
strcpy((char *)ds, (char *)msg);
MNU_MeasureString(ds, &w, &h);
MNU_DrawString(TEXT_XCENTER(w), 170, ds, 1, 16);
nextpage();
videoNextPage();
}
@ -2820,8 +2820,8 @@ MNU_GetSaveCustom(void)
// clear keyboard buffer
while (KB_KeyWaiting())
{
if (KB_Getch() == 0)
KB_Getch();
if (KB_GetCh() == 0)
KB_GetCh();
}
// toggle edit mode
@ -4884,7 +4884,7 @@ FadeIn(unsigned char startcolor, unsigned int clicks)
RGB_color color;
unsigned char temp_pal[768], *palette;
if (getrendermode() >= 3) return;
if (videoGetRenderMode() >= REND_POLYMOST) return;
palette = &palette_data[0][0];
@ -4942,7 +4942,7 @@ FadeOut(unsigned char targetcolor, unsigned int clicks)
RGB_color color;
unsigned char temp_pal[768];
if (getrendermode() >= 3) return;
if (videoGetRenderMode() >= REND_POLYMOST) return;
color.red = palette_data[targetcolor][0];
color.green = palette_data[targetcolor][1];
@ -5057,10 +5057,10 @@ SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor)
// Reset the palette
if (pp == Player + screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
if (pp->FadeAmt <= 0)
GetPaletteFromVESA(&ppalette[screenpeek][0]);
}
@ -5150,8 +5150,8 @@ SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor)
// Do initial palette set
if (pp == Player + screenpeek)
{
if (getrendermode() < 3) set_pal(pp->temp_pal);
else setpalettefade(color.red, color.green, color.blue, faderamp[min(31,max(0,32-abs(pp->FadeAmt)))]);
if (videoGetRenderMode() < REND_POLYMOST) set_pal(pp->temp_pal);
else videoFadePalette(color.red, color.green, color.blue, faderamp[min(31,max(0,32-abs(pp->FadeAmt)))]);
if (damage < -1000)
pp->FadeAmt = 1000; // Don't call DoPaletteFlash for underwater stuff
}
@ -5174,10 +5174,10 @@ DoPaletteFlash(PLAYERp pp)
pp->StartColor = 0;
if (pp == Player + screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
DoPlayerDivePalette(pp); // Check Dive again
DoPlayerNightVisionPalette(pp); // Check Night Vision again
@ -5213,10 +5213,10 @@ DoPaletteFlash(PLAYERp pp)
pp->StartColor = 0;
if (pp == Player + screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
DoPlayerDivePalette(pp); // Check Dive again
DoPlayerNightVisionPalette(pp); // Check Night Vision again
@ -5249,10 +5249,10 @@ DoPaletteFlash(PLAYERp pp)
// Only hard set the palette if this is currently the player's view
if (pp == Player + screenpeek)
{
if (getrendermode() < 3) set_pal(pp->temp_pal);
if (videoGetRenderMode() < REND_POLYMOST) set_pal(pp->temp_pal);
else
{
setpalettefade(
videoFadePalette(
palette_data[pp->StartColor][0],
palette_data[pp->StartColor][1],
palette_data[pp->StartColor][2],
@ -5267,10 +5267,10 @@ DoPaletteFlash(PLAYERp pp)
void ResetPalette(PLAYERp pp)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
//DoPlayerDivePalette(pp); // Check Dive again
//DoPlayerNightVisionPalette(pp); // Check Night Vision again

View file

@ -951,7 +951,7 @@ faketimerhandler(void)
}
#endif
sampletimer();
timerUpdate();
if ((totalclock < ototalclock + synctics))
return;
@ -1260,7 +1260,7 @@ getpackets(void)
PLAYERp pp;
SW_PACKET tempinput;
sampletimer();
timerUpdate();
if (!CommEnabled)
return;

View file

@ -2332,10 +2332,10 @@ PlayerGameReset(PLAYERp pp)
if (pp == Player+screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
}
pp->NightVision = FALSE;
@ -2436,10 +2436,10 @@ InitPlayerSprite(PLAYERp pp)
if (pp == Player+screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
}

View file

@ -5070,10 +5070,10 @@ DoPlayerDivePalette(PLAYERp pp)
{
memcpy(pp->temp_pal, palette_data, sizeof(palette_data));
memcpy(palookup[PALETTE_DEFAULT], DefaultPalette, 256 * 32);
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness, &palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
pp->FadeAmt = 0;
}
}
@ -6934,10 +6934,10 @@ void DoPlayerDeathCheckKeys(PLAYERp pp)
if (pp == Player + screenpeek)
{
if (getrendermode() < 3)
if (videoGetRenderMode() < REND_POLYMOST)
COVERsetbrightness(gs.Brightness,&palette_data[0][0]);
else
setpalettefade(0,0,0,0);
videoFadePalette(0,0,0,0);
//memcpy(&palette_data[0][0],&palette_data[0][0],768);
memcpy(&pp->temp_pal[0],&palette_data[0][0],768);
}

View file

@ -1116,7 +1116,7 @@ DrawOverlapRoom(int tx, int ty, int tz, short tang, int thoriz, short tsectnum)
analyzesprites(tx, ty, tz, FALSE);
post_analyzesprites();
drawmasks();
renderDrawMasks();
}
else
@ -1142,7 +1142,7 @@ DrawOverlapRoom(int tx, int ty, int tz, short tang, int thoriz, short tsectnum)
analyzesprites(tx, ty, tz, FALSE);
post_analyzesprites();
drawmasks();
renderDrawMasks();
}
}

View file

@ -301,7 +301,7 @@ void *RTS_GetSound(int32_t lump)
if (lumpcache[lump] == (intptr_t)NULL)
{
lumplockbyte[lump] = CACHE_LOCK_START;
allocache(&lumpcache[lump],(int)RTS_SoundLength(lump-1),&lumplockbyte[lump]);
cacheAllocateBlock(&lumpcache[lump],(int)RTS_SoundLength(lump-1),&lumplockbyte[lump]);
RTS_ReadLump(lump, lumpcache[lump]);
}
else

View file

@ -1313,10 +1313,10 @@ ScreenLoad(MFILE_READ fin)
{
int num;
setviewtotile(SAVE_SCREEN_TILE, SAVE_SCREEN_YSIZE, SAVE_SCREEN_XSIZE);
renderSetTarget(SAVE_SCREEN_TILE, SAVE_SCREEN_YSIZE, SAVE_SCREEN_XSIZE);
num = MREAD((void *)waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, 1, fin);
setviewback();
renderRestoreTarget();
}

View file

@ -770,7 +770,7 @@ SWBOOL CacheSound(int num, int type)
*/
vp->lock = CACHE_UNLOCK_MAX;
allocache((intptr_t*)&vp->data, length, &vp->lock);
cacheAllocateBlock((intptr_t*)&vp->data, length, &vp->lock);
#if 0
// DEBUG

View file

@ -80,14 +80,14 @@ static void PopulateForm(int pgs)
hwnd = GetDlgItem(pages[TAB_CONFIG], IDCVMODE);
mode = checkvideomode(&settings.xdim, &settings.ydim, settings.bpp, settings.fullscreen, 1);
mode = videoCheckMode(&settings.xdim, &settings.ydim, settings.bpp, settings.fullscreen, 1);
if (mode < 0)
{
int cd[] = { 32, 24, 16, 15, 8, 0 };
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp) i++; else break; }
for (; cd[i]; i++)
{
mode = checkvideomode(&settings.xdim, &settings.ydim, cd[i], settings.fullscreen, 1);
mode = videoCheckMode(&settings.xdim, &settings.ydim, cd[i], settings.fullscreen, 1);
if (mode < 0) continue;
settings.bpp = cd[i];
break;