mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Fix merge conflicts
This commit is contained in:
		
							parent
							
								
									a14cf1f029
								
							
						
					
					
						commit
						2af75a2bd1
					
				
					 25 changed files with 523 additions and 1132 deletions
				
			
		| 
						 | 
				
			
			@ -35,6 +35,7 @@
 | 
			
		|||
#include "lua_script.h"
 | 
			
		||||
#include "d_netfil.h" // findfile
 | 
			
		||||
#include "r_data.h" // Color_cons_t
 | 
			
		||||
#include "r_skins.h"
 | 
			
		||||
 | 
			
		||||
//========
 | 
			
		||||
// protos.
 | 
			
		||||
| 
						 | 
				
			
			@ -1955,6 +1956,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
 | 
			
		|||
 | 
			
		||||
	if (var->PossibleValue)
 | 
			
		||||
	{
 | 
			
		||||
		/*
 | 
			
		||||
		if (var == &cv_nextmap)
 | 
			
		||||
		{
 | 
			
		||||
			// Special case for the nextmap variable, used only directly from the menu
 | 
			
		||||
| 
						 | 
				
			
			@ -1988,9 +1990,11 @@ void CV_AddValue(consvar_t *var, INT32 increment)
 | 
			
		|||
				return;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		*/
 | 
			
		||||
#define MINVAL 0
 | 
			
		||||
#define MAXVAL 1
 | 
			
		||||
		else if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
 | 
			
		||||
		if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
 | 
			
		||||
		{
 | 
			
		||||
#ifdef PARANOIA
 | 
			
		||||
			if (!var->PossibleValue[MAXVAL].strvalue)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2603,17 +2603,16 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
 | 
			
		|||
		{
 | 
			
		||||
			if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_DOWNLOADSAVEGAME)
 | 
			
		||||
			{
 | 
			
		||||
				F_MenuPresTicker(true); // title sky
 | 
			
		||||
				F_TitleScreenTicker(true);
 | 
			
		||||
				F_TitleScreenDrawer();
 | 
			
		||||
			}
 | 
			
		||||
			CL_DrawConnectionStatus();
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
			I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
			I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
			M_Drawer(); //Needed for drawing messageboxes on the connection screen
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
			I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
			I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
			I_UpdateNoVsync(); // page flip or blit buffer
 | 
			
		||||
			if (moviemode)
 | 
			
		||||
| 
						 | 
				
			
			@ -6315,11 +6314,11 @@ void NetUpdate(void)
 | 
			
		|||
	{
 | 
			
		||||
		resptime = nowtime;
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
		I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
		I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
		M_Ticker();
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
		I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
		I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
		CON_Ticker();
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										31
									
								
								src/d_main.c
									
										
									
									
									
								
							
							
						
						
									
										31
									
								
								src/d_main.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -204,13 +204,13 @@ void D_ProcessEvents(void)
 | 
			
		|||
 | 
			
		||||
		// Menu input
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
		I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
		I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
			eaten = M_Responder(ev);
 | 
			
		||||
		}
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
		I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
		I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		if (eaten)
 | 
			
		||||
| 
						 | 
				
			
			@ -300,11 +300,6 @@ static void D_Display(void)
 | 
			
		|||
		if (vid.recalc || setrenderstillneeded)
 | 
			
		||||
		{
 | 
			
		||||
			SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc()
 | 
			
		||||
#ifdef HWRENDER
 | 
			
		||||
			// Shoot! The screen texture was flushed!
 | 
			
		||||
			if ((rendermode == render_opengl) && (gamestate == GS_INTERMISSION))
 | 
			
		||||
				usebuffer = false;
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (rendermode == render_soft)
 | 
			
		||||
| 
						 | 
				
			
			@ -554,9 +549,8 @@ static void D_Display(void)
 | 
			
		|||
				if (rendermode == render_soft)
 | 
			
		||||
				{
 | 
			
		||||
					VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
 | 
			
		||||
					Y_ConsiderScreenBuffer();
 | 
			
		||||
					usebuffer = true;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				lastdraw = false;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -608,11 +602,11 @@ static void D_Display(void)
 | 
			
		|||
	vid.recalc = 0;
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
	I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
	I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
	M_Drawer(); // menu is drawn even on top of everything
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
	I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
	I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
	// focus lost moved to M_Drawer
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -947,7 +941,6 @@ void D_StartTitle(void)
 | 
			
		|||
	G_SetGametype(GT_RACE); // SRB2kart
 | 
			
		||||
	paused = false;
 | 
			
		||||
	advancedemo = false;
 | 
			
		||||
	F_InitMenuPresValues();
 | 
			
		||||
	F_StartTitleScreen();
 | 
			
		||||
 | 
			
		||||
	currentMenu = &MainDef; // reset the current menu ID
 | 
			
		||||
| 
						 | 
				
			
			@ -1355,13 +1348,6 @@ void D_SRB2Main(void)
 | 
			
		|||
	// adapt tables to SRB2's needs, including extra slots for dehacked file support
 | 
			
		||||
	P_PatchInfoTables();
 | 
			
		||||
 | 
			
		||||
	// initiate menu metadata before SOCcing them
 | 
			
		||||
	M_InitMenuPresTables();
 | 
			
		||||
 | 
			
		||||
	// init title screen display params
 | 
			
		||||
	if (M_GetUrlProtocolArg() || M_CheckParm("-connect"))
 | 
			
		||||
		F_InitMenuPresValues();
 | 
			
		||||
 | 
			
		||||
	//---------------------------------------------------- READY TIME
 | 
			
		||||
	// we need to check for dedicated before initialization of some subsystems
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1372,12 +1358,6 @@ void D_SRB2Main(void)
 | 
			
		|||
	// Make backups of some SOCcable tables.
 | 
			
		||||
	P_BackupTables();
 | 
			
		||||
 | 
			
		||||
	// Setup character tables
 | 
			
		||||
	// Have to be done here before files are loaded
 | 
			
		||||
#ifdef USEPLAYERMENU
 | 
			
		||||
	M_InitCharacterTables();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	// load wad, including the main wad file
 | 
			
		||||
	CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
 | 
			
		||||
	W_InitMultipleFiles(startupiwads, false);
 | 
			
		||||
| 
						 | 
				
			
			@ -1824,7 +1804,6 @@ void D_SRB2Main(void)
 | 
			
		|||
	}
 | 
			
		||||
	else if (M_CheckParm("-skipintro"))
 | 
			
		||||
	{
 | 
			
		||||
		F_InitMenuPresValues();
 | 
			
		||||
		F_StartTitleScreen();
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2325,10 +2325,12 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
 | 
			
		|||
	// The supplied data are assumed to be good.
 | 
			
		||||
	I_Assert(delay >= 0 && delay <= 2);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	if (mapnum != -1)
 | 
			
		||||
	{
 | 
			
		||||
		CV_SetValue(&cv_nextmap, mapnum);
 | 
			
		||||
	}
 | 
			
		||||
	*/
 | 
			
		||||
 | 
			
		||||
	CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d pencoremode=%d resetplayers=%d delay=%d skipprecutscene=%d\n",
 | 
			
		||||
	           mapnum, newgametype, pencoremode, resetplayers, delay, skipprecutscene);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										551
									
								
								src/dehacked.c
									
										
									
									
									
								
							
							
						
						
									
										551
									
								
								src/dehacked.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -76,7 +76,6 @@ static sfxenum_t get_sfx(const char *word);
 | 
			
		|||
static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
 | 
			
		||||
#endif
 | 
			
		||||
static hudnum_t get_huditem(const char *word);
 | 
			
		||||
static menutype_t get_menutype(const char *word);
 | 
			
		||||
//static INT16 get_gametype(const char *word);
 | 
			
		||||
//static powertype_t get_power(const char *word);
 | 
			
		||||
skincolornum_t get_skincolor(const char *word);
 | 
			
		||||
| 
						 | 
				
			
			@ -306,201 +305,6 @@ static void clear_levels(void)
 | 
			
		|||
	P_AllocMapHeader(gamemap-1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static boolean findFreeSlot(INT32 *num)
 | 
			
		||||
{
 | 
			
		||||
	// Send the character select entry to a free slot.
 | 
			
		||||
	while (*num < MAXSKINS && (description[*num].used))
 | 
			
		||||
		*num = *num+1;
 | 
			
		||||
 | 
			
		||||
	// No more free slots. :(
 | 
			
		||||
	if (*num >= MAXSKINS)
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	// Redesign your logo. (See M_DrawSetupChoosePlayerMenu in m_menu.c...)
 | 
			
		||||
	description[*num].picname[0] = '\0';
 | 
			
		||||
	description[*num].nametag[0] = '\0';
 | 
			
		||||
	description[*num].displayname[0] = '\0';
 | 
			
		||||
	description[*num].oppositecolor = SKINCOLOR_NONE;
 | 
			
		||||
	description[*num].tagtextcolor = SKINCOLOR_NONE;
 | 
			
		||||
	description[*num].tagoutlinecolor = SKINCOLOR_NONE;
 | 
			
		||||
 | 
			
		||||
	// Found one! ^_^
 | 
			
		||||
	return (description[*num].used = true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Reads a player.
 | 
			
		||||
// For modifying the character select screen
 | 
			
		||||
static void readPlayer(MYFILE *f, INT32 num)
 | 
			
		||||
{
 | 
			
		||||
	char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
 | 
			
		||||
	char *word;
 | 
			
		||||
	char *word2;
 | 
			
		||||
	char *displayname = ZZ_Alloc(MAXLINELEN+1);
 | 
			
		||||
	INT32 i;
 | 
			
		||||
	boolean slotfound = false;
 | 
			
		||||
 | 
			
		||||
	#define SLOTFOUND \
 | 
			
		||||
		if (!slotfound && (slotfound = findFreeSlot(&num)) == false) \
 | 
			
		||||
			goto done;
 | 
			
		||||
 | 
			
		||||
	displayname[MAXLINELEN] = '\0';
 | 
			
		||||
 | 
			
		||||
	do
 | 
			
		||||
	{
 | 
			
		||||
		if (myfgets(s, MAXLINELEN, f))
 | 
			
		||||
		{
 | 
			
		||||
			if (s[0] == '\n')
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			for (i = 0; i < MAXLINELEN-3; i++)
 | 
			
		||||
			{
 | 
			
		||||
				char *tmp;
 | 
			
		||||
				if (s[i] == '=')
 | 
			
		||||
				{
 | 
			
		||||
					tmp = &s[i+2];
 | 
			
		||||
					strncpy(displayname, tmp, SKINNAMESIZE);
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			word = strtok(s, " ");
 | 
			
		||||
			if (word)
 | 
			
		||||
				strupr(word);
 | 
			
		||||
			else
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			if (fastcmp(word, "PLAYERTEXT"))
 | 
			
		||||
			{
 | 
			
		||||
				char *playertext = NULL;
 | 
			
		||||
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
 | 
			
		||||
				for (i = 0; i < MAXLINELEN-3; i++)
 | 
			
		||||
				{
 | 
			
		||||
					if (s[i] == '=')
 | 
			
		||||
					{
 | 
			
		||||
						playertext = &s[i+2];
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				if (playertext)
 | 
			
		||||
				{
 | 
			
		||||
					strcpy(description[num].notes, playertext);
 | 
			
		||||
					strcat(description[num].notes, myhashfgets(playertext, sizeof (description[num].notes), f));
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
					strcpy(description[num].notes, "");
 | 
			
		||||
 | 
			
		||||
				// For some reason, cutting the string did not work above. Most likely due to strcpy or strcat...
 | 
			
		||||
				// It works down here, though.
 | 
			
		||||
				{
 | 
			
		||||
					INT32 numline = 0;
 | 
			
		||||
					for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++)
 | 
			
		||||
					{
 | 
			
		||||
						if (numline < 20 && description[num].notes[i] == '\n')
 | 
			
		||||
							numline++;
 | 
			
		||||
 | 
			
		||||
						if (numline >= 20 || description[num].notes[i] == '\0' || description[num].notes[i] == '#')
 | 
			
		||||
							break;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				description[num].notes[strlen(description[num].notes)-1] = '\0';
 | 
			
		||||
				description[num].notes[i] = '\0';
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			word2 = strtok(NULL, " = ");
 | 
			
		||||
			if (word2)
 | 
			
		||||
				strupr(word2);
 | 
			
		||||
			else
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			if (word2[strlen(word2)-1] == '\n')
 | 
			
		||||
				word2[strlen(word2)-1] = '\0';
 | 
			
		||||
			i = atoi(word2);
 | 
			
		||||
 | 
			
		||||
			if (fastcmp(word, "PICNAME"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				strncpy(description[num].picname, word2, 8);
 | 
			
		||||
			}
 | 
			
		||||
			// new character select
 | 
			
		||||
			else if (fastcmp(word, "DISPLAYNAME"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				// replace '#' with line breaks
 | 
			
		||||
				// (also remove any '\n')
 | 
			
		||||
				{
 | 
			
		||||
					char *cur = NULL;
 | 
			
		||||
 | 
			
		||||
					// remove '\n'
 | 
			
		||||
					cur = strchr(displayname, '\n');
 | 
			
		||||
					if (cur)
 | 
			
		||||
						*cur = '\0';
 | 
			
		||||
 | 
			
		||||
					// turn '#' into '\n'
 | 
			
		||||
					cur = strchr(displayname, '#');
 | 
			
		||||
					while (cur)
 | 
			
		||||
					{
 | 
			
		||||
						*cur = '\n';
 | 
			
		||||
						cur = strchr(cur, '#');
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				// copy final string
 | 
			
		||||
				strncpy(description[num].displayname, displayname, SKINNAMESIZE);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "OPPOSITECOLOR") || fastcmp(word, "OPPOSITECOLOUR"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				description[num].oppositecolor = (UINT16)get_number(word2);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "NAMETAG") || fastcmp(word, "TAGNAME"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				strncpy(description[num].nametag, word2, 8);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TAGTEXTCOLOR") || fastcmp(word, "TAGTEXTCOLOUR"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				description[num].tagtextcolor = (UINT16)get_number(word2);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TAGOUTLINECOLOR") || fastcmp(word, "TAGOUTLINECOLOUR"))
 | 
			
		||||
			{
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				description[num].tagoutlinecolor = (UINT16)get_number(word2);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "STATUS"))
 | 
			
		||||
			{
 | 
			
		||||
				/*
 | 
			
		||||
					You MAY disable previous entries if you so desire...
 | 
			
		||||
					But try to enable something that's already enabled and you will be sent to a free slot.
 | 
			
		||||
 | 
			
		||||
					Because of this, you are allowed to edit any previous entries you like, but only if you
 | 
			
		||||
					signal that you are purposely doing so by disabling and then reenabling the slot.
 | 
			
		||||
				*/
 | 
			
		||||
				if (i && !slotfound && (slotfound = findFreeSlot(&num)) == false)
 | 
			
		||||
					goto done;
 | 
			
		||||
 | 
			
		||||
				description[num].used = (!!i);
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "SKINNAME"))
 | 
			
		||||
			{
 | 
			
		||||
				// Send to free slot.
 | 
			
		||||
				SLOTFOUND
 | 
			
		||||
				strlcpy(description[num].skinname, word2, sizeof description[num].skinname);
 | 
			
		||||
				strlwr(description[num].skinname);
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
				deh_warning("readPlayer %d: unknown word '%s'", num, word);
 | 
			
		||||
		}
 | 
			
		||||
	} while (!myfeof(f)); // finish when the line is empty
 | 
			
		||||
	#undef SLOTFOUND
 | 
			
		||||
done:
 | 
			
		||||
	Z_Free(displayname);
 | 
			
		||||
	Z_Free(s);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int freeslotusage[2][2] = {{0, 0}, {0, 0}}; // [S_, MT_][max, previous .wad's max]
 | 
			
		||||
 | 
			
		||||
void DEH_UpdateMaxFreeslots(void)
 | 
			
		||||
| 
						 | 
				
			
			@ -2795,206 +2599,6 @@ static void readtextprompt(MYFILE *f, INT32 num)
 | 
			
		|||
	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") || fastcmp(word, "TITLEPICSHIDE"))
 | 
			
		||||
			{
 | 
			
		||||
				// true by default, except MM_MAIN
 | 
			
		||||
				menupres[num].hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSMODE"))
 | 
			
		||||
			{
 | 
			
		||||
				if (fastcmp(word2, "USER"))
 | 
			
		||||
					menupres[num].ttmode = TTMODE_USER;
 | 
			
		||||
				else if (fastcmp(word2, "HIDE") || fastcmp(word2, "HIDDEN") || fastcmp(word2, "NONE"))
 | 
			
		||||
				{
 | 
			
		||||
					menupres[num].ttmode = TTMODE_USER;
 | 
			
		||||
					menupres[num].ttname[0] = 0;
 | 
			
		||||
					menupres[num].hidetitlepics = true;
 | 
			
		||||
				}
 | 
			
		||||
				else // if (fastcmp(word2, "OLD") || fastcmp(word2, "SSNTAILS"))
 | 
			
		||||
					menupres[num].ttmode = TTMODE_OLD;
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSSCALE"))
 | 
			
		||||
			{
 | 
			
		||||
				// Don't handle Alacroix special case here; see Maincfg section.
 | 
			
		||||
				menupres[num].ttscale = max(1, min(8, (UINT8)get_number(word2)));
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSNAME"))
 | 
			
		||||
			{
 | 
			
		||||
				strncpy(menupres[num].ttname, word2, 9);
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSX"))
 | 
			
		||||
			{
 | 
			
		||||
				menupres[num].ttx = (INT16)get_number(word2);
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSY"))
 | 
			
		||||
			{
 | 
			
		||||
				menupres[num].tty = (INT16)get_number(word2);
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSLOOP"))
 | 
			
		||||
			{
 | 
			
		||||
				menupres[num].ttloop = (INT16)get_number(word2);
 | 
			
		||||
				titlechanged = true;
 | 
			
		||||
			}
 | 
			
		||||
			else if (fastcmp(word, "TITLEPICSTICS"))
 | 
			
		||||
			{
 | 
			
		||||
				menupres[num].tttics = (UINT16)get_number(word2);
 | 
			
		||||
				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)
 | 
			
		||||
{
 | 
			
		||||
	char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
 | 
			
		||||
| 
						 | 
				
			
			@ -4710,6 +4314,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
 | 
			
		|||
				// This is not a major mod either.
 | 
			
		||||
				continue;	// continue so that we don't error.
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			word2 = strtok(NULL, " ");
 | 
			
		||||
			if (word2) {
 | 
			
		||||
				strupr(word2);
 | 
			
		||||
| 
						 | 
				
			
			@ -4719,20 +4324,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
 | 
			
		|||
			}
 | 
			
		||||
			else
 | 
			
		||||
				i = 0;
 | 
			
		||||
#ifdef USEPLAYERMENU
 | 
			
		||||
			if (fastcmp(word, "CHARACTER"))
 | 
			
		||||
			{
 | 
			
		||||
				if (i >= 0 && i < 32)
 | 
			
		||||
					readPlayer(f, i);
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					deh_warning("Character %d out of range (0 - 31)", i);
 | 
			
		||||
					ignorelines(f);
 | 
			
		||||
				}
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			if (fastcmp(word, "EMBLEM"))
 | 
			
		||||
			{
 | 
			
		||||
				if (!mainfile && !gamedataadded)
 | 
			
		||||
| 
						 | 
				
			
			@ -4785,7 +4377,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
 | 
			
		|||
				}
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			if (word2)
 | 
			
		||||
			{
 | 
			
		||||
				if (fastcmp(word, "THING") || fastcmp(word, "MOBJ") || fastcmp(word, "OBJECT"))
 | 
			
		||||
| 
						 | 
				
			
			@ -5007,19 +4599,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
 | 
			
		|||
						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"))
 | 
			
		||||
				{
 | 
			
		||||
					if (!mainfile && !gamedataadded)
 | 
			
		||||
| 
						 | 
				
			
			@ -11036,101 +10615,6 @@ static const char *const HUDITEMS_LIST[] = {
 | 
			
		|||
	"POWERUPS"
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
	"MP_SERVER_OPTIONS",
 | 
			
		||||
 | 
			
		||||
	// Options
 | 
			
		||||
	"OP_MAIN",
 | 
			
		||||
 | 
			
		||||
	"OP_P1CONTROLS",
 | 
			
		||||
	"OP_CHANGECONTROLS", // OP_ChangeControlsDef shared with P2
 | 
			
		||||
	"OP_P1MOUSE",
 | 
			
		||||
	"OP_P1JOYSTICK",
 | 
			
		||||
	"OP_JOYSTICKSET", // OP_JoystickSetDef shared with P2
 | 
			
		||||
	"OP_P1CAMERA",
 | 
			
		||||
 | 
			
		||||
	"OP_P2CONTROLS",
 | 
			
		||||
	"OP_P2MOUSE",
 | 
			
		||||
	"OP_P2JOYSTICK",
 | 
			
		||||
	"OP_P2CAMERA",
 | 
			
		||||
 | 
			
		||||
	"OP_PLAYSTYLE",
 | 
			
		||||
 | 
			
		||||
	"OP_VIDEO",
 | 
			
		||||
	"OP_VIDEOMODE",
 | 
			
		||||
	"OP_COLOR",
 | 
			
		||||
	"OP_OPENGL",
 | 
			
		||||
	"OP_OPENGL_LIGHTING",
 | 
			
		||||
 | 
			
		||||
	"OP_SOUND",
 | 
			
		||||
 | 
			
		||||
	"OP_SERVER",
 | 
			
		||||
	"OP_MONITORTOGGLE",
 | 
			
		||||
 | 
			
		||||
	"OP_DATA",
 | 
			
		||||
	"OP_ADDONS",
 | 
			
		||||
	"OP_SCREENSHOTS",
 | 
			
		||||
	"OP_ERASEDATA",
 | 
			
		||||
 | 
			
		||||
	// Extras
 | 
			
		||||
	"SR_MAIN",
 | 
			
		||||
	"SR_PANDORA",
 | 
			
		||||
	"SR_LEVELSELECT",
 | 
			
		||||
	"SR_UNLOCKCHECKLIST",
 | 
			
		||||
	"SR_EMBLEMHINT",
 | 
			
		||||
	"SR_PLAYER",
 | 
			
		||||
	"SR_SOUNDTEST",
 | 
			
		||||
 | 
			
		||||
	// Addons (Part of MISC, but let's make it our own)
 | 
			
		||||
	"AD_MAIN",
 | 
			
		||||
 | 
			
		||||
	// MISC
 | 
			
		||||
	// "MESSAGE",
 | 
			
		||||
	// "SPAUSE",
 | 
			
		||||
 | 
			
		||||
	// "MPAUSE",
 | 
			
		||||
	// "SCRAMBLETEAM",
 | 
			
		||||
	// "CHANGETEAM",
 | 
			
		||||
	// "CHANGELEVEL",
 | 
			
		||||
 | 
			
		||||
	// "MAPAUSE",
 | 
			
		||||
	// "HELP",
 | 
			
		||||
 | 
			
		||||
	"SPECIAL"
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct {
 | 
			
		||||
	const char *n;
 | 
			
		||||
	// has to be able to hold both fixed_t and angle_t, so drastic measure!!
 | 
			
		||||
| 
						 | 
				
			
			@ -11926,20 +11410,6 @@ static hudnum_t get_huditem(const char *word)
 | 
			
		|||
	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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
static INT16 get_gametype(const char *word)
 | 
			
		||||
{ // Returns the value of GT_ enumerations
 | 
			
		||||
| 
						 | 
				
			
			@ -12157,11 +11627,6 @@ static fixed_t find_const(const char **rword)
 | 
			
		|||
		free(word);
 | 
			
		||||
		return r;
 | 
			
		||||
	}
 | 
			
		||||
	else if (fastncmp("MN_",word,3)) {
 | 
			
		||||
		r = get_menutype(word);
 | 
			
		||||
		free(word);
 | 
			
		||||
		return r;
 | 
			
		||||
	}
 | 
			
		||||
	else if (fastncmp("GT_",word,3)) {
 | 
			
		||||
		r = get_gametype(word);
 | 
			
		||||
		free(word);
 | 
			
		||||
| 
						 | 
				
			
			@ -12771,16 +12236,6 @@ static inline int lib_getenum(lua_State *L)
 | 
			
		|||
		if (mathlib) return luaL_error(L, "NiGHTS grade '%s' could not be found.\n", word);
 | 
			
		||||
		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)) {
 | 
			
		||||
		char *caps;
 | 
			
		||||
		// Try to get a Lua action first.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@
 | 
			
		|||
#include "i_net.h"
 | 
			
		||||
#include "g_game.h"
 | 
			
		||||
#include "p_tick.h"
 | 
			
		||||
#include "m_menu.h" // gametype_cons_t
 | 
			
		||||
#include "k_menu.h" // gametype_cons_t
 | 
			
		||||
#include "r_things.h" // skins
 | 
			
		||||
#include "mserv.h" // cv_advertise
 | 
			
		||||
#include "z_zone.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -264,7 +264,7 @@ static void DRPC_HandleJoinRequest(const DiscordUser *requestUser)
 | 
			
		|||
	else
 | 
			
		||||
	{
 | 
			
		||||
		discordRequestList = newRequest;
 | 
			
		||||
		M_RefreshPauseMenu();
 | 
			
		||||
		//M_RefreshPauseMenu();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Made it to the end, request was valid, so play the request sound :)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,6 @@ static INT32 timetonext; // Delay between screen changes
 | 
			
		|||
 | 
			
		||||
static tic_t animtimer; // Used for some animation timings
 | 
			
		||||
static tic_t credbgtimer; // Credits background
 | 
			
		||||
static INT16 skullAnimCounter; // Prompts: Chevron animation
 | 
			
		||||
 | 
			
		||||
static tic_t stoptimer;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -406,11 +405,11 @@ void F_IntroDrawer(void)
 | 
			
		|||
					I_OsPolling();
 | 
			
		||||
					I_UpdateNoBlit();
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
					I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
					I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
					M_Drawer(); // menu is drawn even on top of wipes
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
					I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
					I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
					I_FinishUpdate(); // Update the screen with the image Tails 06-19-2001
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1680,35 +1679,6 @@ void F_GameEndTicker(void)
 | 
			
		|||
//  TITLE SCREEN
 | 
			
		||||
// ==============
 | 
			
		||||
 | 
			
		||||
void F_InitMenuPresValues(void)
 | 
			
		||||
{
 | 
			
		||||
	menuanimtimer = 0;
 | 
			
		||||
	prevMenuId = 0;
 | 
			
		||||
	activeMenuId = MainDef.menuid;
 | 
			
		||||
 | 
			
		||||
	// Set defaults for presentation values
 | 
			
		||||
	strncpy(curbgname, "TITLESKY", 9);
 | 
			
		||||
	curfadevalue = 16;
 | 
			
		||||
	curbgcolor = 31;
 | 
			
		||||
	curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
 | 
			
		||||
	curbgyspeed = (gamestate == GS_TIMEATTACK) ? 22 : titlescrollyspeed;
 | 
			
		||||
	curbghide = (gamestate == GS_TIMEATTACK) ? false : true;
 | 
			
		||||
 | 
			
		||||
	curhidepics = hidetitlepics;
 | 
			
		||||
	curttmode = ttmode;
 | 
			
		||||
	curttscale = ttscale;
 | 
			
		||||
	strncpy(curttname, ttname, 9);
 | 
			
		||||
	curttx = ttx;
 | 
			
		||||
	curtty = tty;
 | 
			
		||||
	curttloop = ttloop;
 | 
			
		||||
	curtttics = tttics;
 | 
			
		||||
 | 
			
		||||
	// Find current presentation values
 | 
			
		||||
	//M_SetMenuCurBackground((gamestate == GS_TIMEATTACK) ? "RECATTBG" : "TITLESKY");
 | 
			
		||||
	//M_SetMenuCurFadeValue(16);
 | 
			
		||||
	//M_SetMenuCurTitlePics();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// F_SkyScroll
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			@ -1825,7 +1795,7 @@ void F_StartTitleScreen(void)
 | 
			
		|||
	{
 | 
			
		||||
		ttuser_count = 0;
 | 
			
		||||
		finalecount = 0;
 | 
			
		||||
		wipetypepost = menupres[MN_MAIN].enterwipe;
 | 
			
		||||
		wipetypepost = 0;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		wipegamestate = GS_TITLESCREEN;
 | 
			
		||||
| 
						 | 
				
			
			@ -1877,10 +1847,6 @@ void F_StartTitleScreen(void)
 | 
			
		|||
		camera[0].chase = true;
 | 
			
		||||
		camera[0].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[displayplayers[0]].mo, NULL);
 | 
			
		||||
 | 
			
		||||
		wipegamestate = prevwipegamestate;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
| 
						 | 
				
			
			@ -2004,14 +1970,6 @@ luahook:
 | 
			
		|||
	LUAh_TitleHUD();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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
 | 
			
		||||
void F_TitleScreenTicker(boolean run)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -2026,10 +1984,7 @@ void F_TitleScreenTicker(boolean run)
 | 
			
		|||
		else if (finalecount == 50)
 | 
			
		||||
		{
 | 
			
		||||
			// Now start the music
 | 
			
		||||
			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);
 | 
			
		||||
			S_ChangeMusicInternal("_title", looptitle);
 | 
			
		||||
			S_StartSound(NULL, sfx_s23c);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -129,9 +129,6 @@ extern UINT16 curtttics;
 | 
			
		|||
 | 
			
		||||
#define TITLEBACKGROUNDACTIVE (curfadevalue >= 0 || curbgname[0])
 | 
			
		||||
 | 
			
		||||
void F_InitMenuPresValues(void);
 | 
			
		||||
void F_MenuPresTicker(boolean run);
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// WIPE
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -500,11 +500,11 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu, const char *colormap, boolean r
 | 
			
		|||
		if (drawMenu)
 | 
			
		||||
		{
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
			I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
			I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
			M_Drawer(); // menu is drawn even on top of wipes
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
			I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
			I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@
 | 
			
		|||
#include "g_game.h"
 | 
			
		||||
#include "g_demo.h"
 | 
			
		||||
#include "m_misc.h"
 | 
			
		||||
#include "m_menu.h"
 | 
			
		||||
#include "k_menu.h"
 | 
			
		||||
#include "m_argv.h"
 | 
			
		||||
#include "hu_stuff.h"
 | 
			
		||||
#include "z_zone.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1892,7 +1892,6 @@ void G_Ticker(boolean run)
 | 
			
		|||
			break;
 | 
			
		||||
 | 
			
		||||
		case GS_MENU:
 | 
			
		||||
			F_MenuPresTicker(run);
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		case GS_INTRO:
 | 
			
		||||
| 
						 | 
				
			
			@ -3590,8 +3589,6 @@ demointermission:
 | 
			
		|||
// See also F_EndCutscene, the only other place which handles intra-map/ending transitions
 | 
			
		||||
void G_AfterIntermission(void)
 | 
			
		||||
{
 | 
			
		||||
	Y_CleanupScreenBuffer();
 | 
			
		||||
 | 
			
		||||
	if (modeattacking)
 | 
			
		||||
	{
 | 
			
		||||
		M_EndModeAttackRun();
 | 
			
		||||
| 
						 | 
				
			
			@ -4379,8 +4376,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
 | 
			
		|||
 | 
			
		||||
	(void)FLS;
 | 
			
		||||
 | 
			
		||||
	Y_CleanupScreenBuffer();
 | 
			
		||||
 | 
			
		||||
	if (paused)
 | 
			
		||||
	{
 | 
			
		||||
		paused = false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ Documentation available here.
 | 
			
		|||
#include "d_clisrv.h"
 | 
			
		||||
#include "command.h"
 | 
			
		||||
#include "m_argv.h"
 | 
			
		||||
#include "m_menu.h"
 | 
			
		||||
#include "k_menu.h"
 | 
			
		||||
#include "mserv.h"
 | 
			
		||||
#include "i_tcp.h"/* for current_port */
 | 
			
		||||
#include "i_threads.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										40
									
								
								src/k_menu.h
									
										
									
									
									
								
							
							
						
						
									
										40
									
								
								src/k_menu.h
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -76,6 +76,10 @@
 | 
			
		|||
 | 
			
		||||
#define MAXSTRINGLENGTH 32
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
extern I_mutex k_menu_mutex;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef union
 | 
			
		||||
{
 | 
			
		||||
	struct menu_s *submenu;      // IT_SUBMENU
 | 
			
		||||
| 
						 | 
				
			
			@ -83,9 +87,21 @@ typedef union
 | 
			
		|||
	void (*routine)(INT32 choice); // IT_CALL, IT_KEYHANDLER, IT_ARROWS
 | 
			
		||||
} itemaction_t;
 | 
			
		||||
 | 
			
		||||
// Player Setup menu colors linked list
 | 
			
		||||
typedef struct menucolor_s {
 | 
			
		||||
	struct menucolor_s *next;
 | 
			
		||||
	struct menucolor_s *prev;
 | 
			
		||||
	UINT16 color;
 | 
			
		||||
} menucolor_t;
 | 
			
		||||
 | 
			
		||||
extern menucolor_t *menucolorhead, *menucolortail;
 | 
			
		||||
 | 
			
		||||
extern CV_PossibleValue_t gametype_cons_t[];
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// MENU TYPEDEFS
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
typedef struct menuitem_s
 | 
			
		||||
{
 | 
			
		||||
	UINT16 status; // show IT_xxx
 | 
			
		||||
| 
						 | 
				
			
			@ -97,19 +113,23 @@ typedef struct menuitem_s
 | 
			
		|||
	void *itemaction; // FIXME: should be itemaction_t
 | 
			
		||||
 | 
			
		||||
	// extra variables
 | 
			
		||||
	UINT8 mvar1;
 | 
			
		||||
	UINT8 mvar2;
 | 
			
		||||
	INT32 mvar1;
 | 
			
		||||
	INT32 mvar2;
 | 
			
		||||
} menuitem_t;
 | 
			
		||||
 | 
			
		||||
typedef struct menu_s
 | 
			
		||||
{
 | 
			
		||||
	INT16          numitems;           // # of menu items
 | 
			
		||||
	struct menu_s *prevMenu;           // previous menu
 | 
			
		||||
 | 
			
		||||
	INT16          lastOn;             // last item user was on in menu
 | 
			
		||||
	menuitem_t    *menuitems;          // menu items
 | 
			
		||||
 | 
			
		||||
	INT16          x, y;               // x, y of menu
 | 
			
		||||
 | 
			
		||||
	INT16          transitionID;       // only transition if IDs match
 | 
			
		||||
	INT16          transitionTics;     // tics for transitions out
 | 
			
		||||
 | 
			
		||||
	void         (*drawroutine)(void); // draw routine
 | 
			
		||||
	void         (*tickroutine)(void); // ticker routine
 | 
			
		||||
	boolean      (*quitroutine)(void); // called before quit a menu return true if we can
 | 
			
		||||
| 
						 | 
				
			
			@ -185,6 +205,9 @@ typedef enum
 | 
			
		|||
 | 
			
		||||
// K_MENUFUNC.C
 | 
			
		||||
 | 
			
		||||
// Moviemode menu updating
 | 
			
		||||
void Moviemode_option_Onchange(void);
 | 
			
		||||
 | 
			
		||||
extern menu_t *currentMenu;
 | 
			
		||||
extern char dummystaffname[22];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -228,6 +251,14 @@ void M_HandleImageDef(INT32 choice);
 | 
			
		|||
void M_QuitResponse(INT32 ch);
 | 
			
		||||
void M_QuitSRB2(INT32 choice);
 | 
			
		||||
 | 
			
		||||
void M_AddMenuColor(UINT16 color);
 | 
			
		||||
void M_MoveColorBefore(UINT16 color, UINT16 targ);
 | 
			
		||||
void M_MoveColorAfter(UINT16 color, UINT16 targ);
 | 
			
		||||
UINT16 M_GetColorBefore(UINT16 color);
 | 
			
		||||
UINT16 M_GetColorAfter(UINT16 color);
 | 
			
		||||
void M_InitPlayerSetupColors(void);
 | 
			
		||||
void M_FreePlayerSetupColors(void);
 | 
			
		||||
 | 
			
		||||
// If you want to waste a bunch of memory for a limit no one will hit, feel free to boost this to MAXSKINS :P
 | 
			
		||||
// I figure this will be enough clone characters to fit onto the character select.
 | 
			
		||||
// (If someone runs into it after release I'll probably boost it, though.)
 | 
			
		||||
| 
						 | 
				
			
			@ -317,6 +348,8 @@ void M_CupSelectTick(void);
 | 
			
		|||
void M_LevelSelectHandler(INT32 choice);
 | 
			
		||||
void M_LevelSelectTick(void);
 | 
			
		||||
 | 
			
		||||
extern tic_t playback_last_menu_interaction_leveltime;
 | 
			
		||||
 | 
			
		||||
void M_EndModeAttackRun(void);
 | 
			
		||||
void M_SetPlaybackMenuPointer(void);
 | 
			
		||||
void M_PlaybackRewind(INT32 choice);
 | 
			
		||||
| 
						 | 
				
			
			@ -325,12 +358,15 @@ void M_PlaybackFastForward(INT32 choice);
 | 
			
		|||
void M_PlaybackAdvance(INT32 choice);
 | 
			
		||||
void M_PlaybackSetViews(INT32 choice);
 | 
			
		||||
void M_PlaybackAdjustView(INT32 choice);
 | 
			
		||||
void M_PlaybackToggleFreecam(INT32 choice);
 | 
			
		||||
void M_PlaybackQuit(INT32 choice);
 | 
			
		||||
 | 
			
		||||
void M_ReplayHut(INT32 choice);
 | 
			
		||||
 | 
			
		||||
// M_MENUDRAW.C
 | 
			
		||||
 | 
			
		||||
void M_DrawMenuBackground(void);
 | 
			
		||||
void M_DrawMenuForeground(void);
 | 
			
		||||
void M_Drawer(void);
 | 
			
		||||
void M_DrawGenericMenu(void);
 | 
			
		||||
void M_DrawKartGamemodeMenu(void);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -157,10 +157,10 @@ menu_t PLAY_TimeAttackDef = {
 | 
			
		|||
menuitem_t PLAY_BattleGamemodesMenu[] =
 | 
			
		||||
{
 | 
			
		||||
	{IT_STRING | IT_CALL, "Survival", "It's last hedgehog standing in this free-for-all!",
 | 
			
		||||
		"MENIMG00", M_LevelSelectInit, 0, GT_MATCH},
 | 
			
		||||
		"MENIMG00", M_LevelSelectInit, 0, GT_BATTLE},
 | 
			
		||||
 | 
			
		||||
	{IT_STRING | IT_CALL, "Time Attack", "Bust up all of the capsules in record time!",
 | 
			
		||||
		NULL, M_LevelSelectInit, 1, GT_MATCH},
 | 
			
		||||
		NULL, M_LevelSelectInit, 1, GT_BATTLE},
 | 
			
		||||
 | 
			
		||||
	{IT_STRING | IT_CALL, "Back", NULL, NULL, M_GoBack, 0, 0},
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -173,23 +173,23 @@ menu_t PLAY_BattleGamemodesDef = KARTGAMEMODEMENU(PLAY_BattleGamemodesMenu, &PLA
 | 
			
		|||
 | 
			
		||||
menuitem_t PAUSE_PlaybackMenu[] =
 | 
			
		||||
{
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Hide Menu", NULL, "M_PHIDE", M_SelectableClearMenus, 0, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Hide Menu (Esc)",			NULL, "M_PHIDE",	M_SelectableClearMenus,		  0, 0},
 | 
			
		||||
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Rewind", NULL, "M_PREW",        M_PlaybackRewind,      20, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Pause", NULL, "M_PPAUSE",       M_PlaybackPause,       36, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Fast-Forward", NULL, "M_PFFWD", M_PlaybackFastForward, 52, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Rewind ([)",				NULL, "M_PREW",		M_PlaybackRewind,			 20, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Pause (\\)",				NULL, "M_PPAUSE",	M_PlaybackPause,			 36, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Fast-Forward (])",			NULL, "M_PFFWD",	M_PlaybackFastForward,		 52, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Backup Frame ([)",			NULL, "M_PSTEPB",	M_PlaybackRewind,			 20, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Resume",					NULL, "M_PRESUM",	M_PlaybackPause,			 36, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Advance Frame (])",		NULL, "M_PFADV",	M_PlaybackAdvance,			 52, 0},
 | 
			
		||||
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Backup Frame", NULL, "M_PSTEPB", M_PlaybackRewind,  20, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Resume", NULL, "M_PRESUM",       M_PlaybackPause,   36, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Advance Frame", NULL, "M_PFADV", M_PlaybackAdvance, 52, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "View Count (- and =)",		NULL, "M_PVIEWS",	M_PlaybackSetViews,			 72, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint (1)",			NULL, "M_PNVIEW",	M_PlaybackAdjustView,		 88, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 2 (2)",			NULL, "M_PNVIEW",	M_PlaybackAdjustView,		104, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 3 (3)",			NULL, "M_PNVIEW",	M_PlaybackAdjustView,		120, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 4 (4)",			NULL, "M_PNVIEW",	M_PlaybackAdjustView,		136, 0},
 | 
			
		||||
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "View Count", NULL, "M_PVIEWS",  M_PlaybackSetViews,    72, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint", NULL, "M_PNVIEW",   M_PlaybackAdjustView,  88, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 2", NULL, "M_PNVIEW", M_PlaybackAdjustView, 104, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 3", NULL, "M_PNVIEW", M_PlaybackAdjustView, 120, 0},
 | 
			
		||||
	{IT_ARROWS | IT_STRING, "Viewpoint 4", NULL, "M_PNVIEW", M_PlaybackAdjustView, 136, 0},
 | 
			
		||||
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Stop Playback", NULL, "M_PEXIT", M_PlaybackQuit, 156, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Toggle Free Camera (')",	NULL, "M_PVIEWS",	M_PlaybackToggleFreecam,	156, 0},
 | 
			
		||||
	{IT_CALL   | IT_STRING, "Stop Playback",			NULL, "M_PEXIT",	M_PlaybackQuit,				172, 0},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
menu_t PAUSE_PlaybackMenuDef = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										191
									
								
								src/k_menudraw.c
									
										
									
									
									
								
							
							
						
						
									
										191
									
								
								src/k_menudraw.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -46,6 +46,7 @@
 | 
			
		|||
#include "st_stuff.h"
 | 
			
		||||
#include "i_sound.h"
 | 
			
		||||
#include "k_kart.h" // SRB2kart
 | 
			
		||||
#include "k_hud.h" // SRB2kart
 | 
			
		||||
#include "d_player.h" // KITEM_ constants
 | 
			
		||||
#include "doomstat.h" // MAXSPLITSCREENPLAYERS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -84,11 +85,26 @@ int	snprintf(char *str, size_t n, const char *fmt, ...);
 | 
			
		|||
#define SLIDER_WIDTH (8*SLIDER_RANGE+6)
 | 
			
		||||
#define SERVERS_PER_PAGE 11
 | 
			
		||||
 | 
			
		||||
void M_DrawMenuBackground(void)
 | 
			
		||||
{
 | 
			
		||||
	V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG", PU_CACHE), NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_DrawMenuForeground(void)
 | 
			
		||||
{
 | 
			
		||||
	// draw non-green resolution border
 | 
			
		||||
	if ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0))
 | 
			
		||||
	{
 | 
			
		||||
		V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("WEIRDRES", PU_CACHE), NULL);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// M_Drawer
 | 
			
		||||
// Called after the view has been rendered,
 | 
			
		||||
// but before it has been blitted.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
void M_Drawer(void)
 | 
			
		||||
{
 | 
			
		||||
	if (currentMenu == &MessageDef)
 | 
			
		||||
| 
						 | 
				
			
			@ -99,17 +115,19 @@ void M_Drawer(void)
 | 
			
		|||
 | 
			
		||||
	if (menuactive)
 | 
			
		||||
	{
 | 
			
		||||
		if (gamestate == GS_MENU) // draw BG
 | 
			
		||||
			V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG", PU_CACHE), NULL);
 | 
			
		||||
		if (gamestate == GS_MENU)
 | 
			
		||||
		{
 | 
			
		||||
			M_DrawMenuBackground();
 | 
			
		||||
		}
 | 
			
		||||
		else if (!WipeInAction && currentMenu != &PAUSE_PlaybackMenuDef)
 | 
			
		||||
		{
 | 
			
		||||
			V_DrawCustomFadeScreen("FADEMAP0", 4); // now that's more readable with a faded background (yeah like Quake...)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (currentMenu->drawroutine)
 | 
			
		||||
			currentMenu->drawroutine(); // call current menu Draw routine
 | 
			
		||||
 | 
			
		||||
		// draw non-green resolution border
 | 
			
		||||
		if ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0))
 | 
			
		||||
			V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("WEIRDRES", PU_CACHE), NULL);
 | 
			
		||||
		M_DrawMenuForeground();
 | 
			
		||||
 | 
			
		||||
		// Draw version down in corner
 | 
			
		||||
		// ... but only in the MAIN MENU.  I'm a picky bastard.
 | 
			
		||||
| 
						 | 
				
			
			@ -228,7 +246,6 @@ void M_DrawGenericMenu(void)
 | 
			
		|||
	{
 | 
			
		||||
		if (i == itemOn)
 | 
			
		||||
			cursory = y;
 | 
			
		||||
 | 
			
		||||
		switch (currentMenu->menuitems[i].status & IT_DISPLAY)
 | 
			
		||||
		{
 | 
			
		||||
			case IT_PATCH:
 | 
			
		||||
| 
						 | 
				
			
			@ -274,8 +291,6 @@ void M_DrawGenericMenu(void)
 | 
			
		|||
					case IT_CVAR:
 | 
			
		||||
					{
 | 
			
		||||
						consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction;
 | 
			
		||||
						char asterisks[MAXSTRINGLENGTH+1];
 | 
			
		||||
						size_t sl;
 | 
			
		||||
						switch (currentMenu->menuitems[i].status & IT_CVARTYPE)
 | 
			
		||||
						{
 | 
			
		||||
#if 0
 | 
			
		||||
| 
						 | 
				
			
			@ -285,27 +300,6 @@ void M_DrawGenericMenu(void)
 | 
			
		|||
							case IT_CV_INVISSLIDER: // monitor toggles use this
 | 
			
		||||
								break;
 | 
			
		||||
#endif
 | 
			
		||||
							case IT_CV_PASSWORD:
 | 
			
		||||
								if (i == itemOn)
 | 
			
		||||
								{
 | 
			
		||||
									V_DrawRightAlignedThinString(x + MAXSTRINGLENGTH*8 + 10, y, V_ALLOWLOWERCASE, va(M_GetText("Tab: %s password"), cv->value ? "hide" : "show"));
 | 
			
		||||
								}
 | 
			
		||||
 | 
			
		||||
								if (!cv->value || i != itemOn)
 | 
			
		||||
								{
 | 
			
		||||
									sl = strlen(cv->string);
 | 
			
		||||
									memset(asterisks, '*', sl);
 | 
			
		||||
									memset(asterisks + sl, 0, MAXSTRINGLENGTH+1-sl);
 | 
			
		||||
 | 
			
		||||
									M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1);
 | 
			
		||||
									V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, asterisks);
 | 
			
		||||
									if (skullAnimCounter < 4 && i == itemOn)
 | 
			
		||||
										V_DrawCharacter(x + 8 + V_StringWidth(asterisks, 0), y + 12,
 | 
			
		||||
											'_' | 0x80, false);
 | 
			
		||||
									y += 16;
 | 
			
		||||
									break;
 | 
			
		||||
								}
 | 
			
		||||
								/* fallthru */
 | 
			
		||||
							case IT_CV_STRING:
 | 
			
		||||
								M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1);
 | 
			
		||||
								V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string);
 | 
			
		||||
| 
						 | 
				
			
			@ -544,7 +538,7 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
 | 
			
		|||
	if (p->mdepth == CSSTEP_ALTS)
 | 
			
		||||
		numoptions = setup_chargrid[p->gridx][p->gridy].numskins;
 | 
			
		||||
	else
 | 
			
		||||
		numoptions = MAXSKINCOLORS-1;
 | 
			
		||||
		numoptions = numskincolors-1;
 | 
			
		||||
 | 
			
		||||
	angamt /= numoptions;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -570,7 +564,7 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
 | 
			
		|||
			n %= numoptions;
 | 
			
		||||
 | 
			
		||||
			skin = setup_chargrid[p->gridx][p->gridy].skinlist[n];
 | 
			
		||||
			patch = facerankprefix[skin];
 | 
			
		||||
			patch = faceprefix[skin][FACE_RANK];
 | 
			
		||||
			colormap = R_GetTranslationColormap(skin, skins[skin].prefcolor, GTC_MENUCACHE);
 | 
			
		||||
			radius = 24<<FRACBITS;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -629,16 +623,60 @@ static void M_DrawCharSelectCircle(setup_player_t *p, INT16 x, INT16 y)
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void M_DrawCharSelectSprite(UINT8 num, INT16 x, INT16 y)
 | 
			
		||||
{
 | 
			
		||||
	setup_player_t *p = &setup_player[num];
 | 
			
		||||
 | 
			
		||||
	SINT8 skin = setup_chargrid[p->gridx][p->gridy].skinlist[p->clonenum];
 | 
			
		||||
	UINT8 color = p->color;
 | 
			
		||||
	UINT8 *colormap = R_GetTranslationColormap(skin, color, GTC_MENUCACHE);
 | 
			
		||||
 | 
			
		||||
	if (skin != -1)
 | 
			
		||||
	{
 | 
			
		||||
		UINT8 spr;
 | 
			
		||||
		spritedef_t *sprdef;
 | 
			
		||||
		spriteframe_t *sprframe;
 | 
			
		||||
		patch_t *sprpatch;
 | 
			
		||||
 | 
			
		||||
		UINT32 flags = 0;
 | 
			
		||||
		UINT32 frame;
 | 
			
		||||
 | 
			
		||||
		spr = P_GetSkinSprite2(&skins[skin], SPR2_FSTN, NULL);
 | 
			
		||||
		sprdef = &skins[skin].sprites[spr];
 | 
			
		||||
 | 
			
		||||
		if (!sprdef->numframes) // No frames ??
 | 
			
		||||
			return; // Can't render!
 | 
			
		||||
 | 
			
		||||
		frame = states[S_KART_FAST].frame & FF_FRAMEMASK;
 | 
			
		||||
		if (frame >= sprdef->numframes) // Walking animation missing
 | 
			
		||||
			frame = 0; // Try to use standing frame
 | 
			
		||||
 | 
			
		||||
		sprframe = &sprdef->spriteframes[frame];
 | 
			
		||||
		sprpatch = W_CachePatchNum(sprframe->lumppat[1], PU_CACHE);
 | 
			
		||||
 | 
			
		||||
		if (sprframe->flip & 1) // Only for first sprite
 | 
			
		||||
			flags |= V_FLIP; // This sprite is left/right flipped!
 | 
			
		||||
 | 
			
		||||
		// Flip for left-side players
 | 
			
		||||
		if (!(num & 1))
 | 
			
		||||
			flags ^= V_FLIP;
 | 
			
		||||
 | 
			
		||||
		if (skins[skin].flags & SF_HIRES)
 | 
			
		||||
		{
 | 
			
		||||
			V_DrawFixedPatch(x<<FRACBITS,
 | 
			
		||||
						y<<FRACBITS,
 | 
			
		||||
						skins[skin].highresscale,
 | 
			
		||||
						flags, sprpatch, colormap);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
			V_DrawMappedPatch(x, y, flags, sprpatch, colormap);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void M_DrawCharSelectPreview(UINT8 num)
 | 
			
		||||
{
 | 
			
		||||
	INT16 x = 11, y = 5;
 | 
			
		||||
	char letter = 'A' + num;
 | 
			
		||||
	SINT8 skin;
 | 
			
		||||
	UINT8 color;
 | 
			
		||||
	UINT8 *colormap;
 | 
			
		||||
	patch_t *sprpatch;
 | 
			
		||||
	spritedef_t *sprdef;
 | 
			
		||||
	spriteframe_t *sprframe;
 | 
			
		||||
	setup_player_t *p = &setup_player[num];
 | 
			
		||||
 | 
			
		||||
	if (num & 1)
 | 
			
		||||
| 
						 | 
				
			
			@ -651,59 +689,26 @@ static void M_DrawCharSelectPreview(UINT8 num)
 | 
			
		|||
 | 
			
		||||
	if (p->mdepth >= CSSTEP_CHARS)
 | 
			
		||||
	{
 | 
			
		||||
		skin = setup_chargrid[p->gridx][p->gridy].skinlist[p->clonenum];
 | 
			
		||||
 | 
			
		||||
		color = p->color;
 | 
			
		||||
		colormap = R_GetTranslationColormap(skin, color, GTC_MENUCACHE);
 | 
			
		||||
 | 
			
		||||
		if (skin != -1)
 | 
			
		||||
		{
 | 
			
		||||
			statenum_t st = S_KART_FAST1;
 | 
			
		||||
			UINT32 flags = 0;
 | 
			
		||||
			UINT32 frame;
 | 
			
		||||
 | 
			
		||||
			if (skullAnimCounter & 1)
 | 
			
		||||
				st++;
 | 
			
		||||
 | 
			
		||||
			sprdef = &skins[skin].spritedef;
 | 
			
		||||
 | 
			
		||||
			if (sprdef->numframes) // No frames ??
 | 
			
		||||
			{
 | 
			
		||||
				frame = states[st].frame & FF_FRAMEMASK;
 | 
			
		||||
				if (frame >= sprdef->numframes) // Walking animation missing
 | 
			
		||||
					frame = 0; // Try to use standing frame
 | 
			
		||||
 | 
			
		||||
				sprframe = &sprdef->spriteframes[frame];
 | 
			
		||||
				sprpatch = W_CachePatchNum(sprframe->lumppat[1], PU_CACHE);
 | 
			
		||||
				if (sprframe->flip & 1) // Only for first sprite
 | 
			
		||||
					flags |= V_FLIP; // This sprite is left/right flipped!
 | 
			
		||||
 | 
			
		||||
				// Flip for left-side players
 | 
			
		||||
				if (!(num & 1))
 | 
			
		||||
					flags ^= V_FLIP;
 | 
			
		||||
 | 
			
		||||
				if (skins[skin].flags & SF_HIRES)
 | 
			
		||||
				{
 | 
			
		||||
					V_DrawFixedPatch((x+32)<<FRACBITS,
 | 
			
		||||
								(y+75)<<FRACBITS,
 | 
			
		||||
								skins[skin].highresscale,
 | 
			
		||||
								flags, sprpatch, colormap);
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
					V_DrawMappedPatch(x+32, y+75, flags, sprpatch, colormap);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		M_DrawCharSelectSprite(num, x+32, y+75);
 | 
			
		||||
 | 
			
		||||
		if (p->mdepth == CSSTEP_ALTS || p->mdepth == CSSTEP_COLORS)
 | 
			
		||||
		{
 | 
			
		||||
			M_DrawCharSelectCircle(p, x+32, y+64);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if ((setup_animcounter/10) & 1)
 | 
			
		||||
	{
 | 
			
		||||
		if (p->mdepth == CSSTEP_NONE && num == setup_numplayers)
 | 
			
		||||
		{
 | 
			
		||||
			V_DrawScaledPatch(x+1, y+36, 0, W_CachePatchName("4PSTART", PU_CACHE));
 | 
			
		||||
		//else if (p->mdepth >= CSSTEP_READY)
 | 
			
		||||
		//	V_DrawScaledPatch(x+1, y+36, 0, W_CachePatchName("4PREADY", PU_CACHE));
 | 
			
		||||
		}
 | 
			
		||||
		/*
 | 
			
		||||
		else if (p->mdepth >= CSSTEP_READY)
 | 
			
		||||
		{
 | 
			
		||||
			V_DrawScaledPatch(x+1, y+36, 0, W_CachePatchName("4PREADY", PU_CACHE));
 | 
			
		||||
		}
 | 
			
		||||
		*/
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	V_DrawScaledPatch(x+9, y+2, 0, W_CachePatchName("FILEBACK", PU_CACHE));
 | 
			
		||||
| 
						 | 
				
			
			@ -856,7 +861,7 @@ void M_DrawCharacterSelect(void)
 | 
			
		|||
				else
 | 
			
		||||
					colormap = R_GetTranslationColormap(skin, skins[skin].prefcolor, GTC_MENUCACHE);
 | 
			
		||||
 | 
			
		||||
				V_DrawMappedPatch(82 + (i*16) + quadx, 22 + (j*16) + quady, 0, facerankprefix[skin], colormap);
 | 
			
		||||
				V_DrawMappedPatch(82 + (i*16) + quadx, 22 + (j*16) + quady, 0, faceprefix[skin][FACE_RANK], colormap);
 | 
			
		||||
 | 
			
		||||
				if (setup_chargrid[i][j].numskins > 1)
 | 
			
		||||
					V_DrawScaledPatch(82 + (i*16) + quadx, 22 + (j*16) + quady + 11, 0, W_CachePatchName("ALTSDOT", PU_CACHE));
 | 
			
		||||
| 
						 | 
				
			
			@ -1087,19 +1092,13 @@ static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map)
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (mapheaderinfo[map]->actnum[0])
 | 
			
		||||
	if (mapheaderinfo[map]->actnum)
 | 
			
		||||
	{
 | 
			
		||||
		word2[word2len] = ' ';
 | 
			
		||||
		word2len++;
 | 
			
		||||
 | 
			
		||||
		for (i = 0; i < 3; i++)
 | 
			
		||||
		{
 | 
			
		||||
			if (!mapheaderinfo[map]->actnum[i])
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			word2[word2len] = mapheaderinfo[map]->actnum[i];
 | 
			
		||||
			word2len++;
 | 
			
		||||
		}
 | 
			
		||||
		word2[word2len] = '0' + mapheaderinfo[map]->actnum;
 | 
			
		||||
		word2len++;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	word1[word1len] = '\0';
 | 
			
		||||
| 
						 | 
				
			
			@ -1243,11 +1242,19 @@ void M_DrawTimeAttack(void)
 | 
			
		|||
//
 | 
			
		||||
// INGAME / PAUSE MENUS
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
tic_t playback_last_menu_interaction_leveltime = 0;
 | 
			
		||||
 | 
			
		||||
void M_DrawPlaybackMenu(void)
 | 
			
		||||
{
 | 
			
		||||
	INT16 i;
 | 
			
		||||
	patch_t *icon = NULL;
 | 
			
		||||
	UINT8 *activemap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_GOLD, GTC_MENUCACHE);
 | 
			
		||||
	UINT32 transmap = max(0, (INT32)(leveltime - playback_last_menu_interaction_leveltime - 4*TICRATE)) / 5;
 | 
			
		||||
	transmap = min(8, transmap) << V_ALPHASHIFT;
 | 
			
		||||
 | 
			
		||||
	if (leveltime - playback_last_menu_interaction_leveltime >= 6*TICRATE)
 | 
			
		||||
		playback_last_menu_interaction_leveltime = leveltime - 6*TICRATE;
 | 
			
		||||
 | 
			
		||||
	// Toggle items
 | 
			
		||||
	if (paused && !demo.rewinding)
 | 
			
		||||
| 
						 | 
				
			
			@ -1312,7 +1319,7 @@ void M_DrawPlaybackMenu(void)
 | 
			
		|||
			{
 | 
			
		||||
				INT32 ply = displayplayers[i - playback_view1];
 | 
			
		||||
 | 
			
		||||
				icon = facerankprefix[players[ply].skin];
 | 
			
		||||
				icon = faceprefix[players[ply].skin][FACE_RANK];
 | 
			
		||||
				if (i != itemOn)
 | 
			
		||||
					inactivemap = R_GetTranslationColormap(players[ply].skin, players[ply].skincolor, GTC_MENUCACHE);
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										411
									
								
								src/k_menufunc.c
									
										
									
									
									
								
							
							
						
						
									
										411
									
								
								src/k_menufunc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -58,6 +58,8 @@
 | 
			
		|||
// And just some randomness for the exits.
 | 
			
		||||
#include "m_random.h"
 | 
			
		||||
 | 
			
		||||
#include "r_skins.h"
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_SDL)
 | 
			
		||||
#include "SDL.h"
 | 
			
		||||
#if SDL_VERSION_ATLEAST(2,0,0)
 | 
			
		||||
| 
						 | 
				
			
			@ -75,6 +77,10 @@ int	snprintf(char *str, size_t n, const char *fmt, ...);
 | 
			
		|||
// GLOBAL VARIABLES
 | 
			
		||||
// ==========================================================================
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
I_mutex k_menu_mutex;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
boolean menuactive = false;
 | 
			
		||||
boolean fromlevelselect = false;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -102,7 +108,14 @@ static boolean noFurtherInput = false;
 | 
			
		|||
static void Dummymenuplayer_OnChange(void);
 | 
			
		||||
static void Dummystaff_OnChange(void);
 | 
			
		||||
 | 
			
		||||
consvar_t cv_showfocuslost = {"showfocuslost", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL };
 | 
			
		||||
consvar_t cv_showfocuslost = CVAR_INIT ("showfocuslost", "Yes", CV_SAVE, CV_YesNo, NULL);
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t skins_cons_t[MAXSKINS+1] = {{1, DEFAULTSKIN}};
 | 
			
		||||
consvar_t cv_chooseskin = CVAR_INIT ("chooseskin", DEFAULTSKIN, CV_HIDDEN, skins_cons_t, NULL);
 | 
			
		||||
 | 
			
		||||
// This gametype list is integral for many different reasons.
 | 
			
		||||
// When you add gametypes here, don't forget to update them in dehacked.c and doomstat.h!
 | 
			
		||||
CV_PossibleValue_t gametype_cons_t[NUMGAMETYPES+1];
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t serversort_cons_t[] = {
 | 
			
		||||
	{0,"Ping"},
 | 
			
		||||
| 
						 | 
				
			
			@ -113,44 +126,41 @@ static CV_PossibleValue_t serversort_cons_t[] = {
 | 
			
		|||
	{5,"Gametype"},
 | 
			
		||||
	{0,NULL}
 | 
			
		||||
};
 | 
			
		||||
consvar_t cv_serversort = {"serversort", "Ping", CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_serversort = CVAR_INIT ("serversort", "Ping", CV_CALL, serversort_cons_t, M_SortServerList);
 | 
			
		||||
 | 
			
		||||
// first time memory
 | 
			
		||||
consvar_t cv_tutorialprompt = CVAR_INIT ("tutorialprompt", "On", CV_SAVE, CV_OnOff, NULL);
 | 
			
		||||
 | 
			
		||||
// autorecord demos for time attack
 | 
			
		||||
static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
static consvar_t cv_autorecord = CVAR_INIT ("autorecord", "Yes", 0, CV_YesNo, NULL);
 | 
			
		||||
 | 
			
		||||
CV_PossibleValue_t ghost_cons_t[] = {{0, "Hide"}, {1, "Show Character"}, {2, "Show All"}, {0, NULL}};
 | 
			
		||||
CV_PossibleValue_t ghost2_cons_t[] = {{0, "Hide"}, {1, "Show"}, {0, NULL}};
 | 
			
		||||
 | 
			
		||||
consvar_t cv_ghost_besttime  = {"ghost_besttime",  "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_ghost_bestlap   = {"ghost_bestlap",   "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_ghost_last      = {"ghost_last",      "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_ghost_guest     = {"ghost_guest",     "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_ghost_staff     = {"ghost_staff",     "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static void Splitplayers_OnChange(void);
 | 
			
		||||
CV_PossibleValue_t splitplayers_cons_t[] = {{1, "One"}, {2, "Two"}, {3, "Three"}, {4, "Four"}, {0, NULL}};
 | 
			
		||||
consvar_t cv_splitplayers = {"splitplayers", "One", CV_CALL, splitplayers_cons_t, Splitplayers_OnChange, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
consvar_t cv_ghost_besttime  = CVAR_INIT ("ghost_besttime",  "Show All", CV_SAVE, ghost_cons_t, NULL);
 | 
			
		||||
consvar_t cv_ghost_bestlap   = CVAR_INIT ("ghost_bestlap",   "Show All", CV_SAVE, ghost_cons_t, NULL);
 | 
			
		||||
consvar_t cv_ghost_last      = CVAR_INIT ("ghost_last",      "Show All", CV_SAVE, ghost_cons_t, NULL);
 | 
			
		||||
consvar_t cv_ghost_guest     = CVAR_INIT ("ghost_guest",     "Show", CV_SAVE, ghost2_cons_t, NULL);
 | 
			
		||||
consvar_t cv_ghost_staff     = CVAR_INIT ("ghost_staff",     "Show", CV_SAVE, ghost2_cons_t, NULL);
 | 
			
		||||
 | 
			
		||||
//Console variables used solely in the menu system.
 | 
			
		||||
//todo: add a way to use non-console variables in the menu
 | 
			
		||||
//      or make these consvars legitimate like color or skin.
 | 
			
		||||
static CV_PossibleValue_t skins_cons_t[MAXSKINS+1] = {{1, DEFAULTSKIN}};
 | 
			
		||||
consvar_t cv_chooseskin = {"chooseskin", DEFAULTSKIN, CV_HIDDEN, skins_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
static void Splitplayers_OnChange(void);
 | 
			
		||||
CV_PossibleValue_t splitplayers_cons_t[] = {{1, "One"}, {2, "Two"}, {3, "Three"}, {4, "Four"}, {0, NULL}};
 | 
			
		||||
consvar_t cv_splitplayers = CVAR_INIT ("splitplayers", "One", CV_CALL, splitplayers_cons_t, Splitplayers_OnChange);
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t dummymenuplayer_cons_t[] = {{0, "NOPE"}, {1, "P1"}, {2, "P2"}, {3, "P3"}, {4, "P4"}, {0, NULL}};
 | 
			
		||||
static consvar_t cv_dummymenuplayer = {"dummymenuplayer", "P1", CV_HIDDEN|CV_CALL, dummymenuplayer_cons_t, Dummymenuplayer_OnChange, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t dummyteam_cons_t[] = {{0, "Spectator"}, {1, "Red"}, {2, "Blue"}, {0, NULL}};
 | 
			
		||||
static consvar_t cv_dummyteam = {"dummyteam", "Spectator", CV_HIDDEN, dummyteam_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t dummyspectate_cons_t[] = {{0, "Spectator"}, {1, "Playing"}, {0, NULL}};
 | 
			
		||||
static consvar_t cv_dummyspectate = {"dummyspectate", "Spectator", CV_HIDDEN, dummyspectate_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t dummyscramble_cons_t[] = {{0, "Random"}, {1, "Points"}, {0, NULL}};
 | 
			
		||||
static consvar_t cv_dummyscramble = {"dummyscramble", "Random", CV_HIDDEN, dummyscramble_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static CV_PossibleValue_t dummystaff_cons_t[] = {{0, "MIN"}, {100, "MAX"}, {0, NULL}};
 | 
			
		||||
static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDDEN|CV_CALL, dummystaff_cons_t, Dummystaff_OnChange, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
static consvar_t cv_dummymenuplayer = CVAR_INIT ("dummymenuplayer", "P1", CV_HIDDEN|CV_CALL, dummymenuplayer_cons_t, Dummymenuplayer_OnChange);
 | 
			
		||||
static consvar_t cv_dummyteam = CVAR_INIT ("dummyteam", "Spectator", CV_HIDDEN, dummyteam_cons_t, NULL);
 | 
			
		||||
static consvar_t cv_dummyspectate = CVAR_INIT ("dummyspectate", "Spectator", CV_HIDDEN, dummyspectate_cons_t, NULL);
 | 
			
		||||
static consvar_t cv_dummyscramble = CVAR_INIT ("dummyscramble", "Random", CV_HIDDEN, dummyscramble_cons_t, NULL);
 | 
			
		||||
static consvar_t cv_dummystaff = CVAR_INIT ("dummystaff", "0", CV_HIDDEN|CV_CALL, dummystaff_cons_t, Dummystaff_OnChange);
 | 
			
		||||
 | 
			
		||||
// ==========================================================================
 | 
			
		||||
// CVAR ONCHANGE EVENTS GO HERE
 | 
			
		||||
| 
						 | 
				
			
			@ -330,6 +340,14 @@ void Moviemode_mode_Onchange(void)
 | 
			
		|||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Moviemode_option_Onchange(void)
 | 
			
		||||
{
 | 
			
		||||
#if 0
 | 
			
		||||
	OP_ScreenshotOptionsMenu[op_movie_folder].status =
 | 
			
		||||
		(cv_movie_option.value == 3 ? IT_CVAR|IT_STRING|IT_CV_STRING : IT_DISABLED);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Addons_option_Onchange(void)
 | 
			
		||||
{
 | 
			
		||||
#if 0
 | 
			
		||||
| 
						 | 
				
			
			@ -371,6 +389,179 @@ void M_SortServerList(void)
 | 
			
		|||
// BASIC MENU HANDLING
 | 
			
		||||
// =========================================================================
 | 
			
		||||
 | 
			
		||||
void M_AddMenuColor(UINT16 color) {
 | 
			
		||||
	menucolor_t *c;
 | 
			
		||||
 | 
			
		||||
	// SRB2Kart: I do not understand vanilla doesn't need this but WE do???!?!??!
 | 
			
		||||
	if (!skincolors[color].accessible) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (color >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_AddMenuColor: color %d does not exist.",color);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	c = (menucolor_t *)malloc(sizeof(menucolor_t));
 | 
			
		||||
	c->color = color;
 | 
			
		||||
	if (menucolorhead == NULL) {
 | 
			
		||||
		c->next = c;
 | 
			
		||||
		c->prev = c;
 | 
			
		||||
		menucolorhead = c;
 | 
			
		||||
		menucolortail = c;
 | 
			
		||||
	} else {
 | 
			
		||||
		c->next = menucolorhead;
 | 
			
		||||
		c->prev = menucolortail;
 | 
			
		||||
		menucolortail->next = c;
 | 
			
		||||
		menucolorhead->prev = c;
 | 
			
		||||
		menucolortail = c;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_MoveColorBefore(UINT16 color, UINT16 targ) {
 | 
			
		||||
	menucolor_t *look, *c = NULL, *t = NULL;
 | 
			
		||||
 | 
			
		||||
	if (color == targ)
 | 
			
		||||
		return;
 | 
			
		||||
	if (color >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_MoveColorBefore: color %d does not exist.",color);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	if (targ >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_MoveColorBefore: target color %d does not exist.",targ);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (look=menucolorhead;;look=look->next) {
 | 
			
		||||
		if (look->color == color)
 | 
			
		||||
			c = look;
 | 
			
		||||
		else if (look->color == targ)
 | 
			
		||||
			t = look;
 | 
			
		||||
		if (c != NULL && t != NULL)
 | 
			
		||||
			break;
 | 
			
		||||
		if (look==menucolortail)
 | 
			
		||||
			return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (c == t->prev)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (t==menucolorhead)
 | 
			
		||||
		menucolorhead = c;
 | 
			
		||||
	if (c==menucolortail)
 | 
			
		||||
		menucolortail = c->prev;
 | 
			
		||||
 | 
			
		||||
	c->prev->next = c->next;
 | 
			
		||||
	c->next->prev = c->prev;
 | 
			
		||||
 | 
			
		||||
	c->prev = t->prev;
 | 
			
		||||
	c->next = t;
 | 
			
		||||
	t->prev->next = c;
 | 
			
		||||
	t->prev = c;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_MoveColorAfter(UINT16 color, UINT16 targ) {
 | 
			
		||||
	menucolor_t *look, *c = NULL, *t = NULL;
 | 
			
		||||
 | 
			
		||||
	if (color == targ)
 | 
			
		||||
		return;
 | 
			
		||||
	if (color >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_MoveColorAfter: color %d does not exist.\n",color);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	if (targ >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_MoveColorAfter: target color %d does not exist.\n",targ);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (look=menucolorhead;;look=look->next) {
 | 
			
		||||
		if (look->color == color)
 | 
			
		||||
			c = look;
 | 
			
		||||
		else if (look->color == targ)
 | 
			
		||||
			t = look;
 | 
			
		||||
		if (c != NULL && t != NULL)
 | 
			
		||||
			break;
 | 
			
		||||
		if (look==menucolortail)
 | 
			
		||||
			return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (t == c->prev)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (t==menucolortail)
 | 
			
		||||
		menucolortail = c;
 | 
			
		||||
	else if (c==menucolortail)
 | 
			
		||||
		menucolortail = c->prev;
 | 
			
		||||
 | 
			
		||||
	c->prev->next = c->next;
 | 
			
		||||
	c->next->prev = c->prev;
 | 
			
		||||
 | 
			
		||||
	c->next = t->next;
 | 
			
		||||
	c->prev = t;
 | 
			
		||||
	t->next->prev = c;
 | 
			
		||||
	t->next = c;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
UINT16 M_GetColorBefore(UINT16 color) {
 | 
			
		||||
	menucolor_t *look;
 | 
			
		||||
 | 
			
		||||
	if (color >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_GetColorBefore: color %d does not exist.\n",color);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (look=menucolorhead;;look=look->next) {
 | 
			
		||||
		if (look->color == color)
 | 
			
		||||
			return look->prev->color;
 | 
			
		||||
		if (look==menucolortail)
 | 
			
		||||
			return 0;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
UINT16 M_GetColorAfter(UINT16 color) {
 | 
			
		||||
	menucolor_t *look;
 | 
			
		||||
 | 
			
		||||
	if (color >= numskincolors) {
 | 
			
		||||
		CONS_Printf("M_GetColorAfter: color %d does not exist.\n",color);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (look=menucolorhead;;look=look->next) {
 | 
			
		||||
		if (look->color == color)
 | 
			
		||||
			return look->next->color;
 | 
			
		||||
		if (look==menucolortail)
 | 
			
		||||
			return 0;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_InitPlayerSetupColors(void) {
 | 
			
		||||
	UINT8 i;
 | 
			
		||||
	numskincolors = SKINCOLOR_FIRSTFREESLOT;
 | 
			
		||||
	menucolorhead = menucolortail = NULL;
 | 
			
		||||
	for (i=0; i<numskincolors; i++)
 | 
			
		||||
		M_AddMenuColor(i);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_FreePlayerSetupColors(void) {
 | 
			
		||||
	menucolor_t *look = menucolorhead, *tmp;
 | 
			
		||||
 | 
			
		||||
	if (menucolorhead==NULL)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	while (true) {
 | 
			
		||||
		if (look != menucolortail) {
 | 
			
		||||
			tmp = look;
 | 
			
		||||
			look = look->next;
 | 
			
		||||
			free(tmp);
 | 
			
		||||
		} else {
 | 
			
		||||
			free(look);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	menucolorhead = menucolortail = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void M_ChangeCvar(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	consvar_t *cv = (consvar_t *)currentMenu->menuitems[itemOn].itemaction;
 | 
			
		||||
| 
						 | 
				
			
			@ -378,17 +569,6 @@ static void M_ChangeCvar(INT32 choice)
 | 
			
		|||
	// Backspace sets values to default value
 | 
			
		||||
	if (choice == -1)
 | 
			
		||||
	{
 | 
			
		||||
		// There's a default color technically, but it's not ideal. Use your skin's prefcolor instead!
 | 
			
		||||
		if (cv == &cv_playercolor)
 | 
			
		||||
		{
 | 
			
		||||
			SINT8 skinno = R_SkinAvailable(cv_chooseskin.string);
 | 
			
		||||
 | 
			
		||||
			if (skinno != -1)
 | 
			
		||||
				CV_SetValue(cv, skins[skinno].prefcolor);
 | 
			
		||||
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		CV_Set(cv, cv->defaultvalue);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -533,15 +713,15 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
		switch (ch)
 | 
			
		||||
		{
 | 
			
		||||
			case KEY_MOUSE1:
 | 
			
		||||
			//case KEY_JOY1:
 | 
			
		||||
			//case KEY_JOY1 + 2:
 | 
			
		||||
				//case KEY_JOY1:
 | 
			
		||||
				//case KEY_JOY1 + 2:
 | 
			
		||||
				ch = KEY_ENTER;
 | 
			
		||||
				break;
 | 
			
		||||
			/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
 | 
			
		||||
				ch = 'n';
 | 
			
		||||
				break;*/
 | 
			
		||||
				/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
 | 
			
		||||
					ch = 'n';
 | 
			
		||||
					break;*/
 | 
			
		||||
			case KEY_MOUSE1 + 1:
 | 
			
		||||
			//case KEY_JOY1 + 1:
 | 
			
		||||
				//case KEY_JOY1 + 1:
 | 
			
		||||
				ch = KEY_BACKSPACE;
 | 
			
		||||
				break;
 | 
			
		||||
			case KEY_HAT1:
 | 
			
		||||
| 
						 | 
				
			
			@ -562,10 +742,10 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
	{
 | 
			
		||||
		if (ev->type == ev_joystick  && ev->data1 == 0 && joywait < I_GetTime())
 | 
			
		||||
		{
 | 
			
		||||
			const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_deadzone.value) >> FRACBITS;
 | 
			
		||||
			const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_deadzone[0].value) >> FRACBITS;
 | 
			
		||||
			if (ev->data3 != INT32_MAX)
 | 
			
		||||
			{
 | 
			
		||||
				if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone)
 | 
			
		||||
				if (Joystick[0].bGamepadStyle || abs(ev->data3) > jdeadzone)
 | 
			
		||||
				{
 | 
			
		||||
					if (ev->data3 < 0 && pjoyy >= 0)
 | 
			
		||||
					{
 | 
			
		||||
| 
						 | 
				
			
			@ -585,7 +765,7 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
 | 
			
		||||
			if (ev->data2 != INT32_MAX)
 | 
			
		||||
			{
 | 
			
		||||
				if (Joystick.bGamepadStyle || abs(ev->data2) > jdeadzone)
 | 
			
		||||
				if (Joystick[0].bGamepadStyle || abs(ev->data2) > jdeadzone)
 | 
			
		||||
				{
 | 
			
		||||
					if (ev->data2 < 0 && pjoyx >= 0)
 | 
			
		||||
					{
 | 
			
		||||
| 
						 | 
				
			
			@ -637,9 +817,9 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
 | 
			
		||||
	if (ch == -1)
 | 
			
		||||
		return false;
 | 
			
		||||
	else if (ch == gamecontrol[gc_systemmenu][0] || ch == gamecontrol[gc_systemmenu][1]) // allow remappable ESC key
 | 
			
		||||
	else if (ch == gamecontrol[0][gc_systemmenu][0] || ch == gamecontrol[0][gc_systemmenu][1]) // allow remappable ESC key
 | 
			
		||||
		ch = KEY_ESCAPE;
 | 
			
		||||
	else if ((ch == gamecontrol[gc_accelerate][0] || ch == gamecontrol[gc_accelerate][1])  && ch >= KEY_MOUSE1)
 | 
			
		||||
	else if ((ch == gamecontrol[0][gc_accelerate][0] || ch == gamecontrol[0][gc_accelerate][1])  && ch >= KEY_MOUSE1)
 | 
			
		||||
		ch = KEY_ENTER;
 | 
			
		||||
 | 
			
		||||
	// F-Keys
 | 
			
		||||
| 
						 | 
				
			
			@ -699,11 +879,12 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
				return true;
 | 
			
		||||
 | 
			
		||||
			case KEY_F11: // Empty (used to be Gamma)
 | 
			
		||||
				//CV_AddValue(&cv_usegamma, 1);
 | 
			
		||||
				//CV_AddValue(&cv_globalgamma, 1);
 | 
			
		||||
				return true;
 | 
			
		||||
 | 
			
		||||
			// Spymode on F12 handled in game logic
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			case KEY_ESCAPE: // Pop up menu
 | 
			
		||||
				if (chat_on)
 | 
			
		||||
				{
 | 
			
		||||
| 
						 | 
				
			
			@ -714,13 +895,11 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
					M_StartControlPanel();
 | 
			
		||||
				return true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		noFurtherInput = false; // turns out we didn't care
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if ((ch == gamecontrol[gc_brake][0] || ch == gamecontrol[gc_brake][1]) && ch >= KEY_MOUSE1) // do this here, otherwise brake opens the menu mid-game
 | 
			
		||||
	if ((ch == gamecontrol[0][gc_brake][0] || ch == gamecontrol[0][gc_brake][1]) && ch >= KEY_MOUSE1) // do this here, otherwise brake opens the menu mid-game
 | 
			
		||||
		ch = KEY_ESCAPE;
 | 
			
		||||
 | 
			
		||||
	routine = currentMenu->menuitems[itemOn].itemaction;
 | 
			
		||||
| 
						 | 
				
			
			@ -751,8 +930,11 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
		else
 | 
			
		||||
		{
 | 
			
		||||
			// dirty hack: for customising controls, I want only buttons/keys, not moves
 | 
			
		||||
			if (ev->type == ev_mouse || ev->type == ev_mouse2 || ev->type == ev_joystick
 | 
			
		||||
				|| ev->type == ev_joystick2 || ev->type == ev_joystick3 || ev->type == ev_joystick4)
 | 
			
		||||
			if (ev->type == ev_mouse
 | 
			
		||||
				|| ev->type == ev_joystick
 | 
			
		||||
				|| ev->type == ev_joystick2
 | 
			
		||||
				|| ev->type == ev_joystick3
 | 
			
		||||
				|| ev->type == ev_joystick4)
 | 
			
		||||
				return true;
 | 
			
		||||
			if (routine)
 | 
			
		||||
			{
 | 
			
		||||
| 
						 | 
				
			
			@ -766,10 +948,8 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
	// BP: one of the more big hack i have never made
 | 
			
		||||
	if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR)
 | 
			
		||||
	{
 | 
			
		||||
		if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING || (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD)
 | 
			
		||||
		if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING)
 | 
			
		||||
		{
 | 
			
		||||
			if (ch == KEY_TAB && (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD)
 | 
			
		||||
				((consvar_t *)currentMenu->menuitems[itemOn].itemaction)->value ^= 1;
 | 
			
		||||
 | 
			
		||||
			if (shiftdown && ch >= 32 && ch <= 127)
 | 
			
		||||
				ch = shiftxform[ch];
 | 
			
		||||
| 
						 | 
				
			
			@ -782,8 +962,9 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
			routine = M_ChangeCvar;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (currentMenu == &PAUSE_PlaybackMenuDef)
 | 
			
		||||
	if (currentMenu == &PAUSE_PlaybackMenuDef && !con_destlines)
 | 
			
		||||
	{
 | 
			
		||||
		playback_last_menu_interaction_leveltime = leveltime;
 | 
			
		||||
		// Flip left/right with up/down for the playback menu, since it's a horizontal icon row.
 | 
			
		||||
		switch (ch)
 | 
			
		||||
		{
 | 
			
		||||
| 
						 | 
				
			
			@ -791,6 +972,56 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
			case KEY_UPARROW: ch = KEY_RIGHTARROW; break;
 | 
			
		||||
			case KEY_RIGHTARROW: ch = KEY_DOWNARROW; break;
 | 
			
		||||
			case KEY_DOWNARROW: ch = KEY_LEFTARROW; break;
 | 
			
		||||
 | 
			
		||||
			// arbitrary keyboard shortcuts because fuck you
 | 
			
		||||
 | 
			
		||||
			case '\'':	// toggle freecam
 | 
			
		||||
				M_PlaybackToggleFreecam(0);
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			case ']':	// ffw / advance frame (depends on if paused or not)
 | 
			
		||||
				if (paused)
 | 
			
		||||
					M_PlaybackAdvance(0);
 | 
			
		||||
				else
 | 
			
		||||
					M_PlaybackFastForward(0);
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			case '[':	// rewind /backupframe, uses the same function
 | 
			
		||||
				M_PlaybackRewind(0);
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			case '\\':	// pause
 | 
			
		||||
				M_PlaybackPause(0);
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			// viewpoints, an annoyance (tm)
 | 
			
		||||
			case '-':	// viewpoint minus
 | 
			
		||||
				M_PlaybackSetViews(-1);	// yeah lol.
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			case '=':	// viewpoint plus
 | 
			
		||||
				M_PlaybackSetViews(1);	// yeah lol.
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			// switch viewpoints:
 | 
			
		||||
			case '1':	// viewpoint for p1 (also f12)
 | 
			
		||||
				// maximum laziness:
 | 
			
		||||
				if (!demo.freecam)
 | 
			
		||||
					G_AdjustView(1, 1, true);
 | 
			
		||||
				break;
 | 
			
		||||
			case '2':	// viewpoint for p2
 | 
			
		||||
				if (!demo.freecam)
 | 
			
		||||
					G_AdjustView(2, 1, true);
 | 
			
		||||
				break;
 | 
			
		||||
			case '3':	// viewpoint for p3
 | 
			
		||||
				if (!demo.freecam)
 | 
			
		||||
					G_AdjustView(3, 1, true);
 | 
			
		||||
				break;
 | 
			
		||||
			case '4':	// viewpoint for p4
 | 
			
		||||
				if (!demo.freecam)
 | 
			
		||||
					G_AdjustView(4, 1, true);
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			default: break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -840,9 +1071,9 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
			if (currentMenu == &PAUSE_PlaybackMenuDef)
 | 
			
		||||
			{
 | 
			
		||||
				boolean held = (boolean)playback_enterheld;
 | 
			
		||||
				playback_enterheld = TICRATE/7;
 | 
			
		||||
				if (held)
 | 
			
		||||
					return true;
 | 
			
		||||
				playback_enterheld = 3;
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -856,7 +1087,7 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
				{
 | 
			
		||||
					if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && majormods)
 | 
			
		||||
					{
 | 
			
		||||
						M_StartMessage(M_GetText("This cannot be done with complex add-ons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING);
 | 
			
		||||
						M_StartMessage(M_GetText("This cannot be done with complex addons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING);
 | 
			
		||||
						return true;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			@ -876,7 +1107,6 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
						break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return true;
 | 
			
		||||
 | 
			
		||||
		case KEY_ESCAPE:
 | 
			
		||||
| 
						 | 
				
			
			@ -902,15 +1132,17 @@ boolean M_Responder(event_t *ev)
 | 
			
		|||
 | 
			
		||||
				if (cv == &cv_chooseskin
 | 
			
		||||
					|| cv == &cv_dummystaff
 | 
			
		||||
					/*|| cv == &cv_nextmap
 | 
			
		||||
					|| cv == &cv_newgametype*/)
 | 
			
		||||
					/*
 | 
			
		||||
					|| cv == &cv_nextmap
 | 
			
		||||
					|| cv == &cv_newgametype
 | 
			
		||||
					*/
 | 
			
		||||
					)
 | 
			
		||||
					return true;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
				if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
 | 
			
		||||
#endif
 | 
			
		||||
					S_StartSound(NULL, sfx_s3k5b);
 | 
			
		||||
 | 
			
		||||
				routine(-1);
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -1194,7 +1426,6 @@ void M_GoBack(INT32 choice)
 | 
			
		|||
		//make sure the game doesn't still think we're in a netgame.
 | 
			
		||||
		if (!Playing() && netgame && multiplayer)
 | 
			
		||||
		{
 | 
			
		||||
			MSCloseUDPSocket();		// Clean up so we can re-open the connection later.
 | 
			
		||||
			netgame = false;
 | 
			
		||||
			multiplayer = false;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -1599,8 +1830,6 @@ struct setup_explosions_s setup_explosions[48];
 | 
			
		|||
UINT8 setup_numplayers = 0;
 | 
			
		||||
tic_t setup_animcounter = 0;
 | 
			
		||||
 | 
			
		||||
consvar_t *setup_playercvars[MAXSPLITSCREENPLAYERS][SPLITCV_MAX];
 | 
			
		||||
 | 
			
		||||
void M_CharacterSelectInit(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	UINT8 i, j;
 | 
			
		||||
| 
						 | 
				
			
			@ -1621,22 +1850,6 @@ void M_CharacterSelectInit(INT32 choice)
 | 
			
		|||
	memset(setup_explosions, 0, sizeof(setup_explosions));
 | 
			
		||||
	setup_animcounter = 0;
 | 
			
		||||
 | 
			
		||||
	// Keep these in a table for the sake of my sanity later
 | 
			
		||||
	setup_playercvars[0][SPLITCV_SKIN] = &cv_skin;
 | 
			
		||||
	setup_playercvars[1][SPLITCV_SKIN] = &cv_skin2;
 | 
			
		||||
	setup_playercvars[2][SPLITCV_SKIN] = &cv_skin3;
 | 
			
		||||
	setup_playercvars[3][SPLITCV_SKIN] = &cv_skin4;
 | 
			
		||||
 | 
			
		||||
	setup_playercvars[0][SPLITCV_COLOR] = &cv_playercolor;
 | 
			
		||||
	setup_playercvars[1][SPLITCV_COLOR] = &cv_playercolor2;
 | 
			
		||||
	setup_playercvars[2][SPLITCV_COLOR] = &cv_playercolor3;
 | 
			
		||||
	setup_playercvars[3][SPLITCV_COLOR] = &cv_playercolor4;
 | 
			
		||||
 | 
			
		||||
	setup_playercvars[0][SPLITCV_NAME] = &cv_playername;
 | 
			
		||||
	setup_playercvars[1][SPLITCV_NAME] = &cv_playername2;
 | 
			
		||||
	setup_playercvars[2][SPLITCV_NAME] = &cv_playername3;
 | 
			
		||||
	setup_playercvars[3][SPLITCV_NAME] = &cv_playername4;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < numskins; i++)
 | 
			
		||||
	{
 | 
			
		||||
		UINT8 x = skins[i].kartspeed-1;
 | 
			
		||||
| 
						 | 
				
			
			@ -1652,7 +1865,7 @@ void M_CharacterSelectInit(INT32 choice)
 | 
			
		|||
 | 
			
		||||
		for (j = 0; j < MAXSPLITSCREENPLAYERS; j++)
 | 
			
		||||
		{
 | 
			
		||||
			if (!strcmp(setup_playercvars[j][SPLITCV_SKIN]->string, skins[i].name))
 | 
			
		||||
			if (!strcmp(cv_skin[j].string, skins[i].name))
 | 
			
		||||
			{
 | 
			
		||||
				setup_player[j].gridx = x;
 | 
			
		||||
				setup_player[j].gridy = y;
 | 
			
		||||
| 
						 | 
				
			
			@ -1809,7 +2022,7 @@ static void M_HandleColorRotate(INT32 choice, setup_player_t *p)
 | 
			
		|||
	{
 | 
			
		||||
		case KEY_RIGHTARROW:
 | 
			
		||||
			p->color++;
 | 
			
		||||
			if (p->color >= MAXSKINCOLORS)
 | 
			
		||||
			if (p->color >= numskincolors)
 | 
			
		||||
				p->color = 1;
 | 
			
		||||
			p->rotate = CSROTATETICS;
 | 
			
		||||
			//p->delay = CSROTATETICS;
 | 
			
		||||
| 
						 | 
				
			
			@ -1818,7 +2031,7 @@ static void M_HandleColorRotate(INT32 choice, setup_player_t *p)
 | 
			
		|||
		case KEY_LEFTARROW:
 | 
			
		||||
			p->color--;
 | 
			
		||||
			if (p->color < 1)
 | 
			
		||||
				p->color = MAXSKINCOLORS-1;
 | 
			
		||||
				p->color = numskincolors-1;
 | 
			
		||||
			p->rotate = -CSROTATETICS;
 | 
			
		||||
			//p->delay = CSROTATETICS;
 | 
			
		||||
			S_StartSound(NULL, sfx_s3k5b); //sfx_s3kc3s
 | 
			
		||||
| 
						 | 
				
			
			@ -1949,8 +2162,8 @@ void M_CharacterSelectTick(void)
 | 
			
		|||
	{
 | 
			
		||||
		for (i = 0; i < setup_numplayers; i++)
 | 
			
		||||
		{
 | 
			
		||||
			CV_StealthSet(setup_playercvars[i][SPLITCV_SKIN], skins[setup_player[i].skin].name);
 | 
			
		||||
			CV_StealthSetValue(setup_playercvars[i][SPLITCV_COLOR], setup_player[i].color);
 | 
			
		||||
			CV_StealthSet(&cv_skin[i], skins[setup_player[i].skin].name);
 | 
			
		||||
			CV_StealthSetValue(&cv_playercolor[i], setup_player[i].color);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		CV_StealthSetValue(&cv_splitplayers, setup_numplayers);
 | 
			
		||||
| 
						 | 
				
			
			@ -1989,7 +2202,7 @@ boolean M_CanShowLevelInList(INT16 mapnum, UINT8 gt)
 | 
			
		|||
	if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU /*&& mapnum+1 != gamemap*/)
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	if (gt == GT_MATCH && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
 | 
			
		||||
	if (gt == GT_BATTLE && (mapheaderinfo[mapnum]->typeoflevel & TOL_BATTLE))
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
	if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
 | 
			
		||||
| 
						 | 
				
			
			@ -2474,6 +2687,32 @@ void M_PlaybackAdjustView(INT32 choice)
 | 
			
		|||
	G_AdjustView(itemOn - playback_viewcount, (choice > 0) ? 1 : -1, true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// this one's rather tricky
 | 
			
		||||
void M_PlaybackToggleFreecam(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	(void)choice;
 | 
			
		||||
	M_ClearMenus(true);
 | 
			
		||||
 | 
			
		||||
	// remove splitscreen:
 | 
			
		||||
	splitscreen = 0;
 | 
			
		||||
	R_ExecuteSetViewSize();
 | 
			
		||||
 | 
			
		||||
	P_InitCameraCmd();	// init camera controls
 | 
			
		||||
	if (!demo.freecam)	// toggle on
 | 
			
		||||
	{
 | 
			
		||||
		demo.freecam = true;
 | 
			
		||||
		democam.cam = &camera[0];	// this is rather useful
 | 
			
		||||
	}
 | 
			
		||||
	else	// toggle off
 | 
			
		||||
	{
 | 
			
		||||
		demo.freecam = false;
 | 
			
		||||
		// reset democam vars:
 | 
			
		||||
		democam.cam = NULL;
 | 
			
		||||
		democam.turnheld = false;
 | 
			
		||||
		democam.keyboardlook = false;	// reset only these. localangle / aiming gets set before the cam does anything anyway
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void M_PlaybackQuit(INT32 choice)
 | 
			
		||||
{
 | 
			
		||||
	(void)choice;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,6 @@
 | 
			
		|||
#include "m_random.h"
 | 
			
		||||
#include "s_sound.h"
 | 
			
		||||
#include "g_game.h"
 | 
			
		||||
#include "m_menu.h"
 | 
			
		||||
#include "y_inter.h"
 | 
			
		||||
#include "hu_stuff.h"	// HU_AddChatText
 | 
			
		||||
#include "console.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +30,7 @@
 | 
			
		|||
#include "k_color.h"
 | 
			
		||||
#include "k_hud.h"
 | 
			
		||||
#include "d_netcmd.h" // IsPlayerAdmin
 | 
			
		||||
#include "m_menu.h" // Player Setup menu color stuff
 | 
			
		||||
#include "k_menu.h" // Player Setup menu color stuff
 | 
			
		||||
 | 
			
		||||
// SRB2Kart
 | 
			
		||||
#include "p_spec.h" // P_StartQuake
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -116,11 +116,11 @@ void AddMServCommands(void)
 | 
			
		|||
static void WarnGUI (void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
	I_lock_mutex(&m_menu_mutex);
 | 
			
		||||
	I_lock_mutex(&k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
	M_StartMessage(M_GetText("There was a problem connecting to\nthe Master Server\n\nCheck the console for details.\n"), NULL, MM_NOTHING);
 | 
			
		||||
#ifdef HAVE_THREADS
 | 
			
		||||
	I_unlock_mutex(m_menu_mutex);
 | 
			
		||||
	I_unlock_mutex(k_menu_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
#include "st_stuff.h"
 | 
			
		||||
#include "w_wad.h"
 | 
			
		||||
#include "z_zone.h"
 | 
			
		||||
#include "m_menu.h" // character select
 | 
			
		||||
#include "k_menu.h" // character select
 | 
			
		||||
#include "m_misc.h"
 | 
			
		||||
#include "info.h" // spr2names
 | 
			
		||||
#include "i_video.h" // rendermode
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -181,7 +181,7 @@ static char returnWadPath[256];
 | 
			
		|||
 | 
			
		||||
#include "../m_argv.h"
 | 
			
		||||
 | 
			
		||||
#include "../m_menu.h"
 | 
			
		||||
#include "../k_menu.h"
 | 
			
		||||
 | 
			
		||||
#ifdef MAC_ALERT
 | 
			
		||||
#include "macosx/mac_alert.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -373,7 +373,7 @@ static boolean IgnoreMouse(void)
 | 
			
		|||
	if (cv_alwaysgrabmouse.value)
 | 
			
		||||
		return false;
 | 
			
		||||
	if (menuactive)
 | 
			
		||||
		return !M_MouseNeeded();
 | 
			
		||||
		return false; // return !M_MouseNeeded();
 | 
			
		||||
	if (paused || con_destlines || chat_on)
 | 
			
		||||
		return true;
 | 
			
		||||
	if (gamestate != GS_LEVEL && gamestate != GS_INTERMISSION &&
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										139
									
								
								src/v_video.c
									
										
									
									
									
								
							
							
						
						
									
										139
									
								
								src/v_video.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2542,145 +2542,6 @@ INT32 V_LevelNameHeight(const char *string)
 | 
			
		|||
	return w;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Find string width from hu_font chars
 | 
			
		||||
//
 | 
			
		||||
INT32 V_StringWidth(const char *string, INT32 option)
 | 
			
		||||
{
 | 
			
		||||
	INT32 c, w = 0;
 | 
			
		||||
	INT32 spacewidth = 4, charwidth = 0;
 | 
			
		||||
	size_t i;
 | 
			
		||||
 | 
			
		||||
	switch (option & V_SPACINGMASK)
 | 
			
		||||
	{
 | 
			
		||||
		case V_MONOSPACE:
 | 
			
		||||
			spacewidth = 8;
 | 
			
		||||
			/* FALLTHRU */
 | 
			
		||||
		case V_OLDSPACING:
 | 
			
		||||
			charwidth = 8;
 | 
			
		||||
			break;
 | 
			
		||||
		case V_6WIDTHSPACE:
 | 
			
		||||
			spacewidth = 6;
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < strlen(string); i++)
 | 
			
		||||
	{
 | 
			
		||||
		c = string[i];
 | 
			
		||||
		if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		c = toupper(c) - HU_FONTSTART;
 | 
			
		||||
		if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c])
 | 
			
		||||
			w += spacewidth;
 | 
			
		||||
		else
 | 
			
		||||
			w += (charwidth ? charwidth : SHORT(fontv[HU_FONT].font[c]->width));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (option & (V_NOSCALESTART|V_NOSCALEPATCH))
 | 
			
		||||
		w *= vid.dupx;
 | 
			
		||||
 | 
			
		||||
	return w;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Find string width from hu_font chars, 0.5x scale
 | 
			
		||||
//
 | 
			
		||||
INT32 V_SmallStringWidth(const char *string, INT32 option)
 | 
			
		||||
{
 | 
			
		||||
	INT32 c, w = 0;
 | 
			
		||||
	INT32 spacewidth = 2, charwidth = 0;
 | 
			
		||||
	size_t i;
 | 
			
		||||
 | 
			
		||||
	switch (option & V_SPACINGMASK)
 | 
			
		||||
	{
 | 
			
		||||
		case V_MONOSPACE:
 | 
			
		||||
			spacewidth = 4;
 | 
			
		||||
			/* FALLTHRU */
 | 
			
		||||
		case V_OLDSPACING:
 | 
			
		||||
			charwidth = 4;
 | 
			
		||||
			break;
 | 
			
		||||
		case V_6WIDTHSPACE:
 | 
			
		||||
			spacewidth = 3;
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < strlen(string); i++)
 | 
			
		||||
	{
 | 
			
		||||
		c = string[i];
 | 
			
		||||
		if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		c = toupper(c) - HU_FONTSTART;
 | 
			
		||||
		if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c])
 | 
			
		||||
			w += spacewidth;
 | 
			
		||||
		else
 | 
			
		||||
			w += (charwidth ? charwidth : SHORT(fontv[HU_FONT].font[c]->width)/2);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return w;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Find string width from tny_font chars
 | 
			
		||||
//
 | 
			
		||||
INT32 V_ThinStringWidth(const char *string, INT32 option)
 | 
			
		||||
{
 | 
			
		||||
	INT32 c, w = 0;
 | 
			
		||||
	INT32 spacewidth = 2, charwidth = 0;
 | 
			
		||||
	boolean lowercase = (option & V_ALLOWLOWERCASE);
 | 
			
		||||
	size_t i;
 | 
			
		||||
 | 
			
		||||
	switch (option & V_SPACINGMASK)
 | 
			
		||||
	{
 | 
			
		||||
		case V_MONOSPACE:
 | 
			
		||||
			spacewidth = 5;
 | 
			
		||||
			/* FALLTHRU */
 | 
			
		||||
		case V_OLDSPACING:
 | 
			
		||||
			charwidth = 5;
 | 
			
		||||
			break;
 | 
			
		||||
		// Out of video flags, so we're reusing this for alternate charwidth instead
 | 
			
		||||
		/*case V_6WIDTHSPACE:
 | 
			
		||||
			spacewidth = 3;*/
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < strlen(string); i++)
 | 
			
		||||
	{
 | 
			
		||||
		c = string[i];
 | 
			
		||||
		if ((UINT8)c & 0x80) //color parsing! -Inuyasha 2.16.09
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		if (!lowercase || !fontv[TINY_FONT].font[c-HU_FONTSTART])
 | 
			
		||||
			c = toupper(c);
 | 
			
		||||
		c -= HU_FONTSTART;
 | 
			
		||||
 | 
			
		||||
		if (c < 0 || c >= HU_FONTSIZE || !fontv[TINY_FONT].font[c])
 | 
			
		||||
			w += spacewidth;
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			w += (charwidth ? charwidth
 | 
			
		||||
				: ((option & V_6WIDTHSPACE && i < strlen(string)-1) ? max(1, SHORT(fontv[TINY_FONT].font[c]->width)-1) // Reuse this flag for the alternate bunched-up spacing
 | 
			
		||||
				: SHORT(fontv[TINY_FONT].font[c]->width)));
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return w;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Find string width from tny_font chars, 0.5x scale
 | 
			
		||||
//
 | 
			
		||||
INT32 V_SmallThinStringWidth(const char *string, INT32 option)
 | 
			
		||||
{
 | 
			
		||||
	INT32 w = V_ThinStringWidth(string, option)<<FRACBITS;
 | 
			
		||||
	return w/2 + FRACUNIT; // +FRACUNIT because otherwise it's offset wrong.
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
boolean *heatshifter = NULL;
 | 
			
		||||
INT32 lastheight = 0;
 | 
			
		||||
INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -255,7 +255,11 @@ void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string
 | 
			
		|||
 | 
			
		||||
// draw a string using the hu_font, 0.5x scale
 | 
			
		||||
#define V_DrawSmallString( x,y,option,string ) \
 | 
			
		||||
	V__DrawDupxString (x,y,FRACUNIT>>1,option,HU_FONT,string)
 | 
			
		||||
	V__DrawDupxString (x,y,FRACUNIT>>1,option,NULL,HU_FONT,string)
 | 
			
		||||
 | 
			
		||||
#define V_SmallStringWidth( string,option ) \
 | 
			
		||||
	V__IntegerStringWidth ( FRACUNIT>>1,option,HU_FONT,string )
 | 
			
		||||
 | 
			
		||||
void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string);
 | 
			
		||||
void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										148
									
								
								src/y_inter.c
									
										
									
									
									
								
							
							
						
						
									
										148
									
								
								src/y_inter.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -43,7 +43,6 @@
 | 
			
		|||
#include "g_input.h" // PlayerInputDown
 | 
			
		||||
#include "k_battle.h"
 | 
			
		||||
#include "k_pwrlv.h"
 | 
			
		||||
#include "lua_hook.h" // IntermissionThinker hook
 | 
			
		||||
#include "k_grandprix.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HWRENDER
 | 
			
		||||
| 
						 | 
				
			
			@ -86,25 +85,11 @@ static patch_t *bgpatch = NULL;     // INTERSCR
 | 
			
		|||
static patch_t *widebgpatch = NULL;
 | 
			
		||||
static patch_t *bgtile = NULL;      // SPECTILE/SRB2BACK
 | 
			
		||||
static patch_t *interpic = NULL;    // custom picture defined in map header
 | 
			
		||||
static boolean usetile;
 | 
			
		||||
static INT32 timer;
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
	INT32 source_width, source_height;
 | 
			
		||||
	INT32 source_bpp, source_rowbytes;
 | 
			
		||||
	UINT8 *source_picture;
 | 
			
		||||
	INT32 target_width, target_height;
 | 
			
		||||
	INT32 target_bpp, target_rowbytes;
 | 
			
		||||
	UINT8 *target_picture;
 | 
			
		||||
} y_buffer_t;
 | 
			
		||||
 | 
			
		||||
boolean usebuffer = false;
 | 
			
		||||
static boolean useinterpic;
 | 
			
		||||
static INT32 timer;
 | 
			
		||||
static INT32 powertype = PWRLV_DISABLED;
 | 
			
		||||
static boolean safetorender = true;
 | 
			
		||||
static y_buffer_t *y_buffer;
 | 
			
		||||
 | 
			
		||||
static INT32 intertic;
 | 
			
		||||
static INT32 endtic = -1;
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +99,6 @@ intertype_t intertype = int_none;
 | 
			
		|||
intertype_t intermissiontypes[NUMGAMETYPES];
 | 
			
		||||
 | 
			
		||||
static void Y_FollowIntermission(void);
 | 
			
		||||
static void Y_RescaleScreenBuffer(void);
 | 
			
		||||
static void Y_UnloadData(void);
 | 
			
		||||
static void Y_CleanupData(void);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -335,91 +319,6 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Y_ConsiderScreenBuffer
 | 
			
		||||
//
 | 
			
		||||
// Can we copy the current screen to a buffer?
 | 
			
		||||
//
 | 
			
		||||
void Y_ConsiderScreenBuffer(void)
 | 
			
		||||
{
 | 
			
		||||
	if (gameaction != ga_completed)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (y_buffer == NULL)
 | 
			
		||||
		y_buffer = Z_Calloc(sizeof(y_buffer_t), PU_STATIC, NULL);
 | 
			
		||||
	else
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	y_buffer->source_width = vid.width;
 | 
			
		||||
	y_buffer->source_height = vid.height;
 | 
			
		||||
	y_buffer->source_bpp = vid.bpp;
 | 
			
		||||
	y_buffer->source_rowbytes = vid.rowbytes;
 | 
			
		||||
	y_buffer->source_picture = ZZ_Alloc(y_buffer->source_width*vid.bpp * y_buffer->source_height);
 | 
			
		||||
	VID_BlitLinearScreen(screens[1], y_buffer->source_picture, vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
 | 
			
		||||
 | 
			
		||||
	// Make the rescaled screen buffer
 | 
			
		||||
	Y_RescaleScreenBuffer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Y_RescaleScreenBuffer
 | 
			
		||||
//
 | 
			
		||||
// Write the rescaled source picture, to the destination picture that has the current screen's resolutions.
 | 
			
		||||
//
 | 
			
		||||
static void Y_RescaleScreenBuffer(void)
 | 
			
		||||
{
 | 
			
		||||
	INT32 sx, sy; // source
 | 
			
		||||
	INT32 dx, dy; // dest
 | 
			
		||||
	fixed_t scalefac, yscalefac;
 | 
			
		||||
	fixed_t rowfrac, colfrac;
 | 
			
		||||
	UINT8 *dest;
 | 
			
		||||
 | 
			
		||||
	// Who knows?
 | 
			
		||||
	if (y_buffer == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (y_buffer->target_picture)
 | 
			
		||||
		Z_Free(y_buffer->target_picture);
 | 
			
		||||
 | 
			
		||||
	y_buffer->target_width = vid.width;
 | 
			
		||||
	y_buffer->target_height = vid.height;
 | 
			
		||||
	y_buffer->target_rowbytes = vid.rowbytes;
 | 
			
		||||
	y_buffer->target_bpp = vid.bpp;
 | 
			
		||||
	y_buffer->target_picture = ZZ_Alloc(y_buffer->target_width*vid.bpp * y_buffer->target_height);
 | 
			
		||||
	dest = y_buffer->target_picture;
 | 
			
		||||
 | 
			
		||||
	scalefac = FixedDiv(y_buffer->target_width*FRACUNIT, y_buffer->source_width*FRACUNIT);
 | 
			
		||||
	yscalefac = FixedDiv(y_buffer->target_height*FRACUNIT, y_buffer->source_height*FRACUNIT);
 | 
			
		||||
 | 
			
		||||
	rowfrac = FixedDiv(FRACUNIT, yscalefac);
 | 
			
		||||
	colfrac = FixedDiv(FRACUNIT, scalefac);
 | 
			
		||||
 | 
			
		||||
	for (sy = 0, dy = 0; sy < (y_buffer->source_height << FRACBITS) && dy < y_buffer->target_height; sy += rowfrac, dy++)
 | 
			
		||||
		for (sx = 0, dx = 0; sx < (y_buffer->source_width << FRACBITS) && dx < y_buffer->target_width; sx += colfrac, dx += y_buffer->target_bpp)
 | 
			
		||||
			dest[(dy * y_buffer->target_rowbytes) + dx] = y_buffer->source_picture[((sy>>FRACBITS) * y_buffer->source_width) + (sx>>FRACBITS)];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Y_CleanupScreenBuffer
 | 
			
		||||
//
 | 
			
		||||
// Free all related memory.
 | 
			
		||||
//
 | 
			
		||||
void Y_CleanupScreenBuffer(void)
 | 
			
		||||
{
 | 
			
		||||
	// Who knows?
 | 
			
		||||
	if (y_buffer == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (y_buffer->target_picture)
 | 
			
		||||
		Z_Free(y_buffer->target_picture);
 | 
			
		||||
 | 
			
		||||
	if (y_buffer->source_picture)
 | 
			
		||||
		Z_Free(y_buffer->source_picture);
 | 
			
		||||
 | 
			
		||||
	Z_Free(y_buffer);
 | 
			
		||||
	y_buffer = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Y_IntermissionDrawer
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			@ -441,52 +340,18 @@ void Y_IntermissionDrawer(void)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	if (!safetorender)
 | 
			
		||||
		V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
 | 
			
		||||
 | 
			
		||||
	if (!safetorender)
 | 
			
		||||
		goto dontdrawbg;
 | 
			
		||||
 | 
			
		||||
	if (useinterpic)
 | 
			
		||||
		V_DrawScaledPatch(0, 0, 0, interpic);
 | 
			
		||||
	else if (!usetile)
 | 
			
		||||
	{
 | 
			
		||||
		if (rendermode == render_soft && usebuffer)
 | 
			
		||||
		{
 | 
			
		||||
			// no y_buffer
 | 
			
		||||
			if (y_buffer == NULL)
 | 
			
		||||
				VID_BlitLinearScreen(screens[1], screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				// Maybe the resolution changed?
 | 
			
		||||
				if ((y_buffer->target_width != vid.width) || (y_buffer->target_height != vid.height))
 | 
			
		||||
					Y_RescaleScreenBuffer();
 | 
			
		||||
 | 
			
		||||
				// Blit the already-scaled screen buffer to the current screen
 | 
			
		||||
				VID_BlitLinearScreen(y_buffer->target_picture, screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#ifdef HWRENDER
 | 
			
		||||
		else if (rendermode != render_soft && usebuffer)
 | 
			
		||||
			HWR_DrawIntermissionBG();
 | 
			
		||||
#endif
 | 
			
		||||
		else if (bgpatch)
 | 
			
		||||
		{
 | 
			
		||||
			fixed_t hs = vid.width  * FRACUNIT / BASEVIDWIDTH;
 | 
			
		||||
			fixed_t vs = vid.height * FRACUNIT / BASEVIDHEIGHT;
 | 
			
		||||
			V_DrawStretchyFixedPatch(0, 0, hs, vs, V_NOSCALEPATCH, bgpatch, NULL);
 | 
			
		||||
		}
 | 
			
		||||
		V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		M_DrawMenuBackground();
 | 
			
		||||
	}
 | 
			
		||||
	else if (bgtile)
 | 
			
		||||
		V_DrawPatchFill(bgtile);
 | 
			
		||||
 | 
			
		||||
dontdrawbg:
 | 
			
		||||
	LUAh_IntermissionHUD();
 | 
			
		||||
	if (!LUA_HudEnabled(hud_intermissiontally))
 | 
			
		||||
		goto skiptallydrawer;
 | 
			
		||||
 | 
			
		||||
	if (usebuffer) // Fade everything out
 | 
			
		||||
		V_DrawFadeScreen(0xFF00, 22);
 | 
			
		||||
 | 
			
		||||
	if (!r_splitscreen)
 | 
			
		||||
		whiteplayer = demo.playback ? displayplayers[0] : consoleplayer;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1145,8 +1010,6 @@ void Y_StartIntermission(void)
 | 
			
		|||
 | 
			
		||||
	bgpatch = W_CachePatchName("MENUBG", PU_STATIC);
 | 
			
		||||
	widebgpatch = W_CachePatchName("WEIRDRES", PU_STATIC);
 | 
			
		||||
 | 
			
		||||
	useinterpic = usetile = usebuffer = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ======
 | 
			
		||||
| 
						 | 
				
			
			@ -1161,7 +1024,6 @@ void Y_EndIntermission(void)
 | 
			
		|||
	endtic = -1;
 | 
			
		||||
	sorttic = -1;
 | 
			
		||||
	intertype = int_none;
 | 
			
		||||
	usebuffer = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,9 +15,6 @@ void Y_Ticker(void);
 | 
			
		|||
void Y_StartIntermission(void);
 | 
			
		||||
void Y_EndIntermission(void);
 | 
			
		||||
 | 
			
		||||
void Y_ConsiderScreenBuffer(void);
 | 
			
		||||
void Y_CleanupScreenBuffer(void);
 | 
			
		||||
 | 
			
		||||
void Y_DetermineIntermissionType(void);
 | 
			
		||||
 | 
			
		||||
void Y_VoteDrawer(void);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue