fix false save failure message and clean up begindrawing/enddrawing pairs

git-svn-id: https://svn.eduke32.com/eduke32@1776 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-01-20 10:52:33 +00:00
parent c54304217c
commit 801845fa3b
2 changed files with 34 additions and 44 deletions

View file

@ -580,9 +580,8 @@ CANCEL:
if (keystatus[1])
{
keystatus[1] = 0;
begindrawing(); //{{{
printext256(0,0,whitecol,0,"Are you sure you want to quit?",0);
enddrawing(); //}}}
showframe(1);
synctics = totalclock-lockclock;
@ -620,9 +619,8 @@ CANCEL:
{
i = CheckMapCorruption(4);
begindrawing(); //{{{
printext256(0,8,whitecol,0,i<4?"Save changes?":"Map is heavily corrupt. Save changes?",0);
showframe(1); //}}}
showframe(1);
while ((keystatus[1]|keystatus[0x1c]|keystatus[0x39]|keystatus[0x31]|keystatus[0x2e]) == 0)
{
@ -891,9 +889,6 @@ void editinput(void)
keystatus[0x43] = 0;
}
begindrawing(); //{{{
enddrawing(); //}}}
if (angvel != 0) //ang += angvel * constant
{
//ENGINE calculates angvel for you
@ -1712,6 +1707,7 @@ void overheadeditor(void)
// drawline16(0,ydim-1-20,xdim-1,ydim-1-20,1);
// drawline16(256,ydim-1-20,256,ydim-1,1);
ydim16 = ydim-STATUS2DSIZ2;
enddrawing(); //}}}
pag = 0;
@ -2144,6 +2140,7 @@ void overheadeditor(void)
else
drawline16base(halfxdim16+x2,midydim16+y2, 0,0, 0,0, editorcolors[5]);
}
enddrawing(); //}}}
OSD_Draw();
@ -5128,7 +5125,7 @@ const char *SaveBoard(const char *fn, uint32_t flags)
if ((flags&1)==0)
ExtSaveMap(f);
if (ret)
if (!ret)
return f;
else
return NULL;
@ -6064,16 +6061,14 @@ static int32_t menuselect(void)
if (!findfileshigh)
findfileshigh=findfiles;
begindrawing();
_printmessage16("Select map file with arrow keys and enter.");
enddrawing();
ydim16 = ydim-STATUS2DSIZ2;
listsize = (ydim16-32)/9;
do
{
begindrawing();
begindrawing(); //{{{
CLEARLINES2D(0, ydim16, 0);
@ -6138,7 +6133,8 @@ static int32_t menuselect(void)
}
}
}
enddrawing();
enddrawing(); //}}}
showframe(1);
keystatus[0xcb] = 0;
@ -6934,12 +6930,10 @@ void _printmessage16(const char *fmt, ...)
clearministatbar16();
begindrawing();
// ybase = (overridepm16y >= 0) ? ydim-overridepm16y : ydim-STATUS2DSIZ+128-8;
ybase = ydim-STATUS2DSIZ+128-8;
printext16(/*(overridepm16y >= 0) ? 200L-24 :*/ 8, ybase+8, whitecol, -1, snotbuf, 0);
enddrawing();
}
void printmessage256(int32_t x, int32_t y, const char *name)

View file

@ -3478,7 +3478,6 @@ static int32_t OnSelectTile(int32_t iTile)
bflushchars();
begindrawing();
setpolymost2dview();
clearview(0);
@ -3522,7 +3521,6 @@ static int32_t OnSelectTile(int32_t iTile)
}
}
enddrawing();
showframe(1);
clearkeys();
@ -3672,7 +3670,10 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i
}
if (iSelected < 0 || iSelected >= MAXTILES)
{
enddrawing();
return 1;
}
idTile = localartlookup[ iSelected ];
@ -9462,7 +9463,9 @@ void ExtPreCheckKeys(void) // just before drawrooms
return;
}
begindrawing();
begindrawing(); //{{{
// if (cursectornum >= 0)
// fillsector(cursectornum, 31);
@ -9608,7 +9611,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
}
}
enddrawing();
enddrawing(); //}}}
}
void ExtAnalyzeSprites(void)
@ -10209,7 +10212,6 @@ static void EditSectorData(int16_t sectnum)
showsectordata(sectnum, 0);
begindrawing();
while (keystatus[KEYSC_ESC] == 0)
{
idle_waitevent();
@ -10414,16 +10416,17 @@ static void EditSectorData(int16_t sectnum)
break;
}
}
printext16(xpos,ypos+row*8,editorcolors[11],editorcolors[1],disptext,0);
if (editval)
{
editval = 0;
}
showframe(1);
}
printext16(xpos,ypos+row*8,editorcolors[11],editorcolors[0],disptext,0);
// printmessage16("");
enddrawing();
showframe(1);
keystatus[KEYSC_ESC] = 0;
}
@ -10440,7 +10443,7 @@ static void EditWallData(int16_t wallnum)
disptext[dispwidth] = 0;
showwalldata(wallnum, 0);
begindrawing();
while (keystatus[KEYSC_ESC] == 0)
{
idle_waitevent();
@ -10547,13 +10550,13 @@ static void EditWallData(int16_t wallnum)
//showwalldata(wallnum, 0);
//// printmessage16("");
}
//enddrawing();
showframe(1);
}
//begindrawing();
printext16(xpos,ypos+row*8,editorcolors[11],editorcolors[0],disptext,0);
// printmessage16("");
enddrawing();
showframe(1);
keystatus[KEYSC_ESC] = 0;
}
@ -10575,7 +10578,7 @@ static void EditSpriteData(int16_t spritenum)
while (keystatus[KEYSC_ESC] == 0)
{
idle_waitevent();
begindrawing();
if (handleevents())
{
if (quitevent) quitevent = 0;
@ -10892,17 +10895,15 @@ static void EditSpriteData(int16_t spritenum)
printext16(xpos,ypos+row*8,editorcolors[11],editorcolors[1],disptext,0);
if (editval)
{
editval = 0;
}
enddrawing();
showframe(1);
}
begindrawing();
printext16(xpos,ypos+row*8,editorcolors[11],editorcolors[0],disptext,0);
// printmessage16("");
enddrawing();
showframe(1);
keystatus[KEYSC_ESC] = 0;
}
@ -10987,7 +10988,6 @@ static void GenericSpriteSearch()
if (quitevent) quitevent = 0;
}
begindrawing();
printmessage16("Sprite search, press <Esc> to exit");
if (PRESSED_KEYSC(DOWN))
@ -11029,13 +11029,11 @@ static void GenericSpriteSearch()
if (PRESSED_KEYSC(ENTER))
{
Bsprintf(edittext, "%s: ", labels[row][col]);
enddrawing();
printmessage16("%s", edittext);
i = getnumber16(edittext, gs_spritewhat[col][row] ? gs_sprite[col][row] : 0,
maxval[row][col], sign[row][col]);
if (col == 2 && row == 0) i = (i+2048)&2047; // angle
gs_sprite[col][row] = i;
begindrawing();
gs_spritewhat[col][row] = 1;
if (col == 1 && row == 5) // picnum
@ -11063,14 +11061,13 @@ static void GenericSpriteSearch()
printext16(xpos[col],ypos+row*8,editorcolors[11],editorcolors[1],disptext,0);
enddrawing();
showframe(1);
}
// begindrawing();
printext16(xpos[col],ypos+row*8,editorcolors[11],editorcolors[0],disptext,0);
printmessage16("Search sprite");
// enddrawing();
showframe(1);
keystatus[KEYSC_ESC] = 0;
}
@ -11139,7 +11136,6 @@ static void FuncMenu(void)
if (handleevents())
quitevent = 0;
begindrawing();
_printmessage16("Select an option, press <Esc> to exit");
if (PRESSED_KEYSC(DOWN))
{
@ -11407,13 +11403,13 @@ static void FuncMenu(void)
break;
}
printext16(xpos,ypos+row*MENU_Y_SPACING,editorcolors[11],editorcolors[1],disptext,0);
enddrawing();
showframe(1);
}
begindrawing();
printext16(xpos,ypos+row*MENU_Y_SPACING,editorcolors[11],editorcolors[0],disptext,0);
enddrawing();
/*clearmidstatbar16();*/
showframe(1);
keystatus[KEYSC_ESC] = 0;
}