Factor out four instances of identical code into M32_DrawRoomsAndMasks().

git-svn-id: https://svn.eduke32.com/eduke32@2314 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-02-04 21:33:52 +00:00
parent a04e15082b
commit 1d0cb07167
3 changed files with 26 additions and 67 deletions

View File

@ -115,6 +115,8 @@ extern int32_t autogray, showinnergray;
int32_t yax_is121(int16_t bunchnum, int16_t getfloor);
#endif
extern void M32_DrawRoomsAndMasks(void);
extern int32_t kopen4loadfrommod(const char *filename, char searchfirst);
// set to 1 to enable:

View File

@ -436,6 +436,26 @@ static void m32_keypresscallback(int32_t code, int32_t downp)
VM_OnEvent(EVENT_KEYPRESS, -1);
}
void M32_DrawRoomsAndMasks(void)
{
yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(ExtAnalyzeSprites, horiz, cursectnum);
ExtAnalyzeSprites();
drawmasks();
#ifdef POLYMER
if (rendmode == 4 && searchit == 2)
{
polymer_editorpick();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
ExtAnalyzeSprites();
drawmasks();
}
#endif
}
#undef STARTUP_SETUP_WINDOW
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
# define STARTUP_SETUP_WINDOW
@ -677,22 +697,7 @@ CANCEL:
ExtPreCheckKeys();
yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(ExtAnalyzeSprites, horiz, cursectnum);
ExtAnalyzeSprites();
drawmasks();
#ifdef POLYMER
if (rendmode == 4 && searchit == 2)
{
polymer_editorpick();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
ExtAnalyzeSprites();
drawmasks();
}
#endif
M32_DrawRoomsAndMasks();
#ifdef M32_SHOWDEBUG
if (searchstat>=0 && (searchwall<0 || searchsector<0))
@ -8590,24 +8595,7 @@ int32_t _getnumber256(const char *namestart, int32_t num, int32_t maxnumber, cha
quitevent = 0;
if ((flags&8)==0)
{
yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(ExtAnalyzeSprites, horiz, cursectnum);
ExtAnalyzeSprites();
drawmasks();
#ifdef POLYMER
if (rendmode == 4 && searchit == 2)
{
polymer_editorpick();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
ExtAnalyzeSprites();
drawmasks();
}
#endif
}
M32_DrawRoomsAndMasks();
ch = bgetchar();
if (keystatus[0x1])

View File

@ -4429,22 +4429,7 @@ static void getnumberptr256(const char *namestart, void *num, int32_t bytes, int
if (handleevents())
quitevent = 0;
yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(ExtAnalyzeSprites, horiz, cursectnum);
ExtAnalyzeSprites();
drawmasks();
#ifdef POLYMER
if (rendmode == 4 && searchit == 2)
{
polymer_editorpick();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
ExtAnalyzeSprites();
drawmasks();
}
#endif
M32_DrawRoomsAndMasks();
ch = bgetchar();
@ -4639,23 +4624,7 @@ ENDFOR1:
if (PRESSED_KEYSC(PGDN))
sprite[linebegspr].pal -= (sprite[linebegspr].pal>0);
yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(ExtAnalyzeSprites, horiz, cursectnum);
ExtAnalyzeSprites();
drawmasks();
#ifdef POLYMER
if (rendmode == 4 && searchit == 2)
{
polymer_editorpick();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
ExtAnalyzeSprites();
drawmasks();
}
#endif
M32_DrawRoomsAndMasks();
ch = bgetchar();