mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 23:21:43 +00:00
fix some breakage with the "load last game" screen that pops up when you die
git-svn-id: https://svn.eduke32.com/eduke32@1647 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7c3efce4cc
commit
8120821f8d
7 changed files with 41 additions and 31 deletions
|
@ -132,7 +132,6 @@ void OSD_Draw(void);
|
||||||
|
|
||||||
// just like printf
|
// just like printf
|
||||||
void OSD_Printf(const char *fmt, ...);
|
void OSD_Printf(const char *fmt, ...);
|
||||||
#define printOSD OSD_Printf
|
|
||||||
|
|
||||||
// executes buffered commands
|
// executes buffered commands
|
||||||
void OSD_DispatchQueued(void);
|
void OSD_DispatchQueued(void);
|
||||||
|
|
|
@ -5921,7 +5921,7 @@ void showsectordata(int16_t sectnum)
|
||||||
|
|
||||||
if (mode)
|
if (mode)
|
||||||
{
|
{
|
||||||
_printmessage16("^10Sector %d ^O(F7 to edit)",sectnum);
|
_printmessage16("^10Sector %d %s ^O(F7 to edit)",sectnum, ExtGetSectorCaption(sectnum));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5993,7 +5993,7 @@ void showwalldata(int16_t wallnum)
|
||||||
|
|
||||||
if (mode)
|
if (mode)
|
||||||
{
|
{
|
||||||
_printmessage16("^10Wall %d ^O(F8 to edit)",wallnum);
|
_printmessage16("^10Wall %d %s ^O(F8 to edit)",wallnum, ExtGetWallCaption(wallnum));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6063,7 +6063,7 @@ void showspritedata(int16_t spritenum)
|
||||||
|
|
||||||
if (mode)
|
if (mode)
|
||||||
{
|
{
|
||||||
_printmessage16("^10Sprite %d ^O(F8 to edit)",spritenum);
|
_printmessage16("^10Sprite %d %s ^O(F8 to edit)",spritenum, ExtGetSpriteCaption(spritenum));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,8 @@ char cachedebug = 0;
|
||||||
qlz_state_compress *state_compress = NULL;
|
qlz_state_compress *state_compress = NULL;
|
||||||
qlz_state_decompress *state_decompress = NULL;
|
qlz_state_decompress *state_decompress = NULL;
|
||||||
|
|
||||||
|
int32_t whitecol;
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(NOASM)
|
#if defined(_MSC_VER) && !defined(NOASM)
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -5141,6 +5143,15 @@ static void loadpalette(void)
|
||||||
|
|
||||||
initfastcolorlookup(30L,59L,11L);
|
initfastcolorlookup(30L,59L,11L);
|
||||||
|
|
||||||
|
{
|
||||||
|
int32_t i, j, k = 0;
|
||||||
|
for (i=0; i<256; i++)
|
||||||
|
{
|
||||||
|
j = ((int32_t)palette[i*3])+((int32_t)palette[i*3+1])+((int32_t)palette[i*3+2]);
|
||||||
|
if (j > k) { k = j; whitecol = i; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
paletteloaded = 1;
|
paletteloaded = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5483,6 +5494,8 @@ static sectortype sector_s[MAXSECTORS];
|
||||||
static walltype wall_s[MAXWALLS];
|
static walltype wall_s[MAXWALLS];
|
||||||
static spritetype sprite_s[MAXSPRITES];
|
static spritetype sprite_s[MAXSPRITES];
|
||||||
static spritetype tsprite_s[MAXSPRITESONSCREEN];
|
static spritetype tsprite_s[MAXSPRITESONSCREEN];
|
||||||
|
#else
|
||||||
|
void *blockptr = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32_t preinitengine(void)
|
int32_t preinitengine(void)
|
||||||
|
@ -5495,7 +5508,6 @@ int32_t preinitengine(void)
|
||||||
#ifdef DYNALLOC_ARRAYS
|
#ifdef DYNALLOC_ARRAYS
|
||||||
{
|
{
|
||||||
size_t i, size = 0;
|
size_t i, size = 0;
|
||||||
int8_t *ptr;
|
|
||||||
|
|
||||||
// allocate everything at once... why not? entries can just be added to this table
|
// allocate everything at once... why not? entries can just be added to this table
|
||||||
// to allocate future arrays without further intervention
|
// to allocate future arrays without further intervention
|
||||||
|
@ -5519,14 +5531,14 @@ int32_t preinitengine(void)
|
||||||
for (i=0;i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
for (i=0;i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
||||||
size += dynarray[i].size;
|
size += dynarray[i].size;
|
||||||
|
|
||||||
if ((ptr = (int8_t *)Bcalloc(1, size)) == NULL)
|
if ((blockptr = Bcalloc(1, size)) == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
for (i=0;i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
for (i=0;i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
||||||
{
|
{
|
||||||
*dynarray[i].ptr = ptr + size;
|
*dynarray[i].ptr = (int8_t *)blockptr + size;
|
||||||
size += dynarray[i].size;
|
size += dynarray[i].size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5685,8 +5697,8 @@ void uninitengine(void)
|
||||||
if (palookup[i] != NULL) { Bfree(palookup[i]); palookup[i] = NULL; }
|
if (palookup[i] != NULL) { Bfree(palookup[i]); palookup[i] = NULL; }
|
||||||
|
|
||||||
#ifdef DYNALLOC_ARRAYS
|
#ifdef DYNALLOC_ARRAYS
|
||||||
if (sector != NULL)
|
if (blockptr != NULL)
|
||||||
Bfree(sector);
|
Bfree(blockptr);
|
||||||
#else
|
#else
|
||||||
if (state_compress) Bfree(state_compress);
|
if (state_compress) Bfree(state_compress);
|
||||||
#endif
|
#endif
|
||||||
|
@ -5808,7 +5820,7 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
|
||||||
|
|
||||||
//if (smostwallcnt < 0)
|
//if (smostwallcnt < 0)
|
||||||
// if (getkensmessagecrc(FP_OFF(kensmessage)) != 0x56c764d4)
|
// if (getkensmessagecrc(FP_OFF(kensmessage)) != 0x56c764d4)
|
||||||
// { /* setvmode(0x3);*/ printOSD("Nice try.\n"); exit(0); }
|
// { /* setvmode(0x3);*/ OSD_Printf("Nice try.\n"); exit(0); }
|
||||||
|
|
||||||
numhits = xdimen; numscans = 0; numbunches = 0;
|
numhits = xdimen; numscans = 0; numbunches = 0;
|
||||||
maskwallcnt = 0; smostwallcnt = 0; smostcnt = 0; spritesortcnt = 0;
|
maskwallcnt = 0; smostwallcnt = 0; smostcnt = 0; spritesortcnt = 0;
|
||||||
|
@ -7723,7 +7735,7 @@ int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t da
|
||||||
|
|
||||||
strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI. (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
|
strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI. (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
|
||||||
// if (getkensmessagecrc(FP_OFF(kensmessage)) != 0x56c764d4)
|
// if (getkensmessagecrc(FP_OFF(kensmessage)) != 0x56c764d4)
|
||||||
// { printOSD("Nice try.\n"); exit(0); }
|
// { OSD_Printf("Nice try.\n"); exit(0); }
|
||||||
|
|
||||||
//if (checkvideomode(&daxdim, &daydim, dabpp, davidoption)<0) return (-1);
|
//if (checkvideomode(&daxdim, &daydim, dabpp, davidoption)<0) return (-1);
|
||||||
|
|
||||||
|
@ -7943,13 +7955,12 @@ int32_t loadpics(char *filename, int32_t askedsize)
|
||||||
|
|
||||||
clearbuf(&gotpic[0],(int32_t)((MAXTILES+31)>>5),0L);
|
clearbuf(&gotpic[0],(int32_t)((MAXTILES+31)>>5),0L);
|
||||||
|
|
||||||
//try dpmi_DETERMINEMAXREALALLOC!
|
|
||||||
|
|
||||||
//cachesize = min((int32_t)((Bgetsysmemsize()/100)*60),max(artsize,askedsize));
|
//cachesize = min((int32_t)((Bgetsysmemsize()/100)*60),max(artsize,askedsize));
|
||||||
if (Bgetsysmemsize() <= (uint32_t)askedsize)
|
if (Bgetsysmemsize() <= (uint32_t)askedsize)
|
||||||
cachesize = (Bgetsysmemsize()/100)*60;
|
cachesize = (Bgetsysmemsize()/100)*60;
|
||||||
else
|
else
|
||||||
cachesize = askedsize;
|
cachesize = askedsize;
|
||||||
|
|
||||||
while ((pic = Bmalloc(cachesize)) == NULL)
|
while ((pic = Bmalloc(cachesize)) == NULL)
|
||||||
{
|
{
|
||||||
cachesize -= 65536L;
|
cachesize -= 65536L;
|
||||||
|
@ -7988,7 +7999,7 @@ void loadtile(int16_t tilenume)
|
||||||
#ifdef WITHKPLIB
|
#ifdef WITHKPLIB
|
||||||
if (artptrs[(i = tilefilenum[tilenume])]) // from zip
|
if (artptrs[(i = tilefilenum[tilenume])]) // from zip
|
||||||
{
|
{
|
||||||
waloff[tilenume] = (intptr_t)(artptrs[i] + tilefileoffs[tilenume]);
|
waloff[tilenume] = (intptr_t)(artptrs[i]) + tilefileoffs[tilenume];
|
||||||
faketimerhandler();
|
faketimerhandler();
|
||||||
// OSD_Printf("loaded tile %d from zip\n", tilenume);
|
// OSD_Printf("loaded tile %d from zip\n", tilenume);
|
||||||
return;
|
return;
|
||||||
|
@ -8008,7 +8019,7 @@ void loadtile(int16_t tilenume)
|
||||||
faketimerhandler();
|
faketimerhandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachedebug) printOSD("Tile:%d\n",tilenume);
|
if (cachedebug) OSD_Printf("Tile:%d\n",tilenume);
|
||||||
|
|
||||||
// dummy tiles for highres replacements and tilefromtexture definitions
|
// dummy tiles for highres replacements and tilefromtexture definitions
|
||||||
if (faketilesiz[tilenume])
|
if (faketilesiz[tilenume])
|
||||||
|
@ -8016,13 +8027,13 @@ void loadtile(int16_t tilenume)
|
||||||
if (faketilesiz[tilenume] == -1)
|
if (faketilesiz[tilenume] == -1)
|
||||||
{
|
{
|
||||||
walock[tilenume] = 255; // permanent tile
|
walock[tilenume] = 255; // permanent tile
|
||||||
allocache(&waloff[tilenume],dasiz,&walock[tilenume]);
|
allocache(&waloff[tilenume], dasiz, &walock[tilenume]);
|
||||||
Bmemset((char *)waloff[tilenume],0,dasiz);
|
Bmemset((char *)waloff[tilenume],0,dasiz);
|
||||||
}
|
}
|
||||||
else if (faketiledata[tilenume] != NULL)
|
else if (faketiledata[tilenume] != NULL)
|
||||||
{
|
{
|
||||||
walock[tilenume] = 255; // permanent tile
|
walock[tilenume] = 255;
|
||||||
allocache(&waloff[tilenume],dasiz,&walock[tilenume]);
|
allocache(&waloff[tilenume], dasiz, &walock[tilenume]);
|
||||||
qlz_decompress(faketiledata[tilenume], (char *)waloff[tilenume], state_decompress);
|
qlz_decompress(faketiledata[tilenume], (char *)waloff[tilenume], state_decompress);
|
||||||
Bfree(faketiledata[tilenume]);
|
Bfree(faketiledata[tilenume]);
|
||||||
faketiledata[tilenume] = NULL;
|
faketiledata[tilenume] = NULL;
|
||||||
|
@ -11037,7 +11048,7 @@ void draw2dgrid(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int16
|
||||||
{
|
{
|
||||||
if (xp1 != xp2)
|
if (xp1 != xp2)
|
||||||
{
|
{
|
||||||
drawline16(xp1,yp1,xp1,yp2,editorcolors[8]);
|
drawline16(xp1,yp1,xp1,yp2,whitecol-25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11045,7 +11056,7 @@ void draw2dgrid(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int16
|
||||||
xp2 = xp1;
|
xp2 = xp1;
|
||||||
if ((xp2 >= 0) && (xp2 < xdim))
|
if ((xp2 >= 0) && (xp2 < xdim))
|
||||||
{
|
{
|
||||||
drawline16(xp2,yp1,xp2,yp2,editorcolors[8]);
|
drawline16(xp2,yp1,xp2,yp2,whitecol-25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xp1 = mulscale14(posxe+editorgridextent,zoome);
|
xp1 = mulscale14(posxe+editorgridextent,zoome);
|
||||||
|
@ -11058,7 +11069,7 @@ void draw2dgrid(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int16
|
||||||
{
|
{
|
||||||
if ((yp1 > midydim16-ydim16) && (yp1 <= midydim16))
|
if ((yp1 > midydim16-ydim16) && (yp1 <= midydim16))
|
||||||
{
|
{
|
||||||
drawline16(halfxdim16-xp1,midydim16-yp1,halfxdim16-xp2,midydim16-yp1,editorcolors[8]);
|
drawline16(halfxdim16-xp1,midydim16-yp1,halfxdim16-xp2,midydim16-yp1,whitecol-25);
|
||||||
tempy = yp1;
|
tempy = yp1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11203,7 +11214,7 @@ void draw2dscreen(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int
|
||||||
if (((halfxdim16+xp1) >= 2) && ((halfxdim16+xp1) <= xdim-3))
|
if (((halfxdim16+xp1) >= 2) && ((halfxdim16+xp1) <= xdim-3))
|
||||||
if (((midydim16+yp1) >= 2) && ((midydim16+yp1) <= ydim16-3))
|
if (((midydim16+yp1) >= 2) && ((midydim16+yp1) <= ydim16-3))
|
||||||
{
|
{
|
||||||
int32_t pointsize = 1;
|
int32_t pointsize = 2;
|
||||||
col = 15;
|
col = 15;
|
||||||
if (i == pointhighlight || ((pointhighlight < MAXWALLS) && (pointhighlight >= 0) && (wall[i].x == wall[pointhighlight].x) && (wall[i].y == wall[pointhighlight].y)))
|
if (i == pointhighlight || ((pointhighlight < MAXWALLS) && (pointhighlight >= 0) && (wall[i].x == wall[pointhighlight].x) && (wall[i].y == wall[pointhighlight].y)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1824,7 +1824,7 @@ int32_t handleevents(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//printOSD("Got event (%d)\n", ev.type);
|
//OSD_Printf("Got event (%d)\n", ev.type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ static void SignalHandler(int32_t signum)
|
||||||
switch (signum)
|
switch (signum)
|
||||||
{
|
{
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
printOSD("Fatal Signal caught: SIGSEGV. Bailing out.\n");
|
OSD_Printf("Fatal Signal caught: SIGSEGV. Bailing out.\n");
|
||||||
if (gammabrightness)
|
if (gammabrightness)
|
||||||
setgammaramp(sysgamma);
|
setgammaramp(sysgamma);
|
||||||
gammabrightness = 0;
|
gammabrightness = 0;
|
||||||
|
|
|
@ -4415,15 +4415,15 @@ static int32_t C_ParseCommand(void)
|
||||||
C_GetNextVarType(GAMEVAR_READONLY);
|
C_GetNextVarType(GAMEVAR_READONLY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CON_ROTATEPOINT:
|
|
||||||
case CON_NEARTAG:
|
case CON_NEARTAG:
|
||||||
|
C_GetManyVars(5);
|
||||||
|
C_GetManyVarsType(GAMEVAR_READONLY,4);
|
||||||
|
C_GetManyVars(2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CON_ROTATEPOINT:
|
||||||
C_GetManyVars(5);
|
C_GetManyVars(5);
|
||||||
C_GetManyVarsType(GAMEVAR_READONLY,2);
|
C_GetManyVarsType(GAMEVAR_READONLY,2);
|
||||||
if (tw == CON_NEARTAG)
|
|
||||||
{
|
|
||||||
C_GetManyVarsType(GAMEVAR_READONLY,2);
|
|
||||||
C_GetManyVars(2);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CON_GETTIMEDATE:
|
case CON_GETTIMEDATE:
|
||||||
|
|
|
@ -2793,7 +2793,7 @@ nullquote:
|
||||||
{
|
{
|
||||||
if (g_lastSaveSlot >= 0 && ud.recstat != 2)
|
if (g_lastSaveSlot >= 0 && ud.recstat != 2)
|
||||||
{
|
{
|
||||||
g_player[vm.g_p].ps->gm = MODE_MENU;
|
g_player[vm.g_p].ps->gm |= MODE_MENU;
|
||||||
KB_ClearKeyDown(sc_Space);
|
KB_ClearKeyDown(sc_Space);
|
||||||
ChangeToMenu(15000);
|
ChangeToMenu(15000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue