Merge branch 'master' into update-version

This commit is contained in:
TehRealSalt 2018-10-17 20:31:56 -04:00
commit 36595b06af
89 changed files with 2137 additions and 1612 deletions

View File

@ -66,6 +66,7 @@
# Compile without 3D sound support, add 'NOHS=1' # Compile without 3D sound support, add 'NOHS=1'
# Compile with GDBstubs, add 'RDB=1' # Compile with GDBstubs, add 'RDB=1'
# Compile without PNG, add 'NOPNG=1' # Compile without PNG, add 'NOPNG=1'
# Compile without zlib, add 'NOZLIB=1'
# #
# Addon for SDL: # Addon for SDL:
# To Cross-Compile, add 'SDL_CONFIG=/usr/*/bin/sdl-config' # To Cross-Compile, add 'SDL_CONFIG=/usr/*/bin/sdl-config'
@ -119,6 +120,7 @@ include Makefile.cfg
ifdef DUMMY ifdef DUMMY
NOPNG=1 NOPNG=1
NOZLIB=1
NONET=1 NONET=1
NOHW=1 NOHW=1
NOHS=1 NOHS=1
@ -199,6 +201,7 @@ endif
ifdef NDS ifdef NDS
NOPNG=1 NOPNG=1
NOZLIB=1
NONET=1 NONET=1
#NOHW=1 #NOHW=1
NOHS=1 NOHS=1
@ -325,13 +328,6 @@ LIBS+=$(PNG_LDFLAGS)
CFLAGS+=$(PNG_CFLAGS) CFLAGS+=$(PNG_CFLAGS)
endif endif
ZLIB_PKGCONFIG?=zlib
ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags)
ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs)
LIBS+=$(ZLIB_LDFLAGS)
CFLAGS+=$(ZLIB_CFLAGS)
ifdef HAVE_LIBGME ifdef HAVE_LIBGME
OPTS+=-DHAVE_LIBGME OPTS+=-DHAVE_LIBGME
@ -343,6 +339,18 @@ LIBS+=$(LIBGME_LDFLAGS)
CFLAGS+=$(LIBGME_CFLAGS) CFLAGS+=$(LIBGME_CFLAGS)
endif endif
ifndef NOZLIB
OPTS+=-DHAVE_ZLIB
ZLIB_PKGCONFIG?=zlib
ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags)
ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs)
LIBS+=$(ZLIB_LDFLAGS)
CFLAGS+=$(ZLIB_CFLAGS)
else
NOPNG=1
endif
ifdef STATIC ifdef STATIC
LIBS:=-static $(LIBS) LIBS:=-static $(LIBS)
endif endif

View File

@ -21,13 +21,14 @@ void I_ShutdownSound(void){}
// SFX I/O // SFX I/O
// //
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel)
{ {
(void)id; (void)id;
(void)vol; (void)vol;
(void)sep; (void)sep;
(void)pitch; (void)pitch;
(void)priority; (void)priority;
(void)channel;
return -1; return -1;
} }

View File

@ -16,7 +16,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}

View File

@ -154,9 +154,9 @@ static CV_PossibleValue_t menuhighlight_cons_t[] =
{V_GOLDMAP, "Always gold"}, {V_GOLDMAP, "Always gold"},
{V_LAVENDERMAP, "Always lavender"}, {V_LAVENDERMAP, "Always lavender"},
{V_TEAMAP, "Always tea-green"}, {V_TEAMAP, "Always tea-green"},
{V_STEELMAP, "Always steel"}, {V_STEELMAP, "Always steel-blue"},
{V_PINKMAP, "Always pink"}, {V_PINKMAP, "Always pink"},
{V_TEALMAP, "Always teal"}, {V_BROWNMAP, "Always brown"},
{V_PEACHMAP, "Always peach"}, {V_PEACHMAP, "Always peach"},
{0, NULL} {0, NULL}
}; };
@ -291,7 +291,7 @@ static void CONS_backcolor_Change(void)
// TODO: This could probably be improved somehow... // TODO: This could probably be improved somehow...
// These colormaps are 99% identical, with just a few changed bytes // These colormaps are 99% identical, with just a few changed bytes
UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
static void CON_SetupColormaps(void) static void CON_SetupColormaps(void)
{ {
@ -311,8 +311,8 @@ static void CON_SetupColormaps(void)
teamap = (goldmap+256); teamap = (goldmap+256);
steelmap = (teamap+256); steelmap = (teamap+256);
pinkmap = (steelmap+256); pinkmap = (steelmap+256);
tealmap = (pinkmap+256); brownmap = (pinkmap+256);
peachmap = (tealmap+256); peachmap = (brownmap+256);
// setup the other colormaps, for console text // setup the other colormaps, for console text
@ -335,8 +335,8 @@ static void CON_SetupColormaps(void)
goldmap[120] = (UINT8)114; goldmap[120] = (UINT8)114;
teamap[120] = (UINT8)177; teamap[120] = (UINT8)177;
steelmap[120] = (UINT8)201; steelmap[120] = (UINT8)201;
pinkmap[120] = (UINT8)124; pinkmap[120] = (UINT8)145;
tealmap[120] = (UINT8)220; brownmap[120] = (UINT8)48;
peachmap[120] = (UINT8)69; // nice peachmap[120] = (UINT8)69; // nice
// Init back colormap // Init back colormap

View File

@ -39,7 +39,7 @@ extern UINT32 con_scalefactor; // console text scale factor
extern consvar_t cons_backcolor, cons_menuhighlight; extern consvar_t cons_backcolor, cons_menuhighlight;
extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
// Console bg color (auto updated to match) // Console bg color (auto updated to match)
extern UINT8 *consolebgmap; extern UINT8 *consolebgmap;

View File

@ -1631,8 +1631,6 @@ static void CL_LoadReceivedSavegame(void)
automapactive = false; automapactive = false;
// load a base level // load a base level
playerdeadview = false;
if (P_LoadNetGame()) if (P_LoadNetGame())
{ {
CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap)); CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap));
@ -2491,9 +2489,9 @@ static void CL_RemovePlayer(INT32 playernum)
LUA_InvalidatePlayer(&players[playernum]); LUA_InvalidatePlayer(&players[playernum]);
#endif #endif
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P /*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors(); P_CheckSurvivors();
else if (G_BattleGametype()) // SRB2Kart else*/ if (G_BattleGametype()) // SRB2Kart
K_CheckBumpers(); K_CheckBumpers();
else if (G_RaceGametype()) else if (G_RaceGametype())
P_CheckRacers(); P_CheckRacers();
@ -2920,7 +2918,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
} }
consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
#ifdef VANILLAJOINNEXTROUND
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
#endif
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}};
@ -2966,7 +2966,9 @@ void D_ClientServerInit(void)
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer); RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
#ifndef NONET #ifndef NONET
CV_RegisterVar(&cv_allownewplayer); CV_RegisterVar(&cv_allownewplayer);
#ifdef VANILLAJOINNEXTROUND
CV_RegisterVar(&cv_joinnextround); CV_RegisterVar(&cv_joinnextround);
#endif
CV_RegisterVar(&cv_showjoinaddress); CV_RegisterVar(&cv_showjoinaddress);
CV_RegisterVar(&cv_resynchattempts); CV_RegisterVar(&cv_resynchattempts);
CV_RegisterVar(&cv_blamecfail); CV_RegisterVar(&cv_blamecfail);
@ -3519,8 +3521,10 @@ static void HandleConnect(SINT8 node)
// you get a free second before desynch checks. use it wisely. // you get a free second before desynch checks. use it wisely.
SV_InitResynchVars(node); SV_InitResynchVars(node);
#ifdef VANILLAJOINNEXTROUND
if (cv_joinnextround.value && gameaction == ga_nothing) if (cv_joinnextround.value && gameaction == ga_nothing)
G_SetGamestate(GS_WAITINGPLAYERS); G_SetGamestate(GS_WAITINGPLAYERS);
#endif
if (!SV_SendServerConfig(node)) if (!SV_SendServerConfig(node))
{ {
G_SetGamestate(backupstate); G_SetGamestate(backupstate);

View File

@ -497,7 +497,11 @@ extern UINT32 realpingtable[MAXPLAYERS];
extern UINT32 playerpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS];
#endif #endif
extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; extern consvar_t
#ifdef VANILLAJOINNEXTROUND
cv_joinnextround,
#endif
cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
// Used in d_net, the only dependence // Used in d_net, the only dependence
tic_t ExpandTics(INT32 low); tic_t ExpandTics(INT32 low);

View File

@ -723,20 +723,6 @@ void D_SRB2Loop(void)
} }
else if (rendertimeout < entertic) // in case the server hang or netsplit else if (rendertimeout < entertic) // in case the server hang or netsplit
{ {
// Lagless camera! Yay!
/* Not yay, it ruins Kart's drift :y
if (gamestate == GS_LEVEL && netgame)
{
if (camera.chase)
P_MoveChaseCamera(&players[displayplayer], &camera, false);
if (splitscreen && camera2.chase)
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
if (splitscreen > 1 && camera3.chase)
P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false);
if (splitscreen > 2 && camera4.chase)
P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false);
}
*/
D_Display(); D_Display();
if (moviemode) if (moviemode)
@ -824,7 +810,6 @@ void D_StartTitle(void)
maptol = 0; maptol = 0;
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
displayplayer = consoleplayer = 0; displayplayer = consoleplayer = 0;
//demosequence = -1; //demosequence = -1;
gametype = GT_RACE; // SRB2kart gametype = GT_RACE; // SRB2kart
@ -1484,6 +1469,29 @@ void D_SRB2Main(void)
} }
} }
if (M_CheckParm("-skill") && M_IsNextParm())
{
INT32 j;
INT16 newskill = -1;
const char *sskill = M_GetNextParm();
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill))
{
newskill = (INT16)kartspeed_cons_t[j].value;
break;
}
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
{
j = atoi(sskill); // assume they gave us a skill number, which is okay too
if (j >= 0 && j <= 2)
newskill = (INT16)j;
}
if (newskill != -1)
CV_SetValue(&cv_kartspeed, newskill);
}
if (server && !M_CheckParm("+map")) if (server && !M_CheckParm("+map"))
{ {
// Prevent warping to nonexistent levels // Prevent warping to nonexistent levels

View File

@ -34,7 +34,7 @@ void D_SRB2Loop(void) FUNCNORETURN;
// D_SRB2Main() // D_SRB2Main()
// Not a globally visible function, just included for source reference, // Not a globally visible function, just included for source reference,
// calls all startup code, parses command line options. // calls all startup code, parses command line options.
// If not overrided by user input, calls N_AdvanceDemo. // If not overrided by user input, calls D_AdvanceDemo.
// //
void D_SRB2Main(void); void D_SRB2Main(void);
@ -51,9 +51,6 @@ const char *D_Home(void);
// //
// BASE LEVEL // BASE LEVEL
// //
void D_PageTicker(void);
// pagename is lumpname of a 320x200 patch to fill the screen
void D_PageDrawer(const char *pagename);
void D_AdvanceDemo(void); void D_AdvanceDemo(void);
void D_StartTitle(void); void D_StartTitle(void);

View File

@ -49,7 +49,9 @@ doomcom_t *doomcom = NULL;
/// \brief network packet data, points inside doomcom /// \brief network packet data, points inside doomcom
doomdata_t *netbuffer = NULL; doomdata_t *netbuffer = NULL;
#ifdef DEBUGFILE
FILE *debugfile = NULL; // put some net info in a file during the game FILE *debugfile = NULL; // put some net info in a file during the game
#endif
#define MAXREBOUND 8 #define MAXREBOUND 8
static doomdata_t reboundstore[MAXREBOUND]; static doomdata_t reboundstore[MAXREBOUND];

View File

@ -796,10 +796,10 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_consolechat); CV_RegisterVar(&cv_consolechat);
CV_RegisterVar(&cv_chatnotifications); CV_RegisterVar(&cv_chatnotifications);
CV_RegisterVar(&cv_chatbacktint); CV_RegisterVar(&cv_chatbacktint);
CV_RegisterVar(&cv_crosshair); //CV_RegisterVar(&cv_crosshair);
CV_RegisterVar(&cv_crosshair2); //CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_crosshair3); //CV_RegisterVar(&cv_crosshair3);
CV_RegisterVar(&cv_crosshair4); //CV_RegisterVar(&cv_crosshair4);
//CV_RegisterVar(&cv_alwaysfreelook); //CV_RegisterVar(&cv_alwaysfreelook);
//CV_RegisterVar(&cv_alwaysfreelook2); //CV_RegisterVar(&cv_alwaysfreelook2);
@ -915,19 +915,19 @@ void D_RegisterClientCommands(void)
COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("noclip", Command_CheatNoClip_f);
COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("god", Command_CheatGod_f);
COM_AddCommand("notarget", Command_CheatNoTarget_f); COM_AddCommand("notarget", Command_CheatNoTarget_f);
COM_AddCommand("getallemeralds", Command_Getallemeralds_f); /*COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setlives", Command_Setlives_f); COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f); COM_AddCommand("setcontinues", Command_Setcontinues_f);*/
COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("devmode", Command_Devmode_f);
COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f);
COM_AddCommand("scale", Command_Scale_f); COM_AddCommand("scale", Command_Scale_f);
COM_AddCommand("gravflip", Command_Gravflip_f); COM_AddCommand("gravflip", Command_Gravflip_f);
COM_AddCommand("hurtme", Command_Hurtme_f); COM_AddCommand("hurtme", Command_Hurtme_f);
COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); /*COM_AddCommand("jumptoaxis", Command_JumpToAxis_f);
COM_AddCommand("charability", Command_Charability_f); COM_AddCommand("charability", Command_Charability_f);
COM_AddCommand("charspeed", Command_Charspeed_f); COM_AddCommand("charspeed", Command_Charspeed_f);*/
COM_AddCommand("teleport", Command_Teleport_f); COM_AddCommand("teleport", Command_Teleport_f);
COM_AddCommand("rteleport", Command_RTeleport_f); COM_AddCommand("rteleport", Command_RTeleport_f);
COM_AddCommand("skynum", Command_Skynum_f); COM_AddCommand("skynum", Command_Skynum_f);
@ -3260,9 +3260,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
} }
// In tag, check to see if you still have a game. // In tag, check to see if you still have a game.
if (G_TagGametype()) /*if (G_TagGametype())
P_CheckSurvivors(); P_CheckSurvivors();
else if (G_BattleGametype()) else*/ if (G_BattleGametype())
K_CheckBumpers(); // SRB2Kart K_CheckBumpers(); // SRB2Kart
else if (G_RaceGametype()) else if (G_RaceGametype())
P_CheckRacers(); // also SRB2Kart P_CheckRacers(); // also SRB2Kart
@ -3341,6 +3341,12 @@ static void Command_Login_f(void)
XBOXSTATIC UINT8 finalmd5[16]; XBOXSTATIC UINT8 finalmd5[16];
const char *pw; const char *pw;
if (!netgame)
{
CONS_Printf(M_GetText("This only works in a netgame.\n"));
return;
}
// If the server uses login, it will effectively just remove admin privileges // If the server uses login, it will effectively just remove admin privileges
// from whoever has them. This is good. // from whoever has them. This is good.
if (COM_Argc() != 2) if (COM_Argc() != 2)
@ -3455,6 +3461,12 @@ static void Command_Verify_f(void)
return; return;
} }
if (!netgame)
{
CONS_Printf(M_GetText("This only works in a netgame.\n"));
return;
}
if (COM_Argc() != 2) if (COM_Argc() != 2)
{ {
CONS_Printf(M_GetText("giveadmin <node>: give admin privileges to a node\n")); CONS_Printf(M_GetText("giveadmin <node>: give admin privileges to a node\n"));
@ -3809,7 +3821,7 @@ static void Command_Addfile(void)
WRITEMEM(buf_p, md5sum, 16); WRITEMEM(buf_p, md5sum, 16);
} }
if (IsPlayerAdmin(consoleplayer)) // Request to add file if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf); SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
else else
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf); SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);

View File

@ -284,6 +284,7 @@ typedef enum
k_voices, // Used to stop the player saying more voices than it should k_voices, // Used to stop the player saying more voices than it should
k_tauntvoices, // Used to specifically stop taunt voice spam k_tauntvoices, // Used to specifically stop taunt voice spam
k_instashield, // Instashield no-damage animation timer k_instashield, // Instashield no-damage animation timer
k_enginesnd, // Engine sound number you're on.
k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel
k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still

View File

@ -1308,6 +1308,13 @@ static void readlevelheader(MYFILE *f, INT32 num)
else else
mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE; mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE;
} }
else if (fastcmp(word, "SECTIONRACE"))
{
if (i || word2[0] == 'T' || word2[0] == 'Y')
mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE;
else
mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE;
}
// Individual triggers for menu flags // Individual triggers for menu flags
else if (fastcmp(word, "HIDDEN")) else if (fastcmp(word, "HIDDEN"))
@ -2421,6 +2428,8 @@ static void readunlockable(MYFILE *f, INT32 num)
unlockables[num].type = SECRET_SOUNDTEST; unlockables[num].type = SECRET_SOUNDTEST;
else if (fastcmp(word2, "ENCORE")) else if (fastcmp(word2, "ENCORE"))
unlockables[num].type = SECRET_ENCORE; unlockables[num].type = SECRET_ENCORE;
else if (fastcmp(word2, "HELLATTACK"))
unlockables[num].type = SECRET_HELLATTACK;
else else
unlockables[num].type = (INT16)i; unlockables[num].type = (INT16)i;
} }
@ -6701,9 +6710,58 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_PLAYERBOMB", // Player bomb overlay "S_PLAYERBOMB", // Player bomb overlay
"S_PLAYERITEM", // Player item overlay "S_PLAYERITEM", // Player item overlay
"S_PLAYERFAKE", // Player fake overlay
"S_KARMAWHEEL", // Karma player wheels "S_KARMAWHEEL", // Karma player wheels
// Thunder shield use stuff;
"S_KSPARK1", // Sparkling Radius
"S_KSPARK2",
"S_KSPARK3",
"S_KSPARK4",
"S_KSPARK5",
"S_KSPARK6",
"S_KSPARK7",
"S_KSPARK8",
"S_KSPARK9",
"S_KSPARK10",
"S_KSPARK11",
"S_KSPARK12",
"S_KSPARK13", // ... that's an awful lot.
"S_LZIO11", // Straight lightning bolt
"S_LZIO12",
"S_LZIO13",
"S_LZIO14",
"S_LZIO15",
"S_LZIO16",
"S_LZIO17",
"S_LZIO18",
"S_LZIO19",
"S_LZIO21", // Straight lightning bolt (flipped)
"S_LZIO22",
"S_LZIO23",
"S_LZIO24",
"S_LZIO25",
"S_LZIO26",
"S_LZIO27",
"S_LZIO28",
"S_LZIO29",
"S_KLIT1", // Diagonal lightning. No, it not being straight doesn't make it gay.
"S_KLIT2",
"S_KLIT3",
"S_KLIT4",
"S_KLIT5",
"S_KLIT6",
"S_KLIT7",
"S_KLIT8",
"S_KLIT9",
"S_KLIT10",
"S_KLIT11",
"S_KLIT12",
#ifdef SEENAMES #ifdef SEENAMES
"S_NAMECHECK", "S_NAMECHECK",
#endif #endif
@ -7565,9 +7623,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SALMON", // 10 // SKINCOLOR_SALMON "SALMON", // 10 // SKINCOLOR_SALMON
"PINK", // 11 // SKINCOLOR_PINK "PINK", // 11 // SKINCOLOR_PINK
"ROSE", // 12 // SKINCOLOR_ROSE "ROSE", // 12 // SKINCOLOR_ROSE
"RASPBERRY", // 13 // SKINCOLOR_RASPBERRY "RUBY", // 13 // SKINCOLOR_RUBY
"RED", // 14 // SKINCOLOR_RED "RASPBERRY", // 14 // SKINCOLOR_RASPBERRY
"RUBY", // 15 // SKINCOLOR_RUBY "RED", // 15 // SKINCOLOR_RED
"CRIMSON", // 16 // SKINCOLOR_CRIMSON "CRIMSON", // 16 // SKINCOLOR_CRIMSON
"KETCHUP", // 17 // SKINCOLOR_KETCHUP "KETCHUP", // 17 // SKINCOLOR_KETCHUP
"DAWN", // 18 // SKINCOLOR_DAWN "DAWN", // 18 // SKINCOLOR_DAWN
@ -7587,16 +7645,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"VOMIT", // 32 // SKINCOLOR_VOMIT "VOMIT", // 32 // SKINCOLOR_VOMIT
"GARDEN", // 33 // SKINCOLOR_GARDEN "GARDEN", // 33 // SKINCOLOR_GARDEN
"LIME", // 34 // SKINCOLOR_LIME "LIME", // 34 // SKINCOLOR_LIME
"DREAM", // 35 // SKINCOLOR_DREAM "TEA", // 35 // SKINCOLOR_TEA
"TEA", // 36 // SKINCOLOR_TEA "PISTACHIO", // 36 // SKINCOLOR_PISTACHIO
"PISTACHIO", // 37 // SKINCOLOR_PISTACHIO "ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD
"ROBOHOOD", // 38 // SKINCOLOR_ROBOHOOD "MOSS", // 38 // SKINCOLOR_MOSS
"MOSS", // 39 // SKINCOLOR_MOSS "MINT", // 39 // SKINCOLOR_MINT
"MINT", // 40 // SKINCOLOR_MINT "GREEN", // 40 // SKINCOLOR_GREEN
"GREEN", // 41 // SKINCOLOR_GREEN "PINETREE", // 41 // SKINCOLOR_PINETREE
"PINETREE", // 42 // SKINCOLOR_PINETREE "EMERALD", // 42 // SKINCOLOR_EMERALD
"EMERALD", // 43 // SKINCOLOR_EMERALD "SWAMP", // 43 // SKINCOLOR_SWAMP
"SWAMP", // 44 // SKINCOLOR_SWAMP "DREAM", // 44 // SKINCOLOR_DREAM
"AQUA", // 45 // SKINCOLOR_AQUA "AQUA", // 45 // SKINCOLOR_AQUA
"TEAL", // 46 // SKINCOLOR_TEAL "TEAL", // 46 // SKINCOLOR_TEAL
"CYAN", // 47 // SKINCOLOR_CYAN "CYAN", // 47 // SKINCOLOR_CYAN
@ -7606,9 +7664,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SLATE", // 51 // SKINCOLOR_SLATE "SLATE", // 51 // SKINCOLOR_SLATE
"STEEL", // 52 // SKINCOLOR_STEEL "STEEL", // 52 // SKINCOLOR_STEEL
"JET", // 53 // SKINCOLOR_JET "JET", // 53 // SKINCOLOR_JET
"PERIWINKLE", // 54 // SKINCOLOR_PERIWINKLE "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE
"BLUE", // 55 // SKINCOLOR_BLUE "PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE
"SAPPHIRE", // 56 // SKINCOLOR_SAPPHIRE "BLUE", // 56 // SKINCOLOR_BLUE
"BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY
"DUSK", // 58 // SKINCOLOR_DUSK "DUSK", // 58 // SKINCOLOR_DUSK
"PURPLE", // 59 // SKINCOLOR_PURPLE "PURPLE", // 59 // SKINCOLOR_PURPLE
@ -7689,6 +7747,7 @@ static const char *const KARTSTUFF_LIST[] = {
"VOICES", "VOICES",
"TAUNTVOICES", "TAUNTVOICES",
"INSTASHIELD", "INSTASHIELD",
"ENGINESND",
"FLOORBOOST", "FLOORBOOST",
"SPINOUTTYPE", "SPINOUTTYPE",
@ -7895,6 +7954,7 @@ struct {
{"LF_NOSSMUSIC",LF_NOSSMUSIC}, {"LF_NOSSMUSIC",LF_NOSSMUSIC},
{"LF_NORELOAD",LF_NORELOAD}, {"LF_NORELOAD",LF_NORELOAD},
{"LF_NOZONE",LF_NOZONE}, {"LF_NOZONE",LF_NOZONE},
{"LF_SECTIONRACE",LF_SECTIONRACE},
// And map flags // And map flags
{"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINMENU",LF2_HIDEINMENU},
{"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS},
@ -8216,7 +8276,7 @@ struct {
{"V_TEAMAP",V_TEAMAP}, {"V_TEAMAP",V_TEAMAP},
{"V_STEELMAP",V_STEELMAP}, {"V_STEELMAP",V_STEELMAP},
{"V_PINKMAP",V_PINKMAP}, {"V_PINKMAP",V_PINKMAP},
{"V_TEALMAP",V_TEALMAP}, {"V_BROWNMAP",V_BROWNMAP},
{"V_PEACHMAP",V_PEACHMAP}, {"V_PEACHMAP",V_PEACHMAP},
{"V_TRANSLUCENT",V_TRANSLUCENT}, {"V_TRANSLUCENT",V_TRANSLUCENT},
{"V_10TRANS",V_10TRANS}, {"V_10TRANS",V_10TRANS},

View File

@ -165,9 +165,11 @@ INT32 I_StartSound ( sfxenum_t id,
INT32 vol, INT32 vol,
INT32 sep, INT32 sep,
INT32 pitch, INT32 pitch,
INT32 priority ) INT32 priority,
INT32 channel)
{ {
int voice; int voice;
(void)channel;
if (nosound) if (nosound)
return 0; return 0;

View File

@ -46,7 +46,7 @@ static void VID_Command_ModeInfo_f (void);
static void VID_Command_ModeList_f (void); static void VID_Command_ModeList_f (void);
static void VID_Command_Mode_f (void); static void VID_Command_Mode_f (void);
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#define VBEVERSION 2 // we need vesa2 or higher #define VBEVERSION 2 // we need vesa2 or higher
@ -92,8 +92,8 @@ static vmode_t *pcurrentmode; // the current active videomode.
// table des modes videos. // table des modes videos.
// seul le mode 320x200x256c standard VGA est support sans le VESA. // seul le mode 320x200x256c standard VGA est support<EFBFBD> sans le VESA.
// ce mode est le mode numro 0 dans la liste. // ce mode est le mode num<EFBFBD>ro 0 dans la liste.
typedef struct typedef struct
{ {
int modenum; // vesa vbe2.0 modenum int modenum; // vesa vbe2.0 modenum

View File

@ -245,9 +245,9 @@ typedef enum
SKINCOLOR_SALMON, SKINCOLOR_SALMON,
SKINCOLOR_PINK, SKINCOLOR_PINK,
SKINCOLOR_ROSE, SKINCOLOR_ROSE,
SKINCOLOR_RUBY,
SKINCOLOR_RASPBERRY, SKINCOLOR_RASPBERRY,
SKINCOLOR_RED, SKINCOLOR_RED,
SKINCOLOR_RUBY,
SKINCOLOR_CRIMSON, SKINCOLOR_CRIMSON,
SKINCOLOR_KETCHUP, SKINCOLOR_KETCHUP,
SKINCOLOR_DAWN, SKINCOLOR_DAWN,
@ -267,7 +267,6 @@ typedef enum
SKINCOLOR_VOMIT, SKINCOLOR_VOMIT,
SKINCOLOR_GARDEN, SKINCOLOR_GARDEN,
SKINCOLOR_LIME, SKINCOLOR_LIME,
SKINCOLOR_DREAM,
SKINCOLOR_TEA, SKINCOLOR_TEA,
SKINCOLOR_PISTACHIO, SKINCOLOR_PISTACHIO,
SKINCOLOR_ROBOHOOD, SKINCOLOR_ROBOHOOD,
@ -277,6 +276,7 @@ typedef enum
SKINCOLOR_PINETREE, SKINCOLOR_PINETREE,
SKINCOLOR_EMERALD, SKINCOLOR_EMERALD,
SKINCOLOR_SWAMP, SKINCOLOR_SWAMP,
SKINCOLOR_DREAM,
SKINCOLOR_AQUA, SKINCOLOR_AQUA,
SKINCOLOR_TEAL, SKINCOLOR_TEAL,
SKINCOLOR_CYAN, SKINCOLOR_CYAN,
@ -286,9 +286,9 @@ typedef enum
SKINCOLOR_SLATE, SKINCOLOR_SLATE,
SKINCOLOR_STEEL, SKINCOLOR_STEEL,
SKINCOLOR_JET, SKINCOLOR_JET,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_PERIWINKLE, SKINCOLOR_PERIWINKLE,
SKINCOLOR_BLUE, SKINCOLOR_BLUE,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_BLUEBERRY, SKINCOLOR_BLUEBERRY,
SKINCOLOR_DUSK, SKINCOLOR_DUSK,
SKINCOLOR_PURPLE, SKINCOLOR_PURPLE,
@ -547,6 +547,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2Kart: Camera always has noclip. /// SRB2Kart: Camera always has noclip.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM #define NOCLIPCAM
#endif // __DOOMDEF__ #endif // __DOOMDEF__

View File

@ -272,6 +272,7 @@ typedef struct
#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music #define LF_NOSSMUSIC 4 ///< Disable Super Sonic music
#define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NORELOAD 8 ///< Don't reload level on death
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_NOZONE 16 ///< Don't include "ZONE" on level title
#define LF_SECTIONRACE 32 ///< Section race level
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen
@ -496,19 +497,17 @@ extern mapthing_t *redctfstarts[MAXPLAYERS]; // CTF
#if defined (macintosh) #if defined (macintosh)
#define DEBFILE(msg) I_OutputMsg(msg) #define DEBFILE(msg) I_OutputMsg(msg)
extern FILE *debugfile;
#else #else
#define DEBUGFILE #define DEBUGFILE
#ifdef DEBUGFILE #ifdef DEBUGFILE
#define DEBFILE(msg) { if (debugfile) { fputs(msg, debugfile); fflush(debugfile); } } #define DEBFILE(msg) { if (debugfile) { fputs(msg, debugfile); fflush(debugfile); } }
extern FILE *debugfile;
#else #else
#define DEBFILE(msg) {} #define DEBFILE(msg) {}
extern FILE *debugfile;
#endif #endif
#endif #endif
#ifdef DEBUGFILE #ifdef DEBUGFILE
extern FILE *debugfile;
extern INT32 debugload; extern INT32 debugload;
#endif #endif

View File

@ -23,13 +23,14 @@ void I_UpdateSound(void){};
// SFX I/O // SFX I/O
// //
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
(void)id; (void)id;
(void)vol; (void)vol;
(void)sep; (void)sep;
(void)pitch; (void)pitch;
(void)priority; (void)priority;
(void)channel;
return -1; return -1;
} }

View File

@ -8,7 +8,7 @@ boolean highcolor = false;
boolean allow_fullscreen = false; boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}

View File

@ -276,7 +276,6 @@ void F_StartIntro(void)
G_SetGamestate(GS_INTRO); G_SetGamestate(GS_INTRO);
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
CON_ClearHUD(); CON_ClearHUD();
@ -523,12 +522,15 @@ static const char *credits[] = {
"\"VirtAnderson\"", "\"VirtAnderson\"",
"", "",
"\1Special Thanks", "\1Special Thanks",
"Sonic Team Jr. & SRB2", "Sonic Team Jr. & SRB2 (www.srb2.org)",
"Bandit \"Bobby\" Cochenour", // i <3 my dog "Bandit \"Bobby\" Cochenour", // i <3 my dog
"Bear", // i <3 MY dog too
"\"Chrispy\"",
"\"DirkTheHusky\"",
"\"fickle\"", // and my sharki
"\"Nev3r\"", "\"Nev3r\"",
"\"Ritz\"", "\"Ritz\"",
"\"Spherallic\"", "\"Spherallic\"",
"\"DirkTheHusky\"",
"", "",
"\1Produced By", "\1Produced By",
"Kart Krew", "Kart Krew",
@ -554,7 +556,7 @@ static struct {
{112, 80+200* 7, "CREDIT10"}, {112, 80+200* 7, "CREDIT10"},
{240, 80+200* 8, "CREDIT05"}, {240, 80+200* 8, "CREDIT05"},
{120, 80+200* 9, "CREDIT06"},*/ {120, 80+200* 9, "CREDIT06"},*/
{112, 80+200*10, "TYLER52"}, {112, 80+100+200*10, "TYLER52"},
{0, 0, NULL} {0, 0, NULL}
}; };
@ -576,7 +578,6 @@ void F_StartCredits(void)
} }
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
CON_ClearHUD(); CON_ClearHUD();
@ -738,7 +739,6 @@ void F_StartGameEvaluation(void)
G_SaveGame((UINT32)cursaveslot); G_SaveGame((UINT32)cursaveslot);
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
CON_ClearHUD(); CON_ClearHUD();
@ -849,7 +849,6 @@ void F_StartGameEnd(void)
G_SetGamestate(GS_GAMEEND); G_SetGamestate(GS_GAMEEND);
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
CON_ClearHUD(); CON_ClearHUD();
@ -1106,7 +1105,6 @@ void F_StartContinue(void)
gameaction = ga_nothing; gameaction = ga_nothing;
keypressed = false; keypressed = false;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
CON_ClearHUD(); CON_ClearHUD();
@ -1275,7 +1273,6 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset
G_SetGamestate(GS_CUTSCENE); G_SetGamestate(GS_CUTSCENE);
gameaction = ga_nothing; gameaction = ga_nothing;
playerdeadview = false;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();

View File

@ -340,7 +340,7 @@ void SendWeaponPref2(void);
void SendWeaponPref3(void); void SendWeaponPref3(void);
void SendWeaponPref4(void); void SendWeaponPref4(void);
static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}}; //static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}};
static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"}, static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
#ifdef _WII #ifdef _WII
{1, "LStick.X"}, {2, "LStick.Y"}, {-1, "LStick.X-"}, {-2, "LStick.Y-"}, {1, "LStick.X"}, {2, "LStick.Y"}, {-1, "LStick.X-"}, {-2, "LStick.Y-"},
@ -428,10 +428,10 @@ consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0,
static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {0, NULL}}; static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {0, NULL}};
consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; /*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair4 = {"crosshair4", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair4 = {"crosshair4", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/
consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -1812,25 +1812,41 @@ static INT32 spectatedelay, spectatedelay2, spectatedelay3, spectatedelay4 = 0;
boolean G_Responder(event_t *ev) boolean G_Responder(event_t *ev)
{ {
// allow spy mode changes even during the demo // allow spy mode changes even during the demo
if (gamestate == GS_LEVEL && ev->type == ev_keydown && ev->data1 == KEY_F12) if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& (ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
{ {
if (splitscreen || !netgame) if (splitscreen || !netgame)
displayplayer = consoleplayer; displayplayer = consoleplayer;
else else
{ {
// spy mode UINT8 i = 0; // spy mode
do for (i = 0; i < MAXPLAYERS; i++)
{ {
displayplayer++; displayplayer++;
if (displayplayer == MAXPLAYERS) if (displayplayer == MAXPLAYERS)
displayplayer = 0; displayplayer = 0;
if (displayplayer == consoleplayer)
break; // End loop
if (!playeringame[displayplayer]) if (!playeringame[displayplayer])
continue; continue;
if (players[displayplayer].spectator) if (players[displayplayer].spectator)
continue; continue;
// SRB2Kart: Only go through players who are actually playing
if (players[displayplayer].exiting)
continue;
// I don't know if we want this actually, but I'll humor the suggestion anyway
if (G_BattleGametype())
{
if (players[displayplayer].kartstuff[k_bumper] <= 0)
continue;
}
// SRB2Kart: we have no team-based modes, YET...
/*if (G_GametypeHasTeams()) /*if (G_GametypeHasTeams())
{ {
if (players[consoleplayer].ctfteam if (players[consoleplayer].ctfteam
@ -1855,24 +1871,13 @@ boolean G_Responder(event_t *ev)
continue; continue;
}*/ }*/
// SRB2Kart: Ehhh, who cares, Mario Kart's designed around screen-cheating anyway
/*if (gametype != GT_RACE)
{
if (players[consoleplayer].kartstuff[k_bumper] > 0)
continue;
}*/
break; break;
} while (displayplayer != consoleplayer); }
// change statusbar also if playing back demo // change statusbar also if playing back demo
if (singledemo) if (singledemo)
ST_changeDemoView(); ST_changeDemoView();
// tell who's the view
CONS_Printf(M_GetText("Viewpoint: %s\n"), player_names[displayplayer]);
P_ResetCamera(&players[displayplayer], &camera);
return true; return true;
} }
} }
@ -2280,28 +2285,11 @@ static inline void G_PlayerFinishLevel(INT32 player)
{ {
if (legitimateexit && !demoplayback && !mapreset) // (yes you're allowed to unlock stuff this way when the game is modified) if (legitimateexit && !demoplayback && !mapreset) // (yes you're allowed to unlock stuff this way when the game is modified)
{ {
UINT8 i = 0; matchesplayed++;
if (M_UpdateUnlockablesAndExtraEmblems(true))
if (netgame)
{ {
// check to see if there's anyone else at all S_StartSound(NULL, sfx_ncitem);
for (; i < MAXPLAYERS; i++) G_SaveGameData(true); // only save if unlocked something
{
if (i == consoleplayer)
continue;
if (playeringame[i] && !stplyr->spectator)
break;
}
}
if (i != MAXPLAYERS) // Not FREE PLAY
{
matchesplayed++;
if (M_UpdateUnlockablesAndExtraEmblems(true))
{
S_StartSound(NULL, sfx_ncitem);
G_SaveGameData(true); // only save if unlocked something
}
} }
} }
@ -2519,6 +2507,7 @@ void G_PlayerReborn(INT32 player)
p->kartstuff[k_comebackpoints] = comebackpoints; p->kartstuff[k_comebackpoints] = comebackpoints;
p->kartstuff[k_comebacktimer] = comebacktime; p->kartstuff[k_comebacktimer] = comebacktime;
p->kartstuff[k_wanted] = wanted; p->kartstuff[k_wanted] = wanted;
p->kartstuff[k_eggmanblame] = -1;
// Don't do anything immediately // Don't do anything immediately
p->pflags |= PF_USEDOWN; p->pflags |= PF_USEDOWN;
@ -2554,15 +2543,15 @@ void G_PlayerReborn(INT32 player)
p->maxlink = 0; p->maxlink = 0;
// If NiGHTS, find lowest mare to start with. // If NiGHTS, find lowest mare to start with.
p->mare = P_FindLowestMare(); p->mare = 0; /*P_FindLowestMare();
CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare); CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare);
if (p->mare == 255) if (p->mare == 255)
p->mare = 0; p->mare = 0;*/
// Check to make sure their color didn't change somehow... // Check to make sure their color didn't change somehow...
if (G_GametypeHasTeams()) /*if (G_GametypeHasTeams())
{ {
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam) if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
{ {
@ -2586,7 +2575,7 @@ void G_PlayerReborn(INT32 player)
else if (p == &players[fourthdisplayplayer]) else if (p == &players[fourthdisplayplayer])
CV_SetValue(&cv_playercolor4, skincolor_blueteam); CV_SetValue(&cv_playercolor4, skincolor_blueteam);
} }
} }*/
} }
// //
@ -2967,8 +2956,6 @@ void G_DoReborn(INT32 playernum)
P_LoadThingsOnly(); P_LoadThingsOnly();
P_ClearStarPost(player->starpostnum);
// Do a wipe // Do a wipe
wipegamestate = -1; wipegamestate = -1;
@ -3426,6 +3413,8 @@ static void G_DoCompleted(void)
// nextmap is 0-based, unlike gamemap // nextmap is 0-based, unlike gamemap
if (nextmapoverride != 0) if (nextmapoverride != 0)
nextmap = (INT16)(nextmapoverride-1); nextmap = (INT16)(nextmapoverride-1);
else if (mapheaderinfo[gamemap-1]->nextlevel == 1101) // SRB2Kart: !!! WHENEVER WE GET GRAND PRIX, GO TO AWARDS MAP INSTEAD !!!
nextmap = (INT16)(mapheaderinfo[gamemap] ? gamemap : (spstage_start-1)); // (gamemap-1)+1 == gamemap :V
else else
nextmap = (INT16)(mapheaderinfo[gamemap-1]->nextlevel-1); nextmap = (INT16)(mapheaderinfo[gamemap-1]->nextlevel-1);
@ -3454,9 +3443,6 @@ static void G_DoCompleted(void)
else else
cm = (INT16)(mapheaderinfo[cm]->nextlevel-1); cm = (INT16)(mapheaderinfo[cm]->nextlevel-1);
if (cm == 1100-1) // !!! WHENEVER WE GET GRAND PRIX, GO TO AWARDS MAP INSTEAD !!!
cm = cm+1;
if (cm >= NUMMAPS || cm < 0) // out of range (either 1100-1102 or error) if (cm >= NUMMAPS || cm < 0) // out of range (either 1100-1102 or error)
{ {
cm = nextmap; //Start the loop again so that the error checking below is executed. cm = nextmap; //Start the loop again so that the error checking below is executed.
@ -4341,7 +4327,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
// Don't carry over custom music change to another map. // Don't carry over custom music change to another map.
mapmusflags |= MUSIC_RELOADRESET; mapmusflags |= MUSIC_RELOADRESET;
playerdeadview = false;
automapactive = false; automapactive = false;
imcontinuing = false; imcontinuing = false;

View File

@ -55,7 +55,7 @@ extern INT16 rw_maximums[NUM_WEAPONS];
// used in game menu // used in game menu
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_chatbacktint; extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_chatbacktint;
extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; //extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis; extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis;
extern consvar_t cv_turnaxis2,cv_moveaxis2,cv_brakeaxis2,cv_aimaxis2,cv_lookaxis2,cv_fireaxis2,cv_driftaxis2; extern consvar_t cv_turnaxis2,cv_moveaxis2,cv_brakeaxis2,cv_aimaxis2,cv_lookaxis2,cv_fireaxis2,cv_driftaxis2;

View File

@ -1209,6 +1209,9 @@ static const char *gamecontrolname[num_gamecontrols] =
"console", "console",
"pause", "pause",
"systemmenu", "systemmenu",
"screenshot",
"recordgif",
"viewpoint",
"custom1", "custom1",
"custom2", "custom2",
"custom3", "custom3",
@ -1293,6 +1296,9 @@ void G_Controldefault(void)
// Extra controls // Extra controls
gamecontrol[gc_pause ][0] = KEY_PAUSE; gamecontrol[gc_pause ][0] = KEY_PAUSE;
gamecontrol[gc_console ][0] = KEY_CONSOLE; gamecontrol[gc_console ][0] = KEY_CONSOLE;
gamecontrol[gc_screenshot ][0] = KEY_F8;
gamecontrol[gc_recordgif ][0] = KEY_F9;
gamecontrol[gc_viewpoint ][0] = KEY_F12;
gamecontrol[gc_talkkey ][0] = 't'; gamecontrol[gc_talkkey ][0] = 't';
//gamecontrol[gc_teamkey ][0] = 'y'; //gamecontrol[gc_teamkey ][0] = 'y';
gamecontrol[gc_scores ][0] = KEY_TAB; gamecontrol[gc_scores ][0] = KEY_TAB;
@ -1303,11 +1309,11 @@ void G_Controldefault(void)
gamecontrol[gc_camreset ][0] = KEY_HOME; gamecontrol[gc_camreset ][0] = KEY_HOME;
gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE; gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE;
//gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y
gamecontrol[gc_pause ][1] = KEY_JOY1+6; // Back gamecontrol[gc_pause ][1] = KEY_JOY1+6; // Back
gamecontrol[gc_systemmenu ][0] = KEY_JOY1+7; // Start gamecontrol[gc_systemmenu ][0] = KEY_JOY1+7; // Start
gamecontrol[gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up gamecontrol[gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up
//gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down
gamecontrol[gc_talkkey ][1] = KEY_HAT1+2; // D-Pad Left gamecontrol[gc_talkkey ][1] = KEY_HAT1+2; // D-Pad Left
gamecontrol[gc_scores ][1] = KEY_HAT1+3; // D-Pad Right gamecontrol[gc_scores ][1] = KEY_HAT1+3; // D-Pad Right

View File

@ -115,6 +115,9 @@ typedef enum
gc_console, gc_console,
gc_pause, gc_pause,
gc_systemmenu, gc_systemmenu,
gc_screenshot,
gc_recordgif,
gc_viewpoint,
gc_custom1, // Lua scriptable gc_custom1, // Lua scriptable
gc_custom2, // Lua scriptable gc_custom2, // Lua scriptable
gc_custom3, // Lua scriptable gc_custom3, // Lua scriptable

View File

@ -565,8 +565,6 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
subsector_t *sub; subsector_t *sub;
seg_t *lseg; seg_t *lseg;
sscount++;
sub = &subsectors[num]; sub = &subsectors[num];
count = sub->numlines; count = sub->numlines;
lseg = &segs[sub->firstline]; lseg = &segs[sub->firstline];

View File

@ -857,6 +857,10 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
else if (!(color & V_SNAPTOTOP)) else if (!(color & V_SNAPTOTOP))
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
} }
if (color & V_SPLITSCREEN)
fy += ((float)BASEVIDHEIGHT * dupy)/2;
if (color & V_HORZSCREEN)
fx += ((float)BASEVIDWIDTH * dupx)/2;
} }
if (fx >= vid.width || fy >= vid.height) if (fx >= vid.width || fy >= vid.height)
@ -963,6 +967,10 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
else if (!(options & V_SNAPTOTOP)) else if (!(options & V_SNAPTOTOP))
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
} }
if (options & V_SPLITSCREEN)
fy += ((float)BASEVIDHEIGHT * dupy)/2;
if (options & V_HORZSCREEN)
fx += ((float)BASEVIDWIDTH * dupx)/2;
} }
if (fx >= vid.width || fy >= vid.height) if (fx >= vid.width || fy >= vid.height)

View File

@ -643,13 +643,13 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize;
angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT; angle = FOFsector->floorpic_angle;
} }
else // it's a ceiling else // it's a ceiling
{ {
scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize;
angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT; angle = FOFsector->ceilingpic_angle;
} }
} }
else if (gr_frontsector) else if (gr_frontsector)
@ -658,24 +658,26 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize;
angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT; angle = gr_frontsector->floorpic_angle;
} }
else // it's a ceiling else // it's a ceiling
{ {
scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize;
angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT; angle = gr_frontsector->ceilingpic_angle;
} }
} }
if (angle) // Only needs to be done if there's an altered angle if (angle) // Only needs to be done if there's an altered angle
{ {
angle = InvAngle(angle)>>ANGLETOFINESHIFT;
// This needs to be done so that it scrolls in a different direction after rotation like software // This needs to be done so that it scrolls in a different direction after rotation like software
tempxsow = FLOAT_TO_FIXED(scrollx); /*tempxsow = FLOAT_TO_FIXED(scrollx);
tempytow = FLOAT_TO_FIXED(scrolly); tempytow = FLOAT_TO_FIXED(scrolly);
scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));*/
// This needs to be done so everything aligns after rotation // This needs to be done so everything aligns after rotation
// It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does // It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does
@ -689,7 +691,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
// Hurdler: add scrolling texture on floor/ceiling // Hurdler: add scrolling texture on floor/ceiling
v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx); v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx);
v3d->tow = (float)(flatyref - (pv->y / fflatsize) + scrolly); v3d->tow = (float)(-(pv->y / fflatsize) + flatyref + scrolly);
//v3d->sow = (float)(pv->x / fflatsize); //v3d->sow = (float)(pv->x / fflatsize);
//v3d->tow = (float)(pv->y / fflatsize); //v3d->tow = (float)(pv->y / fflatsize);
@ -700,7 +702,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
tempxsow = FLOAT_TO_FIXED(v3d->sow); tempxsow = FLOAT_TO_FIXED(v3d->sow);
tempytow = FLOAT_TO_FIXED(v3d->tow); tempytow = FLOAT_TO_FIXED(v3d->tow);
v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); v3d->tow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
} }
//v3d->sow = (float)(v3d->sow - flatxref + scrollx); //v3d->sow = (float)(v3d->sow - flatxref + scrollx);
@ -2811,11 +2813,14 @@ static void HWR_AddLine(seg_t * line)
SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
// Closed door. if (viewsector != gr_backsector && viewsector != gr_frontsector)
if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{ {
goto clipsolid; // Closed door.
if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{
goto clipsolid;
}
} }
// Window. // Window.
@ -2828,10 +2833,13 @@ static void HWR_AddLine(seg_t * line)
else else
#endif #endif
{ {
// Closed door. if (viewsector != gr_backsector && viewsector != gr_frontsector)
if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || {
gr_backsector->floorheight >= gr_frontsector->ceilingheight) // Closed door.
goto clipsolid; if (gr_backsector->ceilingheight <= gr_frontsector->floorheight ||
gr_backsector->floorheight >= gr_frontsector->ceilingheight)
goto clipsolid;
}
// Window. // Window.
if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight ||
@ -3268,7 +3276,6 @@ static void HWR_Subsector(size_t num, UINT8 ssplayer)
if (num < numsubsectors) if (num < numsubsectors)
{ {
sscount++;
// subsector // subsector
sub = &subsectors[num]; sub = &subsectors[num];
// sector // sector
@ -5140,7 +5147,7 @@ static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer)
// Handle all things in sector. // Handle all things in sector.
// If a limit exists, handle things a tiny bit different. // If a limit exists, handle things a tiny bit different.
if ((limit_dist = (fixed_t)((maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : cv_drawdist.value) << FRACBITS)) if ((limit_dist = (fixed_t)(/*(maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : */cv_drawdist.value) << FRACBITS))
{ {
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
{ {
@ -5168,8 +5175,10 @@ static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer)
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
if (approx_dist <= limit_dist) if (approx_dist > limit_dist)
HWR_ProjectSprite(thing); continue;
HWR_ProjectSprite(thing);
} }
} }
else else
@ -5214,8 +5223,10 @@ static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer)
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y); approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
if (approx_dist <= limit_dist) if (approx_dist > limit_dist)
HWR_ProjectPrecipitationSprite(precipthing); continue;
HWR_ProjectPrecipitationSprite(precipthing);
} }
} }
else else
@ -5546,6 +5557,16 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
x1 = tr_x + x1 * rightcos; x1 = tr_x + x1 * rightcos;
x2 = tr_x - x2 * rightcos; x2 = tr_x - x2 * rightcos;
// okay, we can't return now... this is a hack, but weather isn't networked, so it should be ok
if (!(thing->precipflags & PCF_THUNK))
{
if (thing->precipflags & PCF_RAIN)
P_RainThinker(thing);
else
P_SnowThinker(thing);
thing->precipflags |= PCF_THUNK;
}
// //
// store information in a vissprite // store information in a vissprite
// //

View File

@ -435,7 +435,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
numwords = COM_Argc() - usedargs; numwords = COM_Argc() - usedargs;
I_Assert(numwords > 0); I_Assert(numwords > 0);
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // TODO: Per Player mute. if (CHAT_MUTE) // TODO: Per Player mute.
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"));
return; return;
@ -465,6 +465,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
{ {
// what we're gonna do now is check if the node exists // what we're gonna do now is check if the node exists
// with that logic, characters 4 and 5 are our numbers: // with that logic, characters 4 and 5 are our numbers:
const char *newmsg;
int spc = 1; // used if nodenum[1] is a space. int spc = 1; // used if nodenum[1] is a space.
char *nodenum = (char*) malloc(3); char *nodenum = (char*) malloc(3);
strncpy(nodenum, msg+3, 5); strncpy(nodenum, msg+3, 5);
@ -503,7 +504,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
return; return;
} }
buf[0] = target; buf[0] = target;
const char *newmsg = msg+5+spc; newmsg = msg+5+spc;
memcpy(msg, newmsg, 252); memcpy(msg, newmsg, 252);
} }
@ -568,7 +569,10 @@ static void Command_Sayteam_f(void)
return; return;
} }
DoSayCommand(-1, 1, 0); if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype.
DoSayCommand(-1, 1, 0);
else
DoSayCommand(0, 1, 0);
} }
/** Send a message to everyone, to be displayed by CECHO. Only /** Send a message to everyone, to be displayed by CECHO. Only
@ -604,6 +608,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
char *msg; char *msg;
boolean action = false; boolean action = false;
char *ptr; char *ptr;
int spam_eatmsg = 0;
CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]);
@ -650,8 +655,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
} }
} }
int spam_eatmsg = 0;
// before we do anything, let's verify the guy isn't spamming, get this easier on us. // before we do anything, let's verify the guy isn't spamming, get this easier on us.
//if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY)) //if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY))
@ -718,19 +721,32 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// player is a spectator? // player is a spectator?
if (players[playernum].spectator) if (players[playernum].spectator)
{ {
cstart = "\x86"; // grey name cstart = "\x86"; // grey name
textcolor = "\x86"; textcolor = "\x86";
} }
else if (target == -1) // say team
{
if (players[playernum].ctfteam == 1) // red
{
cstart = "\x85";
textcolor = "\x85";
}
else // blue
{
cstart = "\x84";
textcolor = "\x84";
}
}
else else
{ {
const UINT8 color = players[playernum].skincolor; const UINT8 color = players[playernum].skincolor;
if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE) if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE)
cstart = "\x80"; // white cstart = "\x80"; // white
else if (color <= SKINCOLOR_BEIGE || color == SKINCOLOR_JET) else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET)
cstart = "\x86"; // V_GRAYMAP cstart = "\x86"; // V_GRAYMAP
else if (color <= SKINCOLOR_LEATHER) else if (color <= SKINCOLOR_LEATHER)
cstart = "\x8A"; // V_GOLDMAP cstart = "\x8e"; // V_BROWNMAP
else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC) else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC)
cstart = "\x8d"; // V_PINKMAP cstart = "\x8d"; // V_PINKMAP
else if (color <= SKINCOLOR_KETCHUP) else if (color <= SKINCOLOR_KETCHUP)
@ -741,14 +757,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x8f"; // V_PEACHMAP cstart = "\x8f"; // V_PEACHMAP
else if (color <= SKINCOLOR_BRONZE) else if (color <= SKINCOLOR_BRONZE)
cstart = "\x8A"; // V_GOLDMAP cstart = "\x8A"; // V_GOLDMAP
else if (color <= SKINCOLOR_MUSTARD) else if (color <= SKINCOLOR_OLIVE)
cstart = "\x82"; // V_YELLOWMAP cstart = "\x82"; // V_YELLOWMAP
else if (color <= SKINCOLOR_PISTACHIO) else if (color <= SKINCOLOR_PISTACHIO)
cstart = "\x8b"; // V_TEAMAP cstart = "\x8b"; // V_TEAMAP
else if (color <= SKINCOLOR_SWAMP || color == SKINCOLOR_LIME) else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME)
cstart = "\x83"; // V_GREENMAP cstart = "\x83"; // V_GREENMAP
else if (color <= SKINCOLOR_TEAL)
cstart = "\x8e"; // V_TEALMAP
else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE)
cstart = "\x88"; // V_SKYMAP cstart = "\x88"; // V_SKYMAP
else if (color <= SKINCOLOR_STEEL) else if (color <= SKINCOLOR_STEEL)
@ -761,7 +775,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x89"; // V_LAVENDERMAP cstart = "\x89"; // V_LAVENDERMAP
} }
prefix = cstart; prefix = cstart;
// Give admins and remote admins their symbols. // Give admins and remote admins their symbols.
if (playernum == serverplayer) if (playernum == serverplayer)
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL); tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
@ -783,13 +797,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// '\4' makes the message yellow and beeps; '\3' just beeps. // '\4' makes the message yellow and beeps; '\3' just beeps.
if (action) if (action)
{ {
fmt = "\3* %s%s%s%s \x82%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! fmt = "\3* %s%s%s%s \x82%s%s\n"; // don't make /me yellow, yellow will be for mentions and PMs!
fmt2 = "* %s%s%s%s \x82%s"; fmt2 = "* %s%s%s%s \x82%s%s";
}
else if (target == 0) // To everyone
{
fmt = "\3%s<%s%s%s>\x80 %s%s\n";
fmt2 = "%s<%s%s%s>\x80 %s%s";
} }
else if (target-1 == consoleplayer) // To you else if (target-1 == consoleplayer) // To you
{ {
@ -809,7 +818,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
fmt2 = "%s<%s%s>%s\x80 %s%s"; fmt2 = "%s<%s%s>%s\x80 %s%s";
} }
else // To your team else // To everyone or sayteam, it doesn't change anything.
{
fmt = "\3%s<%s%s%s>\x80 %s%s\n";
fmt2 = "%s<%s%s%s>\x80 %s%s";
}
/*else // To your team
{ {
if (players[playernum].ctfteam == 1) // red if (players[playernum].ctfteam == 1) // red
prefix = "\x85[TEAM]"; prefix = "\x85[TEAM]";
@ -820,8 +834,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
fmt = "\3%s<%s%s>\x80%s %s%s\n"; fmt = "\3%s<%s%s>\x80%s %s%s\n";
fmt2 = "%s<%s%s>\x80%s %s%s"; fmt2 = "%s<%s%s>\x80%s %s%s";
}*/
}
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type. HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type.
@ -870,7 +883,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
{ {
if (s[m]) if (s[m])
s[m+1] = (s[m]); s[m+1] = (s[m]);
if (m < 1) if (m < 1)
break; // fix the chat going ham if your replace the first character. (For whatever reason this didn't happen in vanilla????) break; // fix the chat going ham if your replace the first character. (For whatever reason this didn't happen in vanilla????)
} }
@ -883,9 +896,10 @@ static inline boolean HU_keyInChatString(char *s, char ch)
} }
else if (ch == KEY_BACKSPACE) else if (ch == KEY_BACKSPACE)
{ {
size_t i;
if (c_input <= 0) if (c_input <= 0)
return false; return false;
size_t i = c_input; i = c_input;
if (!s[i-1]) if (!s[i-1])
return false; return false;
@ -938,28 +952,31 @@ static void HU_queueChatChar(INT32 c)
char buf[2+256]; char buf[2+256];
size_t ci = 2; size_t ci = 2;
char *msg = &buf[2]; char *msg = &buf[2];
size_t i;
INT32 target = 0;
do { do {
c = w_chat[-2+ci++]; c = w_chat[-2+ci++];
if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only. if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only.
buf[ci-1]=c; buf[ci-1]=c;
} while (c); } while (c);
size_t i = 0; i = 0;
for (;(i<HU_MAXMSGLEN);i++) for (;(i<HU_MAXMSGLEN);i++)
w_chat[i] = 0; // reset this. w_chat[i] = 0; // reset this.
c_input = 0; c_input = 0;
// last minute mute check // last minute mute check
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) if (CHAT_MUTE)
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"));
return; return;
} }
INT32 target = 0;
if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
{ {
int spc;
char *nodenum;
const char *newmsg;
// what we're gonna do now is check if the node exists // what we're gonna do now is check if the node exists
// with that logic, characters 4 and 5 are our numbers: // with that logic, characters 4 and 5 are our numbers:
@ -970,8 +987,8 @@ static void HU_queueChatChar(INT32 c)
return; return;
} }
int spc = 1; // used if nodenum[1] is a space. spc = 1; // used if nodenum[1] is a space.
char *nodenum = (char*) malloc(3); nodenum = (char*) malloc(3);
strncpy(nodenum, msg+3, 5); strncpy(nodenum, msg+3, 5);
// check for undesirable characters in our "number" // check for undesirable characters in our "number"
if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9')))
@ -1008,7 +1025,7 @@ static void HU_queueChatChar(INT32 c)
return; return;
} }
// we need to get rid of the /pm<node> // we need to get rid of the /pm<node>
const char *newmsg = msg+5+spc; newmsg = msg+5+spc;
memcpy(msg, newmsg, 255); memcpy(msg, newmsg, 255);
} }
if (ci > 3) // don't send target+flags+empty message. if (ci > 3) // don't send target+flags+empty message.
@ -1053,10 +1070,8 @@ boolean HU_Responder(event_t *ev)
{ {
// enter chat mode // enter chat mode
if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1])
&& netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise.
{ {
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
return false;
chat_on = true; chat_on = true;
w_chat[0] = 0; w_chat[0] = 0;
teamtalk = false; teamtalk = false;
@ -1064,13 +1079,11 @@ boolean HU_Responder(event_t *ev)
return true; return true;
} }
if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1])
&& netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) && netgame && !OLD_MUTE)
{ {
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
return false;
chat_on = true; chat_on = true;
w_chat[0] = 0; w_chat[0] = 0;
teamtalk = true; teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams.
chat_scrollmedown = true; chat_scrollmedown = true;
return true; return true;
} }
@ -1105,17 +1118,19 @@ boolean HU_Responder(event_t *ev)
// TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up. // TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up.
// pasting. pasting is cool. chat is a bit limited, though :( // pasting. pasting is cool. chat is a bit limited, though :(
if ((c == 'v' || c == 'V') && ctrldown) if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
{ {
const char *paste = I_ClipboardPaste(); const char *paste = I_ClipboardPaste();
size_t chatlen;
size_t pastelen;
// create a dummy string real quickly // create a dummy string real quickly
if (paste == NULL) if (paste == NULL)
return true; return true;
size_t chatlen = strlen(w_chat); chatlen = strlen(w_chat);
size_t pastelen = strlen(paste); pastelen = strlen(paste);
if (chatlen+pastelen > HU_MAXMSGLEN) if (chatlen+pastelen > HU_MAXMSGLEN)
return true; // we can't paste this!! return true; // we can't paste this!!
@ -1145,7 +1160,7 @@ boolean HU_Responder(event_t *ev)
} }
} }
if (HU_keyInChatString(w_chat,c)) if (!CHAT_MUTE && HU_keyInChatString(w_chat,c))
{ {
HU_queueChatChar(c); HU_queueChatChar(c);
} }
@ -1155,26 +1170,29 @@ boolean HU_Responder(event_t *ev)
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :) chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
} }
else if (c == KEY_ESCAPE) else if (c == KEY_ESCAPE
|| ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
|| c == gamecontrol[gc_teamkey][0] || c == gamecontrol[gc_teamkey][1])
&& c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle.
{ {
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
} }
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0) // CHAT SCROLLING YAYS! else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
{ {
chat_scroll--; chat_scroll--;
justscrolledup = true; justscrolledup = true;
chat_scrolltime = 4; chat_scrolltime = 4;
} }
else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0) else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0 && !OLDCHAT)
{ {
chat_scroll++; chat_scroll++;
justscrolleddown = true; justscrolleddown = true;
chat_scrolltime = 4; chat_scrolltime = 4;
} }
else if (c == KEY_LEFTARROW && c_input != 0) // i said go back else if (c == KEY_LEFTARROW && c_input != 0 && !OLDCHAT) // i said go back
c_input--; c_input--;
else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat)) else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat) && !OLDCHAT) // don't need to check for admin or w/e here since the chat won't ever contain anything if it's muted.
c_input++; c_input++;
return true; return true;
} }
@ -1249,9 +1267,6 @@ INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh
static void HU_drawMiniChat(void) static void HU_drawMiniChat(void)
{ {
if (!chat_nummsg_min)
return; // needless to say it's useless to do anything if we don't have anything to draw.
INT32 x = chatx+2; INT32 x = chatx+2;
INT32 charwidth = 4, charheight = 6; INT32 charwidth = 4, charheight = 6;
INT32 dx = 0, dy = 0; INT32 dx = 0, dy = 0;
@ -1260,6 +1275,10 @@ static void HU_drawMiniChat(void)
INT32 msglines = 0; INT32 msglines = 0;
// process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has... // process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has...
INT32 y;
if (!chat_nummsg_min)
return; // needless to say it's useless to do anything if we don't have anything to draw.
for (; i>0; i--) for (; i>0; i--)
{ {
@ -1275,10 +1294,10 @@ static void HU_drawMiniChat(void)
{ {
++j; ++j;
if (!prev_linereturn) if (!prev_linereturn)
{ {
linescount += 1; linescount += 1;
dx = 0; dx = 0;
} }
prev_linereturn = true; prev_linereturn = true;
continue; continue;
} }
@ -1307,7 +1326,7 @@ static void HU_drawMiniChat(void)
msglines += linescount+1; msglines += linescount+1;
} }
INT32 y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0); y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0);
dx = 0; dx = 0;
dy = 0; dy = 0;
i = 0; i = 0;
@ -1330,10 +1349,10 @@ static void HU_drawMiniChat(void)
{ {
++j; ++j;
if (!prev_linereturn) if (!prev_linereturn)
{ {
dy += charheight; dy += charheight;
dx = 0; dx = 0;
} }
prev_linereturn = true; prev_linereturn = true;
continue; continue;
} }
@ -1485,8 +1504,10 @@ static void HU_DrawChat(void)
INT32 charwidth = 4, charheight = 6; INT32 charwidth = 4, charheight = 6;
INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0); INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0);
UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday! UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday!
INT32 cflag = 0;
const char *ntalk = "Say: ", *ttalk = "Team: "; const char *ntalk = "Say: ", *ttalk = "Team: ";
const char *talk = ntalk; const char *talk = ntalk;
const char *mute = "Chat has been muted.";
if (teamtalk) if (teamtalk)
{ {
@ -1499,18 +1520,35 @@ static void HU_DrawChat(void)
#endif #endif
} }
if (CHAT_MUTE)
{
talk = mute;
typelines = 1;
cflag = V_GRAYMAP; // set text in gray if chat is muted.
}
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
while (talk[i]) while (talk[i])
{ {
if (talk[i] < HU_FONTSTART) if (talk[i] < HU_FONTSTART)
++i; ++i;
else else
V_DrawChatCharacter(chatx + c + 2, y, talk[i++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT, !cv_allcaps.value, NULL); {
V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag));
i++;
}
c += charwidth; c += charwidth;
} }
// if chat is muted, just draw the log and get it over with:
if (CHAT_MUTE)
{
HU_drawChatLog(0);
return;
}
i = 0; i = 0;
typelines = 1; typelines = 1;
@ -1553,24 +1591,25 @@ static void HU_DrawChat(void)
// handle /pm list. // handle /pm list.
if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
{ {
i = 0;
INT32 count = 0; INT32 count = 0;
INT32 p_dispy = chaty - charheight -1; INT32 p_dispy = chaty - charheight -1;
i = 0;
for(i=0; (i<MAXPLAYERS); i++) for(i=0; (i<MAXPLAYERS); i++)
{ {
// filter: (code needs optimization pls help I'm bad with C) // filter: (code needs optimization pls help I'm bad with C)
if (w_chat[3]) if (w_chat[3])
{ {
char *nodenum;
UINT32 n;
// right, that's half important: (w_chat[4] may be a space since /pm0 msg is perfectly acceptable!) // right, that's half important: (w_chat[4] may be a space since /pm0 msg is perfectly acceptable!)
if ( ( ((w_chat[3] != 0) && ((w_chat[3] < '0') || (w_chat[3] > '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' ')) if ( ( ((w_chat[3] != 0) && ((w_chat[3] < '0') || (w_chat[3] > '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' '))
break; break;
char *nodenum = (char*) malloc(3); nodenum = (char*) malloc(3);
strncpy(nodenum, w_chat+3, 4); strncpy(nodenum, w_chat+3, 4);
UINT32 n = atoi((const char*) nodenum); // turn that into a number n = atoi((const char*) nodenum); // turn that into a number
// special cases: // special cases:
if ((n == 0) && !(w_chat[4] == '0')) if ((n == 0) && !(w_chat[4] == '0'))
@ -1695,7 +1734,7 @@ static void HU_DrawChat_Old(void)
// //
// Crosshairs are pre-cached at HU_Init // Crosshairs are pre-cached at HU_Init
static inline void HU_DrawCrosshair(void) /*static inline void HU_DrawCrosshair(void)
{ {
INT32 i, x, y; INT32 i, x, y;
@ -1847,7 +1886,7 @@ static inline void HU_DrawCrosshair4(void)
V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
} }
} }*/
static void HU_DrawCEcho(void) static void HU_DrawCEcho(void)
{ {
@ -1955,10 +1994,13 @@ void HU_Drawer(void)
} }
else else
{ {
if (netgame) // Don't draw it outside, I know it leads to stupid stuff.
{
chat_scrolltime = 0; // do scroll anyway. chat_scrolltime = 0; // do scroll anyway.
typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time.
if (!OLDCHAT) if (!OLDCHAT)
HU_drawMiniChat(); // draw messages in a cool fashion. HU_drawMiniChat(); // draw messages in a cool fashion.
}
} }
if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh) if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh)
@ -2018,7 +2060,7 @@ void HU_Drawer(void)
return; return;
// draw the crosshair, not when viewing demos nor with chasecam // draw the crosshair, not when viewing demos nor with chasecam
if (!automapactive && !demoplayback) /*if (!automapactive && !demoplayback)
{ {
if (cv_crosshair.value && !camera.chase && !players[displayplayer].spectator) if (cv_crosshair.value && !camera.chase && !players[displayplayer].spectator)
HU_DrawCrosshair(); HU_DrawCrosshair();
@ -2031,7 +2073,7 @@ void HU_Drawer(void)
if (cv_crosshair4.value && !camera4.chase && !players[fourthdisplayplayer].spectator) if (cv_crosshair4.value && !camera4.chase && !players[fourthdisplayplayer].spectator)
HU_DrawCrosshair4(); HU_DrawCrosshair4();
} }*/
// draw desynch text // draw desynch text
if (hu_resynching) if (hu_resynching)
@ -2133,6 +2175,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
UINT8 barcolor = 128; // color we use for the bars (green, yellow or red) UINT8 barcolor = 128; // color we use for the bars (green, yellow or red)
SINT8 i = 0; SINT8 i = 0;
SINT8 yoffset = 6; SINT8 yoffset = 6;
INT32 dx;
if (ping < 128) if (ping < 128)
{ {
numbars = 3; numbars = 3;
@ -2144,7 +2187,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
barcolor = 103; barcolor = 103;
} }
INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2);
if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. if (!notext || vid.width >= 640) // how sad, we're using a shit resolution.
V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping));
@ -2226,22 +2269,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (G_RaceGametype()) if (G_RaceGametype())
{ {
#define timestring(time) va("%i:%02i.%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) #define timestring(time) va("%i'%02i\"%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time))
if (players[tab[i].num].exiting) if (players[tab[i].num].exiting)
{
V_DrawRightAlignedString(x, y-4, hilicol, "FIN");
V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime)); V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime));
}
else if (players[tab[i].num].pflags & PF_TIMEOVER) else if (players[tab[i].num].pflags & PF_TIMEOVER)
V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "TIME OVER..."); V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST.");
else if (circuitmap) else if (circuitmap)
{ V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count));
V_DrawRightAlignedString(x, y-4, 0, "Lap");
V_DrawRightAlignedString(x, y+4, 0, va("%d", tab[i].count));
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(players[tab[i].num].starposttime));
}
else
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(tab[i].count));
#undef timestring #undef timestring
} }
else else

View File

@ -81,6 +81,8 @@ extern patch_t *iconprefix[MAXSKINS];
#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
#define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640) #define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640)
#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
// some functions // some functions
void HU_AddChatText(const char *text); void HU_AddChatText(const char *text);
@ -91,9 +93,6 @@ extern boolean chat_on;
// set true whenever the tab rankings are being shown for any reason // set true whenever the tab rankings are being shown for any reason
extern boolean hu_showscores; extern boolean hu_showscores;
// P_DeathThink sets this true to show scores while dead, in multiplayer
extern boolean playerdeadview;
// init heads up data at game startup. // init heads up data at game startup.
void HU_Init(void); void HU_Init(void);

View File

@ -64,7 +64,7 @@ void I_ShutdownSound(void);
\return sfx handle \return sfx handle
*/ */
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority); INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel);
/** \brief Stops a sound channel. /** \brief Stops a sound channel.

View File

@ -686,14 +686,29 @@ static boolean SOCK_CanGet(void)
#endif #endif
#ifndef NONET #ifndef NONET
static void SOCK_Send(void) static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr)
{ {
ssize_t c = ERRSOCKET;
socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in); socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in);
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
socklen_t d6 = (socklen_t)sizeof(struct sockaddr_in6); socklen_t d6 = (socklen_t)sizeof(struct sockaddr_in6);
#endif #endif
socklen_t d, da = (socklen_t)sizeof(mysockaddr_t); socklen_t d, da = (socklen_t)sizeof(mysockaddr_t);
switch (sockaddr->any.sa_family)
{
case AF_INET: d = d4; break;
#ifdef HAVE_IPV6
case AF_INET6: d = d6; break;
#endif
default: d = da; break;
}
return sendto(socket, (char *)&doomcom->data, doomcom->datalength, 0, &sockaddr->any, d);
}
static void SOCK_Send(void)
{
ssize_t c = ERRSOCKET;
size_t i, j; size_t i, j;
if (!nodeconnected[doomcom->remotenode]) if (!nodeconnected[doomcom->remotenode])
@ -706,19 +721,7 @@ static void SOCK_Send(void)
for (j = 0; j < broadcastaddresses; j++) for (j = 0; j < broadcastaddresses; j++)
{ {
if (myfamily[i] == broadcastaddress[j].any.sa_family) if (myfamily[i] == broadcastaddress[j].any.sa_family)
{ SOCK_SendToAddr(mysockets[i], &broadcastaddress[j]);
if (broadcastaddress[i].any.sa_family == AF_INET)
d = d4;
#ifdef HAVE_IPV6
else if (broadcastaddress[i].any.sa_family == AF_INET6)
d = d6;
#endif
else
d = da;
c = sendto(mysockets[i], (char *)&doomcom->data, doomcom->datalength, 0,
&broadcastaddress[j].any, d);
}
} }
} }
return; return;
@ -728,35 +731,13 @@ static void SOCK_Send(void)
for (i = 0; i < mysocketses; i++) for (i = 0; i < mysocketses; i++)
{ {
if (myfamily[i] == clientaddress[doomcom->remotenode].any.sa_family) if (myfamily[i] == clientaddress[doomcom->remotenode].any.sa_family)
{ SOCK_SendToAddr(mysockets[i], &clientaddress[doomcom->remotenode]);
if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET)
d = d4;
#ifdef HAVE_IPV6
else if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET6)
d = d6;
#endif
else
d = da;
sendto(mysockets[i], (char *)&doomcom->data, doomcom->datalength, 0,
&clientaddress[doomcom->remotenode].any, d);
}
} }
return; return;
} }
else else
{ {
if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET) c = SOCK_SendToAddr(nodesocket[doomcom->remotenode], &clientaddress[doomcom->remotenode]);
d = d4;
#ifdef HAVE_IPV6
else if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET6)
d = d6;
#endif
else
d = da;
c = sendto(nodesocket[doomcom->remotenode], (char *)&doomcom->data, doomcom->datalength, 0,
&clientaddress[doomcom->remotenode].any, d);
} }
if (c == ERRSOCKET && errno != ECONNREFUSED && errno != EWOULDBLOCK) if (c == ERRSOCKET && errno != ECONNREFUSED && errno != EWOULDBLOCK)
@ -1044,7 +1025,7 @@ static boolean UDP_Socket(void)
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
while (runp != NULL) while (runp != NULL && s < MAXNETNODES+1)
{ {
memcpy(&clientaddress[s], runp->ai_addr, runp->ai_addrlen); memcpy(&clientaddress[s], runp->ai_addr, runp->ai_addrlen);
s++; s++;
@ -1059,12 +1040,15 @@ static boolean UDP_Socket(void)
clientaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); //GetLocalAddress(); // my own ip clientaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); //GetLocalAddress(); // my own ip
s++; s++;
} }
s = 0;
// setup broadcast adress to BROADCASTADDR entry // setup broadcast adress to BROADCASTADDR entry
gaie = I_getaddrinfo("255.255.255.255", "0", &hints, &ai); gaie = I_getaddrinfo("255.255.255.255", "0", &hints, &ai);
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
while (runp != NULL) while (runp != NULL && s < MAXNETNODES+1)
{ {
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen); memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
s++; s++;
@ -1087,7 +1071,7 @@ static boolean UDP_Socket(void)
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
while (runp != NULL) while (runp != NULL && s < MAXNETNODES+1)
{ {
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen); memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
s++; s++;

View File

@ -3006,6 +3006,7 @@ state_t states[NUMSTATES] =
{SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB
{SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM
{SPR_FITM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERFAKE
{SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL
@ -4089,7 +4090,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
4, // mass 4, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY, // flags MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_SCENERY, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -10754,7 +10755,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate S_NULL, // deathstate
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_None, // deathsound sfx_None, // deathsound
-24*FRACUNIT, // speed -72*FRACUNIT, // speed -- -24*FRACUNIT originally, srb2kart x3 (nya)
1*FRACUNIT, // radius 1*FRACUNIT, // radius
8*FRACUNIT, // height 8*FRACUNIT, // height
0, // display offset 0, // display offset
@ -17132,7 +17133,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
sfx_kc2e, // seesound sfx_kc2e, // seesound
8, // reactiontime 8, // reactiontime
sfx_s3k4e, // attacksound sfx_s3k4e, // attacksound
S_NULL, // painstate S_PLAYERFAKE, // painstate
0, // painchance 0, // painchance
sfx_None, // painsound sfx_None, // painsound
S_NULL, // meleestate S_NULL, // meleestate

View File

@ -3554,11 +3554,12 @@ typedef enum state
S_PLAYERBOMB, S_PLAYERBOMB,
S_PLAYERITEM, S_PLAYERITEM,
S_PLAYERFAKE,
S_KARMAWHEEL, S_KARMAWHEEL,
// Lightning shield use stuff; // Thunder shield use stuff;
S_KSPARK1, // Sparkling Radius S_KSPARK1, // Sparkling Radius
S_KSPARK2, S_KSPARK2,
S_KSPARK3, S_KSPARK3,
S_KSPARK4, S_KSPARK4,
@ -3571,7 +3572,7 @@ typedef enum state
S_KSPARK11, S_KSPARK11,
S_KSPARK12, S_KSPARK12,
S_KSPARK13, // ... that's an awful lot. S_KSPARK13, // ... that's an awful lot.
S_LZIO11, // Straight lightning bolt S_LZIO11, // Straight lightning bolt
S_LZIO12, S_LZIO12,
S_LZIO13, S_LZIO13,
@ -3581,7 +3582,7 @@ typedef enum state
S_LZIO17, S_LZIO17,
S_LZIO18, S_LZIO18,
S_LZIO19, S_LZIO19,
S_LZIO21, // Straight lightning bolt (flipped) S_LZIO21, // Straight lightning bolt (flipped)
S_LZIO22, S_LZIO22,
S_LZIO23, S_LZIO23,
@ -3591,7 +3592,7 @@ typedef enum state
S_LZIO27, S_LZIO27,
S_LZIO28, S_LZIO28,
S_LZIO29, S_LZIO29,
S_KLIT1, // Diagonal lightning. No, it not being straight doesn't make it gay. S_KLIT1, // Diagonal lightning. No, it not being straight doesn't make it gay.
S_KLIT2, S_KLIT2,
S_KLIT3, S_KLIT3,

View File

@ -55,9 +55,9 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Salmon", // 10 // SKINCOLOR_SALMON "Salmon", // 10 // SKINCOLOR_SALMON
"Pink", // 11 // SKINCOLOR_PINK "Pink", // 11 // SKINCOLOR_PINK
"Rose", // 12 // SKINCOLOR_ROSE "Rose", // 12 // SKINCOLOR_ROSE
"Raspberry", // 13 // SKINCOLOR_RASPBERRY "Ruby", // 13 // SKINCOLOR_RUBY
"Red", // 14 // SKINCOLOR_RED "Raspberry", // 14 // SKINCOLOR_RASPBERRY
"Ruby", // 15 // SKINCOLOR_RUBY "Red", // 15 // SKINCOLOR_RED
"Crimson", // 16 // SKINCOLOR_CRIMSON "Crimson", // 16 // SKINCOLOR_CRIMSON
"Ketchup", // 17 // SKINCOLOR_KETCHUP "Ketchup", // 17 // SKINCOLOR_KETCHUP
"Dawn", // 18 // SKINCOLOR_DAWN "Dawn", // 18 // SKINCOLOR_DAWN
@ -77,16 +77,16 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Vomit", // 32 // SKINCOLOR_VOMIT "Vomit", // 32 // SKINCOLOR_VOMIT
"Garden", // 33 // SKINCOLOR_GARDEN "Garden", // 33 // SKINCOLOR_GARDEN
"Lime", // 34 // SKINCOLOR_LIME "Lime", // 34 // SKINCOLOR_LIME
"Dream", // 35 // SKINCOLOR_DREAM "Tea", // 35 // SKINCOLOR_TEA
"Tea", // 36 // SKINCOLOR_TEA "Pistachio", // 36 // SKINCOLOR_PISTACHIO
"Pistachio", // 37 // SKINCOLOR_PISTACHIO "Robo-Hood", // 37 // SKINCOLOR_ROBOHOOD
"Robo-Hood", // 38 // SKINCOLOR_ROBOHOOD "Moss", // 38 // SKINCOLOR_MOSS
"Moss", // 39 // SKINCOLOR_MOSS "Mint", // 39 // SKINCOLOR_MINT
"Mint", // 40 // SKINCOLOR_MINT "Green", // 40 // SKINCOLOR_GREEN
"Green", // 41 // SKINCOLOR_GREEN "Pinetree", // 41 // SKINCOLOR_PINETREE
"Pinetree", // 42 // SKINCOLOR_PINETREE "Emerald", // 42 // SKINCOLOR_EMERALD
"Emerald", // 43 // SKINCOLOR_EMERALD "Swamp", // 43 // SKINCOLOR_SWAMP
"Swamp", // 44 // SKINCOLOR_SWAMP "Dream", // 44 // SKINCOLOR_DREAM
"Aqua", // 45 // SKINCOLOR_AQUA "Aqua", // 45 // SKINCOLOR_AQUA
"Teal", // 46 // SKINCOLOR_TEAL "Teal", // 46 // SKINCOLOR_TEAL
"Cyan", // 47 // SKINCOLOR_CYAN "Cyan", // 47 // SKINCOLOR_CYAN
@ -96,9 +96,9 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Slate", // 51 // SKINCOLOR_SLATE "Slate", // 51 // SKINCOLOR_SLATE
"Steel", // 52 // SKINCOLOR_STEEL "Steel", // 52 // SKINCOLOR_STEEL
"Jet", // 53 // SKINCOLOR_JET "Jet", // 53 // SKINCOLOR_JET
"Periwinkle", // 54 // SKINCOLOR_PERIWINKLE "Sapphire", // 54 // SKINCOLOR_SAPPHIRE
"Blue", // 55 // SKINCOLOR_BLUE "Periwinkle", // 55 // SKINCOLOR_PERIWINKLE
"Sapphire", // 56 // SKINCOLOR_SAPPHIRE "Blue", // 56 // SKINCOLOR_BLUE
"Blueberry", // 57 // SKINCOLOR_BLUEBERRY "Blueberry", // 57 // SKINCOLOR_BLUEBERRY
"Dusk", // 58 // SKINCOLOR_DUSK "Dusk", // 58 // SKINCOLOR_DUSK
"Purple", // 59 // SKINCOLOR_PURPLE "Purple", // 59 // SKINCOLOR_PURPLE
@ -124,9 +124,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON
SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK
SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE
SKINCOLOR_MINT,8, // 13 // SKINCOLOR_RASPBERRY SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY
SKINCOLOR_GREEN,6, // 14 // SKINCOLOR_RED SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY
SKINCOLOR_SAPPHIRE,8, // 15 // SKINCOLOR_RUBY SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED
SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON
SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP
SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN
@ -146,16 +146,16 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT
SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN
SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME
SKINCOLOR_POMEGRANATE,8, // 35 // SKINCOLOR_DREAM SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA
SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO
SKINCOLOR_PINK,6, // 37 // SKINCOLOR_PISTACHIO SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD
SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS
SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT
SKINCOLOR_RASPBERRY,8, // 40 // SKINCOLOR_MINT SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN
SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE
SKINCOLOR_CRIMSON,8, // 42 // SKINCOLOR_PINETREE SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD
SKINCOLOR_PURPLE,8, // 43 // SKINCOLOR_EMERALD SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP
SKINCOLOR_BYZANTIUM,8, // 44 // SKINCOLOR_SWAMP SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM
SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA
SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL
SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN
@ -165,9 +165,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE
SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL
SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET
SKINCOLOR_CREAMSICLE,8, // 54 // SKINCOLOR_PERIWINKLE SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE
SKINCOLOR_ORANGE,8, // 55 // SKINCOLOR_BLUE SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE
SKINCOLOR_RUBY,6, // 56 // SKINCOLOR_SAPPHIRE SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE
SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY
SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK
SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE
@ -189,11 +189,11 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN
{ 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER
{120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON
{121, 121, 144, 144, 145, 145, 146, 146, 147, 148, 149, 150, 151, 134, 136, 138}, // SKINCOLOR_PINK {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK
{144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE
{121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY
{120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY
{125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED
{121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY
{130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON
{104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP
{120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN
@ -213,7 +213,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT
{ 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN
{ 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME
{120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM
{120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA
{120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO
{176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD
@ -223,18 +222,19 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE
{160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD
{186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP
{120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM
{120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA
{210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL
{120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN
{120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ {120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ
{208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN
{215, 215, 215, 216, 216, 217, 218, 204, 204, 205, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NAVY {211, 212, 213, 215, 216, 218, 219, 205, 206, 206, 207, 207, 28, 29, 30, 31}, // SKINCOLOR_NAVY
{120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE
{120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL
{200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET
{208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE
{120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE
{224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE
{208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE
{228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY
{192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK
{192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE
@ -256,8 +256,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
*/ */
}; };
//#define SALLYALTRAINBOW // Sal's edited version of the below, which keeps a colors' lightness, and looks better with hue-shifted colors like Ruby & Dream. Not strictly *better*, just different...
// Define for getting accurate color brightness readings according to how the human eye sees them. // Define for getting accurate color brightness readings according to how the human eye sees them.
// https://en.wikipedia.org/wiki/Relative_luminance // https://en.wikipedia.org/wiki/Relative_luminance
// 0.2126 to red // 0.2126 to red
@ -277,7 +275,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
INT32 i; INT32 i;
RGBA_t color; RGBA_t color;
UINT8 brightness; UINT8 brightness;
#ifndef SALLYALTRAINBOW
INT32 j; INT32 j;
UINT8 colorbrightnesses[16]; UINT8 colorbrightnesses[16];
UINT16 brightdif; UINT16 brightdif;
@ -289,7 +286,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
color = V_GetColor(colortranslations[skincolor][i]); color = V_GetColor(colortranslations[skincolor][i]);
SETBRIGHTNESS(colorbrightnesses[i], color.s.red, color.s.green, color.s.blue); SETBRIGHTNESS(colorbrightnesses[i], color.s.red, color.s.green, color.s.blue);
} }
#endif
// next, for every colour in the palette, choose the transcolor that has the closest brightness // next, for every colour in the palette, choose the transcolor that has the closest brightness
for (i = 0; i < NUM_PALETTE_ENTRIES; i++) for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
@ -301,10 +297,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
} }
color = V_GetColor(i); color = V_GetColor(i);
SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue); SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue);
#ifdef SALLYALTRAINBOW
brightness = 15-(brightness/16); // Yes, 15.
dest_colormap[i] = colortranslations[skincolor][brightness];
#else
brightdif = 256; brightdif = 256;
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
@ -315,7 +307,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
dest_colormap[i] = colortranslations[skincolor][j]; dest_colormap[i] = colortranslations[skincolor][j];
} }
} }
#endif
} }
} }
@ -905,12 +896,12 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player)) if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8)); S_StartSound(NULL, sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8));
roulettestop = (TICRATE*1) + (3*(pingame - player->kartstuff[k_position])); roulettestop = TICRATE + (3*(pingame - player->kartstuff[k_position]));
// If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item.
// I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think.
// Finally, if you get past this check, now you can actually start calculating what item you get. // Finally, if you get past this check, now you can actually start calculating what item you get.
if ((cmd->buttons & BT_ATTACK) && !(player->kartstuff[k_eggmanheld] || player->kartstuff[k_itemheld]) && player->kartstuff[k_itemroulette] >= roulettestop) if ((cmd->buttons & BT_ATTACK) && !(player->kartstuff[k_eggmanheld] || player->kartstuff[k_itemheld]) && player->kartstuff[k_itemroulette] >= roulettestop && !modeattacking)
{ {
// Mashing reduces your chances for the good items // Mashing reduces your chances for the good items
mashed = FixedDiv((player->kartstuff[k_itemroulette])*FRACUNIT, ((TICRATE*3)+roulettestop)*FRACUNIT) - FRACUNIT; mashed = FixedDiv((player->kartstuff[k_itemroulette])*FRACUNIT, ((TICRATE*3)+roulettestop)*FRACUNIT) - FRACUNIT;
@ -1277,7 +1268,7 @@ static void K_SpawnDashDustRelease(player_t *player)
if (!P_IsObjectOnGround(player->mo)) if (!P_IsObjectOnGround(player->mo))
return; return;
if (player->speed == 0) if (!player->speed && !player->kartstuff[k_startboost])
return; return;
travelangle = player->mo->angle; travelangle = player->mo->angle;
@ -1805,11 +1796,20 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
K_CalculateBattleWanted(); K_CalculateBattleWanted();
} }
if (!player->kartstuff[k_bumper])
{
player->kartstuff[k_comebacktimer] = comebacktime;
if (player->kartstuff[k_comebackmode] == 2)
{
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
player->kartstuff[k_comebackmode] = 0;
}
}
K_CheckBumpers(); K_CheckBumpers();
} }
player->kartstuff[k_comebacktimer] = comebacktime;
player->kartstuff[k_spinouttype] = type; player->kartstuff[k_spinouttype] = type;
if (player->kartstuff[k_spinouttype] <= 0) if (player->kartstuff[k_spinouttype] <= 0)
@ -1887,11 +1887,20 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
K_CalculateBattleWanted(); K_CalculateBattleWanted();
} }
if (!player->kartstuff[k_bumper])
{
player->kartstuff[k_comebacktimer] = comebacktime;
if (player->kartstuff[k_comebackmode] == 2)
{
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
player->kartstuff[k_comebackmode] = 0;
}
}
K_CheckBumpers(); K_CheckBumpers();
} }
player->kartstuff[k_comebacktimer] = comebacktime;
player->kartstuff[k_squishedtimer] = 2*TICRATE; player->kartstuff[k_squishedtimer] = 2*TICRATE;
player->powers[pw_flashing] = K_GetKartFlashing(player); player->powers[pw_flashing] = K_GetKartFlashing(player);
@ -1933,6 +1942,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
return; return;
} }
if (source && source != player->mo && source->player)
K_PlayHitEmSound(source);
player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale); player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale);
player->mo->momx = player->mo->momy = 0; player->mo->momx = player->mo->momy = 0;
@ -1963,11 +1975,20 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
K_CalculateBattleWanted(); K_CalculateBattleWanted();
} }
if (!player->kartstuff[k_bumper])
{
player->kartstuff[k_comebacktimer] = comebacktime;
if (player->kartstuff[k_comebackmode] == 2)
{
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
player->kartstuff[k_comebackmode] = 0;
}
}
K_CheckBumpers(); K_CheckBumpers();
} }
player->kartstuff[k_comebacktimer] = comebacktime;
player->kartstuff[k_spinouttype] = 1; player->kartstuff[k_spinouttype] = 1;
player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2); player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2);
@ -2177,6 +2198,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
dust->angle = (ANGLE_180/16) * i; dust->angle = (ANGLE_180/16) * i;
P_SetScale(dust, source->scale); P_SetScale(dust, source->scale);
dust->destscale = source->scale*10; dust->destscale = source->scale*10;
dust->scalespeed = FixedMul(dust->scalespeed, source->scale);
P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale)); P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale));
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
@ -2184,6 +2206,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE);
P_SetScale(truc, source->scale); P_SetScale(truc, source->scale);
truc->destscale = source->scale*6; truc->destscale = source->scale*6;
truc->scalespeed = FixedMul(truc->scalespeed, source->scale);
speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
@ -2199,6 +2222,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE);
P_SetScale(dust, source->scale); P_SetScale(dust, source->scale);
dust->destscale = source->scale*10; dust->destscale = source->scale*10;
dust->scalespeed = FixedMul(dust->scalespeed, source->scale);
dust->tics = 30; dust->tics = 30;
dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT; dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT;
@ -2207,6 +2231,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE);
P_SetScale(truc, source->scale); P_SetScale(truc, source->scale);
truc->destscale = source->scale*5; truc->destscale = source->scale*5;
truc->scalespeed = FixedMul(truc->scalespeed, source->scale);
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
@ -2531,7 +2556,7 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent)
I_Assert(mo != NULL); I_Assert(mo != NULL);
I_Assert(!P_MobjWasRemoved(mo)); I_Assert(!P_MobjWasRemoved(mo));
dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25)<<FRACBITS), mo->y + (P_RandomRange(-25,25)<<FRACBITS), mo->z, MT_WIPEOUTTRAIL); dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25) * mo->scale), mo->y + (P_RandomRange(-25,25) * mo->scale), mo->z, MT_WIPEOUTTRAIL);
P_SetTarget(&dust->target, mo); P_SetTarget(&dust->target, mo);
dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy);
@ -2600,45 +2625,17 @@ void K_DriftDustHandling(mobj_t *spawner)
{ {
dust->z += spawner->height - dust->height; dust->z += spawner->height - dust->height;
} }
dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*FRACUNIT/4); dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*(spawner->scale)/4);
dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*FRACUNIT/4); dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*(spawner->scale)/4);
dust->momz = P_MobjFlip(spawner) * P_RandomRange(1, 4)<<FRACBITS; dust->momz = P_MobjFlip(spawner) * (P_RandomRange(1, 4) * (spawner->scale));
P_SetScale(dust, spawner->scale/2); P_SetScale(dust, spawner->scale/2);
dust->destscale = spawner->scale * 3; dust->destscale = spawner->scale * 3;
dust->scalespeed = FixedMul(dust->scalespeed, spawner->scale);
if (leveltime % 6 == 0) if (leveltime % 6 == 0)
S_StartSound(spawner, sfx_screec); S_StartSound(spawner, sfx_screec);
// Now time for a bunch of flag shit, groooooaann... K_MatchGenericExtraFlags(dust, spawner);
if (spawner->flags2 & MF2_DONTDRAW)
dust->flags2 |= MF2_DONTDRAW;
else
dust->flags2 &= ~MF2_DONTDRAW;
if (spawner->eflags & MFE_VERTICALFLIP)
dust->eflags |= MFE_VERTICALFLIP;
else
dust->eflags &= ~MFE_VERTICALFLIP;
if (spawner->eflags & MFE_DRAWONLYFORP1)
dust->eflags |= MFE_DRAWONLYFORP1;
else
dust->eflags &= ~MFE_DRAWONLYFORP1;
if (spawner->eflags & MFE_DRAWONLYFORP2)
dust->eflags |= MFE_DRAWONLYFORP2;
else
dust->eflags &= ~MFE_DRAWONLYFORP2;
if (spawner->eflags & MFE_DRAWONLYFORP3)
dust->eflags |= MFE_DRAWONLYFORP3;
else
dust->eflags &= ~MFE_DRAWONLYFORP3;
if (spawner->eflags & MFE_DRAWONLYFORP4)
dust->eflags |= MFE_DRAWONLYFORP4;
else
dust->eflags &= ~MFE_DRAWONLYFORP4;
} }
} }
@ -2850,24 +2847,25 @@ static void K_DoThunderShield(player_t *player)
int i = 0; int i = 0;
fixed_t sx; fixed_t sx;
fixed_t sy; fixed_t sy;
angle_t an;
S_StartSound(player->mo, sfx_zio3); S_StartSound(player->mo, sfx_zio3);
//player->kartstuff[k_thunderanim] = 35; //player->kartstuff[k_thunderanim] = 35;
P_NukeEnemies(player->mo, player->mo, RING_DIST/4); P_NukeEnemies(player->mo, player->mo, RING_DIST/4);
// spawn vertical bolt // spawn vertical bolt
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK); mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
P_SetTarget(&mo->target, player->mo); P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_LZIO11); P_SetMobjState(mo, S_LZIO11);
mo->color = SKINCOLOR_TEAL; mo->color = SKINCOLOR_TEAL;
mo->scale = player->mo->scale*3 + (player->mo->scale/2); mo->scale = player->mo->scale*3 + (player->mo->scale/2);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK); mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
P_SetTarget(&mo->target, player->mo); P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_LZIO21); P_SetMobjState(mo, S_LZIO21);
mo->color = SKINCOLOR_CYAN; mo->color = SKINCOLOR_CYAN;
mo->scale = player->mo->scale*3 + (player->mo->scale/2); mo->scale = player->mo->scale*3 + (player->mo->scale/2);
// spawn horizontal bolts; // spawn horizontal bolts;
for (i=0; i<7; i++) for (i=0; i<7; i++)
{ {
@ -2877,9 +2875,9 @@ static void K_DoThunderShield(player_t *player)
P_SetTarget(&mo->target, player->mo); P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_KLIT1); P_SetMobjState(mo, S_KLIT1);
} }
// spawn the radius thing: // spawn the radius thing:
angle_t an = ANGLE_22h; an = ANGLE_22h;
for (i=0; i<15; i++) for (i=0; i<15; i++)
{ {
sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT)); sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT));
@ -2974,7 +2972,10 @@ void K_DoSneaker(player_t *player, boolean doPFlag)
const fixed_t prevboost = player->kartstuff[k_speedboost]; const fixed_t prevboost = player->kartstuff[k_speedboost];
if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3)
{
S_StartSound(player->mo, sfx_cdfm01); S_StartSound(player->mo, sfx_cdfm01);
K_SpawnDashDustRelease(player);
}
if (!player->kartstuff[k_sneakertimer]) if (!player->kartstuff[k_sneakertimer])
{ {
@ -2985,7 +2986,6 @@ void K_DoSneaker(player_t *player, boolean doPFlag)
} }
player->kartstuff[k_sneakertimer] = sneakertime; player->kartstuff[k_sneakertimer] = sneakertime;
K_SpawnDashDustRelease(player);
if (doPFlag) if (doPFlag)
{ {
@ -3016,7 +3016,7 @@ static void K_DoShrink(player_t *player)
} }
} }
static void K_DoSPB(player_t *victim, player_t *source) static void K_DoSPB(player_t *victim)
{ {
//INT32 i; //INT32 i;
S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG! S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG!
@ -3027,11 +3027,28 @@ static void K_DoSPB(player_t *victim, player_t *source)
P_FlashPal(&players[i], PAL_NUKE, 10); P_FlashPal(&players[i], PAL_NUKE, 10);
}*/ }*/
if (victim->mo && !victim->spectator) if (!victim->mo || !victim->mo->health || victim->spectator)
P_DamageMobj(victim->mo, source->mo, source->mo, 65); return;
{
mobj_t *spbexplode;
if (!victim->kartstuff[k_invincibilitytimer] && !victim->kartstuff[k_growshrinktimer])
{
K_DropHnextList(victim);
K_StripItems(victim);
victim->powers[pw_flashing] = 0;
}
spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION);
if (playeringame[spbplayer] && !players[spbplayer].spectator && players[spbplayer].mo)
P_SetTarget(&spbexplode->target, players[spbplayer].mo);
}
} }
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
{ {
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
@ -3083,8 +3100,8 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
else else
mo->momz = FixedMul(vertispeed, vscale); mo->momz = FixedMul(vertispeed, vscale);
if (!mute) if (sound)
S_StartSound(mo, sfx_kpogos); S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos));
} }
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
@ -3140,7 +3157,7 @@ void K_DropHnextList(player_t *player)
mobj_t *work = player->mo, *nextwork, *dropwork; mobj_t *work = player->mo, *nextwork, *dropwork;
INT32 flip; INT32 flip;
mobjtype_t type; mobjtype_t type;
boolean orbit, ponground; boolean orbit, ponground, dropall = true;
if (!work) if (!work)
return; return;
@ -3180,6 +3197,7 @@ void K_DropHnextList(player_t *player)
break; break;
case MT_SSMINE_SHIELD: case MT_SSMINE_SHIELD:
orbit = false; orbit = false;
dropall = false;
type = MT_SSMINE; type = MT_SSMINE;
break; break;
case MT_FAKESHIELD: case MT_FAKESHIELD:
@ -3258,7 +3276,8 @@ void K_DropHnextList(player_t *player)
player->kartstuff[k_bananadrag] = 0; player->kartstuff[k_bananadrag] = 0;
if (player->kartstuff[k_eggmanheld]) if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0; player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld]) else if (player->kartstuff[k_itemheld]
&& (dropall || (--player->kartstuff[k_itemamount] <= 0)))
{ {
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0; player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE; player->kartstuff[k_itemtype] = KITEM_NONE;
@ -3627,6 +3646,92 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
return wtarg; return wtarg;
} }
// Engine Sounds.
static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
{
const INT32 numsnds = 13;
INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class number
UINT8 volume = 255;
fixed_t volumedampen = 0;
INT32 targetsnd = 0;
INT32 i;
// Silence the engines
if (leveltime < 8 || player->spectator || player->exiting)
{
player->kartstuff[k_enginesnd] = 0; // Reset sound number
return;
}
#if 0
if ((leveltime % 8) != ((player-players) % 8)) // Per-player offset, to make engines sound distinct!
#else
if (leveltime % 8) // .25 seconds of wait time between engine sounds
#endif
return;
if ((leveltime >= starttime-(2*TICRATE) && leveltime <= starttime) || (player->kartstuff[k_respawn] == 1)) // Startup boosts
targetsnd = ((cmd->buttons & BT_ACCELERATE) ? 12 : 0);
else
targetsnd = (((6*cmd->forwardmove)/25) + ((player->speed / mapheaderinfo[gamemap-1]->mobj_scale)/5))/2;
if (targetsnd < 0)
targetsnd = 0;
if (targetsnd > 12)
targetsnd = 12;
if (player->kartstuff[k_enginesnd] < targetsnd)
player->kartstuff[k_enginesnd]++;
if (player->kartstuff[k_enginesnd] > targetsnd)
player->kartstuff[k_enginesnd]--;
if (player->kartstuff[k_enginesnd] < 0)
player->kartstuff[k_enginesnd] = 0;
if (player->kartstuff[k_enginesnd] > 12)
player->kartstuff[k_enginesnd] = 12;
for (i = 0; i < MAXPLAYERS; i++)
{
UINT8 thisvol = 0;
fixed_t dist;
if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting)
continue;
if ((i == displayplayer)
|| (i == secondarydisplayplayer && splitscreen)
|| (i == thirddisplayplayer && splitscreen > 1)
|| (i == fourthdisplayplayer && splitscreen > 2))
{
volumedampen += FRACUNIT; // We already know what this is gonna be, let's not waste our time.
continue;
}
dist = P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x,
player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) / 2;
if (dist > 1536<<FRACBITS)
continue;
else if (dist < 160<<FRACBITS) // engine sounds' approx. range
thisvol = 255;
else
thisvol = (15 * (((160<<FRACBITS) - dist)>>FRACBITS)) / (((1536<<FRACBITS)-(160<<FRACBITS))>>(FRACBITS+4));
if (thisvol == 0)
continue;
volumedampen += (thisvol * 257); // 255 * 257 = FRACUNIT
}
if (volumedampen > FRACUNIT)
volume = FixedDiv(volume<<FRACBITS, volumedampen)>>FRACBITS;
if (volume <= 0) // Might as well
return;
S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume);
}
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c /** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
\param player player object passed from P_PlayerThink \param player player object passed from P_PlayerThink
@ -3637,14 +3742,15 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
{ {
K_UpdateOffroad(player); K_UpdateOffroad(player);
K_UpdateEngineSounds(player, cmd);
K_GetKartBoostPower(player); K_GetKartBoostPower(player);
// Speed lines // Speed lines
if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0) if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0)
{ {
mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36)<<FRACBITS), mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36) * player->mo->scale),
player->mo->y + (P_RandomRange(-36,36)<<FRACBITS), player->mo->y + (P_RandomRange(-36,36) * player->mo->scale),
player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20)<<FRACBITS), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale),
MT_FASTLINE); MT_FASTLINE);
fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
fast->momx = 3*player->mo->momx/4; fast->momx = 3*player->mo->momx/4;
@ -3820,7 +3926,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_deathsentence]) if (player->kartstuff[k_deathsentence])
{ {
if (player->kartstuff[k_deathsentence] == 1) if (player->kartstuff[k_deathsentence] == 1)
K_DoSPB(player, &players[spbplayer]); K_DoSPB(player);
player->kartstuff[k_deathsentence]--; player->kartstuff[k_deathsentence]--;
} }
@ -4113,7 +4219,8 @@ static void K_KartDrift(player_t *player, boolean onground)
&& (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo) && (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo)
&& onground) && onground)
{ {
player->kartstuff[k_driftboost] = 20; if (player->kartstuff[k_driftboost] < 20)
player->kartstuff[k_driftboost] = 20;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
player->kartstuff[k_driftcharge] = 0; player->kartstuff[k_driftcharge] = 0;
@ -4123,7 +4230,8 @@ static void K_KartDrift(player_t *player, boolean onground)
&& player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge] < dsthree
&& onground) && onground)
{ {
player->kartstuff[k_driftboost] = 50; if (player->kartstuff[k_driftboost] < 50)
player->kartstuff[k_driftboost] = 50;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
player->kartstuff[k_driftcharge] = 0; player->kartstuff[k_driftcharge] = 0;
@ -4133,7 +4241,8 @@ static void K_KartDrift(player_t *player, boolean onground)
&& player->kartstuff[k_driftcharge] >= dsthree && player->kartstuff[k_driftcharge] >= dsthree
&& onground) && onground)
{ {
player->kartstuff[k_driftboost] = 125; if (player->kartstuff[k_driftboost] < 125)
player->kartstuff[k_driftboost] = 125;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
player->kartstuff[k_driftcharge] = 0; player->kartstuff[k_driftcharge] = 0;
@ -4235,7 +4344,6 @@ static void K_KartUpdatePosition(player_t *player)
fixed_t oldposition = player->kartstuff[k_position]; fixed_t oldposition = player->kartstuff[k_position];
fixed_t i, ppcd, pncd, ipcd, incd; fixed_t i, ppcd, pncd, ipcd, incd;
fixed_t pmo, imo; fixed_t pmo, imo;
thinker_t *th;
mobj_t *mo; mobj_t *mo;
if (player->spectator || !player->mo) if (player->spectator || !player->mo)
@ -4260,16 +4368,8 @@ static void K_KartUpdatePosition(player_t *player)
player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0; player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0;
// This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now) // This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now)
for (th = thinkercap.next; th != &thinkercap; th = th->next) for (mo = waypointcap; mo != NULL; mo = mo->tracer)
{ {
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo
continue;
mo = (mobj_t *)th;
if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'?
continue;
pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x, pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x,
mo->y - player->mo->y), mo->y - player->mo->y),
mo->z - player->mo->z) / FRACUNIT; mo->z - player->mo->z) / FRACUNIT;
@ -4387,8 +4487,11 @@ void K_StripOther(player_t *player)
player->kartstuff[k_invincibilitytimer] = 0; player->kartstuff[k_invincibilitytimer] = 0;
player->kartstuff[k_growshrinktimer] = 0; player->kartstuff[k_growshrinktimer] = 0;
player->kartstuff[k_eggmanexplode] = 0; if (player->kartstuff[k_eggmanexplode])
player->kartstuff[k_eggmanblame] = 0; {
player->kartstuff[k_eggmanexplode] = 0;
player->kartstuff[k_eggmanblame] = -1;
}
} }
// //
@ -4433,14 +4536,29 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{ {
mobj_t *newitem; mobj_t *newitem;
if (player->kartstuff[k_comebackmode] == 1)
{
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM);
newitem->threshold = 69; // selected "randomly".
}
else
{
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FAKEITEM);
if (player->kartstuff[k_eggmanblame] >= 0
&& player->kartstuff[k_eggmanblame] < MAXPLAYERS
&& playeringame[player->kartstuff[k_eggmanblame]]
&& !players[player->kartstuff[k_eggmanblame]].spectator
&& players[player->kartstuff[k_eggmanblame]].mo)
P_SetTarget(&newitem->target, players[player->kartstuff[k_eggmanblame]].mo);
player->kartstuff[k_eggmanblame] = -1;
}
newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP);
newitem->fuse = 15*TICRATE; // selected randomly.
player->kartstuff[k_comebackmode] = 0; player->kartstuff[k_comebackmode] = 0;
player->kartstuff[k_comebacktimer] = comebacktime; player->kartstuff[k_comebacktimer] = comebacktime;
S_StartSound(player->mo, sfx_s254); S_StartSound(player->mo, sfx_s254);
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM);
newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP);
newitem->fuse = 15*TICRATE; // selected randomly.
newitem->threshold = 69; // selected "randomly".
} }
// Eggman Monitor exploding // Eggman Monitor exploding
else if (player->kartstuff[k_eggmanexplode]) else if (player->kartstuff[k_eggmanexplode])
@ -4775,7 +4893,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
&& !player->kartstuff[k_pogospring]) && !player->kartstuff[k_pogospring])
{ {
K_PlayBoostTaunt(player->mo); K_PlayBoostTaunt(player->mo);
K_DoPogoSpring(player->mo, 32<<FRACBITS, false); K_DoPogoSpring(player->mo, 32<<FRACBITS, 2);
player->kartstuff[k_pogospring] = 1; player->kartstuff[k_pogospring] = 1;
player->kartstuff[k_itemamount]--; player->kartstuff[k_itemamount]--;
} }
@ -5926,7 +6044,7 @@ static void K_drawKartItem(void)
// Quick Eggman numbers // Quick Eggman numbers
if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/)
V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]);
} }
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing)
@ -7222,7 +7340,7 @@ static void K_drawDistributionDebugger(void)
if (stplyr != &players[displayplayer]) // only for p1 if (stplyr != &players[displayplayer]) // only for p1
return; return;
// The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice // The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (!playeringame[i] || players[i].spectator) if (!playeringame[i] || players[i].spectator)

View File

@ -37,7 +37,7 @@ void K_SpawnSparkleTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
void K_DriftDustHandling(mobj_t *spawner); void K_DriftDustHandling(mobj_t *spawner);
void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoSneaker(player_t *player, boolean doPFlag);
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound);
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
void K_UpdateHnextList(player_t *player, boolean clean); void K_UpdateHnextList(player_t *player, boolean clean);
void K_DropHnextList(player_t *player); void K_DropHnextList(player_t *player);

View File

@ -92,9 +92,10 @@ static int lib_print(lua_State *L)
static int lib_chatprint(lua_State *L) static int lib_chatprint(lua_State *L)
{ {
const char *str = luaL_checkstring(L, 1); // retrieve string const char *str = luaL_checkstring(L, 1); // retrieve string
int len;
if (str == NULL) // error if we don't have a string! if (str == NULL) // error if we don't have a string!
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint")); return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
int len = strlen(str); len = strlen(str);
if (len > 255) // string is too long!!! if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
@ -113,19 +114,21 @@ static int lib_chatprintf(lua_State *L)
{ {
int n = lua_gettop(L); /* number of arguments */ int n = lua_gettop(L); /* number of arguments */
player_t *plr; player_t *plr;
const char *str;
int len;
if (n < 2) if (n < 2)
return luaL_error(L, "chatprintf requires at least two arguments: player and text."); return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
if (!plr) if (!plr)
return LUA_ErrInvalid(L, "player_t"); return LUA_ErrInvalid(L, "player_t");
if (plr != &players[consoleplayer]) if (plr != &players[consoleplayer])
return 0; return 0;
const char *str = luaL_checkstring(L, 2); // retrieve string str = luaL_checkstring(L, 2); // retrieve string
if (str == NULL) // error if we don't have a string! if (str == NULL) // error if we don't have a string!
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf")); return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
int len = strlen(str); len = strlen(str);
if (len > 255) // string is too long!!! if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
@ -2231,11 +2234,11 @@ static int lib_kDoPogoSpring(lua_State *L)
{ {
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t vertispeed = luaL_checkfixed(L, 2); fixed_t vertispeed = luaL_checkfixed(L, 2);
boolean mute = luaL_checkboolean(L, 3); UINT8 sound = luaL_checkinteger(L, 3);
NOHUD NOHUD
if (!mo) if (!mo)
return LUA_ErrInvalid(L, "mobj_t"); return LUA_ErrInvalid(L, "mobj_t");
K_DoPogoSpring(mo, vertispeed, mute); K_DoPogoSpring(mo, vertispeed, sound);
return 0; return 0;
} }

View File

@ -327,6 +327,7 @@ static int sector_get(lua_State *L)
{ {
sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
enum sector_e field = luaL_checkoption(L, 2, sector_opt[0], sector_opt); enum sector_e field = luaL_checkoption(L, 2, sector_opt[0], sector_opt);
INT16 i;
if (!sector) if (!sector)
{ {
@ -349,11 +350,23 @@ static int sector_get(lua_State *L)
lua_pushfixed(L, sector->ceilingheight); lua_pushfixed(L, sector->ceilingheight);
return 1; return 1;
case sector_floorpic: // floorpic case sector_floorpic: // floorpic
lua_pushlstring(L, levelflats[sector->floorpic].name, 8); {
levelflat_t *levelflat = &levelflats[sector->floorpic];
for (i = 0; i < 8; i++)
if (!levelflat->name[i])
break;
lua_pushlstring(L, levelflat->name, i);
return 1; return 1;
}
case sector_ceilingpic: // ceilingpic case sector_ceilingpic: // ceilingpic
lua_pushlstring(L, levelflats[sector->ceilingpic].name, 8); {
levelflat_t *levelflat = &levelflats[sector->ceilingpic];
for (i = 0; i < 8; i++)
if (!levelflat->name[i])
break;
lua_pushlstring(L, levelflat->name, i);
return 1; return 1;
}
case sector_lightlevel: case sector_lightlevel:
lua_pushinteger(L, sector->lightlevel); lua_pushinteger(L, sector->lightlevel);
return 1; return 1;

View File

@ -182,19 +182,21 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump)
{ {
MYFILE f; MYFILE f;
char *name; char *name;
size_t len;
f.wad = wad; f.wad = wad;
f.size = W_LumpLengthPwad(wad, lump); f.size = W_LumpLengthPwad(wad, lump);
f.data = Z_Malloc(f.size, PU_LUA, NULL); f.data = Z_Malloc(f.size, PU_LUA, NULL);
W_ReadLumpPwad(wad, lump, f.data); W_ReadLumpPwad(wad, lump, f.data);
f.curpos = f.data; f.curpos = f.data;
name = malloc(strlen(wadfiles[wad]->filename)+10); len = strlen(wadfiles[wad]->filename);
name = malloc(len+10);
strcpy(name, wadfiles[wad]->filename); strcpy(name, wadfiles[wad]->filename);
if (!fasticmp(&name[strlen(name) - 4], ".lua")) { if (!fasticmp(&name[len - 4], ".lua")) {
// If it's not a .lua file, copy the lump name in too. // If it's not a .lua file, copy the lump name in too.
name[strlen(wadfiles[wad]->filename)] = '|'; name[len] = '|';
M_Memcpy(name+strlen(wadfiles[wad]->filename)+1, wadfiles[wad]->lumpinfo[lump].name, 8); M_Memcpy(name+len+1, wadfiles[wad]->lumpinfo[lump].name, 8);
name[strlen(wadfiles[wad]->filename)+9] = '\0'; name[len+9] = '\0';
} }
LUA_LoadFile(&f, name); LUA_LoadFile(&f, name);

View File

@ -492,7 +492,9 @@ static void GIF_framewrite(void)
// screen regions are handled in GIF_lzw // screen regions are handled in GIF_lzw
{ {
UINT16 delay = 3; // todo int d1 = (int)((100.0/NEWTICRATE)*(gif_frames+1));
int d2 = (int)((100.0/NEWTICRATE)*(gif_frames));
UINT16 delay = d1-d2;
INT32 startline; INT32 startline;
WRITEMEM(p, gifframe_gchead, 4); WRITEMEM(p, gifframe_gchead, 4);

View File

@ -377,7 +377,7 @@ void Command_Hurtme_f(void)
} }
// Moves the NiGHTS player to another axis within the current mare // Moves the NiGHTS player to another axis within the current mare
void Command_JumpToAxis_f(void) /*void Command_JumpToAxis_f(void)
{ {
REQUIRE_DEVMODE; REQUIRE_DEVMODE;
REQUIRE_INLEVEL; REQUIRE_INLEVEL;
@ -438,7 +438,7 @@ void Command_Charspeed_f(void)
players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS; players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS;
else else
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n")); CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
} }*/
void Command_RTeleport_f(void) void Command_RTeleport_f(void)
{ {
@ -683,7 +683,7 @@ void Command_Savecheckpoint_f(void)
} }
// Like M_GetAllEmeralds() but for console devmode junkies. // Like M_GetAllEmeralds() but for console devmode junkies.
void Command_Getallemeralds_f(void) /*void Command_Getallemeralds_f(void)
{ {
REQUIRE_SINGLEPLAYER; REQUIRE_SINGLEPLAYER;
REQUIRE_NOULTIMATE; REQUIRE_NOULTIMATE;
@ -702,7 +702,7 @@ void Command_Resetemeralds_f(void)
emeralds = 0; emeralds = 0;
CONS_Printf(M_GetText("Emeralds reset to zero.\n")); CONS_Printf(M_GetText("Emeralds reset to zero.\n"));
} }*/
void Command_Devmode_f(void) void Command_Devmode_f(void)
{ {
@ -730,7 +730,7 @@ void Command_Devmode_f(void)
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);
} }
void Command_Setrings_f(void) /*void Command_Setrings_f(void)
{ {
REQUIRE_INLEVEL; REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER; REQUIRE_SINGLEPLAYER;
@ -785,7 +785,7 @@ void Command_Setcontinues_f(void)
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);
} }
} }*/
// //
// OBJECTPLACE (and related variables) // OBJECTPLACE (and related variables)

View File

@ -48,18 +48,18 @@ void Command_CheatNoClip_f(void);
void Command_CheatGod_f(void); void Command_CheatGod_f(void);
void Command_CheatNoTarget_f(void); void Command_CheatNoTarget_f(void);
void Command_Savecheckpoint_f(void); void Command_Savecheckpoint_f(void);
void Command_Getallemeralds_f(void); /*void Command_Getallemeralds_f(void);
void Command_Resetemeralds_f(void); void Command_Resetemeralds_f(void);
void Command_Setrings_f(void); void Command_Setrings_f(void);
void Command_Setlives_f(void); void Command_Setlives_f(void);
void Command_Setcontinues_f(void); void Command_Setcontinues_f(void);*/
void Command_Devmode_f(void); void Command_Devmode_f(void);
void Command_Scale_f(void); void Command_Scale_f(void);
void Command_Gravflip_f(void); void Command_Gravflip_f(void);
void Command_Hurtme_f(void); void Command_Hurtme_f(void);
void Command_JumpToAxis_f(void); /*void Command_JumpToAxis_f(void);
void Command_Charability_f(void); void Command_Charability_f(void);
void Command_Charspeed_f(void); void Command_Charspeed_f(void);*/
void Command_Teleport_f(void); void Command_Teleport_f(void);
void Command_RTeleport_f(void); void Command_RTeleport_f(void);
void Command_Skynum_f(void); void Command_Skynum_f(void);

View File

@ -102,8 +102,9 @@ unlockable_t unlockables[MAXUNLOCKABLES] =
/* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, /* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0},
/* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, /* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0},
/* 05 */ {"Hell Attack", "", 5, 5, SECRET_HELLATTACK, 0, false, false, 0},
/* 05 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, /* 06 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0},
}; };
// Default number of emblems and extra emblems // Default number of emblems and extra emblems
@ -127,10 +128,13 @@ void M_SetupDefaultConditionSets(void)
M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 30, 0, 0); M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 30, 0, 0);
M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0); M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0);
// -- 4: Collect 50 emblems OR play 150 matches // -- 4: Collect 40 emblems OR play 150 matches
M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 50, 0, 0); M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 40, 0, 0);
M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0); M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0);
// -- 5: Collect 50 emblems ONLY
M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 50, 0, 0);
// -- 10: Play 100 matches // -- 10: Play 100 matches
M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 100, 0, 0); M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 100, 0, 0);
} }

View File

@ -125,6 +125,7 @@ typedef struct
#define SECRET_SOUNDTEST 3 // Sound Test #define SECRET_SOUNDTEST 3 // Sound Test
#define SECRET_CREDITS 4 // Enables Credits #define SECRET_CREDITS 4 // Enables Credits
#define SECRET_ENCORE 5 // Enables Encore mode cvar #define SECRET_ENCORE 5 // Enables Encore mode cvar
#define SECRET_HELLATTACK 6 // Map Hell in record attack
// If you have more secrets than these variables allow in your game, // If you have more secrets than these variables allow in your game,
// you seriously need to get a life. // you seriously need to get a life.

View File

@ -288,8 +288,7 @@ static void M_SetupMultiPlayer4(INT32 choice);
// Options // Options
// Split into multiple parts due to size // Split into multiple parts due to size
// Controls // Controls
menu_t OP_ControlsDef, /*OP_ControlListDef,*/ OP_MoveControlsDef; menu_t OP_ControlsDef, OP_AllControlsDef;
menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef, OP_SpectateControlsDef;
menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef;
menu_t OP_Joystick1Def, OP_Joystick2Def; menu_t OP_Joystick1Def, OP_Joystick2Def;
#ifndef NOFOURPLAYER #ifndef NOFOURPLAYER
@ -663,7 +662,8 @@ static menuitem_t MISC_HelpMenu[] =
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 0}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL99", M_HandleImageDef, 0},
}; };
// -------------------------------- // --------------------------------
@ -1112,88 +1112,47 @@ static menuitem_t OP_ControlsMenu[] =
#endif #endif
}; };
static menuitem_t OP_MoveControlsMenu[] = static menuitem_t OP_AllControlsMenu[] =
{ {
{IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, {IT_SUBMENU|IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 0},
{IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, //{IT_SPACE, NULL, NULL, NULL, 0},
{IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright }, {IT_HEADER, NULL, "Gameplay Controls", NULL, 0},
{IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift }, {IT_SPACE, NULL, NULL, NULL, 0},
{IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake }, {IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate },
{IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, {IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft },
{IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, {IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright },
{IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, {IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift },
{IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback }, {IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake },
{IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire },
{IT_SPACE, NULL, "", NULL, 76}, {IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward },
{IT_CONTROL, NULL, "Talk key", M_ChangeControl, gc_talkkey }, {IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward},
//{IT_CONTROL, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, {IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback },
{IT_CONTROL, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, {IT_HEADER, NULL, "Miscelleanous Controls", NULL, 0},
{IT_CONTROL, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu}, {IT_SPACE, NULL, NULL, NULL, 0},
{IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause }, {IT_CONTROL, NULL, "Chat", M_ChangeControl, gc_talkkey },
{IT_CONTROL, NULL, "Console", M_ChangeControl, gc_console }, //{IT_CONTROL, NULL, "Team Chat", M_ChangeControl, gc_teamkey },
{IT_CONTROL, NULL, "Show Rankings", M_ChangeControl, gc_scores },
{IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 120}, {IT_CONTROL, NULL, "Change Viewpoint", M_ChangeControl, gc_viewpoint },
{IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 128}, {IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset },
{IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 136}, {IT_CONTROL, NULL, "Toggle First-Person", M_ChangeControl, gc_camtoggle },
{IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause },
{IT_CONTROL, NULL, "Screenshot", M_ChangeControl, gc_screenshot },
{IT_CONTROL, NULL, "Toggle GIF Recording", M_ChangeControl, gc_recordgif },
{IT_CONTROL, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu },
{IT_CONTROL, NULL, "Developer Console", M_ChangeControl, gc_console },
{IT_HEADER, NULL, "Spectator Controls", NULL, 0},
{IT_SPACE, NULL, NULL, NULL, 0},
{IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate },
{IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup },
{IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown },
{IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview },
{IT_HEADER, NULL, "Custom Lua Actions", NULL, 0},
{IT_SPACE, NULL, NULL, NULL, 0},
{IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 },
{IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 },
{IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 },
}; };
static menuitem_t OP_SpectateControlsMenu[] =
{
{IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate },
{IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup },
{IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown },
{IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview},
{IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset },
{IT_CONTROL, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle },
{IT_STRING | IT_CVAR, NULL, "Chasecam" , &cv_chasecam , 52},
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 60},
};
static menuitem_t OP_CustomControlsMenu[] =
{
{IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1},
{IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2},
{IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3},
};
// Obsolete thanks to Kart
/*static menuitem_t OP_MPControlsMenu[] =
{
// {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_driftleft },
// {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_driftright },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 1", M_ChangeControl, gc_wepslot1 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 2", M_ChangeControl, gc_wepslot2 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 3", M_ChangeControl, gc_wepslot3 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 4", M_ChangeControl, gc_wepslot4 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 5", M_ChangeControl, gc_wepslot5 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 6", M_ChangeControl, gc_wepslot6 },
// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 7", M_ChangeControl, gc_wepslot7 },
};
static menuitem_t OP_CameraControlsMenu[] =
{
// {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup },
// {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown },
// {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview },
// {IT_CALL | IT_STRING2, NULL, "Mouselook", M_ChangeControl, gc_mouseaiming },
};
static menuitem_t OP_MiscControlsMenu[] =
{
{IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 },
{IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 },
{IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 },
{IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause },
{IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console },
{IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey },
{IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey },
{IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores },
{IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate },
};*/
static menuitem_t OP_Joystick1Menu[] = static menuitem_t OP_Joystick1Menu[] =
{ {
{IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu, 10}, {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu, 10},
@ -1296,14 +1255,14 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 45}, {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 45},
//{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 55}, //{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 55},
{IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55}, {IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55},
{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65}, //{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65},
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 75}, {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 65},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90}, {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 80},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100}, {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 90},
#ifdef HWRENDER #ifdef HWRENDER
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 115}, {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 105},
#endif #endif
}; };
@ -1316,7 +1275,7 @@ enum
op_video_gamma, op_video_gamma,
op_video_dd, op_video_dd,
op_video_wdd, op_video_wdd,
op_video_wd, //op_video_wd,
op_video_skybox, op_video_skybox,
op_video_fps, op_video_fps,
op_video_vsync, op_video_vsync,
@ -1536,7 +1495,9 @@ static menuitem_t OP_ServerOptionsMenu[] =
#ifndef NONET #ifndef NONET
{IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90},
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100},
//{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, #ifdef VANILLAJOINNEXTROUND
{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110},
#endif
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110}, {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110},
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120}, {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120},
@ -1950,28 +1911,12 @@ menu_t OP_MainDef =
}; };
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
//menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDef); menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 60, 30);
//menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef); menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 60, 30);
//menu_t OP_CameraControlsDef = CONTROLMENUSTYLE(OP_CameraControlsMenu, &OP_ControlListDef);
//menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef);
menu_t OP_CustomControlsDef = CONTROLMENUSTYLE(OP_CustomControlsMenu, &OP_MoveControlsDef);
menu_t OP_SpectateControlsDef = CONTROLMENUSTYLE(OP_SpectateControlsMenu, &OP_MoveControlsDef);
/*
menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30);
menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30);
#ifndef NOFOURPLAYER #ifndef NOFOURPLAYER
menu_t OP_P3ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P3ControlsMenu, &OP_ControlsDef, 60, 30); menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 60, 30);
menu_t OP_P4ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P4ControlsMenu, &OP_ControlsDef, 60, 30); menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 60, 30);
#endif
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30);
menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30);
*/
menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_MoveControlsDef, 60, 30);
menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_MoveControlsDef, 60, 30);
#ifndef NOFOURPLAYER
menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_MoveControlsDef, 60, 30);
menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_MoveControlsDef, 60, 30);
#endif #endif
menu_t OP_JoystickSetDef = menu_t OP_JoystickSetDef =
{ {
@ -2547,7 +2492,7 @@ boolean M_Responder(event_t *ev)
if (ch == -1) if (ch == -1)
return false; return false;
else if (ch == gamecontrol[gc_systemmenu][0]) // allow remappable ESC key else if (ch == gamecontrol[gc_systemmenu][0] || ch == gamecontrol[gc_systemmenu][1]) // allow remappable ESC key
ch = KEY_ESCAPE; ch = KEY_ESCAPE;
// F-Keys // F-Keys
@ -2795,6 +2740,7 @@ boolean M_Responder(event_t *ev)
{ {
// detach any keys associated with the game control // detach any keys associated with the game control
G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].alphaKey); G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].alphaKey);
S_StartSound(NULL, sfx_shldls);
return true; return true;
} }
@ -3965,7 +3911,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
if (M_MapLocked(mapnum+1)) if (M_MapLocked(mapnum+1))
return false; // not unlocked return false; // not unlocked
if (gt == GT_COOP && (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)) /*if (gt == GT_COOP && (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP))
return true; return true;
if (gt == GT_COMPETITION && (mapheaderinfo[mapnum]->typeoflevel & TOL_COMPETITION)) if (gt == GT_COMPETITION && (mapheaderinfo[mapnum]->typeoflevel & TOL_COMPETITION))
@ -3974,10 +3920,10 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
if (gt == GT_CTF && (mapheaderinfo[mapnum]->typeoflevel & TOL_CTF)) if (gt == GT_CTF && (mapheaderinfo[mapnum]->typeoflevel & TOL_CTF))
return true; return true;
if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
return true;
if ((gt == GT_TAG || gt == GT_HIDEANDSEEK) && (mapheaderinfo[mapnum]->typeoflevel & TOL_TAG)) if ((gt == GT_TAG || gt == GT_HIDEANDSEEK) && (mapheaderinfo[mapnum]->typeoflevel & TOL_TAG))
return true;*/
if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
return true; return true;
if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
@ -3985,29 +3931,38 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
return false; return false;
case LLM_LEVELSELECT: /*case LLM_LEVELSELECT:
if (mapheaderinfo[mapnum]->levelselect != maplistoption) if (mapheaderinfo[mapnum]->levelselect != maplistoption)
return false; return false;
if (M_MapLocked(mapnum+1)) if (M_MapLocked(mapnum+1))
return false; // not unlocked return false; // not unlocked
return true; return true;*/
case LLM_RECORDATTACK: case LLM_RECORDATTACK:
if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK)) /*if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK))
return false;*/
if (!(mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
return false; return false;
if (M_MapLocked(mapnum+1)) if (M_MapLocked(mapnum+1))
return false; // not unlocked return false; // not unlocked
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED) if (M_SecretUnlocked(SECRET_HELLATTACK))
return true; // now you're in hell
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU)
return false; // map hell
/*if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
return true; return true;
if (!mapvisited[mapnum]) if (!mapvisited[mapnum])
return false; return false;*/
return true; return true;
case LLM_NIGHTSATTACK: /*case LLM_NIGHTSATTACK:
if (!(mapheaderinfo[mapnum]->menuflags & LF2_NIGHTSATTACK)) if (!(mapheaderinfo[mapnum]->menuflags & LF2_NIGHTSATTACK))
return false; return false;
@ -4020,7 +3975,9 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
if (!mapvisited[mapnum]) if (!mapvisited[mapnum])
return false; return false;
return true; return true;*/
default:
return false;
} }
// Hmm? Couldn't decide? // Hmm? Couldn't decide?
@ -4264,7 +4221,7 @@ static void M_DrawImageDef(void)
else else
{ {
patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE);
if (patch->width <= BASEVIDWIDTH) if (patch->height <= BASEVIDHEIGHT)
V_DrawScaledPatch(0,0,0,patch); V_DrawScaledPatch(0,0,0,patch);
else else
V_DrawSmallScaledPatch(0,0,0,patch); V_DrawSmallScaledPatch(0,0,0,patch);
@ -8468,19 +8425,28 @@ static void M_Setup1PControlsMenu(INT32 choice)
setupcontrols = gamecontrol; // was called from main Options (for console player, then) setupcontrols = gamecontrol; // was called from main Options (for console player, then)
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
// Set proper gamepad options
OP_AllControlsMenu[0].itemaction = &OP_Joystick1Def;
// Unhide P1-only controls // Unhide P1-only controls
OP_MoveControlsMenu[10].status = IT_CONTROL; // Talk OP_AllControlsMenu[14].status = IT_CONTROL; // Chat
//OP_MoveControlsMenu[11].status = IT_CONTROL; // Team-talk //OP_AllControlsMenu[15].status = IT_CONTROL; // Team-chat
OP_MoveControlsMenu[11].status = IT_CONTROL; // Rankings OP_AllControlsMenu[15].status = IT_CONTROL; // Rankings
OP_MoveControlsMenu[12].status = IT_CONTROL; // Pause OP_AllControlsMenu[16].status = IT_CONTROL; // Viewpoint
OP_MoveControlsMenu[13].status = IT_CONTROL; // Console // 17 is Reset Camera, 18 is Toggle Chasecam
OP_MoveControlsMenu[14].itemaction = &OP_Joystick1Def; // Gamepad OP_AllControlsMenu[19].status = IT_CONTROL; // Pause
OP_AllControlsMenu[20].status = IT_CONTROL; // Screenshot
OP_AllControlsMenu[21].status = IT_CONTROL; // GIF
OP_AllControlsMenu[22].status = IT_CONTROL; // System Menu
OP_AllControlsMenu[23].status = IT_CONTROL; // Console
OP_AllControlsMenu[24].status = IT_HEADER; // Spectator Controls header
OP_AllControlsMenu[25].status = IT_SPACE; // Spectator Controls space
OP_AllControlsMenu[26].status = IT_CONTROL; // Spectate
OP_AllControlsMenu[27].status = IT_CONTROL; // Look Up
OP_AllControlsMenu[28].status = IT_CONTROL; // Look Down
OP_AllControlsMenu[29].status = IT_CONTROL; // Center View
// Set cvars M_SetupNextMenu(&OP_AllControlsDef);
OP_SpectateControlsMenu[6].itemaction = &cv_chasecam; // Chasecam
OP_SpectateControlsMenu[7].itemaction = &cv_crosshair; // Crosshair
M_SetupNextMenu(&OP_MoveControlsDef);
} }
static void M_Setup2PControlsMenu(INT32 choice) static void M_Setup2PControlsMenu(INT32 choice)
@ -8491,19 +8457,28 @@ static void M_Setup2PControlsMenu(INT32 choice)
setupcontrols = gamecontrolbis; setupcontrols = gamecontrolbis;
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
// Set proper gamepad options
OP_AllControlsMenu[0].itemaction = &OP_Joystick2Def;
// Hide P1-only controls // Hide P1-only controls
OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat
//OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat
OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings
OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint
OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console // 17 is Reset Camera, 18 is Toggle Chasecam
OP_MoveControlsMenu[14].itemaction = &OP_Joystick2Def; // Gamepad OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause
OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot
OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF
OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu
OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console
OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header
OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space
OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate
OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up
OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down
OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View
// Set cvars M_SetupNextMenu(&OP_AllControlsDef);
OP_SpectateControlsMenu[6].itemaction = &cv_chasecam2; // Chasecam
OP_SpectateControlsMenu[7].itemaction = &cv_crosshair2; // Crosshair
M_SetupNextMenu(&OP_MoveControlsDef);
} }
#ifndef NOFOURPLAYER #ifndef NOFOURPLAYER
@ -8515,19 +8490,28 @@ static void M_Setup3PControlsMenu(INT32 choice)
setupcontrols = gamecontrol3; setupcontrols = gamecontrol3;
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
// Set proper gamepad options
OP_AllControlsMenu[0].itemaction = &OP_Joystick3Def;
// Hide P1-only controls // Hide P1-only controls
OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat
//OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat
OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings
OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint
OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console // 17 is Reset Camera, 18 is Toggle Chasecam
OP_MoveControlsMenu[14].itemaction = &OP_Joystick3Def; // Gamepad OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause
OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot
OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF
OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu
OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console
OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header
OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space
OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate
OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up
OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down
OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View
// Set cvars M_SetupNextMenu(&OP_AllControlsDef);
OP_SpectateControlsMenu[6].itemaction = &cv_chasecam3; // Chasecam
OP_SpectateControlsMenu[7].itemaction = &cv_crosshair3; // Crosshair
M_SetupNextMenu(&OP_MoveControlsDef);
} }
static void M_Setup4PControlsMenu(INT32 choice) static void M_Setup4PControlsMenu(INT32 choice)
@ -8538,82 +8522,147 @@ static void M_Setup4PControlsMenu(INT32 choice)
setupcontrols = gamecontrol4; setupcontrols = gamecontrol4;
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
// Set proper gamepad options
OP_AllControlsMenu[0].itemaction = &OP_Joystick4Def;
// Hide P1-only controls // Hide P1-only controls
OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat
//OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat
OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings
OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint
OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console // 17 is Reset Camera, 18 is Toggle Chasecam
OP_MoveControlsMenu[14].itemaction = &OP_Joystick4Def; // Gamepad OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause
OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot
OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF
OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu
OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console
OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header
OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space
OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate
OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up
OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down
OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View
// Set cvars M_SetupNextMenu(&OP_AllControlsDef);
OP_SpectateControlsMenu[6].itemaction = &cv_chasecam4; // Chasecam
OP_SpectateControlsMenu[7].itemaction = &cv_crosshair4; // Crosshair
M_SetupNextMenu(&OP_MoveControlsDef);
} }
#endif #endif
#define controlheight 18
// Draws the Customise Controls menu // Draws the Customise Controls menu
static void M_DrawControl(void) static void M_DrawControl(void)
{ {
char tmp[50]; char tmp[50];
INT32 i, y; INT32 x, y, i, max, cursory = 0, iter;
INT32 keys[2]; INT32 keys[2];
const char *ctrl;
// draw title, strings and submenu
M_DrawGenericMenu();
if (setupcontrols_secondaryplayer)
ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""SECONDARY PLAYER";
else if (setupcontrols_thirdplayer)
ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""THIRD PLAYER";
else if (setupcontrols_fourthplayer)
ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""FOURTH PLAYER";
else
ctrl = "\x86""PRESS ""\x82""ENTER""\x86"" TO CHANGE, ""\x82""BACKSPACE""\x86"" TO CLEAR";
M_CentreText(28, ctrl);
x = currentMenu->x;
y = currentMenu->y; y = currentMenu->y;
for (i = 0; i < currentMenu->numitems;i++) /*i = itemOn - (controlheight/2);
if (i < 0)
i = 0;
*/
iter = (controlheight/2);
for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--)
{ {
if (currentMenu->menuitems[i].status != IT_CONTROL) if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2)
{ iter--;
y = currentMenu->y+currentMenu->menuitems[i].alphaKey; }
continue; if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2)
} i--;
if (currentMenu->menuitems[i].status != IT_CONTROL)
continue;
keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; iter += (controlheight/2);
keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; for (max = itemOn; (iter && max < currentMenu->numitems); max++)
{
if (currentMenu->menuitems[max].status != IT_GRAYEDOUT2)
iter--;
}
tmp[0] ='\0'; if (iter)
if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) {
iter += (controlheight/2);
for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--)
{ {
strcpy(tmp, "---"); if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2)
iter--;
} }
}
/*max = i + controlheight;
if (max > currentMenu->numitems)
{
max = currentMenu->numitems;
if (max < controlheight)
i = 0;
else else
i = max - controlheight;
}*/
// draw title (or big pic)
M_DrawMenuTitle();
M_CentreText(28,
(setupcontrols_fourthplayer ? "\x86""Set controls for ""\x82""Player 4" :
(setupcontrols_thirdplayer ? "\x86""Set controls for ""\x82""Player 3" :
(setupcontrols_secondaryplayer ? "\x86""Set controls for ""\x82""Player 2" :
"\x86""Press ""\x82""ENTER""\x86"" to change, ""\x82""BACKSPACE""\x86"" to clear"))));
if (i)
V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), highlightflags, "\x1A"); // up arrow
if (max != currentMenu->numitems)
V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(controlheight-1))+(skullAnimCounter/5), highlightflags, "\x1B"); // down arrow
for (; i < max; i++)
{
if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2)
continue;
if (i == itemOn)
cursory = y;
if (currentMenu->menuitems[i].status == IT_CONTROL)
{ {
if (keys[0] != KEY_NULL) V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text);
strcat (tmp, G_KeynumToString (keys[0])); keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0];
keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1];
if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) tmp[0] ='\0';
strcat(tmp," or "); if (keys[0] == KEY_NULL && keys[1] == KEY_NULL)
{
strcpy(tmp, "---");
}
else
{
if (keys[0] != KEY_NULL)
strcat (tmp, G_KeynumToString (keys[0]));
if (keys[1] != KEY_NULL) if (keys[0] != KEY_NULL && keys[1] != KEY_NULL)
strcat (tmp, G_KeynumToString (keys[1])); strcat(tmp,", ");
if (keys[1] != KEY_NULL)
strcat (tmp, G_KeynumToString (keys[1]));
}
V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp);
} }
V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp); /*else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2)
V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);*/
else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1))
V_DrawString(19, y+6, highlightflags, currentMenu->menuitems[i].text);
else if (currentMenu->menuitems[i].status & IT_STRING)
V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT; y += SMALLLINEHEIGHT;
} }
V_DrawScaledPatch(currentMenu->x - 20, cursory, 0,
W_CachePatchName("M_CURSOR", PU_CACHE));
} }
#undef controlheight
static INT32 controltochange; static INT32 controltochange;
static void M_ChangecontrolResponse(event_t *ev) static void M_ChangecontrolResponse(event_t *ev)
@ -8673,23 +8722,22 @@ static void M_ChangecontrolResponse(event_t *ev)
setupcontrols[control][found] = ch-KEY_4JOY1+KEY_DBL4JOY1; setupcontrols[control][found] = ch-KEY_4JOY1+KEY_DBL4JOY1;
} }
else else
{ {
// check if change key1 or key2, or replace the two by the new // check if change key1 or key2, or shuffle them along in a queue
found = 0; found = 0;
if (setupcontrols[control][0] == KEY_NULL) if (setupcontrols[control][0] != KEY_NULL)
found++; {
if (setupcontrols[control][1] == KEY_NULL) found++;
found++; if (setupcontrols[control][1] != KEY_NULL)
if (found == 2) setupcontrols[control][0] = setupcontrols[control][1];
{ }
found = 0; G_CheckDoubleUsage(ch);
setupcontrols[control][1] = KEY_NULL; //replace key 1,clear key2 setupcontrols[control][found] = ch;
} }
G_CheckDoubleUsage(ch); S_StartSound(NULL, sfx_strpst);
setupcontrols[control][found] = ch;
}
} }
else
S_StartSound(NULL, sfx_skid);
M_StopMessage(0); M_StopMessage(0);
} }

View File

@ -1480,9 +1480,13 @@ boolean M_ScreenshotResponder(event_t *ev)
return false; return false;
ch = ev->data1; ch = ev->data1;
if (ch == KEY_F8)
if (ch >= KEY_MOUSE1 && menuactive) // If it's not a keyboard key, then don't allow it in the menus!
return false;
if (ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8
M_ScreenShot(); M_ScreenShot();
else if (ch == KEY_F9) else if (ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9
((moviemode) ? M_StopMovie : M_StartMovie)(); ((moviemode) ? M_StopMovie : M_StartMovie)();
else else
return false; return false;

View File

@ -21,13 +21,14 @@ void I_ShutdownSound(void){}
// SFX I/O // SFX I/O
// //
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel)
{ {
(void)id; (void)id;
(void)vol; (void)vol;
(void)sep; (void)sep;
(void)pitch; (void)pitch;
(void)priority; (void)priority;
(void)channel;
return -1; return -1;
} }

View File

@ -32,7 +32,7 @@ boolean highcolor = false;
boolean allow_fullscreen = false; boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void) void I_StartupGraphics(void)
{ {

View File

@ -3913,15 +3913,25 @@ void A_ThrownRing(mobj_t *actor)
//{ SRB2kart - A_GRENADERING //{ SRB2kart - A_GRENADERING
static mobj_t *grenade; static mobj_t *grenade;
static fixed_t explodedist;
static inline boolean PIT_GrenadeRing(mobj_t *thing) static inline boolean PIT_GrenadeRing(mobj_t *thing)
{ {
if (!grenade) if (!grenade)
return true; return false;
if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player. if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player.
return true; return true;
if (!(thing->flags & MF_SHOOTABLE))
{
// didn't do any damage
return true;
}
if (netgame && thing->player && thing->player->spectator)
return true;
if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner. if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner.
return true; return true;
@ -3935,22 +3945,13 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
return true; return true;
// see if it went over / under // see if it went over / under
if (grenade->z - grenade->info->painchance > thing->z + thing->height) if (grenade->z - explodedist > thing->z + thing->height)
return true; // overhead return true; // overhead
if (grenade->z + grenade->height + grenade->info->painchance < thing->z) if (grenade->z + grenade->height + explodedist < thing->z)
return true; // underneath return true; // underneath
if (netgame && thing->player && thing->player->spectator)
return true;
if (!(thing->flags & MF_SHOOTABLE))
{
// didn't do any damage
return true;
}
if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y),
thing->z - grenade->z) > grenade->info->painchance) thing->z - grenade->z) > explodedist)
return true; // Too far away return true; // Too far away
// Explode! // Explode!
@ -3961,7 +3962,11 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
void A_GrenadeRing(mobj_t *actor) void A_GrenadeRing(mobj_t *actor)
{ {
INT32 bx, by, xl, xh, yl, yh; INT32 bx, by, xl, xh, yl, yh;
const fixed_t explodedist = actor->info->painchance; explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
#ifdef HAVE_BLUA
if (LUA_CallAction("A_GrenadeRing", actor))
return;
#endif
if (leveltime % 35 == 0) if (leveltime % 35 == 0)
S_StartSound(actor, actor->info->activesound); S_StartSound(actor, actor->info->activesound);
@ -3978,6 +3983,80 @@ void A_GrenadeRing(mobj_t *actor)
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
P_BlockThingsIterator(bx, by, PIT_GrenadeRing); P_BlockThingsIterator(bx, by, PIT_GrenadeRing);
} }
static inline boolean PIT_MineExplode(mobj_t *thing)
{
if (!grenade || P_MobjWasRemoved(grenade))
return false; // There's the possibility these can chain react onto themselves after they've already died if there are enough all in one spot
if (thing == grenade || thing->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
return true;
if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY))
return true;
if (netgame && thing->player && thing->player->spectator)
return true;
if (G_BattleGametype() && grenade->target && grenade->target->player && grenade->target->player->kartstuff[k_bumper] <= 0 && thing == grenade->target)
return true;
// see if it went over / under
if (grenade->z - explodedist > thing->z + thing->height)
return true; // overhead
if (grenade->z + grenade->height + explodedist < thing->z)
return true; // underneath
if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y),
thing->z - grenade->z) > explodedist)
return true; // Too far away
grenade->flags2 |= MF2_DEBRIS;
if (thing->player) // Looks like we're going to have to need a seperate function for this too
K_ExplodePlayer(thing->player, grenade->target);
else
P_DamageMobj(thing, grenade, grenade->target, 1);
return true;
}
void A_MineExplode(mobj_t *actor)
{
INT32 bx, by, xl, xh, yl, yh;
explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
INT32 d;
INT32 locvar1 = var1;
mobjtype_t type;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_MineExplode", actor))
return;
#endif
type = (mobjtype_t)locvar1;
// Use blockmap to check for nearby shootables
yh = (unsigned)(actor->y + explodedist - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(actor->y - explodedist - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(actor->x + explodedist - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(actor->x - explodedist - bmaporgx)>>MAPBLOCKSHIFT;
grenade = actor;
for (by = yl; by <= yh; by++)
for (bx = xl; bx <= xh; bx++)
P_BlockThingsIterator(bx, by, PIT_MineExplode);
for (d = 0; d < 16; d++)
K_SpawnKartExplosion(actor->x, actor->y, actor->z, explodedist + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
if (actor->target && actor->target->player)
K_SpawnMineExplosion(actor, actor->target->player->skincolor);
else
K_SpawnMineExplosion(actor, SKINCOLOR_RED);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND);
}
//} //}
// Function: A_SetSolidSteam // Function: A_SetSolidSteam
@ -8240,6 +8319,7 @@ void A_JawzExplode(mobj_t *actor)
return; return;
} }
/* old A_MineExplode - see elsewhere in the file
void A_MineExplode(mobj_t *actor) void A_MineExplode(mobj_t *actor)
{ {
mobj_t *mo2; mobj_t *mo2;
@ -8247,12 +8327,14 @@ void A_MineExplode(mobj_t *actor)
INT32 d; INT32 d;
INT32 locvar1 = var1; INT32 locvar1 = var1;
mobjtype_t type; mobjtype_t type;
fixed_t range;
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
if (LUA_CallAction("A_MineExplode", actor)) if (LUA_CallAction("A_MineExplode", actor))
return; return;
#endif #endif
type = (mobjtype_t)locvar1; type = (mobjtype_t)locvar1;
range = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
for (th = thinkercap.next; th != &thinkercap; th = th->next) for (th = thinkercap.next; th != &thinkercap; th = th->next)
{ {
@ -8267,27 +8349,25 @@ void A_MineExplode(mobj_t *actor)
if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
continue; continue;
if (!(mo2->flags & MF_SHOOTABLE) || (mo2->flags & MF_SCENERY))
continue;
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target) if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target)
continue; continue;
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance) if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > range)
continue; continue;
if ((mo2->flags & MF_SHOOTABLE) && !(mo2->flags & MF_SCENERY)) actor->flags2 |= MF2_DEBRIS;
{
actor->flags2 |= MF2_DEBRIS;
if (mo2->player) // Looks like we're going to have to need a seperate function for this too if (mo2->player) // Looks like we're going to have to need a seperate function for this too
K_ExplodePlayer(mo2->player, actor->target); K_ExplodePlayer(mo2->player, actor->target);
else else
P_DamageMobj(mo2, actor, actor->target, 1); P_DamageMobj(mo2, actor, actor->target, 1);
continue;
}
} }
for (d = 0; d < 16; d++) for (d = 0; d < 16; d++)
K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 K_SpawnKartExplosion(actor->x, actor->y, actor->z, range + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
if (actor->target && actor->target->player) if (actor->target && actor->target->player)
K_SpawnMineExplosion(actor, actor->target->player->skincolor); K_SpawnMineExplosion(actor, actor->target->player->skincolor);
@ -8297,7 +8377,7 @@ void A_MineExplode(mobj_t *actor)
P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND);
return; return;
} }*/
void A_BallhogExplode(mobj_t *actor) void A_BallhogExplode(mobj_t *actor)
{ {
@ -8318,13 +8398,13 @@ void A_BallhogExplode(mobj_t *actor)
// Dumb simple function that gives a mobj its target's momentums without updating its angle. // Dumb simple function that gives a mobj its target's momentums without updating its angle.
void A_LightningFollowPlayer(mobj_t *actor) void A_LightningFollowPlayer(mobj_t *actor)
{ {
fixed_t sx, sy;
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
if (LUA_CallAction("A_LightningFollowPlayer", actor)) if (LUA_CallAction("A_LightningFollowPlayer", actor))
return; return;
#endif #endif
fixed_t sx, sy;
if (actor->target) if (actor->target)
{ {
if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly
{ {
sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT)); sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT));
@ -8333,7 +8413,7 @@ void A_LightningFollowPlayer(mobj_t *actor)
} }
else // else just teleport to player directly else // else just teleport to player directly
P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z); P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z);
actor->momx = actor->target->momx; actor->momx = actor->target->momx;
actor->momy = actor->target->momy; actor->momy = actor->target->momy;
actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame. actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame.

View File

@ -1819,6 +1819,7 @@ void T_ThwompSector(levelspecthink_t *thwomp)
#define ceilingwasheight vars[5] #define ceilingwasheight vars[5]
fixed_t thwompx, thwompy; fixed_t thwompx, thwompy;
sector_t *actionsector; sector_t *actionsector;
ffloor_t *rover = NULL;
INT32 secnum; INT32 secnum;
// SRB2kart 170217 - Thwomps are automatic. // SRB2kart 170217 - Thwomps are automatic.
@ -1843,7 +1844,16 @@ void T_ThwompSector(levelspecthink_t *thwomp)
secnum = P_FindSectorFromTag((INT16)thwomp->vars[0], -1); secnum = P_FindSectorFromTag((INT16)thwomp->vars[0], -1);
if (secnum > 0) if (secnum > 0)
{
actionsector = &sectors[secnum]; actionsector = &sectors[secnum];
// Look for thwomp FFloor
for (rover = actionsector->ffloors; rover; rover = rover->next)
{
if (rover->master == thwomp->sourceline)
break;
}
}
else else
return; // Bad bad bad! return; // Bad bad bad!
@ -1932,10 +1942,13 @@ void T_ThwompSector(levelspecthink_t *thwomp)
{ {
mobj_t *mp = (void *)&actionsector->soundorg; mobj_t *mp = (void *)&actionsector->soundorg;
if (thwomp->sourceline->flags & ML_EFFECT4) if (!rover || (rover->flags & FF_EXISTS))
S_StartSound(mp, sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS); {
else if (thwomp->sourceline->flags & ML_EFFECT4)
S_StartSound(mp, sfx_thwomp); S_StartSound(mp, sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS);
else
S_StartSound(mp, sfx_thwomp);
}
thwomp->direction = 1; // start heading back up thwomp->direction = 1; // start heading back up
thwomp->distance = TICRATE; // but only after a small delay thwomp->distance = TICRATE; // but only after a small delay
@ -1953,17 +1966,22 @@ void T_ThwompSector(levelspecthink_t *thwomp)
/* // SRB2kart 170217 - Thwomps are automatic. /* // SRB2kart 170217 - Thwomps are automatic.
// scan the thinkers to find players! // scan the thinkers to find players!
for (th = thinkercap.next; th != &thinkercap; th = th->next) if (!rover || (rover->flags & FF_EXISTS))
{ {
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // scan the thinkers to find players!
continue; for (th = thinkercap.next; th != &thinkercap; th = th->next)
mo = (mobj_t *)th;
if (mo->type == MT_PLAYER && mo->health && mo->z <= thwomp->sector->ceilingheight
&& P_AproxDistance(thwompx - mo->x, thwompy - mo->y) <= 96*FRACUNIT)
{ {
thwomp->direction = -1; if (th->function.acp1 != (actionf_p1)P_MobjThinker)
break; continue;
mo = (mobj_t *)th;
if (mo->type == MT_PLAYER && mo->health && mo->player && !mo->player->spectator
&& mo->z <= thwomp->sector->ceilingheight
&& P_AproxDistance(thwompx - mo->x, thwompy - mo->y) <= 96*FRACUNIT)
{
thwomp->direction = -1;
break;
}
} }
}*/ }*/

View File

@ -96,55 +96,6 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
// GET STUFF // GET STUFF
// //
/** Makes sure all previous starposts are cleared.
* For instance, hitting starpost 5 will clear starposts 1 through 4, even if
* you didn't touch them. This is how the classic games work, although it can
* lead to bizarre situations on levels that allow you to make a circuit.
*
* \param postnum The number of the starpost just touched.
*/
void P_ClearStarPost(INT32 postnum)
{
thinker_t *th;
mobj_t *mo2;
// scan the thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2->type == MT_STARPOST && mo2->health <= postnum)
P_SetMobjState(mo2, mo2->info->seestate);
}
return;
}
//
// P_ResetStarposts
//
// Resets all starposts back to their spawn state, used on A_Mixup and some other things.
//
void P_ResetStarposts(void)
{
// Search through all the thinkers.
thinker_t *th;
mobj_t *post;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
post = (mobj_t *)th;
if (post->type == MT_STARPOST)
P_SetMobjState(post, post->info->spawnstate);
}
}
// //
// P_CanPickupItem // P_CanPickupItem
// //
@ -299,14 +250,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (heightcheck) if (heightcheck)
{ {
if (special->type == MT_FLINGEMERALD) // little hack here... /*if (special->type == MT_FLINGEMERALD) // little hack here...
{ // flingemerald sprites are low to the ground, so extend collision radius down some. { // flingemerald sprites are low to the ground, so extend collision radius down some.
if (toucher->z > (special->z + special->height)) if (toucher->z > (special->z + special->height))
return; return;
if (special->z - special->height > (toucher->z + toucher->height)) if (special->z - special->height > (toucher->z + toucher->height))
return; return;
} }
else else*/
{ {
if (toucher->momz < 0) { if (toucher->momz < 0) {
if (toucher->z + toucher->momz > special->z + special->height) if (toucher->z + toucher->momz > special->z + special->height)
@ -341,7 +292,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (special->flags & MF_BOSS) if (special->flags & MF_BOSS)
{ {
if (special->type == MT_BLACKEGGMAN) /*if (special->type == MT_BLACKEGGMAN)
{ {
P_DamageMobj(toucher, special, special, 1); // ouch P_DamageMobj(toucher, special, special, 1); // ouch
return; return;
@ -357,7 +308,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
toucher->momy = -toucher->momy; toucher->momy = -toucher->momy;
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP)))
&& player->charability == CA_FLY && player->charability == CA_FLY
@ -368,8 +318,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
*/ // SRB2kart - Removed: No more fly states // SRB2kart - Removed: No more fly states
else else*/
P_DamageMobj(toucher, special, special, 1); P_DamageMobj(toucher, special, special, 1);
return; return;
@ -379,7 +329,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
/////ENEMIES!!////////////////////////////////////////// /////ENEMIES!!//////////////////////////////////////////
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) /*if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|| player->powers[pw_invulnerability] || player->powers[pw_super]) || player->powers[pw_invulnerability] || player->powers[pw_super])
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
{ {
@ -401,7 +351,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE
&& player->charability == CA_FLY && player->charability == CA_FLY
@ -413,8 +362,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
*/ // SRB2kart - Removed: No more fly states // SRB2kart - Removed: No more fly states
else else*/
P_DamageMobj(toucher, special, special, 1); P_DamageMobj(toucher, special, special, 1);
return; return;
@ -456,10 +405,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{ {
if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer])
return; return;
if (player->kartstuff[k_comebackmode] == 0) player->kartstuff[k_comebackmode] = 1;
player->kartstuff[k_comebackmode] = 1;
} }
special->momx = special->momy = special->momz = 0; special->momx = special->momy = special->momz = 0;
@ -479,31 +427,39 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{ {
/*if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer])
return; return;
if (player->kartstuff[k_comebackmode] == 0) player->kartstuff[k_comebackmode] = 2;
player->kartstuff[k_comebackmode] = 2;*/ }
return; else
{
K_DropItems(player); //K_StripItems(player);
K_StripOther(player);
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 2;
} }
{ {
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
S_StartSound(poof, special->info->deathsound); S_StartSound(poof, special->info->deathsound);
}
K_DropItems(player); //K_StripItems(player); if (special->target && special->target->player)
K_StripOther(player); {
player->kartstuff[k_itemroulette] = 1; if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)
player->kartstuff[k_roulettetype] = 2;
if (special->target && special->target->player
&& (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0))
player->kartstuff[k_eggmanblame] = special->target->player-players; player->kartstuff[k_eggmanblame] = special->target->player-players;
else else
player->kartstuff[k_eggmanblame] = player-players; player->kartstuff[k_eggmanblame] = player-players;
P_RemoveMobj(special); if (special->target->hnext == special)
return; {
P_SetTarget(&special->target->hnext, NULL);
special->target->player->kartstuff[k_eggmanheld] = 0;
}
} }
break;
P_RemoveMobj(special);
return;
case MT_KARMAHITBOX: case MT_KARMAHITBOX:
if (!special->target->player) if (!special->target->player)
return; return;
@ -519,7 +475,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|| special->target->player->kartstuff[k_squishedtimer]) || special->target->player->kartstuff[k_squishedtimer])
return; return;
if (special->target->player->kartstuff[k_comebackmode] == 0) if (!special->target->player->kartstuff[k_comebackmode])
{ {
if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer]
|| player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer]
@ -580,6 +536,52 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->kartstuff[k_itemroulette] = 1; player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 1; player->kartstuff[k_roulettetype] = 1;
} }
else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2))
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
S_StartSound(poof, special->info->seesound);
if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1
{
INT32 numingame = 0;
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || players[i].kartstuff[k_bumper] <= 0)
continue;
numingame++;
}
if (numingame <= 2) // If so, then an extra two karma points so they are 100% certain to switch places; it's annoying to end matches with a fake kill
special->target->player->kartstuff[k_comebackpoints] += 2;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++;
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s gave an \"item\" to %s.\n"), player_names[special->target->player-players], player_names[player-players]);
if (special->target->player->kartstuff[k_comebackpoints] >= 3)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_DropItems(player); //K_StripItems(player);
K_StripOther(player);
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 2;
if (special->target->player->kartstuff[k_eggmanblame] >= 0
&& special->target->player->kartstuff[k_eggmanblame] < MAXPLAYERS
&& playeringame[special->target->player->kartstuff[k_eggmanblame]]
&& !players[special->target->player->kartstuff[k_eggmanblame]].spectator)
player->kartstuff[k_eggmanblame] = special->target->player->kartstuff[k_eggmanblame];
else
player->kartstuff[k_eggmanblame] = -1;
special->target->player->kartstuff[k_eggmanblame] = -1;
}
return; return;
// ***************************************** // // ***************************************** //
@ -843,7 +845,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// ********************************** // // ********************************** //
// NiGHTS gameplay items and powerups // // NiGHTS gameplay items and powerups //
// ********************************** // // ********************************** //
case MT_NIGHTSDRONE: /*case MT_NIGHTSDRONE:
if (player->bot) if (player->bot)
return; return;
if (player->exiting) if (player->exiting)
@ -1034,7 +1036,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Clear text // Clear text
player->texttimer = 0; player->texttimer = 0;
return; return;*/
case MT_NIGHTSBUMPER: case MT_NIGHTSBUMPER:
// Don't trigger if the stage is ended/failed // Don't trigger if the stage is ended/failed
if (player->exiting) if (player->exiting)
@ -1102,7 +1104,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
} }
} }
return; return;
case MT_NIGHTSSUPERLOOP: /*case MT_NIGHTSSUPERLOOP:
if (player->bot || !(player->pflags & PF_NIGHTSMODE)) if (player->bot || !(player->pflags & PF_NIGHTSMODE))
return; return;
if (!G_IsSpecialStage(gamemap)) if (!G_IsSpecialStage(gamemap))
@ -1235,7 +1237,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
HU_SetCEchoDuration(4); HU_SetCEchoDuration(4);
HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze")); HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze"));
} }
break; break;*/
case MT_NIGHTSWING: case MT_NIGHTSWING:
if (G_IsSpecialStage(gamemap) && useNightsSS) if (G_IsSpecialStage(gamemap) && useNightsSS)
{ // Pseudo-ring. { // Pseudo-ring.
@ -1387,35 +1389,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->starpostangle = special->angle; player->starpostangle = special->angle;
player->starpostnum = special->health; player->starpostnum = special->health;
player->starpostcount++; player->starpostcount++;
P_ClearStarPost(special->health);
// Find all starposts in the level with this value. //S_StartSound(toucher, special->info->painsound);
{
thinker_t *th;
mobj_t *mo2;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2 == special)
continue;
if (mo2->type == MT_STARPOST && mo2->health == special->health)
{
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(mo2, mo2->info->painstate);
}
}
}
S_StartSound(toucher, special->info->painsound);
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(special, special->info->painstate);
return; return;
case MT_FAKEMOBILE: case MT_FAKEMOBILE:
@ -1914,7 +1889,7 @@ void P_CheckTimeLimit(void)
//Tagmode round end but only on the tic before the //Tagmode round end but only on the tic before the
//XD_EXITLEVEL packet is received by all players. //XD_EXITLEVEL packet is received by all players.
if (G_TagGametype()) /*if (G_TagGametype())
{ {
if (leveltime == (timelimitintics + 1)) if (leveltime == (timelimitintics + 1))
{ {
@ -1931,7 +1906,7 @@ void P_CheckTimeLimit(void)
} }
//Optional tie-breaker for Match/CTF //Optional tie-breaker for Match/CTF
else if (cv_overtime.value) else*/ if (cv_overtime.value)
{ {
INT32 playerarray[MAXPLAYERS]; INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0; INT32 tempplayer = 0;
@ -2064,7 +2039,7 @@ void P_CheckPointLimit(void)
/*Checks for untagged remaining players in both tag derivitave modes. /*Checks for untagged remaining players in both tag derivitave modes.
*If no untagged players remain, end the round. *If no untagged players remain, end the round.
*Also serves as error checking if the only IT player leaves.*/ *Also serves as error checking if the only IT player leaves.*/
void P_CheckSurvivors(void) /*void P_CheckSurvivors(void)
{ {
INT32 i; INT32 i;
INT32 survivors = 0; INT32 survivors = 0;
@ -2144,7 +2119,7 @@ void P_CheckSurvivors(void)
if (server) if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0); SendNetXCmd(XD_EXITLEVEL, NULL, 0);
} }
} }*/
// Checks whether or not to end a race netgame. // Checks whether or not to end a race netgame.
boolean P_CheckRacers(void) boolean P_CheckRacers(void)
@ -2444,7 +2419,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
localaiming4 = 0; localaiming4 = 0;
//tag deaths handled differently in suicide cases. Don't count spectators! //tag deaths handled differently in suicide cases. Don't count spectators!
if (G_TagGametype() /*if (G_TagGametype()
&& !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator)) && !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator))
{ {
// if you accidentally die before you run out of time to hide, ignore it. // if you accidentally die before you run out of time to hide, ignore it.
@ -2478,7 +2453,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
} }
} }
} }
else if (G_BattleGametype()) else*/ if (G_BattleGametype())
K_CheckBumpers(); K_CheckBumpers();
target->player->kartstuff[k_pogospring] = 0; target->player->kartstuff[k_pogospring] = 0;
@ -2841,7 +2816,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
} }
// The tag occurs so long as you aren't shooting another tagger with friendlyfire on. // The tag occurs so long as you aren't shooting another tagger with friendlyfire on.
if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) /*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT))
{ {
P_AddPlayerScore(source->player, 1); //award points to tagger. P_AddPlayerScore(source->player, 1); //award points to tagger.
P_HitDeathMessages(player, inflictor, source); P_HitDeathMessages(player, inflictor, source);
@ -2859,7 +2834,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
//checks if tagger has tagged all players, if so, end round early. //checks if tagger has tagged all players, if so, end round early.
P_CheckSurvivors(); P_CheckSurvivors();
} }*/
P_DoPlayerPain(player, source, inflictor); P_DoPlayerPain(player, source, inflictor);
@ -3385,19 +3360,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
S_StartSound(player->mo, sfx_kc59); S_StartSound(player->mo, sfx_kc59);
return true; return true;
} }
// Self-Propelled Bomb
if (damage == 65)
{
mobj_t *spbexplode;
if (player == source->player)
return false;
// Just need to do this now! Being thrown upwards is done by the explosion.
//P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING);
spbexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
P_SetTarget(&spbexplode->target, source);
return true;
}
//} //}
// Sudden-Death mode // Sudden-Death mode

View File

@ -68,7 +68,6 @@
// both the head and tail of the thinker list // both the head and tail of the thinker list
extern thinker_t thinkercap; extern thinker_t thinkercap;
extern INT32 runcount;
void P_InitThinkers(void); void P_InitThinkers(void);
void P_AddThinker(thinker_t *thinker); void P_AddThinker(thinker_t *thinker);
@ -172,7 +171,7 @@ void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player); void P_PlayerAfterThink(player_t *player);
void P_DoPlayerExit(player_t *player); void P_DoPlayerExit(player_t *player);
void P_DoTimeOver(player_t *player); void P_DoTimeOver(player_t *player);
void P_NightserizePlayer(player_t *player, INT32 ptime); //void P_NightserizePlayer(player_t *player, INT32 ptime);
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move); void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
@ -185,12 +184,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in
//boolean P_SuperReady(player_t *player); //boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate); void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player); boolean P_AnalogMove(player_t *player);
boolean P_TransferToNextMare(player_t *player); /*boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void); UINT8 P_FindLowestMare(void);*/
UINT8 P_FindLowestLap(void); UINT8 P_FindLowestLap(void);
UINT8 P_FindHighestLap(void); UINT8 P_FindHighestLap(void);
void P_FindEmerald(void); void P_FindEmerald(void);
void P_TransferToAxis(player_t *player, INT32 axisnum); //void P_TransferToAxis(player_t *player, INT32 axisnum);
boolean P_PlayerMoving(INT32 pnum); boolean P_PlayerMoving(INT32 pnum);
void P_SpawnThokMobj(player_t *player); void P_SpawnThokMobj(player_t *player);
void P_SpawnSpinMobj(player_t *player, mobjtype_t type); void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
@ -231,7 +230,7 @@ boolean P_MobjWasRemoved(mobj_t *th);
void P_RemoveSavegameMobj(mobj_t *th); void P_RemoveSavegameMobj(mobj_t *th);
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
boolean P_SetMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
void P_RunShields(void); //void P_RunShields(void);
void P_RunOverlays(void); void P_RunOverlays(void);
void P_RunShadows(void); void P_RunShadows(void);
void P_MobjThinker(mobj_t *mobj); void P_MobjThinker(mobj_t *mobj);
@ -406,12 +405,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_PlayerFlagBurst(player_t *player, boolean toss); void P_PlayerFlagBurst(player_t *player, boolean toss);
void P_CheckTimeLimit(void); void P_CheckTimeLimit(void);
void P_CheckPointLimit(void); void P_CheckPointLimit(void);
void P_CheckSurvivors(void); //void P_CheckSurvivors(void);
boolean P_CheckRacers(void); boolean P_CheckRacers(void);
void P_ClearStarPost(INT32 postnum);
void P_ResetStarposts(void);
boolean P_CanPickupItem(player_t *player, UINT8 weapon); boolean P_CanPickupItem(player_t *player, UINT8 weapon);
void P_DoNightsScore(player_t *player); void P_DoNightsScore(player_t *player);

View File

@ -316,7 +316,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
break; break;
if (object->player) if (object->player)
object->player->kartstuff[k_pogospring] = 1; object->player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(object, 0, true); K_DoPogoSpring(object, 0, 0);
return; return;
} }
else else
@ -469,7 +469,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
#endif #endif
// Metal Sonic destroys tiny baby objects. // Metal Sonic destroys tiny baby objects.
if (tmthing->type == MT_METALSONIC_RACE /*if (tmthing->type == MT_METALSONIC_RACE
&& (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE))
{ {
if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE)))
@ -495,7 +495,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing); P_KillMobj(thing, tmthing, tmthing);
} }
return true; return true;
} }*/
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING))
return true; return true;
@ -647,9 +647,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
// check for skulls slamming into things // check for skulls slamming into things
if (tmthing->flags2 & MF2_SKULLFLY) if (tmthing->flags2 & MF2_SKULLFLY)
{ {
if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! /*if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop!
return true; // Let him RUN YOU RIGHT OVER. >:3 return true; // Let him RUN YOU RIGHT OVER. >:3
else else*/
{ {
// see if it went over / under // see if it went over / under
if (tmthing->z > thing->z + thing->height) if (tmthing->z > thing->z + thing->height)
@ -1133,7 +1133,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; return true;
// Missiles ignore Brak's helper. // Missiles ignore Brak's helper.
if (thing->type == MT_BLACKEGGMAN_HELPER) /*if (thing->type == MT_BLACKEGGMAN_HELPER)
return true; return true;
// Hurting Brak // Hurting Brak
@ -1144,9 +1144,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35])) if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35]))
P_SetMobjState(thing, thing->info->painstate); P_SetMobjState(thing, thing->info->painstate);
return false; return false;
} }*/
if (!(thing->flags & MF_SHOOTABLE) && !(thing->type == MT_EGGSHIELD)) if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/)
{ {
// didn't do any damage // didn't do any damage
return !(thing->flags & MF_SOLID); return !(thing->flags & MF_SOLID);
@ -1157,7 +1157,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target) && thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target)
return true; // Don't give rings to your carry player by accident. return true; // Don't give rings to your carry player by accident.
if (thing->type == MT_EGGSHIELD) /*if (thing->type == MT_EGGSHIELD)
{ {
fixed_t touchx, touchy; fixed_t touchx, touchy;
angle_t angle; angle_t angle;
@ -1183,14 +1183,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing); P_KillMobj(thing, tmthing, tmthing);
return false; return false;
} }
} }*/
if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE) if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE)
return true; return true;
// damage / explode // damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1); P_DamageMobj(thing, tmthing, tmthing, 1);
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player /*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
&& (thing->player->pflags & PF_JUMPED) && (thing->player->pflags & PF_JUMPED)
&& !thing->player->powers[pw_flashing] && !thing->player->powers[pw_flashing]
&& thing->tracer != tmthing && thing->tracer != tmthing
@ -1230,16 +1230,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
tmthing->x = thing->x; tmthing->x = thing->x;
tmthing->y = thing->y; tmthing->y = thing->y;
P_SetThingPosition(tmthing); P_SetThingPosition(tmthing);
} }*/
else else
P_DamageMobj(thing, tmthing, tmthing->target, 1); P_DamageMobj(thing, tmthing, tmthing->target, 1);
// don't traverse any more // don't traverse any more
if (tmthing->type == MT_SHELL) return (tmthing->type == MT_SHELL);
return true;
else
return false;
} }
if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE) if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE)
@ -1303,7 +1300,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
// Respawn rings and items // Respawn rings and items
if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) /*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
&& (tmthing->player || thing->player)) && (tmthing->player || thing->player))
{ {
mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing;
@ -1323,7 +1320,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
droneobj->extravalue1 = pl->anotherflyangle; droneobj->extravalue1 = pl->anotherflyangle;
droneobj->extravalue2 = (INT32)leveltime + TICRATE; droneobj->extravalue2 = (INT32)leveltime + TICRATE;
} }*/
// check for special pickup // check for special pickup
if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY) if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY)
@ -1394,7 +1391,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (thing->scale > tmthing->scale + (FRACUNIT/8)) else if (thing->scale > tmthing->scale + (FRACUNIT/8))
K_SquishPlayer(tmthing->player, thing); K_SquishPlayer(tmthing->player, thing);
// SRB2kart - Starpower! // SRB2kart - Invincibility!
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer]) if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(thing, tmthing, tmthing, 1); P_DamageMobj(thing, tmthing, tmthing, 1);
else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer]) else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer])
@ -1440,7 +1437,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->player) if (thing->player)
{ {
// Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only // Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only
if (tmthing->eflags & MFE_VERTICALFLIP /*if (tmthing->eflags & MFE_VERTICALFLIP
&& (tmthing->z + tmthing->height + tmthing->momz < thing->z && (tmthing->z + tmthing->height + tmthing->momz < thing->z
|| tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height)) || tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height))
; ;
@ -1462,7 +1459,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// The tmthing->target allows the pusher of the object // The tmthing->target allows the pusher of the object
// to get the point if he topples it on an opponent. // to get the point if he topples it on an opponent.
} }
} }*/
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM) if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
P_DoFanAndGasJet(tmthing, thing); P_DoFanAndGasJet(tmthing, thing);
@ -1585,9 +1582,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
; // Fix a few nasty spring-jumping bugs that happen sometimes. ; // Fix a few nasty spring-jumping bugs that happen sometimes.
// Monitors are not treated as solid to players who are jumping, spinning or gliding, // Monitors are not treated as solid to players who are jumping, spinning or gliding,
// unless it's a CTF team monitor and you're on the wrong team // unless it's a CTF team monitor and you're on the wrong team
else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) /*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
&& !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2)))
; ;*/
// z checking at last // z checking at last
// Treat noclip things as non-solid! // Treat noclip things as non-solid!
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID

View File

@ -48,6 +48,7 @@ actioncache_t actioncachehead;
static mobj_t *overlaycap = NULL; static mobj_t *overlaycap = NULL;
static mobj_t *shadowcap = NULL; static mobj_t *shadowcap = NULL;
mobj_t *waypointcap = NULL;
void P_InitCachedActions(void) void P_InitCachedActions(void)
{ {
@ -494,7 +495,7 @@ boolean P_WeaponOrPanel(mobjtype_t type)
// //
// Power Stone emerald management // Power Stone emerald management
// //
void P_EmeraldManager(void) /*void P_EmeraldManager(void)
{ {
thinker_t *think; thinker_t *think;
mobj_t *mo; mobj_t *mo;
@ -663,7 +664,7 @@ void P_EmeraldManager(void)
break; break;
} }
} }
} }*/
// //
// P_ExplodeMissile // P_ExplodeMissile
@ -4006,7 +4007,8 @@ void P_RecalcPrecipInSector(sector_t *sector)
// //
void P_NullPrecipThinker(precipmobj_t *mobj) void P_NullPrecipThinker(precipmobj_t *mobj)
{ {
(void)mobj; //(void)mobj;
mobj->precipflags &= ~PCF_THUNK;
} }
void P_SnowThinker(precipmobj_t *mobj) void P_SnowThinker(precipmobj_t *mobj)
@ -4026,25 +4028,26 @@ void P_RainThinker(precipmobj_t *mobj)
{ {
// cycle through states, // cycle through states,
// calling action functions at transitions // calling action functions at transitions
if (mobj->tics > 0 && --mobj->tics == 0) if (mobj->tics <= 0)
{ return;
// you can cycle through multiple states in a tic
if (!P_SetPrecipMobjState(mobj, mobj->state->nextstate)) if (--mobj->tics)
return; // freed itself return;
}
if (!P_SetPrecipMobjState(mobj, mobj->state->nextstate))
return;
if (mobj->state != &states[S_RAINRETURN])
return;
mobj->z = mobj->ceilingz;
P_SetPrecipMobjState(mobj, S_RAIN1);
if (mobj->state == &states[S_RAINRETURN])
{
mobj->z = mobj->ceilingz;
P_SetPrecipMobjState(mobj, S_RAIN1);
}
return; return;
} }
// adjust height // adjust height
mobj->z += mobj->momz; if ((mobj->z += mobj->momz) <= mobj->floorz)
if (mobj->z <= mobj->floorz)
{ {
// no splashes on sky or bottomless pits // no splashes on sky or bottomless pits
if (mobj->precipflags & PCF_PIT) if (mobj->precipflags & PCF_PIT)
@ -6058,7 +6061,7 @@ static void P_NightsItemChase(mobj_t *thing)
P_Attract(thing, thing->tracer, true); P_Attract(thing, thing->tracer, true);
} }
static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) /*static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
{ {
if (!thing->target || thing->target->health <= 0 || !thing->target->player if (!thing->target || thing->target->health <= 0 || !thing->target->player
|| (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super]
@ -6174,7 +6177,7 @@ static boolean P_AddShield(mobj_t *thing)
P_SetTarget(&shields[numshields++], thing); P_SetTarget(&shields[numshields++], thing);
return true; return true;
} }*/
void P_RunOverlays(void) void P_RunOverlays(void)
{ {
@ -6608,8 +6611,8 @@ void P_MobjThinker(mobj_t *mobj)
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
else
P_AddOverlay(mobj); P_AddOverlay(mobj);
break; break;
case MT_SHADOW: case MT_SHADOW:
if (!mobj->target) if (!mobj->target)
@ -6617,10 +6620,10 @@ void P_MobjThinker(mobj_t *mobj)
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
else
P_AddShadow(mobj); P_AddShadow(mobj);
break; break;
case MT_BLACKORB: /*case MT_BLACKORB:
case MT_WHITEORB: case MT_WHITEORB:
case MT_GREENORB: case MT_GREENORB:
case MT_YELLOWORB: case MT_YELLOWORB:
@ -6628,7 +6631,7 @@ void P_MobjThinker(mobj_t *mobj)
case MT_PITYORB: case MT_PITYORB:
if (!P_AddShield(mobj)) if (!P_AddShield(mobj))
return; return;
break; break;*/
//{ SRB2kart mobs //{ SRB2kart mobs
case MT_ORBINAUT_SHIELD: // Kart orbit/trail items case MT_ORBINAUT_SHIELD: // Kart orbit/trail items
case MT_JAWZ_SHIELD: case MT_JAWZ_SHIELD:
@ -8035,7 +8038,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
} }
if (mobj->threshold > 0) if (mobj->threshold > 0)
@ -8110,7 +8113,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
break; break;
} }
@ -8139,7 +8142,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
} }
if (mobj->threshold > 0) if (mobj->threshold > 0)
@ -8238,7 +8241,7 @@ void P_MobjThinker(mobj_t *mobj)
return; return;
case MT_MINEEXPLOSIONSOUND: case MT_MINEEXPLOSIONSOUND:
if (mobj->health == 100) if (mobj->health == 100)
S_StartSound(mobj, sfx_prloop); S_StartSound(mobj, sfx_s3k4e);
mobj->health--; mobj->health--;
break; break;
case MT_BOOSTFLAME: case MT_BOOSTFLAME:
@ -8266,12 +8269,13 @@ void P_MobjThinker(mobj_t *mobj)
P_SetScale(smoke, mobj->target->scale/2); P_SetScale(smoke, mobj->target->scale/2);
smoke->destscale = 3*mobj->target->scale/2; smoke->destscale = 3*mobj->target->scale/2;
smoke->scalespeed = FixedMul(smoke->scalespeed, mobj->target->scale);
smoke->momx = mobj->target->momx/2; smoke->momx = mobj->target->momx/2;
smoke->momy = mobj->target->momy/2; smoke->momy = mobj->target->momy/2;
smoke->momz = mobj->target->momz/2; smoke->momz = mobj->target->momz/2;
P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<<FRACBITS), P_RandomRange(0, 8) * mapheaderinfo[gamemap-1]->mobj_scale); P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<<FRACBITS), P_RandomRange(0, 8) * mobj->target->scale);
} }
break; break;
case MT_SPARKLETRAIL: case MT_SPARKLETRAIL:
@ -8362,7 +8366,7 @@ void P_MobjThinker(mobj_t *mobj)
mobj->destscale = mobj->target->destscale; mobj->destscale = mobj->target->destscale;
P_SetScale(mobj, mobj->target->scale); P_SetScale(mobj, mobj->target->scale);
mobj->color = mobj->target->color; mobj->color = mobj->target->color;
mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode] == 1); mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode]);
if (mobj->target->player->kartstuff[k_comebacktimer] > 0) if (mobj->target->player->kartstuff[k_comebacktimer] > 0)
{ {
@ -8376,12 +8380,15 @@ void P_MobjThinker(mobj_t *mobj)
} }
else else
{ {
if (mobj->target->player->kartstuff[k_comebackmode] == 0 if (!mobj->target->player->kartstuff[k_comebackmode]
&& mobj->state != &states[mobj->info->spawnstate]) && mobj->state != &states[mobj->info->spawnstate])
P_SetMobjState(mobj, mobj->info->spawnstate); P_SetMobjState(mobj, mobj->info->spawnstate);
else if (mobj->target->player->kartstuff[k_comebackmode] == 1 else if (mobj->target->player->kartstuff[k_comebackmode] == 1
&& mobj->state != &states[mobj->info->seestate]) && mobj->state != &states[mobj->info->seestate])
P_SetMobjState(mobj, mobj->info->seestate); P_SetMobjState(mobj, mobj->info->seestate);
else if (mobj->target->player->kartstuff[k_comebackmode] == 2
&& mobj->state != &states[mobj->info->painstate])
P_SetMobjState(mobj, mobj->info->painstate);
if (mobj->target->player->powers[pw_flashing] && (leveltime & 1)) if (mobj->target->player->powers[pw_flashing] && (leveltime & 1))
mobj->flags2 |= MF2_DONTDRAW; mobj->flags2 |= MF2_DONTDRAW;
@ -8748,7 +8755,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))
return; return;
} }
else if (mobj->type == MT_RANDOMITEM && mobj->threshold == 69 && mobj->fuse <= TICRATE) else if (((mobj->type == MT_RANDOMITEM && mobj->threshold == 69) || mobj->type == MT_FAKEITEM) && mobj->fuse <= TICRATE)
mobj->flags2 ^= MF2_DONTDRAW; mobj->flags2 ^= MF2_DONTDRAW;
} }
@ -9540,14 +9547,15 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
static inline precipmobj_t *P_SpawnRainMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) static inline precipmobj_t *P_SpawnRainMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
{ {
precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type); precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
mo->thinker.function.acp1 = (actionf_p1)P_RainThinker; mo->precipflags |= PCF_RAIN;
//mo->thinker.function.acp1 = (actionf_p1)P_RainThinker;
return mo; return mo;
} }
static inline precipmobj_t *P_SpawnSnowMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) static inline precipmobj_t *P_SpawnSnowMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
{ {
precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type); precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker; //mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker;
return mo; return mo;
} }
@ -9736,13 +9744,12 @@ consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff,
void P_SpawnPrecipitation(void) void P_SpawnPrecipitation(void)
{ {
INT32 i, j, mrand; INT32 i, mrand;
fixed_t basex, basey, x, y, height; fixed_t basex, basey, x, y, height;
subsector_t *precipsector = NULL; subsector_t *precipsector = NULL;
precipmobj_t *rainmo = NULL; precipmobj_t *rainmo = NULL;
if (dedicated || !cv_precipdensity.value || curWeather == PRECIP_NONE if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE) // SRB2Kart
|| netgame) // SRB2Kart
return; return;
// Use the blockmap to narrow down our placing patterns // Use the blockmap to narrow down our placing patterns
@ -9751,7 +9758,7 @@ void P_SpawnPrecipitation(void)
basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE; basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE;
basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE; basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE;
for (j = 0; j < cv_precipdensity.value; ++j) //for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for kart always
{ {
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3); x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3); y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
@ -9761,7 +9768,11 @@ void P_SpawnPrecipitation(void)
// No sector? Stop wasting time, // No sector? Stop wasting time,
// move on to the next entry in the blockmap // move on to the next entry in the blockmap
if (!precipsector) if (!precipsector)
break; continue;
// Not in a sector with visible sky?
if (precipsector->sector->ceilingpic != skyflatnum)
continue;
// Exists, but is too small for reasonable precipitation. // Exists, but is too small for reasonable precipitation.
if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<<FRACBITS))) if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<<FRACBITS)))
@ -9772,10 +9783,6 @@ void P_SpawnPrecipitation(void)
if (curWeather == PRECIP_SNOW) if (curWeather == PRECIP_SNOW)
{ {
// Not in a sector with visible sky -- exception for NiGHTS.
if (!(maptol & TOL_NIGHTS) && precipsector->sector->ceilingpic != skyflatnum)
continue;
rainmo = P_SpawnSnowMobj(x, y, height, MT_SNOWFLAKE); rainmo = P_SpawnSnowMobj(x, y, height, MT_SNOWFLAKE);
mrand = M_RandomByte(); mrand = M_RandomByte();
if (mrand < 64) if (mrand < 64)
@ -9784,13 +9791,7 @@ void P_SpawnPrecipitation(void)
P_SetPrecipMobjState(rainmo, S_SNOW2); P_SetPrecipMobjState(rainmo, S_SNOW2);
} }
else // everything else. else // everything else.
{
// Not in a sector with visible sky.
if (precipsector->sector->ceilingpic != skyflatnum)
continue;
rainmo = P_SpawnRainMobj(x, y, height, MT_RAIN); rainmo = P_SpawnRainMobj(x, y, height, MT_RAIN);
}
// Randomly assign a height, now that floorz is set. // Randomly assign a height, now that floorz is set.
rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<<FRACBITS; rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<<FRACBITS;
@ -11076,6 +11077,8 @@ ML_NOCLIMB : Direction not controllable
else if (i == MT_BOSS3WAYPOINT) // SRB2kart 120217 - Used to store checkpoint num else if (i == MT_BOSS3WAYPOINT) // SRB2kart 120217 - Used to store checkpoint num
{ {
mobj->health = mthing->angle; mobj->health = mthing->angle;
P_SetTarget(&mobj->tracer, waypointcap);
P_SetTarget(&waypointcap, mobj);
} }
else if (i == MT_SPIKE) else if (i == MT_SPIKE)
{ {

View File

@ -261,6 +261,10 @@ typedef enum {
PCF_FOF = 4, PCF_FOF = 4,
// Above MOVING FOF (this means we need to keep floorz up to date...) // Above MOVING FOF (this means we need to keep floorz up to date...)
PCF_MOVINGFOF = 8, PCF_MOVINGFOF = 8,
// Is rain.
PCF_RAIN = 16,
// Ran the thinker this tic.
PCF_THUNK = 32,
} precipflag_t; } precipflag_t;
// Map Object definition. // Map Object definition.
typedef struct mobj_s typedef struct mobj_s
@ -429,6 +433,8 @@ typedef struct actioncache_s
extern actioncache_t actioncachehead; extern actioncache_t actioncachehead;
extern mobj_t *waypointcap;
void P_InitCachedActions(void); void P_InitCachedActions(void);
void P_RunCachedActions(void); void P_RunCachedActions(void);
void P_AddCachedAction(mobj_t *mobj, INT32 statenum); void P_AddCachedAction(mobj_t *mobj, INT32 statenum);

View File

@ -945,11 +945,10 @@ typedef enum
MD2_EXTVAL2 = 1<<6, MD2_EXTVAL2 = 1<<6,
MD2_HNEXT = 1<<7, MD2_HNEXT = 1<<7,
MD2_HPREV = 1<<8, MD2_HPREV = 1<<8,
MD2_COLORIZED = 1<<9,
MD2_WAYPOINTCAP = 1<<10
#ifdef ESLOPE #ifdef ESLOPE
MD2_SLOPE = 1<<9, , MD2_SLOPE = 1<<11
MD2_COLORIZED = 1<<10
#else
MD2_COLORIZED = 1<<9
#endif #endif
} mobj_diff2_t; } mobj_diff2_t;
@ -969,6 +968,7 @@ typedef enum
tc_bouncecheese, tc_bouncecheese,
tc_startcrumble, tc_startcrumble,
tc_marioblock, tc_marioblock,
tc_marioblockchecker,
tc_spikesector, tc_spikesector,
tc_floatsector, tc_floatsector,
tc_bridgethinker, tc_bridgethinker,
@ -1146,6 +1146,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
#endif #endif
if (mobj->colorized) if (mobj->colorized)
diff2 |= MD2_COLORIZED; diff2 |= MD2_COLORIZED;
if (mobj == waypointcap)
diff2 |= MD2_WAYPOINTCAP;
if (diff2 != 0) if (diff2 != 0)
diff |= MD_MORE; diff |= MD_MORE;
@ -1282,7 +1284,10 @@ static void SaveSpecialLevelThinker(const thinker_t *th, const UINT8 type)
size_t i; size_t i;
WRITEUINT8(save_p, type); WRITEUINT8(save_p, type);
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{
WRITEFIXED(save_p, ht->vars[i]); //var[16] WRITEFIXED(save_p, ht->vars[i]); //var[16]
WRITEFIXED(save_p, ht->var2s[i]); //var[16]
}
WRITEUINT32(save_p, SaveLine(ht->sourceline)); WRITEUINT32(save_p, SaveLine(ht->sourceline));
WRITEUINT32(save_p, SaveSector(ht->sector)); WRITEUINT32(save_p, SaveSector(ht->sector));
} }
@ -1684,8 +1689,7 @@ static void P_NetArchiveThinkers(void)
for (th = thinkercap.next; th != &thinkercap; th = th->next) for (th = thinkercap.next; th != &thinkercap; th = th->next)
{ {
if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed
|| th->function.acp1 == (actionf_p1)P_RainThinker || th->function.acp1 == (actionf_p1)P_NullPrecipThinker))
|| th->function.acp1 == (actionf_p1)P_SnowThinker))
numsaved++; numsaved++;
if (th->function.acp1 == (actionf_p1)P_MobjThinker) if (th->function.acp1 == (actionf_p1)P_MobjThinker)
@ -1694,8 +1698,7 @@ static void P_NetArchiveThinkers(void)
continue; continue;
} }
#ifdef PARANOIA #ifdef PARANOIA
else if (th->function.acp1 == (actionf_p1)P_RainThinker else if (th->function.acp1 == (actionf_p1)P_NullPrecipThinker);
|| th->function.acp1 == (actionf_p1)P_SnowThinker);
#endif #endif
else if (th->function.acp1 == (actionf_p1)T_MoveCeiling) else if (th->function.acp1 == (actionf_p1)T_MoveCeiling)
{ {
@ -1797,6 +1800,11 @@ static void P_NetArchiveThinkers(void)
SaveSpecialLevelThinker(th, tc_marioblock); SaveSpecialLevelThinker(th, tc_marioblock);
continue; continue;
} }
else if (th->function.acp1 == (actionf_p1)T_MarioBlockChecker)
{
SaveSpecialLevelThinker(th, tc_marioblockchecker);
continue;
}
else if (th->function.acp1 == (actionf_p1)T_SpikeSector) else if (th->function.acp1 == (actionf_p1)T_SpikeSector)
{ {
SaveSpecialLevelThinker(th, tc_spikesector); SaveSpecialLevelThinker(th, tc_spikesector);
@ -2165,6 +2173,9 @@ static void LoadMobjThinker(actionf_p1 thinker)
P_AddThinker(&mobj->thinker); P_AddThinker(&mobj->thinker);
if (diff2 & MD2_WAYPOINTCAP)
P_SetTarget(&waypointcap, mobj);
mobj->info = (mobjinfo_t *)next; // temporarily, set when leave this function mobj->info = (mobjinfo_t *)next; // temporarily, set when leave this function
} }
@ -2185,7 +2196,10 @@ static void LoadSpecialLevelThinker(actionf_p1 thinker, UINT8 floorOrCeiling)
size_t i; size_t i;
ht->thinker.function.acp1 = thinker; ht->thinker.function.acp1 = thinker;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{
ht->vars[i] = READFIXED(save_p); //var[16] ht->vars[i] = READFIXED(save_p); //var[16]
ht->var2s[i] = READFIXED(save_p); //var[16]
}
ht->sourceline = LoadLine(READUINT32(save_p)); ht->sourceline = LoadLine(READUINT32(save_p));
ht->sector = LoadSector(READUINT32(save_p)); ht->sector = LoadSector(READUINT32(save_p));
@ -2758,6 +2772,10 @@ static void P_NetUnArchiveThinkers(void)
LoadSpecialLevelThinker((actionf_p1)T_MarioBlock, 3); LoadSpecialLevelThinker((actionf_p1)T_MarioBlock, 3);
break; break;
case tc_marioblockchecker:
LoadSpecialLevelThinker((actionf_p1)T_MarioBlockChecker, 0);
break;
case tc_spikesector: case tc_spikesector:
LoadSpecialLevelThinker((actionf_p1)T_SpikeSector, 0); LoadSpecialLevelThinker((actionf_p1)T_SpikeSector, 0);
break; break;

View File

@ -2782,7 +2782,6 @@ boolean P_SetupLevel(boolean skipprecip)
P_CreateBlockMap(); // Graue 02-29-2004 P_CreateBlockMap(); // Graue 02-29-2004
P_LoadSideDefs2(lastloadedmaplumpnum + ML_SIDEDEFS); P_LoadSideDefs2(lastloadedmaplumpnum + ML_SIDEDEFS);
R_MakeColormaps();
P_LoadLineDefs2(); P_LoadLineDefs2();
P_LoadSubsectors(lastloadedmaplumpnum + ML_SSECTORS); P_LoadSubsectors(lastloadedmaplumpnum + ML_SSECTORS);
P_LoadNodes(lastloadedmaplumpnum + ML_NODES); P_LoadNodes(lastloadedmaplumpnum + ML_NODES);
@ -2865,7 +2864,6 @@ boolean P_SetupLevel(boolean skipprecip)
if (players[i].starposttime) if (players[i].starposttime)
{ {
G_SpawnPlayer(i, true); G_SpawnPlayer(i, true);
P_ClearStarPost(players[i].starpostnum);
} }
else else
G_SpawnPlayer(i, false); G_SpawnPlayer(i, false);
@ -2916,7 +2914,9 @@ boolean P_SetupLevel(boolean skipprecip)
} }
else if (G_RaceGametype() && server) else if (G_RaceGametype() && server)
CV_StealthSetValue(&cv_numlaps, CV_StealthSetValue(&cv_numlaps,
((netgame || multiplayer) && cv_basenumlaps.value) ((netgame || multiplayer) && cv_basenumlaps.value
&& (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|| (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value)))
? cv_basenumlaps.value ? cv_basenumlaps.value
: mapheaderinfo[gamemap - 1]->numlaps); : mapheaderinfo[gamemap - 1]->numlaps);

View File

@ -251,7 +251,7 @@ void P_SpawnSlope_Line(int linenum)
UINT8 flags = 0; // Slope flags UINT8 flags = 0; // Slope flags
if (line->flags & ML_NOSONIC) if (line->flags & ML_NOSONIC)
flags |= SL_NOPHYSICS; flags |= SL_NOPHYSICS;
if (line->flags & ML_NOTAILS) if (!(line->flags & ML_NOTAILS))
flags |= SL_NODYNAMIC; flags |= SL_NODYNAMIC;
if (line->flags & ML_NOKNUX) if (line->flags & ML_NOKNUX)
flags |= SL_ANCHORVERTEX; flags |= SL_ANCHORVERTEX;

View File

@ -1707,16 +1707,16 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (actor && actor->player && triggerline->flags & ML_EFFECT4) if (actor && actor->player && triggerline->flags & ML_EFFECT4)
{ {
if (maptol & TOL_NIGHTS) /*if (maptol & TOL_NIGHTS)
lap = actor->player->mare; lap = actor->player->mare;
else else*/
lap = actor->player->laps; lap = actor->player->laps;
} }
else else
{ {
if (maptol & TOL_NIGHTS) /*if (maptol & TOL_NIGHTS)
lap = P_FindLowestMare(); lap = P_FindLowestMare();
else else*/
lap = P_FindLowestLap(); lap = P_FindLowestLap();
} }
@ -2056,8 +2056,7 @@ void P_SwitchWeather(INT32 weathernum)
for (think = thinkercap.next; think != &thinkercap; think = think->next) for (think = thinkercap.next; think != &thinkercap; think = think->next)
{ {
if ((think->function.acp1 != (actionf_p1)P_SnowThinker) if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker)
&& (think->function.acp1 != (actionf_p1)P_RainThinker))
continue; // not a precipmobj thinker continue; // not a precipmobj thinker
precipmobj = (precipmobj_t *)think; precipmobj = (precipmobj_t *)think;
@ -2073,14 +2072,12 @@ void P_SwitchWeather(INT32 weathernum)
for (think = thinkercap.next; think != &thinkercap; think = think->next) for (think = thinkercap.next; think != &thinkercap; think = think->next)
{ {
if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker)
continue; // not a precipmobj thinker
precipmobj = (precipmobj_t *)think;
if (swap == PRECIP_RAIN) // Snow To Rain if (swap == PRECIP_RAIN) // Snow To Rain
{ {
if (!(think->function.acp1 == (actionf_p1)P_SnowThinker
|| think->function.acp1 == (actionf_p1)P_NullPrecipThinker))
continue; // not a precipmobj thinker
precipmobj = (precipmobj_t *)think;
precipmobj->flags = mobjinfo[MT_RAIN].flags; precipmobj->flags = mobjinfo[MT_RAIN].flags;
st = &states[mobjinfo[MT_RAIN].spawnstate]; st = &states[mobjinfo[MT_RAIN].spawnstate];
precipmobj->state = st; precipmobj->state = st;
@ -2091,18 +2088,13 @@ void P_SwitchWeather(INT32 weathernum)
precipmobj->precipflags &= ~PCF_INVISIBLE; precipmobj->precipflags &= ~PCF_INVISIBLE;
think->function.acp1 = (actionf_p1)P_RainThinker; precipmobj->precipflags |= PCF_RAIN;
//think->function.acp1 = (actionf_p1)P_RainThinker;
} }
else if (swap == PRECIP_SNOW) // Rain To Snow else if (swap == PRECIP_SNOW) // Rain To Snow
{ {
INT32 z; INT32 z;
if (!(think->function.acp1 == (actionf_p1)P_RainThinker
|| think->function.acp1 == (actionf_p1)P_NullPrecipThinker))
continue; // not a precipmobj thinker
precipmobj = (precipmobj_t *)think;
precipmobj->flags = mobjinfo[MT_SNOWFLAKE].flags; precipmobj->flags = mobjinfo[MT_SNOWFLAKE].flags;
z = M_RandomByte(); z = M_RandomByte();
@ -2120,19 +2112,13 @@ void P_SwitchWeather(INT32 weathernum)
precipmobj->frame = st->frame; precipmobj->frame = st->frame;
precipmobj->momz = mobjinfo[MT_SNOWFLAKE].speed; precipmobj->momz = mobjinfo[MT_SNOWFLAKE].speed;
precipmobj->precipflags &= ~PCF_INVISIBLE; precipmobj->precipflags &= ~(PCF_INVISIBLE|PCF_RAIN);
think->function.acp1 = (actionf_p1)P_SnowThinker; //think->function.acp1 = (actionf_p1)P_SnowThinker;
} }
else if (swap == PRECIP_BLANK || swap == PRECIP_STORM_NORAIN) // Remove precip, but keep it around for reuse. else if (swap == PRECIP_BLANK || swap == PRECIP_STORM_NORAIN) // Remove precip, but keep it around for reuse.
{ {
if (!(think->function.acp1 == (actionf_p1)P_RainThinker //think->function.acp1 = (actionf_p1)P_NullPrecipThinker;
|| think->function.acp1 == (actionf_p1)P_SnowThinker))
continue;
precipmobj = (precipmobj_t *)think;
think->function.acp1 = (actionf_p1)P_NullPrecipThinker;
precipmobj->precipflags |= PCF_INVISIBLE; precipmobj->precipflags |= PCF_INVISIBLE;
} }
@ -3790,7 +3776,7 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, minspeed); P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_pogospring] = 1; player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(player->mo, 0, false); K_DoPogoSpring(player->mo, 0, 1);
} }
break; break;
@ -3813,7 +3799,7 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, minspeed); P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_pogospring] = 2; player->kartstuff[k_pogospring] = 2;
K_DoPogoSpring(player->mo, 0, false); K_DoPogoSpring(player->mo, 0, 1);
} }
break; break;
@ -4252,7 +4238,6 @@ DoneSection2:
// //
//player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostangle = player->starposttime = player->starpostnum = 0;
//player->starpostx = player->starposty = player->starpostz = 0; //player->starpostx = player->starposty = player->starpostz = 0;
P_ResetStarposts();
// Play the starpost sound for 'consistency' // Play the starpost sound for 'consistency'
// S_StartSound(player->mo, sfx_strpst); // S_StartSound(player->mo, sfx_strpst);
@ -5821,10 +5806,8 @@ void P_SpawnSpecials(INT32 fromnetsave)
} }
else // Otherwise, set calculated offsets such that line's v1 is the apparent origin else // Otherwise, set calculated offsets such that line's v1 is the apparent origin
{ {
fixed_t cosinecomponent = FINECOSINE(flatangle>>ANGLETOFINESHIFT); xoffs = -lines[i].v1->x;
fixed_t sinecomponent = FINESINE(flatangle>>ANGLETOFINESHIFT); yoffs = lines[i].v1->y;
xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations.
yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto.
} }
for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;)

View File

@ -96,10 +96,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
thing->player->starpostangle = starpostangle; thing->player->starpostangle = starpostangle;
thing->player->starpostnum = starpostnum; thing->player->starpostnum = starpostnum;
// Reset map starposts for the player's new info.
P_ResetStarposts();
P_ClearStarPost(starpostnum);
P_ResetPlayer(thing->player); P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND

View File

@ -57,12 +57,12 @@ void Command_Numthinkers_f(void)
CONS_Printf(M_GetText("numthinkers <#>: Count number of thinkers\n")); CONS_Printf(M_GetText("numthinkers <#>: Count number of thinkers\n"));
CONS_Printf( CONS_Printf(
"\t1: P_MobjThinker\n" "\t1: P_MobjThinker\n"
"\t2: P_RainThinker\n" /*"\t2: P_RainThinker\n"
"\t3: P_SnowThinker\n" "\t3: P_SnowThinker\n"*/
"\t4: P_NullPrecipThinker\n" "\t2: P_NullPrecipThinker\n"
"\t5: T_Friction\n" "\t3: T_Friction\n"
"\t6: T_Pusher\n" "\t4: T_Pusher\n"
"\t7: P_RemoveThinkerDelayed\n"); "\t5: P_RemoveThinkerDelayed\n");
return; return;
} }
@ -74,27 +74,27 @@ void Command_Numthinkers_f(void)
action = (actionf_p1)P_MobjThinker; action = (actionf_p1)P_MobjThinker;
CONS_Printf(M_GetText("Number of %s: "), "P_MobjThinker"); CONS_Printf(M_GetText("Number of %s: "), "P_MobjThinker");
break; break;
case 2: /*case 2:
action = (actionf_p1)P_RainThinker; action = (actionf_p1)P_RainThinker;
CONS_Printf(M_GetText("Number of %s: "), "P_RainThinker"); CONS_Printf(M_GetText("Number of %s: "), "P_RainThinker");
break; break;
case 3: case 3:
action = (actionf_p1)P_SnowThinker; action = (actionf_p1)P_SnowThinker;
CONS_Printf(M_GetText("Number of %s: "), "P_SnowThinker"); CONS_Printf(M_GetText("Number of %s: "), "P_SnowThinker");
break; break;*/
case 4: case 2:
action = (actionf_p1)P_NullPrecipThinker; action = (actionf_p1)P_NullPrecipThinker;
CONS_Printf(M_GetText("Number of %s: "), "P_NullPrecipThinker"); CONS_Printf(M_GetText("Number of %s: "), "P_NullPrecipThinker");
break; break;
case 5: case 3:
action = (actionf_p1)T_Friction; action = (actionf_p1)T_Friction;
CONS_Printf(M_GetText("Number of %s: "), "T_Friction"); CONS_Printf(M_GetText("Number of %s: "), "T_Friction");
break; break;
case 6: case 4:
action = (actionf_p1)T_Pusher; action = (actionf_p1)T_Pusher;
CONS_Printf(M_GetText("Number of %s: "), "T_Pusher"); CONS_Printf(M_GetText("Number of %s: "), "T_Pusher");
break; break;
case 7: case 5:
action = (actionf_p1)P_RemoveThinkerDelayed; action = (actionf_p1)P_RemoveThinkerDelayed;
CONS_Printf(M_GetText("Number of %s: "), "P_RemoveThinkerDelayed"); CONS_Printf(M_GetText("Number of %s: "), "P_RemoveThinkerDelayed");
break; break;
@ -180,6 +180,7 @@ void Command_CountMobjs_f(void)
void P_InitThinkers(void) void P_InitThinkers(void)
{ {
thinkercap.prev = thinkercap.next = &thinkercap; thinkercap.prev = thinkercap.next = &thinkercap;
waypointcap = NULL;
} }
// //
@ -309,7 +310,7 @@ static inline void P_RunThinkers(void)
// //
// Determine if the teams are unbalanced, and if so, move a player to the other team. // Determine if the teams are unbalanced, and if so, move a player to the other team.
// //
static void P_DoAutobalanceTeams(void) /*static void P_DoAutobalanceTeams(void)
{ {
changeteam_union NetPacket; changeteam_union NetPacket;
UINT16 usvalue; UINT16 usvalue;
@ -561,7 +562,7 @@ static inline void P_DoCTFStuff(void)
if (cv_teamscramble.value && server) if (cv_teamscramble.value && server)
P_DoTeamscrambling(); P_DoTeamscrambling();
} }
} }*/
// //
// P_Ticker // P_Ticker
@ -611,11 +612,11 @@ void P_Ticker(boolean run)
if (!demoplayback) // Don't increment if a demo is playing. if (!demoplayback) // Don't increment if a demo is playing.
totalplaytime++; totalplaytime++;
if (!useNightsSS && G_IsSpecialStage(gamemap)) /*if (!useNightsSS && G_IsSpecialStage(gamemap))
P_DoSpecialStageStuff(); P_DoSpecialStageStuff();
if (runemeraldmanager) if (runemeraldmanager)
P_EmeraldManager(); // Power stone mode P_EmeraldManager(); // Power stone mode*/
if (run) if (run)
{ {
@ -632,7 +633,7 @@ void P_Ticker(boolean run)
} }
// Run shield positioning // Run shield positioning
P_RunShields(); //P_RunShields();
P_RunOverlays(); P_RunOverlays();
P_RunShadows(); P_RunShadows();
@ -647,11 +648,11 @@ void P_Ticker(boolean run)
leveltime++; leveltime++;
timeinmap++; timeinmap++;
if (G_TagGametype()) /*if (G_TagGametype())
P_DoTagStuff(); P_DoTagStuff();
if (G_GametypeHasTeams()) if (G_GametypeHasTeams())
P_DoCTFStuff(); P_DoCTFStuff();*/
if (run) if (run)
{ {
@ -747,6 +748,16 @@ void P_Ticker(boolean run)
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false); D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
} }
// Always move the camera.
if (camera.chase)
P_MoveChaseCamera(&players[displayplayer], &camera, false);
if (splitscreen && camera2.chase)
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
if (splitscreen > 1 && camera3.chase)
P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false);
if (splitscreen > 2 && camera4.chase)
P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false);
P_MapEnd(); P_MapEnd();
// Z_CheckMemCleanup(); // Z_CheckMemCleanup();
@ -792,7 +803,7 @@ void P_PreTicker(INT32 frames)
#endif #endif
// Run shield positioning // Run shield positioning
P_RunShields(); //P_RunShields();
P_RunOverlays(); P_RunOverlays();
P_UpdateSpecials(); P_UpdateSpecials();

View File

@ -344,7 +344,7 @@ void P_ResetScore(player_t *player)
// //
// Returns the lowest open mare available // Returns the lowest open mare available
// //
UINT8 P_FindLowestMare(void) /*UINT8 P_FindLowestMare(void)
{ {
thinker_t *th; thinker_t *th;
mobj_t *mo2; mobj_t *mo2;
@ -375,7 +375,7 @@ UINT8 P_FindLowestMare(void)
CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare); CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare);
return mare; return mare;
} }*/
// //
// P_FindLowestLap // P_FindLowestLap
@ -438,7 +438,7 @@ UINT8 P_FindHighestLap(void)
// (Finds the lowest mare # for capsules that have not been destroyed). // (Finds the lowest mare # for capsules that have not been destroyed).
// Returns true if successful, false if there is no other mare. // Returns true if successful, false if there is no other mare.
// //
boolean P_TransferToNextMare(player_t *player) /*boolean P_TransferToNextMare(player_t *player)
{ {
thinker_t *th; thinker_t *th;
mobj_t *mo2; mobj_t *mo2;
@ -759,7 +759,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
if (G_IsSpecialStage(gamemap)) if (G_IsSpecialStage(gamemap))
{ {
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/) if (playeringame[i])
total_rings += players[i].health-1; total_rings += players[i].health-1;
} }
@ -782,10 +782,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
P_AddPlayerScore(&players[i], (players[i].health - 1) * 50); P_AddPlayerScore(&players[i], (players[i].health - 1) * 50);
} }
// Add score to leaderboards now
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i]))
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/
// transfer scores anyway // transfer scores anyway
players[i].mo->health = players[i].health = 1; players[i].mo->health = players[i].health = 1;
@ -803,10 +799,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->textvar = 4; // Score and grades player->textvar = 4; // Score and grades
player->finishedrings = (INT16)(player->health - 1); player->finishedrings = (INT16)(player->health - 1);
// Add score to temp leaderboards
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(player))
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/
// Starting a new mare, transfer scores // Starting a new mare, transfer scores
player->marebegunat = leveltime; player->marebegunat = leveltime;
@ -824,7 +816,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
} }
player->pflags |= PF_NIGHTSMODE; player->pflags |= PF_NIGHTSMODE;
} }*/
// //
// P_PlayerInPain // P_PlayerInPain
@ -4536,7 +4528,7 @@ INT32 P_GetPlayerControlDirection(player_t *player)
} }
// Control scheme for 2d levels. // Control scheme for 2d levels.
static void P_2dMovement(player_t *player) /*static void P_2dMovement(player_t *player)
{ {
ticcmd_t *cmd; ticcmd_t *cmd;
INT32 topspeed, acceleration, thrustfactor; INT32 topspeed, acceleration, thrustfactor;
@ -4713,7 +4705,7 @@ static void P_2dMovement(player_t *player)
else if (player->rmomx > -topspeed && cmd->sidemove < 0) else if (player->rmomx > -topspeed && cmd->sidemove < 0)
P_Thrust(player->mo, movepushangle, movepushforward); P_Thrust(player->mo, movepushangle, movepushforward);
} }
} }*/
//#define OLD_MOVEMENT_CODE 1 //#define OLD_MOVEMENT_CODE 1
static void P_3dMovement(player_t *player) static void P_3dMovement(player_t *player)
@ -5004,7 +4996,7 @@ static void P_SpectatorMovement(player_t *player)
// graphical indicator // graphical indicator
// for building/debugging // for building/debugging
// NiGHTS levels! // NiGHTS levels!
static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) /*static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height)
{ {
mobj_t *mo; mobj_t *mo;
INT32 i; INT32 i;
@ -5578,16 +5570,6 @@ static void P_DoNiGHTSCapsule(player_t *player)
UINT8 em = P_GetNextEmerald(); UINT8 em = P_GetNextEmerald();
tic_t lowest_time; tic_t lowest_time;
/*for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || !players[i].mo || !players[i].mo->tracer)
continue;
emmo = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_GOTEMERALD);
P_SetTarget(&emmo->target, players[i].mo);
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
}*/
if (player->mo->tracer) if (player->mo->tracer)
{ {
// Only give it to ONE person, and THAT player has to get to the goal! // Only give it to ONE person, and THAT player has to get to the goal!
@ -5683,7 +5665,7 @@ static void P_NiGHTSMovement(player_t *player)
boolean capsule = false; boolean capsule = false;
// NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule. // NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ if (playeringame[i]
&& (players[i].capsule && players[i].capsule->reactiontime)) && (players[i].capsule && players[i].capsule->reactiontime))
capsule = true; capsule = true;
if (!capsule if (!capsule
@ -6238,7 +6220,7 @@ static void P_NiGHTSMovement(player_t *player)
if (objectplacing) if (objectplacing)
OP_NightsObjectplace(player); OP_NightsObjectplace(player);
} }*/
// May be used in future for CTF // May be used in future for CTF
#if 0 #if 0
@ -6457,7 +6439,7 @@ void P_ElementalFireTrail(player_t *player)
static void P_MovePlayer(player_t *player) static void P_MovePlayer(player_t *player)
{ {
ticcmd_t *cmd; ticcmd_t *cmd;
INT32 i; //INT32 i;
fixed_t runspd; fixed_t runspd;
@ -6532,7 +6514,7 @@ static void P_MovePlayer(player_t *player)
} }
// Locate the capsule for this mare. // Locate the capsule for this mare.
else if (maptol & TOL_NIGHTS) /*else if (maptol & TOL_NIGHTS)
{ {
if (!player->capsule && !player->bonustime) if (!player->capsule && !player->bonustime)
{ {
@ -6585,15 +6567,15 @@ static void P_MovePlayer(player_t *player)
P_DamageMobj(player->mo, NULL, NULL, 1); P_DamageMobj(player->mo, NULL, NULL, 1);
player->pflags &= ~PF_NIGHTSFALL; player->pflags &= ~PF_NIGHTSFALL;
} }
} }*/
////////////////////// //////////////////////
// MOVEMENT CODE // // MOVEMENT CODE //
////////////////////// //////////////////////
if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. /*if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies.
P_2dMovement(player); P_2dMovement(player);
else else*/
{ {
if (!player->climbing && (!P_AnalogMove(player))) if (!player->climbing && (!P_AnalogMove(player)))
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
@ -6680,36 +6662,17 @@ static void P_MovePlayer(player_t *player)
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
//{ SRB2kart //{ SRB2kart
// Engine Sounds.
if (!player->exiting)
{
if (player->speed == 0 && onground && player->speed == 0 && leveltime % 6 == 0)
S_StartSound(player->mo, sfx_kart1);
if ((player->speed < runspd && player->speed != 0) && leveltime % 8 == 0) // Drifting sound
S_StartSound(player->mo, sfx_kart2); // Start looping the sound now.
if (leveltime % 50 == 0 && onground && player->kartstuff[k_drift] != 0)
if ((player->speed > runspd) && leveltime % 8 == 0) S_StartSound(player->mo, sfx_mkdrft);
S_StartSound(player->mo, sfx_kart3); // Leveltime being 50 might take a while at times. We'll start it up once, isntantly.
else if (!S_SoundPlaying(player->mo, sfx_mkdrft) && onground && player->kartstuff[k_drift] != 0)
// Drifting sound S_StartSound(player->mo, sfx_mkdrft);
{ // Ok, we'll stop now.
// Start looping the sound now. else if (player->kartstuff[k_drift] == 0)
if (leveltime % 50 == 0 && onground S_StopSoundByID(player->mo, sfx_mkdrft);
&& player->kartstuff[k_drift] != 0)
S_StartSound(player->mo, sfx_mkdrft);
// Leveltime being 50 might take a while at times. We'll start it up once, isntantly.
else if ((player->kartstuff[k_drift] >= 1 || player->kartstuff[k_drift] <= -1) && !S_SoundPlaying(player->mo, sfx_mkdrft) && onground)
S_StartSound(player->mo, sfx_mkdrft);
// Ok, we'll stop now.
else if ((player->kartstuff[k_drift] == 0)
&& (player == &players[consoleplayer]
|| (splitscreen && player == &players[secondarydisplayplayer])
|| (splitscreen > 1 && player == &players[thirddisplayplayer])
|| (splitscreen > 2 && player == &players[fourthdisplayplayer])))
S_StopSoundByID(player->mo, sfx_mkdrft);
}
}
K_MoveKartPlayer(player, onground); K_MoveKartPlayer(player, onground);
//} //}
@ -7915,7 +7878,7 @@ static void P_DeathThink(player_t *player)
/*if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) /*if (player->deadtimer > 30*TICRATE && !G_RaceGametype())
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;
else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/ else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/
if (player->lives > 0 && leveltime >= starttime) // *could* you respawn? if (player->lives > 0 /*&& leveltime >= starttime*/) // *could* you respawn?
{ {
// SRB2kart - spawn automatically after 1 second // SRB2kart - spawn automatically after 1 second
if (player->deadtimer > ((netgame || multiplayer) if (player->deadtimer > ((netgame || multiplayer)
@ -8180,15 +8143,21 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
subsector_t *newsubsec; subsector_t *newsubsec;
fixed_t f1, f2; fixed_t f1, f2;
// We probably shouldn't move the camera if there is no player or player mobj somehow
if (!player || !player->mo)
return true;
mo = player->mo;
#ifdef NOCLIPCAM #ifdef NOCLIPCAM
cameranoclip = true; // We like camera noclip! cameranoclip = true; // We like camera noclip!
#else #else
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|| (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!! || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|| (leveltime < introtime)); // Kart intro cam || (leveltime < introtime)); // Kart intro cam
#endif #endif
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) if (!(player->playerstate == PST_DEAD || player->exiting))
{ {
if (player->spectator) // force cam off for spectators if (player->spectator) // force cam off for spectators
return true; return true;
@ -8217,7 +8186,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
else if (player == &players[fourthdisplayplayer]) else if (player == &players[fourthdisplayplayer])
focusangle = localangle4; focusangle = localangle4;
else else
focusangle = player->mo->angle; focusangle = mo->angle;
if (thiscam == &camera) if (thiscam == &camera)
camrotate = cv_cam_rotate.value; camrotate = cv_cam_rotate.value;
else if (thiscam == &camera2) else if (thiscam == &camera2)
@ -8238,17 +8207,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
return true; return true;
} }
if (!player || !player->mo)
return true;
mo = player->mo;
thiscam->radius = FixedMul(20*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); thiscam->radius = FixedMul(20*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale);
thiscam->height = FixedMul(16*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); thiscam->height = FixedMul(16*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale);
if (!mo)
return true;
// Don't run while respawning from a starpost // Don't run while respawning from a starpost
// Inu 4/8/13 Why not?! // Inu 4/8/13 Why not?!
// if (leveltime > 0 && timeinmap <= 0) // if (leveltime > 0 && timeinmap <= 0)
@ -8256,7 +8217,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (player->pflags & PF_NIGHTSMODE) if (player->pflags & PF_NIGHTSMODE)
{ {
focusangle = player->mo->angle; focusangle = mo->angle;
focusaiming = 0; focusaiming = 0;
} }
else if (player == &players[consoleplayer]) else if (player == &players[consoleplayer])
@ -8281,7 +8242,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
} }
else else
{ {
focusangle = player->mo->angle; focusangle = mo->angle;
focusaiming = player->aiming; focusaiming = player->aiming;
} }
@ -8681,9 +8642,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
{ {
// Don't let the camera match your movement. // Don't let the camera match your movement.
thiscam->momz = 0; thiscam->momz = 0;
if (player->spectator)
thiscam->aiming = 0;
// Only let the camera go a little bit downwards. // Only let the camera go a little bit downwards.
if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) else if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180)
thiscam->aiming = ANGLE_337h; thiscam->aiming = ANGLE_337h;
else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180) else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180)
thiscam->aiming = ANGLE_22h; thiscam->aiming = ANGLE_22h;
@ -8945,8 +8907,6 @@ void P_DoTimeOver(player_t *player)
// P_PlayerThink // P_PlayerThink
// //
boolean playerdeadview; // show match/chaos/tag/capture the flag rankings while in death view
void P_PlayerThink(player_t *player) void P_PlayerThink(player_t *player)
{ {
ticcmd_t *cmd; ticcmd_t *cmd;
@ -9129,10 +9089,6 @@ void P_PlayerThink(player_t *player)
if (player->playerstate == PST_DEAD) if (player->playerstate == PST_DEAD)
{ {
player->mo->flags2 &= ~MF2_SHADOW; player->mo->flags2 &= ~MF2_SHADOW;
// show the multiplayer rankings while dead
if (player == &players[displayplayer])
playerdeadview = true;
P_DeathThink(player); P_DeathThink(player);
return; return;
@ -9157,9 +9113,6 @@ void P_PlayerThink(player_t *player)
player->lives = 1; // SRB2Kart player->lives = 1; // SRB2Kart
#endif #endif
if (player == &players[displayplayer])
playerdeadview = false;
// SRB2kart 010217 // SRB2kart 010217
if (leveltime < starttime) if (leveltime < starttime)
player->powers[pw_nocontrol] = 2; player->powers[pw_nocontrol] = 2;
@ -9441,8 +9394,8 @@ void P_PlayerThink(player_t *player)
player->losstime--; player->losstime--;
// Flash player after being hit. // Flash player after being hit.
if (!(player->pflags & PF_NIGHTSMODE if (!(//player->pflags & PF_NIGHTSMODE ||
|| player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| player->kartstuff[k_respawn] // Respawn timer (for drop dash effect) || player->kartstuff[k_respawn] // Respawn timer (for drop dash effect)
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer])
@ -9454,13 +9407,13 @@ void P_PlayerThink(player_t *player)
else else
player->mo->flags2 &= ~MF2_DONTDRAW; player->mo->flags2 &= ~MF2_DONTDRAW;
} }
else if (player->mo->tracer) /*else if (player->mo->tracer)
{ {
if (player->powers[pw_flashing] & 1) if (player->powers[pw_flashing] & 1)
player->mo->tracer->flags2 |= MF2_DONTDRAW; player->mo->tracer->flags2 |= MF2_DONTDRAW;
else else
player->mo->tracer->flags2 &= ~MF2_DONTDRAW; player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
} }*/
player->pflags &= ~PF_SLIDING; player->pflags &= ~PF_SLIDING;
@ -9546,12 +9499,6 @@ void P_PlayerAfterThink(player_t *player)
if (player->playerstate == PST_DEAD) if (player->playerstate == PST_DEAD)
{ {
// camera may still move when guy is dead
//if (!netgame)
{
if (thiscam && thiscam->chase)
P_MoveChaseCamera(player, thiscam, false);
}
return; return;
} }
@ -9833,8 +9780,6 @@ void P_PlayerAfterThink(player_t *player)
player->viewz = player->mo->z + player->mo->height - player->viewheight; player->viewz = player->mo->z + player->mo->height - player->viewheight;
else else
player->viewz = player->mo->z + player->viewheight; player->viewz = player->mo->z + player->viewheight;
if (server || addedtogame)
P_MoveChaseCamera(player, thiscam, false); // calculate the camera movement
} }
} }

View File

@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end)
newend = solidsegs + 2; newend = solidsegs + 2;
} }
// R_DoorClosed
//
// This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff.
//
// It assumes that Doom has already ruled out a door being closed because
// of front-back closure (e.g. front floor is taller than back ceiling).
static INT32 R_DoorClosed(void)
{
return
// if door is closed because back is shut:
backsector->ceilingheight <= backsector->floorheight
// preserve a kind of transparent door/lift special effect:
&& (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
&& (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
// properly render skies (consider door "open" if both ceilings are sky):
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum);
}
// //
// If player's view height is underneath fake floor, lower the // If player's view height is underneath fake floor, lower the
// drawn ceiling to be just under the floor height, and replace // drawn ceiling to be just under the floor height, and replace
@ -502,21 +478,24 @@ static void R_AddLine(seg_t *line)
SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight)
SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
if ((backc1 <= frontf1 && backc2 <= frontf2) if (viewsector != backsector && viewsector != frontsector)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{ {
goto clipsolid; if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{
goto clipsolid;
}
// Check for automap fix. Store in doorclosed for r_segs.c
doorclosed = (backc1 <= backf1 && backc2 <= backf2
&& ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture)
&& ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
if (doorclosed)
goto clipsolid;
} }
// Check for automap fix. Store in doorclosed for r_segs.c
doorclosed = (backc1 <= backf1 && backc2 <= backf2
&& ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture)
&& ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
if (doorclosed)
goto clipsolid;
// Window. // Window.
if (backc1 != frontc1 || backc2 != frontc2 if (backc1 != frontc1 || backc2 != frontc2
|| backf1 != frontf1 || backf2 != frontf2) || backf1 != frontf1 || backf2 != frontf2)
@ -527,16 +506,23 @@ static void R_AddLine(seg_t *line)
else else
#endif #endif
{ {
if (backsector->ceilingheight <= frontsector->floorheight if (viewsector != backsector && viewsector != frontsector)
|| backsector->floorheight >= frontsector->ceilingheight)
{ {
goto clipsolid; if (backsector->ceilingheight <= frontsector->floorheight
} || backsector->floorheight >= frontsector->ceilingheight)
{
goto clipsolid;
}
// Check for automap fix. Store in doorclosed for r_segs.c // Check for automap fix. Store in doorclosed for r_segs.c
doorclosed = R_DoorClosed(); doorclosed = (backsector->ceilingheight <= backsector->floorheight
if (doorclosed) && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
goto clipsolid; && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
if (doorclosed)
goto clipsolid;
}
// Window. // Window.
if (backsector->ceilingheight != frontsector->ceilingheight if (backsector->ceilingheight != frontsector->ceilingheight
@ -1126,30 +1112,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber)
&& polysec->floorheight >= floorcenterz && polysec->floorheight >= floorcenterz
&& (viewz < polysec->floorheight)) && (viewz < polysec->floorheight))
{ {
fixed_t xoff, yoff;
xoff = polysec->floor_xoffs;
yoff = polysec->floor_yoffs;
if (po->angle != 0) {
angle_t fineshift = po->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y);
} else {
xoff -= po->centerPt.x;
yoff += po->centerPt.y;
}
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
light = 0; light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
polysec->lightlevel, xoff, yoff, polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
polysec->floorpic_angle-po->angle, polysec->floorpic_angle-po->angle,
NULL, NULL, NULL, po
NULL
#ifdef POLYOBJECTS_PLANES
, po
#endif
#ifdef ESLOPE #ifdef ESLOPE
, NULL // will ffloors be slopable eventually? , NULL // will ffloors be slopable eventually?
#endif #endif
@ -1174,28 +1142,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber)
&& polysec->ceilingheight <= ceilingcenterz && polysec->ceilingheight <= ceilingcenterz
&& (viewz > polysec->ceilingheight)) && (viewz > polysec->ceilingheight))
{ {
fixed_t xoff, yoff;
xoff = polysec->ceiling_xoffs;
yoff = polysec->ceiling_yoffs;
if (po->angle != 0) {
angle_t fineshift = po->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y);
} else {
xoff -= po->centerPt.x;
yoff += po->centerPt.y;
}
light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight); light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight);
light = 0; light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle, polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs,
NULL, NULL polysec->ceilingpic_angle-po->angle,
#ifdef POLYOBJECTS_PLANES NULL, NULL, po
, po
#endif
#ifdef ESLOPE #ifdef ESLOPE
, NULL // will ffloors be slopable eventually? , NULL // will ffloors be slopable eventually?
#endif #endif

View File

@ -476,40 +476,22 @@ void R_LoadTextures(void)
} }
else else
{ {
UINT16 patchcount = 1;
//CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height); //CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height);
if (SHORT(patchlump->width) == 64 texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
&& SHORT(patchlump->height) == 64)
{ // 64x64 patch
const column_t *column;
for (k = 0; k < SHORT(patchlump->width); k++)
{ // Find use of transparency.
column = (const column_t *)((const UINT8 *)patchlump + LONG(patchlump->columnofs[k]));
if (column->length != SHORT(patchlump->height))
break;
}
if (k == SHORT(patchlump->width))
patchcount = 2; // No transparency? 64x128 texture.
}
texture = textures[i] = Z_Calloc(sizeof(texture_t) + (sizeof(texpatch_t) * patchcount), PU_STATIC, NULL);
// Set texture properties. // Set texture properties.
M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name)); M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name));
texture->width = SHORT(patchlump->width); texture->width = SHORT(patchlump->width);
texture->height = SHORT(patchlump->height)*patchcount; texture->height = SHORT(patchlump->height);
texture->patchcount = patchcount; texture->patchcount = 1;
texture->holes = false; texture->holes = false;
// Allocate information for the texture's patches. // Allocate information for the texture's patches.
for (k = 0; k < patchcount; k++) patch = &texture->patches[0];
{
patch = &texture->patches[k];
patch->originx = 0; patch->originx = patch->originy = 0;
patch->originy = (INT16)(k*patchlump->height); patch->wad = (UINT16)w;
patch->wad = (UINT16)w; patch->lump = texstart + j;
patch->lump = texstart + j;
}
Z_Unlock(patchlump); Z_Unlock(patchlump);
@ -1071,9 +1053,6 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap)
static lumpnum_t foundcolormaps[MAXCOLORMAPS]; static lumpnum_t foundcolormaps[MAXCOLORMAPS];
static char colormapFixingArray[MAXCOLORMAPS][3][9];
static size_t carrayindex;
// //
// R_ClearColormaps // R_ClearColormaps
// //
@ -1085,8 +1064,6 @@ void R_ClearColormaps(void)
num_extra_colormaps = 0; num_extra_colormaps = 0;
carrayindex = 0;
for (i = 0; i < MAXCOLORMAPS; i++) for (i = 0; i < MAXCOLORMAPS; i++)
foundcolormaps[i] = LUMPERROR; foundcolormaps[i] = LUMPERROR;
@ -1140,10 +1117,20 @@ static double deltas[256][3], map[256][3];
static UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); static UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b);
static int RoundUp(double number); static int RoundUp(double number);
#ifdef HASINVERT
void R_MakeInvertmap(void)
{
size_t i;
for (i = 0; i < 256; i++)
invertmap[i] = NearestColor(256 - pLocalPalette[i].s.red, 256 - pLocalPalette[i].s.green, 256 - pLocalPalette[i].s.blue);
}
#endif
INT32 R_CreateColormap(char *p1, char *p2, char *p3) INT32 R_CreateColormap(char *p1, char *p2, char *p3)
{ {
double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb; double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb;
double r, g, b, cbrightness, maskamt = 0, othermask = 0; double maskamt = 0, othermask = 0;
int mask, fog = 0; int mask, fog = 0;
size_t mapnum = num_extra_colormaps; size_t mapnum = num_extra_colormaps;
size_t i; size_t i;
@ -1206,7 +1193,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
fadedist = fadeend - fadestart; fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]); fog = NUMFROMCHAR(p2[1]);
} }
#undef getnum #undef NUMFROMCHAR
if (p3[0] == '#') if (p3[0] == '#')
{ {
@ -1249,14 +1236,30 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
if (num_extra_colormaps == MAXCOLORMAPS) if (num_extra_colormaps == MAXCOLORMAPS)
I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS); I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS);
strncpy(colormapFixingArray[num_extra_colormaps][0], p1, 8);
strncpy(colormapFixingArray[num_extra_colormaps][1], p2, 8);
strncpy(colormapFixingArray[num_extra_colormaps][2], p3, 8);
num_extra_colormaps++; num_extra_colormaps++;
foundcolormaps[mapnum] = LUMPERROR;
// aligned on 8 bit for asm code
extra_colormaps[mapnum].colormap = NULL;
extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor;
extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor;
extra_colormaps[mapnum].maskamt = maskamt;
extra_colormaps[mapnum].fadestart = (UINT16)fadestart;
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
extra_colormaps[mapnum].fog = fog;
if (rendermode == render_soft) if (rendermode == render_soft)
{ {
double r, g, b, cbrightness;
int p;
lighttable_t *colormap_p;
// Initialise the map and delta arrays
// map[i] stores an RGB color (as double) for index i,
// which is then converted to SRB2's palette later
// deltas[i] stores a corresponding fade delta between the RGB color and the final fade color;
// map[i]'s values are decremented by after each use
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
{ {
r = pLocalPalette[i].s.red; r = pLocalPalette[i].s.red;
@ -1279,199 +1282,13 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
map[i][2] = 255.0l; map[i][2] = 255.0l;
deltas[i][2] = (map[i][2] - cdestb) / (double)fadedist; deltas[i][2] = (map[i][2] - cdestb) / (double)fadedist;
} }
}
foundcolormaps[mapnum] = LUMPERROR; // Now allocate memory for the actual colormap array itself!
// aligned on 8 bit for asm code
extra_colormaps[mapnum].colormap = NULL;
extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor;
extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor;
extra_colormaps[mapnum].maskamt = maskamt;
extra_colormaps[mapnum].fadestart = (UINT16)fadestart;
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
extra_colormaps[mapnum].fog = fog;
return (INT32)mapnum;
}
void R_MakeColormaps(void)
{
size_t i;
carrayindex = num_extra_colormaps;
num_extra_colormaps = 0;
for (i = 0; i < carrayindex; i++)
R_CreateColormap2(colormapFixingArray[i][0], colormapFixingArray[i][1],
colormapFixingArray[i][2]);
}
#ifdef HASINVERT
void R_MakeInvertmap(void)
{
size_t i;
for (i = 0; i < 256; i++)
invertmap[i] = NearestColor(256 - pLocalPalette[i].s.red, 256 - pLocalPalette[i].s.green, 256 - pLocalPalette[i].s.blue);
}
#endif
void R_CreateColormap2(char *p1, char *p2, char *p3)
{
double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb;
double r, g, b, cbrightness;
double maskamt = 0, othermask = 0;
INT32 mask, p, fog = 0;
size_t mapnum = num_extra_colormaps;
size_t i;
lighttable_t *colormap_p, *colormap_p2;
UINT32 cr, cg, cb, maskcolor, fadecolor;
UINT32 fadestart = 0, fadeend = 31, fadedist = 31;
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
if (p1[0] == '#')
{
cr = ((HEX2INT(p1[1]) * 16) + HEX2INT(p1[2]));
cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4]));
cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6]));
if (encoremap)
{
i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)];
cr = pLocalPalette[i].s.red;
cg = pLocalPalette[i].s.green;
cb = pLocalPalette[i].s.blue;
}
cmaskr = cr;
cmaskg = cg;
cmaskb = cb;
// Create a rough approximation of the color (a 16 bit color)
maskcolor = ((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11);
if (p1[7] >= 'a' && p1[7] <= 'z')
mask = (p1[7] - 'a');
else if (p1[7] >= 'A' && p1[7] <= 'Z')
mask = (p1[7] - 'A');
else
mask = 24;
maskamt = (double)(mask/24.0l);
othermask = 1 - maskamt;
maskamt /= 0xff;
cmaskr *= maskamt;
cmaskg *= maskamt;
cmaskb *= maskamt;
}
else
{
cmaskr = cmaskg = cmaskb = 0xff;
maskamt = 0;
maskcolor = ((0xff) >> 3) + (((0xff) >> 2) << 5) + (((0xff) >> 3) << 11);
}
#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0)
if (p2[0] == '#')
{
// Get parameters like fadestart, fadeend, and the fogflag
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10);
if (fadestart > 30)
fadestart = 0;
if (fadeend > 31 || fadeend < 1)
fadeend = 31;
fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]);
}
#undef getnum
if (p3[0] == '#')
{
cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2]));
cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4]));
cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6]));
if (encoremap)
{
i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)];
cr = pLocalPalette[i].s.red;
cg = pLocalPalette[i].s.green;
cb = pLocalPalette[i].s.blue;
}
cdestr = cr;
cdestg = cg;
cdestb = cb;
fadecolor = (((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11));
}
else
cdestr = cdestg = cdestb = fadecolor = 0;
#undef HEX2INT
for (i = 0; i < num_extra_colormaps; i++)
{
if (foundcolormaps[i] != LUMPERROR)
continue;
if (maskcolor == extra_colormaps[i].maskcolor
&& fadecolor == extra_colormaps[i].fadecolor
&& (float)maskamt == (float)extra_colormaps[i].maskamt
&& fadestart == extra_colormaps[i].fadestart
&& fadeend == extra_colormaps[i].fadeend
&& fog == extra_colormaps[i].fog)
{
return;
}
}
if (num_extra_colormaps == MAXCOLORMAPS)
I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS);
num_extra_colormaps++;
if (rendermode == render_soft)
{
for (i = 0; i < 256; i++)
{
r = pLocalPalette[i].s.red;
g = pLocalPalette[i].s.green;
b = pLocalPalette[i].s.blue;
cbrightness = sqrt((r*r) + (g*g) + (b*b));
map[i][0] = (cbrightness * cmaskr) + (r * othermask);
if (map[i][0] > 255.0l)
map[i][0] = 255.0l;
deltas[i][0] = (map[i][0] - cdestr) / (double)fadedist;
map[i][1] = (cbrightness * cmaskg) + (g * othermask);
if (map[i][1] > 255.0l)
map[i][1] = 255.0l;
deltas[i][1] = (map[i][1] - cdestg) / (double)fadedist;
map[i][2] = (cbrightness * cmaskb) + (b * othermask);
if (map[i][2] > 255.0l)
map[i][2] = 255.0l;
deltas[i][2] = (map[i][2] - cdestb) / (double)fadedist;
}
}
foundcolormaps[mapnum] = LUMPERROR;
// aligned on 8 bit for asm code
extra_colormaps[mapnum].colormap = NULL;
extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor;
extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor;
extra_colormaps[mapnum].maskamt = maskamt;
extra_colormaps[mapnum].fadestart = (UINT16)fadestart;
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
extra_colormaps[mapnum].fog = fog;
#define ABS2(x) ((x) < 0 ? -(x) : (x))
if (rendermode == render_soft)
{
colormap_p = Z_MallocAlign((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL, 8); colormap_p = Z_MallocAlign((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL, 8);
extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p; extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p;
// Calculate the palette index for each palette index, for each light level
// (as well as the two unused colormap lines we inherited from Doom)
for (p = 0; p < 32; p++) for (p = 0; p < 32; p++)
{ {
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
@ -1483,7 +1300,7 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
if ((UINT32)p < fadestart) if ((UINT32)p < fadestart)
continue; continue;
#define ABS2(x) ((x) < 0 ? -(x) : (x))
if (ABS2(map[i][0] - cdestr) > ABS2(deltas[i][0])) if (ABS2(map[i][0] - cdestr) > ABS2(deltas[i][0]))
map[i][0] -= deltas[i][0]; map[i][0] -= deltas[i][0];
else else
@ -1498,27 +1315,27 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
map[i][2] -= deltas[i][2]; map[i][2] -= deltas[i][2];
else else
map[i][2] = cdestb; map[i][2] = cdestb;
#undef ABS2
} }
} }
if (!encoremap) if (encoremap)
return;
colormap_p2 = extra_colormaps[mapnum].colormap;
for (p = 0; p < 32; p++)
{ {
for (i = 0; i < 256; i++) lighttable_t *colormap_p2 = extra_colormaps[mapnum].colormap;
for (p = 0; p < 32; p++)
{ {
*colormap_p = colormap_p2[encoremap[i]]; for (i = 0; i < 256; i++)
colormap_p++; {
*colormap_p = colormap_p2[encoremap[i]];
colormap_p++;
}
colormap_p2 += 256;
} }
colormap_p2 += 256;
} }
} }
#undef ABS2
return; return (INT32)mapnum;
} }
// Thanks to quake2 source! // Thanks to quake2 source!

View File

@ -93,8 +93,6 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap);
void R_ClearColormaps(void); void R_ClearColormaps(void);
INT32 R_ColormapNumForName(char *name); INT32 R_ColormapNumForName(char *name);
INT32 R_CreateColormap(char *p1, char *p2, char *p3); INT32 R_CreateColormap(char *p1, char *p2, char *p3);
void R_CreateColormap2(char *p1, char *p2, char *p3);
void R_MakeColormaps(void);
#ifdef HASINVERT #ifdef HASINVERT
void R_MakeInvertmap(void); void R_MakeInvertmap(void);
#endif #endif

View File

@ -60,7 +60,6 @@ fixed_t projectiony; // aspect ratio
// just for profiling purposes // just for profiling purposes
size_t framecount; size_t framecount;
size_t sscount;
size_t loopcount; size_t loopcount;
fixed_t viewx, viewy, viewz; fixed_t viewx, viewy, viewz;
@ -123,11 +122,19 @@ size_t num_extra_colormaps;
extracolormap_t extra_colormaps[MAXCOLORMAPS]; extracolormap_t extra_colormaps[MAXCOLORMAPS];
static CV_PossibleValue_t drawdist_cons_t[] = { static CV_PossibleValue_t drawdist_cons_t[] = {
{256, "256"}, {512, "512"}, {768, "768"}, /*{256, "256"},*/ {512, "512"}, {768, "768"},
{1024, "1024"}, {1536, "1536"}, {2048, "2048"}, {1024, "1024"}, {1536, "1536"}, {2048, "2048"},
{3072, "3072"}, {4096, "4096"}, {6144, "6144"}, {3072, "3072"}, {4096, "4096"}, {6144, "6144"},
{8192, "8192"}, {0, "Infinite"}, {0, NULL}}; {8192, "8192"}, {0, "Infinite"}, {0, NULL}};
static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
//static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
{256, "256"}, {512, "512"}, {768, "768"},
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
{0, "None"}, {0, NULL}};
//static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NULL}}; // lmao rendering 32 portals, you're a card static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NULL}}; // lmao rendering 32 portals, you're a card
static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}}; static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}};
@ -165,9 +172,9 @@ consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_c
consvar_t cv_translucency = {"translucency", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_translucency = {"translucency", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_drawdist_nights = {"drawdist_nights", "2048", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //consvar_t cv_drawdist_nights = {"drawdist_nights", "2048", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_precip_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// Okay, whoever said homremoval causes a performance hit should be shot. // Okay, whoever said homremoval causes a performance hit should be shot.
consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -557,9 +564,6 @@ static void R_InitTextureMapping(void)
// Take out the fencepost cases from viewangletox. // Take out the fencepost cases from viewangletox.
for (i = 0; i < FINEANGLES/2; i++) for (i = 0; i < FINEANGLES/2; i++)
{ {
t = FixedMul(FINETANGENT(i), focallength);
t = centerx - t;
if (viewangletox[i] == -1) if (viewangletox[i] == -1)
viewangletox[i] = 0; viewangletox[i] = 0;
else if (viewangletox[i] == viewwidth+1) else if (viewangletox[i] == viewwidth+1)
@ -1048,8 +1052,6 @@ void R_SkyboxFrame(player_t *player)
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
sscount = 0;
// recalc necessary stuff for mouseaiming // recalc necessary stuff for mouseaiming
// slopes are already calculated for the full possible view (which is 4*viewheight). // slopes are already calculated for the full possible view (which is 4*viewheight).
@ -1094,10 +1096,10 @@ void R_SetupFrame(player_t *player, boolean skybox)
chasecam = (cv_chasecam.value != 0); chasecam = (cv_chasecam.value != 0);
} }
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD) if (player->spectator) // no spectator chasecam
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off chasecam = false; // force chasecam off
else if (player->playerstate == PST_DEAD || player->exiting)
chasecam = true; // force chasecam on
if (chasecam && !thiscam->chase) if (chasecam && !thiscam->chase)
{ {
@ -1192,8 +1194,6 @@ void R_SetupFrame(player_t *player, boolean skybox)
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
sscount = 0;
// recalc necessary stuff for mouseaiming // recalc necessary stuff for mouseaiming
// slopes are already calculated for the full possible view (which is 4*viewheight). // slopes are already calculated for the full possible view (which is 4*viewheight).
@ -1349,9 +1349,9 @@ void R_RenderPlayerView(player_t *player)
if (cv_homremoval.value && player == &players[displayplayer]) if (cv_homremoval.value && player == &players[displayplayer])
{ {
if (cv_homremoval.value == 1) if (cv_homremoval.value == 1)
V_DrawFill(0, 0, vid.width, vid.height, 31); // No HOM effect! V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // No HOM effect!
else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
V_DrawFill(0, 0, vid.width, vid.height, 128+(timeinmap&15)); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 128+(timeinmap&15));
} }
// Draw over the fourth screen so you don't have to stare at a HOM :V // Draw over the fourth screen so you don't have to stare at a HOM :V
else if (splitscreen == 2 && player == &players[thirddisplayplayer]) else if (splitscreen == 2 && player == &players[thirddisplayplayer])
@ -1513,10 +1513,10 @@ void R_RegisterEngineStuff(void)
if (dedicated) if (dedicated)
return; return;
CV_RegisterVar(&cv_precipdensity); //CV_RegisterVar(&cv_precipdensity);
CV_RegisterVar(&cv_translucency); CV_RegisterVar(&cv_translucency);
CV_RegisterVar(&cv_drawdist); CV_RegisterVar(&cv_drawdist);
CV_RegisterVar(&cv_drawdist_nights); //CV_RegisterVar(&cv_drawdist_nights);
CV_RegisterVar(&cv_drawdist_precip); CV_RegisterVar(&cv_drawdist_precip);
CV_RegisterVar(&cv_chasecam); CV_RegisterVar(&cv_chasecam);

View File

@ -77,7 +77,7 @@ extern consvar_t cv_chasecam, cv_chasecam2, cv_chasecam3, cv_chasecam4;
extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4; extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
extern consvar_t cv_shadow, cv_shadowoffs; extern consvar_t cv_shadow, cv_shadowoffs;
extern consvar_t cv_translucency; extern consvar_t cv_translucency;
extern consvar_t cv_precipdensity, cv_drawdist, cv_drawdist_nights, cv_drawdist_precip; extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip;
extern consvar_t cv_skybox; extern consvar_t cv_skybox;
extern consvar_t cv_tailspickup; extern consvar_t cv_tailspickup;

View File

@ -450,19 +450,37 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
#ifdef ESLOPE #ifdef ESLOPE
if (slope); else // Don't mess with this right now if a slope is involved if (slope); else // Don't mess with this right now if a slope is involved
#endif #endif
if (plangle != 0)
{
// Add the view offset, rotated by the plane angle.
angle_t angle = plangle>>ANGLETOFINESHIFT;
xoff += FixedMul(viewx,FINECOSINE(angle))-FixedMul(viewy,FINESINE(angle));
yoff += -FixedMul(viewx,FINESINE(angle))-FixedMul(viewy,FINECOSINE(angle));
}
else
{ {
xoff += viewx; xoff += viewx;
yoff -= viewy; yoff -= viewy;
if (plangle != 0)
{
// Add the view offset, rotated by the plane angle.
fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT);
fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT);
fixed_t oldxoff = xoff;
xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent);
yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent);
}
} }
#ifdef POLYOBJECTS_PLANES
if (polyobj)
{
if (polyobj->angle != 0)
{
angle_t fineshift = polyobj->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), polyobj->centerPt.x)+FixedMul(FINESINE(fineshift), polyobj->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), polyobj->centerPt.x)-FixedMul(FINECOSINE(fineshift), polyobj->centerPt.y);
}
else
{
xoff -= polyobj->centerPt.x;
yoff += polyobj->centerPt.y;
}
}
#endif
// This appears to fix the Nimbus Ruins sky bug. // This appears to fix the Nimbus Ruins sky bug.
if (picnum == skyflatnum && pfloor) if (picnum == skyflatnum && pfloor)
{ {
@ -488,6 +506,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
&& !pfloor && !check->ffloor && !pfloor && !check->ffloor
&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
&& check->viewangle == viewangle && check->viewangle == viewangle
&& check->plangle == plangle
#ifdef ESLOPE #ifdef ESLOPE
&& check->slope == slope && check->slope == slope
#endif #endif
@ -974,23 +993,65 @@ void R_DrawSinglePlane(visplane_t *pl)
#ifdef ESLOPE #ifdef ESLOPE
if (pl->slope) { if (pl->slope) {
// Potentially override other stuff for now cus we're mean. :< But draw a slope plane! // Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
// I copied ZDoom's code and adapted it to SRB2... -Red // I copied ZDoom's code and adapted it to SRB2... -fickle
floatv3_t p, m, n; floatv3_t p, m, n;
float ang; float ang;
float vx, vy, vz; float vx, vy, vz;
float fudge;
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_GetZAt's return value each time // use this as a temp var to store P_GetZAt's return value each time
fixed_t temp; fixed_t temp;
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -fickle
const float fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
xoffs &= ((1 << (32-nflatshiftup))-1); angle_t hack = (pl->plangle & (ANGLE_90-1));
yoffs &= ((1 << (32-nflatshiftup))-1);
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); if (hack)
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); {
/*
Essentially: We can't & the components along the regular axes when the plane is rotated.
This is because the distance on each regular axis in order to loop is different.
We rotate them, & the components, add them together, & them again, and then rotate them back.
These three seperate & operations are done per axis in order to prevent overflows.
toast 10/04/17
---
...of coooourse, this still isn't perfect. but it looks... merely kind of grody, rather than
completely wrong? idk. i'm just backporting this to kart right now. if anyone else wants to
ever try dig around: it's drifting towards 0,0, and no, multiplying by fudge doesn't fix it.
toast 27/09/18
*/
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red const fixed_t cosinecomponent = FINECOSINE(hack>>ANGLETOFINESHIFT);
fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup); const fixed_t sinecomponent = FINESINE(hack>>ANGLETOFINESHIFT);
const fixed_t modmask = ((1 << (32-nflatshiftup)) - 1);
fixed_t ox = (FixedMul(pl->slope->o.x,cosinecomponent) & modmask) - (FixedMul(pl->slope->o.y,sinecomponent) & modmask);
fixed_t oy = (-FixedMul(pl->slope->o.x,sinecomponent) & modmask) - (FixedMul(pl->slope->o.y,cosinecomponent) & modmask);
temp = ox & modmask;
oy &= modmask;
ox = FixedMul(temp,cosinecomponent)+FixedMul(oy,-sinecomponent); // negative sine for opposite direction
oy = -FixedMul(temp,-sinecomponent)+FixedMul(oy,cosinecomponent);
temp = xoffs;
xoffs = (FixedMul(temp,cosinecomponent) & modmask) + (FixedMul(yoffs,sinecomponent) & modmask);
yoffs = (-FixedMul(temp,sinecomponent) & modmask) + (FixedMul(yoffs,cosinecomponent) & modmask);
temp = xoffs & modmask;
yoffs &= modmask;
xoffs = FixedMul(temp,cosinecomponent)+FixedMul(yoffs,-sinecomponent); // ditto
yoffs = -FixedMul(temp,-sinecomponent)+FixedMul(yoffs,cosinecomponent);
xoffs -= (pl->slope->o.x - ox);
yoffs += (pl->slope->o.y + oy);
}
else
{
xoffs &= ((1 << (32-nflatshiftup))-1);
yoffs &= ((1 << (32-nflatshiftup))-1);
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
}
xoffs = (fixed_t)(xoffs*fudge); xoffs = (fixed_t)(xoffs*fudge);
yoffs = (fixed_t)(yoffs/fudge); yoffs = (fixed_t)(yoffs/fudge);

View File

@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void)
if (bottom >= floorclip[rw_x]) if (bottom >= floorclip[rw_x])
bottom = floorclip[rw_x]-1; bottom = floorclip[rw_x]-1;
if (top <= bottom) if (top <= bottom && ceilingplane)
{ {
ceilingplane->top[rw_x] = (INT16)top; ceilingplane->top[rw_x] = (INT16)top;
ceilingplane->bottom[rw_x] = (INT16)bottom; ceilingplane->bottom[rw_x] = (INT16)bottom;
@ -2113,52 +2113,55 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// ds_p->sprtopclip = screenheightarray; // ds_p->sprtopclip = screenheightarray;
} }
#ifdef ESLOPE if (viewsector != frontsector && viewsector != backsector)
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else
if (worldhigh <= worldbottom)
#endif
{
ds_p->sprbottomclip = negonearray;
ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM;
}
#ifdef ESLOPE
if (worldlow >= worldtop && worldlowslope >= worldtopslope)
#else
if (worldlow >= worldtop)
#endif
{
ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;
}
//SoM: 3/25/2000: This code fixes an automap bug that didn't check
// frontsector->ceiling and backsector->floor to see if a door was closed.
// Without the following code, sprites get displayed behind closed doors.
{ {
#ifdef ESLOPE #ifdef ESLOPE
if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else #else
if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) if (worldhigh <= worldbottom)
#endif #endif
{ {
ds_p->sprbottomclip = negonearray; ds_p->sprbottomclip = negonearray;
ds_p->bsilheight = INT32_MAX; ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM; ds_p->silhouette |= SIL_BOTTOM;
} }
#ifdef ESLOPE #ifdef ESLOPE
if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) if (worldlow >= worldtop && worldlowslope >= worldtopslope)
#else #else
if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) if (worldlow >= worldtop)
#endif #endif
{ // killough 1/17/98, 2/8/98 {
ds_p->sprtopclip = screenheightarray; ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN; ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP; ds_p->silhouette |= SIL_TOP;
} }
//SoM: 3/25/2000: This code fixes an automap bug that didn't check
// frontsector->ceiling and backsector->floor to see if a door was closed.
// Without the following code, sprites get displayed behind closed doors.
{
#ifdef ESLOPE
if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope))
#else
if (doorclosed || backsector->ceilingheight <= frontsector->floorheight)
#endif
{
ds_p->sprbottomclip = negonearray;
ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM;
}
#ifdef ESLOPE
if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope))
#else
if (doorclosed || backsector->floorheight >= frontsector->ceilingheight)
#endif
{ // killough 1/17/98, 2/8/98
ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;
}
}
} }
if (worldlow != worldbottom if (worldlow != worldbottom

View File

@ -112,7 +112,4 @@ extern angle_t rw_normalangle;
// angle to line origin // angle to line origin
extern angle_t rw_angle1; extern angle_t rw_angle1;
// Segs count?
extern size_t sscount;
#endif #endif

View File

@ -1602,6 +1602,17 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
return; return;
} }
// okay, we can't return now except for vertical clipping... this is a hack, but weather isn't networked, so it should be ok
if (!(thing->precipflags & PCF_THUNK))
{
if (thing->precipflags & PCF_RAIN)
P_RainThinker(thing);
else
P_SnowThinker(thing);
thing->precipflags |= PCF_THUNK;
}
//SoM: 3/17/2000: Disregard sprites that are out of view.. //SoM: 3/17/2000: Disregard sprites that are out of view..
gzt = thing->z + spritecachedinfo[lump].topoffset; gzt = thing->z + spritecachedinfo[lump].topoffset;
gz = gzt - spritecachedinfo[lump].height; gz = gzt - spritecachedinfo[lump].height;
@ -1712,7 +1723,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
// Handle all things in sector. // Handle all things in sector.
// If a limit exists, handle things a tiny bit different. // If a limit exists, handle things a tiny bit different.
if ((limit_dist = (fixed_t)((maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : cv_drawdist.value) << FRACBITS)) if ((limit_dist = (fixed_t)(/*(maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : */cv_drawdist.value) << FRACBITS))
{ {
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
{ {
@ -1740,8 +1751,10 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
if (approx_dist <= limit_dist) if (approx_dist > limit_dist)
R_ProjectSprite(thing); continue;
R_ProjectSprite(thing);
} }
} }
else else
@ -1785,8 +1798,10 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y); approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
if (approx_dist <= limit_dist) if (approx_dist > limit_dist)
R_ProjectPrecipitationSprite(precipthing); continue;
R_ProjectPrecipitationSprite(precipthing);
} }
} }
else else

View File

@ -85,7 +85,7 @@ consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
#else #else
consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
#endif #endif
consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -186,7 +186,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo)
} }
else if (origin && channels[cnum].origin == origin else if (origin && channels[cnum].origin == origin
&& channels[cnum].sfxinfo->name != sfxinfo->name && channels[cnum].sfxinfo->name != sfxinfo->name
&& channels[cnum].sfxinfo->pitch == SF_TOTALLYSINGLE && sfxinfo->pitch == SF_TOTALLYSINGLE) && (channels[cnum].sfxinfo->pitch & SF_TOTALLYSINGLE) && (sfxinfo->pitch & SF_TOTALLYSINGLE))
{ {
S_StopChannel(cnum); S_StopChannel(cnum);
break; break;
@ -582,7 +582,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
} }
dontplay: dontplay:
@ -638,7 +638,7 @@ dontplay:
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
} }
dontplay3: dontplay3:
@ -694,7 +694,7 @@ dontplay3:
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
} }
dontplay4: dontplay4:
@ -743,7 +743,7 @@ dontplay4:
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
} }
void S_StartSound(const void *origin, sfxenum_t sfx_id) void S_StartSound(const void *origin, sfxenum_t sfx_id)

View File

@ -124,6 +124,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include "macosx/mac_resources.h" #include "macosx/mac_resources.h"
#endif #endif
#ifndef errno
#include <errno.h>
#endif
// Locations for searching the srb2.srb // Locations for searching the srb2.srb
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2" #define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2"
@ -1179,6 +1183,7 @@ static void I_ShutdownJoystick2(void)
D_PostEvent(&event); D_PostEvent(&event);
} }
joystick2_started = 0;
JoyReset(&JoyInfo2); JoyReset(&JoyInfo2);
if (!joystick_started && !joystick2_started && !joystick3_started && !joystick4_started if (!joystick_started && !joystick2_started && !joystick3_started && !joystick4_started
&& SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK) && SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK)
@ -2309,7 +2314,7 @@ static void I_ShutdownMouse2(void)
EscapeCommFunction(mouse2filehandle, CLRRTS); EscapeCommFunction(mouse2filehandle, CLRRTS);
PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT | PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT |
PURGE_TXCLEAR | PURGE_RXCLEAR); PURGE_TXCLEAR | PURGE_RXCLEAR);
CloseHandle(mouse2filehandle); CloseHandle(mouse2filehandle);
@ -2502,11 +2507,11 @@ void I_StartupMouse2(void)
{ {
// COM file handle // COM file handle
mouse2filehandle = CreateFileA(cv_mouse2port.string, GENERIC_READ | GENERIC_WRITE, mouse2filehandle = CreateFileA(cv_mouse2port.string, GENERIC_READ | GENERIC_WRITE,
0, // exclusive access 0, // exclusive access
NULL, // no security attrs NULL, // no security attrs
OPEN_EXISTING, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_NORMAL,
NULL); NULL);
if (mouse2filehandle == INVALID_HANDLE_VALUE) if (mouse2filehandle == INVALID_HANDLE_VALUE)
{ {
INT32 e = GetLastError(); INT32 e = GetLastError();
@ -2526,7 +2531,7 @@ void I_StartupMouse2(void)
// purge buffers // purge buffers
PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT
| PURGE_TXCLEAR | PURGE_RXCLEAR); | PURGE_TXCLEAR | PURGE_RXCLEAR);
// setup port to 1200 7N1 // setup port to 1200 7N1
dcb.DCBlength = sizeof (DCB); dcb.DCBlength = sizeof (DCB);
@ -2687,7 +2692,7 @@ static void I_ShutdownTimer(void)
tic_t I_GetTime (void) tic_t I_GetTime (void)
{ {
static Uint32 basetime = 0; static Uint32 basetime = 0;
Uint32 ticks = SDL_GetTicks(); Uint32 ticks = SDL_GetTicks();
if (!basetime) if (!basetime)
basetime = ticks; basetime = ticks;
@ -2753,7 +2758,6 @@ INT32 I_StartupSystem(void)
return 0; return 0;
} }
// //
// I_Quit // I_Quit
// //
@ -3032,7 +3036,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
{ {
DWORD SectorsPerCluster, BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters; DWORD SectorsPerCluster, BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters;
GetDiskFreeSpace(NULL, &SectorsPerCluster, &BytesPerSector, GetDiskFreeSpace(NULL, &SectorsPerCluster, &BytesPerSector,
&NumberOfFreeClusters, &TotalNumberOfClusters); &NumberOfFreeClusters, &TotalNumberOfClusters);
*freespace = BytesPerSector*SectorsPerCluster*NumberOfFreeClusters; *freespace = BytesPerSector*SectorsPerCluster*NumberOfFreeClusters;
} }
#else // Dummy for platform independent; 1GB should be enough #else // Dummy for platform independent; 1GB should be enough
@ -3254,22 +3258,22 @@ static const char *locateWad(void)
#ifdef CMAKECONFIG #ifdef CMAKECONFIG
#ifndef NDEBUG #ifndef NDEBUG
I_OutputMsg(","CMAKE_ASSETS_DIR); I_OutputMsg(","CMAKE_ASSETS_DIR);
strcpy(returnWadPath, CMAKE_ASSETS_DIR); strcpy(returnWadPath, CMAKE_ASSETS_DIR);
if (isWadPathOk(returnWadPath)) if (isWadPathOk(returnWadPath))
{ {
return returnWadPath; return returnWadPath;
} }
#endif #endif
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
OSX_GetResourcesPath(returnWadPath); OSX_GetResourcesPath(returnWadPath);
I_OutputMsg(",%s", returnWadPath); I_OutputMsg(",%s", returnWadPath);
if (isWadPathOk(returnWadPath)) if (isWadPathOk(returnWadPath))
{ {
return returnWadPath; return returnWadPath;
} }
#endif #endif
// examine default dirs // examine default dirs
@ -3374,7 +3378,30 @@ const char *I_LocateWad(void)
#ifdef __linux__ #ifdef __linux__
#define MEMINFO_FILE "/proc/meminfo" #define MEMINFO_FILE "/proc/meminfo"
#define MEMTOTAL "MemTotal:" #define MEMTOTAL "MemTotal:"
#define MEMAVAILABLE "MemAvailable:"
#define MEMFREE "MemFree:" #define MEMFREE "MemFree:"
#define CACHED "Cached:"
#define BUFFERS "Buffers:"
#define SHMEM "Shmem:"
/* Parse the contents of /proc/meminfo (in buf), return value of "name"
* (example: MemTotal) */
static long get_entry(const char* name, const char* buf)
{
long val;
char* hit = strstr(buf, name);
if (hit == NULL) {
return -1;
}
errno = 0;
val = strtol(hit + strlen(name), NULL, 10);
if (errno != 0) {
CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno));
return -1;
}
return val;
}
#endif #endif
// quick fix for compil // quick fix for compil
@ -3446,6 +3473,11 @@ UINT32 I_GetFreeMem(UINT32 *total)
UINT32 totalKBytes; UINT32 totalKBytes;
INT32 n; INT32 n;
INT32 meminfo_fd = -1; INT32 meminfo_fd = -1;
long Cached;
long MemFree;
long Buffers;
long Shmem;
long MemAvailable = -1;
meminfo_fd = open(MEMINFO_FILE, O_RDONLY); meminfo_fd = open(MEMINFO_FILE, O_RDONLY);
n = read(meminfo_fd, buf, 1023); n = read(meminfo_fd, buf, 1023);
@ -3471,16 +3503,28 @@ UINT32 I_GetFreeMem(UINT32 *total)
memTag += sizeof (MEMTOTAL); memTag += sizeof (MEMTOTAL);
totalKBytes = atoi(memTag); totalKBytes = atoi(memTag);
if ((memTag = strstr(buf, MEMFREE)) == NULL) if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL)
{ {
// Error Cached = get_entry(CACHED, buf);
if (total) MemFree = get_entry(MEMFREE, buf);
*total = 0L; Buffers = get_entry(BUFFERS, buf);
return 0; Shmem = get_entry(SHMEM, buf);
} MemAvailable = Cached + MemFree + Buffers - Shmem;
memTag += sizeof (MEMFREE); if (MemAvailable == -1)
freeKBytes = atoi(memTag); {
// Error
if (total)
*total = 0L;
return 0;
}
freeKBytes = MemAvailable;
}
else
{
memTag += sizeof (MEMAVAILABLE);
freeKBytes = atoi(memTag);
}
if (total) if (total)
*total = totalKBytes << 10; *total = totalKBytes << 10;

View File

@ -94,7 +94,7 @@ rendermode_t rendermode=render_soft;
boolean highcolor = false; boolean highcolor = false;
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
UINT8 graphics_started = 0; // Is used in console.c and screen.c UINT8 graphics_started = 0; // Is used in console.c and screen.c

View File

@ -38,10 +38,8 @@
#include "gme/gme.h" #include "gme/gme.h"
#define GME_TREBLE 5.0 #define GME_TREBLE 5.0
#define GME_BASS 1.0 #define GME_BASS 1.0
#ifdef HAVE_PNG /// TODO: compile with zlib support without libpng
#define HAVE_ZLIB
#ifdef HAVE_ZLIB
#ifndef _MSC_VER #ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE #ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
@ -57,8 +55,8 @@
#endif #endif
#include "zlib.h" #include "zlib.h"
#endif #endif // HAVE_ZLIB
#endif #endif // HAVE_LIBGME
UINT8 sound_started = false; UINT8 sound_started = false;
@ -178,7 +176,7 @@ static Mix_Chunk *ds2chunk(void *stream)
return NULL; // would and/or did wrap, can't store. return NULL; // would and/or did wrap, can't store.
break; break;
} }
sound = malloc(newsamples<<2); // samples * frequency shift * bytes per sample * channels sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels
s = (SINT8 *)stream; s = (SINT8 *)stream;
d = (INT16 *)sound; d = (INT16 *)sound;
@ -246,6 +244,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
{ {
void *lump; void *lump;
Mix_Chunk *chunk; Mix_Chunk *chunk;
SDL_RWops *rw;
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
Music_Emu *emu; Music_Emu *emu;
gme_info_t *info; gme_info_t *info;
@ -361,7 +360,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
} }
Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up
#else #else
//CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); return NULL; // No zlib support
#endif #endif
} }
// Try to read it as a GME sound // Try to read it as a GME sound
@ -387,21 +386,43 @@ void *I_GetSfx(sfxinfo_t *sfx)
#endif #endif
// Try to load it as a WAVE or OGG using Mixer. // Try to load it as a WAVE or OGG using Mixer.
return Mix_LoadWAV_RW(SDL_RWFromMem(lump, sfx->length), 1); rw = SDL_RWFromMem(lump, sfx->length);
if (rw != NULL)
{
chunk = Mix_LoadWAV_RW(rw, 1);
return chunk;
}
return NULL; // haven't been able to get anything
} }
void I_FreeSfx(sfxinfo_t *sfx) void I_FreeSfx(sfxinfo_t *sfx)
{ {
if (sfx->data) if (sfx->data)
{
Mix_Chunk *chunk = (Mix_Chunk*)sfx->data;
UINT8 *abufdata = NULL;
if (chunk->allocated == 0)
{
// We allocated the data in this chunk, so get the abuf from mixer, then let it free the chunk, THEN we free the data
// I believe this should ensure the sound is not playing when we free it
abufdata = chunk->abuf;
}
Mix_FreeChunk(sfx->data); Mix_FreeChunk(sfx->data);
if (abufdata)
{
// I'm going to assume we used Z_Malloc to allocate this data.
Z_Free(abufdata);
}
}
sfx->data = NULL; sfx->data = NULL;
sfx->lumpnum = LUMPERROR; sfx->lumpnum = LUMPERROR;
} }
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0);
Mix_Volume(handle, volume); Mix_Volume(handle, volume);
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
(void)pitch; // Mixer can't handle pitch (void)pitch; // Mixer can't handle pitch
@ -524,6 +545,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
char *data; char *data;
size_t len; size_t len;
lumpnum_t lumpnum = W_CheckNumForName(va("O_%s",musicname)); lumpnum_t lumpnum = W_CheckNumForName(va("O_%s",musicname));
SDL_RWops *rw;
I_Assert(!music); I_Assert(!music);
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
@ -621,7 +643,8 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
} }
Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up
#else #else
//CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n");
return true;
#endif #endif
} }
else if (!gme_open_data(data, len, &gme, 44100)) else if (!gme_open_data(data, len, &gme, 44100))
@ -635,7 +658,11 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
} }
#endif #endif
music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); rw = SDL_RWFromMem(data, len);
if (rw != NULL)
{
music = Mix_LoadMUS_RW(rw, 1);
}
if (!music) if (!music)
{ {
CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError());
@ -798,7 +825,11 @@ void I_SetMIDIMusicVolume(UINT8 volume)
INT32 I_RegisterSong(void *data, size_t len) INT32 I_RegisterSong(void *data, size_t len)
{ {
music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); SDL_RWops *rw = SDL_RWFromMem(data, len);
if (rw != NULL)
{
music = Mix_LoadMUS_RW(rw, 1);
}
if (!music) if (!music)
{ {
CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError());
@ -842,4 +873,4 @@ void I_UnRegisterSong(INT32 handle)
music = NULL; music = NULL;
} }
#endif #endif

View File

@ -604,10 +604,11 @@ void I_FreeSfx(sfxinfo_t * sfx)
// Pitching (that is, increased speed of playback) // Pitching (that is, increased speed of playback)
// is set, but currently not used by mixing. // is set, but currently not used by mixing.
// //
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
(void)priority; (void)priority;
(void)pitch; (void)pitch;
(void)channel;
if (nosound) if (nosound)
return 0; return 0;

View File

@ -150,7 +150,7 @@ boolean highcolor = false;
#if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL)) #if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL))
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#else #else
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif #endif
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View File

@ -376,10 +376,10 @@ void I_FreeSfx(sfxinfo_t *sfx)
sfx->data = NULL; sfx->data = NULL;
} }
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0);
Mix_Volume(handle, volume); Mix_Volume(handle, volume);
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
(void)pitch; // Mixer can't handle pitch (void)pitch; // Mixer can't handle pitch

View File

@ -621,10 +621,11 @@ void I_FreeSfx(sfxinfo_t * sfx)
// Pitching (that is, increased speed of playback) // Pitching (that is, increased speed of playback)
// is set, but currently not used by mixing. // is set, but currently not used by mixing.
// //
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
(void)priority; (void)priority;
(void)pitch; (void)pitch;
(void)channel;
if (nosound) if (nosound)
return 0; return 0;

View File

@ -771,9 +771,6 @@ sfxinfo_t S_sfx[NUMSFX] =
{"lkt1", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt1", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"lkt2", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt2", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"lkt3", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt3", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kart1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kart2", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kart3", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -821,6 +818,134 @@ sfxinfo_t S_sfx[NUMSFX] =
{"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2Kart - Engine sounds
// Engine class A
{"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krta12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class B
{"krtb00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtb12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class C
{"krtc00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtc12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class D
{"krtd00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtd12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class E
{"krte00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krte12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class F
{"krtf00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtf12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class G
{"krtg00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krtg12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class H
{"krth00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krth12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// Engine class I
{"krti00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
{"krti12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2kart - Skin sounds // SRB2kart - Skin sounds
{"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR},
{"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR}, {"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR},
@ -830,8 +955,8 @@ sfxinfo_t S_sfx[NUMSFX] =
{"kattk2", false, 64, 96, -1, NULL, 0, SKSKATK2, -1, LUMPERROR}, {"kattk2", false, 64, 96, -1, NULL, 0, SKSKATK2, -1, LUMPERROR},
{"kbost1", false, 64, 96, -1, NULL, 0, SKSKBST1, -1, LUMPERROR}, {"kbost1", false, 64, 96, -1, NULL, 0, SKSKBST1, -1, LUMPERROR},
{"kbost2", false, 64, 96, -1, NULL, 0, SKSKBST2, -1, LUMPERROR}, {"kbost2", false, 64, 96, -1, NULL, 0, SKSKBST2, -1, LUMPERROR},
{"kslow", false, 128, 32, -1, NULL, 0, SKSKSLOW, -1, LUMPERROR}, {"kslow", false, 64, 32, -1, NULL, 0, SKSKSLOW, -1, LUMPERROR},
{"khitem", false, 64, 32, -1, NULL, 0, SKSKHITM, -1, LUMPERROR}, {"khitem", false, 128, 32, -1, NULL, 0, SKSKHITM, -1, LUMPERROR},
{"kgloat", false, 64, 48, -1, NULL, 0, SKSKPOWR, -1, LUMPERROR}, {"kgloat", false, 64, 48, -1, NULL, 0, SKSKPOWR, -1, LUMPERROR},
// skin sounds free slots to add sounds at run time (Boris HACK!!!) // skin sounds free slots to add sounds at run time (Boris HACK!!!)

View File

@ -846,9 +846,6 @@ typedef enum
sfx_lkt1, sfx_lkt1,
sfx_lkt2, sfx_lkt2,
sfx_lkt3, sfx_lkt3,
sfx_kart1,
sfx_kart2,
sfx_kart3,
sfx_mlap, sfx_mlap,
sfx_sboost, sfx_sboost,
sfx_mush, sfx_mush,
@ -896,6 +893,135 @@ typedef enum
sfx_itfree, sfx_itfree,
sfx_dbgsal, sfx_dbgsal,
// Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy...
// Engine class A - Low Speed, Low Weight
sfx_krta00,
sfx_krta01,
sfx_krta02,
sfx_krta03,
sfx_krta04,
sfx_krta05,
sfx_krta06,
sfx_krta07,
sfx_krta08,
sfx_krta09,
sfx_krta10,
sfx_krta11,
sfx_krta12,
// Engine class B - Average Speed, Low Weight
sfx_krtb00,
sfx_krtb01,
sfx_krtb02,
sfx_krtb03,
sfx_krtb04,
sfx_krtb05,
sfx_krtb06,
sfx_krtb07,
sfx_krtb08,
sfx_krtb09,
sfx_krtb10,
sfx_krtb11,
sfx_krtb12,
// Engine class C - High Speed, Low Weight
sfx_krtc00,
sfx_krtc01,
sfx_krtc02,
sfx_krtc03,
sfx_krtc04,
sfx_krtc05,
sfx_krtc06,
sfx_krtc07,
sfx_krtc08,
sfx_krtc09,
sfx_krtc10,
sfx_krtc11,
sfx_krtc12,
// Engine class D - Low Speed, Average Weight
sfx_krtd00,
sfx_krtd01,
sfx_krtd02,
sfx_krtd03,
sfx_krtd04,
sfx_krtd05,
sfx_krtd06,
sfx_krtd07,
sfx_krtd08,
sfx_krtd09,
sfx_krtd10,
sfx_krtd11,
sfx_krtd12,
// Engine class E - Average Speed, Average Weight
sfx_krte00,
sfx_krte01,
sfx_krte02,
sfx_krte03,
sfx_krte04,
sfx_krte05,
sfx_krte06,
sfx_krte07,
sfx_krte08,
sfx_krte09,
sfx_krte10,
sfx_krte11,
sfx_krte12,
// Engine class F - High Speed, Average Weight
sfx_krtf00,
sfx_krtf01,
sfx_krtf02,
sfx_krtf03,
sfx_krtf04,
sfx_krtf05,
sfx_krtf06,
sfx_krtf07,
sfx_krtf08,
sfx_krtf09,
sfx_krtf10,
sfx_krtf11,
sfx_krtf12,
// Engine class G - Low Speed, High Weight
sfx_krtg00,
sfx_krtg01,
sfx_krtg02,
sfx_krtg03,
sfx_krtg04,
sfx_krtg05,
sfx_krtg06,
sfx_krtg07,
sfx_krtg08,
sfx_krtg09,
sfx_krtg10,
sfx_krtg11,
sfx_krtg12,
// Engine class H - Average Speed, High Weight
sfx_krth00,
sfx_krth01,
sfx_krth02,
sfx_krth03,
sfx_krth04,
sfx_krth05,
sfx_krth06,
sfx_krth07,
sfx_krth08,
sfx_krth09,
sfx_krth10,
sfx_krth11,
sfx_krth12,
// Engine class I - High Speed, High Weight
sfx_krti00,
sfx_krti01,
sfx_krti02,
sfx_krti03,
sfx_krti04,
sfx_krti05,
sfx_krti06,
sfx_krti07,
sfx_krti08,
sfx_krti09,
sfx_krti10,
sfx_krti11,
sfx_krti12,
// And LASTLY, Kart's skin sounds.
sfx_kwin, sfx_kwin,
sfx_klose, sfx_klose,
sfx_khurt1, sfx_khurt1,

View File

@ -1952,14 +1952,13 @@ static void ST_overlayDrawer(void)
) )
{ {
// SRB2kart: changed positions & text // SRB2kart: changed positions & text
V_DrawString(2, BASEVIDHEIGHT-50, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -")); V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -"));
if (stplyr->pflags & PF_WANTSTOJOIN) if (stplyr->pflags & PF_WANTSTOJOIN)
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Cancel Join")); V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Cancel Join"));
/*else if (G_GametypeHasTeams()) /*else if (G_GametypeHasTeams())
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/ V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/
else else
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Game")); V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Join Game"));
V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("F12 - Change View"));
V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float")); V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float"));
V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink")); V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink"));
} }

View File

@ -668,14 +668,10 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
// //
void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skincolor) void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skincolor)
{ {
if (skins[skinnum].flags & SF_HIRES if (skinnum < 0 || skinnum >= numskins || (skins[skinnum].flags & SF_HIRES))
#ifdef HWRENDER V_DrawScaledPatch(x - 10, y - 14, flags, W_CachePatchName("CONTINS", PU_CACHE)); // Draw a star
// || (rendermode != render_soft && rendermode != render_none)
#endif
)
V_DrawScaledPatch(x - 10, y - 14, flags, W_CachePatchName("CONTINS", PU_CACHE));
else else
{ { // Find front angle of the first waiting frame of the character's actual sprites
spriteframe_t *sprframe = &skins[skinnum].spritedef.spriteframes[2 & FF_FRAMEMASK]; spriteframe_t *sprframe = &skins[skinnum].spritedef.spriteframes[2 & FF_FRAMEMASK];
patch_t *patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE); patch_t *patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
const UINT8 *colormap = R_GetTranslationColormap(skinnum, skincolor, GTC_CACHE); const UINT8 *colormap = R_GetTranslationColormap(skinnum, skincolor, GTC_CACHE);
@ -820,6 +816,10 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
else if (!(c & V_SNAPTOTOP)) else if (!(c & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
} }
if (c & V_SPLITSCREEN)
y += (BASEVIDHEIGHT * dupy)/2;
if (c & V_HORZSCREEN)
x += (BASEVIDWIDTH * dupx)/2;
} }
if (x >= vid.width || y >= vid.height) if (x >= vid.width || y >= vid.height)
@ -901,6 +901,10 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
else if (!(c & V_SNAPTOTOP)) else if (!(c & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
} }
if (c & V_SPLITSCREEN)
y += (BASEVIDHEIGHT * dupy)/2;
if (c & V_HORZSCREEN)
x += (BASEVIDWIDTH * dupx)/2;
} }
if (x >= vid.width || y >= vid.height) if (x >= vid.width || y >= vid.height)
@ -1282,8 +1286,8 @@ UINT8 *V_GetStringColormap(INT32 colorflags)
return steelmap; return steelmap;
case 13: // 0x8D, pink case 13: // 0x8D, pink
return pinkmap; return pinkmap;
case 14: // 0x8E, teal case 14: // 0x8E, brown
return tealmap; return brownmap;
case 15: // 0x8F, peach case 15: // 0x8F, peach
return peachmap; return peachmap;
default: // reset default: // reset

View File

@ -82,7 +82,7 @@ extern UINT8 hudtrans;
#define V_TEAMAP 0x0000B000 #define V_TEAMAP 0x0000B000
#define V_STEELMAP 0x0000C000 #define V_STEELMAP 0x0000C000
#define V_PINKMAP 0x0000D000 #define V_PINKMAP 0x0000D000
#define V_TEALMAP 0x0000E000 #define V_BROWNMAP 0x0000E000
#define V_PEACHMAP 0x0000F000 #define V_PEACHMAP 0x0000F000
// use bits 17-20 for alpha transparency // use bits 17-20 for alpha transparency

View File

@ -196,16 +196,21 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum)
for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++)
if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump
{ // shameless copy+paste of code from LUA_LoadLump { // shameless copy+paste of code from LUA_LoadLump
char *name = malloc(strlen(wadfiles[wadnum]->filename)+10); size_t len = strlen(wadfiles[wadnum]->filename);
char *name = malloc(len+10);
strcpy(name, wadfiles[wadnum]->filename); strcpy(name, wadfiles[wadnum]->filename);
if (!fasticmp(&name[strlen(name) - 4], ".soc")) { if (!fasticmp(&name[len - 4], ".soc")) {
// If it's not a .soc file, copy the lump name in too. // If it's not a .soc file, copy the lump name in too.
name[strlen(wadfiles[wadnum]->filename)] = '|'; name[len] = '|';
M_Memcpy(name+strlen(wadfiles[wadnum]->filename)+1, lump_p->name, 8); M_Memcpy(name+len+1, lump_p->name, 8);
name[strlen(wadfiles[wadnum]->filename)+9] = '\0'; name[len+9] = '\0';
} }
CONS_Printf(M_GetText("Loading SOC from %s\n"), name); CONS_Printf(M_GetText("Loading SOC from %s\n"), name);
DEH_LoadDehackedLumpPwad(wadnum, lump); DEH_LoadDehackedLumpPwad(wadnum, lump);
free(name);
} }
else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG
{ {

View File

@ -17,17 +17,13 @@
#include "gme/gme.h" #include "gme/gme.h"
#define GME_TREBLE 5.0 #define GME_TREBLE 5.0
#define GME_BASS 1.0 #define GME_BASS 1.0
#ifdef HAVE_PNG /// TODO: compile with zlib support without libpng
#define HAVE_ZLIB
#ifdef HAVE_ZLIB
#ifndef _MSC_VER #ifndef _MSC_VER
#ifndef _WII
#ifndef _LARGEFILE64_SOURCE #ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
#endif #endif
#endif #endif
#endif
#ifndef _LFS64_LARGEFILE #ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE #define _LFS64_LARGEFILE
@ -38,8 +34,8 @@
#endif #endif
#include "zlib.h" #include "zlib.h"
#endif #endif // HAVE_ZLIB
#endif #endif // HAVE_LIBGME
static FMOD_SYSTEM *fsys; static FMOD_SYSTEM *fsys;
static FMOD_SOUND *music_stream; static FMOD_SOUND *music_stream;
@ -357,12 +353,13 @@ void I_FreeSfx(sfxinfo_t *sfx)
sfx->data = NULL; sfx->data = NULL;
} }
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{ {
FMOD_SOUND *sound; FMOD_SOUND *sound;
FMOD_CHANNEL *chan; FMOD_CHANNEL *chan;
INT32 i; INT32 i;
float frequency; float frequency;
(void)channel;
sound = (FMOD_SOUND *)S_sfx[id].data; sound = (FMOD_SOUND *)S_sfx[id].data;
I_Assert(sound != NULL); I_Assert(sound != NULL);

View File

@ -51,7 +51,7 @@ rendermode_t rendermode = render_soft;
static void OnTop_OnChange(void); static void OnTop_OnChange(void);
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}}; static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}};
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View File

@ -538,7 +538,8 @@ INT32 I_StartSound (sfxenum_t id,
INT32 vol, INT32 vol,
INT32 sep, INT32 sep,
INT32 pitch, INT32 pitch,
INT32 priority) INT32 priority,
INT32 channel)
{ {
HRESULT hr; HRESULT hr;
LPDIRECTSOUNDBUFFER dsbuffer; LPDIRECTSOUNDBUFFER dsbuffer;
@ -549,6 +550,7 @@ INT32 I_StartSound (sfxenum_t id,
#ifdef SURROUND #ifdef SURROUND
LPDIRECTSOUNDBUFFER dssurround; LPDIRECTSOUNDBUFFER dssurround;
#endif #endif
(void)channel;
if (nosound) if (nosound)
return -1; return -1;

View File

@ -48,7 +48,7 @@
rendermode_t rendermode = render_soft; rendermode_t rendermode = render_soft;
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
boolean highcolor; boolean highcolor;

View File

@ -560,13 +560,13 @@ void Y_Ticker(void)
// Team scramble code for team match and CTF. // Team scramble code for team match and CTF.
// Don't do this if we're going to automatically scramble teams next round. // Don't do this if we're going to automatically scramble teams next round.
if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) /*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server)
{ {
// If we run out of time in intermission, the beauty is that // If we run out of time in intermission, the beauty is that
// the P_Ticker() team scramble code will pick it up. // the P_Ticker() team scramble code will pick it up.
if ((intertic % (TICRATE/7)) == 0) if ((intertic % (TICRATE/7)) == 0)
P_DoTeamscrambling(); P_DoTeamscrambling();
} }*/
// multiplayer uses timer (based on cv_inttime) // multiplayer uses timer (based on cv_inttime)
if (timer) if (timer)
@ -1137,7 +1137,7 @@ void Y_VoteDrawer(void)
else else
{ {
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0); V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, rubyicon, NULL); V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, rubyicon, NULL);
} }
if (levelinfo[votes[i]].gts) if (levelinfo[votes[i]].gts)