Merge branch 'master' into acz-boss-hardcode
This commit is contained in:
commit
7d0509f1cb
|
@ -148,6 +148,20 @@ void COM_BufInsertText(const char *ptext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Progress the wait timer and flush waiting console commands when ready.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
COM_BufTicker(void)
|
||||||
|
{
|
||||||
|
if (com_wait)
|
||||||
|
{
|
||||||
|
com_wait--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
COM_BufExecute();
|
||||||
|
}
|
||||||
|
|
||||||
/** Flushes (executes) console commands in the buffer.
|
/** Flushes (executes) console commands in the buffer.
|
||||||
*/
|
*/
|
||||||
void COM_BufExecute(void)
|
void COM_BufExecute(void)
|
||||||
|
@ -157,12 +171,6 @@ void COM_BufExecute(void)
|
||||||
char line[1024] = "";
|
char line[1024] = "";
|
||||||
INT32 quotes;
|
INT32 quotes;
|
||||||
|
|
||||||
if (com_wait)
|
|
||||||
{
|
|
||||||
com_wait--;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (com_text.cursize)
|
while (com_text.cursize)
|
||||||
{
|
{
|
||||||
// find a '\n' or; line break
|
// find a '\n' or; line break
|
||||||
|
@ -514,7 +522,6 @@ static void COM_ExecuteString(char *ptext)
|
||||||
{
|
{
|
||||||
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
|
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
|
||||||
{
|
{
|
||||||
recursion = 0;
|
|
||||||
cmd->function();
|
cmd->function();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -526,19 +533,17 @@ static void COM_ExecuteString(char *ptext)
|
||||||
if (!stricmp(com_argv[0], a->name))
|
if (!stricmp(com_argv[0], a->name))
|
||||||
{
|
{
|
||||||
if (recursion > MAX_ALIAS_RECURSION)
|
if (recursion > MAX_ALIAS_RECURSION)
|
||||||
{
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
|
||||||
recursion = 0;
|
else
|
||||||
return;
|
{ // Monster Iestyn: keep track of how many levels of recursion we're in
|
||||||
|
recursion++;
|
||||||
|
COM_BufInsertText(a->value);
|
||||||
|
recursion--;
|
||||||
}
|
}
|
||||||
recursion++;
|
|
||||||
COM_BufInsertText(a->value);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
recursion = 0;
|
|
||||||
|
|
||||||
// check cvars
|
// check cvars
|
||||||
// Hurdler: added at Ebola's request ;)
|
// Hurdler: added at Ebola's request ;)
|
||||||
// (don't flood the console in software mode with bad gr_xxx command)
|
// (don't flood the console in software mode with bad gr_xxx command)
|
||||||
|
|
|
@ -45,6 +45,9 @@ void COM_ImmedExecute(const char *ptext);
|
||||||
// Execute commands in buffer, flush them
|
// Execute commands in buffer, flush them
|
||||||
void COM_BufExecute(void);
|
void COM_BufExecute(void);
|
||||||
|
|
||||||
|
// As above; and progress the wait timer.
|
||||||
|
void COM_BufTicker(void);
|
||||||
|
|
||||||
// setup command buffer, at game tartup
|
// setup command buffer, at game tartup
|
||||||
void COM_Init(void);
|
void COM_Init(void);
|
||||||
|
|
||||||
|
|
|
@ -1115,16 +1115,6 @@ boolean CON_Responder(event_t *ev)
|
||||||
else if (key == KEY_KPADSLASH)
|
else if (key == KEY_KPADSLASH)
|
||||||
key = '/';
|
key = '/';
|
||||||
|
|
||||||
// capslock
|
|
||||||
if (key == KEY_CAPSLOCK) // it's a toggle.
|
|
||||||
{
|
|
||||||
if (capslock)
|
|
||||||
capslock = false;
|
|
||||||
else
|
|
||||||
capslock = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key >= 'a' && key <= 'z')
|
if (key >= 'a' && key <= 'z')
|
||||||
{
|
{
|
||||||
if (capslock ^ shiftdown)
|
if (capslock ^ shiftdown)
|
||||||
|
|
|
@ -1127,7 +1127,8 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
INT32 ccstime = I_GetTime();
|
INT32 ccstime = I_GetTime();
|
||||||
|
|
||||||
// Draw background fade
|
// Draw background fade
|
||||||
V_DrawFadeScreen(0xFF00, 16);
|
if (!menuactive) // menu already draws its own fade
|
||||||
|
V_DrawFadeScreen(0xFF00, 16); // force default
|
||||||
|
|
||||||
// Draw the bottom box.
|
// Draw the bottom box.
|
||||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||||
|
@ -2002,6 +2003,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
|
||||||
#ifdef CLIENT_LOADINGSCREEN
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
||||||
{
|
{
|
||||||
|
F_MenuPresTicker(true); // title sky
|
||||||
F_TitleScreenTicker(true);
|
F_TitleScreenTicker(true);
|
||||||
F_TitleScreenDrawer();
|
F_TitleScreenDrawer();
|
||||||
CL_DrawConnectionStatus();
|
CL_DrawConnectionStatus();
|
||||||
|
@ -2612,7 +2614,10 @@ static void Command_Ban(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (server) // only the server is allowed to do this right now
|
if (server) // only the server is allowed to do this right now
|
||||||
|
{
|
||||||
Ban_Add(COM_Argv(2));
|
Ban_Add(COM_Argv(2));
|
||||||
|
D_SaveBan(); // save the ban list
|
||||||
|
}
|
||||||
|
|
||||||
if (COM_Argc() == 2)
|
if (COM_Argc() == 2)
|
||||||
{
|
{
|
||||||
|
@ -2643,6 +2648,42 @@ static void Command_Ban(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Command_BanIP(void)
|
||||||
|
{
|
||||||
|
if (COM_Argc() < 2)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("banip <ip> <reason>: ban an ip address\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (server) // Only the server can use this, otherwise does nothing.
|
||||||
|
{
|
||||||
|
const char *address = (COM_Argv(1));
|
||||||
|
const char *reason;
|
||||||
|
|
||||||
|
if (COM_Argc() == 2)
|
||||||
|
reason = NULL;
|
||||||
|
else
|
||||||
|
reason = COM_Argv(2);
|
||||||
|
|
||||||
|
|
||||||
|
if (I_SetBanAddress && I_SetBanAddress(address, NULL))
|
||||||
|
{
|
||||||
|
if (reason)
|
||||||
|
CONS_Printf("Banned IP address %s for: %s\n", address, reason);
|
||||||
|
else
|
||||||
|
CONS_Printf("Banned IP address %s\n", address);
|
||||||
|
|
||||||
|
Ban_Add(reason);
|
||||||
|
D_SaveBan();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void Command_Kick(void)
|
static void Command_Kick(void)
|
||||||
{
|
{
|
||||||
if (COM_Argc() < 2)
|
if (COM_Argc() < 2)
|
||||||
|
@ -2922,6 +2963,7 @@ void D_ClientServerInit(void)
|
||||||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||||
COM_AddCommand("kick", Command_Kick);
|
COM_AddCommand("kick", Command_Kick);
|
||||||
COM_AddCommand("ban", Command_Ban);
|
COM_AddCommand("ban", Command_Ban);
|
||||||
|
COM_AddCommand("banip", Command_BanIP);
|
||||||
COM_AddCommand("clearbans", Command_ClearBans);
|
COM_AddCommand("clearbans", Command_ClearBans);
|
||||||
COM_AddCommand("showbanlist", Command_ShowBan);
|
COM_AddCommand("showbanlist", Command_ShowBan);
|
||||||
COM_AddCommand("reloadbans", Command_ReloadBan);
|
COM_AddCommand("reloadbans", Command_ReloadBan);
|
||||||
|
@ -4577,7 +4619,7 @@ void TryRunTics(tic_t realtics)
|
||||||
|
|
||||||
if (realtics >= 1)
|
if (realtics >= 1)
|
||||||
{
|
{
|
||||||
COM_BufExecute();
|
COM_BufTicker();
|
||||||
if (mapchangepending)
|
if (mapchangepending)
|
||||||
D_MapChange(-1, 0, ultimatemode, false, 2, false, fromlevelselect); // finish the map change
|
D_MapChange(-1, 0, ultimatemode, false, 2, false, fromlevelselect); // finish the map change
|
||||||
}
|
}
|
||||||
|
|
80
src/d_main.c
80
src/d_main.c
|
@ -157,37 +157,11 @@ void D_PostEvent_end(void) {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// modifier keys
|
// modifier keys
|
||||||
|
// Now handled in I_OsPolling
|
||||||
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
|
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
|
||||||
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
||||||
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
||||||
boolean capslock = 0; // gee i wonder what this does.
|
boolean capslock = 0; // gee i wonder what this does.
|
||||||
//
|
|
||||||
// D_ModifierKeyResponder
|
|
||||||
// Sets global shift/ctrl/alt variables, never actually eats events
|
|
||||||
//
|
|
||||||
static inline void D_ModifierKeyResponder(event_t *ev)
|
|
||||||
{
|
|
||||||
if (ev->type == ev_keydown || ev->type == ev_console) switch (ev->data1)
|
|
||||||
{
|
|
||||||
case KEY_LSHIFT: shiftdown |= 0x1; return;
|
|
||||||
case KEY_RSHIFT: shiftdown |= 0x2; return;
|
|
||||||
case KEY_LCTRL: ctrldown |= 0x1; return;
|
|
||||||
case KEY_RCTRL: ctrldown |= 0x2; return;
|
|
||||||
case KEY_LALT: altdown |= 0x1; return;
|
|
||||||
case KEY_RALT: altdown |= 0x2; return;
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
else if (ev->type == ev_keyup) switch (ev->data1)
|
|
||||||
{
|
|
||||||
case KEY_LSHIFT: shiftdown &= ~0x1; return;
|
|
||||||
case KEY_RSHIFT: shiftdown &= ~0x2; return;
|
|
||||||
case KEY_LCTRL: ctrldown &= ~0x1; return;
|
|
||||||
case KEY_RCTRL: ctrldown &= ~0x2; return;
|
|
||||||
case KEY_LALT: altdown &= ~0x1; return;
|
|
||||||
case KEY_RALT: altdown &= ~0x2; return;
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// D_ProcessEvents
|
// D_ProcessEvents
|
||||||
|
@ -201,9 +175,6 @@ void D_ProcessEvents(void)
|
||||||
{
|
{
|
||||||
ev = &events[eventtail];
|
ev = &events[eventtail];
|
||||||
|
|
||||||
// Set global shift/ctrl/alt down variables
|
|
||||||
D_ModifierKeyResponder(ev); // never eats events
|
|
||||||
|
|
||||||
// Screenshots over everything so that they can be taken anywhere.
|
// Screenshots over everything so that they can be taken anywhere.
|
||||||
if (M_ScreenshotResponder(ev))
|
if (M_ScreenshotResponder(ev))
|
||||||
continue; // ate the event
|
continue; // ate the event
|
||||||
|
@ -234,6 +205,9 @@ void D_ProcessEvents(void)
|
||||||
// wipegamestate can be set to -1 to force a wipe on the next draw
|
// wipegamestate can be set to -1 to force a wipe on the next draw
|
||||||
// added comment : there is a wipe eatch change of the gamestate
|
// added comment : there is a wipe eatch change of the gamestate
|
||||||
gamestate_t wipegamestate = GS_LEVEL;
|
gamestate_t wipegamestate = GS_LEVEL;
|
||||||
|
// -1: Default; 0-n: Wipe index; INT16_MAX: do not wipe
|
||||||
|
INT16 wipetypepre = -1;
|
||||||
|
INT16 wipetypepost = -1;
|
||||||
|
|
||||||
static void D_Display(void)
|
static void D_Display(void)
|
||||||
{
|
{
|
||||||
|
@ -267,7 +241,7 @@ static void D_Display(void)
|
||||||
|
|
||||||
// save the current screen if about to wipe
|
// save the current screen if about to wipe
|
||||||
wipe = (gamestate != wipegamestate);
|
wipe = (gamestate != wipegamestate);
|
||||||
if (wipe)
|
if (wipe && wipetypepre != INT16_MAX)
|
||||||
{
|
{
|
||||||
// set for all later
|
// set for all later
|
||||||
wipedefindex = gamestate; // wipe_xxx_toblack
|
wipedefindex = gamestate; // wipe_xxx_toblack
|
||||||
|
@ -279,27 +253,37 @@ static void D_Display(void)
|
||||||
wipedefindex = wipe_multinter_toblack;
|
wipedefindex = wipe_multinter_toblack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wipetypepre < 0 || !F_WipeExists(wipetypepre))
|
||||||
|
wipetypepre = wipedefs[wipedefindex];
|
||||||
|
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
{
|
{
|
||||||
// Fade to black first
|
// Fade to black first
|
||||||
if ((wipegamestate != (gamestate_t)-2) // fades to black on its own timing, always
|
if ((wipegamestate == (gamestate_t)FORCEWIPE ||
|
||||||
&& wipedefs[wipedefindex] != UINT8_MAX)
|
(wipegamestate != (gamestate_t)FORCEWIPEOFF
|
||||||
|
&& !(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)))
|
||||||
|
) // fades to black on its own timing, always
|
||||||
|
&& wipetypepre != UINT8_MAX)
|
||||||
{
|
{
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
F_WipeEndScreen();
|
F_WipeEndScreen();
|
||||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wipetypepre = -1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
wipetypepre = -1;
|
||||||
|
|
||||||
// do buffered drawing
|
// do buffered drawing
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
case GS_TITLESCREEN:
|
case GS_TITLESCREEN:
|
||||||
if (!titlemapinaction) {
|
if (!titlemapinaction || !curbghide) {
|
||||||
F_TitleScreenDrawer();
|
F_TitleScreenDrawer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -361,14 +345,14 @@ static void D_Display(void)
|
||||||
|
|
||||||
// STUPID race condition...
|
// STUPID race condition...
|
||||||
if (wipegamestate == GS_INTRO && gamestate == GS_TITLESCREEN)
|
if (wipegamestate == GS_INTRO && gamestate == GS_TITLESCREEN)
|
||||||
wipegamestate = -2;
|
wipegamestate = FORCEWIPEOFF;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wipegamestate = gamestate;
|
wipegamestate = gamestate;
|
||||||
|
|
||||||
// clean up border stuff
|
// clean up border stuff
|
||||||
// see if the border needs to be initially drawn
|
// see if the border needs to be initially drawn
|
||||||
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction))
|
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction && curbghide))
|
||||||
{
|
{
|
||||||
// draw the view directly
|
// draw the view directly
|
||||||
|
|
||||||
|
@ -477,18 +461,25 @@ static void D_Display(void)
|
||||||
//
|
//
|
||||||
// wipe update
|
// wipe update
|
||||||
//
|
//
|
||||||
if (wipe)
|
if (wipe && wipetypepost != INT16_MAX)
|
||||||
{
|
{
|
||||||
// note: moved up here because NetUpdate does input changes
|
// note: moved up here because NetUpdate does input changes
|
||||||
// and input during wipe tends to mess things up
|
// and input during wipe tends to mess things up
|
||||||
wipedefindex += WIPEFINALSHIFT;
|
wipedefindex += WIPEFINALSHIFT;
|
||||||
|
|
||||||
|
if (wipetypepost < 0 || !F_WipeExists(wipetypepost))
|
||||||
|
wipetypepost = wipedefs[wipedefindex];
|
||||||
|
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
{
|
{
|
||||||
F_WipeEndScreen();
|
F_WipeEndScreen();
|
||||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wipetypepost = -1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
wipetypepost = -1;
|
||||||
|
|
||||||
NetUpdate(); // send out any new accumulation
|
NetUpdate(); // send out any new accumulation
|
||||||
|
|
||||||
|
@ -741,8 +732,11 @@ void D_StartTitle(void)
|
||||||
gametype = GT_COOP;
|
gametype = GT_COOP;
|
||||||
paused = false;
|
paused = false;
|
||||||
advancedemo = false;
|
advancedemo = false;
|
||||||
|
F_InitMenuPresValues();
|
||||||
F_StartTitleScreen();
|
F_StartTitleScreen();
|
||||||
|
|
||||||
|
currentMenu = &MainDef; // reset the current menu ID
|
||||||
|
|
||||||
// Reset the palette
|
// Reset the palette
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
V_SetPaletteLump("PLAYPAL");
|
V_SetPaletteLump("PLAYPAL");
|
||||||
|
@ -1114,6 +1108,13 @@ void D_SRB2Main(void)
|
||||||
// adapt tables to SRB2's needs, including extra slots for dehacked file support
|
// adapt tables to SRB2's needs, including extra slots for dehacked file support
|
||||||
P_PatchInfoTables();
|
P_PatchInfoTables();
|
||||||
|
|
||||||
|
// initiate menu metadata before SOCcing them
|
||||||
|
M_InitMenuPresTables();
|
||||||
|
|
||||||
|
// init title screen display params
|
||||||
|
if (M_CheckParm("-connect"))
|
||||||
|
F_InitMenuPresValues();
|
||||||
|
|
||||||
//---------------------------------------------------- READY TIME
|
//---------------------------------------------------- READY TIME
|
||||||
// we need to check for dedicated before initialization of some subsystems
|
// we need to check for dedicated before initialization of some subsystems
|
||||||
|
|
||||||
|
@ -1400,6 +1401,7 @@ void D_SRB2Main(void)
|
||||||
}
|
}
|
||||||
else if (M_CheckParm("-skipintro"))
|
else if (M_CheckParm("-skipintro"))
|
||||||
{
|
{
|
||||||
|
F_InitMenuPresValues();
|
||||||
F_StartTitleScreen();
|
F_StartTitleScreen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
315
src/dehacked.c
315
src/dehacked.c
|
@ -72,6 +72,7 @@ static sfxenum_t get_sfx(const char *word);
|
||||||
static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
|
static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
|
||||||
#endif
|
#endif
|
||||||
static hudnum_t get_huditem(const char *word);
|
static hudnum_t get_huditem(const char *word);
|
||||||
|
static menutype_t get_menutype(const char *word);
|
||||||
#ifndef HAVE_BLUA
|
#ifndef HAVE_BLUA
|
||||||
static powertype_t get_power(const char *word);
|
static powertype_t get_power(const char *word);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1931,6 +1932,161 @@ static void readtextprompt(MYFILE *f, INT32 num)
|
||||||
Z_Free(s);
|
Z_Free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void readmenu(MYFILE *f, INT32 num)
|
||||||
|
{
|
||||||
|
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||||
|
char *word = s;
|
||||||
|
char *word2;
|
||||||
|
char *tmp;
|
||||||
|
INT32 value;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (myfgets(s, MAXLINELEN, f))
|
||||||
|
{
|
||||||
|
if (s[0] == '\n')
|
||||||
|
break;
|
||||||
|
|
||||||
|
// First remove trailing newline, if there is one
|
||||||
|
tmp = strchr(s, '\n');
|
||||||
|
if (tmp)
|
||||||
|
*tmp = '\0';
|
||||||
|
|
||||||
|
tmp = strchr(s, '#');
|
||||||
|
if (tmp)
|
||||||
|
*tmp = '\0';
|
||||||
|
if (s == tmp)
|
||||||
|
continue; // Skip comment lines, but don't break.
|
||||||
|
|
||||||
|
// Get the part before the " = "
|
||||||
|
tmp = strchr(s, '=');
|
||||||
|
if (tmp)
|
||||||
|
*(tmp-1) = '\0';
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
strupr(word);
|
||||||
|
|
||||||
|
// Now get the part after
|
||||||
|
word2 = (tmp += 2);
|
||||||
|
strupr(word2);
|
||||||
|
|
||||||
|
value = atoi(word2); // used for numerical settings
|
||||||
|
|
||||||
|
if (fastcmp(word, "BACKGROUNDNAME"))
|
||||||
|
{
|
||||||
|
strncpy(menupres[num].bgname, word2, 8);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "HIDEBACKGROUND"))
|
||||||
|
{
|
||||||
|
menupres[num].bghide = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "BACKGROUNDCOLOR"))
|
||||||
|
{
|
||||||
|
menupres[num].bgcolor = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "HIDEPICS"))
|
||||||
|
{
|
||||||
|
// true by default, except MM_MAIN
|
||||||
|
menupres[num].hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "TITLESCROLLSPEED") || fastcmp(word, "TITLESCROLLXSPEED")
|
||||||
|
|| fastcmp(word, "SCROLLSPEED") || fastcmp(word, "SCROLLXSPEED"))
|
||||||
|
{
|
||||||
|
menupres[num].titlescrollxspeed = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "TITLESCROLLYSPEED") || fastcmp(word, "SCROLLYSPEED"))
|
||||||
|
{
|
||||||
|
menupres[num].titlescrollyspeed = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "MUSIC"))
|
||||||
|
{
|
||||||
|
strncpy(menupres[num].musname, word2, 7);
|
||||||
|
menupres[num].musname[6] = 0;
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
#ifdef MUSICSLOT_COMPATIBILITY
|
||||||
|
else if (fastcmp(word, "MUSICSLOT"))
|
||||||
|
{
|
||||||
|
value = get_mus(word2, true);
|
||||||
|
if (value && value <= 1035)
|
||||||
|
snprintf(menupres[num].musname, 7, "%sM", G_BuildMapName(value));
|
||||||
|
else if (value && value <= 1050)
|
||||||
|
strncpy(menupres[num].musname, compat_special_music_slots[value - 1036], 7);
|
||||||
|
else
|
||||||
|
menupres[num].musname[0] = 0; // becomes empty string
|
||||||
|
menupres[num].musname[6] = 0;
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else if (fastcmp(word, "MUSICTRACK"))
|
||||||
|
{
|
||||||
|
menupres[num].mustrack = ((UINT16)value - 1);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "MUSICLOOP"))
|
||||||
|
{
|
||||||
|
// true by default except MM_MAIN
|
||||||
|
menupres[num].muslooping = (value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "NOMUSIC"))
|
||||||
|
{
|
||||||
|
menupres[num].musstop = (value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "IGNOREMUSIC"))
|
||||||
|
{
|
||||||
|
menupres[num].musignore = (value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "FADESTRENGTH"))
|
||||||
|
{
|
||||||
|
// one-based, <= 0 means use default value. 1-32
|
||||||
|
menupres[num].fadestrength = get_number(word2)-1;
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "NOENTERBUBBLE"))
|
||||||
|
{
|
||||||
|
menupres[num].enterbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "NOEXITBUBBLE"))
|
||||||
|
{
|
||||||
|
menupres[num].exitbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "ENTERTAG"))
|
||||||
|
{
|
||||||
|
menupres[num].entertag = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "EXITTAG"))
|
||||||
|
{
|
||||||
|
menupres[num].exittag = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "ENTERWIPE"))
|
||||||
|
{
|
||||||
|
menupres[num].enterwipe = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "EXITWIPE"))
|
||||||
|
{
|
||||||
|
menupres[num].exitwipe = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (!myfeof(f)); // finish when the line is empty
|
||||||
|
|
||||||
|
Z_Free(s);
|
||||||
|
}
|
||||||
|
|
||||||
static void readhuditem(MYFILE *f, INT32 num)
|
static void readhuditem(MYFILE *f, INT32 num)
|
||||||
{
|
{
|
||||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||||
|
@ -3186,9 +3342,14 @@ static void readmaincfg(MYFILE *f)
|
||||||
hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
|
hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
titlechanged = true;
|
titlechanged = true;
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "TITLESCROLLSPEED"))
|
else if (fastcmp(word, "TITLESCROLLSPEED") || fastcmp(word, "TITLESCROLLXSPEED"))
|
||||||
{
|
{
|
||||||
titlescrollspeed = get_number(word2);
|
titlescrollxspeed = get_number(word2);
|
||||||
|
titlechanged = true;
|
||||||
|
}
|
||||||
|
else if (fastcmp(word, "TITLESCROLLYSPEED"))
|
||||||
|
{
|
||||||
|
titlescrollyspeed = get_number(word2);
|
||||||
titlechanged = true;
|
titlechanged = true;
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "CREDITSCUTSCENE"))
|
else if (fastcmp(word, "CREDITSCUTSCENE"))
|
||||||
|
@ -3736,6 +3897,19 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
||||||
ignorelines(f);
|
ignorelines(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fastcmp(word, "MENU"))
|
||||||
|
{
|
||||||
|
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||||
|
i = get_menutype(word2); // find a huditem by name
|
||||||
|
if (i >= 1 && i < NUMMENUTYPES)
|
||||||
|
readmenu(f, i);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// zero-based, but let's start at 1
|
||||||
|
deh_warning("Menu number %d out of range (1 - %d)", i, NUMMENUTYPES-1);
|
||||||
|
ignorelines(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (fastcmp(word, "UNLOCKABLE"))
|
else if (fastcmp(word, "UNLOCKABLE"))
|
||||||
{
|
{
|
||||||
if (!mainfile && !gamedataadded)
|
if (!mainfile && !gamedataadded)
|
||||||
|
@ -5482,6 +5656,16 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_CACTI2",
|
"S_CACTI2",
|
||||||
"S_CACTI3",
|
"S_CACTI3",
|
||||||
"S_CACTI4",
|
"S_CACTI4",
|
||||||
|
"S_CACTI5",
|
||||||
|
"S_CACTI6",
|
||||||
|
"S_CACTI7",
|
||||||
|
"S_CACTI8",
|
||||||
|
"S_CACTI9",
|
||||||
|
|
||||||
|
// Warning signs sprites
|
||||||
|
"S_ARIDSIGN_CAUTION",
|
||||||
|
"S_ARIDSIGN_CACTI",
|
||||||
|
"S_ARIDSIGN_SHARPTURN",
|
||||||
|
|
||||||
// Flame jet
|
// Flame jet
|
||||||
"S_FLAMEJETSTND",
|
"S_FLAMEJETSTND",
|
||||||
|
@ -7162,6 +7346,14 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_CACTI2",
|
"MT_CACTI2",
|
||||||
"MT_CACTI3",
|
"MT_CACTI3",
|
||||||
"MT_CACTI4",
|
"MT_CACTI4",
|
||||||
|
"MT_CACTI5",
|
||||||
|
"MT_CACTI6",
|
||||||
|
"MT_CACTI7",
|
||||||
|
"MT_CACTI8",
|
||||||
|
"MT_CACTI9",
|
||||||
|
"MT_ARIDSIGN_CAUTION",
|
||||||
|
"MT_ARIDSIGN_CACTI",
|
||||||
|
"MT_ARIDSIGN_SHARPTURN",
|
||||||
|
|
||||||
// Red Volcano Scenery
|
// Red Volcano Scenery
|
||||||
"MT_FLAMEJET",
|
"MT_FLAMEJET",
|
||||||
|
@ -7873,6 +8065,96 @@ static const char *const HUDITEMS_LIST[] = {
|
||||||
"LAP"
|
"LAP"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *const MENUTYPES_LIST[] = {
|
||||||
|
"NONE",
|
||||||
|
|
||||||
|
"MAIN",
|
||||||
|
|
||||||
|
// Single Player
|
||||||
|
"SP_MAIN",
|
||||||
|
|
||||||
|
"SP_LOAD",
|
||||||
|
"SP_PLAYER",
|
||||||
|
|
||||||
|
"SP_LEVELSELECT",
|
||||||
|
"SP_LEVELSTATS",
|
||||||
|
|
||||||
|
"SP_TIMEATTACK",
|
||||||
|
"SP_TIMEATTACK_LEVELSELECT",
|
||||||
|
"SP_GUESTREPLAY",
|
||||||
|
"SP_REPLAY",
|
||||||
|
"SP_GHOST",
|
||||||
|
|
||||||
|
"SP_NIGHTSATTACK",
|
||||||
|
"SP_NIGHTS_LEVELSELECT",
|
||||||
|
"SP_NIGHTS_GUESTREPLAY",
|
||||||
|
"SP_NIGHTS_REPLAY",
|
||||||
|
"SP_NIGHTS_GHOST",
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
|
"MP_MAIN",
|
||||||
|
"MP_SPLITSCREEN", // SplitServer
|
||||||
|
"MP_SERVER",
|
||||||
|
"MP_CONNECT",
|
||||||
|
"MP_ROOM",
|
||||||
|
"MP_PLAYERSETUP", // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
||||||
|
|
||||||
|
// Options
|
||||||
|
"OP_MAIN",
|
||||||
|
|
||||||
|
"OP_P1CONTROLS",
|
||||||
|
"OP_CHANGECONTROLS", // OP_ChangeControlsDef shared with P2
|
||||||
|
"OP_P1MOUSE",
|
||||||
|
"OP_P1JOYSTICK",
|
||||||
|
"OP_JOYSTICKSET", // OP_JoystickSetDef shared with P2
|
||||||
|
|
||||||
|
"OP_P2CONTROLS",
|
||||||
|
"OP_P2MOUSE",
|
||||||
|
"OP_P2JOYSTICK",
|
||||||
|
|
||||||
|
"OP_VIDEO",
|
||||||
|
"OP_VIDEOMODE",
|
||||||
|
"OP_COLOR",
|
||||||
|
"OP_OPENGL",
|
||||||
|
"OP_OPENGL_LIGHTING",
|
||||||
|
"OP_OPENGL_FOG",
|
||||||
|
"OP_OPENGL_COLOR",
|
||||||
|
|
||||||
|
"OP_SOUND",
|
||||||
|
|
||||||
|
"OP_SERVER",
|
||||||
|
"OP_MONITORTOGGLE",
|
||||||
|
|
||||||
|
"OP_DATA",
|
||||||
|
"OP_ADDONS",
|
||||||
|
"OP_SCREENSHOTS",
|
||||||
|
"OP_ERASEDATA",
|
||||||
|
|
||||||
|
// Secrets
|
||||||
|
"SR_MAIN",
|
||||||
|
"SR_PANDORA",
|
||||||
|
"SR_LEVELSELECT",
|
||||||
|
"SR_UNLOCKCHECKLIST",
|
||||||
|
"SR_EMBLEMHINT",
|
||||||
|
|
||||||
|
// Addons (Part of MISC, but let's make it our own)
|
||||||
|
"AD_MAIN",
|
||||||
|
|
||||||
|
// MISC
|
||||||
|
// "MESSAGE",
|
||||||
|
// "SPAUSE",
|
||||||
|
|
||||||
|
// "MPAUSE",
|
||||||
|
// "SCRAMBLETEAM",
|
||||||
|
// "CHANGETEAM",
|
||||||
|
// "CHANGELEVEL",
|
||||||
|
|
||||||
|
// "MAPAUSE",
|
||||||
|
// "HELP",
|
||||||
|
|
||||||
|
"SPECIAL"
|
||||||
|
};
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
const char *n;
|
const char *n;
|
||||||
// has to be able to hold both fixed_t and angle_t, so drastic measure!!
|
// has to be able to hold both fixed_t and angle_t, so drastic measure!!
|
||||||
|
@ -8574,6 +8856,20 @@ static hudnum_t get_huditem(const char *word)
|
||||||
return HUD_LIVES;
|
return HUD_LIVES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static menutype_t get_menutype(const char *word)
|
||||||
|
{ // Returns the value of MN_ enumerations
|
||||||
|
menutype_t i;
|
||||||
|
if (*word >= '0' && *word <= '9')
|
||||||
|
return atoi(word);
|
||||||
|
if (fastncmp("MN_",word,3))
|
||||||
|
word += 3; // take off the MN_
|
||||||
|
for (i = 0; i < NUMMENUTYPES; i++)
|
||||||
|
if (fastcmp(word, MENUTYPES_LIST[i]))
|
||||||
|
return i;
|
||||||
|
deh_warning("Couldn't find menutype named 'MN_%s'",word);
|
||||||
|
return MN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef HAVE_BLUA
|
#ifndef HAVE_BLUA
|
||||||
static powertype_t get_power(const char *word)
|
static powertype_t get_power(const char *word)
|
||||||
{ // Returns the vlaue of pw_ enumerations
|
{ // Returns the vlaue of pw_ enumerations
|
||||||
|
@ -8770,6 +9066,11 @@ static fixed_t find_const(const char **rword)
|
||||||
free(word);
|
free(word);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
else if (fastncmp("MN_",word,4)) {
|
||||||
|
r = get_menutype(word);
|
||||||
|
free(word);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
else if (fastncmp("HUD_",word,4)) {
|
else if (fastncmp("HUD_",word,4)) {
|
||||||
r = get_huditem(word);
|
r = get_huditem(word);
|
||||||
free(word);
|
free(word);
|
||||||
|
@ -9238,6 +9539,16 @@ static inline int lib_getenum(lua_State *L)
|
||||||
if (mathlib) return luaL_error(L, "skincolor '%s' could not be found.\n", word);
|
if (mathlib) return luaL_error(L, "skincolor '%s' could not be found.\n", word);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (fastncmp("MN_",word,3)) {
|
||||||
|
p = word+3;
|
||||||
|
for (i = 0; i < NUMMENUTYPES; i++)
|
||||||
|
if (fastcmp(p, MENUTYPES_LIST[i])) {
|
||||||
|
lua_pushinteger(L, i);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (mathlib) return luaL_error(L, "menutype '%s' could not be found.\n", word);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else if (!mathlib && fastncmp("A_",word,2)) {
|
else if (!mathlib && fastncmp("A_",word,2)) {
|
||||||
char *caps;
|
char *caps;
|
||||||
// Try to get a Lua action first.
|
// Try to get a Lua action first.
|
||||||
|
|
|
@ -555,6 +555,8 @@ extern boolean precache;
|
||||||
// wipegamestate can be set to -1
|
// wipegamestate can be set to -1
|
||||||
// to force a wipe on the next draw
|
// to force a wipe on the next draw
|
||||||
extern gamestate_t wipegamestate;
|
extern gamestate_t wipegamestate;
|
||||||
|
extern INT16 wipetypepre;
|
||||||
|
extern INT16 wipetypepost;
|
||||||
|
|
||||||
// debug flag to cancel adaptiveness
|
// debug flag to cancel adaptiveness
|
||||||
extern boolean singletics;
|
extern boolean singletics;
|
||||||
|
|
268
src/f_finale.c
268
src/f_finale.c
|
@ -44,14 +44,15 @@
|
||||||
// Stage of animation:
|
// Stage of animation:
|
||||||
// 0 = text, 1 = art screen
|
// 0 = text, 1 = art screen
|
||||||
static INT32 finalecount;
|
static INT32 finalecount;
|
||||||
INT32 titlescrollspeed = 80;
|
INT32 titlescrollxspeed = 80;
|
||||||
|
INT32 titlescrollyspeed = 0;
|
||||||
UINT8 titlemapinaction = TITLEMAP_OFF;
|
UINT8 titlemapinaction = TITLEMAP_OFF;
|
||||||
|
|
||||||
static INT32 timetonext; // Delay between screen changes
|
static INT32 timetonext; // Delay between screen changes
|
||||||
static INT32 continuetime; // Short delay when continuing
|
static INT32 continuetime; // Short delay when continuing
|
||||||
|
|
||||||
static tic_t animtimer; // Used for some animation timings
|
static tic_t animtimer; // Used for some animation timings
|
||||||
static INT16 skullAnimCounter; // Chevron animation
|
static INT16 skullAnimCounter; // Prompts: Chevron animation
|
||||||
static INT32 roidtics; // Asteroid spinning
|
static INT32 roidtics; // Asteroid spinning
|
||||||
|
|
||||||
static INT32 deplete;
|
static INT32 deplete;
|
||||||
|
@ -60,6 +61,20 @@ static tic_t stoptimer;
|
||||||
static boolean keypressed = false;
|
static boolean keypressed = false;
|
||||||
|
|
||||||
// (no longer) De-Demo'd Title Screen
|
// (no longer) De-Demo'd Title Screen
|
||||||
|
static tic_t xscrolltimer;
|
||||||
|
static tic_t yscrolltimer;
|
||||||
|
static INT32 menuanimtimer; // Title screen: background animation timing
|
||||||
|
mobj_t *titlemapcameraref = NULL;
|
||||||
|
|
||||||
|
// menu presentation state
|
||||||
|
char curbgname[8];
|
||||||
|
SINT8 curfadevalue;
|
||||||
|
boolean curhidepics;
|
||||||
|
INT32 curbgcolor;
|
||||||
|
INT32 curbgxspeed;
|
||||||
|
INT32 curbgyspeed;
|
||||||
|
boolean curbghide;
|
||||||
|
|
||||||
static UINT8 curDemo = 0;
|
static UINT8 curDemo = 0;
|
||||||
static UINT32 demoDelayLeft;
|
static UINT32 demoDelayLeft;
|
||||||
static UINT32 demoIdleLeft;
|
static UINT32 demoIdleLeft;
|
||||||
|
@ -80,8 +95,6 @@ static patch_t *ttspop5;
|
||||||
static patch_t *ttspop6;
|
static patch_t *ttspop6;
|
||||||
static patch_t *ttspop7;
|
static patch_t *ttspop7;
|
||||||
|
|
||||||
static void F_SkyScroll(INT32 scrollspeed);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// PROMPT STATE
|
// PROMPT STATE
|
||||||
//
|
//
|
||||||
|
@ -182,101 +195,6 @@ static void F_NewCutscene(const char *basetext)
|
||||||
cutscene_textcount = TICRATE/2;
|
cutscene_textcount = TICRATE/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// F_DrawPatchCol
|
|
||||||
//
|
|
||||||
static void F_DrawPatchCol(INT32 x, patch_t *patch, INT32 col)
|
|
||||||
{
|
|
||||||
const column_t *column;
|
|
||||||
const UINT8 *source;
|
|
||||||
UINT8 *desttop, *dest = NULL;
|
|
||||||
const UINT8 *deststop, *destbottom;
|
|
||||||
size_t count;
|
|
||||||
|
|
||||||
desttop = screens[0] + x*vid.dupx;
|
|
||||||
deststop = screens[0] + vid.rowbytes * vid.height;
|
|
||||||
destbottom = desttop + vid.height*vid.width;
|
|
||||||
|
|
||||||
do {
|
|
||||||
INT32 topdelta, prevdelta = -1;
|
|
||||||
column = (column_t *)((UINT8 *)patch + LONG(patch->columnofs[col]));
|
|
||||||
|
|
||||||
// step through the posts in a column
|
|
||||||
while (column->topdelta != 0xff)
|
|
||||||
{
|
|
||||||
topdelta = column->topdelta;
|
|
||||||
if (topdelta <= prevdelta)
|
|
||||||
topdelta += prevdelta;
|
|
||||||
prevdelta = topdelta;
|
|
||||||
source = (const UINT8 *)column + 3;
|
|
||||||
dest = desttop + topdelta*vid.width;
|
|
||||||
count = column->length;
|
|
||||||
|
|
||||||
while (count--)
|
|
||||||
{
|
|
||||||
INT32 dupycount = vid.dupy;
|
|
||||||
|
|
||||||
while (dupycount-- && dest < destbottom)
|
|
||||||
{
|
|
||||||
INT32 dupxcount = vid.dupx;
|
|
||||||
while (dupxcount-- && dest <= deststop)
|
|
||||||
*dest++ = *source;
|
|
||||||
|
|
||||||
dest += (vid.width - vid.dupx);
|
|
||||||
}
|
|
||||||
source++;
|
|
||||||
}
|
|
||||||
column = (const column_t *)((const UINT8 *)column + column->length + 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
desttop += SHORT(patch->height)*vid.dupy*vid.width;
|
|
||||||
} while(dest < destbottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// F_SkyScroll
|
|
||||||
//
|
|
||||||
static void F_SkyScroll(INT32 scrollspeed)
|
|
||||||
{
|
|
||||||
INT32 scrolled, x, mx, fakedwidth;
|
|
||||||
patch_t *pat;
|
|
||||||
INT16 patwidth;
|
|
||||||
|
|
||||||
pat = W_CachePatchName("TITLESKY", PU_CACHE);
|
|
||||||
|
|
||||||
patwidth = SHORT(pat->width);
|
|
||||||
animtimer = ((finalecount*scrollspeed)/16 + patwidth) % patwidth;
|
|
||||||
|
|
||||||
fakedwidth = vid.width / vid.dupx;
|
|
||||||
|
|
||||||
if (rendermode == render_soft)
|
|
||||||
{ // if only hardware rendering could be this elegant and complete
|
|
||||||
scrolled = (patwidth - animtimer) - 1;
|
|
||||||
for (x = 0, mx = scrolled; x < fakedwidth; x++, mx = (mx+1)%patwidth)
|
|
||||||
F_DrawPatchCol(x, pat, mx);
|
|
||||||
}
|
|
||||||
#ifdef HWRENDER
|
|
||||||
else if (rendermode != render_none)
|
|
||||||
{ // if only software rendering could be this simple and retarded
|
|
||||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
|
||||||
INT32 y, pw = patwidth * dupz, ph = SHORT(pat->height) * dupz;
|
|
||||||
scrolled = animtimer * dupz;
|
|
||||||
for (x = 0; x < vid.width; x += pw)
|
|
||||||
{
|
|
||||||
for (y = 0; y < vid.height; y += ph)
|
|
||||||
{
|
|
||||||
if (scrolled > 0)
|
|
||||||
V_DrawScaledPatch(scrolled - pw, y, V_NOSCALESTART, pat);
|
|
||||||
|
|
||||||
V_DrawScaledPatch(x + scrolled, y, V_NOSCALESTART, pat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
W_UnlockCachedPatch(pat);
|
|
||||||
}
|
|
||||||
|
|
||||||
// =============
|
// =============
|
||||||
// INTRO SCENE
|
// INTRO SCENE
|
||||||
// =============
|
// =============
|
||||||
|
@ -474,7 +392,7 @@ void F_StartIntro(void)
|
||||||
F_NewCutscene(introtext[0]);
|
F_NewCutscene(introtext[0]);
|
||||||
|
|
||||||
intro_scenenum = 0;
|
intro_scenenum = 0;
|
||||||
finalecount = animtimer = stoptimer = 0;
|
finalecount = animtimer = skullAnimCounter = stoptimer = 0;
|
||||||
roidtics = BASEVIDWIDTH - 64;
|
roidtics = BASEVIDWIDTH - 64;
|
||||||
timetonext = introscenetime[intro_scenenum];
|
timetonext = introscenetime[intro_scenenum];
|
||||||
}
|
}
|
||||||
|
@ -706,7 +624,7 @@ static void F_IntroDrawScene(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
F_SkyScroll(80*4);
|
F_SkyScroll(80*4, 0, "TITLESKY");
|
||||||
if (timetonext == 6)
|
if (timetonext == 6)
|
||||||
{
|
{
|
||||||
stoptimer = finalecount;
|
stoptimer = finalecount;
|
||||||
|
@ -1489,12 +1407,104 @@ void F_GameEndTicker(void)
|
||||||
// ==============
|
// ==============
|
||||||
// TITLE SCREEN
|
// TITLE SCREEN
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
|
void F_InitMenuPresValues(void)
|
||||||
|
{
|
||||||
|
menuanimtimer = 0;
|
||||||
|
prevMenuId = 0;
|
||||||
|
activeMenuId = MainDef.menuid;
|
||||||
|
|
||||||
|
// Set defaults for presentation values
|
||||||
|
strncpy(curbgname, "TITLESKY", 8);
|
||||||
|
curfadevalue = 16;
|
||||||
|
curhidepics = hidetitlepics;
|
||||||
|
curbgcolor = -1;
|
||||||
|
curbgxspeed = titlescrollxspeed;
|
||||||
|
curbgyspeed = titlescrollyspeed;
|
||||||
|
curbghide = false;
|
||||||
|
|
||||||
|
// Find current presentation values
|
||||||
|
M_SetMenuCurBackground((gamestate == GS_TIMEATTACK) ? "SRB2BACK" : "TITLESKY");
|
||||||
|
M_SetMenuCurFadeValue(16);
|
||||||
|
M_SetMenuCurHideTitlePics();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// F_SkyScroll
|
||||||
|
//
|
||||||
|
void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname)
|
||||||
|
{
|
||||||
|
INT32 xscrolled, x, xneg = (scrollxspeed > 0) - (scrollxspeed < 0), tilex;
|
||||||
|
INT32 yscrolled, y, yneg = (scrollyspeed > 0) - (scrollyspeed < 0), tiley;
|
||||||
|
boolean xispos = (scrollxspeed >= 0), yispos = (scrollyspeed >= 0);
|
||||||
|
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||||
|
INT16 patwidth, patheight;
|
||||||
|
INT32 pw, ph; // scaled by dupz
|
||||||
|
patch_t *pat;
|
||||||
|
INT32 i, j;
|
||||||
|
|
||||||
|
if (rendermode == render_none)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!patchname || !patchname[0])
|
||||||
|
{
|
||||||
|
V_DrawFill(0, 0, vid.width, vid.height, 31);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!scrollxspeed && !scrollyspeed)
|
||||||
|
{
|
||||||
|
V_DrawPatchFill(W_CachePatchName(patchname, PU_CACHE));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pat = W_CachePatchName(patchname, PU_CACHE);
|
||||||
|
|
||||||
|
patwidth = SHORT(pat->width);
|
||||||
|
patheight = SHORT(pat->height);
|
||||||
|
pw = patwidth * dupz;
|
||||||
|
ph = patheight * dupz;
|
||||||
|
|
||||||
|
tilex = max(FixedCeil(FixedDiv(vid.width, pw)) >> FRACBITS, 1)+2; // one tile on both sides of center
|
||||||
|
tiley = max(FixedCeil(FixedDiv(vid.height, ph)) >> FRACBITS, 1)+2;
|
||||||
|
|
||||||
|
xscrolltimer = ((menuanimtimer*scrollxspeed)/16 + patwidth*xneg) % (patwidth);
|
||||||
|
yscrolltimer = ((menuanimtimer*scrollyspeed)/16 + patheight*yneg) % (patheight);
|
||||||
|
|
||||||
|
// coordinate offsets
|
||||||
|
xscrolled = xscrolltimer * dupz;
|
||||||
|
yscrolled = yscrolltimer * dupz;
|
||||||
|
|
||||||
|
for (x = (xispos) ? -pw*(tilex-1)+pw : 0, i = 0;
|
||||||
|
i < tilex;
|
||||||
|
x += pw, i++)
|
||||||
|
{
|
||||||
|
for (y = (yispos) ? -ph*(tiley-1)+ph : 0, j = 0;
|
||||||
|
j < tiley;
|
||||||
|
y += ph, j++)
|
||||||
|
{
|
||||||
|
V_DrawScaledPatch(
|
||||||
|
(xispos) ? xscrolled - x : x + xscrolled,
|
||||||
|
(yispos) ? yscrolled - y : y + yscrolled,
|
||||||
|
V_NOSCALESTART, pat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
W_UnlockCachedPatch(pat);
|
||||||
|
}
|
||||||
|
|
||||||
void F_StartTitleScreen(void)
|
void F_StartTitleScreen(void)
|
||||||
{
|
{
|
||||||
S_ChangeMusicInternal("_title", looptitle);
|
if (menupres[MN_MAIN].musname[0])
|
||||||
|
S_ChangeMusic(menupres[MN_MAIN].musname, menupres[MN_MAIN].mustrack, menupres[MN_MAIN].muslooping);
|
||||||
|
else
|
||||||
|
S_ChangeMusicInternal("_title", looptitle);
|
||||||
|
|
||||||
if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS)
|
if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS)
|
||||||
|
{
|
||||||
finalecount = 0;
|
finalecount = 0;
|
||||||
|
wipetypepost = menupres[MN_MAIN].enterwipe;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
wipegamestate = GS_TITLESCREEN;
|
wipegamestate = GS_TITLESCREEN;
|
||||||
|
|
||||||
|
@ -1504,6 +1514,7 @@ void F_StartTitleScreen(void)
|
||||||
|
|
||||||
gamestate_t prevwipegamestate = wipegamestate;
|
gamestate_t prevwipegamestate = wipegamestate;
|
||||||
titlemapinaction = TITLEMAP_LOADING;
|
titlemapinaction = TITLEMAP_LOADING;
|
||||||
|
titlemapcameraref = NULL;
|
||||||
gamemap = titlemap;
|
gamemap = titlemap;
|
||||||
|
|
||||||
if (!mapheaderinfo[gamemap-1])
|
if (!mapheaderinfo[gamemap-1])
|
||||||
|
@ -1544,6 +1555,10 @@ void F_StartTitleScreen(void)
|
||||||
camera.chase = true;
|
camera.chase = true;
|
||||||
camera.height = 0;
|
camera.height = 0;
|
||||||
|
|
||||||
|
// Run enter linedef exec for MN_MAIN, since this is where we start
|
||||||
|
if (menupres[MN_MAIN].entertag)
|
||||||
|
P_LinedefExecute(menupres[MN_MAIN].entertag, players[displayplayer].mo, NULL);
|
||||||
|
|
||||||
wipegamestate = prevwipegamestate;
|
wipegamestate = prevwipegamestate;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1557,7 +1572,7 @@ void F_StartTitleScreen(void)
|
||||||
|
|
||||||
// IWAD dependent stuff.
|
// IWAD dependent stuff.
|
||||||
|
|
||||||
animtimer = 0;
|
animtimer = skullAnimCounter = 0;
|
||||||
|
|
||||||
demoDelayLeft = demoDelayTime;
|
demoDelayLeft = demoDelayTime;
|
||||||
demoIdleLeft = demoIdleTime;
|
demoIdleLeft = demoIdleTime;
|
||||||
|
@ -1582,19 +1597,24 @@ void F_StartTitleScreen(void)
|
||||||
// (no longer) De-Demo'd Title Screen
|
// (no longer) De-Demo'd Title Screen
|
||||||
void F_TitleScreenDrawer(void)
|
void F_TitleScreenDrawer(void)
|
||||||
{
|
{
|
||||||
|
boolean hidepics;
|
||||||
|
|
||||||
if (modeattacking)
|
if (modeattacking)
|
||||||
return; // We likely came here from retrying. Don't do a damn thing.
|
return; // We likely came here from retrying. Don't do a damn thing.
|
||||||
|
|
||||||
// Draw that sky!
|
// Draw that sky!
|
||||||
if (!titlemapinaction)
|
if (curbgcolor >= 0)
|
||||||
F_SkyScroll(titlescrollspeed);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
|
else if (!curbghide || !titlemapinaction || gamestate == GS_WAITINGPLAYERS)
|
||||||
|
F_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
|
||||||
// Don't draw outside of the title screen, or if the patch isn't there.
|
// Don't draw outside of the title screen, or if the patch isn't there.
|
||||||
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
|
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// rei|miru: use title pics?
|
// rei|miru: use title pics?
|
||||||
if (hidetitlepics)
|
hidepics = curhidepics;
|
||||||
|
if (hidepics)
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
goto luahook;
|
goto luahook;
|
||||||
#else
|
#else
|
||||||
|
@ -1644,6 +1664,14 @@ luahook:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// separate animation timer for backgrounds, since we also count
|
||||||
|
// during GS_TIMEATTACK
|
||||||
|
void F_MenuPresTicker(boolean run)
|
||||||
|
{
|
||||||
|
if (run)
|
||||||
|
menuanimtimer++;
|
||||||
|
}
|
||||||
|
|
||||||
// (no longer) De-Demo'd Title Screen
|
// (no longer) De-Demo'd Title Screen
|
||||||
void F_TitleScreenTicker(boolean run)
|
void F_TitleScreenTicker(boolean run)
|
||||||
{
|
{
|
||||||
|
@ -1661,22 +1689,28 @@ void F_TitleScreenTicker(boolean run)
|
||||||
mobj_t *mo2;
|
mobj_t *mo2;
|
||||||
mobj_t *cameraref = NULL;
|
mobj_t *cameraref = NULL;
|
||||||
|
|
||||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
// If there's a Line 422 Switch Cut-Away view, don't force us.
|
||||||
|
if (!titlemapcameraref || titlemapcameraref->type != MT_ALTVIEWMAN)
|
||||||
{
|
{
|
||||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||||
continue;
|
{
|
||||||
|
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||||
|
continue;
|
||||||
|
|
||||||
mo2 = (mobj_t *)th;
|
mo2 = (mobj_t *)th;
|
||||||
|
|
||||||
if (!mo2)
|
if (!mo2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mo2->type != MT_ALTVIEWMAN)
|
if (mo2->type != MT_ALTVIEWMAN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cameraref = mo2;
|
cameraref = titlemapcameraref = mo2;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
cameraref = titlemapcameraref;
|
||||||
|
|
||||||
if (cameraref)
|
if (cameraref)
|
||||||
{
|
{
|
||||||
|
@ -1690,7 +1724,7 @@ void F_TitleScreenTicker(boolean run)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Default behavior: Do a lil' camera spin if a title map is loaded;
|
// Default behavior: Do a lil' camera spin if a title map is loaded;
|
||||||
camera.angle += titlescrollspeed*ANG1/64;
|
camera.angle += titlescrollxspeed*ANG1/64;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ void F_TextPromptTicker(void);
|
||||||
void F_GameEndDrawer(void);
|
void F_GameEndDrawer(void);
|
||||||
void F_IntroDrawer(void);
|
void F_IntroDrawer(void);
|
||||||
void F_TitleScreenDrawer(void);
|
void F_TitleScreenDrawer(void);
|
||||||
|
void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
|
||||||
|
|
||||||
void F_GameEvaluationDrawer(void);
|
void F_GameEvaluationDrawer(void);
|
||||||
void F_StartGameEvaluation(void);
|
void F_StartGameEvaluation(void);
|
||||||
|
@ -69,7 +70,8 @@ void F_StartContinue(void);
|
||||||
void F_ContinueTicker(void);
|
void F_ContinueTicker(void);
|
||||||
void F_ContinueDrawer(void);
|
void F_ContinueDrawer(void);
|
||||||
|
|
||||||
extern INT32 titlescrollspeed;
|
extern INT32 titlescrollxspeed;
|
||||||
|
extern INT32 titlescrollyspeed;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -78,17 +80,38 @@ typedef enum
|
||||||
TITLEMAP_RUNNING
|
TITLEMAP_RUNNING
|
||||||
} titlemap_enum;
|
} titlemap_enum;
|
||||||
|
|
||||||
|
// Current menu parameters
|
||||||
|
|
||||||
extern UINT8 titlemapinaction;
|
extern UINT8 titlemapinaction;
|
||||||
|
extern mobj_t *titlemapcameraref;
|
||||||
|
extern char curbgname[8];
|
||||||
|
extern SINT8 curfadevalue;
|
||||||
|
extern boolean curhidepics;
|
||||||
|
extern INT32 curbgcolor;
|
||||||
|
extern INT32 curbgxspeed;
|
||||||
|
extern INT32 curbgyspeed;
|
||||||
|
extern boolean curbghide;
|
||||||
|
|
||||||
|
#define TITLEBACKGROUNDACTIVE (curfadevalue >= 0 || curbgname[0])
|
||||||
|
|
||||||
|
void F_InitMenuPresValues(void);
|
||||||
|
void F_MenuPresTicker(boolean run);
|
||||||
|
|
||||||
//
|
//
|
||||||
// WIPE
|
// WIPE
|
||||||
//
|
//
|
||||||
|
// HACK for menu fading while titlemapinaction; skips the level check
|
||||||
|
#define FORCEWIPE -3
|
||||||
|
#define FORCEWIPEOFF -2
|
||||||
|
|
||||||
extern boolean WipeInAction;
|
extern boolean WipeInAction;
|
||||||
extern INT32 lastwipetic;
|
extern INT32 lastwipetic;
|
||||||
|
|
||||||
void F_WipeStartScreen(void);
|
void F_WipeStartScreen(void);
|
||||||
void F_WipeEndScreen(void);
|
void F_WipeEndScreen(void);
|
||||||
void F_RunWipe(UINT8 wipetype, boolean drawMenu);
|
void F_RunWipe(UINT8 wipetype, boolean drawMenu);
|
||||||
|
tic_t F_GetWipeLength(UINT8 wipetype);
|
||||||
|
boolean F_WipeExists(UINT8 wipetype);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
45
src/f_wipe.c
45
src/f_wipe.c
|
@ -378,3 +378,48 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
||||||
WipeInAction = false;
|
WipeInAction = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns tic length of wipe
|
||||||
|
* One lump equals one tic
|
||||||
|
*/
|
||||||
|
tic_t F_GetWipeLength(UINT8 wipetype)
|
||||||
|
{
|
||||||
|
#ifdef NOWIPE
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
static char lumpname[10] = "FADEmmss";
|
||||||
|
lumpnum_t lumpnum;
|
||||||
|
UINT8 wipeframe;
|
||||||
|
|
||||||
|
if (wipetype > 99)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
for (wipeframe = 0; wipeframe < 100; wipeframe++)
|
||||||
|
{
|
||||||
|
sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipetype, (UINT16)wipeframe);
|
||||||
|
|
||||||
|
lumpnum = W_CheckNumForName(lumpname);
|
||||||
|
if (lumpnum == LUMPERROR)
|
||||||
|
return --wipeframe;
|
||||||
|
}
|
||||||
|
return --wipeframe;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean F_WipeExists(UINT8 wipetype)
|
||||||
|
{
|
||||||
|
#ifdef NOWIPE
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
static char lumpname[10] = "FADEmm00";
|
||||||
|
lumpnum_t lumpnum;
|
||||||
|
|
||||||
|
if (wipetype > 99)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sprintf(&lumpname[4], "%.2hu00", (UINT16)wipetype);
|
||||||
|
|
||||||
|
lumpnum = W_CheckNumForName(lumpname);
|
||||||
|
return !(lumpnum == LUMPERROR);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -2020,6 +2020,7 @@ void G_Ticker(boolean run)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_TIMEATTACK:
|
case GS_TIMEATTACK:
|
||||||
|
F_MenuPresTicker(run);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_INTRO:
|
case GS_INTRO:
|
||||||
|
@ -2059,6 +2060,7 @@ void G_Ticker(boolean run)
|
||||||
if (titlemapinaction) P_Ticker(run); // then intentionally fall through
|
if (titlemapinaction) P_Ticker(run); // then intentionally fall through
|
||||||
/* FALLTHRU */
|
/* FALLTHRU */
|
||||||
case GS_WAITINGPLAYERS:
|
case GS_WAITINGPLAYERS:
|
||||||
|
F_MenuPresTicker(run);
|
||||||
F_TitleScreenTicker(run);
|
F_TitleScreenTicker(run);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -343,6 +343,9 @@ light_t *t_lspr[NUMSPRITES] =
|
||||||
&lspr[NOLIGHT], // SPR_BTBL
|
&lspr[NOLIGHT], // SPR_BTBL
|
||||||
&lspr[NOLIGHT], // SPR_STBL
|
&lspr[NOLIGHT], // SPR_STBL
|
||||||
&lspr[NOLIGHT], // SPR_CACT
|
&lspr[NOLIGHT], // SPR_CACT
|
||||||
|
&lspr[NOLIGHT], // SPR_WWSG
|
||||||
|
&lspr[NOLIGHT], // SPR_WWS2
|
||||||
|
&lspr[NOLIGHT], // SPR_WWS3
|
||||||
|
|
||||||
// Red Volcano Scenery
|
// Red Volcano Scenery
|
||||||
&lspr[REDBALL_L], // SPR_FLME
|
&lspr[REDBALL_L], // SPR_FLME
|
||||||
|
|
|
@ -4265,10 +4265,45 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
|
||||||
|
static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts)
|
||||||
|
{
|
||||||
|
if (cv_grspritebillboarding.value
|
||||||
|
&& spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)
|
||||||
|
&& wallVerts)
|
||||||
|
{
|
||||||
|
float basey = FIXED_TO_FLOAT(spr->mobj->z);
|
||||||
|
float lowy = wallVerts[0].y;
|
||||||
|
if (P_MobjFlip(spr->mobj) == -1)
|
||||||
|
{
|
||||||
|
basey = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
|
||||||
|
}
|
||||||
|
// Rotate sprites to fully billboard with the camera
|
||||||
|
// X, Y, AND Z need to be manipulated for the polys to rotate around the
|
||||||
|
// origin, because of how the origin setting works I believe that should
|
||||||
|
// be mobj->z or mobj->z + mobj->height
|
||||||
|
wallVerts[2].y = wallVerts[3].y = (spr->ty - basey) * gr_viewludsin + basey;
|
||||||
|
wallVerts[0].y = wallVerts[1].y = (lowy - basey) * gr_viewludsin + basey;
|
||||||
|
// translate back to be around 0 before translating back
|
||||||
|
wallVerts[3].x += ((spr->ty - basey) * gr_viewludcos) * gr_viewcos;
|
||||||
|
wallVerts[2].x += ((spr->ty - basey) * gr_viewludcos) * gr_viewcos;
|
||||||
|
|
||||||
|
wallVerts[0].x += ((lowy - basey) * gr_viewludcos) * gr_viewcos;
|
||||||
|
wallVerts[1].x += ((lowy - basey) * gr_viewludcos) * gr_viewcos;
|
||||||
|
|
||||||
|
wallVerts[3].z += ((spr->ty - basey) * gr_viewludcos) * gr_viewsin;
|
||||||
|
wallVerts[2].z += ((spr->ty - basey) * gr_viewludcos) * gr_viewsin;
|
||||||
|
|
||||||
|
wallVerts[0].z += ((lowy - basey) * gr_viewludcos) * gr_viewsin;
|
||||||
|
wallVerts[1].z += ((lowy - basey) * gr_viewludcos) * gr_viewsin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void HWR_SplitSprite(gr_vissprite_t *spr)
|
static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
{
|
{
|
||||||
float this_scale = 1.0f;
|
float this_scale = 1.0f;
|
||||||
FOutVector wallVerts[4];
|
FOutVector wallVerts[4];
|
||||||
|
FOutVector baseWallVerts[4]; // This is what the verts should end up as
|
||||||
GLPatch_t *gpatch;
|
GLPatch_t *gpatch;
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
||||||
|
@ -4281,11 +4316,13 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
float realtop, realbot, top, bot;
|
float realtop, realbot, top, bot;
|
||||||
float towtop, towbot, towmult;
|
float towtop, towbot, towmult;
|
||||||
float bheight;
|
float bheight;
|
||||||
|
float realheight, heightmult;
|
||||||
const sector_t *sector = spr->mobj->subsector->sector;
|
const sector_t *sector = spr->mobj->subsector->sector;
|
||||||
const lightlist_t *list = sector->lightlist;
|
const lightlist_t *list = sector->lightlist;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
float endrealtop, endrealbot, endtop, endbot;
|
float endrealtop, endrealbot, endtop, endbot;
|
||||||
float endbheight;
|
float endbheight;
|
||||||
|
float endrealheight;
|
||||||
fixed_t temp;
|
fixed_t temp;
|
||||||
fixed_t v1x, v1y, v2x, v2y;
|
fixed_t v1x, v1y, v2x, v2y;
|
||||||
#endif
|
#endif
|
||||||
|
@ -4318,16 +4355,16 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
HWR_DrawSpriteShadow(spr, gpatch, this_scale);
|
HWR_DrawSpriteShadow(spr, gpatch, this_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
wallVerts[0].x = wallVerts[3].x = spr->x1;
|
baseWallVerts[0].x = baseWallVerts[3].x = spr->x1;
|
||||||
wallVerts[2].x = wallVerts[1].x = spr->x2;
|
baseWallVerts[2].x = baseWallVerts[1].x = spr->x2;
|
||||||
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
baseWallVerts[0].z = baseWallVerts[3].z = spr->z1;
|
||||||
wallVerts[1].z = wallVerts[2].z = spr->z2;
|
baseWallVerts[1].z = baseWallVerts[2].z = spr->z2;
|
||||||
|
|
||||||
wallVerts[2].y = wallVerts[3].y = spr->ty;
|
baseWallVerts[2].y = baseWallVerts[3].y = spr->ty;
|
||||||
if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f)
|
if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f)
|
||||||
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height * this_scale;
|
baseWallVerts[0].y = baseWallVerts[1].y = spr->ty - gpatch->height * this_scale;
|
||||||
else
|
else
|
||||||
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height;
|
baseWallVerts[0].y = baseWallVerts[1].y = spr->ty - gpatch->height;
|
||||||
|
|
||||||
v1x = FLOAT_TO_FIXED(spr->x1);
|
v1x = FLOAT_TO_FIXED(spr->x1);
|
||||||
v1y = FLOAT_TO_FIXED(spr->z1);
|
v1y = FLOAT_TO_FIXED(spr->z1);
|
||||||
|
@ -4336,44 +4373,56 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
|
|
||||||
if (spr->flip)
|
if (spr->flip)
|
||||||
{
|
{
|
||||||
wallVerts[0].sow = wallVerts[3].sow = gpatch->max_s;
|
baseWallVerts[0].sow = baseWallVerts[3].sow = gpatch->max_s;
|
||||||
wallVerts[2].sow = wallVerts[1].sow = 0;
|
baseWallVerts[2].sow = baseWallVerts[1].sow = 0;
|
||||||
}else{
|
}
|
||||||
wallVerts[0].sow = wallVerts[3].sow = 0;
|
else
|
||||||
wallVerts[2].sow = wallVerts[1].sow = gpatch->max_s;
|
{
|
||||||
|
baseWallVerts[0].sow = baseWallVerts[3].sow = 0;
|
||||||
|
baseWallVerts[2].sow = baseWallVerts[1].sow = gpatch->max_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// flip the texture coords (look familiar?)
|
// flip the texture coords (look familiar?)
|
||||||
if (spr->vflip)
|
if (spr->vflip)
|
||||||
{
|
{
|
||||||
wallVerts[3].tow = wallVerts[2].tow = gpatch->max_t;
|
baseWallVerts[3].tow = baseWallVerts[2].tow = gpatch->max_t;
|
||||||
wallVerts[0].tow = wallVerts[1].tow = 0;
|
baseWallVerts[0].tow = baseWallVerts[1].tow = 0;
|
||||||
}else{
|
}
|
||||||
wallVerts[3].tow = wallVerts[2].tow = 0;
|
else
|
||||||
wallVerts[0].tow = wallVerts[1].tow = gpatch->max_t;
|
{
|
||||||
|
baseWallVerts[3].tow = baseWallVerts[2].tow = 0;
|
||||||
|
baseWallVerts[0].tow = baseWallVerts[1].tow = gpatch->max_t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it has a dispoffset, push it a little towards the camera
|
// if it has a dispoffset, push it a little towards the camera
|
||||||
if (spr->dispoffset) {
|
if (spr->dispoffset) {
|
||||||
float co = -gr_viewcos*(0.05f*spr->dispoffset);
|
float co = -gr_viewcos*(0.05f*spr->dispoffset);
|
||||||
float si = -gr_viewsin*(0.05f*spr->dispoffset);
|
float si = -gr_viewsin*(0.05f*spr->dispoffset);
|
||||||
wallVerts[0].z = wallVerts[3].z = wallVerts[0].z+si;
|
baseWallVerts[0].z = baseWallVerts[3].z = baseWallVerts[0].z+si;
|
||||||
wallVerts[1].z = wallVerts[2].z = wallVerts[1].z+si;
|
baseWallVerts[1].z = baseWallVerts[2].z = baseWallVerts[1].z+si;
|
||||||
wallVerts[0].x = wallVerts[3].x = wallVerts[0].x+co;
|
baseWallVerts[0].x = baseWallVerts[3].x = baseWallVerts[0].x+co;
|
||||||
wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
|
baseWallVerts[1].x = baseWallVerts[2].x = baseWallVerts[1].x+co;
|
||||||
}
|
}
|
||||||
|
|
||||||
realtop = top = wallVerts[3].y;
|
// Let dispoffset work first since this adjust each vertex
|
||||||
realbot = bot = wallVerts[0].y;
|
HWR_RotateSpritePolyToAim(spr, baseWallVerts);
|
||||||
towtop = wallVerts[3].tow;
|
|
||||||
towbot = wallVerts[0].tow;
|
realtop = top = baseWallVerts[3].y;
|
||||||
|
realbot = bot = baseWallVerts[0].y;
|
||||||
|
towtop = baseWallVerts[3].tow;
|
||||||
|
towbot = baseWallVerts[0].tow;
|
||||||
towmult = (towbot - towtop) / (top - bot);
|
towmult = (towbot - towtop) / (top - bot);
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
endrealtop = endtop = wallVerts[2].y;
|
endrealtop = endtop = baseWallVerts[2].y;
|
||||||
endrealbot = endbot = wallVerts[1].y;
|
endrealbot = endbot = baseWallVerts[1].y;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// copy the contents of baseWallVerts into the drawn wallVerts array
|
||||||
|
// baseWallVerts is used to know the final shape to easily get the vertex
|
||||||
|
// co-ordinates
|
||||||
|
memcpy(wallVerts, baseWallVerts, sizeof(baseWallVerts));
|
||||||
|
|
||||||
if (!cv_translucency.value) // translucency disabled
|
if (!cv_translucency.value) // translucency disabled
|
||||||
{
|
{
|
||||||
Surf.FlatColor.s.alpha = 0xFF;
|
Surf.FlatColor.s.alpha = 0xFF;
|
||||||
|
@ -4500,12 +4549,55 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
wallVerts[2].y = endtop;
|
wallVerts[2].y = endtop;
|
||||||
wallVerts[0].y = bot;
|
wallVerts[0].y = bot;
|
||||||
wallVerts[1].y = endbot;
|
wallVerts[1].y = endbot;
|
||||||
|
|
||||||
|
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||||
|
if (cv_grspritebillboarding.value
|
||||||
|
&& spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE))
|
||||||
|
{
|
||||||
|
// Get the x and z of the vertices so billboarding draws correctly
|
||||||
|
realheight = realbot - realtop;
|
||||||
|
endrealheight = endrealbot - endrealtop;
|
||||||
|
heightmult = (realtop - top) / realheight;
|
||||||
|
wallVerts[3].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
|
||||||
|
wallVerts[3].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
|
||||||
|
|
||||||
|
heightmult = (endrealtop - endtop) / endrealheight;
|
||||||
|
wallVerts[2].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
|
||||||
|
wallVerts[2].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
|
||||||
|
|
||||||
|
heightmult = (realtop - bot) / realheight;
|
||||||
|
wallVerts[0].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
|
||||||
|
wallVerts[0].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
|
||||||
|
|
||||||
|
heightmult = (endrealtop - endbot) / endrealheight;
|
||||||
|
wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
|
||||||
|
wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult);
|
wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult);
|
||||||
wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult);
|
wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult);
|
||||||
|
|
||||||
wallVerts[2].y = wallVerts[3].y = top;
|
wallVerts[2].y = wallVerts[3].y = top;
|
||||||
wallVerts[0].y = wallVerts[1].y = bot;
|
wallVerts[0].y = wallVerts[1].y = bot;
|
||||||
|
|
||||||
|
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||||
|
if (cv_grspritebillboarding.value
|
||||||
|
&& spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE))
|
||||||
|
{
|
||||||
|
// Get the x and z of the vertices so billboarding draws correctly
|
||||||
|
realheight = realbot - realtop;
|
||||||
|
heightmult = (realtop - top) / realheight;
|
||||||
|
wallVerts[3].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
|
||||||
|
wallVerts[3].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
|
||||||
|
wallVerts[2].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
|
||||||
|
wallVerts[2].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
|
||||||
|
|
||||||
|
heightmult = (realtop - bot) / realheight;
|
||||||
|
wallVerts[0].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
|
||||||
|
wallVerts[0].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
|
||||||
|
wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
|
||||||
|
wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (colormap)
|
if (colormap)
|
||||||
|
@ -4675,6 +4767,9 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
||||||
wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
|
wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let dispoffset work first since this adjust each vertex
|
||||||
|
HWR_RotateSpritePolyToAim(spr, wallVerts);
|
||||||
|
|
||||||
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
|
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
|
||||||
// sprite lighting by modulating the RGB components
|
// sprite lighting by modulating the RGB components
|
||||||
/// \todo coloured
|
/// \todo coloured
|
||||||
|
@ -4756,6 +4851,9 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||||
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
||||||
wallVerts[1].z = wallVerts[2].z = spr->z2;
|
wallVerts[1].z = wallVerts[2].z = spr->z2;
|
||||||
|
|
||||||
|
// Let dispoffset work first since this adjust each vertex
|
||||||
|
HWR_RotateSpritePolyToAim(spr, wallVerts);
|
||||||
|
|
||||||
wallVerts[0].sow = wallVerts[3].sow = 0;
|
wallVerts[0].sow = wallVerts[3].sow = 0;
|
||||||
wallVerts[2].sow = wallVerts[1].sow = gpatch->max_s;
|
wallVerts[2].sow = wallVerts[1].sow = gpatch->max_s;
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ extern consvar_t cv_grcorrecttricks;
|
||||||
extern consvar_t cv_voodoocompatibility;
|
extern consvar_t cv_voodoocompatibility;
|
||||||
extern consvar_t cv_grfovchange;
|
extern consvar_t cv_grfovchange;
|
||||||
extern consvar_t cv_grsolvetjoin;
|
extern consvar_t cv_grsolvetjoin;
|
||||||
|
extern consvar_t cv_grspritebillboarding;
|
||||||
|
|
||||||
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
||||||
|
|
||||||
|
|
|
@ -1095,7 +1095,9 @@ static INT16 typelines = 1; // number of drawfill lines we need when drawing the
|
||||||
//
|
//
|
||||||
boolean HU_Responder(event_t *ev)
|
boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
INT32 c=0;
|
INT32 c=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ev->type != ev_keydown)
|
if (ev->type != ev_keydown)
|
||||||
return false;
|
return false;
|
||||||
|
@ -1122,19 +1124,9 @@ boolean HU_Responder(event_t *ev)
|
||||||
return false;
|
return false;
|
||||||
}*/ //We don't actually care about that unless we get splitscreen netgames. :V
|
}*/ //We don't actually care about that unless we get splitscreen netgames. :V
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
c = (INT32)ev->data1;
|
c = (INT32)ev->data1;
|
||||||
|
|
||||||
// capslock (now handled outside of chat on so that it works everytime......)
|
|
||||||
if (c && c == KEY_CAPSLOCK) // it's a toggle.
|
|
||||||
{
|
|
||||||
if (capslock)
|
|
||||||
capslock = false;
|
|
||||||
else
|
|
||||||
capslock = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if (!chat_on)
|
if (!chat_on)
|
||||||
{
|
{
|
||||||
// enter chat mode
|
// enter chat mode
|
||||||
|
|
229
src/info.c
229
src/info.c
|
@ -240,6 +240,9 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"BTBL", // Big tumbleweed
|
"BTBL", // Big tumbleweed
|
||||||
"STBL", // Small tumbleweed
|
"STBL", // Small tumbleweed
|
||||||
"CACT", // Cacti sprites
|
"CACT", // Cacti sprites
|
||||||
|
"WWSG", // Caution Sign
|
||||||
|
"WWS2", // Cacti Sign
|
||||||
|
"WWS3", // Sharp Turn Sign
|
||||||
|
|
||||||
// Red Volcano Scenery
|
// Red Volcano Scenery
|
||||||
"FLME", // Flame jet
|
"FLME", // Flame jet
|
||||||
|
@ -2285,6 +2288,16 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_CACT, 1, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI2
|
{SPR_CACT, 1, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI2
|
||||||
{SPR_CACT, 2, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI3
|
{SPR_CACT, 2, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI3
|
||||||
{SPR_CACT, 3, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI4
|
{SPR_CACT, 3, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI4
|
||||||
|
{SPR_CACT, 4, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI5
|
||||||
|
{SPR_CACT, 5, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI6
|
||||||
|
{SPR_CACT, 6, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI7
|
||||||
|
{SPR_CACT, 7, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI8
|
||||||
|
{SPR_CACT, 8, -1, {NULL}, 0, 0, S_NULL}, // S_CACTI9
|
||||||
|
|
||||||
|
// Warning Signs
|
||||||
|
{SPR_WWSG, FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_ARIDSIGN_CAUTION
|
||||||
|
{SPR_WWS2, FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_ARIDSIGN_CACTI
|
||||||
|
{SPR_WWS3, FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_ARIDSIGN_SHARPTURN
|
||||||
|
|
||||||
// Flame jet
|
// Flame jet
|
||||||
{SPR_NULL, 0, 2*TICRATE, {NULL}, 0, 0, S_FLAMEJETSTART}, // S_FLAMEJETSTND
|
{SPR_NULL, 0, 2*TICRATE, {NULL}, 0, 0, S_FLAMEJETSTART}, // S_FLAMEJETSTND
|
||||||
|
@ -11145,6 +11158,222 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI5
|
||||||
|
1207, // doomednum
|
||||||
|
S_CACTI5, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
40*FRACUNIT, // radius
|
||||||
|
128*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI6
|
||||||
|
1208, // doomednum
|
||||||
|
S_CACTI6, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
24*FRACUNIT, // radius
|
||||||
|
132*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI7
|
||||||
|
1209, // doomednum
|
||||||
|
S_CACTI7, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
24*FRACUNIT, // radius
|
||||||
|
224*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI8
|
||||||
|
1210, // doomednum
|
||||||
|
S_CACTI8, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
24*FRACUNIT, // radius
|
||||||
|
208*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI9
|
||||||
|
1211, // doomednum
|
||||||
|
S_CACTI9, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
48*FRACUNIT, // radius
|
||||||
|
208*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_ARIDSIGN_CAUTION
|
||||||
|
1212, // doomednum
|
||||||
|
S_ARIDSIGN_CAUTION, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
22*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SCENERY|MF_SOLID|MF_PAPERCOLLISION, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_ARIDSIGN_CACTI
|
||||||
|
1213, // doomednum
|
||||||
|
S_ARIDSIGN_CACTI, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
22*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SCENERY|MF_SOLID|MF_PAPERCOLLISION, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_ARIDSIGN_SHARPTURN
|
||||||
|
1214, // doomednum
|
||||||
|
S_ARIDSIGN_SHARPTURN, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
192*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SCENERY|MF_SOLID|MF_PAPERCOLLISION, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_FLAMEJET
|
{ // MT_FLAMEJET
|
||||||
1300, // doomednum
|
1300, // doomednum
|
||||||
S_FLAMEJETSTND, // spawnstate
|
S_FLAMEJETSTND, // spawnstate
|
||||||
|
|
21
src/info.h
21
src/info.h
|
@ -471,6 +471,9 @@ typedef enum sprite
|
||||||
SPR_BTBL, // Big tumbleweed
|
SPR_BTBL, // Big tumbleweed
|
||||||
SPR_STBL, // Small tumbleweed
|
SPR_STBL, // Small tumbleweed
|
||||||
SPR_CACT, // Cacti sprites
|
SPR_CACT, // Cacti sprites
|
||||||
|
SPR_WWSG, // Caution Sign
|
||||||
|
SPR_WWS2, // Cacti Sign
|
||||||
|
SPR_WWS3, // Sharp Turn Sign
|
||||||
|
|
||||||
// Red Volcano Scenery
|
// Red Volcano Scenery
|
||||||
SPR_FLME, // Flame jet
|
SPR_FLME, // Flame jet
|
||||||
|
@ -2396,6 +2399,16 @@ typedef enum state
|
||||||
S_CACTI2,
|
S_CACTI2,
|
||||||
S_CACTI3,
|
S_CACTI3,
|
||||||
S_CACTI4,
|
S_CACTI4,
|
||||||
|
S_CACTI5,
|
||||||
|
S_CACTI6,
|
||||||
|
S_CACTI7,
|
||||||
|
S_CACTI8,
|
||||||
|
S_CACTI9,
|
||||||
|
|
||||||
|
// Warning signs sprites
|
||||||
|
S_ARIDSIGN_CAUTION,
|
||||||
|
S_ARIDSIGN_CACTI,
|
||||||
|
S_ARIDSIGN_SHARPTURN,
|
||||||
|
|
||||||
// Flame jet
|
// Flame jet
|
||||||
S_FLAMEJETSTND,
|
S_FLAMEJETSTND,
|
||||||
|
@ -4096,6 +4109,14 @@ typedef enum mobj_type
|
||||||
MT_CACTI2,
|
MT_CACTI2,
|
||||||
MT_CACTI3,
|
MT_CACTI3,
|
||||||
MT_CACTI4,
|
MT_CACTI4,
|
||||||
|
MT_CACTI5, // Harmful Cactus 1
|
||||||
|
MT_CACTI6, // Harmful Cactus 2
|
||||||
|
MT_CACTI7, // Harmful Cactus 3
|
||||||
|
MT_CACTI8, // Harmful Cactus 4
|
||||||
|
MT_CACTI9, // Harmful Cactus 5
|
||||||
|
MT_ARIDSIGN_CAUTION, // Caution Sign
|
||||||
|
MT_ARIDSIGN_CACTI, // Cacti Sign
|
||||||
|
MT_ARIDSIGN_SHARPTURN, // Sharp Turn Sign
|
||||||
|
|
||||||
// Red Volcano Scenery
|
// Red Volcano Scenery
|
||||||
MT_FLAMEJET,
|
MT_FLAMEJET,
|
||||||
|
|
666
src/m_menu.c
666
src/m_menu.c
File diff suppressed because it is too large
Load diff
152
src/m_menu.h
152
src/m_menu.h
|
@ -22,6 +22,140 @@
|
||||||
//
|
//
|
||||||
// MENUS
|
// MENUS
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// If menu hierarchies go deeper, change this up to 5.
|
||||||
|
// Zero-based, inclusive.
|
||||||
|
#define NUMMENULEVELS 3
|
||||||
|
#define MENUBITS 6
|
||||||
|
|
||||||
|
// Menu IDs sectioned by numeric places to signify hierarchy
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
MN_NONE,
|
||||||
|
|
||||||
|
MN_MAIN,
|
||||||
|
|
||||||
|
// Single Player
|
||||||
|
MN_SP_MAIN,
|
||||||
|
|
||||||
|
MN_SP_LOAD,
|
||||||
|
MN_SP_PLAYER,
|
||||||
|
|
||||||
|
MN_SP_LEVELSELECT,
|
||||||
|
MN_SP_LEVELSTATS,
|
||||||
|
|
||||||
|
MN_SP_TIMEATTACK,
|
||||||
|
MN_SP_TIMEATTACK_LEVELSELECT,
|
||||||
|
MN_SP_GUESTREPLAY,
|
||||||
|
MN_SP_REPLAY,
|
||||||
|
MN_SP_GHOST,
|
||||||
|
|
||||||
|
MN_SP_NIGHTSATTACK,
|
||||||
|
MN_SP_NIGHTS_LEVELSELECT,
|
||||||
|
MN_SP_NIGHTS_GUESTREPLAY,
|
||||||
|
MN_SP_NIGHTS_REPLAY,
|
||||||
|
MN_SP_NIGHTS_GHOST,
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
|
MN_MP_MAIN,
|
||||||
|
MN_MP_SPLITSCREEN, // SplitServer
|
||||||
|
MN_MP_SERVER,
|
||||||
|
MN_MP_CONNECT,
|
||||||
|
MN_MP_ROOM,
|
||||||
|
MN_MP_PLAYERSETUP, // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
||||||
|
|
||||||
|
// Options
|
||||||
|
MN_OP_MAIN,
|
||||||
|
|
||||||
|
MN_OP_P1CONTROLS,
|
||||||
|
MN_OP_CHANGECONTROLS, // OP_ChangeControlsDef shared with P2
|
||||||
|
MN_OP_P1MOUSE,
|
||||||
|
MN_OP_P1JOYSTICK,
|
||||||
|
MN_OP_JOYSTICKSET, // OP_JoystickSetDef shared with P2
|
||||||
|
|
||||||
|
MN_OP_P2CONTROLS,
|
||||||
|
MN_OP_P2MOUSE,
|
||||||
|
MN_OP_P2JOYSTICK,
|
||||||
|
|
||||||
|
MN_OP_VIDEO,
|
||||||
|
MN_OP_VIDEOMODE,
|
||||||
|
MN_OP_COLOR,
|
||||||
|
MN_OP_OPENGL,
|
||||||
|
MN_OP_OPENGL_LIGHTING,
|
||||||
|
MN_OP_OPENGL_FOG,
|
||||||
|
MN_OP_OPENGL_COLOR,
|
||||||
|
|
||||||
|
MN_OP_SOUND,
|
||||||
|
|
||||||
|
MN_OP_SERVER,
|
||||||
|
MN_OP_MONITORTOGGLE,
|
||||||
|
|
||||||
|
MN_OP_DATA,
|
||||||
|
MN_OP_ADDONS,
|
||||||
|
MN_OP_SCREENSHOTS,
|
||||||
|
MN_OP_ERASEDATA,
|
||||||
|
|
||||||
|
// Secrets
|
||||||
|
MN_SR_MAIN,
|
||||||
|
MN_SR_PANDORA,
|
||||||
|
MN_SR_LEVELSELECT,
|
||||||
|
MN_SR_UNLOCKCHECKLIST,
|
||||||
|
MN_SR_EMBLEMHINT,
|
||||||
|
|
||||||
|
// Addons (Part of MISC, but let's make it our own)
|
||||||
|
MN_AD_MAIN,
|
||||||
|
|
||||||
|
// MISC
|
||||||
|
// MN_MESSAGE,
|
||||||
|
// MN_SPAUSE,
|
||||||
|
|
||||||
|
// MN_MPAUSE,
|
||||||
|
// MN_SCRAMBLETEAM,
|
||||||
|
// MN_CHANGETEAM,
|
||||||
|
// MN_CHANGELEVEL,
|
||||||
|
|
||||||
|
// MN_MAPAUSE,
|
||||||
|
// MN_HELP,
|
||||||
|
|
||||||
|
MN_SPECIAL,
|
||||||
|
NUMMENUTYPES,
|
||||||
|
} menutype_t; // up to 63; MN_SPECIAL = 53
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char bgname[8]; // name for background gfx lump; lays over titlemap if this is set
|
||||||
|
SINT8 hidetitlepics; // hide title gfx per menu; -1 means undefined, inherits global setting
|
||||||
|
INT32 titlescrollxspeed; // background gfx scroll per menu; inherits global setting
|
||||||
|
INT32 titlescrollyspeed; // y scroll
|
||||||
|
INT32 bgcolor; // fill color, overrides bg name. -1 means follow bg name rules.
|
||||||
|
boolean bghide; // for titlemaps, hide the background.
|
||||||
|
|
||||||
|
char musname[7]; ///< Music track to play. "" for no music.
|
||||||
|
UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
|
||||||
|
boolean muslooping; ///< Loop the music
|
||||||
|
boolean musstop; ///< Don't play any music
|
||||||
|
boolean musignore; ///< Let the current music keep playing
|
||||||
|
|
||||||
|
SINT8 fadestrength; // darken background when displaying this menu, strength 0-31 or -1 for undefined
|
||||||
|
boolean enterbubble; // run all entrance line execs after common ancestor and up to child. If false, only run the child's exec
|
||||||
|
boolean exitbubble; // run all exit line execs from child and up to before common ancestor. If false, only run the child's exec
|
||||||
|
INT32 entertag; // line exec to run on menu enter, if titlemap
|
||||||
|
INT32 exittag; // line exec to run on menu exit, if titlemap
|
||||||
|
INT16 enterwipe; // wipe type to run on menu enter, -1 means default
|
||||||
|
INT16 exitwipe; // wipe type to run on menu exit, -1 means default
|
||||||
|
} menupres_t;
|
||||||
|
|
||||||
|
extern menupres_t menupres[NUMMENUTYPES];
|
||||||
|
extern UINT32 prevMenuId;
|
||||||
|
extern UINT32 activeMenuId;
|
||||||
|
|
||||||
|
void M_InitMenuPresTables(void);
|
||||||
|
UINT8 M_GetYoungestChildMenu(void);
|
||||||
|
void M_ChangeMenuMusic(const char *defaultmusname, boolean defaultmuslooping);
|
||||||
|
void M_SetMenuCurBackground(const char *defaultname);
|
||||||
|
void M_SetMenuCurFadeValue(UINT8 defaultvalue);
|
||||||
|
void M_SetMenuCurHideTitlePics(void);
|
||||||
|
|
||||||
// Called by main loop,
|
// Called by main loop,
|
||||||
// saves config file and calls I_Quit when user exits.
|
// saves config file and calls I_Quit when user exits.
|
||||||
// Even when the menu is not displayed,
|
// Even when the menu is not displayed,
|
||||||
|
@ -156,6 +290,7 @@ typedef struct menuitem_s
|
||||||
|
|
||||||
typedef struct menu_s
|
typedef struct menu_s
|
||||||
{
|
{
|
||||||
|
UINT32 menuid; // ID to encode menu type and hierarchy
|
||||||
const char *menutitlepic;
|
const char *menutitlepic;
|
||||||
INT16 numitems; // # of menu items
|
INT16 numitems; // # of menu items
|
||||||
struct menu_s *prevMenu; // previous menu
|
struct menu_s *prevMenu; // previous menu
|
||||||
|
@ -262,8 +397,9 @@ void Screenshot_option_Onchange(void);
|
||||||
void Addons_option_Onchange(void);
|
void Addons_option_Onchange(void);
|
||||||
|
|
||||||
// These defines make it a little easier to make menus
|
// These defines make it a little easier to make menus
|
||||||
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\
|
#define DEFAULTMENUSTYLE(id, header, source, prev, x, y)\
|
||||||
{\
|
{\
|
||||||
|
id,\
|
||||||
header,\
|
header,\
|
||||||
sizeof(source)/sizeof(menuitem_t),\
|
sizeof(source)/sizeof(menuitem_t),\
|
||||||
prev,\
|
prev,\
|
||||||
|
@ -274,8 +410,9 @@ void Addons_option_Onchange(void);
|
||||||
NULL\
|
NULL\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEFAULTSCROLLMENUSTYLE(header, source, prev, x, y)\
|
#define DEFAULTSCROLLMENUSTYLE(id, header, source, prev, x, y)\
|
||||||
{\
|
{\
|
||||||
|
id,\
|
||||||
header,\
|
header,\
|
||||||
sizeof(source)/sizeof(menuitem_t),\
|
sizeof(source)/sizeof(menuitem_t),\
|
||||||
prev,\
|
prev,\
|
||||||
|
@ -288,6 +425,7 @@ void Addons_option_Onchange(void);
|
||||||
|
|
||||||
#define PAUSEMENUSTYLE(source, x, y)\
|
#define PAUSEMENUSTYLE(source, x, y)\
|
||||||
{\
|
{\
|
||||||
|
MN_SPECIAL,\
|
||||||
NULL,\
|
NULL,\
|
||||||
sizeof(source)/sizeof(menuitem_t),\
|
sizeof(source)/sizeof(menuitem_t),\
|
||||||
NULL,\
|
NULL,\
|
||||||
|
@ -298,8 +436,9 @@ void Addons_option_Onchange(void);
|
||||||
NULL\
|
NULL\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CENTERMENUSTYLE(header, source, prev, y)\
|
#define CENTERMENUSTYLE(id, header, source, prev, y)\
|
||||||
{\
|
{\
|
||||||
|
id,\
|
||||||
header,\
|
header,\
|
||||||
sizeof(source)/sizeof(menuitem_t),\
|
sizeof(source)/sizeof(menuitem_t),\
|
||||||
prev,\
|
prev,\
|
||||||
|
@ -310,8 +449,9 @@ void Addons_option_Onchange(void);
|
||||||
NULL\
|
NULL\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAPPLATTERMENUSTYLE(header, source)\
|
#define MAPPLATTERMENUSTYLE(id, header, source)\
|
||||||
{\
|
{\
|
||||||
|
id,\
|
||||||
header,\
|
header,\
|
||||||
sizeof (source)/sizeof (menuitem_t),\
|
sizeof (source)/sizeof (menuitem_t),\
|
||||||
&MainDef,\
|
&MainDef,\
|
||||||
|
@ -322,8 +462,9 @@ void Addons_option_Onchange(void);
|
||||||
NULL\
|
NULL\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CONTROLMENUSTYLE(source, prev)\
|
#define CONTROLMENUSTYLE(id, source, prev)\
|
||||||
{\
|
{\
|
||||||
|
id,\
|
||||||
"M_CONTRO",\
|
"M_CONTRO",\
|
||||||
sizeof (source)/sizeof (menuitem_t),\
|
sizeof (source)/sizeof (menuitem_t),\
|
||||||
prev,\
|
prev,\
|
||||||
|
@ -336,6 +477,7 @@ void Addons_option_Onchange(void);
|
||||||
|
|
||||||
#define IMAGEDEF(source)\
|
#define IMAGEDEF(source)\
|
||||||
{\
|
{\
|
||||||
|
MN_SPECIAL,\
|
||||||
NULL,\
|
NULL,\
|
||||||
sizeof (source)/sizeof (menuitem_t),\
|
sizeof (source)/sizeof (menuitem_t),\
|
||||||
NULL,\
|
NULL,\
|
||||||
|
|
|
@ -2679,7 +2679,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
players[consoleplayer].viewz = 1;
|
players[consoleplayer].viewz = 1;
|
||||||
|
|
||||||
// Cancel all d_main.c fadeouts (keep fade in though).
|
// Cancel all d_main.c fadeouts (keep fade in though).
|
||||||
wipegamestate = -2;
|
wipegamestate = FORCEWIPEOFF;
|
||||||
|
|
||||||
// Special stage fade to white
|
// Special stage fade to white
|
||||||
// This is handled BEFORE sounds are stopped.
|
// This is handled BEFORE sounds are stopped.
|
||||||
|
@ -2723,18 +2723,27 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
// As oddly named as this is, this handles music only.
|
// As oddly named as this is, this handles music only.
|
||||||
// We should be fine starting it here.
|
// We should be fine starting it here.
|
||||||
S_Start();
|
S_Start();
|
||||||
|
}
|
||||||
|
|
||||||
// Let's fade to black here
|
// Let's fade to black here
|
||||||
// But only if we didn't do the special stage wipe
|
// But only if we didn't do the special stage wipe
|
||||||
if (rendermode != render_none && !ranspecialwipe)
|
if (rendermode != render_none && !ranspecialwipe)
|
||||||
{
|
{
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
|
|
||||||
F_WipeEndScreen();
|
F_WipeEndScreen();
|
||||||
F_RunWipe(wipedefs[wipe_level_toblack], false);
|
// for titlemap: run a specific wipe if specified
|
||||||
}
|
// needed for exiting time attack
|
||||||
|
if (wipetypepre != INT16_MAX)
|
||||||
|
F_RunWipe(
|
||||||
|
(wipetypepre >= 0 && F_WipeExists(wipetypepre)) ? wipetypepre : wipedefs[wipe_level_toblack],
|
||||||
|
false);
|
||||||
|
wipetypepre = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!titlemapinaction)
|
||||||
|
{
|
||||||
if (ranspecialwipe == 2)
|
if (ranspecialwipe == 2)
|
||||||
{
|
{
|
||||||
pausedelay = -3; // preticker plus one
|
pausedelay = -3; // preticker plus one
|
||||||
|
|
12
src/p_spec.c
12
src/p_spec.c
|
@ -2619,7 +2619,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
|
|
||||||
case 413: // Change music
|
case 413: // Change music
|
||||||
// console player only unless NOCLIMB is set
|
// console player only unless NOCLIMB is set
|
||||||
if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player)))
|
if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player)) || titlemapinaction)
|
||||||
{
|
{
|
||||||
boolean musicsame = (!sides[line->sidenum[0]].text[0] || !strnicmp(sides[line->sidenum[0]].text, S_MusicName(), 7));
|
boolean musicsame = (!sides[line->sidenum[0]].text[0] || !strnicmp(sides[line->sidenum[0]].text, S_MusicName(), 7));
|
||||||
UINT16 tracknum = (UINT16)max(sides[line->sidenum[0]].bottomtexture, 0);
|
UINT16 tracknum = (UINT16)max(sides[line->sidenum[0]].bottomtexture, 0);
|
||||||
|
@ -2970,7 +2970,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
{
|
{
|
||||||
mobj_t *altview;
|
mobj_t *altview;
|
||||||
|
|
||||||
if (!mo || !mo->player) // only players have views
|
if ((!mo || !mo->player) && !titlemapinaction) // only players have views, and title screens
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((secnum = P_FindSectorFromLineTag(line, -1)) < 0)
|
if ((secnum = P_FindSectorFromLineTag(line, -1)) < 0)
|
||||||
|
@ -2980,6 +2980,14 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
if (!altview)
|
if (!altview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// If titlemap, set the camera ref for title's thinker
|
||||||
|
// This is not revoked until overwritten; awayviewtics is ignored
|
||||||
|
if (titlemapinaction)
|
||||||
|
{
|
||||||
|
titlemapcameraref = altview;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
P_SetTarget(&mo->player->awayviewmobj, altview);
|
P_SetTarget(&mo->player->awayviewmobj, altview);
|
||||||
mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS;
|
mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS;
|
||||||
|
|
||||||
|
|
|
@ -1322,6 +1322,7 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_grcoronasize);
|
CV_RegisterVar(&cv_grcoronasize);
|
||||||
#endif
|
#endif
|
||||||
CV_RegisterVar(&cv_grmd2);
|
CV_RegisterVar(&cv_grmd2);
|
||||||
|
CV_RegisterVar(&cv_grspritebillboarding);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|
|
@ -877,8 +877,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
if (leftheight > pfloorleft && rightheight > pfloorright && i+1 < dc_numlights)
|
if (leftheight > pfloorleft && rightheight > pfloorright && i+1 < dc_numlights)
|
||||||
{
|
{
|
||||||
lightlist_t *nextlight = &frontsector->lightlist[i+1];
|
lightlist_t *nextlight = &frontsector->lightlist[i+1];
|
||||||
if (nextlight->slope ? P_GetZAt(nextlight->slope, ds->leftpos.x, ds->leftpos.y) : nextlight->height > pfloorleft
|
if ((nextlight->slope ? P_GetZAt(nextlight->slope, ds->leftpos.x, ds->leftpos.y) : nextlight->height) > pfloorleft
|
||||||
&& nextlight->slope ? P_GetZAt(nextlight->slope, ds->rightpos.x, ds->rightpos.y) : nextlight->height > pfloorright)
|
&& (nextlight->slope ? P_GetZAt(nextlight->slope, ds->rightpos.x, ds->rightpos.y) : nextlight->height) > pfloorright)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -580,8 +580,6 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||||
if (cv_usemouse.value) I_StartupMouse();
|
if (cv_usemouse.value) I_StartupMouse();
|
||||||
}
|
}
|
||||||
//else firsttimeonmouse = SDL_FALSE;
|
//else firsttimeonmouse = SDL_FALSE;
|
||||||
|
|
||||||
capslock = !!( SDL_GetModState() & KMOD_CAPS );// in case CL changes
|
|
||||||
}
|
}
|
||||||
else if (!mousefocus && !kbfocus)
|
else if (!mousefocus && !kbfocus)
|
||||||
{
|
{
|
||||||
|
@ -939,6 +937,8 @@ void I_StartupMouse(void)
|
||||||
//
|
//
|
||||||
void I_OsPolling(void)
|
void I_OsPolling(void)
|
||||||
{
|
{
|
||||||
|
SDL_Keymod mod;
|
||||||
|
|
||||||
if (consolevent)
|
if (consolevent)
|
||||||
I_GetConsoleEvents();
|
I_GetConsoleEvents();
|
||||||
if (SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK)
|
if (SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK)
|
||||||
|
@ -951,6 +951,18 @@ void I_OsPolling(void)
|
||||||
I_GetMouseEvents();
|
I_GetMouseEvents();
|
||||||
|
|
||||||
I_GetEvent();
|
I_GetEvent();
|
||||||
|
|
||||||
|
mod = SDL_GetModState();
|
||||||
|
/* Handle here so that our state is always synched with the system. */
|
||||||
|
shiftdown = ctrldown = altdown = 0;
|
||||||
|
capslock = false;
|
||||||
|
if (mod & KMOD_LSHIFT) shiftdown |= 1;
|
||||||
|
if (mod & KMOD_RSHIFT) shiftdown |= 2;
|
||||||
|
if (mod & KMOD_LCTRL) ctrldown |= 1;
|
||||||
|
if (mod & KMOD_RCTRL) ctrldown |= 2;
|
||||||
|
if (mod & KMOD_LALT) altdown |= 1;
|
||||||
|
if (mod & KMOD_RALT) altdown |= 2;
|
||||||
|
if (mod & KMOD_CAPS) capslock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -984,6 +996,7 @@ void I_UpdateNoBlit(void)
|
||||||
// from PrBoom's src/SDL/i_video.c
|
// from PrBoom's src/SDL/i_video.c
|
||||||
static inline boolean I_SkipFrame(void)
|
static inline boolean I_SkipFrame(void)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
static boolean skip = false;
|
static boolean skip = false;
|
||||||
|
|
||||||
if (rendermode != render_soft)
|
if (rendermode != render_soft)
|
||||||
|
@ -1003,6 +1016,8 @@ static inline boolean I_SkipFrame(void)
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -902,21 +902,10 @@ boolean I_LoadSong(char *data, size_t len)
|
||||||
const char *key1 = "LOOP";
|
const char *key1 = "LOOP";
|
||||||
const char *key2 = "POINT=";
|
const char *key2 = "POINT=";
|
||||||
const char *key3 = "MS=";
|
const char *key3 = "MS=";
|
||||||
const char *key4 = "LENGTHMS=";
|
|
||||||
const size_t key1len = strlen(key1);
|
const size_t key1len = strlen(key1);
|
||||||
const size_t key2len = strlen(key2);
|
const size_t key2len = strlen(key2);
|
||||||
const size_t key3len = strlen(key3);
|
const size_t key3len = strlen(key3);
|
||||||
const size_t key4len = strlen(key4);
|
|
||||||
|
|
||||||
// for mp3 wide chars
|
|
||||||
const char *key1w = "L\0O\0O\0P\0";
|
|
||||||
const char *key2w = "P\0O\0I\0N\0T\0\0\0\xFF\xFE";
|
|
||||||
const char *key3w = "M\0S\0\0\0\xFF\xFE";
|
|
||||||
const char *key4w = "L\0E\0N\0G\0T\0H\0M\0S\0\0\0\xFF\xFE";
|
|
||||||
const char *wterm = "\0\0";
|
|
||||||
char wval[10];
|
|
||||||
|
|
||||||
size_t wstart, wp;
|
|
||||||
char *p = data;
|
char *p = data;
|
||||||
SDL_RWops *rw;
|
SDL_RWops *rw;
|
||||||
|
|
||||||
|
@ -1062,61 +1051,8 @@ boolean I_LoadSong(char *data, size_t len)
|
||||||
// Everything that uses LOOPMS will work perfectly with SDL_Mixer.
|
// Everything that uses LOOPMS will work perfectly with SDL_Mixer.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fpclassify(song_length) == FP_ZERO && !strncmp(p, key4, key4len)) // is it LENGTHMS=?
|
|
||||||
{
|
|
||||||
p += key4len; // skip LENGTHMS
|
|
||||||
song_length = (float)(atoi(p) / 1000.0L);
|
|
||||||
}
|
|
||||||
// below: search MP3 or other tags that use wide char encoding
|
|
||||||
else if (fpclassify(loop_point) == FP_ZERO && !memcmp(p, key1w, key1len*2)) // LOOP wide char
|
|
||||||
{
|
|
||||||
p += key1len*2;
|
|
||||||
if (!memcmp(p, key2w, (key2len+1)*2)) // POINT= wide char
|
|
||||||
{
|
|
||||||
p += (key2len+1)*2;
|
|
||||||
wstart = (size_t)p;
|
|
||||||
wp = 0;
|
|
||||||
while (wp < 9 && memcmp(p, wterm, 2))
|
|
||||||
{
|
|
||||||
wval[wp] = *p;
|
|
||||||
p += 2;
|
|
||||||
wp = ((size_t)(p-wstart))/2;
|
|
||||||
}
|
|
||||||
wval[min(wp, 9)] = 0;
|
|
||||||
loop_point = (float)((44.1L+atoi(wval) / 44100.0L));
|
|
||||||
}
|
|
||||||
else if (!memcmp(p, key3w, (key3len+1)*2)) // MS= wide char
|
|
||||||
{
|
|
||||||
p += (key3len+1)*2;
|
|
||||||
wstart = (size_t)p;
|
|
||||||
wp = 0;
|
|
||||||
while (wp < 9 && memcmp(p, wterm, 2))
|
|
||||||
{
|
|
||||||
wval[wp] = *p;
|
|
||||||
p += 2;
|
|
||||||
wp = ((size_t)(p-wstart))/2;
|
|
||||||
}
|
|
||||||
wval[min(wp, 9)] = 0;
|
|
||||||
loop_point = (float)(atoi(wval) / 1000.0L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (fpclassify(song_length) == FP_ZERO && !memcmp(p, key4w, (key4len+1)*2)) // LENGTHMS= wide char
|
|
||||||
{
|
|
||||||
p += (key4len+1)*2;
|
|
||||||
wstart = (size_t)p;
|
|
||||||
wp = 0;
|
|
||||||
while (wp < 9 && memcmp(p, wterm, 2))
|
|
||||||
{
|
|
||||||
wval[wp] = *p;
|
|
||||||
p += 2;
|
|
||||||
wp = ((size_t)(p-wstart))/2;
|
|
||||||
}
|
|
||||||
wval[min(wp, 9)] = 0;
|
|
||||||
song_length = (float)(atoi(wval) / 1000.0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fpclassify(loop_point) != FP_ZERO && fpclassify(song_length) != FP_ZERO && song_length > loop_point) // Got what we needed
|
if (fpclassify(loop_point) != FP_ZERO) // Got what we needed
|
||||||
// the last case is a sanity check, in case the wide char searches were false matches.
|
|
||||||
break;
|
break;
|
||||||
else // continue searching
|
else // continue searching
|
||||||
p++;
|
p++;
|
||||||
|
|
|
@ -111,6 +111,7 @@ consvar_t cv_grcoronasize = {"gr_coronasize", "1", CV_SAVE| CV_FLOAT, 0, NULL, 0
|
||||||
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
||||||
// console variables in development
|
// console variables in development
|
||||||
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// local copy of the palette for V_GetColor()
|
// local copy of the palette for V_GetColor()
|
||||||
|
|
|
@ -24,8 +24,10 @@ ifndef NOASM
|
||||||
USEASM=1
|
USEASM=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
ifndef MINGW64 #miniupnc is broken with MINGW64
|
ifndef MINGW64 #miniupnc is broken with MINGW64
|
||||||
HAVE_MINIUPNPC=1
|
HAVE_MINIUPNPC=1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OPTS=-DSTDC_HEADERS
|
OPTS=-DSTDC_HEADERS
|
||||||
|
|
|
@ -639,9 +639,6 @@ void I_Error(const char *error, ...)
|
||||||
if (!errorcount)
|
if (!errorcount)
|
||||||
{
|
{
|
||||||
M_SaveConfig(NULL); // save game config, cvars..
|
M_SaveConfig(NULL); // save game config, cvars..
|
||||||
#ifndef NONET
|
|
||||||
D_SaveBan(); // save the ban list
|
|
||||||
#endif
|
|
||||||
G_SaveGameData();
|
G_SaveGameData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue