mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Mapster32: fix fillsector() calls before fade_editor_screen().
The latter allows one to specify a color to keep, but with r5302 the fillsector() highlights are drawn with transparency, thus making it ineffective. Add an argument to toggle transparency to fillsector() (now fillsector_maybetrans()) and two wrapper functions. git-svn-id: https://svn.eduke32.com/eduke32@5411 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d9d8a56abf
commit
d824ddf406
3 changed files with 21 additions and 10 deletions
|
@ -316,10 +316,20 @@ void _printmessage16(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
|||
|
||||
extern char lastpm16buf[156];
|
||||
|
||||
int32_t fillsector(int16_t sectnum, int32_t fillcolor); // fillcolor == -1: default (pulsating)
|
||||
int32_t fillsector_maybetrans(int16_t sectnum, int32_t fillcolor, uint8_t dotrans); // fillcolor == -1: default (pulsating)
|
||||
int32_t ask_if_sure(const char *query, uint32_t flags);
|
||||
int32_t editor_ask_function(const char *question, const char *dachars, int32_t numchars);
|
||||
|
||||
static inline int32_t fillsector(int16_t sectnum, int32_t fillcolor)
|
||||
{
|
||||
return fillsector_maybetrans(sectnum, fillcolor, 1);
|
||||
}
|
||||
|
||||
static inline int32_t fillsector_notrans(int16_t sectnum, int32_t fillcolor)
|
||||
{
|
||||
return fillsector_maybetrans(sectnum, fillcolor, 0);
|
||||
}
|
||||
|
||||
void spriteoncfz(int32_t i, int32_t *czptr, int32_t *fzptr) ATTRIBUTE((nonnull(2,3)));
|
||||
void DoSpriteOrnament(int32_t i);
|
||||
|
||||
|
|
|
@ -2926,7 +2926,7 @@ static int32_t bakframe_fillandfade(char **origframeptr, int32_t sectnum, const
|
|||
enddrawing();
|
||||
}
|
||||
|
||||
fillsector(sectnum, editorcolors[9]);
|
||||
fillsector_notrans(sectnum, editorcolors[9]);
|
||||
fade_editor_screen(editorcolors[9]);
|
||||
|
||||
return ask_if_sure(querystr, 0);
|
||||
|
@ -6202,9 +6202,10 @@ end_point_dragging:
|
|||
// now is a good time to ask...
|
||||
for (comp=0; comp<2; comp++)
|
||||
for (k=0; k<collnumsects[comp]; k++)
|
||||
fillsector(collsectlist[comp][k], comp==0 ? 159 : editorcolors[11]);
|
||||
fillsector_notrans(collsectlist[comp][k], comp==0 ? 159 : editorcolors[11]);
|
||||
|
||||
fade_editor_screen(editorcolors[11] | (159<<8));
|
||||
|
||||
askres = editor_ask_function("Connect yellow ceil w/ blue floor (1) or (v)ice versa?", askchars, 2);
|
||||
if (askres==-1)
|
||||
goto end_join_sectors;
|
||||
|
@ -6234,7 +6235,7 @@ end_point_dragging:
|
|||
|
||||
for (comp=0; comp<2; comp++)
|
||||
for (k=0; k<collnumsects[comp]; k++)
|
||||
fillsector(collsectlist[comp][k], comp==0 ? 159 : editorcolors[11]);
|
||||
fillsector_notrans(collsectlist[comp][k], comp==0 ? 159 : editorcolors[11]);
|
||||
|
||||
fade_editor_screen(editorcolors[11] | (159<<8));
|
||||
askres = editor_ask_function("Move (y)ellow or (b)lue component?", askchars, 2);
|
||||
|
@ -6276,7 +6277,7 @@ end_point_dragging:
|
|||
int32_t movecol = movestat==0 ? 159 : editorcolors[11];
|
||||
for (i=0; i<numsectors; i++)
|
||||
if (tcollbitmap[i>>3]&(1<<(i&7)))
|
||||
fillsector(i, editorcolors[12]);
|
||||
fillsector_notrans(i, editorcolors[12]);
|
||||
|
||||
fade_editor_screen(editorcolors[12] | (movecol<<8));
|
||||
moveonwp = ask_if_sure("Also move formerly wall-connected sectors?",0);
|
||||
|
@ -6444,8 +6445,8 @@ end_point_dragging:
|
|||
}
|
||||
|
||||
{
|
||||
fillsector(i, editorcolors[9]);
|
||||
fillsector(joinsector[0], editorcolors[9]);
|
||||
fillsector_notrans(i, editorcolors[9]);
|
||||
fillsector_notrans(joinsector[0], editorcolors[9]);
|
||||
fade_editor_screen(editorcolors[9]);
|
||||
|
||||
if (!ask_if_sure("Really join non-adjacent sectors? (Y/N)", 0))
|
||||
|
@ -9973,7 +9974,7 @@ static inline int32_t imod(int32_t a, int32_t b)
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t fillsector(int16_t sectnum, int32_t fillcolor)
|
||||
int32_t fillsector_maybetrans(int16_t sectnum, int32_t fillcolor, uint8_t dotrans)
|
||||
{
|
||||
if (sectnum == -1)
|
||||
return 0;
|
||||
|
@ -10096,7 +10097,7 @@ int32_t fillsector(int16_t sectnum, int32_t fillcolor)
|
|||
if (fillist[z+1] > rborder)
|
||||
fillist[z+1] = rborder;
|
||||
|
||||
drawline16(fillist[z]+1,sy, fillist[z+1]-1,sy, -col); //editorcolors[fillcolor]
|
||||
drawline16(fillist[z]+1,sy, fillist[z+1]-1,sy, dotrans ? -col : col); //editorcolors[fillcolor]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7164,7 +7164,7 @@ static void Keys2d(void)
|
|||
if (fb >= 0)
|
||||
{
|
||||
for (SECTORS_OF_BUNCH(fb,YAX_FLOOR, i))
|
||||
fillsector(i, editorcolors[11]);
|
||||
fillsector_notrans(i, editorcolors[11]);
|
||||
fade_editor_screen(editorcolors[11]);
|
||||
|
||||
if (ask_if_sure("Clear all TROR extensions from marked sectors?", 0))
|
||||
|
|
Loading…
Reference in a new issue