Merge branch 'sonicitems' of https://git.magicalgirl.moe/KartKrew/Kart into sonicitems

This commit is contained in:
TehRealSalt 2018-06-30 21:19:54 -04:00
commit e4c96fcd7f
16 changed files with 778 additions and 461 deletions

View File

@ -125,10 +125,12 @@ 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
@ -1326,7 +1328,7 @@ void D_SRB2Main(void)
if (dedicated)
{
nosound = true;
nomidimusic = nodigimusic = true;
/*nomidimusic = */nodigimusic = true;
}
else
{
@ -1335,17 +1337,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

@ -866,7 +866,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
@ -4731,7 +4731,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]);

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)

View File

@ -2014,20 +2014,24 @@ void K_DriftDustHandling(mobj_t *spawner)
if (spawner->player)
{
angle_t playerangle;
if (spawner->player->speed < 5<<FRACBITS)
return;
if (spawner->player->cmd.forwardmove < 0)
if (spawner->player->pflags & PF_SKIDDOWN)
{
playerangle = spawner->angle+ANGLE_180;
anglediff = abs(spawner->angle - spawner->player->frameangle);
if (leveltime % 6 == 0)
S_StartSound(spawner, sfx_screec); // repeated here because it doesn't always happen to be within the range when this is the case
}
else
{
playerangle = spawner->angle;
angle_t playerangle = spawner->angle;
if (spawner->player->speed < 5<<FRACBITS)
return;
if (spawner->player->cmd.forwardmove < 0)
playerangle += ANGLE_180;
anglediff = abs(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy));
}
anglediff = abs(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy));
}
else
{
@ -3746,7 +3750,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else if (player->kartstuff[k_boostcharge] > 50)
{
player->powers[pw_nocontrol] = 40;
S_StartSound(player->mo, sfx_slip);
//S_StartSound(player->mo, sfx_kc34);
S_StartSound(player->mo, sfx_s3k83);
player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse
}
player->kartstuff[k_boostcharge] = 0;
@ -4891,6 +4897,7 @@ static void K_drawKartMinimap(void)
INT32 i = 0;
INT32 x, y;
INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT);
boolean dop1later = false;
// Draw the HUD only when playing in a level.
// hu_stuff needs this, unlike st_stuff.
@ -4942,37 +4949,39 @@ static void K_drawKartMinimap(void)
x -= SHORT(AutomapPic->leftoffset);
y -= SHORT(AutomapPic->topoffset);
// Player's tiny icons on the Automap.
for (i = 0; i < MAXPLAYERS; i++)
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
for (i = MAXPLAYERS-1; i >= 0; i--)
{
if (i == displayplayer && !splitscreen)
continue; // Do displayplayer later
if (players[i].mo && !players[i].spectator)
if (!playeringame[i])
continue;
if (!players[i].mo || players[i].spectator)
continue;
if (!splitscreen && i == displayplayer)
{
if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0)
continue;
if (players[i].kartstuff[k_hyudorotimer] > 0)
{
if ((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2
|| players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2))
&& !(leveltime & 1))
;
else
continue;
}
K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic);
dop1later = true; // Do displayplayer later
continue;
}
if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0)
continue;
if (players[i].kartstuff[k_hyudorotimer] > 0)
{
if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2
|| players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2))
&& !(leveltime & 1)))
continue;
}
K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic);
}
if (splitscreen)
return; // Don't need this for splits
if (!dop1later)
return; // Don't need this
splitflags &= ~V_HUDTRANSHALF;
splitflags |= V_HUDTRANS;
if (stplyr->mo && !stplyr->spectator)
K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic);
K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic);
}
static void K_drawBattleFullscreen(void)

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

@ -3146,7 +3146,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++;
}
}
@ -3167,7 +3167,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

@ -7756,7 +7756,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

@ -6614,14 +6614,24 @@ static void P_MovePlayer(player_t *player)
if (player->mo->state != &states[S_KART_SQUISH])
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
}
else if (player->kartstuff[k_spinouttimer] > 0)
else if (player->kartstuff[k_spinouttimer] > 0 || player->pflags & PF_SLIDING)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
player->frameangle -= ANGLE_22h;
}
else if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0)
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
if (((player->powers[pw_nocontrol] + 5) % 20) < 10)
player->frameangle += ANGLE_11hh;
else
player->frameangle -= ANGLE_11hh;
}
else
{
K_KartMoveAnimation(player);
@ -9518,7 +9528,10 @@ void P_PlayerThink(player_t *player)
player->powers[pw_nights_helper]--;
if (player->powers[pw_nocontrol] & ((1<<15)-1) && player->powers[pw_nocontrol] < UINT16_MAX)
player->powers[pw_nocontrol]--;
{
if (!(--player->powers[pw_nocontrol]))
player->pflags &= ~PF_SKIDDOWN;
}
else
player->powers[pw_nocontrol] = 0;

View File

@ -1346,15 +1346,32 @@ void R_RenderPlayerView(player_t *player)
else
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])

View File

@ -80,7 +80,7 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL
// 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_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};
@ -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)
@ -1470,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)
(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);
@ -1506,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)
@ -1595,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");
@ -1607,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
@ -1618,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;
@ -1627,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,7 +23,7 @@
#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;
@ -72,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.
@ -123,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);

View File

@ -147,7 +147,7 @@ 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},
{"yeeeah", 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},

View File

@ -219,7 +219,7 @@ typedef enum
sfx_drown,
sfx_fizzle,
sfx_gbeep,
sfx_gclose,
sfx_yeeeah,
sfx_ghit,
sfx_gloop,
sfx_gspray,

View File

@ -760,8 +760,9 @@ static void ST_drawLevelTitle(void)
INT32 dupcalc = (vid.width/vid.dupx);
UINT8 gtc = G_GetGametypeColor(gametype);
INT32 sub = 0;
INT32 lvlttly = 145;
INT32 zoney = 169;
INT32 bary = (splitscreen)
? BASEVIDHEIGHT/2
: 163;
INT32 lvlw;
if (timeinmap > 113)
@ -797,30 +798,29 @@ static void ST_drawLevelTitle(void)
{
dupcalc = (dupcalc - BASEVIDWIDTH)>>1;
INT32 h = lvlttly + V_LevelNameHeight(lvlttl) + 2;
V_DrawFill(sub - dupcalc, h+9, ttlnumxpos+dupcalc + 1, 2, 31);
V_DrawDiag(sub + ttlnumxpos + 1, h, 11, 31);
V_DrawFill(sub - dupcalc, h, ttlnumxpos+dupcalc, 10, gtc);
V_DrawDiag(sub + ttlnumxpos, h, 10, gtc);
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, h+1, V_ALLOWLOWERCASE, va("%s - %s", gametype_cons_t[gametype].strvalue, subttl));
V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttl);
else
V_DrawRightAlignedString(sub + zonexpos - 8, h+1, V_ALLOWLOWERCASE, gametype_cons_t[gametype].strvalue);
V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue));
}
ttlnumxpos += sub;
lvlttlxpos += sub;
zonexpos += sub;
if (strlen(actnum) > 0)
V_DrawLevelTitle(ttlnumxpos+12, zoney, 0, actnum);
V_DrawLevelTitle(lvlttlxpos, lvlttly, 0, lvlttl);
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 (strlen(actnum) > 0)
V_DrawLevelTitle(ttlnumxpos+12, bary+6, 0, actnum);
}
/*

View File

@ -2442,6 +2442,8 @@ void Y_VoteTicker(void)
{
voteendtic = votetic + (3*TICRATE);
S_StartSound(NULL, sfx_kc48);
if (P_IsLocalPlayer(&players[pickedvote]))
S_StartSound(NULL, sfx_yeeeah);
}
}
}
@ -2674,6 +2676,7 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
if (pick == -1) // No other votes? We gotta get out of here, then!
{
timer = 0;
deferredgametype = gametype;
Y_UnloadVoteData();
Y_FollowIntermission();
return;
@ -2714,8 +2717,10 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
else if (endtype == 1) // Only one unique vote, so just end it immediately.
{
voteendtic = votetic + (5*TICRATE);
S_StartSound(NULL, sfx_kc48);
S_ChangeMusicInternal("voteeb", false);
S_StartSound(NULL, sfx_kc48);
if (P_IsLocalPlayer(&players[pick]))
S_StartSound(NULL, sfx_yeeeah);
}
else
S_ChangeMusicInternal("voteea", true);