Merge branch 'sonicitems' into 'master'

Sonic Items

See merge request KartKrew/Kart!5
This commit is contained in:
Sal 2018-09-20 14:51:07 -04:00
commit 9c01ad6065
87 changed files with 13354 additions and 9570 deletions

View file

@ -57,49 +57,6 @@ matrix:
- gcc-4.8
compiler: gcc-4.8
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-4.9
compiler: gcc-4.9
#gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-5
compiler: gcc-5
#gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-6
compiler: gcc-6
env: WFLAGS="-Wno-tautological-compare"
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
- os: linux
addons:
apt:

View file

@ -1,3 +1,4 @@
*.exe
*.mo
r_opengl.dll
*.bat

View file

@ -1,3 +1,4 @@
*.exe
*.mo
r_opengl.dll
*.bat

View file

@ -1,3 +1,4 @@
# GNU Make makefile for SRB2
#############################################################################
# Copyright (C) 1998-2000 by DooM Legacy Team.
@ -426,7 +427,8 @@ endif
ifdef PROFILEMODE
# build with profiling information
CFLAGS:=-pg $(CFLAGS)
CFLAGS+=-pg
LDFLAGS+=-pg
endif
ifdef ZDEBUG

View file

@ -8,7 +8,7 @@
UINT8 cdaudio_started = 0;
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -1088,32 +1088,42 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if (var->PossibleValue[0].strvalue && !stricmp(var->PossibleValue[0].strvalue, "MIN")) // bounded cvar
{
#define MINVAL 0
#define MAXVAL 1
INT32 i;
// search for maximum
for (i = 1; var->PossibleValue[i].strvalue; i++)
if (!stricmp(var->PossibleValue[i].strvalue, "MAX"))
break;
#ifdef PARANOIA
if (!var->PossibleValue[i].strvalue)
if (!var->PossibleValue[MAXVAL].strvalue)
I_Error("Bounded cvar \"%s\" without maximum!\n", var->name);
#endif
if ((v != INT32_MIN && v < var->PossibleValue[0].value) || !stricmp(valstr, "MIN"))
// search for other
for (i = MAXVAL+1; var->PossibleValue[i].strvalue; i++)
if (!stricmp(var->PossibleValue[i].strvalue, valstr))
{
var->value = var->PossibleValue[i].value;
var->string = var->PossibleValue[i].strvalue;
goto finish;
}
if ((v != INT32_MIN && v < var->PossibleValue[MINVAL].value) || !stricmp(valstr, "MIN"))
{
v = var->PossibleValue[0].value;
valstr = var->PossibleValue[0].strvalue;
v = var->PossibleValue[MINVAL].value;
valstr = var->PossibleValue[MINVAL].strvalue;
override = true;
overrideval = v;
}
else if ((v != INT32_MIN && v > var->PossibleValue[i].value) || !stricmp(valstr, "MAX"))
else if ((v != INT32_MIN && v > var->PossibleValue[MAXVAL].value) || !stricmp(valstr, "MAX"))
{
v = var->PossibleValue[i].value;
valstr = var->PossibleValue[i].strvalue;
v = var->PossibleValue[MAXVAL].value;
valstr = var->PossibleValue[MAXVAL].strvalue;
override = true;
overrideval = v;
}
if (v == INT32_MIN)
goto badinput;
#undef MINVAL
#undef MAXVAL
}
else
{
@ -1453,7 +1463,6 @@ void CV_AddValue(consvar_t *var, INT32 increment)
if (var->PossibleValue)
{
#define MINVAL 0
if (var == &cv_nextmap)
{
// Special case for the nextmap variable, used only directly from the menu
@ -1478,33 +1487,52 @@ void CV_AddValue(consvar_t *var, INT32 increment)
}
if (newvalue == oldvalue)
gt = -1; // don't loop forever if there's none of a certain gametype
break; // don't loop forever if there's none of a certain gametype
if(!mapheaderinfo[newvalue])
continue; // Don't allocate the header. That just makes memory usage skyrocket.
} while (newvalue != oldvalue && !M_CanShowLevelInList(newvalue, gt));
} while (!M_CanShowLevelInList(newvalue, gt));
var->value = newvalue + 1;
var->func();
return;
}
}
#define MINVAL 0
#define MAXVAL 1
else if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
{
// search the next to last
for (max = 0; var->PossibleValue[max+1].strvalue; max++)
;
{ // SRB2Kart
#ifdef PARANOIA
if (!var->PossibleValue[MAXVAL].strvalue)
I_Error("Bounded cvar \"%s\" without maximum!\n", var->name);
#endif
if (newvalue < var->PossibleValue[MINVAL].value) // add the max+1
newvalue += var->PossibleValue[max].value - var->PossibleValue[MINVAL].value + 1;
if (newvalue < var->PossibleValue[MINVAL].value || newvalue > var->PossibleValue[MAXVAL].value)
{
INT32 currentindice = -1, newindice;
for (max = MAXVAL+1; var->PossibleValue[max].strvalue; max++)
if (var->PossibleValue[max].value == var->value)
currentindice = max;
newvalue = var->PossibleValue[MINVAL].value + (newvalue - var->PossibleValue[MINVAL].value)
% (var->PossibleValue[max].value - var->PossibleValue[MINVAL].value + 1);
if (currentindice == -1 && max != MAXVAL+1)
newindice = ((increment > 0) ? MAXVAL : max) + increment;
else
newindice = currentindice + increment;
CV_SetValue(var, newvalue);
#undef MINVAL
if (newindice >= max || newindice <= MAXVAL)
{
newvalue = var->PossibleValue[((increment > 0) ? MINVAL : MAXVAL)].value;
CV_SetValue(var, newvalue);
}
else
CV_Set(var, var->PossibleValue[newindice].strvalue);
}
else
CV_SetValue(var, newvalue);
}
#undef MINVAL
#undef MAXVAL
else
{
INT32 currentindice = -1, newindice;
@ -1514,8 +1542,6 @@ void CV_AddValue(consvar_t *var, INT32 increment)
if (var->PossibleValue[max].value == var->value)
currentindice = max;
max--;
if (var == &cv_chooseskin)
{
// Special case for the chooseskin variable, used only directly from the menu
@ -1578,7 +1604,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
var->value);
#endif
newindice = (currentindice + increment + max + 1) % (max+1);
newindice = (currentindice + increment + max) % max;
CV_Set(var, var->PossibleValue[newindice].strvalue);
}
}

View file

@ -139,6 +139,21 @@ static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Gray"}, {2,
{0, NULL}};
consvar_t cons_backcolor = {"con_backcolor", "Green", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t menuhighlight_cons_t[] =
{
{0, "Game type"},
{V_YELLOWMAP, "Always yellow"},
{V_PURPLEMAP, "Always purple"},
{V_GREENMAP, "Always green"},
{V_BLUEMAP, "Always blue"},
{V_REDMAP, "Always red"},
{V_GRAYMAP, "Always gray"},
{V_ORANGEMAP, "Always orange"},
{V_SKYMAP, "Always sky-blue"},
{0, NULL}
};
consvar_t cons_menuhighlight = {"menuhighlight", "Game type", CV_SAVE, menuhighlight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static void CON_Print(char *msg);
//
@ -227,13 +242,7 @@ static void CONS_Bind_f(void)
// Font colormap colors
// TODO: This could probably be improved somehow...
// These colormaps are 99% identical, with just a few changed bytes
UINT8 *yellowmap;
UINT8 *purplemap;
UINT8 *lgreenmap;
UINT8 *bluemap;
UINT8 *graymap;
UINT8 *redmap;
UINT8 *orangemap;
UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap, *skymap;
// Console BG color
UINT8 *consolebgmap = NULL;
@ -278,39 +287,34 @@ static void CONS_backcolor_Change(void)
static void CON_SetupColormaps(void)
{
INT32 i;
UINT8 *memorysrc = (UINT8 *)Z_Malloc((256*8), PU_STATIC, NULL);
yellowmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
graymap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
purplemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
lgreenmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
bluemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
redmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
orangemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
purplemap = memorysrc;
yellowmap = (purplemap+256);
greenmap = (yellowmap+256);
bluemap = (greenmap+256);
redmap = (bluemap+256);
graymap = (redmap+256);
orangemap = (graymap+256);
skymap = (orangemap+256);
// setup the other colormaps, for console text
// these don't need to be aligned, unless you convert the
// V_DrawMappedPatch() into optimised asm.
for (i = 0; i < 256; i++)
{
yellowmap[i] = (UINT8)i; // remap each color to itself...
graymap[i] = (UINT8)i;
purplemap[i] = (UINT8)i;
lgreenmap[i] = (UINT8)i;
bluemap[i] = (UINT8)i;
redmap[i] = (UINT8)i;
orangemap[i] = (UINT8)i;
}
for (i = 0; i < (256*8); i++, ++memorysrc)
*memorysrc = (UINT8)(i & 0xFF); // remap each color to itself...
// SRB2Kart: Different console font, new colors
yellowmap[120] = (UINT8)103;
purplemap[120] = (UINT8)194;
lgreenmap[120] = (UINT8)162;
yellowmap[120] = (UINT8)103;
greenmap[120] = (UINT8)162;
bluemap[120] = (UINT8)228;
graymap[120] = (UINT8)10;
redmap[120] = (UINT8)126;
orangemap[120] = (UINT8)85;
redmap[120] = (UINT8)126; // battle
orangemap[120] = (UINT8)85; // record attack
skymap[120] = (UINT8)214; // race
// Init back colormap
CON_SetupBackColormap();
@ -367,6 +371,7 @@ void CON_Init(void)
CV_RegisterVar(&cons_height);
CV_RegisterVar(&cons_backpic);
CV_RegisterVar(&cons_backcolor);
CV_RegisterVar(&cons_menuhighlight);
COM_AddCommand("bind", CONS_Bind_f);
}
else
@ -1032,7 +1037,17 @@ boolean CON_Responder(event_t *ev)
else if (key == KEY_KPADSLASH)
key = '/';
if (shiftdown)
// capslock
if (key == KEY_CAPSLOCK) // it's a toggle.
{
if (capslock)
capslock = false;
else
capslock = true;
return true;
}
if (capslock ^ shiftdown) // gets capslock to work because capslock is cool
key = shiftxform[key];
// enter a char into the command prompt
@ -1040,7 +1055,7 @@ boolean CON_Responder(event_t *ev)
return true; // even if key can't be printed, eat it anyway
// add key to cmd line here
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
key = key + 'a' - 'A';
if (input_sel != input_cur)
@ -1427,7 +1442,7 @@ static void CON_DrawHudlines(void)
if (con_hudlines <= 0)
return;
if (chat_on)
if (chat_on && OLDCHAT)
y = charheight; // leave place for chat input in the first row of text
else
y = 0;
@ -1620,6 +1635,6 @@ void CON_Drawer(void)
if (con_curlines > 0)
CON_DrawConsole();
else if (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE || gamestate == GS_CREDITS
|| gamestate == GS_VOTING)
|| gamestate == GS_VOTING || gamestate == GS_EVALUATION || gamestate == GS_WAITINGPLAYERS)
CON_DrawHudlines();
}

View file

@ -36,9 +36,9 @@ extern INT32 con_clearlines; // lines of top of screen to refresh
extern boolean con_hudupdate; // hud messages have changed, need refresh
extern UINT32 con_scalefactor; // console text scale factor
extern consvar_t cons_backcolor;
extern consvar_t cons_backcolor, cons_menuhighlight;
extern UINT8 *yellowmap, *purplemap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap;
extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap, *skymap;
// Console bg color (auto updated to match)
extern UINT8 *consolebgmap;

View file

@ -443,8 +443,7 @@ static void ExtraDataTicker(void)
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
}
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
D_FreeTextcmd(gametic);
return;
break;
}
}
}
@ -1166,7 +1165,7 @@ static inline void CL_DrawConnectionStatus(void)
INT32 ccstime = I_GetTime();
// Draw background fade
V_DrawFadeScreen();
V_DrawFadeScreen(0xFF00, 16);
// Draw the bottom box.
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
@ -2145,7 +2144,8 @@ static void CL_ConnectToServer(boolean viams)
}
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
F_StartWaitingPlayers();
if (netgame)
F_StartWaitingPlayers();
DEBFILE(va("Synchronisation Finished\n"));
displayplayer = consoleplayer;
@ -2431,6 +2431,9 @@ static void CL_RemovePlayer(INT32 playernum)
}
}
if (K_IsPlayerWanted(&players[playernum]))
K_CalculateBattleWanted();
if (gametype == GT_CTF)
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
@ -2491,7 +2494,7 @@ static void CL_RemovePlayer(INT32 playernum)
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors();
else if (G_BattleGametype()) // SRB2Kart
K_CheckBalloons();
K_CheckBumpers();
else if (G_RaceGametype())
P_CheckRacers();
}
@ -3424,7 +3427,7 @@ void SV_StopServer(void)
localtextcmd3[0] = 0;
localtextcmd4[0] = 0;
for (i = 0; i < BACKUPTICS; i++)
for (i = firstticstosend; i < firstticstosend + BACKUPTICS; i++)
D_Clearticcmd(i);
consoleplayer = 0;
@ -3706,7 +3709,8 @@ static void HandlePacketFromAwayNode(SINT8 node)
if (client)
{
maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);
gametype = netbuffer->u.servercfg.gametype;
if ((gametype = netbuffer->u.servercfg.gametype) >= NUMGAMETYPES)
I_Error("Bad gametype in cliserv!");
modifiedgame = netbuffer->u.servercfg.modifiedgame;
for (j = 0; j < MAXPLAYERS; j++)
adminplayers[j] = netbuffer->u.servercfg.adminplayers[j];

View file

@ -125,17 +125,19 @@ INT32 postimgparam3;
postimg_t postimgtype4 = postimg_none;
INT32 postimgparam4;
#ifdef _XBOX
boolean nomidimusic = true, nosound = true;
//boolean nomidimusic = false;
boolean nosound = true;
boolean nodigimusic = true;
#else
boolean nomidimusic = false, nosound = false;
//boolean nomidimusic = false;
boolean nosound = false;
boolean nodigimusic = false; // No fmod-based music
#endif
// These variables are only true if
// the respective sound system is initialized
// and active, but no sounds/music should play.
boolean music_disabled = false;
//boolean music_disabled = false;
boolean sound_disabled = false;
boolean digital_disabled = false;
@ -184,6 +186,7 @@ void D_PostEvent_end(void) {};
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
UINT8 altdown = 0; // 0x1 left, 0x2 right
boolean capslock = 0; // jeez i wonder what this does.
//
// D_ModifierKeyResponder
// Sets global shift/ctrl/alt variables, never actually eats events
@ -294,15 +297,15 @@ static void D_Display(void)
{
// set for all later
wipedefindex = gamestate; // wipe_xxx_toblack
if (gamestate == GS_INTERMISSION)
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
wipedefindex = wipe_timeattack_toblack;
else if (gamestate == GS_INTERMISSION)
{
if (intertype == int_spec) // Special Stage
wipedefindex = wipe_specinter_toblack;
else //if (intertype != int_coop) // Multiplayer
wipedefindex = wipe_multinter_toblack;
}
else if (gamestate == GS_VOTING)
wipedefindex = wipe_multinter_toblack;
if (rendermode != render_none)
{
@ -316,6 +319,12 @@ static void D_Display(void)
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
}
if (wipegamestate == GS_LEVEL && rendermode != render_none)
{
V_SetPaletteLump("PLAYPAL"); // Reset the palette
R_ReInitColormaps(0);
}
F_WipeStartScreen();
}
}
@ -367,6 +376,7 @@ static void D_Display(void)
case GS_EVALUATION:
F_GameEvaluationDrawer();
HU_Erase();
HU_Drawer();
break;
@ -382,12 +392,19 @@ static void D_Display(void)
case GS_TITLESCREEN:
F_TitleScreenDrawer();
if (wipe)
wipedefindex = wipe_titlescreen_toblack;
break;
case GS_WAITINGPLAYERS:
// The clientconnect drawer is independent...
// I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer();
if (netgame)
{
// I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer();
HU_Erase();
HU_Drawer();
}
case GS_DEDICATEDSERVER:
case GS_NULL:
break;
@ -527,7 +544,7 @@ static void D_Display(void)
wipegamestate = gamestate;
// draw pause pic
if (paused && cv_showhud.value && (!menuactive || netgame))
if (paused && cv_showhud.value)
{
INT32 py;
patch_t *patch;
@ -813,9 +830,9 @@ void D_StartTitle(void)
F_StartTitleScreen();
CON_ToggleOff();
// Reset the palette
if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");
// Reset the palette -- SRB2Kart: actually never mind let's do this in the middle of every fade
/*if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");*/
}
//
@ -943,6 +960,10 @@ static void IdentifyVersion(void)
D_AddFile(va(pandf,srb2waddir,"maps.kart"));
D_AddFile(va(pandf,srb2waddir,"sounds.kart"));
#ifdef USE_PATCH_KART
D_AddFile(va(pandf,srb2waddir,"patch.kart"));
#endif
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
{
#if defined (DC) && 0
@ -1153,15 +1174,6 @@ void D_SRB2Main(void)
if (M_CheckParm("-password") && M_IsNextParm())
D_SetPassword(M_GetNextParm());
else
{
size_t z;
char junkpw[25];
for (z = 0; z < 24; z++)
junkpw[z] = (char)(rand() & 64)+32;
junkpw[24] = '\0';
D_SetPassword(junkpw);
}
// add any files specified on the command line with -file wadfile
// to the wad list
@ -1241,25 +1253,23 @@ void D_SRB2Main(void)
#ifndef DEVELOP // md5s last updated 12/14/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(0, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad
W_VerifyFileMD5(1, ASSET_HASH_GFX_DTA); // gfx.kart
W_VerifyFileMD5(2, ASSET_HASH_CHARS_DTA); // chars.kart
W_VerifyFileMD5(3, ASSET_HASH_MAPS_DTA); // maps.kart
// sounds.kart - since music is large, we'll ignore it for now.
mainwads = 0;
W_VerifyFileMD5(mainwads, ASSET_HASH_SRB2_SRB); mainwads++; // srb2.srb/srb2.wad
#ifdef USE_PATCH_DTA
W_VerifyFileMD5(4, ASSET_HASH_PATCH_DTA); // patch.dta
W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_DTA); mainwads++; // patch.dta
#endif
W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_KART); mainwads++; // gfx.kart
W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_KART); mainwads++; // chars.kart
W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_KART); mainwads++; // maps.kart
//W_VerifyFileMD5(mainwads, ASSET_HASH_SOUNDS_KART); mainwads++; // sounds.kart - doesn't trigger modifiedgame, doesn't need an MD5...?
#ifdef USE_PATCH_KART
W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_KART); mainwads++; // patch.kart
#endif
// don't check music.dta because people like to modify it, and it doesn't matter if they do
// ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
#endif //ifndef DEVELOP
mainwads = 4; // there are 4 wads not to unload
#ifdef USE_PATCH_DTA
++mainwads; // patch.dta adds one more
#endif
cht_Init();
//---------------------------------------------------- READY SCREEN
@ -1326,7 +1336,7 @@ void D_SRB2Main(void)
if (dedicated)
{
nosound = true;
nomidimusic = nodigimusic = true;
/*nomidimusic = */nodigimusic = true;
}
else
{
@ -1335,17 +1345,17 @@ void D_SRB2Main(void)
if (M_CheckParm("-nosound"))
nosound = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
nomidimusic = nodigimusic = true;
/*nomidimusic = */nodigimusic = true;
else
{
if (M_CheckParm("-nomidimusic"))
nomidimusic = true; ; // WARNING: DOS version initmusic in I_StartupSound
/*if (M_CheckParm("-nomidimusic"))
nomidimusic = true; ; // WARNING: DOS version initmusic in I_StartupSound*/
if (M_CheckParm("-nodigmusic"))
nodigimusic = true; // WARNING: DOS version initmusic in I_StartupSound
}
I_StartupSound();
I_InitMusic();
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
S_Init(cv_soundvolume.value, cv_digmusicvolume.value);//, cv_midimusicvolume.value);
CONS_Printf("ST_Init(): Init status bar.\n");
ST_Init();

View file

@ -109,10 +109,12 @@ static void Color4_OnChange(void);
static void DummyConsvar_OnChange(void);
static void SoundTest_OnChange(void);
static void BaseNumLaps_OnChange(void);
static void KartFrantic_OnChange(void);
static void KartSpeed_OnChange(void);
static void KartMirror_OnChange(void);
static void KartComeback_OnChange(void);
static void KartEliminateLast_OnChange(void);
#ifdef NETGAME_DEVMODE
static void Fishcake_OnChange(void);
@ -220,7 +222,7 @@ static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Rando
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
{3, "None"}, {0, NULL}};
static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}};
@ -244,7 +246,7 @@ consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEA
#ifdef SEENAMES
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
consvar_t cv_seenames = {"seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_seenames = {"seenames", "Off", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
@ -271,26 +273,15 @@ INT32 cv_debug;
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) //joystick 1 and 2
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#elif defined (PSP) || defined (GP2X) || defined (_NDS) //only one joystick
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#else //all esle, no joystick
consvar_t cv_usejoystick = {"use_joystick", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick3 = {"use_joystick3", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
consvar_t cv_usejoystick3 = {"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick4 = {"use_joystick4", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
consvar_t cv_usejoystick4 = {"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL};
#endif
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
#ifdef LJOYSTICK
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -315,7 +306,7 @@ consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT, matchboxe
consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
/*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_superring = {"tv_superring", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_supersneakers = {"tv_supersneaker", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -326,45 +317,56 @@ consvar_t cv_ringshield = {"tv_ringshield", "5", CV_NETVAR|CV_CHEAT, chanc
consvar_t cv_forceshield = {"tv_forceshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_bombshield = {"tv_bombshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/
// SRB2kart
consvar_t cv_magnet = {"magnets", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_boo = {"boos", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mushroom = {"mushrooms", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_triplemushroom = {"triplemushrooms", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_megashroom = {"megashrooms", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_goldshroom = {"goldshrooms", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_star = {"stars", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_triplebanana = {"triplebananas", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_fakeitem = {"fakeitems", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_banana = {"bananas", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_greenshell = {"greenshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_redshell = {"redshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_laserwisp = {"laserwisps", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_triplegreenshell = {"triplegreenshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_bobomb = {"bobombs", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_blueshell = {"blueshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_jaws = {"jaws", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_fireflower = {"fireflowers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_tripleredshell = {"tripleredshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_lightning = {"lightning", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_feather = {"feathers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_rocketsneaker = {"rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_invincibility = {"invincibility", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_banana = {"banana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_eggmanmonitor = {"eggmanmonitor", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_orbinaut = {"orbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_jawz = {"jawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mine = {"mine", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_ballhog = {"ballhog", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_selfpropelledbomb = {"selfpropelledbomb", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grow = {"grow", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_shrink = {"shrink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_thundershield = {"thundershield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_hyudoro = {"hyudoro", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_pogospring = {"pogospring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_triplesneaker = {"triplesneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_triplebanana = {"triplebanana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_tripleorbinaut = {"tripleorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_dualjawz = {"dualjawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
consvar_t cv_kartminimap = {"kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartstarsfx_cons_t[] = {{0, "Music"}, {1, "SMK"}, {0, NULL}};
consvar_t cv_kartstarsfx = {"kartstarsfx", "SMK", CV_SAVE, kartstarsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartinvinsfx_cons_t[] = {{0, "Music"}, {1, "SFX"}, {0, NULL}};
consvar_t cv_kartinvinsfx = {"kartinvinsfx", "SFX", CV_SAVE, kartinvinsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartspeed = {"kartspeed", "Normal", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartballoons_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR|CV_CHEAT, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
consvar_t cv_kartbumpers = {"kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t speedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
consvar_t cv_speedometer = {"speedometer", "Off", CV_SAVE, speedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// this might be a debug or it might be an undocumented regular feature
consvar_t cv_karteliminatelast = {"karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_OnOff, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartdebugitem_cons_t[] = {{-1, "MIN"}, {NUMKARTITEMS-1, "MAX"}, {0, NULL}};
consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
consvar_t cv_kartdebugamount = {"kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartdebugshrink = {"kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -403,10 +405,11 @@ consvar_t cv_pointlimit = {"pointlimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, point
static CV_PossibleValue_t timelimit_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
consvar_t cv_timelimit = {"timelimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t,
TimeLimit_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t numlaps_cons_t[] = {{0, "MIN"}, {50, "MAX"}, {0, NULL}};
static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, NULL}};
consvar_t cv_numlaps = {"numlaps", "3", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t,
NumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemapnumlaps = {"usemaplaps", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}};
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
// log elemental hazards -- not a netvar, is local to current player
consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -429,7 +432,7 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Same"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
consvar_t cv_advancemap = {"advancemap", "Vote", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "All"}, {0, NULL}};
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -442,6 +445,7 @@ consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange,
consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
INT16 gametype = GT_RACE; // SRB2kart
boolean forceresetplayers = false;
UINT8 splitscreen = 0;
boolean circuitmap = true; // SRB2kart
INT32 adminplayers[MAXPLAYERS];
@ -579,7 +583,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_friendlyfire);
CV_RegisterVar(&cv_pointlimit);
CV_RegisterVar(&cv_numlaps);
CV_RegisterVar(&cv_usemapnumlaps);
CV_RegisterVar(&cv_basenumlaps);
CV_RegisterVar(&cv_hazardlog);
@ -603,7 +607,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_competitionboxes);
CV_RegisterVar(&cv_matchboxes);
CV_RegisterVar(&cv_recycler);
/*CV_RegisterVar(&cv_recycler);
CV_RegisterVar(&cv_teleporters);
CV_RegisterVar(&cv_superring);
CV_RegisterVar(&cv_supersneakers);
@ -614,7 +618,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_forceshield);
CV_RegisterVar(&cv_bombshield);
CV_RegisterVar(&cv_1up);
CV_RegisterVar(&cv_eggmanbox);
CV_RegisterVar(&cv_eggmanbox);*/
K_RegisterKartStuff(); // SRB2kart
@ -776,6 +780,13 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_usegamma);
// m_menu.c
CV_RegisterVar(&cv_chatheight);
CV_RegisterVar(&cv_chatwidth);
CV_RegisterVar(&cv_chattime);
CV_RegisterVar(&cv_chatspamprotection);
CV_RegisterVar(&cv_consolechat);
CV_RegisterVar(&cv_chatnotifications);
CV_RegisterVar(&cv_chatbacktint);
CV_RegisterVar(&cv_crosshair);
CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_crosshair3);
@ -858,7 +869,7 @@ void D_RegisterClientCommands(void)
// s_sound.c
CV_RegisterVar(&cv_soundvolume);
CV_RegisterVar(&cv_digmusicvolume);
CV_RegisterVar(&cv_midimusicvolume);
//CV_RegisterVar(&cv_midimusicvolume);
CV_RegisterVar(&cv_numChannels);
// i_cdmus.c
@ -1152,7 +1163,7 @@ UINT8 CanChangeSkin(INT32 playernum)
return true;
// Can change skin during initial countdown.
if (leveltime < 4*TICRATE)
if (leveltime < starttime)
return true;
if (G_TagGametype())
@ -1875,6 +1886,8 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
static char buf[2+MAX_WADPATH+1+4];
static char *buf_p = buf;
forceresetplayers = false;
// The supplied data are assumed to be good.
I_Assert(delay >= 0 && delay <= 2);
@ -1955,16 +1968,22 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
void D_SetupVote(void)
{
char buf[8];
char *p = buf;
UINT8 buf[6*2]; // five UINT16 maps (at twice the width of a UINT8), and two gametypes
UINT8 *p = buf;
INT32 i;
UINT8 secondgt = G_SometimesGetDifferentGametype();
for (i = 0; i < 4; i++)
WRITEUINT8(p, gametype);
WRITEUINT8(p, secondgt);
for (i = 0; i < 5; i++)
{
if (i == 3)
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false));
if (i == 2) // sometimes a different gametype
WRITEUINT16(p, G_RandMap(G_TOLFlag(secondgt), prevmap, false, false, 0, true));
else if (i >= 3) // unknown-random and force-unknown MAP HELL
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false, (i-2), (i < 4)));
else
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false));
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, true));
}
SendNetXCmd(XD_SETUPVOTE, buf, p - buf);
@ -1990,7 +2009,9 @@ void D_PickVote(void)
char* p = buf;
SINT8 temppicks[MAXPLAYERS];
SINT8 templevels[MAXPLAYERS];
SINT8 votecompare = -1;
UINT8 numvotes = 0, key = 0;
boolean force = true;
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
@ -2002,6 +2023,10 @@ void D_PickVote(void)
temppicks[numvotes] = i;
templevels[numvotes] = votes[i];
numvotes++;
if (votecompare == -1)
votecompare = votes[i];
else if (votes[i] != votecompare)
force = false;
}
}
@ -2010,7 +2035,10 @@ void D_PickVote(void)
if (numvotes > 0)
{
WRITESINT8(p, temppicks[key]);
WRITESINT8(p, templevels[key]);
if (force && templevels[key] == 3 && numvotes > 1)
WRITESINT8(p, 4);
else
WRITESINT8(p, templevels[key]);
}
else
{
@ -2102,7 +2130,6 @@ static void Command_Map_f(void)
// Don't do any variable setting here. Wait until you get your
// map packet first to avoid sending the same info twice!
newgametype = gametype_cons_t[j].value;
break;
}
@ -2120,26 +2147,23 @@ static void Command_Map_f(void)
}
}
if (!(i = COM_CheckParm("-force")) && newgametype == gametype) // SRB2Kart
newresetplayers = false; // if not forcing and gametypes is the same
// don't use a gametype the map doesn't support
if (cv_debug || COM_CheckParm("-force") || cv_skipmapcheck.value)
if (cv_debug || i || cv_skipmapcheck.value)
; // The player wants us to trek on anyway. Do so.
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
// Alternatively, bail if the map header is completely missing anyway.
else if (!mapheaderinfo[newmapnum-1]
|| !(mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype)))
else
{
char gametypestring[32] = "Single Player";
if (multiplayer)
for (i = 0; gametype_cons_t[i].strvalue != NULL; i++)
if (gametype_cons_t[i].value == newgametype)
{
strcpy(gametypestring, gametype_cons_t[i].strvalue);
break;
}
CONS_Alert(CONS_WARNING, M_GetText("%s doesn't support %s mode!\n(Use -force to override)\n"), mapname, gametypestring);
return;
if (!mapheaderinfo[newmapnum-1]
|| !(mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype)))
{
CONS_Alert(CONS_WARNING, M_GetText("%s doesn't support %s mode!\n(Use -force to override)\n"), mapname,
(multiplayer ? gametype_cons_t[newgametype].strvalue : "Single Player"));
return;
}
}
// Prevent warping to locked levels
@ -2225,6 +2249,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
emeralds = 0;
}
if (modeattacking) // i remember moving this here in internal fixed a heisenbug so
SetPlayerSkinByNum(0, cv_chooseskin.value-1);
#ifdef HAVE_BLUA
LUAh_MapChange();
#endif
@ -2236,15 +2263,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
if (timingdemo)
G_DoneLevelLoad();
if (modeattacking)
{
SetPlayerSkinByNum(0, cv_chooseskin.value-1);
players[0].skincolor = cv_playercolor.value; // srb2kart
// a copy of color
if (players[0].mo)
players[0].mo->color = players[0].skincolor;
}
if (metalrecording)
G_BeginMetal();
if (demorecording) // Okay, level loaded, character spawned and skinned,
@ -2344,7 +2362,7 @@ static void Command_Suicide(void)
return;
}
/*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a balloon in battle, so it's not desirable to use as a way to escape a hit
/*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit
{
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
return;
@ -2511,18 +2529,12 @@ static void Command_Teamchange_f(void)
return;
}
if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam == (unsigned)players[consoleplayer].ctfteam ||
(players[consoleplayer].spectator && !NetPacket.packet.newteam))
error = true;
}
else if (G_GametypeHasSpectators())
{
if ((players[consoleplayer].spectator && !NetPacket.packet.newteam) ||
(!players[consoleplayer].spectator && NetPacket.packet.newteam == 3))
error = true;
}
if (players[consoleplayer].spectator)
error = !(NetPacket.packet.newteam || (players[consoleplayer].pflags & PF_WANTSTOJOIN)); // :lancer:
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[consoleplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[consoleplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2608,18 +2620,12 @@ static void Command_Teamchange2_f(void)
return;
}
if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam == (unsigned)players[secondarydisplayplayer].ctfteam ||
(players[secondarydisplayplayer].spectator && !NetPacket.packet.newteam))
error = true;
}
else if (G_GametypeHasSpectators())
{
if ((players[secondarydisplayplayer].spectator && !NetPacket.packet.newteam) ||
(!players[secondarydisplayplayer].spectator && NetPacket.packet.newteam == 3))
error = true;
}
if (players[secondarydisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[secondarydisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[secondarydisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[secondarydisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2705,18 +2711,12 @@ static void Command_Teamchange3_f(void)
return;
}
if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam == (unsigned)players[thirddisplayplayer].ctfteam ||
(players[thirddisplayplayer].spectator && !NetPacket.packet.newteam))
error = true;
}
else if (G_GametypeHasSpectators())
{
if ((players[thirddisplayplayer].spectator && !NetPacket.packet.newteam) ||
(!players[thirddisplayplayer].spectator && NetPacket.packet.newteam == 3))
error = true;
}
if (players[thirddisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[thirddisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[thirddisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[thirddisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2802,18 +2802,12 @@ static void Command_Teamchange4_f(void)
return;
}
if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam == (unsigned)players[fourthdisplayplayer].ctfteam ||
(players[fourthdisplayplayer].spectator && !NetPacket.packet.newteam))
error = true;
}
else if (G_GametypeHasSpectators())
{
if ((players[fourthdisplayplayer].spectator && !NetPacket.packet.newteam) ||
(!players[fourthdisplayplayer].spectator && NetPacket.packet.newteam == 3))
error = true;
}
if (players[fourthdisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[fourthdisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[fourthdisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[fourthdisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -3013,24 +3007,23 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
// Prevent multiple changes in one go.
if (G_TagGametype())
if (players[playernum].spectator && !(players[playernum].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
return;
else if (G_TagGametype())
{
if (((players[playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 1) ||
(!(players[playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 2) ||
(players[playernum].spectator && NetPacket.packet.newteam == 0) ||
(!players[playernum].spectator && NetPacket.packet.newteam == 3))
return;
}
else if (G_GametypeHasTeams())
{
if ((NetPacket.packet.newteam && (NetPacket.packet.newteam == (unsigned)players[playernum].ctfteam)) ||
(players[playernum].spectator && !NetPacket.packet.newteam))
if (NetPacket.packet.newteam && (NetPacket.packet.newteam == (unsigned)players[playernum].ctfteam))
return;
}
else if (G_GametypeHasSpectators())
{
if ((players[playernum].spectator && !NetPacket.packet.newteam) ||
(!players[playernum].spectator && NetPacket.packet.newteam == 3))
if (!players[playernum].spectator && NetPacket.packet.newteam == 3)
return;
}
else
@ -3102,19 +3095,26 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
//Safety first!
if (players[playernum].mo)
// (not respawning spectators here...)
if (!players[playernum].spectator)
{
if (!players[playernum].spectator)
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
else
if (players[playernum].mo)
{
P_RemoveMobj(players[playernum].mo);
players[playernum].mo = NULL;
players[playernum].playerstate = PST_REBORN;
//if (!players[playernum].spectator)
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
/*else
{
if (players[playernum].mo)
{
P_RemoveMobj(players[playernum].mo);
players[playernum].mo = NULL;
}
players[playernum].playerstate = PST_REBORN;
}*/
}
else
players[playernum].playerstate = PST_REBORN;
}
else
players[playernum].playerstate = PST_REBORN;
//Now that we've done our error checking and killed the player
//if necessary, put the player on the correct team/status.
@ -3128,7 +3128,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
else if (NetPacket.packet.newteam != 3) // .newteam == 1 or 2.
{
players[playernum].spectator = false;
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
players[playernum].pflags &= ~PF_TAGGED;//Just in case.
if (NetPacket.packet.newteam == 1) //Make the player IT.
@ -3138,7 +3138,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
else // Just join the game.
{
players[playernum].spectator = false;
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
//If joining after hidetime in normal tag, default to being IT.
if (gametype == GT_TAG && (leveltime > (hidetime * TICRATE)))
@ -3158,7 +3158,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
else
{
players[playernum].ctfteam = NetPacket.packet.newteam;
players[playernum].spectator = false;
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
}
}
else if (G_GametypeHasSpectators())
@ -3166,7 +3166,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (!NetPacket.packet.newteam)
players[playernum].spectator = true;
else
players[playernum].spectator = false;
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
}
if (NetPacket.packet.autobalance)
@ -3198,7 +3198,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80');
}
else if (NetPacket.packet.newteam == 3)
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[playernum]);
/*CONS_Printf(M_GetText("%s entered the game.\n"), player_names[playernum])*/;
else if (players[playernum].pflags & PF_WANTSTOJOIN)
players[playernum].pflags &= ~PF_WANTSTOJOIN;
else
CONS_Printf(M_GetText("%s became a spectator.\n"), player_names[playernum]);
@ -3221,10 +3223,18 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
}
if (gamestate != GS_LEVEL)
return;
// Clear player score and rings if a spectator.
if (players[playernum].spectator)
{
//players[playernum].score = 0; // SRB2kart
if (G_BattleGametype()) // SRB2kart
{
players[playernum].marescore = 0;
if (K_IsPlayerWanted(&players[playernum]))
K_CalculateBattleWanted();
}
players[playernum].health = 1;
if (players[playernum].mo)
players[playernum].mo->health = 1;
@ -3234,7 +3244,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (G_TagGametype())
P_CheckSurvivors();
else if (G_BattleGametype())
K_CheckBalloons(); // SRB2Kart
K_CheckBumpers(); // SRB2Kart
else if (G_RaceGametype())
P_CheckRacers(); // also SRB2Kart
}
@ -3271,10 +3281,12 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
#define BASESALT "basepasswordstorage"
static UINT8 adminpassmd5[16];
static boolean adminpasswordset = false;
void D_SetPassword(const char *pw)
{
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
adminpasswordset = true;
}
// Remote Administration
@ -3346,6 +3358,12 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
if (client)
return;
if (!adminpasswordset)
{
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
return;
}
// Do the final pass to compare with the sent md5
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5);
@ -4026,27 +4044,12 @@ static void Command_ModDetails_f(void)
//
static void Command_ShowGametype_f(void)
{
INT32 j;
const char *gametypestr = NULL;
if (!(netgame || multiplayer)) // print "Single player" instead of "Co-op"
if (!(netgame || multiplayer)) // print "Single player" instead of "Race"
{
CONS_Printf(M_GetText("Current gametype is %s\n"), M_GetText("Single player"));
CONS_Printf(M_GetText("Current gametype is %s\n"), "Single Player");
return;
}
// find name string for current gametype
for (j = 0; gametype_cons_t[j].strvalue; j++)
{
if (gametype_cons_t[j].value == gametype)
{
gametypestr = gametype_cons_t[j].strvalue;
break;
}
}
if (gametypestr)
CONS_Printf(M_GetText("Current gametype is %s\n"), gametypestr);
else // string for current gametype was not found above (should never happen)
CONS_Printf(M_GetText("Unknown gametype set (%d)\n"), gametype);
CONS_Printf(M_GetText("Current gametype is %s\n"), gametype_cons_t[gametype].strvalue);
}
/** Plays the intro.
@ -4179,20 +4182,9 @@ static void TimeLimit_OnChange(void)
*/
void D_GameTypeChanged(INT32 lastgametype)
{
if (netgame)
{
INT32 j;
const char *oldgt = NULL, *newgt = NULL;
for (j = 0; gametype_cons_t[j].strvalue; j++)
{
if (gametype_cons_t[j].value == lastgametype)
oldgt = gametype_cons_t[j].strvalue;
if (gametype_cons_t[j].value == gametype)
newgt = gametype_cons_t[j].strvalue;
}
if (oldgt && newgt)
CONS_Printf(M_GetText("Gametype was changed from %s to %s\n"), oldgt, newgt);
}
if (multiplayer)
CONS_Printf(M_GetText("Gametype was changed from %s to %s\n"), gametype_cons_t[lastgametype].strvalue, gametype_cons_t[gametype].strvalue);
// Only do the following as the server, not as remote admin.
// There will always be a server, and this only needs to be done once.
if (server && (multiplayer || netgame))
@ -4268,7 +4260,7 @@ void D_GameTypeChanged(INT32 lastgametype)
// When swapping to a gametype that supports spectators,
// make everyone a spectator initially.
/*if (!splitscreen && (G_GametypeHasSpectators()))
/*if (G_GametypeHasSpectators())
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
@ -4596,6 +4588,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
{
INT32 i;
UINT8 gt, secondgt;
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
@ -4611,13 +4604,19 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
return;
}
for (i = 0; i < 4; i++)
gt = (UINT8)READUINT8(*cp);
secondgt = (UINT8)READUINT8(*cp);
for (i = 0; i < 5; i++)
{
votelevels[i] = (INT16)READUINT16(*cp);
if (!mapheaderinfo[votelevels[i]])
P_AllocMapHeader(votelevels[i]);
votelevels[i][0] = (UINT16)READUINT16(*cp);
votelevels[i][1] = gt;
if (!mapheaderinfo[votelevels[i][0]])
P_AllocMapHeader(votelevels[i][0]);
}
votelevels[2][1] = secondgt;
G_SetGamestate(GS_VOTING);
Y_StartVote();
}
@ -4742,7 +4741,7 @@ static void Command_RestartAudio_f(void)
I_SetSfxVolume(cv_soundvolume.value);
I_SetDigMusicVolume(cv_digmusicvolume.value);
I_SetMIDIMusicVolume(cv_midimusicvolume.value);
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
if (Playing()) // Gotta make sure the player is in a level
P_RestoreMusic(&players[consoleplayer]);
@ -5207,26 +5206,73 @@ static void Command_ShowTime_f(void)
}
// SRB2Kart: On change messages
static void BaseNumLaps_OnChange(void)
{
if (gamestate == GS_LEVEL)
{
if (cv_basenumlaps.value)
CONS_Printf(M_GetText("Number of laps will be changed to %d next round.\n"), cv_basenumlaps.value);
else
CONS_Printf(M_GetText("Number of laps will be changed to map defaults next round.\n"));
}
}
static void KartFrantic_OnChange(void)
{
if ((boolean)cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL)
if ((boolean)cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Frantic items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Frantic items has been turned %s.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off"));
franticitems = (boolean)cv_kartfrantic.value;
}
}
static void KartSpeed_OnChange(void)
{
if ((UINT8)cv_kartspeed.value != gamespeed && G_RaceGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string);
if (G_RaceGametype())
{
if ((UINT8)cv_kartspeed.value != gamespeed && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string);
else
{
CONS_Printf(M_GetText("Game speed has been changed to \"%s\".\n"), cv_kartspeed.string);
gamespeed = (UINT8)cv_kartspeed.value;
}
}
}
static void KartMirror_OnChange(void)
{
if ((boolean)cv_kartmirror.value != mirrormode && G_RaceGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Mirror Mode will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
if (G_RaceGametype())
{
if ((boolean)cv_kartmirror.value != mirrormode && gamestate == GS_LEVEL /*&& leveltime > starttime*/)
CONS_Printf(M_GetText("Mirrored tracks will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Mirrored tracks has been turned %s.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
mirrormode = (boolean)cv_kartmirror.value;
}
}
}
static void KartComeback_OnChange(void)
{
if ((boolean)cv_kartcomeback.value != comeback && G_BattleGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
}
if (G_BattleGametype())
{
if ((boolean)cv_kartcomeback.value != comeback && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Karma Comeback has been turned %s.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
comeback = (boolean)cv_kartcomeback.value;
}
}
}
static void KartEliminateLast_OnChange(void)
{
if (G_RaceGametype() && cv_karteliminatelast.value)
P_CheckRacers();
}

View file

@ -77,7 +77,7 @@ extern consvar_t cv_friendlyfire;
extern consvar_t cv_pointlimit;
extern consvar_t cv_timelimit;
extern consvar_t cv_numlaps;
extern consvar_t cv_usemapnumlaps;
extern consvar_t cv_basenumlaps;
extern UINT32 timelimitintics;
extern consvar_t cv_allowexitlevel;
@ -103,31 +103,37 @@ extern consvar_t cv_pause;
extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_respawntime;
extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility;
/*extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility;
extern consvar_t cv_jumpshield, cv_watershield, cv_ringshield, cv_forceshield, cv_bombshield;
extern consvar_t cv_1up, cv_eggmanbox;
extern consvar_t cv_recycler;
extern consvar_t cv_recycler;*/
// SRB2kart items
extern consvar_t cv_magnet, cv_boo, cv_mushroom, cv_triplemushroom, cv_megashroom;
extern consvar_t cv_goldshroom, cv_star, cv_triplebanana, cv_fakeitem, cv_banana;
extern consvar_t cv_greenshell, cv_redshell, cv_laserwisp, cv_triplegreenshell, cv_bobomb;
extern consvar_t cv_blueshell, cv_jaws, cv_fireflower, cv_tripleredshell, cv_lightning;
extern consvar_t cv_feather;
extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana;
extern consvar_t cv_eggmanmonitor, cv_orbinaut, cv_jawz, cv_mine;
extern consvar_t cv_ballhog, cv_selfpropelledbomb, cv_grow, cv_shrink;
extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring;
extern consvar_t cv_triplesneaker, cv_triplebanana, cv_tripleorbinaut, cv_dualjawz;
extern consvar_t cv_karthud;
extern consvar_t cv_kartminimap;
extern consvar_t cv_kartcheck;
extern consvar_t cv_kartstarsfx;
extern consvar_t cv_kartinvinsfx;
extern consvar_t cv_kartspeed;
extern consvar_t cv_kartballoons;
extern consvar_t cv_kartbumpers;
extern consvar_t cv_kartfrantic;
extern consvar_t cv_kartcomeback;
extern consvar_t cv_kartmirror;
extern consvar_t cv_speedometer;
extern consvar_t cv_kartspeedometer;
extern consvar_t cv_kartvoices;
extern consvar_t cv_karteliminatelast;
extern consvar_t cv_votetime;
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugcheckpoint, cv_kartdebugshrink;
extern consvar_t cv_itemfinder;
extern consvar_t cv_inttime, cv_advancemap, cv_playersforexit;

View file

@ -108,8 +108,8 @@ typedef enum
// Did you get a time-over?
PF_TIMEOVER = 1<<10,
// Ready for Super?
PF_SUPERREADY = 1<<11,
// SRB2Kart: Spectator that wants to join
PF_WANTSTOJOIN = 1<<11,
// Character action status
PF_JUMPED = 1<<12,
@ -230,93 +230,109 @@ typedef enum
NUMPOWERS
} powertype_t;
typedef enum
{
KITEM_SAD = -1,
KITEM_NONE = 0,
KITEM_SNEAKER,
KITEM_ROCKETSNEAKER,
KITEM_INVINCIBILITY,
KITEM_BANANA,
KITEM_EGGMAN,
KITEM_ORBINAUT,
KITEM_JAWZ,
KITEM_MINE,
KITEM_BALLHOG,
KITEM_SPB,
KITEM_GROW,
KITEM_SHRINK,
KITEM_THUNDERSHIELD,
KITEM_HYUDORO,
KITEM_POGOSPRING,
KITEM_KITCHENSINK,
NUMKARTITEMS,
// Additional roulette numbers, only used for K_KartGetItemResult
KRITEM_TRIPLESNEAKER = NUMKARTITEMS,
KRITEM_TRIPLEBANANA,
KRITEM_TENFOLDBANANA,
KRITEM_TRIPLEORBINAUT,
KRITEM_QUADORBINAUT,
KRITEM_DUALJAWZ,
NUMKARTRESULTS
} kartitems_t;
//{ SRB2kart - kartstuff
typedef enum
{
// Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff
k_oldposition, // Used for taunting when you pass someone
k_positiondelay, // Prevents player from taunting continuously if two people were neck-and-neck
k_positiondelay, // Used for position number, so it can grow when passing/being passed
k_prevcheck, // Previous checkpoint distance; for p_user.c (was "pw_pcd")
k_nextcheck, // Next checkpoint distance; for p_user.c (was "pw_ncd")
k_waypoint, // Waypoints.
k_starpostwp, // Temporarily stores player waypoint for... some reason. Used when respawning and finishing.
k_lakitu, // Timer for Lakitu to carry and drop the player
k_respawn, // Timer for the DEZ laser respawn effect
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
k_lapanimation, // Used to make a swoopy lap lakitu, maybe other effects in the future
k_lapanimation, // Used to show the lap start wing logo animation
k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
k_voices, // Used to stop the player saying more voices than it should
k_tauntvoices, // Used to specifically stop taunt voice spam
k_instashield, // Instashield no-damage animation timer
k_boosting, // Determines if you're currently shroom-boosting
k_floorboost, // Prevents Mushroom sounds for a breif duration when triggered by a floor panel
k_spinout, // Separate confirmation to prevent endless wipeout loops
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_drift, // Drifting Left or Right, plus a bigger counter = sharper turn
k_driftend, // Drift has ended, used to adjust character angle after drift
k_driftcharge, // Charge your drift so you can release a burst of speed
k_driftboost, // Boost you get from drifting
k_boostcharge, // Charge-up for boosting at the start of the race, or when Lakitu drops you
k_boostcharge, // Charge-up for boosting at the start of the race, or when dropping from respawn
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
k_pogospring, // Pogo spring bounce effect
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
k_waterskip, // Water skipping counter
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)
k_itemclose, // Used to animate the item window closing (was "pw_psychic")
// Item held stuff
k_itemtype, // KITEM_ constant for item number
k_itemamount, // Amount of said item
k_itemheld, // Are you holding an item?
// Some items use timers for their duration or effects
k_magnettimer, // Duration of Magnet's item-break and item box pull
k_bootimer, // Duration of the boo offroad effect itself
k_bootaketimer, // You are stealing an item, this is your timer
k_boostolentimer, // You are being stolen from, this is your timer
k_mushroomtimer, // Duration of the Mushroom Boost itself
k_growshrinktimer, // > 0 = Big, < 0 = small
k_squishedtimer, // Squished frame timer
k_goldshroomtimer, // Gold Mushroom duration timer
k_startimer, // Invincibility timer
k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam")
k_laserwisptimer, // The duration and relative angle of the laser
k_justbumped, // Prevent players from endlessly bumping into each other
k_deathsentence, // 30 seconds to live... (Blue Shell murder timer (not actually 30 sec, I just couldn't help the FF reference :p))
k_poweritemtimer, // Battle mode, how long before you're allowed another power item (Star, Megashroom)
k_comebacktimer, // Battle mode, how long before you become a bomb after death
// Each item needs its own power slot, for the HUD and held use
// *** ADDING A NEW ITEM? ADD IT TO K_DoBooSteal PLEASE!! -Salt ***
k_magnet, // 0x1 = Magnet in inventory
k_boo, // 0x1 = Boo in inventory
k_mushroom, // 0x1 = 1 Mushroom in inventory, 0x2 = 2 Mushrooms in inventory
// 0x4 = 3 Mushrooms in inventory
k_megashroom, // 0x1 = Mega Mushroom in inventory
k_goldshroom, // 0x1 = Gold Mushroom in inventory
k_star, // 0x1 = Star in inventory
k_triplebanana, // 0x1 = 1 Banana following, 0x2 = 2 Bananas following
// 0x4 = 3 Bananas following, 0x8 = Triple Banana in inventory
k_fakeitem, // 0x1 = Fake Item being held, 0x2 = Fake Item in inventory
k_banana, // 0x1 = Banana being held, 0x2 = Banana in inventory
k_greenshell, // 0x1 = Green Shell being held, 0x2 = Green Shell in inventory
k_redshell, // 0x1 = Red Shell being held, 0x2 = Red Shell in inventory
k_laserwisp, // 0x1 = Laser Wisp in inventory
k_triplegreenshell, // 0x1 = 1 Green Shell orbiting, 0x2 = 2 Green Shells orbiting
// 0x4 = 3 Green Shells orbiting, 0x8 = Triple Green Shell in inventory
k_bobomb, // 0x1 = Bob-omb being held, 0x2 = Bob-omb in inventory
k_blueshell, // 0x1 = Blue Shell in inventory
k_jaws, // 0x1 = 1 Jaws orbiting, 0x2 = 2 Jaws orbiting,
// 0x4 = 2x Jaws in inventory
k_fireflower, // 0x1 = Fire Flower in inventory
k_tripleredshell, // 0x1 = 1 Red Shell orbiting, 0x2 = 2 Red Shells orbiting
// 0x4 = 3 Red Shells orbiting, 0x8 = Triple Red Shell in inventory
k_lightning, // 0x1 = Lightning in inventory
k_feather, // 0x1 = Feather in inventory, 0x2 = Player is feather jumping
k_kitchensink, // 0x1 = Sink in inventory
//k_thunderanim, // Duration of Thunder Shield's use animation
k_curshield, // 0 = no shield, 1 = thunder shield
k_hyudorotimer, // Duration of the Hyudoro offroad effect itself
k_stealingtimer, // You are stealing an item, this is your timer
k_stolentimer, // You are being stolen from, this is your timer
k_sneakertimer, // Duration of the Sneaker Boost itself
k_growshrinktimer, // > 0 = Big, < 0 = small
k_squishedtimer, // Squished frame timer
k_rocketsneakertimer, // Rocket Sneaker duration timer
k_invincibilitytimer, // Invincibility timer
k_deathsentence, // 30 seconds to live... (SPB murder timer (not actually 30 sec, I just couldn't help the FF reference :p))
k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items
k_eggmanexplode, // Fake item recieved, explode in a few seconds
k_eggmanblame, // Fake item recieved, who set this fake
k_bananadrag, // After a second of holding a banana behind you, you start to slow down
k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam")
k_wipeoutslow, // Timer before you slowdown when getting wiped out
k_justbumped, // Prevent players from endlessly bumping into each other
k_comebacktimer, // Battle mode, how long before you become a bomb after death
k_sadtimer, // How long you've been sad
// Battle Mode vars
k_balloon, // Number of balloons left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a balloon
k_bumper, // Number of bumpers left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
NUMKARTSTUFF
} kartstufftype_t;
@ -511,7 +527,7 @@ typedef struct player_s
tic_t startedtime; // Time which you started this mare with.
tic_t finishedtime; // Time it took you to finish the mare (used for display)
INT16 finishedrings; // The rings you had left upon finishing the mare
UINT32 marescore; // score for this nights stage
UINT32 marescore; // SRB2Kart: Battle score
UINT32 lastmarescore; // score for the last mare
UINT8 lastmare; // previous mare
INT32 maxlink; // maximum link obtained

View file

@ -1824,8 +1824,10 @@ static actionpointer_t actionpointers[] =
{{A_RemoteAction}, "A_REMOTEACTION"},
{{A_ToggleFlameJet}, "A_TOGGLEFLAMEJET"},
{{A_ItemPop}, "A_ITEMPOP"}, // SRB2kart
{{A_RedShellChase}, "A_REDSHELLCHASE"}, // SRB2kart
{{A_BobombExplode}, "A_BOBOMBEXPLODE"}, // SRB2kart
{{A_JawzChase}, "A_JAWZCHASE"}, // SRB2kart
{{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart
{{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart
{{A_OrbitNights}, "A_ORBITNIGHTS"},
{{A_GhostMe}, "A_GHOSTME"},
{{A_SetObjectState}, "A_SETOBJECTSTATE"},
@ -3182,6 +3184,14 @@ static void readwipes(MYFILE *f)
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_specinter_final;
}
else if (fastncmp(word, "VOTING_", 10))
{
pword = word + 10;
if (fastcmp(pword, "TOBLACK"))
wipeoffset = wipe_specinter_toblack;
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_specinter_final;
}
else if (fastncmp(word, "MULTINTER_", 10))
{
pword = word + 10;
@ -5807,15 +5817,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREBALL2",
"S_FIREBALL3",
"S_FIREBALL4",
"S_FIREBALL5",
"S_FIREBALL6",
"S_FIREBALL7",
"S_FIREBALLEXP1",
"S_FIREBALLEXP2",
"S_FIREBALLEXP3",
"S_FIREBALLEXP4",
"S_FIREBALLEXP5",
"S_FIREBALLEXP6",
"S_SHELL",
"S_SHELL1",
"S_SHELL2",
@ -6243,9 +6247,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DRIFTDUST3",
"S_DRIFTDUST4",
// Magnet Burst
// Thunder Shield Burst
// Mushroom Fire Trail
// Sneaker Fire Trail
"S_KARTFIRE1",
"S_KARTFIRE2",
"S_KARTFIRE3",
@ -6255,7 +6259,33 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_KARTFIRE7",
"S_KARTFIRE8",
//{ Fake Item
// Invincibility Sparks
"S_KARTINVULN_SMALL1",
"S_KARTINVULN_SMALL2",
"S_KARTINVULN_SMALL3",
"S_KARTINVULN_SMALL4",
"S_KARTINVULN_SMALL5",
"S_KARTINVULN_LARGE1",
"S_KARTINVULN_LARGE2",
"S_KARTINVULN_LARGE3",
"S_KARTINVULN_LARGE4",
"S_KARTINVULN_LARGE5",
// Invincibility flash overlay
"S_INVULNFLASH1",
"S_INVULNFLASH2",
"S_INVULNFLASH3",
"S_INVULNFLASH4",
// Wipeout dust trail
"S_WIPEOUTTRAIL1",
"S_WIPEOUTTRAIL2",
"S_WIPEOUTTRAIL3",
"S_WIPEOUTTRAIL4",
"S_WIPEOUTTRAIL5",
//{ Eggman Monitor
"S_FAKEITEM1",
"S_FAKEITEM2",
"S_FAKEITEM3",
@ -6284,81 +6314,79 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
//}
// Banana
"S_BANANAITEM",
"S_DEADBANANA",
"S_BANANA",
"S_BANANA_DEAD",
//{ Green Shell
"S_TRIPLEGREENSHIELD1",
"S_TRIPLEGREENSHIELD2",
"S_TRIPLEGREENSHIELD3",
"S_TRIPLEGREENSHIELD4",
"S_TRIPLEGREENSHIELD5",
"S_TRIPLEGREENSHIELD6",
"S_TRIPLEGREENSHIELD7",
"S_TRIPLEGREENSHIELD8",
"S_GREENSHIELD1",
"S_GREENSHIELD2",
"S_GREENSHIELD3",
"S_GREENSHIELD4",
"S_GREENSHIELD5",
"S_GREENSHIELD6",
"S_GREENSHIELD7",
"S_GREENSHIELD8",
"S_GREENITEM1",
"S_GREENITEM2",
"S_GREENITEM3",
"S_GREENITEM4",
"S_GREENITEM5",
"S_GREENITEM6",
"S_GREENITEM7",
"S_GREENITEM8",
"S_DEADGREEN",
//{ Orbinaut
"S_ORBINAUT1",
"S_ORBINAUT2",
"S_ORBINAUT3",
"S_ORBINAUT4",
"S_ORBINAUT5",
"S_ORBINAUT6",
"S_ORBINAUT_DEAD",
"S_ORBINAUT_SHIELD1",
"S_ORBINAUT_SHIELD2",
"S_ORBINAUT_SHIELD3",
"S_ORBINAUT_SHIELD4",
"S_ORBINAUT_SHIELD5",
"S_ORBINAUT_SHIELD6",
"S_ORBINAUT_SHIELDDEAD",
//}
//{ Red Shell
"S_TRIPLEREDSHIELD1",
"S_TRIPLEREDSHIELD2",
"S_TRIPLEREDSHIELD3",
"S_TRIPLEREDSHIELD4",
"S_TRIPLEREDSHIELD5",
"S_TRIPLEREDSHIELD6",
"S_TRIPLEREDSHIELD7",
"S_TRIPLEREDSHIELD8",
"S_REDSHIELD1",
"S_REDSHIELD2",
"S_REDSHIELD3",
"S_REDSHIELD4",
"S_REDSHIELD5",
"S_REDSHIELD6",
"S_REDSHIELD7",
"S_REDSHIELD8",
"S_REDITEM1",
"S_REDITEM2",
"S_REDITEM3",
"S_REDITEM4",
"S_REDITEM5",
"S_REDITEM6",
"S_REDITEM7",
"S_REDITEM8",
"S_DEADRED",
//{ Jawz
"S_JAWZ1",
"S_JAWZ2",
"S_JAWZ3",
"S_JAWZ4",
"S_JAWZ5",
"S_JAWZ6",
"S_JAWZ7",
"S_JAWZ8",
"S_JAWZ_DUD1",
"S_JAWZ_DUD2",
"S_JAWZ_DUD3",
"S_JAWZ_DUD4",
"S_JAWZ_DUD5",
"S_JAWZ_DUD6",
"S_JAWZ_DUD7",
"S_JAWZ_DUD8",
"S_JAWZ_SHIELD1",
"S_JAWZ_SHIELD2",
"S_JAWZ_SHIELD3",
"S_JAWZ_SHIELD4",
"S_JAWZ_SHIELD5",
"S_JAWZ_SHIELD6",
"S_JAWZ_SHIELD7",
"S_JAWZ_SHIELD8",
"S_JAWZ_DEAD1",
"S_JAWZ_DEAD2",
//}
"S_FIRETRAIL1",
"S_FIRETRAIL2",
"S_FIRETRAIL3",
"S_FIRETRAIL4",
"S_FIRETRAIL5",
"S_FIRETRAIL6",
"S_FIRETRAIL7",
"S_FIRETRAIL8",
"S_FIRETRAIL9",
// Bob-omb
"S_BOMBSHIELD",
"S_BOMBITEM",
"S_BOMBAIR",
"S_BOMBEXPLODE",
"S_BOMBEXPLOSION1",
"S_BOMBEXPLOSION2",
// Special Stage Mine
"S_SSMINE1",
"S_SSMINE2",
"S_SSMINE3",
"S_SSMINE4",
"S_SSMINE_SHIELD1",
"S_SSMINE_SHIELD2",
"S_SSMINE_AIR1",
"S_SSMINE_AIR2",
"S_SSMINE_DEPLOY1",
"S_SSMINE_DEPLOY2",
"S_SSMINE_DEPLOY3",
"S_SSMINE_DEPLOY4",
"S_SSMINE_DEPLOY5",
"S_SSMINE_DEPLOY6",
"S_SSMINE_DEPLOY7",
"S_SSMINE_DEPLOY8",
"S_SSMINE_DEPLOY9",
"S_SSMINE_DEPLOY10",
"S_SSMINE_DEPLOY11",
"S_SSMINE_DEPLOY12",
"S_SSMINE_DEPLOY13",
"S_SSMINE_EXPLODE",
"S_MINEEXPLOSION1",
"S_MINEEXPLOSION2",
// New explosion
"S_QUICKBOOM1",
@ -6383,33 +6411,85 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_SLOWBOOM9",
"S_SLOWBOOM10",
// Blue Shell - Blue Lightning for now...
// Ballhog
"S_BALLHOG1",
"S_BALLHOG2",
"S_BALLHOG3",
"S_BALLHOG4",
"S_BALLHOG5",
"S_BALLHOG6",
"S_BALLHOG7",
"S_BALLHOG8",
"S_BALLHOG_DEAD",
"S_BALLHOGBOOM1",
"S_BALLHOGBOOM2",
"S_BALLHOGBOOM3",
"S_BALLHOGBOOM4",
"S_BALLHOGBOOM5",
"S_BALLHOGBOOM6",
"S_BALLHOGBOOM7",
"S_BALLHOGBOOM8",
"S_BALLHOGBOOM9",
"S_BALLHOGBOOM10",
"S_BALLHOGBOOM11",
"S_BALLHOGBOOM12",
"S_BALLHOGBOOM13",
"S_BALLHOGBOOM14",
"S_BALLHOGBOOM15",
"S_BALLHOGBOOM16",
// Self-Propelled Bomb - just an explosion for now...
"S_BLUELIGHTNING1",
"S_BLUELIGHTNING2",
"S_BLUELIGHTNING3",
"S_BLUELIGHTNING4",
"S_BLUEEXPLODE",
// Lightning
// Grow/shrink beams
"S_LIGHTNING1",
"S_LIGHTNING2",
"S_LIGHTNING3",
"S_LIGHTNING4",
// Thunder Shield
"S_THUNDERSHIELD1",
"S_THUNDERSHIELD2",
"S_THUNDERSHIELD3",
"S_THUNDERSHIELD4",
"S_THUNDERSHIELD5",
"S_THUNDERSHIELD6",
"S_THUNDERSHIELD7",
"S_THUNDERSHIELD8",
"S_THUNDERSHIELD9",
"S_THUNDERSHIELD10",
"S_THUNDERSHIELD11",
"S_THUNDERSHIELD12",
"S_THUNDERSHIELD13",
"S_THUNDERSHIELD14",
"S_THUNDERSHIELD15",
"S_THUNDERSHIELD16",
"S_THUNDERSHIELD17",
"S_THUNDERSHIELD18",
"S_THUNDERSHIELD19",
"S_THUNDERSHIELD20",
"S_THUNDERSHIELD21",
"S_THUNDERSHIELD22",
"S_THUNDERSHIELD23",
"S_THUNDERSHIELD24",
// The legend
"S_SINK",
"S_SINKTRAIL1",
"S_SINKTRAIL2",
"S_SINKTRAIL3",
// Battle Mode balloon
"S_BATTLEBALLOON1",
"S_BATTLEBALLOON2",
"S_BATTLEBALLOON3",
// Battle Mode bumper
"S_BATTLEBUMPER1",
"S_BATTLEBUMPER2",
"S_BATTLEBUMPER3",
// Lakitu
"S_LAKITU1",
"S_LAKITU2",
// DEZ respawn laser
"S_DEZLASER",
// Pokey
"S_POKEY1",
@ -6489,15 +6569,22 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DOOD_BOX4",
"S_DOOD_BOX5",
// D00Dkart - Diddy Kong Racing Balloon
// D00Dkart - Diddy Kong Racing Bumper
"S_DOOD_BALLOON",
// D00Dkart - Big Ring
"S_DOOD_RING1",
"S_DOOD_RING2",
"S_DOOD_RING3",
"S_DOOD_RING4",
"S_DOOD_RING5",
// Chaotix Big Ring
"S_BIGRING01",
"S_BIGRING02",
"S_BIGRING03",
"S_BIGRING04",
"S_BIGRING05",
"S_BIGRING06",
"S_BIGRING07",
"S_BIGRING08",
"S_BIGRING09",
"S_BIGRING10",
"S_BIGRING11",
"S_BIGRING12",
// SNES Objects
"S_SNES_DONUTBUSH1",
@ -6569,28 +6656,38 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREDITEM3",
"S_FIREDITEM4",
"S_INSTASHIELDA1", // No damage instashield effect
"S_INSTASHIELDA2",
"S_INSTASHIELDA3",
"S_INSTASHIELDA4",
"S_INSTASHIELDA5",
"S_INSTASHIELDA6",
"S_INSTASHIELDA7",
"S_INSTASHIELDB1",
"S_INSTASHIELDB2",
"S_INSTASHIELDB3",
"S_INSTASHIELDB4",
"S_INSTASHIELDB5",
"S_INSTASHIELDB6",
"S_INSTASHIELDB7",
"S_PLAYERARROW", // Above player arrow
"S_PLAYERARROW_MUSHROOM",
"S_PLAYERARROW_GREENSHELL",
"S_PLAYERARROW_BANANA",
"S_PLAYERARROW_FAKEITEM",
"S_PLAYERARROW_BOO",
"S_PLAYERARROW_FEATHER",
"S_PLAYERARROW_REDSHELL",
"S_PLAYERARROW_BOBOMB",
"S_PLAYERARROW_FIREFLOWER",
"S_PLAYERARROW_TRIPLEGREENSHELL",
"S_PLAYERARROW_TRIPLEBANANA",
"S_PLAYERARROW_TRIPLEREDSHELL",
"S_PLAYERARROW_STAR",
"S_PLAYERARROW_MEGASHROOM",
"S_PLAYERARROW_KITCHENSINK",
"S_PLAYERARROW_EMPTY",
"S_PLAYERARROW_ROULETTE",
"S_PLAYERARROW_BOX",
"S_PLAYERARROW_ITEM",
"S_PLAYERARROW_NUMBER",
"S_PLAYERARROW_X",
"S_PLAYERARROW_WANTED1",
"S_PLAYERARROW_WANTED2",
"S_PLAYERARROW_WANTED3",
"S_PLAYERARROW_WANTED4",
"S_PLAYERARROW_WANTED5",
"S_PLAYERARROW_WANTED6",
"S_PLAYERARROW_WANTED7",
"S_PLAYERBOMB", // Player bomb overlay
"S_PLAYERITEM", // Player item overlay
"S_PLAYERBOMB_WHEEL",
"S_KARMAWHEEL", // Karma player wheels
#ifdef SEENAMES
"S_NAMECHECK",
@ -7109,52 +7206,50 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_RANDOMITEM",
"MT_RANDOMITEMPOP",
"MT_MUSHROOMTRAIL",
"MT_SNEAKERTRAIL",
"MT_SPARKLETRAIL",
"MT_INVULNFLASH",
"MT_WIPEOUTTRAIL",
"MT_DRIFT",
"MT_DRIFTDUST",
"MT_FAKESHIELD",
"MT_FAKEITEM",
"MT_TRIPLEBANANASHIELD1", // Banana Stuff
"MT_TRIPLEBANANASHIELD2",
"MT_TRIPLEBANANASHIELD3",
"MT_BANANASHIELD",
"MT_BANANAITEM",
"MT_BANANA", // Banana Stuff
"MT_BANANA_SHIELD",
"MT_TRIPLEGREENSHIELD1", // Green shell stuff
"MT_TRIPLEGREENSHIELD2",
"MT_TRIPLEGREENSHIELD3",
"MT_GREENSHIELD",
"MT_GREENITEM",
"MT_FIRETRAIL",
"MT_ORBINAUT", // Orbinaut stuff
"MT_ORBINAUT_SHIELD",
"MT_TRIPLEREDSHIELD1", // Red shell stuff
"MT_TRIPLEREDSHIELD2",
"MT_TRIPLEREDSHIELD3",
"MT_REDSHIELD",
"MT_REDITEM",
"MT_REDITEMDUD",
"MT_JAWZ", // Jawz stuff
"MT_JAWZ_DUD",
"MT_JAWZ_SHIELD",
"MT_BOMBSHIELD", // Bob-omb stuff
"MT_BOMBITEM",
"MT_BOMBEXPLOSION",
"MT_BOMBEXPLOSIONSOUND",
"MT_SSMINE_SHIELD", // Special Stage Mine stuff
"MT_SSMINE",
"MT_MINEEXPLOSION",
"MT_MINEEXPLOSIONSOUND",
"MT_SMOLDERING", // New explosion
"MT_BOOMEXPLODE",
"MT_BOOMPARTICLE",
"MT_BLUELIGHTNING", // Lightning stuff
"MT_BALLHOG", // Ballhog
"MT_BALLHOGBOOM",
"MT_BLUELIGHTNING", // Grow/shrink stuff
"MT_BLUEEXPLOSION",
"MT_LIGHTNING",
"MT_THUNDERSHIELD", // Thunder Shield stuff
"MT_SINK", // Kitchen Sink Stuff
"MT_SINKTRAIL",
"MT_BATTLEBALLOON", // Battle Mode balloon
"MT_BATTLEBUMPER", // Battle Mode bumper
"MT_LAKITU",
"MT_DEZLASER",
"MT_POKEY", // Huh, thought this was a default asset for some reason, guess not.
@ -7190,7 +7285,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_DOOD_FLOWER4",
"MT_DOOD_BOX",
"MT_DOOD_BALLOON",
"MT_DOOD_RING",
"MT_BIGRING",
"MT_SNES_DONUTBUSH1",
"MT_SNES_DONUTBUSH2",
@ -7225,7 +7320,14 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_FIREDITEM",
"MT_INSTASHIELDA",
"MT_INSTASHIELDB",
"MT_PLAYERARROW",
"MT_PLAYERWANTED",
"MT_KARMAHITBOX",
"MT_KARMAWHEEL",
#ifdef SEENAMES
"MT_NAMECHECK",
@ -7350,8 +7452,8 @@ static const char *const PLAYERFLAG_LIST[] = {
// Did you get a time-over?
"TIMEOVER",
// Ready for Super?
"SUPERREADY",
// SRB2Kart: spectator that wants to join
"WANTSTOJOIN",
// Character action status
"JUMPED",
@ -7429,64 +7531,64 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SILVER", // 03 // SKINCOLOR_SILVER
"CLOUDY", // 04 // SKINCOLOR_CLOUDY
"GREY", // 05 // SKINCOLOR_GREY
"DARKGREY", // 06 // SKINCOLOR_DARKGREY
"NICKEL", // 06 // SKINCOLOR_NICKEL
"BLACK", // 07 // SKINCOLOR_BLACK
"SALMON", // 08 // SKINCOLOR_SALMON
"PINK", // 09 // SKINCOLOR_PINK
"LIGHTRED", // 10 // SKINCOLOR_LIGHTRED
"SHINYRED", // 11 // SKINCOLOR_SHINYRED
"ROSE", // 10 // SKINCOLOR_ROSE
"RASPBERRY", // 11 // SKINCOLOR_RASPBERRY
"RED", // 12 // SKINCOLOR_RED
"DARKPINK", // 13 // SKINCOLOR_DARKPINK
"DARKRED", // 14 // SKINCOLOR_DARKRED
"RUBY", // 13 // SKINCOLOR_RUBY
"CRIMSON", // 14 // SKINCOLOR_CRIMSON
"DAWN", // 15 // SKINCOLOR_DAWN
"ORANGE", // 16 // SKINCOLOR_ORANGE
"SHINYORANGE", // 17 // SKINCOLOR_SHINYORANGE
"DARKORANGE", // 18 // SKINCOLOR_DARKORANGE
"GOLDENBROWN", // 19 // SKINCOLOR_GOLDENBROWN
"ROSEWOOD", // 20 // SKINCOLOR_ROSEWOOD
"DARKROSEWOOD", // 21 // SKINCOLOR_DARKROSEWOOD
"CREAMSICLE", // 16 // SKINCOLOR_CREAMSICLE
"ORANGE", // 17 // SKINCOLOR_ORANGE
"PUMPKIN", // 18 // SKINCOLOR_PUMPKIN
"ROSEWOOD", // 19 // SKINCOLOR_ROSEWOOD
"BURGUNDY", // 20 // SKINCOLOR_BURGUNDY
"BRONZE", // 21 // SKINCOLOR_BRONZE
"SEPIA", // 22 // SKINCOLOR_SEPIA
"BEIGE", // 23 // SKINCOLOR_BEIGE
"BROWN", // 24 // SKINCOLOR_BROWN
"LEATHER", // 25 // SKINCOLOR_LEATHER
"YELLOW", // 26 // SKINCOLOR_YELLOW
"PEACH", // 27 // SKINCOLOR_PEACH
"LIGHTORANGE", // 28 // SKINCOLOR_LIGHTORANGE
"CARAMEL", // 29 // SKINCOLOR_CARAMEL
"GOLD", // 30 // SKINCOLOR_GOLD
"SHINYCARAMEL", // 31 // SKINCOLOR_SHINYCARAMEL
"VOMIT", // 32 // SKINCOLOR_VOMIT
"GARDEN", // 33 // SKINCOLOR_GARDEN
"LIGHTARMY", // 34 // SKINCOLOR_LIGHTARMY
"ARMY", // 35 // SKINCOLOR_ARMY
"PISTACHIO", // 36 // SKINCOLOR_PISTACHIO
"ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD
"OLIVE", // 38 // SKINCOLOR_OLIVE
"DARKARMY", // 39 // SKINCOLOR_DARKARMY
"LIGHTGREEN", // 40 // SKINCOLOR_LIGHTGREEN
"UGLYGREEN", // 41 // SKINCOLOR_UGLYGREEN
"NEONGREEN", // 42 // SKINCOLOR_NEONGREEN
"GREEN", // 43 // SKINCOLOR_GREEN
"DARKGREEN", // 44 // SKINCOLOR_DARKGREEN
"PEACH", // 26 // SKINCOLOR_PEACH
"CARAMEL", // 27 // SKINCOLOR_CARAMEL
"TANGERINE", // 28 // SKINCOLOR_TANGERINE
"GOLD", // 29 // SKINCOLOR_GOLD
"VOMIT", // 30 // SKINCOLOR_VOMIT
"YELLOW", // 31 // SKINCOLOR_YELLOW
"CANARY", // 32 // SKINCOLOR_CANARY
"OLIVE", // 33 // SKINCOLOR_OLIVE
"GARDEN", // 34 // SKINCOLOR_GARDEN
"LIME", // 35 // SKINCOLOR_LIME
"TEA", // 36 // SKINCOLOR_TEA
"ARMY", // 37 // SKINCOLOR_ARMY
"PISTACHIO", // 38 // SKINCOLOR_PISTACHIO
"MOSS", // 39 // SKINCOLOR_MOSS
"MINT", // 40 // SKINCOLOR_MINT
"GREEN", // 41 // SKINCOLOR_GREEN
"ROBOHOOD", // 42 // SKINCOLOR_ROBOHOOD
"PINETREE", // 43 // SKINCOLOR_PINETREE
"EMERALD", // 44 // SKINCOLOR_EMERALD
"SWAMP", // 45 // SKINCOLOR_SWAMP
"FROST", // 46 // SKINCOLOR_FROST
"SLATE", // 47 // SKINCOLOR_SLATE
"LIGHTBLUE", // 48 // SKINCOLOR_LIGHTBLUE
"CYAN", // 49 // SKINCOLOR_CYAN
"CERULEAN", // 50 // SKINCOLOR_CERULEAN
"TURQUOISE", // 51 // SKINCOLOR_TURQUOISE
"TEAL", // 52 // SKINCOLOR_TEAL
"STEELBLUE", // 53 // SKINCOLOR_STEELBLUE
"BLUE", // 54 // SKINCOLOR_BLUE
"SHINYBLUE", // 55 // SKINCOLOR_SHINYBLUE
"AQUA", // 46 // SKINCOLOR_AQUA
"TEAL", // 47 // SKINCOLOR_TEAL
"CYAN", // 48 // SKINCOLOR_CYAN
"CERULEAN", // 49 // SKINCOLOR_CERULEAN
"SLATE", // 50 // SKINCOLOR_SLATE
"STEEL", // 51 // SKINCOLOR_STEEL
"PERIWINKLE", // 52 // SKINCOLOR_PERIWINKLE
"BLUE", // 53 // SKINCOLOR_BLUE
"SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE
"BLUEBERRY", // 55 // SKINCOLOR_BLUEBERRY
"NAVY", // 56 // SKINCOLOR_NAVY
"DARKBLUE", // 57 // SKINCOLOR_DARKBLUE
"JETBLACK", // 58 // SKINCOLOR_JETBLACK
"LILAC", // 59 // SKINCOLOR_LILAC
"PURPLE", // 60 // SKINCOLOR_PURPLE
"LAVENDER", // 61 // SKINCOLOR_LAVENDER
"JET", // 57 // SKINCOLOR_JET
"DUSK", // 58 // SKINCOLOR_DUSK
"PURPLE", // 59 // SKINCOLOR_PURPLE
"LAVENDER", // 60 // SKINCOLOR_LAVENDER
"INDIGO", // 61 // SKINCOLOR_INDIGO
"BYZANTIUM", // 62 // SKINCOLOR_BYZANTIUM
"INDIGO", // 63 // SKINCOLOR_INDIGO
"LILAC", // 63 // SKINCOLOR_LILAC
// Super special awesome Super flashing colors!
"SUPER1", // SKINCOLOR_SUPER1
@ -7551,17 +7653,16 @@ static const char *const KARTSTUFF_LIST[] = {
"NEXTCHECK",
"WAYPOINT",
"STARPOSTWP",
"LAKITU",
"RESPAWN",
"THROWDIR",
"LAPANIMATION",
"CARDANIMATION",
"VOICES",
"TAUNTVOICES",
"INSTASHIELD",
"BOOSTING",
"FLOORBOOST",
"SPINOUT",
"SPINOUTTYPE",
"DRIFT",
@ -7571,53 +7672,42 @@ static const char *const KARTSTUFF_LIST[] = {
"BOOSTCHARGE",
"JMP",
"OFFROAD",
"POGOSPRING",
"BRAKESTOP",
"WATERSKIP",
"ITEMROULETTE",
"ROULETTETYPE",
"ITEMCLOSE",
"MAGNETTIMER",
"BOOTIMER",
"BOOTAKETIMER",
"BOOSTOLENTIMER",
"MUSHROOMTIMER",
"ITEMTYPE",
"ITEMAMOUNT",
"ITEMHELD",
//"THUNDERANIM",
"CURSHIELD",
"HYUDOROTIMER",
"STEALINGTIMER",
"STOLENTIMER",
"SNEAKERTIMER",
"GROWSHRINKTIMER",
"SQUISHEDTIMER",
"GOLDSHROOMTIMER",
"STARTIMER",
"SPINOUTTIMER",
"LASERWISPTIMER",
"JUSTBUMPED",
"ROCKETSNEAKERTIMER",
"INVINCIBILITYTIMER",
"DEATHSENTENCE",
"POWERITEMTIMER",
"EGGMANHELD",
"EGGMANEXPLODE",
"EGGMANBLAME",
"BANANADRAG",
"SPINOUTTIMER",
"WIPEOUTSLOW",
"JUSTBUMPED",
"COMEBACKTIMER",
"SADTIMER",
"MAGNET",
"BOO",
"MUSHROOM",
"MEGASHROOM",
"GOLDSHROOM",
"STAR",
"TRIPLEBANANA",
"FAKEITEM",
"BANANA",
"GREENSHELL",
"REDSHELL",
"LASERWISP",
"TRIPLEGREENSHELL",
"BOBOMB",
"BLUESHELL",
"JAWS",
"FIREFLOWER",
"TRIPLEREDSHELL",
"LIGHTNING",
"FEATHER",
"KITCHENSINK",
"BALLOON",
"BUMPER",
"COMEBACKPOINTS",
"COMEBACKMODE"
"COMEBACKMODE",
"WANTED",
};
static const char *const HUDITEMS_LIST[] = {

View file

@ -50,7 +50,7 @@ static boolean wasPlaying;
static int cdVolume=0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track
// some crap cd drivers take up to

View file

@ -207,8 +207,8 @@ typedef struct
#define ZSHIFT 4
extern const char *Color_Names[MAXSKINCOLORS];
extern const UINT8 Color_Opposite[MAXSKINCOLORS*2];
//extern const char *Color_Names[MAXSKINCOLORS];
//extern const UINT8 Color_Opposite[MAXSKINCOLORS*2];
#define NUMMAPS 1035

View file

@ -161,6 +161,9 @@ extern FILE *logstream;
// Comment or uncomment this as necessary.
//#define USE_PATCH_DTA
// Kart has it's own, as well.
#define USE_PATCH_KART
// Modification options
// If you want to take advantage of the Master Server's ability to force clients to update
// to the latest version, fill these out. Otherwise, just comment out UPDATE_ALERT and leave
@ -234,64 +237,64 @@ typedef enum
SKINCOLOR_SILVER,
SKINCOLOR_CLOUDY,
SKINCOLOR_GREY,
SKINCOLOR_DARKGREY,
SKINCOLOR_NICKEL,
SKINCOLOR_BLACK,
SKINCOLOR_SALMON,
SKINCOLOR_PINK,
SKINCOLOR_LIGHTRED,
SKINCOLOR_SHINYRED,
SKINCOLOR_ROSE,
SKINCOLOR_RASPBERRY,
SKINCOLOR_RED,
SKINCOLOR_DARKPINK,
SKINCOLOR_DARKRED,
SKINCOLOR_RUBY,
SKINCOLOR_CRIMSON,
SKINCOLOR_DAWN,
SKINCOLOR_CREAMSICLE,
SKINCOLOR_ORANGE,
SKINCOLOR_SHINYORANGE,
SKINCOLOR_DARKORANGE,
SKINCOLOR_GOLDENBROWN,
SKINCOLOR_PUMPKIN,
SKINCOLOR_ROSEWOOD,
SKINCOLOR_DARKROSEWOOD,
SKINCOLOR_BURGUNDY,
SKINCOLOR_BRONZE,
SKINCOLOR_SEPIA,
SKINCOLOR_BEIGE,
SKINCOLOR_BROWN,
SKINCOLOR_LEATHER,
SKINCOLOR_YELLOW,
SKINCOLOR_PEACH,
SKINCOLOR_LIGHTORANGE,
SKINCOLOR_CARAMEL,
SKINCOLOR_TANGERINE,
SKINCOLOR_GOLD,
SKINCOLOR_SHINYCARAMEL,
SKINCOLOR_VOMIT,
SKINCOLOR_YELLOW,
SKINCOLOR_CANARY,
SKINCOLOR_OLIVE,
SKINCOLOR_GARDEN,
SKINCOLOR_LIGHTARMY,
SKINCOLOR_LIME,
SKINCOLOR_TEA,
SKINCOLOR_ARMY,
SKINCOLOR_PISTACHIO,
SKINCOLOR_ROBOHOOD,
SKINCOLOR_OLIVE,
SKINCOLOR_DARKARMY,
SKINCOLOR_LIGHTGREEN,
SKINCOLOR_UGLYGREEN,
SKINCOLOR_NEONGREEN,
SKINCOLOR_MOSS,
SKINCOLOR_MINT,
SKINCOLOR_GREEN,
SKINCOLOR_DARKGREEN,
SKINCOLOR_ROBOHOOD,
SKINCOLOR_PINETREE,
SKINCOLOR_EMERALD,
SKINCOLOR_SWAMP,
SKINCOLOR_FROST,
SKINCOLOR_SLATE,
SKINCOLOR_LIGHTBLUE,
SKINCOLOR_AQUA,
SKINCOLOR_TEAL,
SKINCOLOR_CYAN,
SKINCOLOR_CERULEAN,
SKINCOLOR_TURQUOISE,
SKINCOLOR_TEAL,
SKINCOLOR_STEELBLUE,
SKINCOLOR_SLATE,
SKINCOLOR_STEEL,
SKINCOLOR_PERIWINKLE,
SKINCOLOR_BLUE,
SKINCOLOR_SHINYBLUE,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_BLUEBERRY,
SKINCOLOR_NAVY,
SKINCOLOR_DARKBLUE,
SKINCOLOR_JETBLACK,
SKINCOLOR_LILAC,
SKINCOLOR_JET,
SKINCOLOR_DUSK,
SKINCOLOR_PURPLE,
SKINCOLOR_LAVENDER,
SKINCOLOR_BYZANTIUM,
SKINCOLOR_INDIGO,
SKINCOLOR_BYZANTIUM,
SKINCOLOR_LILAC,
// Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now.
MAXSKINCOLORS,
@ -434,6 +437,7 @@ extern INT32 cv_debug;
// Modifier key variables, accessible anywhere
extern UINT8 shiftdown, ctrldown, altdown;
extern boolean capslock;
// if we ever make our alloc stuff...
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
@ -540,4 +544,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
#define SECTORSPECIALSAFTERTHINK
/// SRB2Kart: Camera always has noclip.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM
#endif // __DOOMDEF__

View file

@ -80,15 +80,18 @@ extern INT16 gametype;
extern UINT8 splitscreen;
extern boolean circuitmap; // Does this level have 'circuit mode'?
extern boolean fromlevelselect;
extern boolean forceresetplayers;
// ========================================
// Internal parameters for sound rendering.
// ========================================
extern boolean nomidimusic; // defined in d_main.c
//extern boolean nomidimusic; // defined in d_main.c
#define nomidimusic true
extern boolean nosound;
extern boolean nodigimusic;
extern boolean music_disabled;
//extern boolean music_disabled;
#define music_disabled false
extern boolean sound_disabled;
extern boolean digital_disabled;
@ -303,21 +306,19 @@ enum TypeOfLevel
};
// Gametypes
enum GameType
enum GameType // SRB2Kart
{
GT_COOP = 0, // also used in single player
GT_COMPETITION, // Classic "Race"
GT_RACE,
GT_RACE = 0, // also used in record attack
GT_MATCH, // battle, but renaming would be silly
NUMGAMETYPES,
GT_MATCH,
// the following have been left in on account of just not wanting to deal with removing all the checks for them
GT_COOP,
GT_COMPETITION,
GT_TEAMMATCH,
GT_TAG,
GT_HIDEANDSEEK,
GT_CTF, // capture the flag
NUMGAMETYPES
GT_CTF
};
// If you alter this list, update gametype_cons_t in m_menu.c
@ -409,12 +410,17 @@ extern UINT16 spacetimetics;
extern UINT16 extralifetics;
// SRB2kart
extern INT32 bootime;
extern INT32 boostealtime;
extern INT32 mushroomtime;
extern tic_t introtime;
extern tic_t starttime;
extern INT32 hyudorotime;
extern INT32 stealtime;
extern INT32 sneakertime;
extern INT32 itemtime;
extern INT32 comebacktime;
extern INT32 bumptime;
extern INT32 wipeoutslowtime;
extern INT32 wantedreduce;
extern INT32 wantedfrequency;
extern UINT8 introtoplay;
extern UINT8 creditscutscene;
@ -445,15 +451,18 @@ extern boolean franticitems;
extern boolean mirrormode;
extern boolean comeback;
extern tic_t lightningcooldown;
extern tic_t blueshellincoming;
extern UINT8 blueshellplayer;
extern SINT8 battlewanted[4];
extern tic_t wantedcalcdelay;
extern tic_t indirectitemcooldown;
extern tic_t spbincoming;
extern UINT8 spbplayer;
extern tic_t mapreset;
extern boolean legitimateexit;
extern boolean comebackshowninfo;
extern tic_t curlap, bestlap;
extern INT16 votelevels[4];
extern INT16 votelevels[5][2];
extern SINT8 votes[MAXPLAYERS];
extern SINT8 pickedvote;

View file

@ -528,6 +528,7 @@ static const char *credits[] = {
"\"Nev3r\"",
"\"Ritz\"",
"\"Spherallic\"",
"\"DirkTheHusky\"",
"",
"\1Produced By",
"Kart Krew",
@ -593,7 +594,7 @@ void F_CreditDrawer(void)
UINT16 i;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
//V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
// Draw background
V_DrawSciencePatch(0, 0 - FixedMul(32<<FRACBITS, FixedDiv(credbgtimer%TICRATE, TICRATE)), V_SNAPTOTOP, W_CachePatchName("CREDTILE", PU_CACHE), FRACUNIT);
@ -624,7 +625,7 @@ void F_CreditDrawer(void)
y += 12<<FRACBITS;
break;
}
if (FixedMul(y,vid.dupy) > vid.height)
if (((y>>FRACBITS) * vid.dupy) > vid.height)
break;
}
@ -685,13 +686,20 @@ boolean F_CreditResponder(event_t *event)
break;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (event->type != ev_keydown)
return false;
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_SPACE && key != KEY_BACKSPACE)
if (key == KEY_DOWNARROW || key == KEY_SPACE)
{
if (!timetonext && !finalecount)
animtimer += 7;
return false;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
return false;
if (keypressed)
@ -906,36 +914,52 @@ void F_TitleScreenDrawer(void)
if (modeattacking)
return; // We likely came here from retrying. Don't do a damn thing.
if (finalecount < 50)
V_DrawFill(0, 0, 320, 200, 31);
else
// Draw that sky!
F_SkyScroll(titlescrollspeed);
// Don't draw outside of the title screewn, or if the patch isn't there.
// Don't draw outside of the title screen, or if the patch isn't there.
if (!ttbanner || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
return;
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);
if (finalecount < 20)
{
if (finalecount >= 10)
F_SkyScroll(titlescrollspeed);
return;
}
if (finalecount < 50)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);
if (finalecount >= 20)
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
else if (finalecount >= 10)
V_DrawSciencePatch((84<<FRACBITS) - FixedDiv(180<<FRACBITS, 10<<FRACBITS)*(20-finalecount), (87<<FRACBITS), 0, ttkart, FRACUNIT/2);
}
else if (finalecount < 52)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawSmallScaledPatch(84, 36, 0, ttkflash);
}
else
{
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
INT32 transval = 0;
if (finalecount <= (50+(9<<1)))
transval = (finalecount - 50)>>1;
F_SkyScroll(titlescrollspeed);
// Checkers, only need to be drawn after the whiteout, but we can do it here because it won't be seen before anyway
V_DrawSciencePatch(0, 0 - FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
}
if (finalecount >= 50 && finalecount < 55)
{
V_DrawFill(0, 0, 320, 200, 120);
V_DrawSmallScaledPatch(84, 36, 0, ttkflash);
if (transval)
V_DrawFadeScreen(120, 10 - transval);
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
if (!transval)
return;
V_DrawSmallScaledPatch(84, 36, transval<<V_ALPHASHIFT, ttkflash);
}
}
@ -1059,7 +1083,7 @@ void F_WaitingPlayersDrawer(void)
INT32 flags = V_FLIP;
const char *waittext1 = "You will join";
const char *waittext2 = "the next race...";
V_DrawFill(0, 0, 320, 200, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
@ -1298,7 +1322,7 @@ void F_CutsceneDrawer(void)
// Fade to any palette color you want.
if (cutscenes[cutnum]->scene[scenenum].fadecolor)
{
V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,cutscenes[cutnum]->scene[scenenum].fadecolor);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, cutscenes[cutnum]->scene[scenenum].fadecolor);
F_WipeEndScreen();
F_RunWipe(cutscenes[cutnum]->scene[scenenum].fadeinid, true);
@ -1306,7 +1330,7 @@ void F_CutsceneDrawer(void)
F_WipeStartScreen();
}
}
V_DrawFill(0,0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
if (cutscenes[cutnum]->scene[scenenum].picname[picnum][0] != '\0')
{

View file

@ -82,6 +82,7 @@ enum
wipe_level_toblack,
wipe_intermission_toblack,
wipe_voting_toblack,
wipe_continuing_toblack,
wipe_titlescreen_toblack,
wipe_timeattack_toblack,
@ -98,6 +99,7 @@ enum
wipe_level_final,
wipe_intermission_final,
wipe_voting_final,
wipe_continuing_final,
wipe_titlescreen_final,
wipe_timeattack_final,
@ -111,9 +113,10 @@ enum
wipe_specinter_final,
wipe_multinter_final,
NUMWIPEDEFS
NUMWIPEDEFS,
WIPEFINALSHIFT = wipe_level_final - wipe_level_toblack
};
#define WIPEFINALSHIFT 13
extern UINT8 wipedefs[NUMWIPEDEFS];
#endif

View file

@ -46,8 +46,9 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
99, // wipe_credits_intermediate (0)
0, // wipe_level_toblack
UINT8_MAX, // wipe_intermission_toblack
UINT8_MAX, // wipe_continuing_toblack
UINT8_MAX, // wipe_intermission_toblack
0, // wipe_voting_toblack,
UINT8_MAX, // wipe_continuing_toblack
3, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack
99, // wipe_credits_toblack
@ -56,12 +57,13 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
UINT8_MAX, // wipe_intro_toblack (hardcoded)
UINT8_MAX, // wipe_cutscene_toblack (hardcoded)
0, // wipe_specinter_toblack
0, // wipe_multinter_toblack
0, // wipe_speclevel_towhite
UINT8_MAX, // wipe_specinter_toblack
UINT8_MAX, // wipe_multinter_toblack
99, // wipe_speclevel_towhite
0, // wipe_level_final
3, // wipe_level_final
0, // wipe_intermission_final
0, // wipe_voting_final
0, // wipe_continuing_final
3, // wipe_titlescreen_final
0, // wipe_timeattack_final

View file

@ -95,7 +95,7 @@ boolean imcontinuing = false;
boolean runemeraldmanager = false;
// menu demo things
UINT8 numDemos = 3;
UINT8 numDemos = 0; //3; -- i'm FED UP of losing my skincolour to a broken demo. change this back when we make new ones
UINT32 demoDelayTime = 15*TICRATE;
UINT32 demoIdleTime = 3*TICRATE;
@ -132,7 +132,7 @@ boolean useNightsSS = false;
UINT8 skincolor_redteam = SKINCOLOR_RED;
UINT8 skincolor_blueteam = SKINCOLOR_BLUE;
UINT8 skincolor_redring = SKINCOLOR_RED;
UINT8 skincolor_bluering = SKINCOLOR_STEELBLUE;
UINT8 skincolor_bluering = SKINCOLOR_STEEL;
tic_t countdowntimer = 0;
boolean countdowntimeup = false;
@ -207,12 +207,17 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2);
UINT16 extralifetics = 4*TICRATE;
// SRB2kart
INT32 bootime = 7*TICRATE;
INT32 boostealtime = TICRATE/2;
INT32 mushroomtime = TICRATE + (TICRATE/3);
tic_t introtime = 108+5; // plus 5 for white fade
tic_t starttime = 6*TICRATE + (3*TICRATE/4);
INT32 hyudorotime = 7*TICRATE;
INT32 stealtime = TICRATE/2;
INT32 sneakertime = TICRATE + (TICRATE/3);
INT32 itemtime = 8*TICRATE;
INT32 comebacktime = 10*TICRATE;
INT32 bumptime = 6;
INT32 wipeoutslowtime = 20;
INT32 wantedreduce = 5*TICRATE;
INT32 wantedfrequency = 10*TICRATE;
INT32 gameovertics = 15*TICRATE;
@ -248,21 +253,24 @@ boolean franticitems; // Frantic items currently enabled?
boolean comeback; // Battle Mode's karma comeback is on/off
// Voting system
INT16 votelevels[4]; // Levels that were rolled by the host
INT16 votelevels[5][2]; // Levels that were rolled by the host
SINT8 votes[MAXPLAYERS]; // Each player's vote
SINT8 pickedvote; // What vote the host rolls
// Server-sided variables
tic_t lightningcooldown; // Cooldown before any more lightning/blue shell is awarded
tic_t blueshellincoming; // Timer before blue shell hits, can switch targets at this point
UINT8 blueshellplayer; // Player num that used the last blue shell
// Server-sided, synched variables
SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points
tic_t wantedcalcdelay; // Time before it recalculates WANTED
tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any other item that works indirectly is awarded
tic_t spbincoming; // Timer before SPB hits, can switch targets at this point
UINT8 spbplayer; // Player num that used the last SPB
tic_t mapreset; // Map reset delay when enough players have joined an empty game
// Client-sided variables (NEVER use in anything that needs to be synced with other players)
// Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players)
boolean legitimateexit; // Did this client actually finish the match?
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
tic_t curlap; // Current lap time
tic_t bestlap; // Best lap time
static INT16 randmapbuffer[NUMMAPS]; // Buffer for maps RandMap is allowed to roll
static INT16 randmapbuffer[NUMMAPS+1]; // Buffer for maps RandMap is allowed to roll
tic_t hidetime;
@ -307,13 +315,6 @@ static struct {
// Your naming conventions are stupid and useless.
// There is no conflict here.
typedef struct demoghost {
UINT8 checksum[16];
UINT8 *buffer, *p, color;
UINT16 version;
mobj_t oldmo, *mo;
struct demoghost *next;
} demoghost;
demoghost *ghosts = NULL;
boolean precache = true; // if true, load all graphics at start
@ -397,6 +398,33 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
#endif
#endif
// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.
// chat timer thingy
static CV_PossibleValue_t chattime_cons_t[] = {{5, "MIN"}, {999, "MAX"}, {0, NULL}};
consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chatwidth
static CV_PossibleValue_t chatwidth_cons_t[] = {{64, "MIN"}, {150, "MAX"}, {0, NULL}};
consvar_t cv_chatwidth = {"chatwidth", "150", CV_SAVE, chatwidth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chatheight
static CV_PossibleValue_t chatheight_cons_t[] = {{6, "MIN"}, {22, "MAX"}, {0, NULL}};
consvar_t cv_chatheight = {"chatheight", "8", CV_SAVE, chatheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat notifications (do you want to hear beeps? I'd understand if you didn't.)
consvar_t cv_chatnotifications = {"chatnotifications", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat spam protection (why would you want to disable that???)
consvar_t cv_chatspamprotection = {"chatspamprotection", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// minichat text background
consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.)
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_crosshair = {"crosshair", "Cross", 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_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -1163,7 +1191,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
INT32 laim, th, tspeed, forward, side, axis; //i
const INT32 speed = 1;
// these ones used for multiple conditions
boolean turnleft, turnright, invertmouse, mouseaiming, lookaxis, analogjoystickmove, gamepadjoystickmove, kbl, rd;
boolean turnleft, turnright, invertmouse, mouseaiming, lookaxis, usejoystick, analogjoystickmove, gamepadjoystickmove, kbl, rd;
player_t *player;
camera_t *thiscam;
angle_t lang;
@ -1260,6 +1288,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
break;
}
usejoystick = (analogjoystickmove || gamepadjoystickmove);
turnright = InputDown(gc_turnright, ssplayer);
turnleft = InputDown(gc_turnleft, ssplayer);
@ -1320,8 +1349,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
cmd->driftturn = (INT16)(cmd->driftturn - (mousex*(mirrormode ? -1 : 1)*8));
}
// Bounce pad strafing
if (!demoplayback && ((player->pflags & PF_FORCESTRAFE) || (player->kartstuff[k_feather] & 2)))
// Speed bump strafing
if (!demoplayback && ((player->pflags & PF_FORCESTRAFE) || (player->kartstuff[k_pogospring])))
{
if (turnright)
side += sidemove[1];
@ -1334,42 +1363,23 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
}
}
//{ SRB2kart - Drift support
// limit turning to angleturn[1] to stop mouselook letting you look too fast
if (cmd->angleturn > angleturn[1])
cmd->angleturn = angleturn[1];
else if (cmd->angleturn < -angleturn[1])
cmd->angleturn = -angleturn[1];
if (cmd->driftturn > angleturn[1])
cmd->driftturn = angleturn[1];
else if (cmd->driftturn < -angleturn[1])
cmd->driftturn = -angleturn[1];
if (player->mo)
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
// SRB2kart - no additional angle if not moving
if ((player->mo && player->speed > 0) || (leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE) || (player->spectator || objectplacing))
lang += (cmd->angleturn<<16);
if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls
{
if (InputDown(gc_accelerate, ssplayer) || (cv_usejoystick.value && axis > 0))
if (InputDown(gc_accelerate, ssplayer) || (usejoystick && axis > 0))
cmd->buttons |= BT_ACCELERATE;
if (InputDown(gc_brake, ssplayer) || (cv_usejoystick.value && axis > 0))
if (InputDown(gc_brake, ssplayer) || (usejoystick && axis > 0))
cmd->buttons |= BT_BRAKE;
axis = JoyAxis(AXISAIM, ssplayer);
if (InputDown(gc_aimforward, ssplayer) || (gamepadjoystickmove && axis < 0) || (analogjoystickmove && axis < 0))
if (InputDown(gc_aimforward, ssplayer) || (usejoystick && axis < 0))
forward += forwardmove[1];
if (InputDown(gc_aimbackward, ssplayer) || (gamepadjoystickmove && axis > 0) || (analogjoystickmove && axis > 0))
if (InputDown(gc_aimbackward, ssplayer) || (usejoystick && axis > 0))
forward -= forwardmove[1];
}
else
{
// forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward.
axis = JoyAxis(AXISMOVE, ssplayer);
if (InputDown(gc_accelerate, ssplayer) || (gamepadjoystickmove && axis > 0) || player->kartstuff[k_mushroomtimer])
if (InputDown(gc_accelerate, ssplayer) || (gamepadjoystickmove && axis > 0) || player->kartstuff[k_sneakertimer])
{
cmd->buttons |= BT_ACCELERATE;
forward = forwardmove[1]; // 50
@ -1398,20 +1408,20 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// But forward/backward IS used for aiming.
axis = JoyAxis(AXISAIM, ssplayer);
if (InputDown(gc_aimforward, ssplayer) || (cv_usejoystick.value && axis < 0))
if (InputDown(gc_aimforward, ssplayer) || (usejoystick && axis < 0))
cmd->buttons |= BT_FORWARD;
if (InputDown(gc_aimbackward, ssplayer) || (cv_usejoystick.value && axis > 0))
if (InputDown(gc_aimbackward, ssplayer) || (usejoystick && axis > 0))
cmd->buttons |= BT_BACKWARD;
}
// fire with any button/key
axis = JoyAxis(AXISFIRE, ssplayer);
if (InputDown(gc_fire, ssplayer) || (cv_usejoystick.value && axis > 0))
if (InputDown(gc_fire, ssplayer) || (usejoystick && axis > 0))
cmd->buttons |= BT_ATTACK;
// drift with any button/key
axis = JoyAxis(AXISDRIFT, ssplayer);
if (InputDown(gc_drift, ssplayer) || (cv_usejoystick.value && axis > 0))
if (InputDown(gc_drift, ssplayer) || (usejoystick && axis > 0))
cmd->buttons |= BT_DRIFT;
// Lua scriptable buttons
@ -1508,6 +1518,29 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
cmd->sidemove = (SINT8)(cmd->sidemove + side);
}
//{ SRB2kart - Drift support
// Not grouped with the rest of turn stuff because it needs to know what buttons you're pressing for rubber-burn turn
// limit turning to angleturn[1] to stop mouselook letting you look too fast
if (cmd->angleturn > angleturn[1])
cmd->angleturn = angleturn[1];
else if (cmd->angleturn < -angleturn[1])
cmd->angleturn = -angleturn[1];
if (cmd->driftturn > angleturn[1])
cmd->driftturn = angleturn[1];
else if (cmd->driftturn < -angleturn[1])
cmd->driftturn = -angleturn[1];
if (player->mo)
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
// SRB2kart - no additional angle if not moving
if (((player->mo && player->speed > 0) // Moving
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|| (player->spectator || objectplacing)) // Not a physical player
&& !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout
lang += (cmd->angleturn<<16);
cmd->angleturn = (INT16)(lang >> 16);
if (!hu_stopped)
@ -1811,7 +1844,7 @@ boolean G_Responder(event_t *ev)
// SRB2Kart: Ehhh, who cares, Mario Kart's designed around screen-cheating anyway
/*if (gametype != GT_RACE)
{
if (players[consoleplayer].kartstuff[k_balloon] > 0)
if (players[consoleplayer].kartstuff[k_bumper] > 0)
continue;
}*/
@ -1902,7 +1935,7 @@ boolean G_Responder(event_t *ev)
else if (gamestate == GS_GAMEEND || gamestate == GS_EVALUATION || gamestate == GS_CREDITS)
return true;
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING)
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)
if (HU_Responder(ev))
return true; // chat ate the event
@ -2158,7 +2191,9 @@ void G_Ticker(boolean run)
F_TitleScreenTicker(run);
break;
case GS_WAITINGPLAYERS:
F_WaitingPlayersTicker();
if (netgame)
F_WaitingPlayersTicker();
HU_Ticker();
break;
case GS_DEDICATEDSERVER:
@ -2168,6 +2203,11 @@ void G_Ticker(boolean run)
if (run)
{
if (G_GametypeHasSpectators()
&& (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING // definitely good
|| gamestate == GS_WAITINGPLAYERS)) // definitely a problem if we don't do it at all in this gamestate, but might need more protection?
K_CheckSpectateStatus();
if (pausedelay)
pausedelay--;
@ -2220,19 +2260,33 @@ static inline void G_PlayerFinishLevel(INT32 player)
p->starpostnum = 0;
p->starpostcount = 0;
if (rendermode == render_soft)
V_SetPaletteLump(GetPalette()); // Reset the palette
// SRB2kart: Increment the "matches played" counter.
if (player == consoleplayer)
{
if (legitimateexit && !demoplayback) // (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)
{
matchesplayed++;
if (M_UpdateUnlockablesAndExtraEmblems(true))
UINT8 i = 0;
if (netgame)
{
S_StartSound(NULL, sfx_ncitem);
G_SaveGameData(true); // only save if unlocked something
// check to see if there's anyone else at all
for (; i < MAXPLAYERS; i++)
{
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
}
}
}
@ -2247,7 +2301,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
void G_PlayerReborn(INT32 player)
{
player_t *p;
INT32 score;
INT32 score, marescore;
INT32 lives;
INT32 continues;
UINT8 charability;
@ -2292,11 +2346,12 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
INT32 starpostwp;
INT32 offroad;
INT32 balloon;
INT32 bumper;
INT32 comebackpoints;
INT32 wanted;
score = players[player].score;
marescore = players[player].marescore;
lives = players[player].lives;
continues = players[player].continues;
ctfteam = players[player].ctfteam;
@ -2349,14 +2404,15 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
starpostwp = players[player].kartstuff[k_starpostwp];
offroad = players[player].kartstuff[k_offroad];
balloon = players[player].kartstuff[k_balloon];
bumper = players[player].kartstuff[k_bumper];
comebackpoints = players[player].kartstuff[k_comebackpoints];
wanted = players[player].kartstuff[k_wanted];
p = &players[player];
memset(p, 0, sizeof (*p));
p->score = score;
p->marescore = marescore;
p->lives = lives;
p->continues = continues;
p->pflags = pflags;
@ -2407,11 +2463,10 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync
p->kartstuff[k_offroad] = offroad;
p->kartstuff[k_balloon] = balloon;
p->kartstuff[k_bumper] = bumper;
p->kartstuff[k_comebackpoints] = comebackpoints;
p->kartstuff[k_comebacktimer] = comebacktime;
p->kartstuff[k_wanted] = wanted;
// Don't do anything immediately
p->pflags |= PF_USEDOWN;
@ -2423,7 +2478,7 @@ void G_PlayerReborn(INT32 player)
p->panim = PA_IDLE; // standing animation
if ((netgame || multiplayer) && !p->spectator)
p->powers[pw_flashing] = K_GetKartFlashing()-1; // Babysitting deterrent
p->powers[pw_flashing] = K_GetKartFlashing(p)-1; // Babysitting deterrent
if (p-players == consoleplayer)
{
@ -2437,14 +2492,14 @@ void G_PlayerReborn(INT32 player)
P_RestoreMusic(p);
if (leveltime > 157 && !p->spectator)
p->kartstuff[k_lakitu] = 48; // Lakitu Spawner
if (leveltime > (starttime + (TICRATE/2)) && !p->spectator)
p->kartstuff[k_respawn] = 48; // Respawn effect
if (gametype == GT_COOP)
P_FindEmerald(); // scan for emeralds to hunt for
// Reset Nights score and max link to 0 on death
p->marescore = p->maxlink = 0;
p->maxlink = 0;
// If NiGHTS, find lowest mare to start with.
p->mare = P_FindLowestMare();
@ -2956,7 +3011,7 @@ void G_ExitLevel(void)
CV_SetValue(&cv_teamscramble, cv_scrambleonchange.value);
}
if (gametype != GT_COOP)
if (netgame || multiplayer)
CONS_Printf(M_GetText("The round has ended.\n"));
// Remove CEcho text on round end.
@ -3025,7 +3080,7 @@ boolean G_GametypeHasSpectators(void)
#if 0
return (gametype != GT_COOP && gametype != GT_COMPETITION && gametype != GT_RACE);
#else
return true;
return (!splitscreen);//true;
#endif
}
@ -3039,6 +3094,42 @@ boolean G_BattleGametype(void)
return (gametype == GT_MATCH);
}
//
// G_SometimesGetDifferentGametype
//
// I pity the fool who adds more gametypes later, because it'll require some element of randomisation which needs to be synched...
// Although given this only gets called for the host, you could probably get away with M_Random.
//
INT16 G_SometimesGetDifferentGametype(void)
{
if (randmapbuffer[NUMMAPS] != -1)
return gametype;
randmapbuffer[NUMMAPS] = gametype;
if (gametype == GT_MATCH)
return GT_RACE;
return GT_MATCH;
}
//
// G_GetGametypeColor
//
// Pretty and consistent ^u^
// See also M_GetGametypeColor.
//
UINT8 G_GetGametypeColor(INT16 gt)
{
if (modeattacking // == ATTACKING_RECORD
|| gamestate == GS_TIMEATTACK)
return orangemap[120];
if (gt == GT_MATCH)
return redmap[120];
if (gt == GT_RACE)
return skymap[120];
return 247; // FALLBACK
}
//
// G_RaceGametype
//
@ -3108,12 +3199,15 @@ static INT32 TOLMaps(INT16 tolflags)
* has those flags.
* \author Graue <graue@oceanbase.org>
*/
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer)
static INT16 *okmaps = NULL;
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon)
{
INT16 *okmaps = Z_Malloc(NUMMAPS * sizeof(INT16), PU_STATIC, NULL);
INT32 numokmaps = 0;
INT16 ix, bufx;
if (!okmaps)
okmaps = Z_Malloc(NUMMAPS * sizeof(INT16), PU_STATIC, NULL);
// Find all the maps that are ok and and put them in an array.
for (ix = 0; ix < NUMMAPS; ix++)
{
@ -3124,12 +3218,14 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags
|| ix == pprevmap
|| (M_MapLocked(ix+1) && !dedicated))
|| (!dedicated && M_MapLocked(ix+1))
|| (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU)) // this is bad
|| ((maphell == 2) && !(mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // gasp
isokmap = false;
if (!ignorebuffer)
{
for (bufx = 0; bufx < NUMMAPS; bufx++)
for (bufx = 0; bufx < (maphell ? 3 : NUMMAPS); bufx++)
{
if (randmapbuffer[bufx] == -1) // Rest of buffer SHOULD be empty
break;
@ -3148,10 +3244,12 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
if (numokmaps == 0)
{
if (!ignorebuffer)
return G_RandMap(tolflags, pprevmap, dontadd, true); // If there's no matches, (An incredibly silly function chain, buuut... :V)
return G_RandMap(tolflags, pprevmap, dontadd, true, maphell, callagainsoon); // If there's no matches, (An incredibly silly function chain, buuut... :V)
if (maphell)
return G_RandMap(tolflags, pprevmap, dontadd, true, maphell-1, callagainsoon);
ix = 0; // Sorry, none match. You get MAP01.
for (bufx = 0; bufx < NUMMAPS; bufx++)
for (bufx = 0; bufx < NUMMAPS+1; bufx++)
randmapbuffer[bufx] = -1; // if we're having trouble finding a map we should probably clear it
}
else
@ -3159,13 +3257,17 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
ix = okmaps[M_RandomKey(numokmaps)];
if (!dontadd)
{
for (bufx = NUMMAPS; bufx > 0; bufx--)
for (bufx = NUMMAPS-1; bufx > 0; bufx--)
randmapbuffer[bufx] = randmapbuffer[bufx-1];
randmapbuffer[0] = ix;
}
}
Z_Free(okmaps);
if (!callagainsoon)
{
Z_Free(okmaps);
okmaps = NULL;
}
return ix;
}
@ -3175,7 +3277,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
//
static void G_DoCompleted(void)
{
INT32 i;
INT32 i, j = 0;
boolean gottoken = false;
tokenlist = 0; // Reset the list
@ -3189,7 +3291,20 @@ static void G_DoCompleted(void)
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i])
{
// SRB2Kart: exitlevel shouldn't get you the points
if (!players[i].exiting && !(players[i].pflags & PF_TIMEOVER))
{
players[i].pflags |= PF_TIMEOVER;
if (P_IsLocalPlayer(&players[i]))
j++;
}
G_PlayerFinishLevel(i); // take away cards and stuff
}
// play some generic music if there's no win/cool/lose music going on (for exitlevel commands)
if (G_RaceGametype() && j == splitscreen+1 && (cv_inttime.value > 0))
S_ChangeMusicInternal("racent", true);
if (automapactive)
AM_Stop();
@ -3230,6 +3345,9 @@ static void G_DoCompleted(void)
else
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)
{
cm = nextmap; //Start the loop again so that the error checking below is executed.
@ -3292,7 +3410,7 @@ static void G_DoCompleted(void)
if (randmapbuffer[TOLMaps(G_TOLFlag(gametype))-4] != -1) // we're getting pretty full, so lets clear it
{
for (i = 0; i < NUMMAPS; i++)
for (i = 0; i < NUMMAPS+1; i++)
randmapbuffer[i] = -1;
}
@ -3301,7 +3419,7 @@ static void G_DoCompleted(void)
if (cv_advancemap.value == 0) // Stay on same map.
nextmap = prevmap;
else if (cv_advancemap.value == 2) // Go to random map.
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, false);
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, false);
}
// We are committed to this map now.
@ -3343,19 +3461,39 @@ void G_AfterIntermission(void)
//
void G_NextLevel(void)
{
if ((cv_advancemap.value == 3 && gamestate != GS_VOTING)
&& !modeattacking && !skipstats && (multiplayer || netgame))
gameaction = ga_startvote;
else
gameaction = ga_worlddone;
if (gamestate != GS_VOTING)
{
if ((cv_advancemap.value == 3) && !modeattacking && !skipstats && (multiplayer || netgame))
{
UINT8 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
gameaction = ga_startvote;
return;
}
}
}
forceresetplayers = false;
}
gameaction = ga_worlddone;
}
static void G_DoWorldDone(void)
{
if (server)
{
// SRB2kart: don't reset player between maps
D_MapChange(nextmap+1, gametype, ultimatemode, false, 0, false, false);
// SRB2Kart
D_MapChange(nextmap+1,
gametype,
ultimatemode,
forceresetplayers,
0,
false,
false);
}
gameaction = ga_nothing;
@ -3387,6 +3525,7 @@ static void G_DoStartContinue(void)
{
I_Assert(!netgame && !multiplayer);
legitimateexit = false;
G_PlayerFinishLevel(consoleplayer); // take away cards and stuff
F_StartContinue();
@ -3944,9 +4083,16 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, U
if (demoplayback)
COM_BufAddText("stopdemo\n");
while (ghosts)
{
demoghost *next = ghosts->next;
Z_Free(ghosts);
ghosts = next;
}
ghosts = NULL;
for (i = 0; i < NUMMAPS; i++)
for (i = 0; i < NUMMAPS+1; i++)
randmapbuffer[i] = -1;
// this leave the actual game if needed
@ -4000,11 +4146,12 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
if (!demoplayback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us!
P_SetRandSeed(M_RandomizedSeed()); // Use a more "Random" random seed
if (resetplayer)
//SRB2Kart - Score is literally the only thing you SHOULDN'T reset at all times
//if (resetplayer)
{
// Clear a bunch of variables
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
countdown = countdown2 = 0;
countdown = countdown2 = mapreset = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -4013,6 +4160,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
players[i].starpostx = players[i].starposty = players[i].starpostz = 0;
players[i].starpostcount = 0; // srb2kart
#if 0
if (netgame || multiplayer)
{
players[i].lives = cv_startinglives.value;
@ -4029,13 +4177,23 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
players[i].continues = 1;
}
players[i].xtralife = 0;
#else
players[i].lives = 1; // SRB2Kart
#endif
// The latter two should clear by themselves, but just in case
players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS);
// Clear cheatcodes too, just in case.
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS);
players[i].score = players[i].xtralife = 0;
players[i].marescore = 0;
if (resetplayer) // SRB2Kart
{
players[i].score = 0;
}
}
// Reset unlockable triggers
@ -4837,6 +4995,7 @@ void G_GhostTicker(void)
p->next = g->next;
else
ghosts = g->next;
Z_Free(g);
continue;
}
p = g;
@ -5569,8 +5728,7 @@ void G_DoPlayDemo(char *defdemoname)
memset(playeringame,0,sizeof(playeringame));
playeringame[0] = true;
P_SetRandSeed(randseed);
//G_InitNew(false, G_BuildMapName(gamemap), false, true); // resetplayer needs to be false to retain score
G_InitNew(false, G_BuildMapName(gamemap), true, true); // ...but uh, for demos? doing that makes them start in different positions depending on the last demo you watched
G_InitNew(false, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer.
// Set skin
SetPlayerSkin(0, skin);
@ -5780,29 +5938,28 @@ void G_AddGhost(char *defdemoname)
mthing = playerstarts[0];
I_Assert(mthing);
{ // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling.
fixed_t x,y,z;
sector_t *sector;
x = mthing->x << FRACBITS;
y = mthing->y << FRACBITS;
sector = R_PointInSubsector(x, y)->sector;
fixed_t z,f,c;
gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST);
gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
f = gh->mo->floorz;
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
{
z = sector->ceilingheight - mobjinfo[MT_PLAYER].height;
z = c;
if (mthing->options >> ZSHIFT)
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
if (z < sector->floorheight)
z = sector->floorheight;
if (z < f)
z = f;
}
else
{
z = sector->floorheight;
z = f;
if (mthing->options >> ZSHIFT)
z += ((mthing->options >> ZSHIFT) << FRACBITS);
if (z > sector->ceilingheight - mobjinfo[MT_PLAYER].height)
z = sector->ceilingheight - mobjinfo[MT_PLAYER].height;
if (z > c)
z = c;
}
gh->mo = P_SpawnMobj(x, y, z, MT_GHOST);
gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
gh->mo->z = z;
}
gh->mo->state = states+S_KART_STND1; // SRB2kart - was S_PLAY_STND
gh->mo->sprite = gh->mo->state->sprite;
@ -6000,8 +6157,13 @@ boolean G_CheckDemoStatus(void)
{
boolean saved;
if(ghosts) // ... ... ...
ghosts = NULL; // :)
while (ghosts)
{
demoghost *next = ghosts->next;
Z_Free(ghosts);
ghosts = next;
}
ghosts = NULL;
// DO NOT end metal sonic demos here

View file

@ -54,6 +54,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
extern INT16 rw_maximums[NUM_WEAPONS];
// used in game menu
extern consvar_t cv_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_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis;
@ -167,6 +168,17 @@ void G_WriteMetalTic(mobj_t *metal);
void G_SaveMetal(UINT8 **buffer);
void G_LoadMetal(UINT8 **buffer);
// Your naming conventions are stupid and useless.
// There is no conflict here.
typedef struct demoghost {
UINT8 checksum[16];
UINT8 *buffer, *p, color;
UINT16 version;
mobj_t oldmo, *mo;
struct demoghost *next;
} demoghost;
extern demoghost *ghosts;
void G_DoPlayDemo(char *defdemoname);
void G_TimeDemo(const char *name);
void G_AddGhost(char *defdemoname);
@ -183,6 +195,8 @@ boolean G_GametypeUsesLives(void);
boolean G_GametypeHasTeams(void);
boolean G_GametypeHasSpectators(void);
boolean G_BattleGametype(void);
INT16 G_SometimesGetDifferentGametype(void);
UINT8 G_GetGametypeColor(INT16 gt);
boolean G_RaceGametype(void);
boolean G_TagGametype(void);
void G_ExitLevel(void);
@ -236,6 +250,6 @@ FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics);
// Don't split up TOL handling
INT16 G_TOLFlag(INT32 pgametype);
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer);
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon);
#endif

View file

@ -1208,6 +1208,7 @@ static const char *gamecontrolname[num_gamecontrols] =
"scores",
"console",
"pause",
"systemmenu",
"custom1",
"custom2",
"custom3",

View file

@ -114,6 +114,7 @@ typedef enum
gc_scores,
gc_console,
gc_pause,
gc_systemmenu,
gc_custom1, // Lua scriptable
gc_custom2, // Lua scriptable
gc_custom3, // Lua scriptable

View file

@ -209,7 +209,7 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
// if it's meant to cover the whole screen, black out the rest
// cx and cy are possibly *slightly* off from float maths
// This is done before here compared to software because we directly alter cx and cy to centre
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
/*if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
{
// Need to temporarily cache the real patch to get the colour of the top left pixel
patch_t *realpatch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
@ -217,7 +217,7 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
const UINT8 *source = (const UINT8 *)(column) + 3;
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
Z_Free(realpatch);
}
}*/
// centre screen
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
@ -292,9 +292,9 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
{
FSurfaceInfo Surf;
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans];
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
@ -357,7 +357,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
// if it's meant to cover the whole screen, black out the rest
// cx and cy are possibly *slightly* off from float maths
// This is done before here compared to software because we directly alter cx and cy to centre
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
/*if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
{
// Need to temporarily cache the real patch to get the colour of the top left pixel
patch_t *realpatch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
@ -365,7 +365,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
const UINT8 *source = (const UINT8 *)(column) + 3;
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
Z_Free(realpatch);
}
}*/
// centre screen
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
@ -446,9 +446,9 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
{
FSurfaceInfo Surf;
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans];
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
@ -576,29 +576,33 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
// | /|
// |/ |
// 0--1
void HWR_FadeScreenMenuBack(UINT32 color, INT32 height)
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
{
FOutVector v[4];
FSurfaceInfo Surf;
FOutVector v[4];
FSurfaceInfo Surf;
// setup some neat-o translucency effect
if (!height) //cool hack 0 height is full height
height = vid.height;
v[0].x = v[3].x = -1.0f;
v[2].x = v[1].x = 1.0f;
v[0].y = v[1].y = -1.0f;
v[2].y = v[3].y = 1.0f;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].x = v[3].x = -1.0f;
v[2].x = v[1].x = 1.0f;
v[0].y = v[1].y = 1.0f-((height<<1)/(float)vid.height);
v[2].y = v[3].y = 1.0f;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = 1.0f;
v[0].tow = v[1].tow = 1.0f;
v[2].tow = v[3].tow = 0.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = 1.0f;
v[0].tow = v[1].tow = 1.0f;
v[2].tow = v[3].tow = 0.0f;
Surf.FlatColor.rgba = UINT2RGBA(color);
Surf.FlatColor.s.alpha = (UINT8)((0xff/2) * ((float)height / vid.height)); //calum: varies console alpha
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
if (color & 0xFF00) // Do COLORMAP fade.
{
Surf.FlatColor.rgba = UINT2RGBA(0x01010160);
Surf.FlatColor.s.alpha = (strength*8);
}
else // Do TRANSMAP** fade.
{
Surf.FlatColor.rgba = pLocalPalette[color].rgba;
Surf.FlatColor.s.alpha = (UINT8)(strength*25.5f);
}
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
}
// Draw the console background with translucency support
@ -900,6 +904,210 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
}
// -------------------+
// HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that.
// -------------------+
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options)
{
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh;
if (w < 0 || h < 0)
return; // consistency w/ software
// 3--2
// | /|
// |/ |
// 0--1
fx = (float)x;
fy = (float)y;
fw = (float)w;
fh = (float)h;
if (!(options & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{
RGBA_t rgbaColour = V_GetColor(color);
FRGBAFloat clearColour;
clearColour.red = (float)rgbaColour.s.red / 255;
clearColour.green = (float)rgbaColour.s.green / 255;
clearColour.blue = (float)rgbaColour.s.blue / 255;
clearColour.alpha = 1;
HWD.pfnClearBuffer(true, false, &clearColour);
return;
}
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
if (options & V_SNAPTORIGHT)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
else if (!(options & V_SNAPTOLEFT))
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (options & V_SNAPTOBOTTOM)
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
else if (!(options & V_SNAPTOTOP))
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
}
}
if (fx >= vid.width || fy >= vid.height)
return;
if (fx < 0)
{
fw += fx;
fx = 0;
}
if (fy < 0)
{
fh += fy;
fy = 0;
}
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
fw = (float)vid.width - fx;
if (fy + fh > vid.height)
fh = (float)vid.height - fy;
fx = -1 + fx / (vid.width / 2);
fy = 1 - fy / (vid.height / 2);
fw = fw / (vid.width / 2);
fh = fh / (vid.height / 2);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
v[0].y = v[1].y = fy;
v[2].y = v[3].y = fy - fh;
//Hurdler: do we still use this argb color? if not, we should remove it
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = 1.0f;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = 1.0f;
Surf.FlatColor.rgba = UINT2RGBA(color);
Surf.FlatColor.s.alpha = 0x80;
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
}
// -----------------+
// HWR_DrawDiag : draw flat coloured rectangle, with no texture
// -----------------+
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
{
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh, fwait = 0;
if (wh < 0)
return; // consistency w/ software
// 3--2
// | /|
// |/ |
// 0--1
fx = (float)x;
fy = (float)y;
fw = fh = (float)wh;
if (!(color & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
if (color & V_SNAPTORIGHT)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
else if (!(color & V_SNAPTOLEFT))
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (color & V_SNAPTOBOTTOM)
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
else if (!(color & V_SNAPTOTOP))
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
}
}
if (fx >= vid.width || fy >= vid.height)
return;
if (fx < 0)
{
fw += fx;
fx = 0;
}
if (fy < 0)
{
fh += fy;
fy = 0;
}
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
{
fwait = fw - ((float)vid.width - fx);
fw = (float)vid.width - fx;
}
if (fy + fh > vid.height)
fh = (float)vid.height - fy;
fx = -1 + fx / (vid.width / 2);
fy = 1 - fy / (vid.height / 2);
fw = fw / (vid.width / 2);
fh = fh / (vid.height / 2);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
v[0].y = v[1].y = fy;
v[3].y = fy - fh;
v[2].y = fy - fwait;
//Hurdler: do we still use this argb color? if not, we should remove it
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = 1.0f;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = 1.0f;
Surf.FlatColor = V_GetColor(color);
HWD.pfnDrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
}
#ifdef HAVE_PNG
#ifndef _MSC_VER

View file

@ -499,23 +499,46 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], //"SPRG",
&lspr[NOLIGHT], //"BSPR",
&lspr[NOLIGHT], //"RNDM",
&lspr[NOLIGHT], //"SPRK",
&lspr[NOLIGHT], //"KFRE",
&lspr[NOLIGHT], //"DRIF",
&lspr[NOLIGHT], //"FAKE",
&lspr[NOLIGHT], //"DFAK",
&lspr[NOLIGHT], //"DSMO",
&lspr[NOLIGHT], //"FITM",
&lspr[NOLIGHT], //"BANA",
&lspr[NOLIGHT], //"DBAN",
&lspr[NOLIGHT], //"GSHE",
&lspr[NOLIGHT], //"GSTR",
&lspr[NOLIGHT], //"DGSH",
&lspr[NOLIGHT], //"RSHE",
&lspr[NOLIGHT], //"RSTR",
&lspr[NOLIGHT], //"DRSH",
&lspr[NOLIGHT], //"BOMB",
&lspr[NOLIGHT], //"SSMN",
&lspr[NOLIGHT], //"BLIG",
&lspr[NOLIGHT], //"LIGH"
&lspr[NOLIGHT], //"LIGH",
&lspr[NOLIGHT], //"SINK",
&lspr[NOLIGHT], //"SITR",
&lspr[NOLIGHT], //"KBLN",
&lspr[NOLIGHT], //"LAKI",
&lspr[NOLIGHT], //"POKE",
&lspr[NOLIGHT], //"AUDI",
&lspr[NOLIGHT], //"DECO",
&lspr[NOLIGHT], //"DOOD",
&lspr[NOLIGHT], //"SNES",
&lspr[NOLIGHT], //"GBAS",
&lspr[NOLIGHT], //"SPRS",
&lspr[NOLIGHT], //"BUZB",
&lspr[NOLIGHT], //"CHOM",
&lspr[NOLIGHT], //"SACO",
&lspr[NOLIGHT], //"CRAB",
&lspr[NOLIGHT], //"SHAD",
&lspr[NOLIGHT], //"BUMP",
&lspr[NOLIGHT], //"FLEN",
&lspr[NOLIGHT], //"CLAS",
&lspr[NOLIGHT], //"PSHW",
&lspr[NOLIGHT], //"ARRO",
&lspr[NOLIGHT], //"PBOM"
// Free slots
&lspr[NOLIGHT],

View file

@ -59,7 +59,7 @@ struct hwdriver_s hwdriver;
// ==========================================================================
static void HWR_AddSprites(sector_t *sec);
static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer);
static void HWR_ProjectSprite(mobj_t *thing);
#ifdef HWPRECIP
static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing);
@ -2186,27 +2186,34 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
}
else if (drawtextured)
{
#ifdef ESLOPE // P.S. this is better-organized than the old version
fixed_t offs = sides[(newline ? newline : rover->master)->sidenum[0]].rowoffset;
grTex = HWR_GetTexture(texnum);
wallVerts[3].t = (*rover->topheight - h + offs) * grTex->scaleY;
wallVerts[2].t = (*rover->topheight - hS + offs) * grTex->scaleY;
wallVerts[0].t = (*rover->topheight - l + offs) * grTex->scaleY;
wallVerts[1].t = (*rover->topheight - lS + offs) * grTex->scaleY;
#else
grTex = HWR_GetTexture(texnum);
fixed_t texturevpeg;
// Wow, how was this missing from OpenGL for so long?
// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
// -- Monster Iestyn 26/06/18
if (newline)
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY;
texturevpeg = sides[newline->sidenum[0]].rowoffset;
if (newline->flags & ML_DONTPEGBOTTOM)
texturevpeg -= *rover->topheight - *rover->bottomheight;
}
else
{
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
if (gr_linedef->flags & ML_DONTPEGBOTTOM)
texturevpeg -= *rover->topheight - *rover->bottomheight;
}
grTex = HWR_GetTexture(texnum);
#ifdef ESLOPE
wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY;
wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY;
#else
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
#endif
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
@ -3234,7 +3241,7 @@ static void HWR_AddPolyObjectPlanes(void)
// : Draw one or more line segments.
// Notes : Sets gr_cursectorlight to the light of the parent sector, to modulate wall textures
// -----------------+
static void HWR_Subsector(size_t num)
static void HWR_Subsector(size_t num, UINT8 ssplayer)
{
INT16 count;
seg_t *line;
@ -3602,7 +3609,7 @@ static void HWR_Subsector(size_t num)
{
// draw sprites first, coz they are clipped to the solidsegs of
// subsectors more 'in front'
HWR_AddSprites(gr_frontsector);
HWR_AddSprites(gr_frontsector, ssplayer);
//Hurdler: at this point validcount must be the same, but is not because
// gr_frontsector doesn't point anymore to sub->sector due to
@ -3654,7 +3661,7 @@ static boolean HWR_CheckHackBBox(fixed_t *bb)
// BP: big hack for a test in lighning ref : 1249753487AB
fixed_t *hwbbox;
static void HWR_RenderBSPNode(INT32 bspnum)
static void HWR_RenderBSPNode(INT32 bspnum, UINT8 ssplayer)
{
/*//GZDoom code
if(bspnum == -1)
@ -3694,12 +3701,12 @@ static void HWR_RenderBSPNode(INT32 bspnum)
if (bspnum == -1)
{
//*(gr_drawsubsector_p++) = 0;
HWR_Subsector(0);
HWR_Subsector(0, ssplayer);
}
else
{
//*(gr_drawsubsector_p++) = bspnum&(~NF_SUBSECTOR);
HWR_Subsector(bspnum&(~NF_SUBSECTOR));
HWR_Subsector(bspnum&(~NF_SUBSECTOR), ssplayer);
}
return;
}
@ -3711,14 +3718,14 @@ static void HWR_RenderBSPNode(INT32 bspnum)
hwbbox = bsp->bbox[side];
// Recursively divide front space.
HWR_RenderBSPNode(bsp->children[side]);
HWR_RenderBSPNode(bsp->children[side], ssplayer);
// Possibly divide back space.
if (HWR_CheckBBox(bsp->bbox[side^1]))
{
// BP: big hack for a test in lighning ref : 1249753487AB
hwbbox = bsp->bbox[side^1];
HWR_RenderBSPNode(bsp->children[side^1]);
HWR_RenderBSPNode(bsp->children[side^1], ssplayer);
}
}
@ -5110,7 +5117,7 @@ static void HWR_DrawSprites(void)
// During BSP traversal, this adds sprites by sector.
// --------------------------------------------------------------------------
static UINT8 sectorlight;
static void HWR_AddSprites(sector_t *sec)
static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer)
{
mobj_t *thing;
#ifdef HWPRECIP
@ -5140,6 +5147,25 @@ static void HWR_AddSprites(sector_t *sec)
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
continue;
if (splitscreen)
{
if (thing->eflags & MFE_DRAWONLYFORP1)
if (ssplayer != 1)
continue;
if (thing->eflags & MFE_DRAWONLYFORP2)
if (ssplayer != 2)
continue;
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
if (ssplayer != 3)
continue;
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
if (ssplayer != 4)
continue;
}
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
if (approx_dist <= limit_dist)
@ -5150,8 +5176,31 @@ static void HWR_AddSprites(sector_t *sec)
{
// Draw everything in sector, no checks
for (thing = sec->thinglist; thing; thing = thing->snext)
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW))
HWR_ProjectSprite(thing);
{
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
continue;
if (splitscreen)
{
if (thing->eflags & MFE_DRAWONLYFORP1)
if (ssplayer != 1)
continue;
if (thing->eflags & MFE_DRAWONLYFORP2)
if (ssplayer != 2)
continue;
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
if (ssplayer != 3)
continue;
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
if (ssplayer != 4)
continue;
}
HWR_ProjectSprite(thing);
}
}
#ifdef HWPRECIP
@ -5347,7 +5396,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
}
heightsec = thing->subsector->sector->heightsec;
phs = players[displayplayer].mo->subsector->sector->heightsec;
if (viewplayer->mo && viewplayer->mo->subsector)
phs = viewplayer->mo->subsector->sector->heightsec;
else
phs = -1;
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
{
@ -5388,23 +5440,15 @@ static void HWR_ProjectSprite(mobj_t *thing)
else if (thing->color)
{
// New colormap stuff for skins Tails 06-07-2002
if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
if (thing->colorized)
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
{
if (thing->colorized)
vis->colormap = R_GetTranslationColormap(TC_STARMAN, thing->color, GTC_CACHE);
else
{
size_t skinnum = (skin_t*)thing->skin-skins;
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
}
size_t skinnum = (skin_t*)thing->skin-skins;
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
}
else
{
if (vis->mobj && vis->mobj->colorized)
vis->colormap = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
else
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
}
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, thing->color, GTC_CACHE);
}
else
vis->colormap = colormaps;
@ -5666,13 +5710,31 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
{
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
postimg_t *type;
UINT8 ssplayer = 0;
if (splitscreen && player == &players[secondarydisplayplayer])
type = &postimgtype2;
else if (splitscreen > 1 && player == &players[thirddisplayplayer])
type = &postimgtype3;
else if (splitscreen > 2 && player == &players[fourthdisplayplayer])
type = &postimgtype4;
if (splitscreen)
{
if (player == &players[secondarydisplayplayer])
{
type = &postimgtype2;
ssplayer = 2;
}
else if (splitscreen > 1 && player == &players[thirddisplayplayer])
{
type = &postimgtype3;
ssplayer = 3;
}
else if (splitscreen > 2 && player == &players[fourthdisplayplayer])
{
type = &postimgtype4;
ssplayer = 4;
}
else
{
type = &postimgtype;
ssplayer = 1;
}
}
else
type = &postimgtype;
@ -5789,7 +5851,7 @@ if (0)
validcount++;
HWR_RenderBSPNode((INT32)numnodes-1);
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer);
// Make a viewangle int so we can render things based on mouselook
if (player == &players[consoleplayer])
@ -5806,18 +5868,18 @@ if (0)
{
dup_viewangle += ANGLE_90;
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //left
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //left
dup_viewangle += ANGLE_90;
if (((INT32)aimingangle > ANGLE_45 || (INT32)aimingangle<-ANGLE_45))
{
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //back
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //back
}
dup_viewangle += ANGLE_90;
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //right
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //right
dup_viewangle += ANGLE_90;
}
@ -5881,17 +5943,35 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
{
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
postimg_t *type;
UINT8 ssplayer = 0;
const boolean skybox = (skyboxmo[0] && cv_skybox.value); // True if there's a skybox object and skyboxes are on
FRGBAFloat ClearColor;
if (splitscreen && player == &players[secondarydisplayplayer])
type = &postimgtype2;
else if (splitscreen > 1 && player == &players[thirddisplayplayer])
type = &postimgtype3;
else if (splitscreen > 2 && player == &players[fourthdisplayplayer])
type = &postimgtype4;
if (splitscreen)
{
if (player == &players[secondarydisplayplayer])
{
type = &postimgtype2;
ssplayer = 2;
}
else if (splitscreen > 1 && player == &players[thirddisplayplayer])
{
type = &postimgtype3;
ssplayer = 3;
}
else if (splitscreen > 2 && player == &players[fourthdisplayplayer])
{
type = &postimgtype4;
ssplayer = 4;
}
else
{
type = &postimgtype;
ssplayer = 1;
}
}
else
type = &postimgtype;
@ -6019,7 +6099,7 @@ if (0)
validcount++;
HWR_RenderBSPNode((INT32)numnodes-1);
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer);
// Make a viewangle int so we can render things based on mouselook
if (player == &players[consoleplayer])
@ -6036,18 +6116,18 @@ if (0)
{
dup_viewangle += ANGLE_90;
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //left
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //left
dup_viewangle += ANGLE_90;
if (((INT32)aimingangle > ANGLE_45 || (INT32)aimingangle<-ANGLE_45))
{
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //back
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //back
}
dup_viewangle += ANGLE_90;
HWR_ClearClipSegs();
HWR_RenderBSPNode((INT32)numnodes-1); //right
HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //right
dup_viewangle += ANGLE_90;
}

View file

@ -33,7 +33,7 @@ void HWR_Shutdown(void);
void HWR_clearAutomap(void);
void HWR_drawAMline(const fline_t *fl, INT32 color);
void HWR_FadeScreenMenuBack(UINT32 color, INT32 height);
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength);
void HWR_DrawConsoleBack(UINT32 color, INT32 height);
void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player);
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player);
@ -46,12 +46,13 @@ void HWR_SetViewSize(void);
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option);
void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, const UINT8 *colormap);
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, INT32 option, fixed_t scale, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap);
void HWR_CreatePlanePolygons(INT32 bspnum);
void HWR_CreateStaticLightmaps(INT32 bspnum);
void HWR_PrepLevelCache(size_t pnumtextures);
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right.
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color);
void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum);
void HWR_AddCommands(void);

View file

@ -33,6 +33,7 @@
#include "hw_drv.h"
#include "hw_light.h"
#include "hw_md2.h"
#include "../d_main.h"
#include "../r_bsp.h"
#include "../r_main.h"
#include "../m_misc.h"
@ -41,6 +42,7 @@
#include "../r_things.h"
#include "../r_draw.h"
#include "../p_tick.h"
#include "../k_kart.h" // colortranslations
#include "hw_main.h"
#include "../v_video.h"
@ -69,6 +71,10 @@
#endif
#endif
#ifndef errno
#include "errno.h"
#endif
#define NUMVERTEXNORMALS 162
float avertexnormals[NUMVERTEXNORMALS][3] = {
{-0.525731f, 0.000000f, 0.850651f},
@ -290,7 +296,8 @@ static md2_model_t *md2_readModel(const char *filename)
if (model == NULL)
return 0;
file = fopen(filename, "rb");
//Filename checking fixed ~Monster Iestyn and Golden
file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb");
if (!file)
{
free(model);
@ -479,7 +486,8 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
#endif
#endif
png_FILE_p png_FILE;
char *pngfilename = va("md2/%s", filename);
//Filename checking fixed ~Monster Iestyn and Golden
char *pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
FIL_ForceExtension(pngfilename, ".png");
png_FILE = fopen(pngfilename, "rb");
@ -607,7 +615,8 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
size_t pw, ph, size, ptr = 0;
INT32 ch, rep;
FILE *file;
char *pcxfilename = va("md2/%s", filename);
//Filename checking fixed ~Monster Iestyn and Golden
char *pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
FIL_ForceExtension(pcxfilename, ".pcx");
file = fopen(pcxfilename, "rb");
@ -796,12 +805,13 @@ void HWR_InitMD2(void)
md2_models[i].error = false;
}
// read the kmd2.dat file
f = fopen("kmd2.dat", "rt");
// read the md2.dat file
//Filename checking fixed ~Monster Iestyn and Golden
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
if (!f)
{
CONS_Printf("%s", M_GetText("Error while loading kmd2.dat\n"));
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
nomd2s = true;
return;
}
@ -862,8 +872,9 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
CONS_Printf("AddPlayerMD2()...\n");
// read the kmd2.dat file
f = fopen("kmd2.dat", "rt");
// read the md2.dat file
//Filename checking fixed ~Monster Iestyn and Golden
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
if (!f)
{
@ -907,8 +918,9 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
return;
// Read the kmd2.dat file
f = fopen("kmd2.dat", "rt");
// Read the md2.dat file
//Filename checking fixed ~Monster Iestyn and Golden
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
if (!f)
{
@ -938,6 +950,7 @@ spritemd2found:
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color)
{
UINT8 i;
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor;
@ -963,252 +976,46 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
image = gpatch->mipmap.grInfo.data;
blendimage = blendgpatch->mipmap.grInfo.data;
switch (color)
// Average all of the translation's colors
{
case SKINCOLOR_IVORY:
blendcolor = V_GetColor(0);
break;
case SKINCOLOR_WHITE:
blendcolor = V_GetColor(3);
break;
case SKINCOLOR_SILVER:
blendcolor = V_GetColor(7);
break;
case SKINCOLOR_CLOUDY:
blendcolor = V_GetColor(13);
break;
case SKINCOLOR_GREY:
blendcolor = V_GetColor(15);
break;
case SKINCOLOR_DARKGREY:
blendcolor = V_GetColor(23);
break;
case SKINCOLOR_BLACK:
blendcolor = V_GetColor(27);
break;
case SKINCOLOR_SALMON:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_PINK:
blendcolor = V_GetColor(147);
break;
case SKINCOLOR_LIGHTRED:
blendcolor = V_GetColor(127);
break;
case SKINCOLOR_SHINYRED:
blendcolor = V_GetColor(130);
break;
case SKINCOLOR_RED:
blendcolor = V_GetColor(132);
break;
case SKINCOLOR_DARKPINK:
blendcolor = V_GetColor(151);
break;
case SKINCOLOR_DARKRED:
blendcolor = V_GetColor(139);
break;
case SKINCOLOR_DAWN:
blendcolor = V_GetColor(89);
break;
case SKINCOLOR_ORANGE:
blendcolor = V_GetColor(87);
break;
case SKINCOLOR_SHINYORANGE:
blendcolor = V_GetColor(91);
break;
case SKINCOLOR_DARKORANGE:
blendcolor = V_GetColor(95);
break;
case SKINCOLOR_GOLDENBROWN:
blendcolor = V_GetColor(119);
break;
case SKINCOLOR_ROSEWOOD:
blendcolor = V_GetColor(155);
break;
case SKINCOLOR_DARKROSEWOOD:
blendcolor = V_GetColor(159);
break;
case SKINCOLOR_SEPIA:
blendcolor = V_GetColor(37);
break;
case SKINCOLOR_BEIGE:
blendcolor = V_GetColor(39);
break;
case SKINCOLOR_BROWN:
blendcolor = V_GetColor(55);
break;
case SKINCOLOR_LEATHER:
blendcolor = V_GetColor(61);
break;
case SKINCOLOR_YELLOW:
blendcolor = V_GetColor(104);
break;
case SKINCOLOR_PEACH:
blendcolor = V_GetColor(71);
break;
case SKINCOLOR_LIGHTORANGE:
blendcolor = V_GetColor(83);
break;
case SKINCOLOR_CARAMEL:
blendcolor = V_GetColor(79);
break;
case SKINCOLOR_GOLD:
blendcolor = V_GetColor(115);
break;
case SKINCOLOR_SHINYCARAMEL:
blendcolor = V_GetColor(78);
break;
case SKINCOLOR_VOMIT:
blendcolor = V_GetColor(114);
break;
case SKINCOLOR_GARDEN:
blendcolor = V_GetColor(179);
break;
case SKINCOLOR_LIGHTARMY:
blendcolor = V_GetColor(177);
break;
case SKINCOLOR_ARMY:
blendcolor = V_GetColor(179);
break;
case SKINCOLOR_PISTACHIO:
blendcolor = V_GetColor(166);
break;
case SKINCOLOR_ROBOHOOD:
blendcolor = V_GetColor(182);
break;
case SKINCOLOR_OLIVE:
blendcolor = V_GetColor(108);
break;
case SKINCOLOR_DARKARMY:
blendcolor = V_GetColor(183);
break;
case SKINCOLOR_LIGHTGREEN:
blendcolor = V_GetColor(163);
break;
case SKINCOLOR_UGLYGREEN:
blendcolor = V_GetColor(185);
break;
case SKINCOLOR_NEONGREEN:
blendcolor = V_GetColor(187);
break;
case SKINCOLOR_GREEN:
blendcolor = V_GetColor(167);
break;
case SKINCOLOR_DARKGREEN:
blendcolor = V_GetColor(171);
break;
case SKINCOLOR_SWAMP:
blendcolor = V_GetColor(190);
break;
case SKINCOLOR_FROST:
blendcolor = V_GetColor(215);
break;
case SKINCOLOR_SLATE:
blendcolor = V_GetColor(201);
break;
case SKINCOLOR_LIGHTBLUE:
blendcolor = V_GetColor(227);
break;
case SKINCOLOR_CYAN:
blendcolor = V_GetColor(213);
break;
case SKINCOLOR_CERULEAN:
blendcolor = V_GetColor(217);
break;
case SKINCOLOR_TURQUOISE:
blendcolor = V_GetColor(220);
break;
case SKINCOLOR_TEAL:
blendcolor = V_GetColor(221);
break;
case SKINCOLOR_STEELBLUE:
blendcolor = V_GetColor(203);
break;
case SKINCOLOR_BLUE:
blendcolor = V_GetColor(231);
break;
case SKINCOLOR_SHINYBLUE:
blendcolor = V_GetColor(234);
break;
case SKINCOLOR_NAVY:
blendcolor = V_GetColor(206);
break;
case SKINCOLOR_DARKBLUE:
blendcolor = V_GetColor(238);
break;
case SKINCOLOR_JETBLACK:
blendcolor = V_GetColor(207);
break;
case SKINCOLOR_LILAC:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_PURPLE:
blendcolor = V_GetColor(195);
break;
case SKINCOLOR_LAVENDER:
blendcolor = V_GetColor(251);
break;
case SKINCOLOR_BYZANTIUM:
blendcolor = V_GetColor(254);
break;
case SKINCOLOR_INDIGO:
blendcolor = V_GetColor(199);
break;
UINT16 r, g, b;
UINT8 div = 0;
case SKINCOLOR_SUPER1:
blendcolor = V_GetColor(97);
break;
case SKINCOLOR_SUPER2:
blendcolor = V_GetColor(100);
break;
case SKINCOLOR_SUPER3:
blendcolor = V_GetColor(103);
break;
case SKINCOLOR_SUPER4:
blendcolor = V_GetColor(113);
break;
case SKINCOLOR_SUPER5:
blendcolor = V_GetColor(116);
break;
blendcolor = V_GetColor(colortranslations[color][0]);
r = (UINT16)blendcolor.s.red;
g = (UINT16)blendcolor.s.green;
b = (UINT16)blendcolor.s.blue;
case SKINCOLOR_TSUPER1:
blendcolor = V_GetColor(81);
break;
case SKINCOLOR_TSUPER2:
blendcolor = V_GetColor(82);
break;
case SKINCOLOR_TSUPER3:
blendcolor = V_GetColor(84);
break;
case SKINCOLOR_TSUPER4:
blendcolor = V_GetColor(85);
break;
case SKINCOLOR_TSUPER5:
blendcolor = V_GetColor(87);
break;
for (i = 1; i < 16; i++)
{
RGBA_t nextcolor = V_GetColor(colortranslations[color][i]);
UINT8 mul = 1;
// Weight these shades more. Indices 1-9 weren't randomly picked, they are commonly used on sprites and are generally what the colors "look" like
if (i >= 1 && i <= 9)
mul++;
// The mid & dark tons on the minimap icons get weighted even harder
if (i == 4 || i == 6)
mul += 2;
// And the shade between them, why not
if (i == 5)
mul++;
r += (UINT16)(nextcolor.s.red)*mul;
g += (UINT16)(nextcolor.s.green)*mul;
b += (UINT16)(nextcolor.s.blue)*mul;
div += mul;
}
case SKINCOLOR_KSUPER1:
blendcolor = V_GetColor(122);
break;
case SKINCOLOR_KSUPER2:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_KSUPER3:
blendcolor = V_GetColor(124);
break;
case SKINCOLOR_KSUPER4:
blendcolor = V_GetColor(125);
break;
case SKINCOLOR_KSUPER5:
blendcolor = V_GetColor(126);
break;
default:
blendcolor = V_GetColor(247);
break;
// This shouldn't happen.
if (div < 1)
div = 1;
blendcolor.s.red = (UINT8)(r/div);
blendcolor.s.green = (UINT8)(g/div);
blendcolor.s.blue = (UINT8)(b/div);
}
// starman support, could theoretically support boss ones too
if (skinnum == TC_STARMAN)
// rainbow support, could theoretically support boss ones too
if (skinnum == TC_RAINBOW)
{
while (size--)
{
@ -1490,7 +1297,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
if (spr->mobj->colorized)
skinnum = TC_STARMAN;
skinnum = TC_RAINBOW;
else
{
skinnum = (INT32)((skin_t*)spr->mobj->skin-skins);
@ -1524,7 +1331,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames;
buff = md2->model->glCommandBuffer;
curr = &md2->model->frames[frame];
if (cv_grmd2.value == 1)
if (cv_grmd2.value == 1 && tics <= durs)
{
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
if (spr->mobj->frame & FF_ANIMATE)

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,7 @@
//------------------------------------
// heads up font
//------------------------------------
#define HU_FONTSTART '\x1E' // the first font character
#define HU_FONTSTART '\x19' // the first font character
#define HU_FONTEND '~'
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
@ -55,8 +55,6 @@ typedef struct
{
UINT32 count;
INT32 num;
INT32 color;
INT32 emeralds;
const char *name;
} playersort_t;
@ -80,6 +78,13 @@ extern patch_t *tagico;
extern patch_t *tallminus;
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 OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640)
// some functions
void HU_AddChatText(const char *text);
// set true when entering a chat message
extern boolean chat_on;
@ -104,9 +109,12 @@ void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard.
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds);
INT32 HU_CreateTeamScoresTbl(playersort_t *tab, UINT32 dmtotals[]);

View file

@ -50,7 +50,7 @@ struct JoyType_s
};
typedef struct JoyType_s JoyType_t;
/** \brief Joystick info
for palyer 1 and 2's joystick/gamepad
for palyer[sic] 1-4's joystick/gamepad
*/
extern JoyType_t Joystick, Joystick2, Joystick3, Joystick4;

1260
src/info.c

File diff suppressed because it is too large Load diff

View file

@ -164,8 +164,10 @@ void A_DualAction();
void A_RemoteAction();
void A_ToggleFlameJet();
void A_ItemPop(); // SRB2kart
void A_RedShellChase(); // SRB2kart
void A_BobombExplode(); // SRB2kart
void A_JawzChase(); // SRB2kart
void A_JawzExplode(); // SRB2kart
void A_MineExplode(); // SRB2kart
void A_BallhogExplode(); // SRB2kart
void A_OrbitNights();
void A_GhostMe();
void A_SetObjectState();
@ -580,28 +582,30 @@ typedef enum sprite
SPR_RNDM, // Random Item Box
SPR_RPOP, // Random Item Box Pop
SPR_KFRE, // Mushroom fire trail
SPR_KFRE, // Sneaker fire trail
SPR_KINV, // Invincibility sparkle trail
SPR_KINF, // Invincibility flash
SPR_WIPD, // Wipeout dust trail
SPR_DRIF, // Drift Sparks
SPR_DUST, // Drift Dust
// Kart Items
SPR_FITM, // Fake Item box
SPR_DFAK, // Dead Fake Item
SPR_FITM, // Eggman Monitor
SPR_BANA, // Banana Peel
SPR_DBAN, // Dead Banana Peel
SPR_GSHE, // Green Shell
SPR_DGSH, // Dead Green Shell
SPR_RSHE, // Red Shell
SPR_DRSH, // Dead Red Shell
SPR_BOMB, // Bob-omb
SPR_KRBM,
SPR_BLIG, // Blue Lightning
SPR_LIGH, // Lightning
SPR_ORBN, // Orbinaut
SPR_JAWZ, // Jawz
SPR_SSMN, // SS Mine
SPR_KRBM, // SS Mine BOOM
SPR_BHOG, // Ballhog
SPR_BHBM, // Ballhog BOOM
SPR_BLIG, // Self-Propelled Bomb
SPR_LIGH, // Grow/shrink beams (Metallic Maddness)
SPR_THNS, // Thunder Shield
SPR_SINK, // Kitchen Sink
SPR_SITR, // Kitchen Sink Trail
SPR_KBLN, // Battle Mode Balloon
SPR_KBLN, // Battle Mode Bumper
SPR_LAKI, // Lakitu
SPR_DEZL, // DEZ Laser respawn
// Additional Kart Objects
SPR_POKE, // Pokey
@ -616,16 +620,26 @@ typedef enum sprite
SPR_SACO, // Sapphire Coast Fauna
SPR_CRAB, // Crystal Abyss mobs
SPR_SHAD, // TD shadows
SPR_BRNG, // Chaotix Big Ring
SPR_BUMP, // Player/shell bump
SPR_FLEN, // Shell hit graphics stuff
SPR_CLAS, // items clash
SPR_PSHW, // thrown indicator
SPR_ISTA, // instashield layer A
SPR_ISTB, // instashield layer B
SPR_ARRO, // player arrows
SPR_ITEM,
SPR_ITMO,
SPR_ITMI,
SPR_ITMN,
SPR_WANT,
SPR_PBOM, // player bomb
SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw!
SPR_FIRSTFREESLOT,
SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1,
NUMSPRITES
@ -2647,15 +2661,9 @@ typedef enum state
S_FIREBALL2,
S_FIREBALL3,
S_FIREBALL4,
S_FIREBALL5,
S_FIREBALL6,
S_FIREBALL7,
S_FIREBALLEXP1,
S_FIREBALLEXP2,
S_FIREBALLEXP3,
S_FIREBALLEXP4,
S_FIREBALLEXP5,
S_FIREBALLEXP6,
S_SHELL,
S_SHELL1,
S_SHELL2,
@ -3085,7 +3093,7 @@ typedef enum state
// Magnet Burst
// Mushroom Fire Trail
// Sneaker Fire Trail
S_KARTFIRE1,
S_KARTFIRE2,
S_KARTFIRE3,
@ -3095,7 +3103,33 @@ typedef enum state
S_KARTFIRE7,
S_KARTFIRE8,
//{ Fake Item
// Invincibility Sparks
S_KARTINVULN_SMALL1,
S_KARTINVULN_SMALL2,
S_KARTINVULN_SMALL3,
S_KARTINVULN_SMALL4,
S_KARTINVULN_SMALL5,
S_KARTINVULN_LARGE1,
S_KARTINVULN_LARGE2,
S_KARTINVULN_LARGE3,
S_KARTINVULN_LARGE4,
S_KARTINVULN_LARGE5,
// Invincibility flash
S_INVULNFLASH1,
S_INVULNFLASH2,
S_INVULNFLASH3,
S_INVULNFLASH4,
// Wipeout dust trail
S_WIPEOUTTRAIL1,
S_WIPEOUTTRAIL2,
S_WIPEOUTTRAIL3,
S_WIPEOUTTRAIL4,
S_WIPEOUTTRAIL5,
//{ Eggman Monitor
S_FAKEITEM1,
S_FAKEITEM2,
S_FAKEITEM3,
@ -3124,81 +3158,79 @@ typedef enum state
//}
// Banana
S_BANANAITEM,
S_DEADBANANA,
S_BANANA,
S_BANANA_DEAD,
//{ Green Shell
S_TRIPLEGREENSHIELD1,
S_TRIPLEGREENSHIELD2,
S_TRIPLEGREENSHIELD3,
S_TRIPLEGREENSHIELD4,
S_TRIPLEGREENSHIELD5,
S_TRIPLEGREENSHIELD6,
S_TRIPLEGREENSHIELD7,
S_TRIPLEGREENSHIELD8,
S_GREENSHIELD1,
S_GREENSHIELD2,
S_GREENSHIELD3,
S_GREENSHIELD4,
S_GREENSHIELD5,
S_GREENSHIELD6,
S_GREENSHIELD7,
S_GREENSHIELD8,
S_GREENITEM1,
S_GREENITEM2,
S_GREENITEM3,
S_GREENITEM4,
S_GREENITEM5,
S_GREENITEM6,
S_GREENITEM7,
S_GREENITEM8,
S_DEADGREEN,
//{ Orbinaut
S_ORBINAUT1,
S_ORBINAUT2,
S_ORBINAUT3,
S_ORBINAUT4,
S_ORBINAUT5,
S_ORBINAUT6,
S_ORBINAUT_DEAD,
S_ORBINAUT_SHIELD1,
S_ORBINAUT_SHIELD2,
S_ORBINAUT_SHIELD3,
S_ORBINAUT_SHIELD4,
S_ORBINAUT_SHIELD5,
S_ORBINAUT_SHIELD6,
S_ORBINAUT_SHIELDDEAD,
//}
//{ Red Shell
S_TRIPLEREDSHIELD1,
S_TRIPLEREDSHIELD2,
S_TRIPLEREDSHIELD3,
S_TRIPLEREDSHIELD4,
S_TRIPLEREDSHIELD5,
S_TRIPLEREDSHIELD6,
S_TRIPLEREDSHIELD7,
S_TRIPLEREDSHIELD8,
S_REDSHIELD1,
S_REDSHIELD2,
S_REDSHIELD3,
S_REDSHIELD4,
S_REDSHIELD5,
S_REDSHIELD6,
S_REDSHIELD7,
S_REDSHIELD8,
S_REDITEM1,
S_REDITEM2,
S_REDITEM3,
S_REDITEM4,
S_REDITEM5,
S_REDITEM6,
S_REDITEM7,
S_REDITEM8,
S_DEADRED,
//{ Jawz
S_JAWZ1,
S_JAWZ2,
S_JAWZ3,
S_JAWZ4,
S_JAWZ5,
S_JAWZ6,
S_JAWZ7,
S_JAWZ8,
S_JAWZ_DUD1,
S_JAWZ_DUD2,
S_JAWZ_DUD3,
S_JAWZ_DUD4,
S_JAWZ_DUD5,
S_JAWZ_DUD6,
S_JAWZ_DUD7,
S_JAWZ_DUD8,
S_JAWZ_SHIELD1,
S_JAWZ_SHIELD2,
S_JAWZ_SHIELD3,
S_JAWZ_SHIELD4,
S_JAWZ_SHIELD5,
S_JAWZ_SHIELD6,
S_JAWZ_SHIELD7,
S_JAWZ_SHIELD8,
S_JAWZ_DEAD1,
S_JAWZ_DEAD2,
//}
S_FIRETRAIL1,
S_FIRETRAIL2,
S_FIRETRAIL3,
S_FIRETRAIL4,
S_FIRETRAIL5,
S_FIRETRAIL6,
S_FIRETRAIL7,
S_FIRETRAIL8,
S_FIRETRAIL9,
// Bob-omb
S_BOMBSHIELD,
S_BOMBITEM,
S_BOMBAIR,
S_BOMBEXPLODE,
S_BOMBEXPLOSION1,
S_BOMBEXPLOSION2,
// Special Stage Mine
S_SSMINE1,
S_SSMINE2,
S_SSMINE3,
S_SSMINE4,
S_SSMINE_SHIELD1,
S_SSMINE_SHIELD2,
S_SSMINE_AIR1,
S_SSMINE_AIR2,
S_SSMINE_DEPLOY1,
S_SSMINE_DEPLOY2,
S_SSMINE_DEPLOY3,
S_SSMINE_DEPLOY4,
S_SSMINE_DEPLOY5,
S_SSMINE_DEPLOY6,
S_SSMINE_DEPLOY7,
S_SSMINE_DEPLOY8,
S_SSMINE_DEPLOY9,
S_SSMINE_DEPLOY10,
S_SSMINE_DEPLOY11,
S_SSMINE_DEPLOY12,
S_SSMINE_DEPLOY13,
S_SSMINE_EXPLODE,
S_MINEEXPLOSION1,
S_MINEEXPLOSION2,
// New explosion
S_QUICKBOOM1,
@ -3223,33 +3255,85 @@ typedef enum state
S_SLOWBOOM9,
S_SLOWBOOM10,
// Blue Shell - Blue Lightning for now...
// Ballhog
S_BALLHOG1,
S_BALLHOG2,
S_BALLHOG3,
S_BALLHOG4,
S_BALLHOG5,
S_BALLHOG6,
S_BALLHOG7,
S_BALLHOG8,
S_BALLHOG_DEAD,
S_BALLHOGBOOM1,
S_BALLHOGBOOM2,
S_BALLHOGBOOM3,
S_BALLHOGBOOM4,
S_BALLHOGBOOM5,
S_BALLHOGBOOM6,
S_BALLHOGBOOM7,
S_BALLHOGBOOM8,
S_BALLHOGBOOM9,
S_BALLHOGBOOM10,
S_BALLHOGBOOM11,
S_BALLHOGBOOM12,
S_BALLHOGBOOM13,
S_BALLHOGBOOM14,
S_BALLHOGBOOM15,
S_BALLHOGBOOM16,
// Self-Propelled Bomb - just an explosion for now...
S_BLUELIGHTNING1,
S_BLUELIGHTNING2,
S_BLUELIGHTNING3,
S_BLUELIGHTNING4,
S_BLUEEXPLODE,
// Lightning
// Grow/Shrink
S_LIGHTNING1,
S_LIGHTNING2,
S_LIGHTNING3,
S_LIGHTNING4,
// Thunder Shield
S_THUNDERSHIELD1,
S_THUNDERSHIELD2,
S_THUNDERSHIELD3,
S_THUNDERSHIELD4,
S_THUNDERSHIELD5,
S_THUNDERSHIELD6,
S_THUNDERSHIELD7,
S_THUNDERSHIELD8,
S_THUNDERSHIELD9,
S_THUNDERSHIELD10,
S_THUNDERSHIELD11,
S_THUNDERSHIELD12,
S_THUNDERSHIELD13,
S_THUNDERSHIELD14,
S_THUNDERSHIELD15,
S_THUNDERSHIELD16,
S_THUNDERSHIELD17,
S_THUNDERSHIELD18,
S_THUNDERSHIELD19,
S_THUNDERSHIELD20,
S_THUNDERSHIELD21,
S_THUNDERSHIELD22,
S_THUNDERSHIELD23,
S_THUNDERSHIELD24,
// The legend
S_SINK,
S_SINKTRAIL1,
S_SINKTRAIL2,
S_SINKTRAIL3,
// Battle Mode balloons
S_BATTLEBALLOON1,
S_BATTLEBALLOON2,
S_BATTLEBALLOON3,
// Battle Mode bumpers
S_BATTLEBUMPER1,
S_BATTLEBUMPER2,
S_BATTLEBUMPER3,
// Lakitu
S_LAKITU1,
S_LAKITU2,
// DEZ Laser respawn
S_DEZLASER,
// Pokey
S_POKEY1,
@ -3329,15 +3413,22 @@ typedef enum state
S_DOOD_BOX4,
S_DOOD_BOX5,
// D00Dkart - Diddy Kong Racing Balloon
// D00Dkart - Diddy Kong Racing Bumper
S_DOOD_BALLOON,
// D00Dkart - Big Ring
S_DOOD_RING1,
S_DOOD_RING2,
S_DOOD_RING3,
S_DOOD_RING4,
S_DOOD_RING5,
// Chaotix Big Ring
S_BIGRING01,
S_BIGRING02,
S_BIGRING03,
S_BIGRING04,
S_BIGRING05,
S_BIGRING06,
S_BIGRING07,
S_BIGRING08,
S_BIGRING09,
S_BIGRING10,
S_BIGRING11,
S_BIGRING12,
// SNES Objects
S_SNES_DONUTBUSH1,
@ -3409,28 +3500,38 @@ typedef enum state
S_FIREDITEM3,
S_FIREDITEM4,
S_INSTASHIELDA1, // No damage instashield effect
S_INSTASHIELDA2,
S_INSTASHIELDA3,
S_INSTASHIELDA4,
S_INSTASHIELDA5,
S_INSTASHIELDA6,
S_INSTASHIELDA7,
S_INSTASHIELDB1,
S_INSTASHIELDB2,
S_INSTASHIELDB3,
S_INSTASHIELDB4,
S_INSTASHIELDB5,
S_INSTASHIELDB6,
S_INSTASHIELDB7,
S_PLAYERARROW, // Above player arrow
S_PLAYERARROW_MUSHROOM,
S_PLAYERARROW_GREENSHELL,
S_PLAYERARROW_BANANA,
S_PLAYERARROW_FAKEITEM,
S_PLAYERARROW_BOO,
S_PLAYERARROW_FEATHER,
S_PLAYERARROW_REDSHELL,
S_PLAYERARROW_BOBOMB,
S_PLAYERARROW_FIREFLOWER,
S_PLAYERARROW_TRIPLEGREENSHELL,
S_PLAYERARROW_TRIPLEBANANA,
S_PLAYERARROW_TRIPLEREDSHELL,
S_PLAYERARROW_STAR,
S_PLAYERARROW_MEGASHROOM,
S_PLAYERARROW_KITCHENSINK,
S_PLAYERARROW_EMPTY,
S_PLAYERARROW_ROULETTE,
S_PLAYERARROW_BOX,
S_PLAYERARROW_ITEM,
S_PLAYERARROW_NUMBER,
S_PLAYERARROW_X,
S_PLAYERARROW_WANTED1,
S_PLAYERARROW_WANTED2,
S_PLAYERARROW_WANTED3,
S_PLAYERARROW_WANTED4,
S_PLAYERARROW_WANTED5,
S_PLAYERARROW_WANTED6,
S_PLAYERARROW_WANTED7,
S_PLAYERBOMB,
S_PLAYERITEM,
S_PLAYERWHEEL,
S_KARMAWHEEL,
#ifdef SEENAMES
S_NAMECHECK,
@ -3966,52 +4067,50 @@ typedef enum mobj_type
MT_RANDOMITEM,
MT_RANDOMITEMPOP,
MT_MUSHROOMTRAIL,
MT_SNEAKERTRAIL,
MT_SPARKLETRAIL,
MT_INVULNFLASH,
MT_WIPEOUTTRAIL,
MT_DRIFT,
MT_DRIFTDUST,
MT_FAKESHIELD,
MT_FAKEITEM,
MT_TRIPLEBANANASHIELD1, // Banana Stuff
MT_TRIPLEBANANASHIELD2,
MT_TRIPLEBANANASHIELD3,
MT_BANANASHIELD,
MT_BANANAITEM,
MT_BANANA, // Banana Stuff
MT_BANANA_SHIELD,
MT_TRIPLEGREENSHIELD1, // Green shell stuff
MT_TRIPLEGREENSHIELD2,
MT_TRIPLEGREENSHIELD3,
MT_GREENSHIELD,
MT_GREENITEM,
MT_FIRETRAIL,
MT_ORBINAUT, // Orbinaut stuff
MT_ORBINAUT_SHIELD,
MT_TRIPLEREDSHIELD1, // Red shell stuff
MT_TRIPLEREDSHIELD2,
MT_TRIPLEREDSHIELD3,
MT_REDSHIELD,
MT_REDITEM,
MT_REDITEMDUD,
MT_JAWZ, // Jawz stuff
MT_JAWZ_DUD,
MT_JAWZ_SHIELD,
MT_BOMBSHIELD, // Bob-omb stuff
MT_BOMBITEM,
MT_BOMBEXPLOSION,
MT_BOMBEXPLOSIONSOUND,
MT_SSMINE, // Mine stuff
MT_SSMINE_SHIELD,
MT_MINEEXPLOSION,
MT_MINEEXPLOSIONSOUND,
MT_SMOLDERING, // New explosion
MT_BOOMEXPLODE,
MT_BOOMPARTICLE,
MT_BLUELIGHTNING, // Lightning stuff
MT_BALLHOG, // Ballhog
MT_BALLHOGBOOM,
MT_BLUELIGHTNING, // Grow/shrink stuff
MT_BLUEEXPLOSION,
MT_LIGHTNING,
MT_THUNDERSHIELD, // Thunder Shield stuff
MT_SINK, // Kitchen Sink Stuff
MT_SINKTRAIL,
MT_BATTLEBALLOON, // Battle Mode balloons
MT_BATTLEBUMPER, // Battle Mode bumpers
MT_LAKITU,
MT_DEZLASER,
MT_POKEY, // Huh, thought this was a default asset for some reason, guess not.
@ -4047,7 +4146,7 @@ typedef enum mobj_type
MT_DOOD_FLOWER4,
MT_DOOD_BOX,
MT_DOOD_BALLOON,
MT_DOOD_RING,
MT_BIGRING,
MT_SNES_DONUTBUSH1,
MT_SNES_DONUTBUSH2,
@ -4082,7 +4181,14 @@ typedef enum mobj_type
MT_FIREDITEM,
MT_INSTASHIELDA,
MT_INSTASHIELDB,
MT_PLAYERARROW,
MT_PLAYERWANTED,
MT_KARMAHITBOX,
MT_KARMAWHEEL,
#ifdef SEENAMES
MT_NAMECHECK,

File diff suppressed because it is too large Load diff

View file

@ -11,42 +11,56 @@
UINT8 colortranslations[MAXSKINCOLORS][16];
extern const char *KartColor_Names[MAXSKINCOLORS];
void K_StarmanColormap(UINT8 *dest_colormap, UINT8 skincolor);
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
UINT8 K_GetKartColorByName(const char *name);
void K_RegisterKartStuff(void);
boolean K_IsPlayerLosing(player_t *player);
boolean K_IsPlayerWanted(player_t *player);
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
void K_LakituChecker(player_t *player);
void K_RespawnChecker(player_t *player);
void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_KartPlayerAfterThink(player_t *player);
void K_SpinPlayer(player_t *player, mobj_t *source);
void K_DoInstashield(player_t *player);
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem);
void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source);
void K_StealBalloon(player_t *player, player_t *victim, boolean force);
void K_StealBumper(player_t *player, player_t *victim, boolean force);
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
void K_SpawnBobombExplosion(mobj_t *source, UINT8 color);
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
void K_SpawnBoostTrail(player_t *player);
void K_SpawnSparkleTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
void K_DriftDustHandling(mobj_t *spawner);
void K_DoMushroom(player_t *player, boolean doPFlag);
void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed);
void K_DoSneaker(player_t *player, boolean doPFlag);
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute);
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
void K_CleanHnextList(mobj_t *work);
void K_UpdateHnextList(player_t *player);
void K_RepairOrbitChain(mobj_t *orbit);
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
fixed_t K_GetKartDriftSparkValue(player_t *player);
void K_StripItems(player_t *player);
void K_MomentumToFacing(player_t *player);
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
fixed_t K_GetKartAccel(player_t *player);
UINT16 K_GetKartFlashing(void);
UINT16 K_GetKartFlashing(player_t *player);
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
void K_MoveKartPlayer(player_t *player, boolean onground);
void K_CheckBalloons(void);
void K_CalculateBattleWanted(void);
void K_CheckBumpers(void);
void K_CheckSpectateStatus(void);
INT32 K_calcSplitFlags(INT32 snapflags);
void K_LoadKartHUDGraphics(void);
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);
void K_drawKartHUD(void);
void K_drawKartFreePlay(UINT32 flashtime);
void K_LoadIconGraphics(char *facestr, INT32 skinnum);
void K_ReloadSkinIconGraphics(void);

View file

@ -20,6 +20,8 @@
#include "m_random.h"
#include "s_sound.h"
#include "g_game.h"
#include "hu_stuff.h"
#include "console.h"
#include "k_kart.h"
#include "lua_script.h"
@ -86,6 +88,57 @@ static int lib_print(lua_State *L)
return 0;
}
// Print stuff in the chat, or in the console if we can't.
static int lib_chatprint(lua_State *L)
{
const char *str = luaL_checkstring(L, 1); // retrieve 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"));
int len = strlen(str);
if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0;
}
// Same as above, but do it for only one player.
static int lib_chatprintf(lua_State *L)
{
int n = lua_gettop(L); /* number of arguments */
player_t *plr;
if (n < 2)
return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
if (!plr)
return LUA_ErrInvalid(L, "player_t");
if (plr != &players[consoleplayer])
return 0;
const char *str = luaL_checkstring(L, 2); // retrieve 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"));
int len = strlen(str);
if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0;
}
static int lib_evalMath(lua_State *L)
{
const char *word = luaL_checkstring(L, 1);
@ -583,6 +636,16 @@ static int lib_pCanRunOnWater(lua_State *L)
return 1;
}
static int lib_pSpawnShadowMobj(lua_State *L)
{
mobj_t *caster = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
if (!caster)
return LUA_ErrInvalid(L, "mobj_t");
P_SpawnShadowMobj(caster);
return 0;
}
// P_USER
////////////
@ -887,7 +950,7 @@ static int lib_pHomingAttack(lua_State *L)
return 0;
}
static int lib_pSuperReady(lua_State *L)
/*static int lib_pSuperReady(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
//HUDSAFE
@ -895,7 +958,7 @@ static int lib_pSuperReady(lua_State *L)
return LUA_ErrInvalid(L, "player_t");
lua_pushboolean(L, P_SuperReady(player));
return 1;
}
}*/
static int lib_pDoJump(lua_State *L)
{
@ -1252,7 +1315,7 @@ static int lib_pPlayLivesJingle(lua_State *L)
static int lib_pCanPickupItem(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean weapon = lua_optboolean(L, 2);
UINT8 weapon = (UINT8)luaL_optinteger(L, 2, 0);
//HUDSAFE
if (!player)
return LUA_ErrInvalid(L, "player_t");
@ -1993,6 +2056,26 @@ static int lib_kGetKartColorByName(lua_State *L)
return 1;
}
static int lib_kIsPlayerLosing(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
//HUDSAFE
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_IsPlayerLosing(player);
return 0;
}
static int lib_kIsPlayerWanted(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
//HUDSAFE
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_IsPlayerWanted(player);
return 0;
}
static int lib_kKartBouncing(lua_State *L)
{
mobj_t *mobj1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -2008,16 +2091,28 @@ static int lib_kKartBouncing(lua_State *L)
return 0;
}
static int lib_kDoInstashield(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_DoInstashield(player);
return 0;
}
static int lib_kSpinPlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
INT32 type = (INT32)luaL_checkinteger(L, 3);
boolean trapitem = luaL_checkboolean(L, 4);
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
if (!source)
return LUA_ErrInvalid(L, "mobj_t");
K_SpinPlayer(player, source);
K_SpinPlayer(player, source, type, trapitem);
return 0;
}
@ -2047,7 +2142,7 @@ static int lib_kExplodePlayer(lua_State *L)
return 0;
}
static int lib_kStealBalloon(lua_State *L)
static int lib_kStealBumper(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *victim = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
@ -2057,7 +2152,7 @@ static int lib_kStealBalloon(lua_State *L)
return LUA_ErrInvalid(L, "player_t");
if (!victim)
return LUA_ErrInvalid(L, "player_t");
K_StealBalloon(player, victim, force);
K_StealBumper(player, victim, force);
return 0;
}
@ -2080,7 +2175,7 @@ static int lib_kSpawnKartExplosion(lua_State *L)
return 0;
}
static int lib_kSpawnDriftTrail(lua_State *L)
static int lib_kSpawnBoostTrail(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
@ -2090,6 +2185,27 @@ static int lib_kSpawnDriftTrail(lua_State *L)
return 0;
}
static int lib_kSpawnSparkleTrail(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
K_SpawnSparkleTrail(mo);
return 0;
}
static int lib_kSpawnWipeoutTrail(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
boolean translucent = luaL_checkboolean(L, 2);
NOHUD
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
K_SpawnWipeoutTrail(mo, translucent);
return 0;
}
static int lib_kDriftDustHandling(lua_State *L)
{
mobj_t *spawner = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -2100,25 +2216,52 @@ static int lib_kDriftDustHandling(lua_State *L)
return 0;
}
static int lib_kDoMushroom(lua_State *L)
static int lib_kDoSneaker(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean doPFlag = luaL_checkboolean(L, 2);
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_DoMushroom(player, doPFlag);
K_DoSneaker(player, doPFlag);
return 0;
}
static int lib_kDoBouncePad(lua_State *L)
static int lib_kDoPogoSpring(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t vertispeed = luaL_checkfixed(L, 2);
boolean mute = luaL_checkboolean(L, 3);
NOHUD
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
K_DoBouncePad(mo, vertispeed);
K_DoPogoSpring(mo, vertispeed, mute);
return 0;
}
static int lib_kKillBananaChain(lua_State *L)
{
mobj_t *banana = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
if (!banana)
return LUA_ErrInvalid(L, "mobj_t");
if (!inflictor)
return LUA_ErrInvalid(L, "mobj_t");
if (!source)
return LUA_ErrInvalid(L, "mobj_t");
K_KillBananaChain(banana, inflictor, source);
return 0;
}
static int lib_kRepairOrbitChain(lua_State *L)
{
mobj_t *orbit = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
if (!orbit)
return LUA_ErrInvalid(L, "mobj_t");
K_RepairOrbitChain(orbit);
return 0;
}
@ -2155,16 +2298,18 @@ static int lib_kGetKartAccel(lua_State *L)
static int lib_kGetKartFlashing(lua_State *L)
{
//player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
//HUDSAFE
//if (!player)
//return LUA_ErrInvalid(L, "player_t");
lua_pushinteger(L, K_GetKartFlashing());
if (!player)
return LUA_ErrInvalid(L, "player_t");
lua_pushinteger(L, K_GetKartFlashing(player));
return 0;
}
static luaL_Reg lib[] = {
{"print", lib_print},
{"chatprint", lib_chatprint},
{"chatprintf", lib_chatprintf},
{"EvalMath", lib_evalMath},
// m_random
@ -2213,6 +2358,7 @@ static luaL_Reg lib[] = {
{"P_CheckDeathPitCollide",lib_pCheckDeathPitCollide},
{"P_CheckSolidLava",lib_pCheckSolidLava},
{"P_CanRunOnWater",lib_pCanRunOnWater},
{"P_SpawnShadowMobj",lib_pSpawnShadowMobj},
// p_user
{"P_GetPlayerHeight",lib_pGetPlayerHeight},
@ -2243,7 +2389,7 @@ static luaL_Reg lib[] = {
{"P_LookForEnemies",lib_pLookForEnemies},
{"P_NukeEnemies",lib_pNukeEnemies},
{"P_HomingAttack",lib_pHomingAttack},
{"P_SuperReady",lib_pSuperReady},
//{"P_SuperReady",lib_pSuperReady},
{"P_DoJump",lib_pDoJump},
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
@ -2338,16 +2484,23 @@ static luaL_Reg lib[] = {
// k_kart
{"K_GetKartColorByName",lib_kGetKartColorByName},
{"K_IsPlayerLosing",lib_kIsPlayerLosing},
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
{"K_KartBouncing",lib_kKartBouncing},
{"K_DoInstashield",lib_kDoInstashield},
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},
{"K_ExplodePlayer",lib_kExplodePlayer},
{"K_StealBalloon",lib_kStealBalloon},
{"K_StealBumper",lib_kStealBumper},
{"K_SpawnKartExplosion",lib_kSpawnKartExplosion},
{"K_SpawnBoostTrail",lib_kSpawnDriftTrail},
{"K_SpawnBoostTrail",lib_kSpawnBoostTrail},
{"K_SpawnSparkleTrail",lib_kSpawnSparkleTrail},
{"K_SpawnWipeoutTrail",lib_kSpawnWipeoutTrail},
{"K_DriftDustHandling",lib_kDriftDustHandling},
{"K_DoMushroom",lib_kDoMushroom},
{"K_DoBouncePad",lib_kDoBouncePad},
{"K_DoSneaker",lib_kDoSneaker},
{"K_DoPogoSpring",lib_kDoPogoSpring},
{"K_KillBananaChain",lib_kKillBananaChain},
{"K_RepairOrbitChain",lib_kRepairOrbitChain},
{"K_MomentumToFacing",lib_kMomentumToFacing},
{"K_GetKartSpeed",lib_kGetKartSpeed},
{"K_GetKartAccel",lib_kGetKartAccel},

View file

@ -77,7 +77,9 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
deny:
//must be hacked/buggy client
lua_settop(gL, 0); // clear stack
if (gL) // check if Lua is actually turned on first, you dummmy -- Monster Iestyn 04/07/18
lua_settop(gL, 0); // clear stack
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
if (server)
{

View file

@ -74,7 +74,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Ho
boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd
boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); // Hook for chat messages
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer

View file

@ -952,7 +952,9 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
}
// Hook for player chat
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
// Added the "mute" field. It's set to true if the message was supposed to be eaten by spam protection.
// But for netgame consistency purposes, this hook is ran first reguardless, so this boolean allows for modders to adapt if they so desire.
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute)
{
hook_p hookp;
boolean hooked = false;
@ -981,14 +983,19 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target
}
lua_pushstring(gL, msg); // msg
if (mute)
lua_pushboolean(gL, true); // the message was supposed to be eaten by spamprotecc.
else
lua_pushboolean(gL, false);
}
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
lua_gettable(gL, LUA_REGISTRYINDEX);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
if (lua_pcall(gL, 4, 1, 0)) {
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
if (lua_pcall(gL, 5, 1, 0)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);

View file

@ -424,6 +424,30 @@ static int libd_drawFill(lua_State *L)
return 0;
}
static int libd_fadeScreen(lua_State *L)
{
UINT16 color = luaL_checkinteger(L, 1);
UINT8 strength = luaL_checkinteger(L, 2);
const UINT8 maxstrength = ((color & 0xFF00) ? 32 : 10);
HUDONLY
if (!strength)
return 0;
if (strength > maxstrength)
return luaL_error(L, "%s fade strength %d out of range (0 - %d)", ((color & 0xFF00) ? "COLORMAP" : "TRANSMAP"), strength, maxstrength);
if (strength == maxstrength) // Allow as a shortcut for drawfill...
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, ((color & 0xFF00) ? 31 : color));
return 0;
}
V_DrawFadeScreen(color, strength);
return 0;
}
static int libd_drawString(lua_State *L)
{
fixed_t x = luaL_checkinteger(L, 1);
@ -568,6 +592,7 @@ static luaL_Reg lib_draw[] = {
{"drawNum", libd_drawNum},
{"drawPaddedNum", libd_drawPaddedNum},
{"drawFill", libd_drawFill},
{"fadeScreen", libd_fadeScreen},
{"drawString", libd_drawString},
{"stringWidth", libd_stringWidth},
{"getColormap", libd_getColormap},

View file

@ -16,6 +16,7 @@
#include "tables.h"
#include "p_local.h"
#include "doomstat.h" // for ALL7EMERALDS
#include "k_kart.h" // KartColor_Opposite
#include "lua_script.h"
#include "lua_libs.h"
@ -191,8 +192,8 @@ static int lib_coloropposite(lua_State *L)
UINT8 colornum = (UINT8)luaL_checkinteger(L, 1);
if (colornum >= MAXSKINCOLORS)
return luaL_error(L, "skincolor %d out of range (0 - %d).", colornum, MAXSKINCOLORS-1);
lua_pushinteger(L, Color_Opposite[colornum*2]); // push color
lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame
lua_pushinteger(L, KartColor_Opposite[colornum*2]); // push color
lua_pushinteger(L, KartColor_Opposite[colornum*2+1]); // push frame
return 2;
}

View file

@ -530,10 +530,22 @@ static int mobj_set(lua_State *L)
case mobj_bprev:
return UNIMPLEMENTED;
case mobj_hnext:
mo->hnext = luaL_checkudata(L, 3, META_MOBJ);
if (lua_isnil(L, 3))
P_SetTarget(&mo->hnext, NULL);
else
{
mobj_t *hnext = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&mo->hnext, hnext);
}
break;
case mobj_hprev:
mo->hprev = luaL_checkudata(L, 3, META_MOBJ);
if (lua_isnil(L, 3))
P_SetTarget(&mo->hprev, NULL);
else
{
mobj_t *hprev = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&mo->hprev, hprev);
}
break;
case mobj_type: // yeah sure, we'll let you change the mobj's type.
{

View file

@ -527,9 +527,23 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
break;
}
case LUA_TSTRING:
{
UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros
const char *s = lua_tostring(gL, myindex);
UINT16 i = 0;
WRITEUINT8(save_p, ARCH_STRING);
WRITESTRING(save_p, lua_tostring(gL, myindex));
// if you're wondering why we're writing a string to save_p this way,
// it turns out that Lua can have embedded zeros ('\0') in the strings,
// so we can't use WRITESTRING as that cuts off when it finds a '\0'.
// Saving the size of the string also allows us to get the size of the string on the other end,
// fixing the awful crashes previously encountered for reading strings longer than 1024
// (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?)
// -- Monster Iestyn 05/08/18
WRITEUINT16(save_p, len); // save size of string
while (i < len)
WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros
break;
}
case LUA_TTABLE:
{
boolean found = false;
@ -810,9 +824,19 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
break;
case ARCH_STRING:
{
char value[1024];
READSTRING(save_p, value);
lua_pushstring(gL, value);
UINT16 len = READUINT16(save_p); // length of string, including embedded zeros
char *value;
UINT16 i = 0;
// See my comments in the ArchiveValue function;
// it's much the same for reading strings as writing them!
// (i.e. we can't use READSTRING either)
// -- Monster Iestyn 05/08/18
value = malloc(len); // make temp buffer of size len
// now read the actual string
while (i < len)
value[i++] = READCHAR(save_p); // read chars individually, including the embedded zeros
lua_pushlstring(gL, value, len); // push the string (note: this function supports embedded zeros)
free(value); // free the buffer
break;
}
case ARCH_TABLE:

View file

@ -1149,7 +1149,7 @@ void OP_ObjectplaceMovement(player_t *player)
// make sure viewz follows player if in 1st person mode
//player->deltaviewheight = 0;
player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, player->mo->scale);
player->viewheight = FixedMul(32 << FRACBITS, player->mo->scale);
if (player->mo->eflags & MFE_VERTICALFLIP)
player->viewz = player->mo->z + player->mo->height - player->viewheight;
else
@ -1368,7 +1368,7 @@ void Command_ObjectPlace_f(void)
players[0].mo->color = op_oldcolor;
// This is necessary for recovery of dying players.
if (players[0].powers[pw_flashing] >= K_GetKartFlashing())
players[0].powers[pw_flashing] = K_GetKartFlashing() - 1;
if (players[0].powers[pw_flashing] >= K_GetKartFlashing(&players[0]))
players[0].powers[pw_flashing] = K_GetKartFlashing(&players[0]) - 1;
}
}

File diff suppressed because it is too large Load diff

View file

@ -267,7 +267,7 @@ void Screenshot_option_Onchange(void);
prev,\
source,\
M_DrawServerMenu,\
27,40,\
24,40,\
0,\
NULL\
}
@ -279,7 +279,7 @@ void Screenshot_option_Onchange(void);
prev,\
source,\
M_DrawControl,\
24, 40,\
26, 40,\
0,\
NULL\
}

View file

@ -187,9 +187,11 @@ void A_RandomStateRange(mobj_t *actor);
void A_DualAction(mobj_t *actor);
void A_RemoteAction(mobj_t *actor);
void A_ToggleFlameJet(mobj_t *actor);
void A_ItemPop(mobj_t *actor); // SRB2kart
void A_RedShellChase(mobj_t *actor); // SRB2kart
void A_BobombExplode(mobj_t *actor); // SRB2kart
void A_ItemPop(mobj_t *actor); // SRB2kart
void A_JawzChase(mobj_t *actor); // SRB2kart
void A_JawzExplode(mobj_t *actor); // SRB2kart
void A_MineExplode(mobj_t *actor); // SRB2kart
void A_BallhogExplode(mobj_t *actor); // SRB2kart
void A_OrbitNights(mobj_t *actor);
void A_GhostMe(mobj_t *actor);
void A_SetObjectState(mobj_t *actor);
@ -849,7 +851,7 @@ void A_Look(mobj_t *actor)
if (!P_LookForPlayers(actor, locvar1 & 65535, false , FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale)))
return;
if (leveltime < 4*TICRATE) // SRB2kart - no looking before race starts
if (leveltime < starttime) // SRB2kart - no looking before race starts
return;
// go into chase state
@ -2549,7 +2551,7 @@ void A_MonitorPop(mobj_t *actor)
mobj_t *remains;
mobjtype_t explode;
mobjtype_t item = 0;
mobjtype_t newbox;
//mobjtype_t newbox;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_MonitorPop", actor))
@ -2601,7 +2603,7 @@ void A_MonitorPop(mobj_t *actor)
switch (actor->type)
{
case MT_QUESTIONBOX: // Random!
/*case MT_QUESTIONBOX: // Random!
{
mobjtype_t spawnchance[256];
INT32 numchoices = 0, i = 0;
@ -2635,7 +2637,7 @@ for (i = cvar.value; i; --i) spawnchance[numchoices++] = type
remains->flags2 &= ~MF2_AMBUSH;
break;
}
}*/
default:
item = actor->info->damage;
break;
@ -3238,8 +3240,10 @@ void A_WaterShield(mobj_t *actor)
P_SpawnShieldOrb(player);
}
/* // SRB2kart - Can't drown.
if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)
P_RestoreMusic(player);
*/
player->powers[pw_underwater] = 0;
@ -3825,7 +3829,7 @@ void A_ThrownRing(mobj_t *actor)
P_SetTarget(&actor->tracer, NULL);
}
if (actor->tracer && (actor->tracer->health)) // SRB2kart - red shells always follow
if (actor->tracer && (actor->tracer->health)) // SRB2kart - jawz always follow
//&& (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)// Already found someone to follow.
{
const INT32 temp = actor->threshold;
@ -3877,7 +3881,7 @@ void A_ThrownRing(mobj_t *actor)
&& actor->target->player->ctfteam == player->ctfteam)
continue;
if (actor->target->player->kartstuff[k_position] < player->kartstuff[k_position]) // SRB2kart - Red Shells only go after people ahead of you
if (actor->target->player->kartstuff[k_position] < player->kartstuff[k_position]) // SRB2kart - Jawz only go after people ahead of you
continue;
}
@ -3920,8 +3924,8 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner.
return true;
if (thing->player && (thing->player->kartstuff[k_bootimer]
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
if (thing->player && (thing->player->kartstuff[k_hyudorotimer]
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_bumper] <= 0 && thing->player->kartstuff[k_comebacktimer])))
return true;
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
@ -3990,15 +3994,19 @@ void A_SetSolidSteam(mobj_t *actor)
#endif
actor->flags &= ~MF_NOCLIP;
actor->flags |= MF_SOLID;
if (P_RandomChance(FRACUNIT/8))
if (!(actor->flags2 & MF2_AMBUSH)) // Don't be so obnoxious.
{
if (actor->info->deathsound)
S_StartSound(actor, actor->info->deathsound); // Hiss!
}
else
{
if (actor->info->painsound)
S_StartSound(actor, actor->info->painsound);
if (P_RandomChance(FRACUNIT/8))
{
if (actor->info->deathsound)
S_StartSound(actor, actor->info->deathsound); // Hiss!
}
else
{
if (actor->info->painsound)
S_StartSound(actor, actor->info->painsound);
}
}
P_SetObjectMomZ (actor, 1, true);
@ -4042,8 +4050,8 @@ void A_SignPlayer(mobj_t *actor)
return;
// Set the sign to be an appropriate background color for this player's skincolor.
actor->color = Color_Opposite[actor->target->player->skincolor*2];
actor->frame += Color_Opposite[actor->target->player->skincolor*2+1];
actor->color = KartColor_Opposite[actor->target->player->skincolor*2];
actor->frame += KartColor_Opposite[actor->target->player->skincolor*2+1];
// spawn an overlay of the player's face.
ov = P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY);
@ -8085,7 +8093,7 @@ void A_ToggleFlameJet(mobj_t* actor)
}
}
//{ SRB2kart - A_ItemPop, A_RedShellChase and A_BobombExplode
//{ SRB2kart - A_ItemPop, A_JawzChase, A_JawzExplode, A_MineExplode, and A_BallhogExplode
void A_ItemPop(mobj_t *actor)
{
mobj_t *remains;
@ -8134,7 +8142,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags = actor->flags; // Transfer flags
remains->flags2 = actor->flags2; // Transfer flags2
remains->fuse = actor->fuse; // Transfer respawn timer
remains->threshold = 68;
remains->threshold = (actor->threshold == 69 ? 69 : 68);
remains->skin = NULL;
remains->spawnpoint = actor->spawnpoint;
@ -8143,25 +8151,25 @@ void A_ItemPop(mobj_t *actor)
if (actor->info->deathsound)
S_StartSound(remains, actor->info->deathsound);
if (!(G_BattleGametype() && actor->target->player->kartstuff[k_balloon] <= 0))
if (!(G_BattleGametype() && actor->target->player->kartstuff[k_bumper] <= 0))
actor->target->player->kartstuff[k_itemroulette] = 1;
remains->flags2 &= ~MF2_AMBUSH;
if (G_BattleGametype())
if (G_BattleGametype() && actor->threshold != 69)
numgotboxes++;
P_RemoveMobj(actor);
}
void A_RedShellChase(mobj_t *actor)
void A_JawzChase(mobj_t *actor)
{
INT32 c = 0;
INT32 stop;
player_t *player;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_RedShellChase", actor))
if (LUA_CallAction("A_JawzChase", actor))
return;
#endif
@ -8221,13 +8229,13 @@ void A_RedShellChase(mobj_t *actor)
if (G_RaceGametype()) // Only in races, in match and CTF you should go after any nearby players
{
// USER TARGET
if (actor->target->player->kartstuff[k_position] != (player->kartstuff[k_position] + 1)) // Red Shells only go after the person directly ahead of you -Sryder
if (actor->target->player->kartstuff[k_position] != (player->kartstuff[k_position] + 1)) // Jawz only go after the person directly ahead of you -Sryder
continue;
}
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] <= 0)
if (player->kartstuff[k_bumper] <= 0)
continue;
if (P_AproxDistance(P_AproxDistance(player->mo->x-actor->x,
@ -8239,7 +8247,7 @@ void A_RedShellChase(mobj_t *actor)
if ((G_RaceGametype()) || (G_BattleGametype() // If in match etc. only home in when you get close enough, in race etc. home in all the time
&& P_AproxDistance(P_AproxDistance(player->mo->x-actor->x,
player->mo->y-actor->y), player->mo->z-actor->z) < RING_DIST
&& player->kartstuff[k_balloon] > 0))
&& player->kartstuff[k_bumper] > 0))
P_SetTarget(&actor->tracer, player->mo);
return;
@ -8258,7 +8266,45 @@ void A_RedShellChase(mobj_t *actor)
}
void A_BobombExplode(mobj_t *actor)
void A_JawzExplode(mobj_t *actor)
{
INT32 shrapnel = 2;
mobj_t *truc;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_JawzExplode", actor))
return;
#endif
truc = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOOMEXPLODE);
truc->scale = actor->scale*2;
truc->color = SKINCOLOR_RED;
while (shrapnel)
{
INT32 speed, speed2;
truc = P_SpawnMobj(actor->x + P_RandomRange(-8, 8)*FRACUNIT, actor->y + P_RandomRange(-8, 8)*FRACUNIT,
actor->z + P_RandomRange(0, 8)*FRACUNIT, MT_BOOMPARTICLE);
truc->scale = actor->scale*2;
speed = FixedMul(7*FRACUNIT, actor->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
speed = FixedMul(5*FRACUNIT, actor->scale)>>FRACBITS;
speed2 = FixedMul(15*FRACUNIT, actor->scale)>>FRACBITS;
truc->momz = P_RandomRange(speed, speed2)*FRACUNIT;
truc->tics = TICRATE*2;
truc->color = SKINCOLOR_RED;
shrapnel--;
}
return;
}
void A_MineExplode(mobj_t *actor)
{
mobj_t *mo2;
thinker_t *th;
@ -8266,7 +8312,7 @@ void A_BobombExplode(mobj_t *actor)
INT32 locvar1 = var1;
mobjtype_t type;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_BobombExplode", actor))
if (LUA_CallAction("A_MineExplode", actor))
return;
#endif
@ -8282,10 +8328,10 @@ void A_BobombExplode(mobj_t *actor)
mo2 = (mobj_t *)th;
if (mo2 == actor || mo2->type == MT_BOMBEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
continue;
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target)
continue;
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance)
@ -8308,14 +8354,29 @@ void A_BobombExplode(mobj_t *actor)
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
if (actor->target && actor->target->player)
K_SpawnBobombExplosion(actor, actor->target->player->skincolor);
K_SpawnMineExplosion(actor, actor->target->player->skincolor);
else
K_SpawnBobombExplosion(actor, SKINCOLOR_RED);
K_SpawnMineExplosion(actor, SKINCOLOR_RED);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND);
return;
}
void A_BallhogExplode(mobj_t *actor)
{
mobj_t *mo2;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_BallhogExplode", actor))
return;
#endif
mo2 = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BALLHOGBOOM);
P_SetScale(mo2, actor->scale*2);
mo2->destscale = mo2->scale;
S_StartSound(mo2, actor->info->deathsound);
return;
}
//}
// Function: A_OrbitNights

View file

@ -237,7 +237,7 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus
{
case MT_GOOP: // Egg Slimer's goop objects
case MT_SPINFIRE: // Elemental Shield flame balls
case MT_MUSHROOMTRAIL:
case MT_SNEAKERTRAIL:
case MT_SPIKE: // Floor Spike
// Is the object hang from the ceiling?
// In that case, swap the planes used.

View file

@ -150,28 +150,47 @@ void P_ResetStarposts(void)
//
// Returns true if the player is in a state where they can pick up items.
//
boolean P_CanPickupItem(player_t *player, boolean weapon)
boolean P_CanPickupItem(player_t *player, UINT8 weapon)
{
/*if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // No balloons in Match
return false;*/
if (player->exiting || mapreset)
return false;
/*if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) // No bumpers in Match
return false;*/
if (weapon)
{
if (player->kartstuff[k_bootaketimer] || player->kartstuff[k_boostolentimer]
|| player->kartstuff[k_growshrinktimer] > 1 || player->kartstuff[k_goldshroomtimer]) // Item-specific timer going off
return false;
// Item slot already taken up
if (weapon == 2)
{
// Invulnerable
if (player->powers[pw_flashing] > 0
|| player->kartstuff[k_spinouttimer] > 0
|| player->kartstuff[k_squishedtimer] > 0
|| player->kartstuff[k_invincibilitytimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0
|| player->kartstuff[k_hyudorotimer] > 0)
return false;
if (player->kartstuff[k_itemroulette]
|| player->kartstuff[k_greenshell] || player->kartstuff[k_triplegreenshell]
|| player->kartstuff[k_redshell] || player->kartstuff[k_tripleredshell]
|| player->kartstuff[k_banana] || player->kartstuff[k_triplebanana]
|| player->kartstuff[k_fakeitem] & 2 || player->kartstuff[k_magnet]
|| player->kartstuff[k_bobomb] || player->kartstuff[k_blueshell]
|| player->kartstuff[k_mushroom] || player->kartstuff[k_fireflower]
|| player->kartstuff[k_star] || player->kartstuff[k_goldshroom]
|| player->kartstuff[k_lightning] || player->kartstuff[k_megashroom]
|| player->kartstuff[k_boo] || player->kartstuff[k_feather] & 1) // Item slot already taken up
return false;
// Already have fake
if (player->kartstuff[k_roulettetype] == 2
|| player->kartstuff[k_eggmanexplode])
return false;
}
else
{
// Item-specific timer going off
if (player->kartstuff[k_stealingtimer] || player->kartstuff[k_stolentimer]
|| player->kartstuff[k_growshrinktimer] != 0 || player->kartstuff[k_rocketsneakertimer]
|| player->kartstuff[k_eggmanexplode])
return false;
// Item slot already taken up
if (player->kartstuff[k_itemroulette]
|| player->kartstuff[k_itemamount]
|| player->kartstuff[k_itemheld])
return false;
}
}
return true;
@ -411,12 +430,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
switch (special->type)
{
case MT_RANDOMITEM: // SRB2kart
if (!P_CanPickupItem(player, true))
if (!P_CanPickupItem(player, 1))
return;
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
if (player->kartstuff[k_comebackmode] == 1 || player->kartstuff[k_comebacktimer])
if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer])
return;
if (player->kartstuff[k_comebackmode] == 0)
player->kartstuff[k_comebackmode] = 1;
@ -426,6 +445,106 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_SetTarget(&special->target, toucher);
P_KillMobj(special, toucher, toucher);
break;
case MT_FAKESHIELD: // SRB2kart
case MT_FAKEITEM:
if ((special->target == toucher || special->target == toucher->target) && (special->threshold > 0))
return;
if (special->health <= 0 || toucher->health <= 0)
return;
if (!P_CanPickupItem(player, 2))
return;
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
/*if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer])
return;
if (player->kartstuff[k_comebackmode] == 0)
player->kartstuff[k_comebackmode] = 2;*/
return;
}
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
S_StartSound(poof, special->info->deathsound);
K_StripItems(player);
if (player->kartstuff[k_itemroulette] <= 0)
player->kartstuff[k_itemroulette] = 1;
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;
else
player->kartstuff[k_eggmanblame] = player-players;
P_RemoveMobj(special);
return;
}
break;
case MT_KARMAHITBOX:
if (!special->target->player)
return;
if (player == special->target->player)
return;
if (player->kartstuff[k_bumper] <= 0)
return;
if (special->target->player->exiting || player->exiting)
return;
if (special->target->player->kartstuff[k_comebacktimer]
|| special->target->player->kartstuff[k_spinouttimer]
|| special->target->player->kartstuff[k_squishedtimer])
return;
if (special->target->player->kartstuff[k_comebackmode] == 0)
{
if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer]
|| player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer]
|| player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing])
return;
else
{
mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE);
boom->scale = special->target->scale;
boom->destscale = special->target->scale;
boom->momz = 5*FRACUNIT;
if (special->target->color)
boom->color = special->target->color;
else
boom->color = SKINCOLOR_RED;
S_StartSound(boom, special->info->attacksound);
special->target->player->kartstuff[k_comebackpoints] += 2 * (K_IsPlayerWanted(player) ? 2 : 1);
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s bombed %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_ExplodePlayer(player, special->target);
}
}
else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, 1))
{
mobj_t *poof = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE);
S_StartSound(poof, special->info->seesound);
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;
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 1;
}
return;
// ***************************************** //
// Rings, coins, spheres, weapon panels, etc //
// ***************************************** //
@ -439,7 +558,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
/* FALLTHRU */
case MT_RING:
case MT_FLINGRING:
if (!(P_CanPickupItem(player, false)))
if (!(P_CanPickupItem(player, 0)))
return;
special->momx = special->momy = special->momz = 0;
@ -451,7 +570,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
case MT_COIN:
case MT_FLINGCOIN:
if (!(P_CanPickupItem(player, false)))
if (!(P_CanPickupItem(player, 0)))
return;
special->momx = special->momy = 0;
@ -461,7 +580,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DoNightsScore(player);
break;
case MT_BLUEBALL:
if (!(P_CanPickupItem(player, false)))
if (!(P_CanPickupItem(player, 0)))
return;
P_GivePlayerRings(player, 1);
@ -482,7 +601,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
case MT_GRENADEPICKUP:
case MT_EXPLODEPICKUP:
case MT_RAILPICKUP:
if (!(P_CanPickupItem(player, true)))
if (!(P_CanPickupItem(player, 1)))
return;
// Give the power and ringweapon
@ -506,7 +625,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
case MT_GRENADERING:
case MT_EXPLOSIONRING:
case MT_RAILRING:
if (!(P_CanPickupItem(player, true)))
if (!(P_CanPickupItem(player, 1)))
return;
if (special->info->mass >= pw_infinityring && special->info->mass <= pw_railring)
@ -594,7 +713,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Power stones / Match emeralds
case MT_FLINGEMERALD:
if (!(P_CanPickupItem(player, true)) || player->tossdelay)
if (!(P_CanPickupItem(player, 1)) || player->tossdelay)
return;
player->powers[pw_emeralds] |= special->threshold;
@ -1490,12 +1609,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|| special->z > toucher->z + (toucher->height*2/3))
return; // Only go in the mouth
/* // SRB2kart - Can't drown.
// Eaten by player!
if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)
P_RestoreMusic(player);
if (player->powers[pw_underwater] < underwatertics + 1)
player->powers[pw_underwater] = underwatertics + 1;
*/
/*
if (!player->climbing)
@ -1612,7 +1733,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
str = M_GetText("%s%s's tagging hand %s %s.\n");
break;
case MT_SPINFIRE:
case MT_MUSHROOMTRAIL:
case MT_SNEAKERTRAIL:
str = M_GetText("%s%s's elemental fire trail %s %s.\n");
break;
case MT_THROWNBOUNCE:
@ -1749,7 +1870,7 @@ void P_CheckTimeLimit(void)
if (G_RaceGametype())
return;
if (leveltime < timelimitintics)
if (leveltime < (timelimitintics + starttime))
return;
if (gameaction == ga_completed)
@ -1771,9 +1892,6 @@ void P_CheckTimeLimit(void)
P_AddPlayerScore(&players[i], players[i].score);
}
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
//Optional tie-breaker for Match/CTF
@ -1787,6 +1905,8 @@ void P_CheckTimeLimit(void)
//Figure out if we have enough participating players to care.
for (i = 0; i < MAXPLAYERS; i++)
{
if (players[i].exiting)
return;
if (playeringame[i] && players[i].spectator)
spectators++;
}
@ -1815,7 +1935,7 @@ void P_CheckTimeLimit(void)
{
for (k = i; k < playercount; k++)
{
if (players[playerarray[i-1]].score < players[playerarray[k]].score)
if (players[playerarray[i-1]].marescore < players[playerarray[k]].marescore)
{
tempplayer = playerarray[i-1];
playerarray[i-1] = playerarray[k];
@ -1825,7 +1945,7 @@ void P_CheckTimeLimit(void)
}
//End the round if the top players aren't tied.
if (players[playerarray[0]].score == players[playerarray[1]].score)
if (players[playerarray[0]].marescore == players[playerarray[1]].marescore)
return;
}
else
@ -1835,12 +1955,19 @@ void P_CheckTimeLimit(void)
return;
}
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].exiting)
return;
P_DoPlayerExit(&players[i]);
}
/*if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);*/
}
/** Checks if a player's score is over the pointlimit and the round should end.
@ -1863,7 +1990,7 @@ void P_CheckPointLimit(void)
return;
// pointlimit is nonzero, check if it's been reached by this player
if (G_GametypeHasTeams())
/*if (G_GametypeHasTeams())
{
// Just check both teams
if ((UINT32)cv_pointlimit.value <= redscore || (UINT32)cv_pointlimit.value <= bluescore)
@ -1872,18 +1999,27 @@ void P_CheckPointLimit(void)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
}
else
else*/
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if ((UINT32)cv_pointlimit.value <= players[i].score)
if ((UINT32)cv_pointlimit.value <= players[i].marescore)
{
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
return;
for (i = 0; i < MAXPLAYERS; i++) // AAAAA nested loop using the same iteration variable ;;
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].exiting)
return;
P_DoPlayerExit(&players[i]);
}
/*if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);*/
return; // good thing we're leaving the function immediately instead of letting the loop get mangled!
}
}
}
@ -1977,13 +2113,15 @@ void P_CheckSurvivors(void)
// Checks whether or not to end a race netgame.
boolean P_CheckRacers(void)
{
INT32 i;
INT32 i, j, numplayersingame = 0;
// Check if all the players in the race have finished. If so, end the level.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator && !players[i].exiting && players[i].lives > 0)
break;
if (!playeringame[i] || players[i].spectator || players[i].exiting || !players[i].lives)
continue;
break;
}
if (i == MAXPLAYERS) // finished
@ -1992,6 +2130,35 @@ boolean P_CheckRacers(void)
return true;
}
if (cv_karteliminatelast.value)
{
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator)
continue;
numplayersingame++;
}
if (numplayersingame > 1) // if there's more than one player in-game, this is safe to do
{
// check if we just got unlucky and there was only one guy who was a problem
for (j = i+1; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator || players[j].exiting || !players[j].lives)
continue;
break;
}
if (j == MAXPLAYERS) // finish anyways, force a time over
{
P_DoTimeOver(&players[i]);
countdown = countdown2 = 0;
return true;
}
}
}
return false;
}
@ -2011,43 +2178,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
//if (inflictor && (inflictor->type == MT_SHELL || inflictor->type == MT_FIREBALL))
// P_SetTarget(&target->tracer, inflictor);
// SRB2kart
// I wish I knew a better way to do this
if (target->target && target->target->player && target->target->player->mo)
{
if (target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_greenshell] & 1)
target->target->player->kartstuff[k_greenshell] &= ~1;
else if (target->type == MT_REDSHIELD && target->target->player->kartstuff[k_redshell] & 1)
target->target->player->kartstuff[k_redshell] &= ~1;
else if (target->type == MT_BANANASHIELD && target->target->player->kartstuff[k_banana] & 1)
target->target->player->kartstuff[k_banana] &= ~1;
else if (target->type == MT_FAKESHIELD && target->target->player->kartstuff[k_fakeitem] & 1)
target->target->player->kartstuff[k_fakeitem] &= ~1;
else if (target->type == MT_BOMBSHIELD && target->target->player->kartstuff[k_bobomb] & 1)
target->target->player->kartstuff[k_bobomb] &= ~1;
else if (target->type == MT_TRIPLEGREENSHIELD1 && target->target->player->kartstuff[k_triplegreenshell] & 1)
target->target->player->kartstuff[k_triplegreenshell] &= ~1;
else if (target->type == MT_TRIPLEGREENSHIELD2 && target->target->player->kartstuff[k_triplegreenshell] & 2)
target->target->player->kartstuff[k_triplegreenshell] &= ~2;
else if (target->type == MT_TRIPLEGREENSHIELD3 && target->target->player->kartstuff[k_triplegreenshell] & 4)
target->target->player->kartstuff[k_triplegreenshell] &= ~4;
else if (target->type == MT_TRIPLEREDSHIELD1 && target->target->player->kartstuff[k_tripleredshell] & 1)
target->target->player->kartstuff[k_tripleredshell] &= ~1;
else if (target->type == MT_TRIPLEREDSHIELD2 && target->target->player->kartstuff[k_tripleredshell] & 2)
target->target->player->kartstuff[k_tripleredshell] &= ~2;
else if (target->type == MT_TRIPLEREDSHIELD3 && target->target->player->kartstuff[k_tripleredshell] & 4)
target->target->player->kartstuff[k_tripleredshell] &= ~4;
else if (target->type == MT_TRIPLEBANANASHIELD1 && target->target->player->kartstuff[k_triplebanana] & 1)
target->target->player->kartstuff[k_triplebanana] &= ~1;
else if (target->type == MT_TRIPLEBANANASHIELD2 && target->target->player->kartstuff[k_triplebanana] & 2)
target->target->player->kartstuff[k_triplebanana] &= ~2;
else if (target->type == MT_TRIPLEBANANASHIELD3 && target->target->player->kartstuff[k_triplebanana] & 4)
target->target->player->kartstuff[k_triplebanana] &= ~4;
/*else if (target->type == MT_BATTLEBALLOON && target->target->player->kartstuff[k_balloon] > target->threshold-1)
target->target->player->kartstuff[k_balloon] = target->threshold-1;*/
}
//
if (!useNightsSS && G_IsSpecialStage(gamemap) && target->player && sstimer > 6)
sstimer = 6; // Just let P_Ticker take care of the rest.
@ -2056,14 +2186,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
// SRB2kart
if (target->type != MT_PLAYER && !(target->flags & MF_MONITOR)
&& !(target->type == MT_GREENITEM || target->type == MT_GREENSHIELD
|| target->type == MT_TRIPLEGREENSHIELD1 || target->type == MT_TRIPLEGREENSHIELD2 || target->type == MT_TRIPLEGREENSHIELD3
|| target->type == MT_REDITEM || target->type == MT_REDITEMDUD || target->type == MT_REDSHIELD
|| target->type == MT_TRIPLEREDSHIELD1 || target->type == MT_TRIPLEREDSHIELD2 || target->type == MT_TRIPLEREDSHIELD3
|| target->type == MT_BANANAITEM || target->type == MT_BANANASHIELD
|| target->type == MT_TRIPLEBANANASHIELD1 || target->type == MT_TRIPLEBANANASHIELD2 || target->type == MT_TRIPLEBANANASHIELD3
&& !(target->type == MT_ORBINAUT || target->type == MT_ORBINAUT_SHIELD
|| target->type == MT_JAWZ || target->type == MT_JAWZ_DUD || target->type == MT_JAWZ_SHIELD
|| target->type == MT_BANANA || target->type == MT_BANANA_SHIELD
|| target->type == MT_FAKEITEM || target->type == MT_FAKESHIELD
|| target->type == MT_FIREBALL)) // kart dead items
|| target->type == MT_BALLHOG)) // kart dead items
target->flags |= MF_NOGRAVITY; // Don't drop Tails 03-08-2000
else
target->flags &= ~MF_NOGRAVITY; // lose it if you for whatever reason have it, I'm looking at you shields
@ -2082,6 +2209,49 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
return;
#endif
// SRB2kart
// I wish I knew a better way to do this
if (target->target && target->target->player && target->target->player->mo)
{
if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_FAKESHIELD)
target->target->player->kartstuff[k_eggmanheld] = 0;
if (target->target->player->kartstuff[k_itemheld])
{
if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) // trail items
|| (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))
{
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
{
if (target->target->hnext)
K_KillBananaChain(target->target->hnext, inflictor, source);
target->target->player->kartstuff[k_itemamount] = 0;
}
else
target->target->player->kartstuff[k_itemamount]--;
}
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items
|| (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ))
{
target->target->player->kartstuff[k_itemamount]--;
if (target->lastlook != 0)
{
K_RepairOrbitChain(target);
}
}
if (target->target->player->kartstuff[k_itemamount] < 0)
target->target->player->kartstuff[k_itemamount] = 0;
if (!target->target->player->kartstuff[k_itemamount])
target->target->player->kartstuff[k_itemheld] = 0;
if (target->target->hnext == target)
P_SetTarget(&target->target->hnext, NULL);
}
}
//
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
if (target->player && !target->player->spectator)
{
@ -2197,7 +2367,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
target->flags &= ~(MF_SOLID|MF_SHOOTABLE); // does not block
P_UnsetThingPosition(target);
target->flags |= MF_NOBLOCKMAP;
target->flags |= MF_NOBLOCKMAP|MF_NOCLIPHEIGHT;
P_SetThingPosition(target);
if (!target->player->bot && !G_IsSpecialStage(gamemap)
@ -2272,9 +2442,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
}
}
else if (G_BattleGametype())
{
K_CheckBalloons();
}
K_CheckBumpers();
target->player->kartstuff[k_pogospring] = 0;
}
if (source && target && target->player && source->player)
@ -2586,7 +2756,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
target->momy = FixedMul(FINESINE(fa),target->target->radius);
}
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
P_SetMobjState(target->tracer, S_NIGHTSHURT1);
S_StartSound(target, sfx_nghurt);
@ -2773,14 +2943,22 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] > 0)
if (player->kartstuff[k_bumper] > 0)
{
if (player->kartstuff[k_balloon] == 1)
CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]);
player->kartstuff[k_balloon]--;
if (player->kartstuff[k_bumper] == 1)
{
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, player->mo);
karmahitbox->destscale = player->mo->scale;
P_SetScale(karmahitbox, player->mo->scale);
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
}
player->kartstuff[k_bumper]--;
if (K_IsPlayerWanted(player))
K_CalculateBattleWanted();
}
K_CheckBalloons();
K_CheckBumpers();
}
}
@ -2907,6 +3085,8 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
{
//const UINT8 scoremultiply = ((K_IsWantedPlayer(player) && !trapitem) : 2 ? 1);
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
{
P_DoPlayerPain(player, source, inflictor);
@ -2917,11 +3097,11 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
S_StartSound(player->mo, sfx_spkdth);
}
if (source && source->player && !player->powers[pw_super]) //don't score points against super players
/*if (source && source->player && !player->powers[pw_super]) //don't score points against super players
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 1);
P_AddPlayerScore(source->player, scoremultiply);
}
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
@ -2931,9 +3111,9 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 1);
P_AddPlayerScore(source->player, scoremultiply);
}
}
}*/
// Ring loss sound plays despite hitting spikes
P_PlayRinglossSound(player->mo); // Ringledingle!
@ -2964,7 +3144,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
#else
static const boolean force = false;
#endif
mobj_t *blueexplode;
if (objectplacing)
return false;
@ -3124,42 +3303,57 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
//{ SRB2kart - special damage sources
player->kartstuff[k_mushroomtimer] = 0;
// Thunder
// Shrink
if (damage == 64)
{
if (player == source->player)
return false;
// Don't flip out while super!
if (!player->kartstuff[k_startimer] && player->kartstuff[k_growshrinktimer] <= 0)
if (!player->kartstuff[k_invincibilitytimer] && player->kartstuff[k_growshrinktimer] <= 0)
{
// Start slipping!
K_SpinPlayer(player, source);
// Start shrinking!
player->mo->scalespeed = FRACUNIT/TICRATE;
player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8;
player->kartstuff[k_growshrinktimer] -= (100+20*(16-(player->kartstuff[k_position])));
if (cv_kartdebugshrink.value && !player->bot)
player->mo->destscale = 6*player->mo->destscale/8;
// Wipeout
K_SpinPlayer(player, source, 1, false);
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
P_PlayerRingBurst(player, 5);
player->mo->momx = player->mo->momy = 0;
if (P_IsLocalPlayer(player))
{
quake.intensity = 32*FRACUNIT;
quake.time = 5;
}
K_StripItems(player);
player->kartstuff[k_growshrinktimer] -= (200+(40*(16-player->kartstuff[k_position])));
}
// Mega Mushroom? Let's take that away.
// Grow? Let's take that away.
if (player->kartstuff[k_growshrinktimer] > 0)
{
player->kartstuff[k_growshrinktimer] = 2;
}
player->kartstuff[k_sneakertimer] = 0;
// Invincible or not, we still need this.
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING);
//P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING);
S_StartSound(player->mo, sfx_kc59);
return true;
}
// Blue Thunder
// 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);
blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
P_SetTarget(&blueexplode->target, source);
//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;
}
//}
@ -3185,23 +3379,22 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Instant-Death
if (damage == 10000)
P_KillPlayer(player, source, damage);
else if (player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->powers[pw_flashing])
else if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->powers[pw_flashing])
{
K_DoInstashield(player);
return false;
}
else
{
if (inflictor && (inflictor->type == MT_GREENITEM || inflictor->type == MT_GREENSHIELD
|| inflictor->type == MT_REDITEM || inflictor->type == MT_REDSHIELD || inflictor->type == MT_REDITEMDUD
|| inflictor->type == MT_FAKEITEM || inflictor->type == MT_FAKESHIELD
|| inflictor->type == MT_TRIPLEGREENSHIELD1 || inflictor->type == MT_TRIPLEGREENSHIELD2 || inflictor->type == MT_TRIPLEGREENSHIELD3
|| inflictor->type == MT_TRIPLEREDSHIELD1 || inflictor->type == MT_TRIPLEREDSHIELD2 || inflictor->type == MT_TRIPLEREDSHIELD3
if (inflictor && (inflictor->type == MT_ORBINAUT || inflictor->type == MT_ORBINAUT_SHIELD
|| inflictor->type == MT_JAWZ || inflictor->type == MT_JAWZ_SHIELD || inflictor->type == MT_JAWZ_DUD
|| inflictor->player))
{
player->kartstuff[k_spinouttype] = 1;
K_SpinPlayer(player, source);
player->kartstuff[k_sneakertimer] = 0;
K_SpinPlayer(player, source, 1, false);
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
P_PlayerRingBurst(player, 5);
player->mo->momx = player->mo->momy = 0;
if (P_IsLocalPlayer(player))
{
quake.intensity = 32*FRACUNIT;
@ -3210,8 +3403,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
}
else
{
player->kartstuff[k_spinouttype] = -1;
K_SpinPlayer(player, source);
K_SpinPlayer(player, source, 0, false);
}
return true;
}
@ -3304,7 +3496,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
player->health -= damage; // mirror mobj health here
if (damage < 10000)
{
target->player->powers[pw_flashing] = K_GetKartFlashing();
target->player->powers[pw_flashing] = K_GetKartFlashing(target->player);
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
P_PlayerRingBurst(player, damage);
}
@ -3362,22 +3554,25 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
break;
}
target->reactiontime = 0; // we're awake now...
if (source && source != target)
if (!P_MobjWasRemoved(target))
{
// if not intent on another player,
// chase after this one
P_SetTarget(&target->target, source);
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
target->reactiontime = 0; // we're awake now...
if (source && source != target)
{
if (player)
// if not intent on another player,
// chase after this one
P_SetTarget(&target->target, source);
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
{
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
P_SetPlayerMobjState(target, target->info->seestate);
if (player)
{
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
P_SetPlayerMobjState(target, target->info->seestate);
}
else
P_SetMobjState(target, target->info->seestate);
}
else
P_SetMobjState(target, target->info->seestate);
}
}

View file

@ -25,7 +25,7 @@
#define FLOATSPEED (FRACUNIT*4)
#define VIEWHEIGHTS "41"
//#define VIEWHEIGHTS "41"
// Maximum player score.
#define MAXSCORE 999999990
@ -150,6 +150,7 @@ boolean P_InQuicksand(mobj_t *mo);
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
void P_RestoreMusic(player_t *player);
boolean P_EndingMusic(player_t *player);
void P_SpawnShieldOrb(player_t *player);
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
void P_GivePlayerRings(player_t *player, INT32 num_rings);
@ -167,6 +168,7 @@ void P_ElementalFireTrail(player_t *player);
void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player);
void P_DoPlayerExit(player_t *player);
void P_DoTimeOver(player_t *player);
void P_NightserizePlayer(player_t *player, INT32 ptime);
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
@ -177,12 +179,13 @@ void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
boolean P_LookForEnemies(player_t *player);
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
boolean P_SuperReady(player_t *player);
//boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player);
boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void);
UINT8 P_FindLowestLap(void);
UINT8 P_FindHighestLap(void);
void P_FindEmerald(void);
void P_TransferToAxis(player_t *player, INT32 axisnum);
boolean P_PlayerMoving(INT32 pnum);
@ -191,9 +194,9 @@ void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range);
void P_PlayLivesJingle(player_t *player);
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
#define P_PlayDeathSound(s) S_StartSound(s, sfx_altdi1 + P_RandomKey(4));
#define P_PlayVictorySound(s) S_StartSound(s, sfx_victr1 + P_RandomKey(4));
void P_PlayRinglossSound(mobj_t *source);
void P_PlayDeathSound(mobj_t *source);
void P_PlayVictorySound(mobj_t *source);
//
@ -209,7 +212,7 @@ void P_PlayLivesJingle(player_t *player);
extern mapthing_t *itemrespawnque[ITEMQUESIZE];
extern tic_t itemrespawntime[ITEMQUESIZE];
extern size_t iquehead, iquetail;
extern consvar_t cv_gravity, cv_viewheight;
extern consvar_t cv_gravity/*, cv_viewheight*/;
void P_RespawnSpecials(void);
@ -338,6 +341,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
boolean P_Move(mobj_t *actor, fixed_t speed);
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
void P_SlideMove(mobj_t *mo, boolean forceslide);
void P_BouncePlayerMove(mobj_t *mo);
void P_BounceMove(mobj_t *mo);
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);
@ -405,7 +409,7 @@ boolean P_CheckRacers(void);
void P_ClearStarPost(INT32 postnum);
void P_ResetStarposts(void);
boolean P_CanPickupItem(player_t *player, boolean weapon);
boolean P_CanPickupItem(player_t *player, UINT8 weapon);
void P_DoNightsScore(player_t *player);
//

View file

@ -116,6 +116,8 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z)
boolean P_DoSpring(mobj_t *spring, mobj_t *object)
{
//INT32 pflags;
const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - object->scale);
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (object->scale - mapheaderinfo[gamemap-1]->mobj_scale);
fixed_t offx, offy;
fixed_t vertispeed = spring->info->mass;
fixed_t horizspeed = spring->info->damage;
@ -178,12 +180,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
}
if (vertispeed)
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(object->scale, spring->scale)));
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale)));
if (horizspeed)
{
if (!object->player)
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(object->scale, spring->scale))));
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
else
{
fixed_t finalSpeed = horizspeed;
@ -192,7 +194,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (pSpeed > finalSpeed)
finalSpeed = pSpeed;
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(object->scale, spring->scale))));
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
}
}
@ -308,7 +310,17 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (spring->state != &states[S_STEAM1]) // Only when it bursts
break;
object->momz = flipval*FixedMul(speed, FixedSqrt(FixedMul(spring->scale, object->scale))); // scale the speed with both objects' scales, just like with springs!
if (spring->spawnpoint && spring->spawnpoint->options & MTF_OBJECTSPECIAL)
{
if (object->eflags & MFE_SPRUNG)
break;
if (object->player)
object->player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(object, 0, true);
return;
}
else
object->momz = flipval*FixedMul(speed, FixedSqrt(FixedMul(spring->scale, object->scale))); // scale the speed with both objects' scales, just like with springs!
/* // SRB2kart - don't need state change
if (p)
@ -655,10 +667,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->type == MT_RANDOMITEM)
return true;
if (tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD ||
tmthing->type == MT_GREENSHIELD || tmthing->type == MT_REDSHIELD ||
tmthing->type == MT_TRIPLEGREENSHIELD1 || tmthing->type == MT_TRIPLEGREENSHIELD2 || tmthing->type == MT_TRIPLEGREENSHIELD3 ||
tmthing->type == MT_TRIPLEREDSHIELD1 || tmthing->type == MT_TRIPLEREDSHIELD2 || tmthing->type == MT_TRIPLEREDSHIELD3)
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD
|| tmthing->type == MT_ORBINAUT_SHIELD || tmthing->type == MT_JAWZ_SHIELD)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -672,23 +682,22 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->health <= 0 || thing->health <= 0)
return true;
if (((tmthing->type == MT_TRIPLEGREENSHIELD1 || tmthing->type == MT_TRIPLEGREENSHIELD2 || tmthing->type == MT_TRIPLEGREENSHIELD3
|| tmthing->type == MT_TRIPLEREDSHIELD1 || tmthing->type == MT_TRIPLEREDSHIELD2 || tmthing->type == MT_TRIPLEREDSHIELD3)
&& (thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3))
if ((tmthing->type == MT_ORBINAUT_SHIELD || tmthing->type == MT_JAWZ_SHIELD) && tmthing->lastlook
&& (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD) && thing->lastlook
&& (tmthing->target == thing->target)) // Don't hit each other if you have the same target
return true;
if (thing->player && thing->player->powers[pw_flashing]
&& !(tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD))
&& !(tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD))
return true;
if (thing->type == MT_PLAYER)
{
// Player Damage
P_DamageMobj(thing, tmthing, tmthing->target, 1);
K_KartBouncing(thing, tmthing, false, false);
if (tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD)
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
S_StartSound(thing, sfx_shelit);
// This Item Damage
@ -703,13 +712,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_GREENSHIELD || thing->type == MT_REDSHIELD
|| thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3
|| thing->type == MT_BANANAITEM || thing->type == MT_BANANASHIELD
|| thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3
|| thing->type == MT_FIREBALL)
else if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|| thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD
|| thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD
|| thing->type == MT_BALLHOG)
{
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
@ -737,40 +743,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
{
if (tmthing->type == MT_GREENSHIELD || tmthing->type == MT_REDSHIELD
|| tmthing->type == MT_TRIPLEGREENSHIELD1 || tmthing->type == MT_TRIPLEGREENSHIELD2 || tmthing->type == MT_TRIPLEGREENSHIELD3
|| tmthing->type == MT_TRIPLEREDSHIELD1 || tmthing->type == MT_TRIPLEREDSHIELD2 || tmthing->type == MT_TRIPLEREDSHIELD3)
{
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
tmthing->z -= tmthing->height;
else
tmthing->z += tmthing->height;
S_StartSound(tmthing, tmthing->info->deathsound);
P_KillMobj(tmthing, thing, thing);
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH);
}
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
thing->z -= thing->height;
else
thing->z += thing->height;
S_StartSound(thing, thing->info->deathsound);
P_KillMobj(thing, tmthing, tmthing);
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM)
else if (thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE)
{
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
@ -787,12 +760,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
// Bomb death
P_KillMobj(thing, tmthing, tmthing);
}
else if (thing->flags & MF_SPRING && (tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD || tmthing->type == MT_GREENITEM))
else if (thing->flags & MF_SPRING && (tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD || tmthing->type == MT_ORBINAUT))
P_DoSpring(thing, tmthing);
return true;
}
else if (tmthing->flags & MF_SPRING && (thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD || thing->type == MT_GREENITEM))
else if (tmthing->flags & MF_SPRING && (thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_ORBINAUT))
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -834,7 +807,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
else if (tmthing->type == MT_BOMBEXPLOSION)
else if (tmthing->type == MT_MINEEXPLOSION)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -850,17 +823,16 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->type == MT_PLAYER && thing->player)
{
if (tmthing->state == &states[S_BOMBEXPLOSION1])
if (tmthing->state == &states[S_MINEEXPLOSION1])
K_ExplodePlayer(thing->player, tmthing->target);
else
K_SpinPlayer(thing->player, tmthing->target);
K_SpinPlayer(thing->player, tmthing->target, 0, false);
}
return true; // This doesn't collide with anything, but we want it to effect the player anyway.
}
else if (tmthing->type == MT_BANANASHIELD || tmthing->type == MT_BANANAITEM
|| tmthing->type == MT_TRIPLEBANANASHIELD1 || tmthing->type == MT_TRIPLEBANANASHIELD2 || tmthing->type == MT_TRIPLEBANANASHIELD3
|| tmthing->type == MT_FIREBALL)
else if (tmthing->type == MT_BANANA_SHIELD || tmthing->type == MT_BANANA
|| tmthing->type == MT_BALLHOG)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -874,13 +846,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->health <= 0 || thing->health <= 0)
return true;
if (((tmthing->type == MT_BANANASHIELD || tmthing->type == MT_TRIPLEBANANASHIELD1 || tmthing->type == MT_TRIPLEBANANASHIELD2 || tmthing->type == MT_TRIPLEBANANASHIELD3)
&& (thing->type == MT_BANANASHIELD || thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3))
if (((tmthing->type == MT_BANANA_SHIELD) && (thing->type == MT_BANANA_SHIELD))
&& (tmthing->target == thing->target)) // Don't hit each other if you have the same target
return true;
if (tmthing->type == MT_FIREBALL && thing->type == MT_FIREBALL)
return true; // Fireballs don't collide with eachother
if (tmthing->type == MT_BALLHOG && thing->type == MT_BALLHOG)
return true; // Ballhogs don't collide with eachother
if (thing->player && thing->player->powers[pw_flashing])
return true;
@ -888,7 +859,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->type == MT_PLAYER)
{
// Player Damage
K_SpinPlayer(thing->player, tmthing->target);
K_SpinPlayer(thing->player, tmthing->target, 0, (tmthing->type == MT_BANANA || tmthing->type == MT_BANANA_SHIELD));
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
@ -902,12 +873,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_BANANASHIELD || thing->type == MT_BANANAITEM
|| thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3
|| thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_GREENSHIELD || thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_REDSHIELD || thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3
|| thing->type == MT_FIREBALL)
else if (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD
|| thing->type == MT_ORBINAUT || thing->type == MT_ORBINAUT_SHIELD
|| thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_JAWZ_SHIELD
|| thing->type == MT_BALLHOG)
{
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
@ -935,126 +904,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
{
if (tmthing->type == MT_BANANASHIELD || tmthing->type == MT_TRIPLEBANANASHIELD1 || tmthing->type == MT_TRIPLEBANANASHIELD2 || tmthing->type == MT_TRIPLEBANANASHIELD3)
{
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
tmthing->z -= tmthing->height;
else
tmthing->z += tmthing->height;
S_StartSound(tmthing, tmthing->info->deathsound);
P_KillMobj(tmthing, thing, thing);
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH);
}
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
thing->z -= thing->height;
else
thing->z += thing->height;
S_StartSound(thing, thing->info->deathsound);
P_KillMobj(thing, tmthing, tmthing);
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
}
return true;
}
else if (tmthing->type == MT_FAKESHIELD || tmthing->type == MT_FAKEITEM)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
return true;
if (tmthing->health <= 0 || thing->health <= 0)
return true;
if (thing->player && thing->player->powers[pw_flashing])
return true;
if (thing->type == MT_GREENITEM // When these items collide with the fake item, just the fake item is destroyed
|| thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_BOMBITEM
|| thing->type == MT_BANANAITEM || thing->type == MT_FIREBALL)
{
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
tmthing->z -= tmthing->height;
else
tmthing->z += tmthing->height;
S_StartSound(tmthing, tmthing->info->deathsound);
P_KillMobj(tmthing, thing, thing);
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_GREENSHIELD || thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3 // When these items collide with the fake item, both of them are destroyed
|| thing->type == MT_REDSHIELD || thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3
|| thing->type == MT_BOMBSHIELD
|| thing->type == MT_BANANASHIELD || thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3
|| thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
{
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
thing->z -= thing->height;
else
thing->z += thing->height;
S_StartSound(thing, thing->info->deathsound);
P_KillMobj(thing, tmthing, tmthing);
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH);
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
tmthing->z -= tmthing->height;
else
tmthing->z += tmthing->height;
S_StartSound(tmthing, tmthing->info->deathsound);
P_KillMobj(tmthing, thing, thing);
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_PLAYER)
{
// Player Damage
P_DamageMobj(thing, tmthing, tmthing->target, 1);
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
tmthing->z -= tmthing->height;
else
tmthing->z += tmthing->height;
S_StartSound(tmthing, tmthing->info->deathsound);
P_KillMobj(tmthing, thing, thing);
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
}
return true;
}
else if (tmthing->type == MT_BOMBSHIELD || tmthing->type == MT_BOMBITEM)
else if (tmthing->type == MT_SSMINE_SHIELD || tmthing->type == MT_SSMINE)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
@ -1075,9 +928,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
P_KillMobj(tmthing, thing, thing);
}
else if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_GREENSHIELD || thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_REDSHIELD || thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3)
else if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|| thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD)
{
P_KillMobj(tmthing, thing, thing);
@ -1097,16 +949,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
else if (tmthing->type == MT_PLAYER &&
(thing->type == MT_GREENSHIELD || thing->type == MT_GREENITEM
|| thing->type == MT_REDSHIELD || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3
|| thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM
|| thing->type == MT_BANANASHIELD || thing->type == MT_BANANAITEM
|| thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3
|| thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM
|| thing->type == MT_BOMBEXPLOSION
|| thing->type == MT_SINK || thing->type == MT_FIREBALL
(thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_ORBINAUT
|| thing->type == MT_JAWZ_SHIELD || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|| thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA
|| thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE
|| thing->type == MT_MINEEXPLOSION
|| thing->type == MT_SINK || thing->type == MT_BALLHOG
))
{
// see if it went over / under
@ -1116,13 +964,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; // underneath
if (tmthing->player && tmthing->player->powers[pw_flashing]
&& !(thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD))
&& !(thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD))
return true;
if (thing->type == MT_GREENSHIELD || thing->type == MT_TRIPLEGREENSHIELD1 || thing->type == MT_TRIPLEGREENSHIELD2 || thing->type == MT_TRIPLEGREENSHIELD3
|| thing->type == MT_REDSHIELD || thing->type == MT_TRIPLEREDSHIELD1 || thing->type == MT_TRIPLEREDSHIELD2 || thing->type == MT_TRIPLEREDSHIELD3
|| thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD
|| thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM)
if (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD
|| thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
{
if ((thing->target == tmthing) && (thing->threshold > 0))
return true;
@ -1132,8 +978,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
// Player Damage
P_DamageMobj(tmthing, thing, thing->target, 1);
K_KartBouncing(tmthing, thing, false, false);
if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD)
if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
S_StartSound(tmthing, sfx_shelit);
// Other Item Damage
@ -1148,9 +995,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_BANANASHIELD || thing->type == MT_BANANAITEM
|| thing->type == MT_TRIPLEBANANASHIELD1 || thing->type == MT_TRIPLEBANANASHIELD2 || thing->type == MT_TRIPLEBANANASHIELD3
|| thing->type == MT_FIREBALL)
else if (thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA
|| thing->type == MT_BALLHOG)
{
if ((thing->target == tmthing) && (thing->threshold > 0))
return true;
@ -1159,7 +1005,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// Player Damage
K_SpinPlayer(tmthing->player, thing->target);
K_SpinPlayer(tmthing->player, thing->target, 0, (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD));
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
@ -1173,7 +1019,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
}
else if (thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM)
else if (thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE)
{
if ((thing->target == tmthing) && (thing->threshold > 0))
return true;
@ -1183,13 +1029,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing);
}
else if (thing->type == MT_BOMBEXPLOSION && tmthing->player)
else if (thing->type == MT_MINEEXPLOSION && tmthing->player)
{
// Player Damage
if (thing->state == &states[S_BOMBEXPLOSION1])
if (thing->state == &states[S_MINEEXPLOSION1])
K_ExplodePlayer(tmthing->player, thing->target);
else
K_SpinPlayer(tmthing->player, thing->target);
K_SpinPlayer(tmthing->player, thing->target, 0, false);
return true;
}
@ -1543,21 +1389,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& !(thing->z + thing->height < tmthing->z || thing->z > tmthing->z + tmthing->height))
{
// SRB2kart - Squish!
if ((tmthing->player->kartstuff[k_growshrinktimer] > 0 && thing->player->kartstuff[k_growshrinktimer] <= 0)
|| (tmthing->player->kartstuff[k_growshrinktimer] == 0 && thing->player->kartstuff[k_growshrinktimer] < 0))
{
if (tmthing->scale > thing->scale + (FRACUNIT/8))
K_SquishPlayer(thing->player, tmthing);
}
else if ((thing->player->kartstuff[k_growshrinktimer] > 0 && tmthing->player->kartstuff[k_growshrinktimer] <= 0)
|| (thing->player->kartstuff[k_growshrinktimer] == 0 && tmthing->player->kartstuff[k_growshrinktimer] < 0))
{
else if (thing->scale > tmthing->scale + (FRACUNIT/8))
K_SquishPlayer(tmthing->player, thing);
}
// SRB2kart - Starpower!
if (tmthing->player->kartstuff[k_startimer] && !thing->player->kartstuff[k_startimer])
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(thing, tmthing, tmthing, 1);
else if (thing->player->kartstuff[k_startimer] && !tmthing->player->kartstuff[k_startimer])
else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(tmthing, thing, thing, 1);
if (G_BattleGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
@ -1649,107 +1489,32 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer]
|| thing->player->kartstuff[k_bootimer] || thing->player->kartstuff[k_spinouttimer]
|| thing->player->kartstuff[k_startimer] || thing->player->kartstuff[k_justbumped]
|| (G_BattleGametype() && (thing->player->kartstuff[k_balloon] <= 0
&& (thing->player->kartstuff[k_comebacktimer])))
|| tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer]
|| tmthing->player->kartstuff[k_bootimer] || tmthing->player->kartstuff[k_spinouttimer]
|| tmthing->player->kartstuff[k_startimer] || tmthing->player->kartstuff[k_justbumped]
|| (G_BattleGametype() && (tmthing->player->kartstuff[k_balloon] <= 0
&& (tmthing->player->kartstuff[k_comebacktimer]))))
if (thing->player->kartstuff[k_squishedtimer] || thing->player->kartstuff[k_hyudorotimer]
|| thing->player->kartstuff[k_justbumped] || thing->scale > tmthing->scale + (FRACUNIT/8)
|| (G_BattleGametype() && thing->player->kartstuff[k_bumper] <= 0)
|| tmthing->player->kartstuff[k_squishedtimer] || tmthing->player->kartstuff[k_hyudorotimer]
|| tmthing->player->kartstuff[k_justbumped] || tmthing->scale > thing->scale + (FRACUNIT/8)
|| (G_BattleGametype() && tmthing->player->kartstuff[k_bumper] <= 0))
{
return true;
}
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_balloon] <= 0 || tmthing->player->kartstuff[k_balloon] <= 0)
{
if (thing->player->kartstuff[k_comebackmode] == 0
&& (tmthing->player->kartstuff[k_balloon] > 0
&& !tmthing->player->powers[pw_flashing]))
{
mobj_t *boom = P_SpawnMobj(thing->x, thing->y, thing->z, MT_BOOMPARTICLE);
boom->scale = thing->scale;
boom->destscale = thing->scale;
boom->momz = 5*FRACUNIT;
if (thing->player->skincolor)
boom->color = thing->player->skincolor;
else
boom->color = SKINCOLOR_RED;
S_StartSound(boom, sfx_s3k4e);
K_ExplodePlayer(tmthing->player, thing);
thing->player->kartstuff[k_comebacktimer] = comebacktime;
return true;
}
else if (tmthing->player->kartstuff[k_comebackmode] == 0
&& (thing->player->kartstuff[k_balloon] > 0
&& !thing->player->powers[pw_flashing]))
{
mobj_t *boom = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_BOOMPARTICLE);
boom->scale = tmthing->scale;
boom->destscale = tmthing->scale;
boom->momz = 5*FRACUNIT;
if (tmthing->player->skincolor)
boom->color = tmthing->player->skincolor;
else
boom->color = SKINCOLOR_RED;
S_StartSound(boom, sfx_s3k4e);
K_ExplodePlayer(thing->player, tmthing);
tmthing->player->kartstuff[k_comebacktimer] = comebacktime;
return true;
}
else if (thing->player->kartstuff[k_comebackmode] == 1
&& (tmthing->player->kartstuff[k_balloon] > 0
&& P_CanPickupItem(tmthing->player, true)))
{
thing->player->kartstuff[k_comebackmode] = 0;
thing->player->kartstuff[k_comebackpoints]++;
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[thing->player-players], player_names[tmthing->player-players]);
tmthing->player->kartstuff[k_itemroulette] = 1;
tmthing->player->kartstuff[k_roulettetype] = 1;
if (thing->player->kartstuff[k_comebackpoints] >= 3)
K_StealBalloon(thing->player, tmthing->player, true);
thing->player->kartstuff[k_comebacktimer] = comebacktime;
return true;
}
else if (tmthing->player->kartstuff[k_comebackmode] == 1
&& (thing->player->kartstuff[k_balloon] > 0
&& P_CanPickupItem(thing->player, true)))
{
tmthing->player->kartstuff[k_comebackmode] = 0;
tmthing->player->kartstuff[k_comebackpoints]++;
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[tmthing->player-players], player_names[thing->player-players]);
thing->player->kartstuff[k_itemroulette] = 1;
thing->player->kartstuff[k_roulettetype] = 1;
if (tmthing->player->kartstuff[k_comebackpoints] >= 3)
K_StealBalloon(tmthing->player, thing->player, true);
tmthing->player->kartstuff[k_comebacktimer] = comebacktime;
return true;
}
}
}
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true, false);
if (G_BattleGametype() && tmthing->player->kartstuff[k_feather] & 2)
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBalloon(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing);
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);
}
}
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true, false);
if (G_BattleGametype() && thing->player->kartstuff[k_feather] & 2)
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBalloon(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing);
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, false);
}
}
else
@ -1757,15 +1522,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_mushroomtimer] && !(tmthing->player->kartstuff[k_mushroomtimer]))
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]))
{
K_StealBalloon(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing);
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, false);
}
else if (tmthing->player->kartstuff[k_mushroomtimer] && !(thing->player->kartstuff[k_mushroomtimer]))
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]))
{
K_StealBalloon(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing);
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);
}
}
@ -2608,10 +2373,13 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
fixed_t tryx = thiscam->x;
fixed_t tryy = thiscam->y;
#ifndef NOCLIPCAM
if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)))
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP))
|| (leveltime < introtime))
#endif
{ // Noclipping player camera noclips too!!
floatok = true;
thiscam->floorz = thiscam->z;
@ -3229,11 +2997,11 @@ static void P_HitSlideLine(line_t *ld)
}
//
// P_HitBounceLine
// P_PlayerHitBounceLine
//
// Adjusts the xmove / ymove so that the next move will bounce off the wall.
// HitBounceLine, for players
//
static void P_HitBounceLine(line_t *ld)
static void P_PlayerHitBounceLine(line_t *ld)
{
INT32 side;
angle_t lineangle;
@ -3256,6 +3024,47 @@ static void P_HitBounceLine(line_t *ld)
tmymove += FixedMul(movelen, FINESINE(lineangle));
}
//
// P_HitBounceLine
//
// Adjusts the xmove / ymove so that the next move will bounce off the wall.
//
static void P_HitBounceLine(line_t *ld)
{
angle_t lineangle, moveangle, deltaangle;
fixed_t movelen;
if (ld->slopetype == ST_HORIZONTAL)
{
tmymove = -tmymove;
return;
}
if (ld->slopetype == ST_VERTICAL)
{
tmxmove = -tmxmove;
return;
}
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
if (lineangle >= ANGLE_180)
lineangle -= ANGLE_180;
moveangle = R_PointToAngle2(0, 0, tmxmove, tmymove);
deltaangle = moveangle + 2*(lineangle - moveangle);
lineangle >>= ANGLETOFINESHIFT;
deltaangle >>= ANGLETOFINESHIFT;
movelen = P_AproxDistance(tmxmove, tmymove);
tmxmove = FixedMul(movelen, FINECOSINE(deltaangle));
tmymove = FixedMul(movelen, FINESINE(deltaangle));
deltaangle = R_PointToAngle2(0, 0, tmxmove, tmymove);
}
//
// PTR_SlideCameraTraverse
//
@ -3874,41 +3683,35 @@ stairstep:
}
//
// P_BounceMove
// P_BouncePlayerMove
//
// The momx / momy move is bad, so try to bounce off a wall.
// Bounce move, for players.
//
void P_BounceMove(mobj_t *mo)
void P_BouncePlayerMove(mobj_t *mo)
{
fixed_t leadx, leady;
fixed_t trailx, traily;
//fixed_t newx, newy;
//INT32 hitcount;
fixed_t mmomx = 0, mmomy = 0;
if (mo->eflags & MFE_JUSTBOUNCEDWALL)
if (!mo->player)
return;
if ((mo->eflags & MFE_JUSTBOUNCEDWALL) || (mo->player->spectator))
{
P_SlideMove(mo, true);
return;
}
slidemo = mo;
//hitcount = 0;
/*retry:
if (++hitcount == 3)
goto bounceback; // don't loop forever*/
mmomx = mo->player->rmomx;
mmomy = mo->player->rmomy;
if (mo->player)
if (mo->player->kartstuff[k_drift] != 0) // SRB2kart
{
mmomx = mo->player->rmomx;
mmomy = mo->player->rmomy;
if (mo->player->kartstuff[k_drift] != 0) // SRB2kart
{
mo->player->kartstuff[k_drift] = 0;
mo->player->kartstuff[k_driftcharge] = 0;
}
mo->player->kartstuff[k_drift] = 0;
mo->player->kartstuff[k_driftcharge] = 0;
}
else
{
@ -3945,8 +3748,107 @@ void P_BounceMove(mobj_t *mo)
P_PathTraverse(trailx, leady, trailx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse);
P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse);
// Now continue along the wall.
// First calculate remainder.
bestslidefrac = FRACUNIT - bestslidefrac;
if (bestslidefrac > FRACUNIT)
bestslidefrac = FRACUNIT;
if (bestslidefrac <= 0)
return;
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
{
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
if (mo->eflags & MFE_VERTICALFLIP)
fx->eflags |= MFE_VERTICALFLIP;
else
fx->eflags &= ~MFE_VERTICALFLIP;
fx->scale = mo->scale;
S_StartSound(mo, sfx_s3k49);
}
P_PlayerHitBounceLine(bestslideline);
mo->eflags |= MFE_JUSTBOUNCEDWALL;
mo->momx = tmxmove;
mo->momy = tmymove;
mo->player->cmomx = tmxmove;
mo->player->cmomy = tmymove;
P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true);
}
//
// P_BounceMove
//
// The momx / momy move is bad, so try to bounce off a wall.
//
void P_BounceMove(mobj_t *mo)
{
fixed_t leadx, leady;
fixed_t trailx, traily;
fixed_t newx, newy;
INT32 hitcount;
fixed_t mmomx = 0, mmomy = 0;
if (mo->eflags & MFE_JUSTBOUNCEDWALL)
{
P_SlideMove(mo, true);
return;
}
if (mo->player)
{
P_BouncePlayerMove(mo);
return;
}
slidemo = mo;
hitcount = 0;
retry:
if (++hitcount == 3)
goto bounceback; // don't loop forever
mmomx = mo->momx;
mmomy = mo->momy;
// trace along the three leading corners
if (mo->momx > 0)
{
leadx = mo->x + mo->radius;
trailx = mo->x - mo->radius;
}
else
{
leadx = mo->x - mo->radius;
trailx = mo->x + mo->radius;
}
if (mo->momy > 0)
{
leady = mo->y + mo->radius;
traily = mo->y - mo->radius;
}
else
{
leady = mo->y - mo->radius;
traily = mo->y + mo->radius;
}
bestslidefrac = FRACUNIT + 1;
P_PathTraverse(leadx, leady, leadx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse);
P_PathTraverse(trailx, leady, trailx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse);
P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse);
// move up to the wall
/*if (bestslidefrac == FRACUNIT + 1)
if (bestslidefrac == FRACUNIT + 1)
{
// the move must have hit the middle, so bounce straight back
bounceback:
@ -3956,22 +3858,12 @@ bounceback:
mo->momy *= -1;
mo->momx = FixedMul(mo->momx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
mo->momy = FixedMul(mo->momy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
if (mo->player)
{
mo->player->cmomx *= -1;
mo->player->cmomy *= -1;
mo->player->cmomx = FixedMul(mo->player->cmomx,
(FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
mo->player->cmomy = FixedMul(mo->player->cmomy,
(FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
}
}
return;
}*/
}
// fudge a bit to make sure it doesn't hit
/*bestslidefrac -= 0x800;
bestslidefrac -= 0x800;
if (bestslidefrac > 0)
{
newx = FixedMul(mmomx, bestslidefrac);
@ -3979,7 +3871,7 @@ bounceback:
if (!P_TryMove(mo, mo->x + newx, mo->y + newy, true))
goto bounceback;
}*/
}
// Now continue along the wall.
// First calculate remainder.
@ -4011,34 +3903,15 @@ bounceback:
{
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
if (mo->player)
{
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
if (mo->eflags & MFE_VERTICALFLIP)
fx->eflags |= MFE_VERTICALFLIP;
else
fx->eflags &= ~MFE_VERTICALFLIP;
fx->scale = mo->scale;
S_StartSound(mo, sfx_s3k49);
}
}
P_HitBounceLine(bestslideline);
mo->eflags |= MFE_JUSTBOUNCEDWALL;
P_HitBounceLine(bestslideline); // clip the moves
mo->momx = tmxmove;
mo->momy = tmymove;
if (mo->player)
{
mo->player->cmomx = tmxmove;
mo->player->cmomy = tmymove;
}
/*if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true))
goto retry;*/
P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true);
if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true))
goto retry;
}
//

File diff suppressed because it is too large Load diff

View file

@ -366,7 +366,7 @@ typedef struct mobj_s
struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
#endif
boolean colorized; // Whether the mobj uses the starman colormap
boolean colorized; // Whether the mobj uses the rainbow colormap
// WARNING: New fields must be added separately to savegame and Lua.
} mobj_t;

View file

@ -436,7 +436,7 @@ static void P_NetUnArchivePlayers(void)
if (flags & AWAYVIEW)
players[i].awayviewmobj = (mobj_t *)(size_t)READUINT32(save_p);
players[i].viewheight = cv_viewheight.value<<FRACBITS;
players[i].viewheight = 32<<FRACBITS;
//SetPlayerSkinByNum(i, players[i].skin);
players[i].charability = READUINT8(save_p);
@ -944,12 +944,11 @@ typedef enum
MD2_EXTVAL1 = 1<<5,
MD2_EXTVAL2 = 1<<6,
MD2_HNEXT = 1<<7,
#ifdef ESLOPE
MD2_HPREV = 1<<8,
#ifdef ESLOPE
MD2_SLOPE = 1<<9,
MD2_COLORIZED = 1<<10
#else
MD2_HPREV = 1<<8,
MD2_COLORIZED = 1<<9
#endif
} mobj_diff2_t;
@ -3213,7 +3212,10 @@ static void P_NetArchiveMisc(void)
WRITEINT16(save_p, lastmap);
for (i = 0; i < 4; i++)
WRITEINT16(save_p, votelevels[i]);
{
WRITEINT16(save_p, votelevels[i][0]);
WRITEINT16(save_p, votelevels[i][1]);
}
for (i = 0; i < MAXPLAYERS; i++)
WRITESINT8(save_p, votes[i]);
@ -3258,9 +3260,14 @@ static void P_NetArchiveMisc(void)
WRITEUINT8(save_p, franticitems);
WRITEUINT8(save_p, comeback);
WRITEUINT32(save_p, lightningcooldown);
WRITEUINT32(save_p, blueshellincoming);
WRITEUINT8(save_p, blueshellplayer);
for (i = 0; i < 4; i++)
WRITESINT8(save_p, battlewanted[i]);
WRITEUINT32(save_p, wantedcalcdelay);
WRITEUINT32(save_p, indirectitemcooldown);
WRITEUINT32(save_p, spbincoming);
WRITEUINT8(save_p, spbplayer);
WRITEUINT32(save_p, mapreset);
// Is it paused?
if (paused)
@ -3310,7 +3317,10 @@ static inline boolean P_NetUnArchiveMisc(void)
lastmap = READINT16(save_p);
for (i = 0; i < 4; i++)
votelevels[i] = READINT16(save_p);
{
votelevels[i][0] = READINT16(save_p);
votelevels[i][1] = READINT16(save_p);
}
for (i = 0; i < MAXPLAYERS; i++)
votes[i] = READSINT8(save_p);
@ -3355,9 +3365,14 @@ static inline boolean P_NetUnArchiveMisc(void)
franticitems = (boolean)READUINT8(save_p);
comeback = (boolean)READUINT8(save_p);
lightningcooldown = READUINT32(save_p);
blueshellincoming = READUINT32(save_p);
blueshellplayer = READUINT8(save_p);
for (i = 0; i < 4; i++)
battlewanted[i] = READSINT8(save_p);
wantedcalcdelay = READUINT32(save_p);
indirectitemcooldown = READUINT32(save_p);
spbincoming = READUINT32(save_p);
spbplayer = READUINT8(save_p);
mapreset = READUINT32(save_p);
// Is it paused?
if (READUINT8(save_p) == 0x2f)

View file

@ -2197,11 +2197,15 @@ static void P_LevelInitStuff(void)
for (i = 0; i < MAXPLAYERS; i++)
{
#if 0
if ((netgame || multiplayer) && (gametype == GT_COMPETITION || players[i].lives <= 0))
{
// In Co-Op, replenish a user's lives if they are depleted.
players[i].lives = cv_startinglives.value;
}
#else
players[i].lives = 1;
#endif
players[i].realtime = countdown = countdown2 = 0;
curlap = bestlap = 0; // SRB2Kart
@ -2426,6 +2430,7 @@ static void P_ForceCharacter(const char *forcecharskin)
static void P_LoadRecordGhosts(void)
{
// see also m_menu.c's Nextmap_OnChange
const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1;
char *gpath = malloc(glen);
INT32 i;
@ -2559,11 +2564,6 @@ boolean P_SetupLevel(boolean skipprecip)
CON_Drawer(); // let the user know what we are going to do
I_FinishUpdate(); // page flip or blit buffer
// Reset the palette
if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");
// Initialize sector node list.
P_Initsecnode();
@ -2620,7 +2620,7 @@ boolean P_SetupLevel(boolean skipprecip)
// Special stage fade to white
// This is handled BEFORE sounds are stopped.
if (rendermode != render_none && G_IsSpecialStage(gamemap))
/*if (rendermode != render_none && G_IsSpecialStage(gamemap))
{
tic_t starttime = I_GetTime();
tic_t endtime = starttime + (3*TICRATE)/2;
@ -2647,7 +2647,7 @@ boolean P_SetupLevel(boolean skipprecip)
}
ranspecialwipe = 1;
}
}*/
// Make sure all sounds are stopped before Z_FreeTags.
S_StopSounds();
@ -2659,20 +2659,24 @@ boolean P_SetupLevel(boolean skipprecip)
S_Start();
// SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished
// but we do still need the mapmusname to be changed
if (leveltime < 158)
S_StopMusic();
if (leveltime < (starttime + (TICRATE/2)))
S_ChangeMusicInternal("kstart", false); //S_StopMusic();
// Let's fade to black here
// But only if we didn't do the special stage wipe
if (rendermode != render_none && !ranspecialwipe)
{
F_WipeStartScreen();
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
F_WipeEndScreen();
F_RunWipe(wipedefs[wipe_level_toblack], false);
}
// Reset the palette now all fades have been done
if (rendermode != render_none)
V_SetPaletteLump(GetPalette()); // Set the level palette
// Print "SPEEDING OFF TO [ZONE] [ACT 1]..."
/*if (rendermode != render_none)
{
@ -2875,8 +2879,11 @@ boolean P_SetupLevel(boolean skipprecip)
CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n"));
}
else if (G_RaceGametype() && server && cv_usemapnumlaps.value)
CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps);
else if (G_RaceGametype() && server)
CV_StealthSetValue(&cv_numlaps,
((netgame || multiplayer) && cv_basenumlaps.value)
? cv_basenumlaps.value
: mapheaderinfo[gamemap - 1]->numlaps);
// ===========
// landing point for netgames.
@ -2990,22 +2997,27 @@ boolean P_SetupLevel(boolean skipprecip)
else
{
if (G_BattleGametype())
{
gamespeed = 0;
else
gamespeed = (UINT8)cv_kartspeed.value;
if (G_BattleGametype())
mirrormode = false;
}
else
{
gamespeed = (UINT8)cv_kartspeed.value;
mirrormode = (boolean)cv_kartmirror.value;
}
franticitems = (boolean)cv_kartfrantic.value;
comeback = (boolean)cv_kartcomeback.value;
}
lightningcooldown = 0;
blueshellincoming = 0;
blueshellplayer = 0;
for (i = 0; i < 4; i++)
battlewanted[i] = -1;
wantedcalcdelay = wantedfrequency*2;
indirectitemcooldown = 0;
spbincoming = 0;
spbplayer = 0;
mapreset = 0;
// clear special respawning que
iquehead = iquetail = 0;
@ -3025,7 +3037,7 @@ boolean P_SetupLevel(boolean skipprecip)
// Remove the loading shit from the screen
if (rendermode != render_none)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (ranspecialwipe) ? 0 : 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
if (precache || dedicated)
R_PrecacheLevel();
@ -3143,7 +3155,7 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname)
}
else if (name[1] == '_')
{
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
mreplaces++;
}
}
@ -3164,7 +3176,7 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname)
if (!devparm && sreplaces)
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
if (!devparm && mreplaces)
CONS_Printf(M_GetText("%s midi musics replaced\n"), sizeu1(mreplaces));
CONS_Printf(M_GetText("%s midi musics ignored\n"), sizeu1(mreplaces));
if (!devparm && digmreplaces)
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));

View file

@ -3753,22 +3753,46 @@ DoneSection2:
// Process Section 3
switch (special)
{
case 1: // SRB2kart: bounce pad
case 1: // SRB2kart: Spring Panel
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
{
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
const fixed_t minspeed = 24*scale;
if (player->mo->eflags & MFE_SPRUNG)
break;
if (player->speed < K_GetKartSpeed(player, true)/4) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale));
if (player->speed < minspeed) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_feather] |= 2;
K_DoBouncePad(player->mo, 0);
player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(player->mo, 0, false);
}
break;
case 2: // Wind/Current
case 3: // Unused (was "Ice/Sludge and Wind/Current")
break;
case 3: // SRB2kart: Spring Panel (capped speed)
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
{
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
const fixed_t minspeed = 24*scale;
const fixed_t maxspeed = 36*scale;
if (player->mo->eflags & MFE_SPRUNG)
break;
if (player->speed > maxspeed) // Prevent overshooting jumps
P_InstaThrust(player->mo, R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy), maxspeed);
else if (player->speed < minspeed) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_pogospring] = 2;
K_DoPogoSpring(player->mo, 0, false);
}
break;
case 4: // Conveyor Belt
break;
@ -3969,22 +3993,21 @@ DoneSection2:
// P_SetPlayerMobjState(player->mo, S_PLAY_FALL1);
break;
case 6: // SRB2kart 190117 - Mushroom Boost Panel
case 6: // SRB2kart 190117 - Sneaker Panel
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
{
if (!player->kartstuff[k_floorboost])
player->kartstuff[k_floorboost] = 3;
else
player->kartstuff[k_floorboost] = 2;
K_DoMushroom(player, false);
K_DoSneaker(player, false);
}
break;
case 7: // SRB2kart 190117 - Oil Slick
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
{
player->kartstuff[k_spinouttype] = -1;
K_SpinPlayer(player, NULL);
K_SpinPlayer(player, NULL, 0, false);
}
break;
@ -4184,11 +4207,12 @@ DoneSection2:
if (P_IsLocalPlayer(player))
{
if (player->laps < (UINT8)(cv_numlaps.value - 1))
S_StartSound(NULL, sfx_mlap);
else if (player->laps == (UINT8)(cv_numlaps.value - 1))
S_StartSound(NULL, sfx_mlap);
if (player->laps == (UINT8)(cv_numlaps.value - 1))
S_StartSound(NULL, sfx_s3k68);
else if (player->laps < (UINT8)(cv_numlaps.value - 1))
S_StartSound(NULL, sfx_s221);
}
//
//player->starpostangle = player->starposttime = player->starpostnum = 0;
//player->starpostx = player->starposty = player->starpostz = 0;
@ -4207,26 +4231,10 @@ DoneSection2:
if (player->laps >= (unsigned)cv_numlaps.value)
{
if (P_IsLocalPlayer(player))
{
// SRB2kart 200117
if (splitscreen)
S_ChangeMusicInternal("karwin", true);
else
{
if (player->kartstuff[k_position] == 1)
S_ChangeMusicInternal("karwin", true);
else if (K_IsPlayerLosing(player))
S_ChangeMusicInternal("karlos", true);
else
S_ChangeMusicInternal("karok", true);
}
}
if (player->kartstuff[k_position] == 1)
if (!splitscreen && P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_s3k6a);
else if (player->kartstuff[k_position] == 1)
S_StartSound(NULL, sfx_s253);
else if (P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_s24f);
P_DoPlayerExit(player);
}
@ -7222,8 +7230,8 @@ void T_Friction(friction_t *f)
// friction works for all mobj's
// (or at least MF_PUSHABLEs, which is all I care about anyway)
if ((!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) && thing->z == thing->floorz) && (thing->player
&& (thing->player->kartstuff[k_startimer] == 0 && thing->player->kartstuff[k_bootimer] == 0
&& thing->player->kartstuff[k_mushroomtimer] == 0 && thing->player->kartstuff[k_growshrinktimer] <= 0)))
&& (thing->player->kartstuff[k_invincibilitytimer] == 0 && thing->player->kartstuff[k_hyudorotimer] == 0
&& thing->player->kartstuff[k_sneakertimer] == 0 && thing->player->kartstuff[k_growshrinktimer] <= 0)))
{
if (f->roverfriction)
{
@ -7619,7 +7627,9 @@ void T_Pusher(pusher_t *p)
if (thing->player && thing->player->pflags & PF_ROPEHANG)
continue;
if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (K_GetKartFlashing()/4)*3 && thing->player->powers[pw_flashing] <= K_GetKartFlashing()))
if (thing->player && (thing->state == &states[thing->info->painstate])
&& (thing->player->powers[pw_flashing] > (K_GetKartFlashing(thing->player)/4)*3
&& thing->player->powers[pw_flashing] <= K_GetKartFlashing(thing->player)))
continue;
inFOF = touching = moved = false;
@ -7756,7 +7766,6 @@ void T_Pusher(pusher_t *p)
thing->player->pflags |= PF_JUMPED;
thing->player->pflags |= PF_SLIDING;
P_SetPlayerMobjState (thing, thing->info->painstate); // Whee!
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
if (!demoplayback || P_AnalogMove(thing->player))

View file

@ -677,12 +677,12 @@ void P_Ticker(boolean run)
if (countdown2)
countdown2--;
if (blueshellincoming && --blueshellincoming <= 0)
if (spbincoming && --spbincoming <= 0)
{
UINT8 best = 0;
SINT8 hurtthisguy = -1;
blueshellincoming = 0;
spbincoming = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -703,11 +703,20 @@ void P_Ticker(boolean run)
}
if (hurtthisguy != -1)
players[hurtthisguy].kartstuff[k_deathsentence] = TICRATE+1;
{
players[hurtthisguy].kartstuff[k_deathsentence] = (2*TICRATE)+1;
S_StartSound(players[hurtthisguy].mo, sfx_kc57);
}
}
if (lightningcooldown)
lightningcooldown--;
if (indirectitemcooldown)
indirectitemcooldown--;
if (G_BattleGametype())
{
if (wantedcalcdelay && --wantedcalcdelay <= 0)
K_CalculateBattleWanted();
}
if (quake.time)
{
@ -731,6 +740,11 @@ void P_Ticker(boolean run)
G_ConsGhostTic();
if (modeattacking)
G_GhostTicker();
if (mapreset > 1
&& --mapreset <= 1
&& server) // Remember: server uses it for mapchange, but EVERYONE ticks down for the animation
D_MapChange(gamemap, gametype, ultimatemode, true, 0, false, false);
}
P_MapEnd();

File diff suppressed because it is too large Load diff

View file

@ -855,7 +855,7 @@ static void R_AddPolyObjects(subsector_t *sub)
drawseg_t *firstseg;
static void R_Subsector(size_t num, UINT8 ssplayer)
static void R_Subsector(size_t num, UINT8 viewnumber)
{
INT32 count, floorlightlevel, ceilinglightlevel, light;
seg_t *line;
@ -1213,7 +1213,7 @@ static void R_Subsector(size_t num, UINT8 ssplayer)
// Either you must pass the fake sector and handle validcount here, on the
// real sector, or you must account for the lighting in some other way,
// like passing it as an argument.
R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2, ssplayer);
R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2, viewnumber);
firstseg = NULL;
@ -1419,7 +1419,7 @@ INT32 R_GetPlaneLight(sector_t *sector, fixed_t planeheight, boolean underside)
//
// killough 5/2/98: reformatted, removed tail recursion
void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer)
void R_RenderBSPNode(INT32 bspnum, UINT8 viewnumber)
{
node_t *bsp;
INT32 side;
@ -1430,7 +1430,7 @@ void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer)
// Decide which side the view point is on.
side = R_PointOnSide(viewx, viewy, bsp);
// Recursively divide front space.
R_RenderBSPNode(bsp->children[side], ssplayer);
R_RenderBSPNode(bsp->children[side], viewnumber);
// Possibly divide back space.
@ -1448,5 +1448,5 @@ void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer)
portalcullsector = NULL;
}
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR, ssplayer);
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR, viewnumber);
}

View file

@ -37,7 +37,7 @@ extern INT32 doorclosed;
void R_ClearClipSegs(void);
void R_PortalClearClipSegs(INT32 start, INT32 end);
void R_ClearDrawSegs(void);
void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer);
void R_RenderBSPNode(INT32 bspnum, UINT8 viewnumber);
void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2);
#ifdef POLYOBJECTS

View file

@ -1087,7 +1087,7 @@ INT32 R_ColormapNumForName(char *name)
extra_colormaps[num_extra_colormaps].fadecolor = 0x0;
extra_colormaps[num_extra_colormaps].maskamt = 0x0;
extra_colormaps[num_extra_colormaps].fadestart = 0;
extra_colormaps[num_extra_colormaps].fadeend = 33;
extra_colormaps[num_extra_colormaps].fadeend = 31;
extra_colormaps[num_extra_colormaps].fog = 0;
num_extra_colormaps++;
@ -1115,7 +1115,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
size_t mapnum = num_extra_colormaps;
size_t i;
UINT32 cr, cg, cb, maskcolor, fadecolor;
UINT32 fadestart = 0, fadeend = 33, fadedist = 33;
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] == '#')
@ -1156,12 +1156,12 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
// 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 > 32)
if (fadestart > 30)
fadestart = 0;
if (fadeend > 33 || fadeend < 1)
fadeend = 33;
if (fadeend > 31 || fadeend < 1)
fadeend = 31;
fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]) ? 1 : 0;
fog = NUMFROMCHAR(p2[1]);
}
#undef getnum
@ -1262,7 +1262,7 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
size_t i;
char *colormap_p;
UINT32 cr, cg, cb, maskcolor, fadecolor;
UINT32 fadestart = 0, fadeend = 33, fadedist = 33;
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] == '#')
@ -1303,12 +1303,12 @@ void R_CreateColormap2(char *p1, char *p2, char *p3)
// 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 > 32)
if (fadestart > 30)
fadestart = 0;
if (fadeend > 33 || fadeend < 1)
fadeend = 33;
if (fadeend > 31 || fadeend < 1)
fadeend = 31;
fadedist = fadeend - fadestart;
fog = NUMFROMCHAR(p2[1]) ? 1 : 0;
fog = NUMFROMCHAR(p2[1]);
}
#undef getnum

View file

@ -135,7 +135,7 @@ UINT32 nflatxshift, nflatyshift, nflatshiftup, nflatmask;
#define BOSS_TT_CACHE_INDEX (MAXSKINS + 1)
#define METALSONIC_TT_CACHE_INDEX (MAXSKINS + 2)
#define ALLWHITE_TT_CACHE_INDEX (MAXSKINS + 3)
#define STARMAN_TT_CACHE_INDEX (MAXSKINS + 4)
#define RAINBOW_TT_CACHE_INDEX (MAXSKINS + 4)
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 160
#define NUM_PALETTE_ENTRIES 256
@ -155,7 +155,7 @@ const char *Color_Names[MAXSKINCOLORS] =
"Black", // SKINCOLOR_BLACK
"Cyan", // SKINCOLOR_CYAN
"Teal", // SKINCOLOR_TEAL
"Steel_Blue",// SKINCOLOR_STEELBLUE
"Steel_Blue",// SKINCOLOR_STEEL
"Blue", // SKINCOLOR_BLUE
"Peach", // SKINCOLOR_PEACH
"Tan", // SKINCOLOR_TAN
@ -175,7 +175,6 @@ const char *Color_Names[MAXSKINCOLORS] =
"Yellow", // SKINCOLOR_YELLOW
"Gold" // SKINCOLOR_GOLD
};
*/
const UINT8 Color_Opposite[MAXSKINCOLORS*2] =
{
@ -186,7 +185,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK
SKINCOLOR_NONE,8, // SKINCOLOR_CYAN
SKINCOLOR_NONE,8, // SKINCOLOR_TEAL
SKINCOLOR_NONE,8, // SKINCOLOR_STEELBLUE
SKINCOLOR_NONE,8, // SKINCOLOR_STEEL
SKINCOLOR_ORANGE,9, // SKINCOLOR_BLUE
SKINCOLOR_NONE,8, // SKINCOLOR_PEACH
SKINCOLOR_NONE,8, // SKINCOLOR_TAN
@ -206,6 +205,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_NONE,8, // SKINCOLOR_YELLOW
SKINCOLOR_NONE,8 // SKINCOLOR_GOLD
};
*/
CV_PossibleValue_t Color_cons_t[MAXSKINCOLORS+1];
@ -257,7 +257,7 @@ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, U
0x18, // SKINCOLOR_BLACK
0xd0, // SKINCOLOR_CYAN
0xdc, // SKINCOLOR_TEAL
0xc8, // SKINCOLOR_STEELBLUE
0xc8, // SKINCOLOR_STEEL
0xe2, // SKINCOLOR_BLUE
0x40, // SKINCOLOR_PEACH
0x48, // SKINCOLOR_TAN
@ -339,7 +339,7 @@ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, U
case SKINCOLOR_WHITE:
case SKINCOLOR_BLACK:
case SKINCOLOR_STEELBLUE:
case SKINCOLOR_STEEL:
case SKINCOLOR_PINK:
case SKINCOLOR_LAVENDER:
case SKINCOLOR_PURPLE:
@ -529,7 +529,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags)
else if (skinnum == TC_BOSS) skintableindex = BOSS_TT_CACHE_INDEX;
else if (skinnum == TC_METALSONIC) skintableindex = METALSONIC_TT_CACHE_INDEX;
else if (skinnum == TC_ALLWHITE) skintableindex = ALLWHITE_TT_CACHE_INDEX;
else if (skinnum == TC_STARMAN) skintableindex = STARMAN_TT_CACHE_INDEX;
else if (skinnum == TC_RAINBOW) skintableindex = RAINBOW_TT_CACHE_INDEX;
else skintableindex = skinnum;
if (flags & GTC_CACHE)

View file

@ -107,7 +107,7 @@ extern lumpnum_t viewborderlump[8];
#define TC_BOSS -2
#define TC_METALSONIC -3 // For Metal Sonic battle
#define TC_ALLWHITE -4 // For Cy-Brak-demon
#define TC_STARMAN -5 // For star power
#define TC_RAINBOW -5 // For invincibility power
// Initialize color translation tables, for player rendering etc.
void R_InitTranslationTables(void);

View file

@ -297,7 +297,7 @@ void R_DrawTranslucentColumn_8(void)
// Re-map color indices from wall texture column
// using a lighting/special effects LUT.
// heightmask is the Tutti-Frutti fix
*dest = colormap[*(transmap + (source[frac>>FRACBITS]<<8) + (*dest))];
*dest = *(transmap + (colormap[source[frac>>FRACBITS]]<<8) + (*dest));
dest += vid.width;
if ((frac += fracstep) >= heightmask)
frac -= heightmask;
@ -308,15 +308,15 @@ void R_DrawTranslucentColumn_8(void)
{
while ((count -= 2) >= 0) // texture height is a power of 2
{
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
dest += vid.width;
frac += fracstep;
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
dest += vid.width;
frac += fracstep;
}
if (count & 1)
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
}
}
}
@ -367,8 +367,7 @@ void R_DrawTranslatedTranslucentColumn_8(void)
// using a lighting/special effects LUT.
// heightmask is the Tutti-Frutti fix
*dest = dc_colormap[*(dc_transmap
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest));
dest += vid.width;
if ((frac += fracstep) >= heightmask)
@ -380,17 +379,15 @@ void R_DrawTranslatedTranslucentColumn_8(void)
{
while ((count -= 2) >= 0) // texture height is a power of 2
{
*dest = dc_colormap[*(dc_transmap
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
dest += vid.width;
frac += fracstep;
*dest = dc_colormap[*(dc_transmap
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
dest += vid.width;
frac += fracstep;
}
if (count & 1)
*dest = dc_colormap[*(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]] <<8) + (*dest))];
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
}
}
}
@ -738,8 +735,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
v = (INT64)(vz*z) + viewy;
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
dest++;
iz += ds_sz.x;
uz += ds_su.x;
@ -776,7 +772,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
for (i = SPANSIZE-1; i >= 0; i--)
{
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
dest++;
u += stepu;
v += stepv;
@ -792,7 +788,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
u = (INT64)(startu);
v = (INT64)(startv);
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
}
else
{
@ -813,7 +809,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
for (; width != 0; width--)
{
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
*dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])];
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
dest++;
u += stepu;
v += stepv;
@ -1124,49 +1120,49 @@ void R_DrawTranslucentSplat_8 (void)
// need!
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[0] = colormap[*(ds_transmap + (val << 8) + dest[0])];
dest[0] = *(ds_transmap + (colormap[val] << 8) + dest[0]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[1] = colormap[*(ds_transmap + (val << 8) + dest[1])];
dest[1] = *(ds_transmap + (colormap[val] << 8) + dest[1]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[2] = colormap[*(ds_transmap + (val << 8) + dest[2])];
dest[2] = *(ds_transmap + (colormap[val] << 8) + dest[2]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[3] = colormap[*(ds_transmap + (val << 8) + dest[3])];
dest[3] = *(ds_transmap + (colormap[val] << 8) + dest[3]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[4] = colormap[*(ds_transmap + (val << 8) + dest[4])];
dest[4] = *(ds_transmap + (colormap[val] << 8) + dest[4]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[5] = colormap[*(ds_transmap + (val << 8) + dest[5])];
dest[5] = *(ds_transmap + (colormap[val] << 8) + dest[5]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[6] = colormap[*(ds_transmap + (val << 8) + dest[6])];
dest[6] = *(ds_transmap + (colormap[val] << 8) + dest[6]);
xposition += xstep;
yposition += ystep;
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
dest[7] = colormap[*(ds_transmap + (val << 8) + dest[7])];
dest[7] = *(ds_transmap + (colormap[val] << 8) + dest[7]);
xposition += xstep;
yposition += ystep;
@ -1177,7 +1173,7 @@ void R_DrawTranslucentSplat_8 (void)
{
val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)];
if (val != TRANSPARENTPIXEL)
*dest = colormap[*(ds_transmap + (val << 8) + *dest)];
*dest = *(ds_transmap + (colormap[val] << 8) + *dest);
dest++;
xposition += xstep;
@ -1220,35 +1216,35 @@ void R_DrawTranslucentSpan_8 (void)
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
// have the uber complicated math to calculate it now, so that was a memory write we didn't
// need!
dest[0] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[0])];
dest[0] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[0]);
xposition += xstep;
yposition += ystep;
dest[1] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[1])];
dest[1] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[1]);
xposition += xstep;
yposition += ystep;
dest[2] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[2])];
dest[2] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[2]);
xposition += xstep;
yposition += ystep;
dest[3] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[3])];
dest[3] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[3]);
xposition += xstep;
yposition += ystep;
dest[4] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[4])];
dest[4] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[4]);
xposition += xstep;
yposition += ystep;
dest[5] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[5])];
dest[5] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[5]);
xposition += xstep;
yposition += ystep;
dest[6] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[6])];
dest[6] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[6]);
xposition += xstep;
yposition += ystep;
dest[7] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[7])];
dest[7] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[7]);
xposition += xstep;
yposition += ystep;
@ -1257,7 +1253,7 @@ void R_DrawTranslucentSpan_8 (void)
}
while (count--)
{
*dest = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + *dest)];
*dest = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + *dest);
dest++;
xposition += xstep;
yposition += ystep;

View file

@ -170,7 +170,7 @@ consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_con
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.
consvar_t cv_homremoval = {"homremoval", "No", 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};
consvar_t cv_maxportals = {"maxportals", "2", CV_SAVE, maxportals_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -1334,28 +1334,43 @@ void R_RenderPlayerView(player_t *player)
{
portal_pair *portal;
const boolean skybox = (skyboxmo[0] && cv_skybox.value);
UINT8 ssplayer;
UINT8 viewnumber;
if (player == &players[secondarydisplayplayer] && splitscreen)
ssplayer = 2;
viewnumber = 1;
else if (player == &players[thirddisplayplayer] && splitscreen > 1)
ssplayer = 3;
viewnumber = 2;
else if (player == &players[fourthdisplayplayer] && splitscreen > 2)
ssplayer = 4;
else if (splitscreen)
ssplayer = 1;
viewnumber = 3;
else
ssplayer = 0;
viewnumber = 0;
if (cv_homremoval.value && player == &players[displayplayer]) // if this is display player 1
// if this is display player 1
if (cv_homremoval.value && player == &players[displayplayer])
{
if (cv_homremoval.value == 1)
V_DrawFill(0, 0, vid.width, vid.height, 31); // No HOM effect!
else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
V_DrawFill(0, 0, vid.width, vid.height, 128+(timeinmap&15));
}
// Draw over the fourth screen so you don't have to stare at a HOM :V
else if (splitscreen == 2 && player == &players[thirddisplayplayer])
V_DrawFill(viewwidth, viewheight, viewwidth, viewheight, 31|V_NOSCALESTART); // Draw over the fourth screen so you don't have to stare at a HOM :V
#if 1
{
// V_DrawPatchFill, but for the fourth screen only
patch_t *pat = W_CachePatchName("SRB2BACK", PU_CACHE);
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
INT32 x, y, pw = SHORT(pat->width) * dupz, ph = SHORT(pat->height) * dupz;
for (x = vid.width>>1; x < vid.width; x += pw)
{
for (y = vid.height>>1; y < vid.height; y += ph)
V_DrawScaledPatch(x, y, V_NOSCALESTART, pat);
}
}
#else
V_DrawFill(viewwidth, viewheight, viewwidth, viewheight, 31|V_NOSCALESTART);
#endif
// load previous saved value of skyVisible for the player
if (splitscreen > 2 && player == &players[fourthdisplayplayer])
@ -1382,7 +1397,7 @@ void R_RenderPlayerView(player_t *player)
R_ClearVisibleFloorSplats();
#endif
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
R_RenderBSPNode((INT32)numnodes - 1, viewnumber);
R_ClipSprites();
R_DrawPlanes();
#ifdef FLOORSPLATS
@ -1415,7 +1430,7 @@ void R_RenderPlayerView(player_t *player)
mytotal = 0;
ProfZeroTimer();
#endif
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
R_RenderBSPNode((INT32)numnodes - 1, viewnumber);
R_ClipSprites();
#ifdef TIMING
RDMSR(0x10, &mycount);
@ -1440,7 +1455,7 @@ void R_RenderPlayerView(player_t *player)
validcount++;
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
R_RenderBSPNode((INT32)numnodes - 1, viewnumber);
R_ClipSprites();
//R_DrawPlanes();
//R_DrawMasked();
@ -1547,7 +1562,7 @@ void R_RegisterEngineStuff(void)
// Default viewheight is changeable,
// initialized to standard viewheight
CV_RegisterVar(&cv_viewheight);
//CV_RegisterVar(&cv_viewheight);
#ifdef HWRENDER
// GL-specific Commands

View file

@ -37,6 +37,9 @@
// Quincunx antialiasing of flats!
//#define QUINCUNX
// good night sweet prince
//#define SHITPLANESPARENCY
//SoM: 3/23/2000: Use Boom visplane hashing.
#define MAXVISPLANES 512
@ -769,7 +772,11 @@ void R_DrawSinglePlane(visplane_t *pl)
else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc;
if (pl->extra_colormap && pl->extra_colormap->fog)
#ifdef SHITPLANESPARENCY
if (spanfunc == splatfunc || (pl->extra_colormap && pl->extra_colormap->fog))
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT);
else
light = LIGHTLEVELS-1;
@ -823,7 +830,11 @@ void R_DrawSinglePlane(visplane_t *pl)
else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc;
if (pl->extra_colormap && pl->extra_colormap->fog)
#ifdef SHITPLANESPARENCY
if (spanfunc == splatfunc || (pl->extra_colormap && pl->extra_colormap->fog))
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT);
else
light = LIGHTLEVELS-1;

View file

@ -826,15 +826,12 @@ static void R_DrawVisSprite(vissprite_t *vis)
{
colfunc = transtransfunc;
dc_transmap = vis->transmap;
if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_>
if (vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_>
{
if (vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color, GTC_CACHE);
else
{
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
else // Use the defaults
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
@ -850,15 +847,12 @@ static void R_DrawVisSprite(vissprite_t *vis)
colfunc = transcolfunc;
// New colormap stuff for skins Tails 06-07-2002
if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
if (vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
{
if (vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color, GTC_CACHE);
else
{
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
else // Use the defaults
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
@ -1092,7 +1086,7 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
else
*/
if (!((thing->frame & (FF_FULLBRIGHT|FF_TRANSMASK) || thing->flags2 & MF2_SHADOW)
&& (!newsprite->extra_colormap || !newsprite->extra_colormap->fog)))
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
{
lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
@ -1475,7 +1469,7 @@ static void R_ProjectSprite(mobj_t *thing)
vis->transmap = transtables + (thing->frame & FF_TRANSMASK) - 0x10000;
if (((thing->frame & FF_FULLBRIGHT) || (thing->flags2 & MF2_SHADOW))
&& (!vis->extra_colormap || !vis->extra_colormap->fog))
&& (!vis->extra_colormap || !(vis->extra_colormap->fog & 1)))
{
// full bright: goggles
vis->colormap = colormaps;
@ -1676,7 +1670,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
// R_AddSprites
// During BSP traversal, this adds sprites by sector.
//
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer)
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
{
mobj_t *thing;
precipmobj_t *precipthing; // Tails 08-25-2002
@ -1722,19 +1716,19 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer)
if (splitscreen)
{
if (thing->eflags & MFE_DRAWONLYFORP1)
if (ssplayer != 1)
if (viewnumber != 0)
continue;
if (thing->eflags & MFE_DRAWONLYFORP2)
if (ssplayer != 2)
if (viewnumber != 1)
continue;
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
if (ssplayer != 3)
if (viewnumber != 2)
continue;
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
if (ssplayer != 4)
if (viewnumber != 3)
continue;
}
@ -1755,19 +1749,19 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer)
if (splitscreen)
{
if (thing->eflags & MFE_DRAWONLYFORP1)
if (ssplayer != 1)
if (viewnumber != 0)
continue;
if (thing->eflags & MFE_DRAWONLYFORP2)
if (ssplayer != 2)
if (viewnumber != 1)
continue;
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
if (ssplayer != 3)
if (viewnumber != 2)
continue;
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
if (ssplayer != 4)
if (viewnumber != 3)
continue;
}

View file

@ -55,7 +55,7 @@ void R_DelSpriteDefs(UINT16 wadnum);
#endif
//SoM: 6/5/2000: Light sprites correctly!
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer);
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber);
void R_InitSprites(void);
void R_ClearSprites(void);
void R_ClipSprites(void);

View file

@ -78,9 +78,9 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N
static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// actual general (maximum) sound & music volume, saved into the config
consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
//consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// number of channels available
#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};
@ -88,7 +88,7 @@ consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, S
consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
#endif
static 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};
#define S_MAX_VOLUME 127
@ -846,7 +846,7 @@ void S_StopSound(void *origin)
//
static INT32 actualsfxvolume; // check for change through console
static INT32 actualdigmusicvolume;
static INT32 actualmidimusicvolume;
//static INT32 actualmidimusicvolume;
void S_UpdateSounds(void)
{
@ -873,8 +873,8 @@ void S_UpdateSounds(void)
S_SetSfxVolume (cv_soundvolume.value);
if (actualdigmusicvolume != cv_digmusicvolume.value)
S_SetDigMusicVolume (cv_digmusicvolume.value);
if (actualmidimusicvolume != cv_midimusicvolume.value)
S_SetMIDIMusicVolume (cv_midimusicvolume.value);
//if (actualmidimusicvolume != cv_midimusicvolume.value)
//S_SetMIDIMusicVolume (cv_midimusicvolume.value);
// We're done now, if we're not in a level.
if (gamestate != GS_LEVEL)
@ -1438,7 +1438,7 @@ void S_StartSoundName(void *mo, const char *soundname)
/// ------------------------
#ifdef MUSICSLOT_COMPATIBILITY
const char *compat_special_music_slots[21] =
const char *compat_special_music_slots[16] =
{
"titles", // 1036 title screen
"read_m", // 1037 intro
@ -1455,12 +1455,6 @@ const char *compat_special_music_slots[21] =
"credit", // 1048 credits
"racent", // 1049 Race Results
"stjr", // 1050 Sonic Team Jr. Presents
// SRB2kart 040217
"finlap", // 1051 Sonic Team Jr. Presents
"karwin", // 1052 Sonic Team Jr. Presents
"karok", // 1053 Sonic Team Jr. Presents
"karlos", // 1054 Sonic Team Jr. Presents
"mega", // 1055 Sonic Team Jr. Presents
""
};
#endif
@ -1476,16 +1470,22 @@ static boolean mus_paused = 0; // whether songs are mus_paused
static boolean S_MIDIMusic(const char *mname, boolean looping)
{
lumpnum_t mlumpnum;
/*lumpnum_t mlumpnum;
void *mdata;
INT32 mhandle;
INT32 mhandle;*/
if (nomidimusic || music_disabled)
return false; // didn't search.
(void)looping;
/*if (nomidimusic || music_disabled)
return false; // didn't search.*/
if (W_CheckNumForName(va("d_%s", mname)) == LUMPERROR)
return false;
mlumpnum = W_GetNumForName(va("d_%s", mname));
CONS_Alert(CONS_ERROR, "A MIDI Music lump %.6s was found,\nbut SRB2Kart does not support MIDI output.\nWe apologise for the inconvenience.\n", mname);
return false;
/*mlumpnum = W_GetNumForName(va("d_%s", mname));
// load & register it
mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC);
@ -1512,7 +1512,7 @@ static boolean S_MIDIMusic(const char *mname, boolean looping)
music_lumpnum = mlumpnum;
music_data = mdata;
music_handle = mhandle;
return true;
return true;*/
}
static boolean S_DigMusic(const char *mname, boolean looping)
@ -1537,7 +1537,7 @@ void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping)
S_ClearSfx();
#endif
if ((nomidimusic || music_disabled) && (nodigimusic || digital_disabled))
if (/*(nomidimusic || music_disabled) && */(nodigimusic || digital_disabled))
return;
// No Music (empty string)
@ -1601,7 +1601,7 @@ void S_SetDigMusicVolume(INT32 volume)
I_SetDigMusicVolume(volume&31);
}
void S_SetMIDIMusicVolume(INT32 volume)
/*void S_SetMIDIMusicVolume(INT32 volume)
{
if (volume < 0 || volume > 31)
CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n");
@ -1613,7 +1613,7 @@ void S_SetMIDIMusicVolume(INT32 volume)
I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this.
#endif
I_SetMIDIMusicVolume(volume&0x1f);
}
}*/
/// ------------------------
/// Init & Others
@ -1624,7 +1624,7 @@ void S_SetMIDIMusicVolume(INT32 volume)
// Sets channels, SFX and music volume,
// allocates channel buffer, sets S_sfx lookup.
//
void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume)
void S_Init(INT32 sfxVolume, INT32 digMusicVolume)
{
INT32 i;
@ -1633,7 +1633,7 @@ void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume)
S_SetSfxVolume(sfxVolume);
S_SetDigMusicVolume(digMusicVolume);
S_SetMIDIMusicVolume(midiMusicVolume);
//S_SetMIDIMusicVolume(midiMusicVolume);
SetChannelsNum();

View file

@ -23,8 +23,9 @@
#define PICKUP_SOUND 0x8000
extern consvar_t stereoreverse;
extern consvar_t cv_soundvolume, cv_digmusicvolume, cv_midimusicvolume;
extern consvar_t cv_soundvolume, cv_digmusicvolume;//, cv_midimusicvolume;
extern consvar_t cv_numChannels;
extern consvar_t surround;
#ifdef SNDSERV
extern consvar_t sndserver_cmd, sndserver_arg;
@ -71,7 +72,7 @@ void S_RegisterSoundStuff(void);
// Initializes sound stuff, including volume
// Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.
//
void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume);
void S_Init(INT32 sfxVolume, INT32 digMusicVolume);
//
// Per level startup code.
@ -122,7 +123,7 @@ void S_UpdateSounds(void);
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
void S_SetDigMusicVolume(INT32 volume);
void S_SetMIDIMusicVolume(INT32 volume);
//void S_SetMIDIMusicVolume(INT32 volume);
void S_SetSfxVolume(INT32 volume);
INT32 S_OriginPlaying(void *origin);
@ -142,7 +143,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum);
#ifdef MUSICSLOT_COMPATIBILITY
// For compatibility with code/scripts relying on older versions
// This is a list of all the "special" slot names and their associated numbers
const char *compat_special_music_slots[21];
const char *compat_special_music_slots[16];
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,425 +1,213 @@
/* XPM */
static char * C:\Repo\srb2\src\sdl\SDL_icon_xpm[] = {
"32 32 390 2",
" c None",
". c #4F4F70",
"+ c #4D4D87",
"@ c #4D4D84",
"# c #4E4E6C",
"$ c #6C6C95",
"% c #5E5EB2",
"& c #6B6BE7",
"* c #7373F9",
"= c #7C7CFF",
"- c #6F70E7",
"; c #494BB2",
"> c #4F4FA3",
", c #6464D4",
"' c #7979F5",
") c #5F5FCA",
"! c #5D5D93",
"~ c #3A3A9F",
"{ c #6060AC",
"] c #777793",
"^ c #5C5CB3",
"/ c #7373EA",
"( c #7A7AFF",
"_ c #7575FF",
": c #7979FF",
"< c #6264DD",
"[ c #47478C",
"} c #564567",
"| c #4647D0",
"1 c #5C5CAE",
"2 c #5E5EFF",
"3 c #2929FF",
"4 c #1D1DFF",
"5 c #1919D1",
"6 c #4F4F90",
"7 c #1E1ECE",
"8 c #5858FF",
"9 c #6767A8",
"0 c #4949A0",
"a c #7070FB",
"b c #7D7DFF",
"c c #7777FF",
"d c #7373FF",
"e c #7272FF",
"f c #7878FF",
"g c #6465D8",
"h c #363886",
"i c #9F7655",
"j c #C89B5C",
"k c #1D1CB7",
"l c #3031B1",
"m c #1919F4",
"n c #1111FF",
"o c #1818FF",
"p c #1B1BFF",
"q c #1C1CFF",
"r c #2626B3",
"s c #1E1EC8",
"t c #1A1AE8",
"u c #24249F",
"v c #2F2FD2",
"w c #7676FF",
"x c #6869E2",
"y c #414290",
"z c #8C6751",
"A c #FCBA68",
"B c #E9BD7D",
"C c #201EB8",
"D c #090AB8",
"E c #1616EB",
"F c #1818FD",
"G c #1414EE",
"H c #1010E1",
"I c #0E0EE2",
"J c #0E0EF4",
"K c #0606B2",
"L c #7A7A89",
"M c #0C0C9A",
"N c #0A0AA7",
"O c #2424E4",
"P c #6669E6",
"Q c #4F4A8F",
"R c #BF853B",
"S c #FFD98D",
"T c #CDAB76",
"U c #1717C4",
"V c #0F10BA",
"W c #0909B6",
"X c #0505C3",
"Y c #0000B6",
"Z c #0000BE",
"` c #0000AD",
" . c #1D1D83",
".. c #63638E",
"+. c #090975",
"@. c #1414F3",
"#. c #5B5BFF",
"$. c #7B7BFF",
"%. c #7070FF",
"&. c #6E6EFF",
"*. c #7172F6",
"=. c #625DAF",
"-. c #BA9E6C",
";. c #887167",
">. c #090DF2",
",. c #1313BE",
"'. c #000085",
"). c #0000AC",
"!. c #0202AA",
"~. c #242488",
"{. c #1414C7",
"]. c #1717FF",
"^. c #5959FF",
"/. c #7F7FFF",
"(. c #7474FF",
"_. c #7171FF",
":. c #8686FF",
"<. c #7574FF",
"[. c #797CFF",
"}. c #5756B8",
"|. c #1C19A4",
"1. c #1617FF",
"2. c #1212BD",
"3. c #040485",
"4. c #0707A4",
"5. c #1B1B71",
"6. c #373797",
"7. c #1616FF",
"8. c #5050FF",
"9. c #8080FF",
"0. c #AAAAFF",
"a. c #AEAEF6",
"b. c #8A8AEF",
"c. c #6969FB",
"d. c #2728FF",
"e. c #1314FF",
"f. c #1919FF",
"g. c #1313E8",
"h. c #1F1FF4",
"i. c #5454FF",
"j. c #6D6DF0",
"k. c #6868B5",
"l. c #0B0BB8",
"m. c #1212C5",
"n. c #1616FC",
"o. c #1515FF",
"p. c #1212FF",
"q. c #2323FF",
"r. c #3636FF",
"s. c #4040FF",
"t. c #4343F9",
"u. c #5D5DB8",
"v. c #7F7F92",
"w. c #878793",
"x. c #4B4B94",
"y. c #0B0CE2",
"z. c #1313FF",
"A. c #4C4CFF",
"B. c #8282FF",
"C. c #7171ED",
"D. c #636394",
"E. c #575785",
"F. c #A9A99C",
"G. c #1414BC",
"H. c #1414FF",
"I. c #0707FD",
"J. c #2525AA",
"K. c #A8A8A4",
"L. c #EBEBE2",
"M. c #F9F9F2",
"N. c #E1E1CC",
"O. c #4D4D9F",
"P. c #0B0BF7",
"Q. c #2121FF",
"R. c #3232FF",
"S. c #5555FF",
"T. c #6161B4",
"U. c #B5B5B2",
"V. c #FFFFF8",
"W. c #4F4F9A",
"X. c #0B0BF5",
"Y. c #1616C5",
"Z. c #A8A8A1",
"`. c #FFFFFC",
" + c #FFFFFF",
".+ c #C0C0C4",
"++ c #1212D4",
"@+ c #4444FF",
"#+ c #6464FF",
"$+ c #8383FF",
"%+ c #6767C3",
"&+ c #E4E4E4",
"*+ c #9494AE",
"=+ c #0808DF",
"-+ c #0D0DF2",
";+ c #61619A",
">+ c #F1F1E0",
",+ c #E8E8DD",
"'+ c #2424BB",
")+ c #1010FF",
"!+ c #3434FF",
"~+ c #6161FF",
"{+ c #6969D2",
"]+ c #EFEFF0",
"^+ c #C2C2BA",
"/+ c #1010B6",
"(+ c #0909AC",
"_+ c #A4A49A",
":+ c #EAEADE",
"<+ c #2525B8",
"[+ c #2F2FFF",
"}+ c #3C3CB5",
"|+ c #EEEEEE",
"1+ c #BBBBAD",
"2+ c #0B0B56",
"3+ c #0B0BFC",
"4+ c #1212EF",
"5+ c #0C0C3E",
"6+ c #919187",
"7+ c #DEDED6",
"8+ c #1F1FC0",
"9+ c #1A1AFF",
"0+ c #1717FA",
"a+ c #1515F8",
"b+ c #1111FC",
"c+ c #494992",
"d+ c #999998",
"e+ c #3E3E3B",
"f+ c #3C3C99",
"g+ c #535397",
"h+ c #5A5A4D",
"i+ c #6F6F70",
"j+ c #BFBFC9",
"k+ c #1111D6",
"l+ c #1515F1",
"m+ c #0F0FE2",
"n+ c #0D0DD9",
"o+ c #0909CD",
"p+ c #0808C7",
"q+ c #0505C7",
"r+ c #0303CB",
"s+ c #0101C0",
"t+ c #0202AF",
"u+ c #0606AC",
"v+ c #121283",
"w+ c #BBBBBB",
"x+ c #BEBEBE",
"y+ c #2F2F2E",
"z+ c #C7C8BB",
"A+ c #D8DAD1",
"B+ c #272828",
"C+ c #929292",
"D+ c #8688C7",
"E+ c #0506F6",
"F+ c #1616F5",
"G+ c #0B0BD3",
"H+ c #0202B6",
"I+ c #0000AF",
"J+ c #0000B4",
"K+ c #0000BD",
"L+ c #0000BB",
"M+ c #00009E",
"N+ c #2C2C7E",
"O+ c #6A6A8B",
"P+ c #959595",
"Q+ c #F0F0F1",
"R+ c #E1E1E1",
"S+ c #8C8E90",
"T+ c #BEBEBF",
"U+ c #C9C7C5",
"V+ c #939699",
"W+ c #E7EAED",
"X+ c #CBCBC7",
"Y+ c #413B9B",
"Z+ c #0607DD",
"`+ c #0C0CE2",
" @ c #0303B9",
".@ c #0000A8",
"+@ c #181888",
"@@ c #6A6A6A",
"#@ c #626263",
"$@ c #4B4B4C",
"%@ c #3E3B36",
"&@ c #9B805C",
"*@ c #D9B07D",
"=@ c #C9AE89",
"-@ c #B9AF9E",
";@ c #C7C5C4",
">@ c #CBCCCF",
",@ c #C7C6C6",
"'@ c #AEA59A",
")@ c #B69974",
"!@ c #D8B87F",
"~@ c #9B8272",
"{@ c #0E0B9B",
"]@ c #0000B7",
"^@ c #0000B8",
"/@ c #000082",
"(@ c #00007A",
"_@ c #636379",
":@ c #62533E",
"<@ c #B59B6C",
"[@ c #DEB07B",
"}@ c #FECC90",
"|@ c #FFCE92",
"1@ c #FEC98C",
"2@ c #F1BD82",
"3@ c #D1A979",
"4@ c #BC9E73",
"5@ c #CCA777",
"6@ c #EAB980",
"7@ c #FFCD90",
"8@ c #FFD595",
"9@ c #FDD782",
"0@ c #413678",
"a@ c #0000AE",
"b@ c #000077",
"c@ c #010193",
"d@ c #0C0CE4",
"e@ c #38389E",
"f@ c #EEC585",
"g@ c #FFDA9D",
"h@ c #FFC992",
"i@ c #FFC88F",
"j@ c #FFC990",
"k@ c #FFCE93",
"l@ c #FFD094",
"m@ c #FFCC92",
"n@ c #C9A174",
"o@ c #EDBD88",
"p@ c #FAD287",
"q@ c #3A2F7F",
"r@ c #0000BA",
"s@ c #0000B0",
"t@ c #0101B2",
"u@ c #1111ED",
"v@ c #1919C1",
"w@ c #95887C",
"x@ c #DCAC6E",
"y@ c #FFD393",
"z@ c #FFCD94",
"A@ c #FFCA93",
"B@ c #FFC991",
"C@ c #FFC78E",
"D@ c #FFCB91",
"E@ c #E0B581",
"F@ c #BB9A6F",
"G@ c #FFDC97",
"H@ c #C1A173",
"I@ c #0E0B9A",
"J@ c #0000B5",
"K@ c #0101B6",
"L@ c #1010E0",
"M@ c #1616EC",
"N@ c #A68156",
"O@ c #E7AC6B",
"P@ c #FFC582",
"Q@ c #FFCF8F",
"R@ c #FFD195",
"S@ c #FFD296",
"T@ c #FFD396",
"U@ c #FFD193",
"V@ c #FFD28F",
"W@ c #D2A96B",
"X@ c #2F2482",
"Y@ c #0000C1",
"Z@ c #0000C0",
"`@ c #0000BF",
" # c #0101BF",
".# c #1212F0",
"+# c #767698",
"@# c #9C866E",
"## c #A9865D",
"$# c #C0915D",
"%# c #C89760",
"&# c #C29360",
"*# c #AD8A61",
"=# c #9D8971",
"-# c #7F7A7A",
";# c #70708F",
"># c #6F6F91",
",# c #575788",
"'# c #464687",
")# c #2F2F87",
"!# c #15158F",
"~# c #0101A8",
"{# c #1313FB",
"]# c #57579F",
"^# c #343487",
"/# c #434388",
static const char *SDL_icon_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 175 2 ",
" c None",
". c #2E2E2E",
"X c #3C3C3C",
"o c #493939",
"O c #4E473F",
"+ c #161658",
"@ c #131369",
"# c #06067B",
"$ c #111173",
"% c #16167F",
"& c #252567",
"* c #372B7C",
"= c #3D3679",
"- c #41414A",
"; c #575655",
": c #6A5841",
"> c #5B4B72",
", c #616160",
"< c #7B7B7B",
"1 c #906E49",
"2 c #89685D",
"3 c #A67B4A",
"4 c #AA7F50",
"5 c #9B7560",
"6 c #856C78",
"7 c #997B7D",
"8 c #B48552",
"9 c #BA8A55",
"0 c #A48665",
"q c #B98F67",
"w c #B9946A",
"e c #B7937A",
"r c #C8955C",
"t c #CA9966",
"y c #DAA469",
"u c #C9A37B",
"i c #D7AB7B",
"p c #DFB07D",
"a c #EBAE6A",
"s c #E5B27A",
"d c #F1B779",
"f c #0A0A83",
"g c #05058B",
"h c #060687",
"j c #101089",
"k c #131382",
"l c #040494",
"z c #02029D",
"x c #0C0B9C",
"c c #120F9E",
"v c #19199B",
"b c #382D84",
"n c #39398D",
"m c #222296",
"M c #0101A6",
"N c #0A0AA2",
"B c #0202AC",
"V c #1919A2",
"C c #1616AD",
"Z c #0000B5",
"A c #0202BC",
"S c #0C0CB6",
"D c #1313B3",
"F c #1011BD",
"G c #1B1BBE",
"H c #2B2BAC",
"J c #3737A1",
"K c #2A26BE",
"L c #2A29B4",
"P c #3B3BB8",
"I c #48478B",
"U c #57578A",
"Y c #4A499A",
"T c #524F95",
"R c #565399",
"E c #4C4CA8",
"W c #524DA7",
"Q c #5353A4",
"! c #5555A9",
"~ c #5555B4",
"^ c #5656B7",
"/ c #6464A6",
"( c #6F67B5",
") c #0404C3",
"_ c #0707CA",
"` c #1414CB",
"' c #1A1AC6",
"] c #0A0AD3",
"[ c #0D0DDC",
"{ c #1A1AD4",
"} c #1010DF",
"| c #1E1EDE",
" . c #1817DE",
".. c #221FCA",
"X. c #2B2BCC",
"o. c #2727C9",
"O. c #3434C3",
"+. c #3434D4",
"@. c #0F0FE2",
"#. c #1313E5",
"$. c #1515ED",
"%. c #1B1BEA",
"&. c #1C1CE4",
"*. c #1515F4",
"=. c #1818F3",
"-. c #1717FD",
";. c #1818FF",
":. c #2B2BE9",
">. c #2424FF",
",. c #2A2AFF",
"<. c #2222F1",
"1. c #3737FF",
"2. c #5D5DC3",
"3. c #5F5FC9",
"4. c #5655C2",
"5. c #4747D1",
"6. c #5B5BD4",
"7. c #6565C8",
"8. c #6363DA",
"9. c #4545FF",
"0. c #4D4DFC",
"q. c #5454FF",
"w. c #5959FF",
"e. c #6969E5",
"r. c #6B6CEA",
"t. c #6666E7",
"y. c #6B6BFE",
"u. c #6767F8",
"i. c #7070F6",
"p. c #7373FF",
"a. c #7C7CFF",
"s. c #91918F",
"d. c #8F9090",
"f. c #979797",
"g. c #9C9C9C",
"h. c #8585A1",
"j. c #9C9CA7",
"k. c #9292B6",
"l. c #A4A4A4",
"z. c #BDB2A4",
"x. c #A4A4B1",
"c. c #BFBFBD",
"v. c #BABAB7",
"b. c #C8AA87",
"n. c #DAAE82",
"m. c #DBB081",
"M. c #EBBA85",
"N. c #F3BF84",
"B. c #F2BE88",
"V. c #C2B3A3",
"C. c #FBC386",
"Z. c #FCC68C",
"A. c #FFC88F",
"S. c #F4C387",
"D. c #FFC990",
"F. c #C3C1BF",
"G. c #8F8FCB",
"H. c #BDBDC2",
"J. c #BDBDD1",
"K. c #8888F9",
"L. c #A4A4FB",
"P. c #CDCDCC",
"I. c #CECAC6",
"U. c #D3CFCA",
"Y. c #D3D0CC",
"T. c #C0C0D5",
"R. c #D6D5D4",
"E. c #D7D7DD",
"W. c #E1E1DF",
"Q. c #DEDEE1",
"!. c #E4E4E4",
"~. c #E8E8E8",
"^. c #F0F0EE",
"/. c #F5F5F2",
"(. c #FFFFFF",
/* pixels */
" ",
" ",
" ",
" . + @ # ",
" $ % & * = - ; > , ' ) ! ",
" ~ { ] ^ / = ( _ : < [ } | 1 2 3 4 5 6 ",
" 7 8 9 0 a b c d e f g h i j k l m n o p q r ",
" s t u v _ f d d d w x y z A B C D E F G H I J K L ",
" M N O _ c e d d d _ P Q R S T U V W X Y Z ` ... ",
" +.@.#.$.d d d d %.&._ *.=.-.;.>.,.'.).!.~. ",
" {.].^./.(.d d _.$.:._ <.[.}.|.1.2.3.4.5. ",
" 6.7.7.4 8.e : w 9.0.a.b.c.2 d.e.f.g.h.i.j.k. ",
" l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.o o z.A.B./.b C.D. ",
" E.F.G.].o H.z.I.J.K.L.M.N.O.P.o o o Q.R.S._.b B.T. ",
" U.V.W.X.f.f.7.Y.Z.`. + + +.+++].o o o.n z.q.@+#+$+%+ ",
" &+ +*+=+].o -+;+>+ + + + +,+'+H.o o o o o H.)+o !+~+{+ ",
" ]+ +^+/+H.o.(+_+ + + + + +:+<+z.o o o o o o o 7.n H.[+}+ ",
" |+ +1+2+3+4+5+6+ + + + + +7+8+H.o o f.9+f.9+f.F 0+a+b+o.c+ ",
" &+ +d+e+f+g+h+i+ + + + + +j+k+].f.9+l+m+n+o+p+q+r+s+t+u+v+ ",
" w+ +x+y+z+A+B+C+ + + + + +D+E+9+F+G+H+I+J+K+L+M+N+O+ ",
" P+Q+R+S+T+U+V+W+ + + + +X+Y+Z+`+ @I+J+Z .@+@E. ",
" @@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@I+/@(@_@ ",
" :@<@[@}@|@1@2@3@4@5@6@7@8@9@0@L+a@b@c@d@e@ ",
" f@g@h@i@i@j@k@l@|@m@n@o@p@q@r@s@t@u@p v@ ",
" w@x@y@z@A@B@i@C@D@E@F@G@H@I@L+J@K@L@p M@ ",
" N@O@P@Q@R@S@T@U@V@W@X@Y@Z@Y@`@ #.#p +# ",
" @###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]# ",
" ^#/# ",
" I Q T = ",
" Q 7.e.r.i.8.E E 3.r.6.J ",
" H ~ n 4.r.p.p.p.p.8.R > 5.^ w.,.-.{ v ",
" { 9.^ & P t.p.p.p.p.p.8.I 5 q K L <.;.;.;.-.' ",
" { %.H +.y.p.p.p.p.p.e.Y 2 a n.K F $.*.$.@.} ] N ",
" x D :.y.p.p.p.p.p.p.r.R 8 C.u ..F A ) A Z M h $ ",
" f =.q.p.p.p.p.p.p.p.p.i.( e 6 $.` l B M g ",
" ` ;.q.p.p.p.p.p.a.K.a.p.p.4.L -.` l N % ",
" V =.-.>.q.y.p.p.p.L.L.K.i.w.,.-.;.$.<.q.u.2. ",
" D { =.-.;.>.1.1.9.( h.h.Q &.-.-.-.;.9.p.p.p.r.! ",
" U j.o.-.;.-.;.-.P x.Q.^.R.~ *.-.;.;.>.1.q.y.p.i.2. ",
" H./.! *.;.;.;.o.x./.(.(.(.J.| -.-.;.-.-.;.,.9.u.p.7. ",
" !.(.k.#.;.-.=./ !.(.(.(.(.Q.X.-.;.;.;.;.-.-.;.;.1.w.6. ",
" ~.(.H.G ;.-.D j.(.(.(.(.(.!.O.-.-.;.;.;.-.;.-.;.-.;.,.O. ",
" ~.(.v.@ *.$.+ d.(.(.(.(.(.E.o.-.-.;.;.-.;.;.;.*.=.=.*.$.v ",
" ~.(.l.- Y T ; < (.(.(.(.(.J.&.-.;.;.$.@.[ ] _ ) ) Z B B f ",
" P.(.F.X c.I.X f.(.(.(.(.(.G.=.-.=.] A Z Z Z Z z f $ ",
" l.!.R.s.F.I.g.W.(.(.(.(.R.E .[ A Z Z Z B g $ ",
" . , ; - 0 M.b.V.U.R.Y.z.u n.7 c Z Z B g # + ",
" : w p Z.D.A.S.p u i M.A.A.S.* Z B h z ] C ",
" s D.D.A.A.A.A.A.A.A.i B.B.b A Z Z @.-.` ",
" 1 y C.D.A.A.A.A.A.M.u Z.e c A Z Z [ ;.&. ",
" 8 y d C.A.A.A.C.B.t * B Z Z Z A #.=.m ",
" 3 9 r t r 9 8 o @ $ # f j l B #.V ",
" j k ",
" ",
" ",
" ",
" "};
" "
};

View file

@ -39,6 +39,10 @@
#ifdef HAVE_IMAGE
#include "SDL_image.h"
#elif 1
#define LOAD_XPM //I want XPM!
#include "IMG_xpm.c" //Alam: I don't want to add SDL_Image.dll/so
#define HAVE_IMAGE //I have SDL_Image, sortof
#endif
#ifdef HAVE_IMAGE
@ -1014,7 +1018,6 @@ static inline boolean I_SkipFrame(void)
if (!paused)
return false;
/* FALLTHRU */
case GS_TIMEATTACK:
case GS_WAITINGPLAYERS:
return skip; // Skip odd frames
default:

View file

@ -66,6 +66,7 @@ static boolean midimode;
static Mix_Music *music;
static UINT8 music_volume, midi_volume, sfx_volume;
static float loop_point;
static boolean songpaused;
#ifdef HAVE_LIBGME
static Music_Emu *gme;
@ -102,6 +103,7 @@ void I_StartupSound(void)
}
sound_started = true;
songpaused = false;
Mix_AllocateChannels(256);
}
@ -176,7 +178,7 @@ static Mix_Chunk *ds2chunk(void *stream)
return NULL; // would and/or did wrap, can't store.
break;
}
sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels
sound = malloc(newsamples<<2); // samples * frequency shift * bytes per sample * channels
s = (SINT8 *)stream;
d = (INT16 *)sound;
@ -304,7 +306,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL);
mem = malloc(len);
gme_play(emu, len >> 1, mem);
gme_delete(emu);
@ -376,7 +378,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL);
mem = malloc(len);
gme_play(emu, len >> 1, mem);
gme_delete(emu);
@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
(void)udata;
// no gme? no music.
if (!gme || gme_track_ended(gme))
if (!gme || gme_track_ended(gme) || songpaused)
return;
// play gme into stream
@ -458,7 +460,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
// apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++)
*p = ((INT32)*p) * music_volume / 31;
*p = ((INT32)*p) * music_volume*2 / 42;
}
#endif
@ -476,12 +478,14 @@ void I_PauseSong(INT32 handle)
{
(void)handle;
Mix_PauseMusic();
songpaused = true;
}
void I_ResumeSong(INT32 handle)
{
(void)handle;
Mix_ResumeMusic();
songpaused = false;
}
//

View file

@ -60,7 +60,7 @@ void SDL_SYS_CDQuit(void)
UINT8 cdaudio_started = 0; // for system startup/shutdown
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifndef NOSDLCD

View file

@ -1311,7 +1311,6 @@ static inline boolean I_SkipFrame(void)
case GS_LEVEL:
if (!paused)
return false;
case GS_TIMEATTACK:
case GS_WAITINGPLAYERS:
return skip; // Skip odd frames
default:

View file

@ -147,7 +147,6 @@ sfxinfo_t S_sfx[NUMSFX] =
{"drown", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grenade beep
{"gclose", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -294,7 +293,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s1ba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1bb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1bc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1bd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1bd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Ballhog bounce
{"s1be", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1bf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s1c0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -316,7 +315,7 @@ sfxinfo_t S_sfx[NUMSFX] =
// Sonic 2 sounds
{"s220", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Lap sound
{"s222", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s223", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s224", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -343,7 +342,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s239", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Drift boost
{"s23d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s23f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -362,7 +361,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s24c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s24d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s24e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s24f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Normal finish
{"s24f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s250", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s251", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s252", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -378,7 +377,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s25c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s25d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s25e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s25f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s25f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Perfect start boost
{"s260", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s261", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s262", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -405,7 +404,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart item shield
{"s3k3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -416,7 +415,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Thunder Shield use
{"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -451,9 +450,9 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k65", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Blue Spheres
{"s3k66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart final lap
{"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart finish
{"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -493,11 +492,11 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k91", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k92", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Hyudoro use
{"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Orbinaut
{"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -514,13 +513,13 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart 3,2,1
{"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart GO!
{"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -543,7 +542,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3kbel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kbfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kbfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc0s", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Jawz
{"s3kc0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc1l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -557,12 +556,13 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3kc5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc7s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc7l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc8s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kc9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart respawn
{"s3kcal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -600,14 +600,14 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3kdbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
// 3D Blast sounds (the "missing" ones are direct copies of S3K's, no minor differences what-so-ever)
{"3db06", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"3db06", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Bumper stolen
{"3db09", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"3db14", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"3db16", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
// Sonic CD sounds
{"cdfm00", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Sneaker boost
{"cdfm02", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm03", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm04", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -645,7 +645,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"cdfm36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm39", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SS Mine deployed
{"cdfm40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -676,7 +676,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"cdfm67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Trail item dragging
{"cdfm71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdfm73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -695,7 +695,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"cdpcm6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm9", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // No damage taken
// Knuckles Chaotix sounds
{"kc2a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -703,7 +703,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"kc2c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc2d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc2e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc2f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring
{"kc2f", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring use
{"kc30", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc31", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc32", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -726,7 +726,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"kc43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc46", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink use
{"kc47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Vote picked
{"kc49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -743,10 +743,10 @@ sfxinfo_t S_sfx[NUMSFX] =
{"kc54", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc57", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SPB locked in
{"kc58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink
{"kc5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow
{"kc59", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink
{"kc5a", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow
{"kc5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"kc5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -777,8 +777,8 @@ sfxinfo_t S_sfx[NUMSFX] =
{"mlap", true, 127, 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},
{"star", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR},
{"mega", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR},
{"kinvnc", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"kgrow", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"bomb", false, 110, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"bomb2", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"peel", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -799,13 +799,19 @@ sfxinfo_t S_sfx[NUMSFX] =
{"mkitm7", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"mkitm8", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"mkitmF", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"mkitmE", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"clash", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"tossed", false, 150, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR},
{"vroom", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"boing", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"smkinv", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR},
{"smkinv", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"screec", false, 52, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2kart - Skin sounds
{"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR},

View file

@ -219,7 +219,6 @@ typedef enum
sfx_drown,
sfx_fizzle,
sfx_gbeep,
sfx_gclose,
sfx_ghit,
sfx_gloop,
sfx_gspray,
@ -629,7 +628,8 @@ typedef enum
sfx_s3kc5l,
sfx_s3kc6s,
sfx_s3kc6l,
sfx_s3kc7,
sfx_s3kc7s,
sfx_s3kc7l,
sfx_s3kc8s,
sfx_s3kc8l,
sfx_s3kc9s,
@ -849,8 +849,8 @@ typedef enum
sfx_mlap,
sfx_sboost,
sfx_mush,
sfx_star,
sfx_mega,
sfx_kinvnc,
sfx_kgrow,
sfx_bomb,
sfx_bomb2,
sfx_peel,
@ -871,6 +871,7 @@ typedef enum
sfx_mkitm7,
sfx_mkitm8,
sfx_mkitmF,
sfx_mkitmE,
sfx_clash,
sfx_tossed,
sfx_shelit,
@ -878,6 +879,11 @@ typedef enum
sfx_boing,
sfx_smkinv,
sfx_screec,
sfx_yeeeah,
sfx_noooo1,
sfx_noooo2,
sfx_hogbom,
sfx_dbgsal,
sfx_kwin,
sfx_klose,

View file

@ -229,7 +229,7 @@ void ST_doPaletteStuff(void)
if (rendermode != render_none)
{
V_SetPaletteLump(GetPalette()); // Reset the palette
//V_SetPaletteLump(GetPalette()); // Reset the palette -- is this needed?
if (!splitscreen)
V_SetPalette(palette);
}
@ -755,63 +755,75 @@ static void ST_drawLevelTitle(void)
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
char *actnum = mapheaderinfo[gamemap-1]->actnum;
INT32 lvlttlxpos;
INT32 subttlxpos = BASEVIDWIDTH/2;
INT32 ttlnumxpos;
INT32 zonexpos;
INT32 dupcalc = (vid.width/vid.dupx);
UINT8 gtc = G_GetGametypeColor(gametype);
INT32 sub = 0;
INT32 bary = (splitscreen)
? BASEVIDHEIGHT/2
: 163;
INT32 lvlw;
INT32 lvlttly;
INT32 zoney;
if (!(timeinmap > 2 && timeinmap-3 < 110))
if (timeinmap > 113)
return;
if (strlen(actnum) > 0)
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - V_LevelNameWidth(actnum);
else
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
lvlw = V_LevelNameWidth(lvlttl);
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
if (strlen(zonttl) > 0)
zonexpos = ttlnumxpos - V_LevelNameWidth(zonttl); // SRB2kart
if (strlen(actnum) > 0)
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)) - V_LevelNameWidth(actnum);
else
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2));
zonexpos = ttlnumxpos = lvlttlxpos + lvlw;
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
{
if (zonttl[0])
zonexpos -= V_LevelNameWidth(zonttl); // SRB2kart
else
zonexpos -= V_LevelNameWidth(M_GetText("ZONE"));
}
if (lvlttlxpos < 0)
lvlttlxpos = 0;
// There's no consistent algorithm that can accurately define the old positions
// so I just ended up resorting to a single switct statement to define them
switch (timeinmap-3)
if (timeinmap > 105)
{
case 0: zoney = 200; lvlttly = 0; break;
case 1: zoney = 188; lvlttly = 12; break;
case 2: zoney = 176; lvlttly = 24; break;
case 3: zoney = 164; lvlttly = 36; break;
case 4: zoney = 152; lvlttly = 48; break;
case 5: zoney = 140; lvlttly = 60; break;
case 6: zoney = 128; lvlttly = 72; break;
case 105: zoney = 80; lvlttly = 104; break;
case 106: zoney = 56; lvlttly = 128; break;
case 107: zoney = 32; lvlttly = 152; break;
case 108: zoney = 8; lvlttly = 176; break;
case 109: zoney = 0; lvlttly = 200; break;
default: zoney = 104; lvlttly = 80; break;
INT32 count = (113 - (INT32)(timeinmap));
sub = dupcalc;
while (count-- > 0)
sub >>= 1;
sub = -sub;
}
if (strlen(actnum) > 0)
V_DrawLevelTitle(ttlnumxpos+12, zoney, 0, actnum);
{
dupcalc = (dupcalc - BASEVIDWIDTH)>>1;
V_DrawFill(sub - dupcalc, bary+9, ttlnumxpos+dupcalc + 1, 2, 31);
V_DrawDiag(sub + ttlnumxpos + 1, bary, 11, 31);
V_DrawFill(sub - dupcalc, bary, ttlnumxpos+dupcalc, 10, gtc);
V_DrawDiag(sub + ttlnumxpos, bary, 10, gtc);
if (subttl[0])
V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttl);
//else
//V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue));
}
V_DrawLevelTitle(lvlttlxpos, lvlttly, 0, lvlttl);
ttlnumxpos += sub;
lvlttlxpos += sub;
zonexpos += sub;
V_DrawLevelTitle(lvlttlxpos, bary-18, 0, lvlttl);
if (strlen(zonttl) > 0)
V_DrawLevelTitle(zonexpos, zoney, 0, zonttl);
V_DrawLevelTitle(zonexpos, bary+6, 0, zonttl);
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
V_DrawLevelTitle(zonexpos, zoney, 0, M_GetText("ZONE"));
V_DrawLevelTitle(zonexpos, bary+6, 0, M_GetText("ZONE"));
if (lvlttly+48 < 200)
V_DrawCenteredString(subttlxpos, lvlttly+48, V_ALLOWLOWERCASE, subttl);
if (actnum[0])
V_DrawLevelTitle(ttlnumxpos+12, bary+6, 0, actnum);
}
/*
static void ST_drawFirstPersonHUD(void)
{
player_t *player = stplyr;
@ -913,11 +925,12 @@ static void ST_drawFirstPersonHUD(void)
V_DrawScaledPatch(SCX((BASEVIDWIDTH/2) - (SHORT(p->width)/2) + SHORT(p->leftoffset)), SCY(60 - SHORT(p->topoffset)),
V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, p);
}
*/
/*
// [21:42] <+Rob> Beige - Lavender - Steel Blue - Peach - Orange - Purple - Silver - Yellow - Pink - Red - Blue - Green - Cyan - Gold
static skincolors_t linkColor[14] =
{SKINCOLOR_BEIGE, SKINCOLOR_LAVENDER, SKINCOLOR_STEELBLUE, SKINCOLOR_PEACH, SKINCOLOR_ORANGE,
{SKINCOLOR_BEIGE, SKINCOLOR_LAVENDER, SKINCOLOR_STEEL, SKINCOLOR_PEACH, SKINCOLOR_ORANGE,
SKINCOLOR_PURPLE, SKINCOLOR_SILVER, SKINCOLOR_SUPER4, SKINCOLOR_PINK, SKINCOLOR_RED,
SKINCOLOR_BLUE, SKINCOLOR_GREEN, SKINCOLOR_CYAN, SKINCOLOR_GOLD};
@ -967,7 +980,7 @@ static void ST_drawNightsRecords(void)
V_DrawString(BASEVIDWIDTH/2 - 48, STRINGY(148), aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, STRINGY(140), V_ORANGEMAP|aflag, va("%d", stplyr->finishedrings));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, STRINGY(148), V_ORANGEMAP|aflag, va("%d", stplyr->finishedrings * 50));
ST_DrawNightsOverlayNum(BASEVIDWIDTH/2 + 48, STRINGY(160), aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_STEELBLUE);
ST_DrawNightsOverlayNum(BASEVIDWIDTH/2 + 48, STRINGY(160), aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_STEEL);
// If new record, say so!
if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore)
@ -1251,7 +1264,7 @@ static void ST_drawNiGHTSHUD(void) // SRB2kart - unused.
#endif
)
{
ST_DrawNightsOverlayNum(304, STRINGY(16), SPLITFLAGS(V_SNAPTOTOP)|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_STEELBLUE);
ST_DrawNightsOverlayNum(304, STRINGY(16), SPLITFLAGS(V_SNAPTOTOP)|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_STEEL);
}
if (!stplyr->exiting
@ -1488,13 +1501,13 @@ static void ST_drawMatchHUD(void) // SRB2kart - unused.
static inline void ST_drawRaceHUD(void)
{
if (leveltime > TICRATE && leveltime <= 2*TICRATE)
if (leveltime > starttime-(3*TICRATE) && leveltime <= starttime-(2*TICRATE))
V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race3->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race3);
else if (leveltime > 2*TICRATE && leveltime <= 3*TICRATE)
else if (leveltime > starttime-(2*TICRATE) && leveltime <= starttime-TICRATE)
V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race2->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race2);
else if (leveltime > 3*TICRATE && leveltime <= 4*TICRATE)
else if (leveltime > starttime-TICRATE && leveltime <= starttime)
V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race1->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race1);
else if (leveltime > 4*TICRATE && leveltime <= 5*TICRATE)
else if (leveltime > starttime && leveltime <= starttime+TICRATE)
V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(racego->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, racego);
if (circuitmap)
@ -1815,7 +1828,7 @@ static void ST_overlayDrawer(void)
*/
// GAME OVER pic
if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
{
patch_t *p;
@ -1825,23 +1838,12 @@ static void ST_overlayDrawer(void)
p = sboover;
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, STRINGY(BASEVIDHEIGHT/2 - (SHORT(p->height)/2)), 0, p);
}
}*/
if (!hu_showscores) // hide the following if TAB is held
{
// Countdown timer for Race Mode
if (countdown)
{
INT32 x = BASEVIDWIDTH/2;
INT32 y = BASEVIDHEIGHT-24;
if (splitscreen)
{
y = (BASEVIDHEIGHT/2)-12;
if (splitscreen > 1)
x = BASEVIDWIDTH/4;
}
V_DrawCenteredString(x, y, K_calcSplitFlags(0), va("%d", countdown/TICRATE));
}
// ...moved to k_kart.c so we can take advantage of the LAPS_Y value
K_drawKartHUD();
@ -1897,18 +1899,18 @@ static void ST_overlayDrawer(void)
strlcpy(name, player_names[stplyr-players], 13);
// Show name of player being displayed
V_DrawCenteredString((BASEVIDWIDTH/6), BASEVIDHEIGHT-80, 0, M_GetText("Viewpoint:"));
V_DrawCenteredString((BASEVIDWIDTH/6), BASEVIDHEIGHT-64, V_ALLOWLOWERCASE, name);
V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, 0, M_GetText("Viewpoint:"));
V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_ALLOWLOWERCASE, name);
}
// This is where we draw all the fun cheese if you have the chasecam off!
if ((stplyr == &players[displayplayer] && !camera.chase)
/*if ((stplyr == &players[displayplayer] && !camera.chase)
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase)
|| ((splitscreen > 1 && stplyr == &players[thirddisplayplayer]) && !camera3.chase)
|| ((splitscreen > 2 && stplyr == &players[fourthdisplayplayer]) && !camera4.chase))
{
ST_drawFirstPersonHUD();
}
}*/
}
#ifdef HAVE_BLUA
@ -1917,16 +1919,16 @@ static void ST_overlayDrawer(void)
#endif
// draw level title Tails
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset)
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_stagetitle)
#endif
)
ST_drawLevelTitle();
if (!hu_showscores && !splitscreen && netgame && displayplayer == consoleplayer)
if (!hu_showscores && !splitscreen && netgame && displayplayer == consoleplayer && !mapreset)
{
if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player."));
else if (gametype == GT_HIDEANDSEEK &&
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))
@ -1934,15 +1936,15 @@ static void ST_overlayDrawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(116), 0, M_GetText("You cannot move while hiding."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player."));
}
/*else if (!G_RaceGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
else if (!G_RaceGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
if (respawntime > 0 && !stplyr->spectator)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, va(M_GetText("Respawn in: %d second%s."), respawntime, respawntime == 1 ? "" : "s"));
else
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Jump to respawn."));
}*/
else if (stplyr->spectator
}
else*/ if (stplyr->spectator
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_textspectator)
#endif
@ -1950,12 +1952,12 @@ static void ST_overlayDrawer(void)
{
// SRB2kart: changed positions & text
V_DrawString(2, BASEVIDHEIGHT-50, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -"));
/*if (G_GametypeHasTeams())
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));
else if (G_IsSpecialStage(gamemap) && useNightsSS)
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_REDMAP, M_GetText("- CANNOT JOIN -"));
else*/
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Enter Game"));
if (stplyr->pflags & PF_WANTSTOJOIN)
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Cancel Join"));
/*else if (G_GametypeHasTeams())
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/
else
V_DrawString(2, BASEVIDHEIGHT-40, 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-10, V_HUDTRANSHALF, M_GetText("Brake - Sink"));
@ -1968,7 +1970,7 @@ static void ST_overlayDrawer(void)
void ST_Drawer(void)
{
#ifdef SEENAMES
if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo)
if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo && !mapreset)
{
if (cv_seenames.value == 1)
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);

View file

@ -41,7 +41,7 @@ UINT8 *screens[5];
static CV_PossibleValue_t gamma_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
static void CV_usegamma_OnChange(void);
consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allcaps = {"allcaps", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -303,8 +303,9 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
#endif
}
//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5};
UINT8 hudtrans = 0;
static const UINT8 *v_colormap = NULL;
static const UINT8 *v_translevel = NULL;
@ -359,11 +360,11 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT)))
{
if (alphalevel == 13)
alphalevel = hudminusalpha[cv_translucenthud.value];
alphalevel = hudminusalpha[hudtrans];
else if (alphalevel == 14)
alphalevel = 10 - cv_translucenthud.value;
alphalevel = 10 - hudtrans;
/*else if (alphalevel == 15)
alphalevel = hudplusalpha[cv_translucenthud.value];*/
alphalevel = hudplusalpha[hudtrans];*/
if (alphalevel >= 10)
return; // invis
@ -418,7 +419,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
if (scrn & V_FLIP)
{
flip = true;
x -= FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale);
x -= FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1;
}
else
x -= FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale);
@ -449,41 +450,45 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
y = FixedMul(y,dupy<<FRACBITS);
x >>= FRACBITS;
y >>= FRACBITS;
desttop += (y*vid.width) + x;
// Center it if necessary
if (!(scrn & V_SCALEPATCHMASK))
{
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if ((scrn & (V_HORZSCREEN|V_SNAPTOLEFT)) == (V_HORZSCREEN|V_SNAPTOLEFT))
desttop += (vid.width/2 - (BASEVIDWIDTH/2 * dupx));
else if (scrn & V_SNAPTORIGHT)
desttop += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(scrn & V_SNAPTOLEFT))
desttop += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if ((scrn & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
desttop += (vid.height/2 - (BASEVIDHEIGHT/2 * dupy)) * vid.width;
else if (scrn & V_SNAPTOBOTTOM)
desttop += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width;
else if (!(scrn & V_SNAPTOTOP))
desttop += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width / 2;
}
// if it's meant to cover the whole screen, black out the rest
if (x == 0 && FixedMul(SHORT(patch->width)<<FRACBITS, pscale)>>FRACBITS == BASEVIDWIDTH
// BAD, BAD, BAD, FUCK OFF, STOP, EW, AAAAAAA
// This does NOT account for transparent pixels
/*if (x == 0 && FixedMul(SHORT(patch->width)<<FRACBITS, pscale)>>FRACBITS == BASEVIDWIDTH
&& y == 0 && FixedMul(SHORT(patch->height)<<FRACBITS, pscale)>>FRACBITS == BASEVIDHEIGHT)
{
column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[0]));
source = (const UINT8 *)(column) + 3;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}*/
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if ((scrn & (V_HORZSCREEN|V_SNAPTOLEFT)) == (V_HORZSCREEN|V_SNAPTOLEFT))
x += (vid.width/2 - (BASEVIDWIDTH/2 * dupx));
else if (scrn & V_SNAPTORIGHT)
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(scrn & V_SNAPTOLEFT))
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if ((scrn & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
y += (vid.height/2 - (BASEVIDHEIGHT/2 * dupy));
else if (scrn & V_SNAPTOBOTTOM)
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(scrn & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
}
}
desttop += (y*vid.width) + x;
}
if (pscale != FRACUNIT) // scale width properly
@ -589,36 +594,39 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
y = FixedMul(y,dupy<<FRACBITS);
x >>= FRACBITS;
y >>= FRACBITS;
desttop += (y*vid.width) + x;
// Center it if necessary
if (!(scrn & V_SCALEPATCHMASK))
{
// if it's meant to cover the whole screen, black out the rest
// BAD, BAD, BAD, FUCK OFF, STOP, EW, AAAAAAA
// This does NOT account for transparent pixels
/*if (x == 0 && SHORT(patch->width) == BASEVIDWIDTH && y == 0 && SHORT(patch->height) == BASEVIDHEIGHT)
{
column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[0]));
source = (const UINT8 *)(column) + 3;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}*/
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if (scrn & V_SNAPTORIGHT)
desttop += (vid.width - (BASEVIDWIDTH * dupx));
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(scrn & V_SNAPTOLEFT))
desttop += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (scrn & V_SNAPTOBOTTOM)
desttop += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width;
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(scrn & V_SNAPTOTOP))
desttop += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width / 2;
}
// if it's meant to cover the whole screen, black out the rest
if (x == 0 && SHORT(patch->width) == BASEVIDWIDTH && y == 0 && SHORT(patch->height) == BASEVIDHEIGHT)
{
column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[0]));
source = (const UINT8 *)(column) + 3;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
}
}
desttop += (y*vid.width) + x;
}
for (col = sx<<FRACBITS; (col>>FRACBITS) < SHORT(patch->width) && (col>>FRACBITS) < w; col += colfrac, ++x, desttop++)
@ -782,7 +790,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
memset(screens[0], (c&255), vid.width * vid.height * vid.bpp);
return;
}
@ -837,7 +845,227 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
c &= 255;
for (;(--h >= 0) && dest < deststop; dest += vid.width)
memset(dest, (UINT8)(c&255), w * vid.bpp);
memset(dest, c, w * vid.bpp);
}
//
// Fills a triangle of pixels with a single color, NOTE: scaled to screen size
//
// ...
// .. <-- this shape only for now, i'm afraid
// .
//
void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
{
UINT8 *dest;
const UINT8 *deststop;
INT32 w, h, wait = 0;
if (rendermode == render_none)
return;
#ifdef HWRENDER
if (rendermode != render_soft && !con_startup)
{
HWR_DrawDiag(x, y, wh, c);
return;
}
#endif
if (!(c & V_NOSCALESTART))
{
INT32 dupx = vid.dupx, dupy = vid.dupy;
x *= dupx;
y *= dupy;
wh *= dupx;
// Center it if necessary
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if (c & V_SNAPTORIGHT)
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(c & V_SNAPTOLEFT))
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (c & V_SNAPTOBOTTOM)
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(c & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
}
}
if (x >= vid.width || y >= vid.height)
return; // off the screen
if (y < 0)
{
wh += y;
y = 0;
}
w = h = wh;
if (x < 0)
{
w += x;
x = 0;
}
if (w <= 0 || h <= 0)
return; // zero width/height wouldn't draw anything
if (x + w > vid.width)
{
wait = w - (vid.width - x);
w = vid.width - x;
}
if (y + w > vid.height)
h = vid.height - y;
if (h > w)
h = w;
dest = screens[0] + y*vid.width + x;
deststop = screens[0] + vid.rowbytes * vid.height;
c &= 255;
for (;(--h >= 0) && dest < deststop; dest += vid.width)
{
memset(dest, c, w * vid.bpp);
if (wait)
wait--;
else
w--;
}
}
// THANK YOU MPC!!!
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
{
UINT8 *dest;
INT32 u, v;
UINT32 alphalevel = 0;
if (rendermode == render_none)
return;
#ifdef HWRENDER
if (rendermode != render_soft && rendermode != render_none)
{
UINT32 hwcolor;
switch (cons_backcolor.value)
{
case 0: hwcolor = 0xffffff00; break; // White
case 1: hwcolor = 0x80808000; break; // Gray
case 2: hwcolor = 0x40201000; break; // Brown
case 3: hwcolor = 0xff000000; break; // Red
case 4: hwcolor = 0xff800000; break; // Orange
case 5: hwcolor = 0x80800000; break; // Yellow
case 6: hwcolor = 0x00800000; break; // Green
case 7: hwcolor = 0x0000ff00; break; // Blue
case 8: hwcolor = 0x4080ff00; break; // Cyan
// Default green
default: hwcolor = 0x00800000; break;
}
HWR_DrawConsoleFill(x, y, w, h, hwcolor, c); // we still use the regular color stuff but only for flags. actual draw color is "hwcolor" for this.
return;
}
#endif
if (!(c & V_NOSCALESTART))
{
INT32 dupx = vid.dupx, dupy = vid.dupy;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
return;
}
x *= dupx;
y *= dupy;
w *= dupx;
h *= dupy;
// Center it if necessary
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if (c & V_SNAPTORIGHT)
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(c & V_SNAPTOLEFT))
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (c & V_SNAPTOBOTTOM)
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(c & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
}
}
if (x >= vid.width || y >= vid.height)
return; // off the screen
if (x < 0) {
w += x;
x = 0;
}
if (y < 0) {
h += y;
y = 0;
}
if (w <= 0 || h <= 0)
return; // zero width/height wouldn't draw anything
if (x + w > vid.width)
w = vid.width-x;
if (y + h > vid.height)
h = vid.height-y;
dest = screens[0] + y*vid.width + x;
if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT)))
{
if (alphalevel == 13)
alphalevel = hudminusalpha[cv_translucenthud.value];
else if (alphalevel == 14)
alphalevel = 10 - cv_translucenthud.value;
else if (alphalevel == 15)
alphalevel = hudplusalpha[cv_translucenthud.value];
if (alphalevel >= 10)
return; // invis
}
c &= 255;
if (!alphalevel) {
for (v = 0; v < h; v++, dest += vid.width) {
for (u = 0; u < w; u++) {
dest[u] = consolebgmap[dest[u]];
}
}
} else { // mpc 12-04-2018
const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<<FF_TRANSSHIFT) + (c*256));
#define clip(x,y) (x>y) ? y : x
w = clip(w,vid.width);
h = clip(h,vid.height);
for (v = 0; v < h; v++, dest += vid.width) {
for (u = 0; u < w; u++) {
dest[u] = fadetable[consolebgmap[dest[u]]];
}
}
}
}
//
@ -953,25 +1181,34 @@ void V_DrawPatchFill(patch_t *pat)
//
// Fade all the screen buffer, so that the menu is more readable,
// especially now that we use the small hufont in the menus...
// If color is 0x00 to 0xFF, draw transtable (strength range 0-9).
// Else, use COLORMAP lump (strength range 0-31).
// IF YOU ARE NOT CAREFUL, THIS CAN AND WILL CRASH!
// I have kept the safety checks out of this function;
// the v.fadeScreen Lua interface handles those.
//
void V_DrawFadeScreen(void)
void V_DrawFadeScreen(UINT16 color, UINT8 strength)
{
const UINT8 *fadetable = (UINT8 *)colormaps + 16*256;
const UINT8 *deststop = screens[0] + vid.rowbytes * vid.height;
UINT8 *buf = screens[0];
#ifdef HWRENDER
if (rendermode != render_soft && rendermode != render_none)
{
HWR_FadeScreenMenuBack(0x01010160, 0); // hack, 0 means full height
return;
}
if (rendermode != render_soft && rendermode != render_none)
{
HWR_FadeScreenMenuBack(color, strength);
return;
}
#endif
// heavily simplified -- we don't need to know x or y
// position when we're doing a full screen fade
for (; buf < deststop; ++buf)
*buf = fadetable[*buf];
{
const UINT8 *fadetable = ((color & 0xFF00) // Color is not palette index?
? ((UINT8 *)colormaps + strength*256) // Do COLORMAP fade.
: ((UINT8 *)transtables + ((9-strength)<<FF_TRANSSHIFT) + color*256)); // Else, do TRANSMAP** fade.
const UINT8 *deststop = screens[0] + vid.rowbytes * vid.height;
UINT8 *buf = screens[0];
// heavily simplified -- we don't need to know x or y
// position when we're doing a full screen fade
for (; buf < deststop; ++buf)
*buf = fadetable[*buf];
}
}
// Simple translucency with one color, over a set number of lines starting from the top.
@ -1011,7 +1248,7 @@ void V_DrawFadeConsBack(INT32 plines)
// Gets string colormap, used for 0x80 color codes
//
static const UINT8 *V_GetStringColormap(INT32 colorflags)
const UINT8 *V_GetStringColormap(INT32 colorflags)
{
switch ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT)
{
@ -1020,7 +1257,7 @@ static const UINT8 *V_GetStringColormap(INT32 colorflags)
case 2: // 0x82, yellow
return yellowmap;
case 3: // 0x83, lgreen
return lgreenmap;
return greenmap;
case 4: // 0x84, blue
return bluemap;
case 5: // 0x85, red
@ -1029,6 +1266,8 @@ static const UINT8 *V_GetStringColormap(INT32 colorflags)
return graymap;
case 7: // 0x87, orange
return orangemap;
case 8: // 0x88, sky
return skymap;
default: // reset
return NULL;
}
@ -1060,6 +1299,32 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed)
V_DrawScaledPatch(x, y, flags, hu_font[c]);
}
// Writes a single character for the chat. (draw WHITE if bit 7 set)
// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge..
//
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap)
{
INT32 w, flags;
//const UINT8 *colormap = V_GetStringColormap(c);
flags = c & ~(V_CHARCOLORMASK | V_PARAMMASK);
c &= 0x7f;
if (lowercaseallowed)
c -= HU_FONTSTART;
else
c = toupper(c) - HU_FONTSTART;
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
return;
w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution.
if (x + w > vid.width)
return;
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap);
}
// Precompile a wordwrapped string to any given width.
// This is a muuuch better method than V_WORDWRAP.
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
@ -1135,7 +1400,7 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
//
void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
{
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0;
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0;
const char *ch = string;
INT32 charflags = 0;
const UINT8 *colormap = NULL;
@ -1151,7 +1416,12 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
charflags = (option & V_CHARCOLORMASK);
@ -1212,9 +1482,9 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
else
w = SHORT(hu_font[c]->width) * dupx;
if (cx + w > scrwidth)
if (cx > scrwidth)
break;
if (cx < 0) //left boundary check
if (cx+left + w < 0) //left boundary check
{
cx += w;
continue;
@ -1230,7 +1500,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
// SRB2kart
void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
{
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0;
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0;
const char *ch = string;
INT32 charflags = 0;
const UINT8 *colormap = NULL;
@ -1246,7 +1516,11 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
}
charflags = (option & V_CHARCOLORMASK);
@ -1307,9 +1581,9 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
else
w = SHORT(kart_font[c]->width) * dupx;
if (cx + w > scrwidth)
if (cx > scrwidth)
break;
if (cx < 0) //left boundary check
if (cx+left + w < 0) //left boundary check
{
cx += w;
continue;
@ -1341,7 +1615,7 @@ void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string
//
void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
{
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0;
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0;
const char *ch = string;
INT32 charflags = 0;
const UINT8 *colormap = NULL;
@ -1357,7 +1631,12 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
charflags = (option & V_CHARCOLORMASK);
@ -1416,9 +1695,9 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
}
else
w = SHORT(hu_font[c]->width) * dupx / 2;
if (cx + w > scrwidth)
if (cx > scrwidth)
break;
if (cx < 0) //left boundary check
if (cx+left + w < 0) //left boundary check
{
cx += w;
continue;
@ -1443,7 +1722,7 @@ void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *s
//
void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
{
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH;
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, left = 0;
const char *ch = string;
INT32 charflags = 0;
const UINT8 *colormap = NULL;
@ -1459,7 +1738,12 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
charflags = (option & V_CHARCOLORMASK);
@ -1516,9 +1800,9 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
else
w = (SHORT(tny_font[c]->width) * dupx);
if (cx + w > scrwidth)
if (cx > scrwidth)
break;
if (cx < 0) //left boundary check
if (cx+left + w < 0) //left boundary check
{
cx += w;
continue;
@ -1541,7 +1825,7 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st
void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
{
fixed_t cx = x, cy = y;
INT32 w, c, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0;
INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0;
const char *ch = string;
INT32 spacewidth = 4, charwidth = 0;
@ -1555,7 +1839,12 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
switch (option & V_SPACINGMASK)
{
@ -1609,9 +1898,9 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
else
w = SHORT(hu_font[c]->width) * dupx;
if ((cx>>FRACBITS) + w > scrwidth)
if ((cx>>FRACBITS) > scrwidth)
break;
if (cx < 0) //left boundary check
if ((cx>>FRACBITS)+left + w < 0) //left boundary check
{
cx += w<<FRACBITS;
continue;
@ -1711,7 +2000,7 @@ void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string)
}
w = SHORT(cred_font[c]->width) * dupx;
if ((cx>>FRACBITS) + w > scrwidth)
if ((cx>>FRACBITS) > scrwidth)
break;
V_DrawSciencePatch(cx, cy, option, cred_font[c], FRACUNIT);
@ -1747,7 +2036,7 @@ INT32 V_CreditStringWidth(const char *string)
//
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
{
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH;
INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, left = 0;
const char *ch = string;
if (option & V_NOSCALESTART)
@ -1757,7 +2046,12 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
for (;;)
{
@ -1779,11 +2073,9 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
}
w = SHORT(lt_font[c]->width) * dupx;
if (cx + w > scrwidth)
if (cx > scrwidth)
break;
//left boundary check
if (cx < 0)
if (cx+left + w < 0) //left boundary check
{
cx += w;
continue;

View file

@ -43,6 +43,8 @@ const char *GetPalette(void);
extern RGBA_t *pLocalPalette;
extern UINT8 hudtrans;
// Retrieve the ARGB value from a palette color index
#define V_GetColor(color) (pLocalPalette[color&0xFF])
@ -76,6 +78,7 @@ extern RGBA_t *pLocalPalette;
#define V_REDMAP 0x00005000
#define V_GRAYMAP 0x00006000
#define V_ORANGEMAP 0x00007000
#define V_SKYMAP 0x00008000
// use bits 17-20 for alpha transparency
#define V_ALPHASHIFT 16
@ -139,16 +142,22 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum);
// fill a box with a single color
void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
// fill a triangle with a single color
void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c);
// fill a box with a flat as a pattern
void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum);
// fade down the screen buffer before drawing the menu over
void V_DrawFadeScreen(void);
void V_DrawFadeScreen(UINT16 color, UINT8 strength);
void V_DrawFadeConsBack(INT32 plines);
// draw a single character
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
// draw a single character, but for the chat
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap);
const UINT8 *V_GetStringColormap(INT32 colorflags);
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);

View file

@ -161,7 +161,7 @@ static BOOL wasPlaying;
//static INT cdVolume = 0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track
// some crap cd drivers take up to

View file

@ -323,7 +323,6 @@ static inline boolean I_SkipFrame(void)
if (!paused)
return false;
/* FALLTHRU */
case GS_TIMEATTACK:
#ifndef CLIENT_LOADINGSCREEN
case GS_WAITINGPLAYERS:
#endif

View file

@ -159,7 +159,7 @@ static boolean wasPlaying;
//static int cdVolume = 0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track
// some crap cd drivers take up to

File diff suppressed because it is too large Load diff