Merge branch 'master' into text-prompts

This commit is contained in:
mazmazz 2018-11-13 11:12:44 -05:00
commit 6c69dd1f78
35 changed files with 504 additions and 142 deletions

View file

@ -15,7 +15,9 @@
#define DEALIGNED
#endif
#ifndef _BIG_ENDIAN
#include "endian.h"
#ifndef SRB2_BIG_ENDIAN
//
// Little-endian machines
//
@ -75,7 +77,7 @@
#define READANGLE(p) *((angle_t *)p)++
#endif
#else //_BIG_ENDIAN
#else //SRB2_BIG_ENDIAN
//
// definitions for big-endian machines with alignment constraints.
//
@ -144,7 +146,7 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
#endif //_BIG_ENDIAN
#endif //SRB2_BIG_ENDIAN
#undef DEALIGNED

View file

@ -63,6 +63,7 @@ CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
#define COM_BUF_SIZE 8192 // command buffer size
#define MAX_ALIAS_RECURSION 100 // max recursion allowed for aliases
static INT32 com_wait; // one command per frame (for cmd sequences)
@ -485,6 +486,7 @@ static void COM_ExecuteString(char *ptext)
{
xcommand_t *cmd;
cmdalias_t *a;
static INT32 recursion = 0; // detects recursion and stops it if it goes too far
COM_TokenizeString(ptext);
@ -497,6 +499,7 @@ static void COM_ExecuteString(char *ptext)
{
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
{
recursion = 0;
cmd->function();
return;
}
@ -507,11 +510,20 @@ static void COM_ExecuteString(char *ptext)
{
if (!stricmp(com_argv[0], a->name))
{
if (recursion > MAX_ALIAS_RECURSION)
{
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
recursion = 0;
return;
}
recursion++;
COM_BufInsertText(a->value);
return;
}
}
recursion = 0;
// check cvars
// Hurdler: added at Ebola's request ;)
// (don't flood the console in software mode with bad gr_xxx command)

View file

@ -71,6 +71,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "fastcmp.h"
#include "keys.h"
#include "filesrch.h" // refreshdirmenu, mainwadstally
#include "g_input.h" // tutorial mode control scheming
#ifdef CMAKECONFIG
#include "config.h"
@ -151,7 +152,7 @@ void D_PostEvent(const event_t *ev)
eventhead = (eventhead+1) & (MAXEVENTS-1);
}
// just for lock this function
#ifndef DOXYGEN
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void) {};
#endif
@ -734,6 +735,19 @@ void D_StartTitle(void)
// Reset the palette
if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");
// The title screen is obviously not a tutorial! (Unless I'm mistaken)
if (tutorialmode && tutorialgcs)
{
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gcl_tutorial_full, num_gcl_tutorial_full); // using gcs_custom as temp storage
CV_SetValue(&cv_usemouse, tutorialusemouse);
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
CV_SetValue(&cv_mousemove, tutorialmousemove);
CV_SetValue(&cv_analog, tutorialanalog);
M_StartMessage("Do you want to \x82save the recommended \x82movement controls?\x80\n\nPress 'Y' or 'Enter' to confirm\nPress 'N' or any key to keep \nyour current controls",
M_TutorialSaveControlResponse, MM_YESNO);
}
tutorialmode = false;
}
//
@ -767,10 +781,6 @@ static inline void D_CleanFile(void)
}
}
#ifndef _MAX_PATH
#define _MAX_PATH MAX_WADPATH
#endif
// ==========================================================================
// Identify the SRB2 version, and IWAD file to use.
// ==========================================================================

View file

@ -40,8 +40,8 @@ void D_SRB2Main(void);
// Called by IO functions when input is detected.
void D_PostEvent(const event_t *ev);
#ifndef DOXYGEN
FUNCMATH void D_PostEvent_end(void); // delimiter for locking memory
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void); // delimiter for locking memory
#endif
void D_ProcessEvents(void);

View file

@ -712,6 +712,7 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_alwaysfreelook);
CV_RegisterVar(&cv_alwaysfreelook2);
CV_RegisterVar(&cv_tutorialprompt);
// g_input.c
CV_RegisterVar(&cv_sideaxis);
@ -1808,6 +1809,16 @@ static void Command_Map_f(void)
else
fromlevelselect = ((netgame || multiplayer) && ((gametype == newgametype) && (newgametype == GT_COOP)));
if (tutorialmode && tutorialgcs)
{
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gcl_tutorial_full, num_gcl_tutorial_full); // using gcs_custom as temp storage
CV_SetValue(&cv_usemouse, tutorialusemouse);
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
CV_SetValue(&cv_mousemove, tutorialmousemove);
CV_SetValue(&cv_analog, tutorialanalog);
}
tutorialmode = false; // warping takes us out of tutorial mode
D_MapChange(newmapnum, newgametype, false, newresetplayers, 0, false, fromlevelselect);
}

View file

@ -3256,6 +3256,19 @@ static void readmaincfg(MYFILE *f)
startchar = (INT16)value;
char_on = -1;
}
else if (fastcmp(word, "TUTORIALMAP"))
{
// Support using the actual map name,
// i.e., Level AB, Level FZ, etc.
// Convert to map number
if (word2[0] >= 'A' && word2[0] <= 'Z')
value = M_MapNumber(word2[0], word2[1]);
else
value = get_number(word2);
tutorialmap = (INT16)value;
}
else
deh_warning("Maincfg: unknown word '%s'", word);
}
@ -7336,6 +7349,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_PULL",
"MT_GHOST",
"MT_OVERLAY",
"MT_ANGLEMAN",
"MT_POLYANCHOR",
"MT_POLYSPAWN",
"MT_POLYSPAWNCRUSH",
@ -8681,7 +8695,7 @@ fixed_t get_number(const char *word)
#endif
}
void FUNCMATH DEH_Check(void)
void DEH_Check(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);

View file

@ -571,4 +571,11 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
#define SECTORSPECIALSAFTERTHINK
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
/// on the bright side it fixes some weird issues with translucent walls
/// \note SRB2CB port.
/// SRB2CB itself ported this from PrBoom+
#define NEWCLIP
#endif // __DOOMDEF__

View file

@ -132,6 +132,10 @@ extern INT16 bootmap; //bootmap for loading a map on startup
extern INT16 tutorialmap; // map to load for tutorial
extern boolean tutorialmode; // are we in a tutorial right now?
extern INT32 tutorialgcs; // which control scheme is loaded?
extern INT32 tutorialusemouse; // store cv_usemouse user value
extern INT32 tutorialfreelook; // store cv_alwaysfreelook user value
extern INT32 tutorialmousemove; // store cv_mousemove user value
extern INT32 tutorialanalog; // store cv_analog user value
extern boolean looptitle;

View file

@ -40,12 +40,13 @@
typedef long ssize_t;
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(PDWORD_PTR)))
#define PDWORD_PTR PDWORD
#if (_MSC_VER <= 1200)
#ifndef DWORD_PTR
#define DWORD_PTR DWORD
#endif
#ifndef PDWORD_PTR
#define PDWORD_PTR PDWORD
#endif
#endif
#elif defined (__DJGPP__)
#define UINT8 unsigned char
@ -80,11 +81,13 @@ typedef long ssize_t;
#define NOIPX
#endif
/* Strings and some misc platform specific stuff */
#ifdef _MSC_VER
// Microsoft VisualC++
#if (_MSC_VER <= 1800) // MSVC 2013 and back
#define snprintf _snprintf
#if (_MSC_VER <= 1200) // MSVC 2012 and back
#if (_MSC_VER <= 1200) // MSVC 6.0 and back
#define vsnprintf _vsnprintf
#endif
#endif
@ -148,6 +151,8 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
// not the number of bytes in the buffer.
#define STRBUFCPY(dst,src) strlcpy(dst, src, sizeof dst)
/* Boolean type definition */
// \note __BYTEBOOL__ used to be set above if "macintosh" was defined,
// if macintosh's version of boolean type isn't needed anymore, then isn't this macro pointless now?
#ifndef __BYTEBOOL__
@ -155,7 +160,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
//faB: clean that up !!
#if defined( _MSC_VER) && (_MSC_VER >= 1800) // MSVC 2013 and forward
#include "stdbool.h"
#include "stdbool.h"
#elif defined (_WIN32)
#define false FALSE // use windows types
#define true TRUE
@ -205,89 +210,65 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
#endif
union FColorRGBA
{
UINT32 rgba;
struct
{
UINT8 red;
UINT8 green;
UINT8 blue;
UINT8 alpha;
} s;
} ATTRPACK;
typedef union FColorRGBA RGBA_t;
typedef enum
{
postimg_none,
postimg_water,
postimg_motion,
postimg_flip,
postimg_heat
} postimg_t;
typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num)
#define LUMPERROR UINT32_MAX
typedef UINT32 tic_t;
#define INFTICS UINT32_MAX
#ifdef _BIG_ENDIAN
#define UINT2RGBA(a) a
#else
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
#endif
/* Compiler-specific attributes and other macros */
#ifdef __GNUC__ // __attribute__ ((X))
#define FUNCNORETURN __attribute__ ((noreturn))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__)
#include "inttypes.h"
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCPRINTF __attribute__ ((format(gnu_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(gnu_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(gnu_printf, 1, 2),noreturn))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#define FUNCPRINTF __attribute__ ((format(ms_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(ms_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(ms_printf, 1, 2),noreturn))
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#ifndef FUNCIERROR
#define FUNCIERROR __attribute__ ((noreturn))
#endif
#define FUNCMATH __attribute__((const))
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define FUNCDEAD __attribute__ ((deprecated))
#define FUNCINLINE __attribute__((always_inline))
#define FUNCNONNULL __attribute__((nonnull))
#endif
#define FUNCNOINLINE __attribute__((noinline))
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#ifdef __i386__ // i386 only
#define FUNCTARGET(X) __attribute__ ((__target__ (X)))
#endif
#endif
#if defined (__MINGW32__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#define ATTRPACK __attribute__((packed, gcc_struct))
#else
#define ATTRPACK __attribute__((packed))
#endif
#define ATTRUNUSED __attribute__((unused))
#define FUNCNORETURN __attribute__ ((noreturn))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__) // MinGW, >= GCC 4.1
#include "inttypes.h"
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCPRINTF __attribute__ ((format(gnu_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(gnu_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(gnu_printf, 1, 2),noreturn))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#define FUNCPRINTF __attribute__ ((format(ms_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(ms_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(ms_printf, 1, 2),noreturn))
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#ifndef FUNCIERROR
#define FUNCIERROR __attribute__ ((noreturn))
#endif
#define FUNCMATH __attribute__((const))
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) // >= GCC 3.1
#define FUNCDEAD __attribute__ ((deprecated))
#define FUNCINLINE __attribute__((always_inline))
#define FUNCNONNULL __attribute__((nonnull))
#endif
#define FUNCNOINLINE __attribute__((noinline))
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#ifdef __i386__ // i386 only
#define FUNCTARGET(X) __attribute__ ((__target__ (X)))
#endif
#endif
#if defined (__MINGW32__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) // MinGW, >= GCC 3.4
#define ATTRPACK __attribute__((packed, gcc_struct))
#else
#define ATTRPACK __attribute__((packed))
#endif
#define ATTRUNUSED __attribute__((unused))
#elif defined (_MSC_VER)
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200
#define ATTRNOINLINE __declspec(noinline)
#endif
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200 // >= MSVC 6.0
#define ATTRNOINLINE __declspec(noinline)
#endif
#endif
#ifndef FUNCPRINTF
@ -335,4 +316,43 @@ typedef UINT32 tic_t;
#ifndef ATTRNOINLINE
#define ATTRNOINLINE
#endif
/* Miscellaneous types that don't fit anywhere else (Can this be changed?) */
union FColorRGBA
{
UINT32 rgba;
struct
{
UINT8 red;
UINT8 green;
UINT8 blue;
UINT8 alpha;
} s;
} ATTRPACK;
typedef union FColorRGBA RGBA_t;
typedef enum
{
postimg_none,
postimg_water,
postimg_motion,
postimg_flip,
postimg_heat
} postimg_t;
typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num)
#define LUMPERROR UINT32_MAX
typedef UINT32 tic_t;
#define INFTICS UINT32_MAX
#include "endian.h" // This is needed to make sure the below macro acts correctly in big endian builds
#ifdef SRB2_BIG_ENDIAN
#define UINT2RGBA(a) a
#else
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
#endif
#endif //__DOOMTYPE__

View file

@ -1429,6 +1429,7 @@ void F_StartGameEnd(void)
//
void F_GameEndDrawer(void)
{
// this function does nothing
}
//

View file

@ -37,7 +37,7 @@ void F_TitleDemoTicker(void);
void F_TextPromptTicker(void);
// Called by main loop.
FUNCMATH void F_GameEndDrawer(void);
void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);

View file

@ -130,6 +130,10 @@ INT16 bootmap; //bootmap for loading a map on startup
INT16 tutorialmap = 0; // map to load for tutorial
boolean tutorialmode = false; // are we in a tutorial right now?
INT32 tutorialgcs = gcs_custom; // which control scheme is loaded?
INT32 tutorialusemouse = 0; // store cv_usemouse user value
INT32 tutorialfreelook = 0; // store cv_alwaysfreelook user value
INT32 tutorialmousemove = 0; // store cv_mousemove user value
INT32 tutorialanalog = 0; // store cv_analog user value
boolean looptitle = false;

View file

@ -55,6 +55,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
extern INT16 rw_maximums[NUM_WEAPONS];
// used in game menu
extern consvar_t cv_tutorialprompt;
extern consvar_t cv_crosshair, cv_crosshair2;
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2;

View file

@ -338,7 +338,7 @@ angle_t gld_FrustumAngle(void)
}
// If the pitch is larger than this you can look all around at a FOV of 90
if (aimingangle > (ANGLE_45+ANG1) && (ANGLE_315-ANG1) > aimingangle)
if (abs((signed)aimingangle) > 46 * ANG1)
return 0xffffffff;
// ok, this is a gross hack that barely works...

View file

@ -86,7 +86,7 @@ void HU_Init(void);
void HU_LoadGraphics(void);
// reset heads up when consoleplayer respawns.
FUNCMATH void HU_Start(void);
void HU_Start(void);
boolean HU_Responder(event_t *ev);

View file

@ -17814,6 +17814,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_ANGLEMAN
758, // doomednum
S_INVISIBLE, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8, // radius
8, // height
0, // display offset
10, // mass
0, // damage
sfx_None, // activesound
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
{ // MT_POLYANCHOR
760, // doomednum
S_INVISIBLE, // spawnstate

View file

@ -4305,6 +4305,7 @@ typedef enum mobj_type
MT_PULL,
MT_GHOST,
MT_OVERLAY,
MT_ANGLEMAN,
MT_POLYANCHOR,
MT_POLYSPAWN,
MT_POLYSPAWNCRUSH,

View file

@ -273,6 +273,7 @@ menu_t SP_MainDef, OP_MainDef;
menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef;
// Single Player
static void M_StartTutorial(INT32 choice);
static void M_LoadGame(INT32 choice);
static void M_TimeAttackLevelSelect(INT32 choice);
static void M_TimeAttack(INT32 choice);
@ -440,6 +441,9 @@ static CV_PossibleValue_t serversort_cons_t[] = {
};
consvar_t cv_serversort = {"serversort", "Ping", CV_HIDEN | CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL};
// first time memory
consvar_t cv_tutorialprompt = {"tutorialprompt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// autorecord demos for time attack
static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -731,6 +735,7 @@ static menuitem_t SR_EmblemHintMenu[] =
// Single Player Main
static menuitem_t SP_MainMenu[] =
{
{IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 84},
{IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 92},
{IT_SECRET, NULL, "Record Attack", M_TimeAttack, 100},
{IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 108},
@ -739,6 +744,7 @@ static menuitem_t SP_MainMenu[] =
enum
{
sptutorial,
sploadgame,
sprecordattack,
spnightsmode,
@ -1554,7 +1560,18 @@ menu_t SR_EmblemHintDef =
};
// Single Player
menu_t SP_MainDef = CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72);
menu_t SP_MainDef = //CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72);
{
NULL,
sizeof(SP_MainMenu)/sizeof(menuitem_t),
&MainDef,
SP_MainMenu,
M_DrawCenteredMenu,
BASEVIDWIDTH/2, 72,
1, // start at "Start Game" on first entry
NULL
};
menu_t SP_LoadDef =
{
"M_PICKG",
@ -6093,6 +6110,8 @@ static void M_CustomLevelSelect(INT32 choice)
static void M_SinglePlayerMenu(INT32 choice)
{
(void)choice;
SP_MainMenu[sptutorial].status =
tutorialmap ? IT_CALL|IT_STRING : IT_NOTHING|IT_DISABLED;
SP_MainMenu[sprecordattack].status =
(M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING : IT_SECRET;
SP_MainMenu[spnightsmode].status =
@ -6118,6 +6137,80 @@ static void M_LoadGameLevelSelect(INT32 choice)
M_SetupNextMenu(&SP_LevelSelectDef);
}
void M_TutorialSaveControlResponse(INT32 ch)
{
if (ch == 'y' || ch == KEY_ENTER)
{
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gcl_tutorial_full, num_gcl_tutorial_full);
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
CV_Set(&cv_analog, cv_analog.defaultvalue);
S_StartSound(NULL, sfx_itemup);
}
else
S_StartSound(NULL, sfx_menu1);
}
static void M_TutorialControlResponse(INT32 ch)
{
if (ch != KEY_ESCAPE)
{
G_CopyControls(gamecontroldefault[gcs_custom], gamecontrol, NULL, 0); // using gcs_custom as temp storage for old controls
if (ch == 'y' || ch == KEY_ENTER)
{
tutorialgcs = gcs_fps;
tutorialusemouse = cv_usemouse.value;
tutorialfreelook = cv_alwaysfreelook.value;
tutorialmousemove = cv_mousemove.value;
tutorialanalog = cv_analog.value;
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gcl_tutorial_full, num_gcl_tutorial_full);
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
CV_Set(&cv_analog, cv_analog.defaultvalue);
//S_StartSound(NULL, sfx_itemup);
}
else
{
tutorialgcs = gcs_custom;
S_StartSound(NULL, sfx_menu1);
}
M_StartTutorial(INT32_MAX);
}
else
S_StartSound(NULL, sfx_menu1);
MessageDef.prevMenu = &SP_MainDef; // if FirstPrompt -> ControlsPrompt -> ESC, we would go to the main menu unless we force this
}
// Starts up the tutorial immediately (tbh I wasn't sure where else to put this)
static void M_StartTutorial(INT32 choice)
{
if (!tutorialmap)
return; // no map to go to, don't bother
if (choice != INT32_MAX && G_GetControlScheme(gamecontrol, gcl_tutorial_check, num_gcl_tutorial_check) != gcs_fps)
{
M_StartMessage("Do you want to try the \202recommended \202movement controls\x80?\n\nWe will set them just for this tutorial.\n\nPress 'Y' or 'Enter' to confirm\nPress 'N' or any key to keep \nyour current controls.\n",M_TutorialControlResponse,MM_YESNO);
return;
}
else if (choice != INT32_MAX)
tutorialgcs = gcs_custom;
CV_SetValue(&cv_tutorialprompt, 0); // first-time prompt
tutorialmode = true; // turn on tutorial mode
emeralds = 0;
M_ClearMenus(true);
gamecomplete = false;
cursaveslot = 0;
G_DeferedInitNew(false, G_BuildMapName(tutorialmap), 0, false, false);
}
// ==============
// LOAD GAME MENU
// ==============
@ -6725,6 +6818,26 @@ static void M_HandleLoadSave(INT32 choice)
}
}
static void M_FirstTimeResponse(INT32 ch)
{
S_StartSound(NULL, sfx_menu1);
if (ch == KEY_ESCAPE)
return;
if (ch != 'y' && ch != KEY_ENTER)
{
CV_SetValue(&cv_tutorialprompt, 0);
M_ReadSaveStrings();
MessageDef.prevMenu = &SP_LoadDef; // calls M_SetupNextMenu
}
else
{
M_StartTutorial(0);
MessageDef.prevMenu = &MessageDef; // otherwise, the controls prompt won't fire
}
}
//
// Selected from SRB2 menu
//
@ -6732,6 +6845,13 @@ static void M_LoadGame(INT32 choice)
{
(void)choice;
if (tutorialmap && cv_tutorialprompt.value)
{
M_StartMessage("Do you want to \x82play a brief Tutorial\x80?\n\nWe highly recommend this because \nthe controls are slightly different \nfrom other games.\n\nPress 'Y' or 'Enter' to go\nPress 'N' or any key to skip\n",
M_FirstTimeResponse, MM_YESNO);
return;
}
M_ReadSaveStrings();
M_SetupNextMenu(&SP_LoadDef);
}
@ -9198,9 +9318,17 @@ static void M_DrawControl(void)
// draw title (or big pic)
M_DrawMenuTitle();
M_CentreText(30,
(setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" :
"PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR"));
if (tutorialmode && tutorialgcs)
{
if ((gametic / TICRATE) % 2)
M_CentreText(30, "\202EXIT THE TUTORIAL TO CHANGE THE CONTROLS");
else
M_CentreText(30, "EXIT THE TUTORIAL TO CHANGE THE CONTROLS");
}
else
M_CentreText(30,
(setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" :
"PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR"));
if (i)
V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), V_YELLOWMAP, "\x1A"); // up arrow
@ -9335,6 +9463,9 @@ static void M_ChangeControl(INT32 choice)
{
static char tmp[55];
if (tutorialmode && tutorialgcs) // don't allow control changes if temp control override is active
return;
controltochange = currentMenu->menuitems[choice].alphaKey;
sprintf(tmp, M_GetText("Hit the new key for\n%s\nESC for Cancel"),
currentMenu->menuitems[choice].text);

View file

@ -240,6 +240,8 @@ extern INT16 char_on, startchar;
#define BwehHehHe() S_StartSound(NULL, sfx_bewar1+M_RandomKey(4)) // Bweh heh he
void M_TutorialSaveControlResponse(INT32 ch);
void M_ForceSaveSlotSelected(INT32 sslot);
void M_CheatActivationResponder(INT32 ch);

View file

@ -539,7 +539,21 @@ void M_SaveConfig(const char *filename)
// FIXME: save key aliases if ever implemented..
CV_SaveVariables(f);
if (tutorialmode && tutorialgcs)
{
CV_SetValue(&cv_usemouse, tutorialusemouse);
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
CV_SetValue(&cv_mousemove, tutorialmousemove);
CV_SetValue(&cv_analog, tutorialanalog);
CV_SaveVariables(f);
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
CV_Set(&cv_analog, cv_analog.defaultvalue);
}
else
CV_SaveVariables(f);
if (!dedicated)
{
if (tutorialmode && tutorialgcs)

View file

@ -3324,6 +3324,11 @@ void A_MonitorPop(mobj_t *actor)
newmobj->sprite = SPR_TV1P;
}
}
// Run a linedef executor immediately upon popping
// You may want to delay your effects by 18 tics to sync with the reward giving
if (actor->spawnpoint && actor->lastlook)
P_LinedefExecute(actor->lastlook, actor->target, NULL);
}
// Function: A_GoldMonitorPop
@ -3407,6 +3412,11 @@ void A_GoldMonitorPop(mobj_t *actor)
newmobj->sprite = SPR_TV1P;
}
}
// Run a linedef executor immediately upon popping
// You may want to delay your effects by 18 tics to sync with the reward giving
if (actor->spawnpoint && actor->lastlook)
P_LinedefExecute(actor->lastlook, actor->target, NULL);
}
// Function: A_GoldMonitorRestore

View file

@ -7436,6 +7436,48 @@ void P_MobjThinker(mobj_t *mobj)
if ((mobj->flags & MF_ENEMY) && (mobj->state->nextstate == mobj->info->spawnstate && mobj->tics == 1))
mobj->flags2 &= ~MF2_FRET;
// Angle-to-tracer to trigger a linedef exec
// See Linedef Exec 457 (Track mobj angle to point)
if ((mobj->eflags & MFE_TRACERANGLE) && mobj->tracer && mobj->extravalue2)
{
// mobj->lastlook - Don't disable behavior after first failure
// mobj->extravalue1 - Angle tolerance
// mobj->extravalue2 - Exec tag upon failure
// mobj->cvval - Allowable failure delay
// mobj->cvmem - Failure timer
angle_t ang = mobj->angle - R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y);
// \todo account for distance between mobj and tracer
// Because closer mobjs can be facing beyond the angle tolerance
// yet tracer is still in the camera view
// failure state: mobj is not facing tracer
// Reasaonable defaults: ANGLE_67h, ANGLE_292h
if (ang >= (UINT32)mobj->extravalue1 && ang <= ANGLE_MAX - (UINT32)mobj->extravalue1)
{
if (mobj->cvmem)
mobj->cvmem--;
else
{
INT32 exectag = mobj->extravalue2; // remember this before we erase the values
if (mobj->lastlook)
mobj->cvmem = mobj->cusval; // reset timer for next failure
else
{
// disable after first failure
mobj->eflags &= ~MFE_TRACERANGLE;
mobj->lastlook = mobj->extravalue1 = mobj->extravalue2 = mobj->cvmem = mobj->cusval = 0;
}
P_LinedefExecute(exectag, mobj, NULL);
}
}
else
mobj->cvmem = mobj->cusval; // reset failure timer
}
switch (mobj->type)
{
case MT_WALLSPIKEBASE:
@ -10895,6 +10937,16 @@ ML_EFFECT4 : Don't clip inside the ground
mobj->flags2 |= MF2_OBJECTFLIP;
}
// Extra functionality
if (mthing->options & MTF_EXTRA)
{
if (mobj->flags & MF_MONITOR && (mthing->angle & 16384))
{
// Store line exec tag to run upon popping
mobj->lastlook = (mthing->angle & 16383);
}
}
// Final set of not being able to draw nightsitems.
if (mobj->flags & MF_NIGHTSITEM)
mobj->flags2 |= MF2_DONTDRAW;

View file

@ -239,6 +239,9 @@ typedef enum
MFE_SPRUNG = 1<<8,
// Platform movement
MFE_APPLYPMOMZ = 1<<9,
// Compute and trigger on mobj angle relative to tracer
// See Linedef Exec 457 (Track mobj angle to point)
MFE_TRACERANGLE = 1<<10,
// free: to and including 1<<15
} mobjeflag_t;
@ -453,7 +456,7 @@ boolean P_SupermanLook4Players(mobj_t *actor);
void P_DestroyRobots(void);
void P_SnowThinker(precipmobj_t *mobj);
void P_RainThinker(precipmobj_t *mobj);
FUNCMATH void P_NullPrecipThinker(precipmobj_t *mobj);
void P_NullPrecipThinker(precipmobj_t *mobj);
void P_RemovePrecipMobj(precipmobj_t *mobj);
void P_SetScale(mobj_t *mobj, fixed_t newscale);
void P_XYMovement(mobj_t *mo);

View file

@ -3758,6 +3758,41 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
P_ResetColormapFader(&sectors[secnum]);
break;
case 457: // Track mobj angle to point
if (mo)
{
INT32 failureangle = min(max(abs(sides[line->sidenum[0]].textureoffset>>FRACBITS), 0), 360) * ANG1;
INT32 failuredelay = abs(sides[line->sidenum[0]].rowoffset>>FRACBITS);
INT32 failureexectag = line->sidenum[1] != 0xffff ?
(INT32)(sides[line->sidenum[1]].textureoffset>>FRACBITS) : 0;
boolean persist = (line->flags & ML_EFFECT2);
mobj_t *anchormo;
if ((secnum = P_FindSectorFromLineTag(line, -1)) < 0)
return;
anchormo = P_GetObjectTypeInSectorNum(MT_ANGLEMAN, secnum);
if (!anchormo)
return;
mo->eflags |= MFE_TRACERANGLE;
P_SetTarget(&mo->tracer, anchormo);
mo->lastlook = persist; // don't disable behavior after first failure
mo->extravalue1 = failureangle; // angle to exceed for failure state
mo->extravalue2 = failureexectag; // exec tag for failure state (angle is not within range)
mo->cusval = mo->cvmem = failuredelay; // cusval = tics to allow failure before line trigger; cvmem = decrement timer
}
break;
case 458: // Stop tracking mobj angle to point
if (mo && (mo->eflags & MFE_TRACERANGLE))
{
mo->eflags &= ~MFE_TRACERANGLE;
P_SetTarget(&mo->tracer, NULL);
mo->lastlook = mo->cvmem = mo->cusval = mo->extravalue1 = mo->extravalue2 = 0;
}
break;
case 459: // Control Text Prompt
// console player only unless NOCLIMB is set
if (mo && mo->player && P_IsLocalPlayer(mo->player) && (!bot || bot != mo))

View file

@ -8785,7 +8785,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
if (!(player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD))
if (!(player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || tutorialmode))
{
if (player->spectator) // force cam off for spectators
return true;
@ -8848,7 +8848,16 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (P_CameraThinker(player, thiscam, resetcalled))
return true;
if (thiscam == &camera)
if (tutorialmode)
{
// force defaults because we have a camera look section
camspeed = (INT32)(atof(cv_cam_speed.defaultvalue) * FRACUNIT);
camstill = (!stricmp(cv_cam_still.defaultvalue, "off")) ? false : true;
camrotate = atoi(cv_cam_rotate.defaultvalue);
camdist = FixedMul((INT32)(atof(cv_cam_dist.defaultvalue) * FRACUNIT), mo->scale);
camheight = FixedMul((INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT), FixedMul(player->camerascale, mo->scale));
}
else if (thiscam == &camera)
{
camspeed = cv_cam_speed.value;
camstill = cv_cam_still.value;

View file

@ -913,7 +913,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
chasecam = (cv_chasecam.value != 0);
}
if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN)
if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode)
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off

View file

@ -87,7 +87,7 @@ extern lighttable_t **planezlight;
extern fixed_t *yslope;
extern fixed_t distscale[MAXVIDWIDTH];
FUNCMATH void R_InitPlanes(void);
void R_InitPlanes(void);
void R_PortalStoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_PortalRestoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_ClearPlanes(void);

View file

@ -63,11 +63,7 @@ typedef struct floorsplat_s
fixed_t P_SegLength(seg_t *seg);
// call at P_SetupLevel()
#if !(defined (WALLSPLATS) || defined (FLOORSPLATS))
FUNCMATH void R_ClearLevelSplats(void);
#else
void R_ClearLevelSplats(void);
#endif
#ifdef WALLSPLATS
void R_AddWallSplat(line_t *wallline, INT16 sectorside, const char *patchname, fixed_t top,

View file

@ -69,11 +69,7 @@ consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, N
consvar_t cv_scr_depth = {"scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef DIRECTFULLSCREEN
static FUNCMATH void SCR_ChangeFullscreen (void);
#else
static void SCR_ChangeFullscreen (void);
#endif
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};

View file

@ -12,19 +12,19 @@ consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NUL
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
FUNCMATH void I_InitCD(void){}
void I_InitCD(void){}
FUNCMATH void I_StopCD(void){}
void I_StopCD(void){}
FUNCMATH void I_PauseCD(void){}
void I_PauseCD(void){}
FUNCMATH void I_ResumeCD(void){}
void I_ResumeCD(void){}
FUNCMATH void I_ShutdownCD(void){}
void I_ShutdownCD(void){}
FUNCMATH void I_UpdateCD(void){}
void I_UpdateCD(void){}
FUNCMATH void I_PlayCD(UINT8 track, UINT8 looping)
void I_PlayCD(UINT8 track, UINT8 looping)
{
(void)track;
(void)looping;

View file

@ -1929,14 +1929,14 @@ void I_StartupMouse2(void)
//
// I_Tactile
//
FUNCMATH void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
@ -1947,7 +1947,7 @@ FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
*/
static ticcmd_t emptycmd;
FUNCMATH ticcmd_t *I_BaseTiccmd(void)
ticcmd_t *I_BaseTiccmd(void)
{
return &emptycmd;
}
@ -1956,7 +1956,7 @@ FUNCMATH ticcmd_t *I_BaseTiccmd(void)
*/
static ticcmd_t emptycmd2;
FUNCMATH ticcmd_t *I_BaseTiccmd2(void)
ticcmd_t *I_BaseTiccmd2(void)
{
return &emptycmd2;
}
@ -2050,7 +2050,7 @@ tic_t I_GetTime (void)
//
//I_StartupTimer
//
FUNCMATH void I_StartupTimer(void)
void I_StartupTimer(void)
{
#ifdef _WIN32
// for win2k time bug
@ -2149,11 +2149,11 @@ void I_WaitVBL(INT32 count)
SDL_Delay(count);
}
FUNCMATH void I_BeginRead(void)
void I_BeginRead(void)
{
}
FUNCMATH void I_EndRead(void)
void I_EndRead(void)
{
}
@ -2916,5 +2916,5 @@ const CPUInfoFlags *I_CPUInfo(void)
}
// note CPUAFFINITY code used to reside here
FUNCMATH void I_RegisterSysCommands(void) {}
void I_RegisterSysCommands(void) {}
#endif

View file

@ -1059,7 +1059,7 @@ void I_SetPalette(RGBA_t *palette)
}
// return number of fullscreen + X11 modes
FUNCMATH INT32 VID_NumModes(void)
INT32 VID_NumModes(void)
{
if (USE_FULLSCREEN && numVidModes != -1)
return numVidModes - firstEntry;
@ -1067,7 +1067,7 @@ FUNCMATH INT32 VID_NumModes(void)
return MAXWINMODES;
}
FUNCMATH const char *VID_GetModeName(INT32 modeNum)
const char *VID_GetModeName(INT32 modeNum)
{
#if 0
if (USE_FULLSCREEN && numVidModes != -1) // fullscreen modes
@ -1097,7 +1097,7 @@ FUNCMATH const char *VID_GetModeName(INT32 modeNum)
return &vidModeName[modeNum][0];
}
FUNCMATH INT32 VID_GetModeForSize(INT32 w, INT32 h)
INT32 VID_GetModeForSize(INT32 w, INT32 h)
{
int i;
for (i = 0; i < MAXWINMODES; i++)

View file

@ -143,7 +143,7 @@ void I_ShutdownSound(void)
#endif
}
FUNCMATH void I_UpdateSound(void)
void I_UpdateSound(void)
{
}
@ -512,7 +512,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
/// Music System
/// ------------------------
FUNCMATH void I_InitMusic(void)
void I_InitMusic(void)
{
}

View file

@ -219,7 +219,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio
#endif
}
FUNCMATH static inline Uint16 Snd_LowerRate(Uint16 sr)
static inline Uint16 Snd_LowerRate(Uint16 sr)
{
if (sr <= audio.freq) // already lowered rate?
return sr; // good then

View file

@ -24,7 +24,7 @@
//
// Called by main loop.
FUNCMATH void ST_Ticker(void);
void ST_Ticker(void);
// Called by main loop.
void ST_Drawer(void);