Merge branch 'public_next'

# Conflicts:
#	src/hardware/hw_md2.c
This commit is contained in:
Monster Iestyn 2018-07-31 19:41:54 +01:00
commit be5d0406bd
10 changed files with 54 additions and 37 deletions

View File

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

View File

@ -395,8 +395,7 @@ static void ExtraDataTicker(void)
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic)); 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]); CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
D_FreeTextcmd(gametic); break;
return;
} }
} }
} }
@ -3326,7 +3325,7 @@ void SV_StopServer(void)
localtextcmd[0] = 0; localtextcmd[0] = 0;
localtextcmd2[0] = 0; localtextcmd2[0] = 0;
for (i = 0; i < BACKUPTICS; i++) for (i = firstticstosend; i < firstticstosend + BACKUPTICS; i++)
D_Clearticcmd(i); D_Clearticcmd(i);
consoleplayer = 0; consoleplayer = 0;

View File

@ -1032,15 +1032,6 @@ void D_SRB2Main(void)
if (M_CheckParm("-password") && M_IsNextParm()) if (M_CheckParm("-password") && M_IsNextParm())
D_SetPassword(M_GetNextParm()); 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 // add any files specified on the command line with -file wadfile
// to the wad list // to the wad list

View File

@ -2725,10 +2725,12 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
#define BASESALT "basepasswordstorage" #define BASESALT "basepasswordstorage"
static UINT8 adminpassmd5[16]; static UINT8 adminpassmd5[16];
static boolean adminpasswordset = false;
void D_SetPassword(const char *pw) void D_SetPassword(const char *pw)
{ {
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5); D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
adminpasswordset = true;
} }
// Remote Administration // Remote Administration
@ -2797,6 +2799,12 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
READMEM(*cp, sentmd5, 16); READMEM(*cp, sentmd5, 16);
if (!adminpasswordset)
{
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
return;
}
if (client) if (client)
return; return;
@ -4066,7 +4074,7 @@ static void Command_RestartAudio_f(void)
I_ShutdownSound(); I_ShutdownSound();
I_StartupSound(); I_StartupSound();
I_InitMusic(); I_InitMusic();
// These must be called or no sound and music until manually set. // These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value); I_SetSfxVolume(cv_soundvolume.value);
@ -4074,7 +4082,7 @@ static void Command_RestartAudio_f(void)
I_SetMIDIMusicVolume(cv_midimusicvolume.value); I_SetMIDIMusicVolume(cv_midimusicvolume.value);
if (Playing()) // Gotta make sure the player is in a level if (Playing()) // Gotta make sure the player is in a level
P_RestoreMusic(&players[consoleplayer]); P_RestoreMusic(&players[consoleplayer]);
} }
/** Quits a game and returns to the title screen. /** Quits a game and returns to the title screen.

View File

@ -987,7 +987,6 @@ static const char *credits[] = {
"\1Programming", "\1Programming",
"Alam \"GBC\" Arias", "Alam \"GBC\" Arias",
"Logan \"GBA\" Arias", "Logan \"GBA\" Arias",
"Colette \"fickle\" Bordelon",
"Callum Dickinson", "Callum Dickinson",
"Scott \"Graue\" Feeney", "Scott \"Graue\" Feeney",
"Nathan \"Jazz\" Giroux", "Nathan \"Jazz\" Giroux",

View File

@ -2115,27 +2115,34 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
} }
else else
{ {
#ifdef ESLOPE // P.S. this is better-organized than the old version fixed_t texturevpeg;
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);
// 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) if (newline)
{ {
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY; texturevpeg = sides[newline->sidenum[0]].rowoffset;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY; if (newline->flags & ML_DONTPEGBOTTOM)
texturevpeg -= *rover->topheight - *rover->bottomheight;
} }
else else
{ {
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY; texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY; 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 #endif
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
@ -4072,7 +4079,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
angle_t shadowdir; angle_t shadowdir;
// Set direction // Set direction
if (splitscreen && stplyr != &players[displayplayer]) if (splitscreen && stplyr == &players[secondarydisplayplayer])
shadowdir = localangle2 + FixedAngle(cv_cam2_rotate.value); shadowdir = localangle2 + FixedAngle(cv_cam2_rotate.value);
else else
shadowdir = localangle + FixedAngle(cv_cam_rotate.value); shadowdir = localangle + FixedAngle(cv_cam_rotate.value);
@ -5480,7 +5487,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
} }
heightsec = thing->subsector->sector->heightsec; 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 if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
{ {

View File

@ -85,7 +85,9 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
deny: deny:
//must be hacked/buggy client //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]); CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ {

View File

@ -8829,7 +8829,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
break; break;
S_StartSound(NULL,sfx_menu1); // Tails S_StartSound(NULL,sfx_menu1); // Tails
l = strlen(setupm_name); l = strlen(setupm_name);
if (l < MAXPLAYERNAME-1) if (l < MAXPLAYERNAME)
{ {
setupm_name[l] = (char)choice; setupm_name[l] = (char)choice;
setupm_name[l+1] = 0; setupm_name[l+1] = 0;

View File

@ -56,7 +56,9 @@ typedef off_t off64_t;
#endif #endif
#endif #endif
#if defined (_WIN32) #if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3))
#define PRIdS "u"
#elif defined (_WIN32)
#define PRIdS "Iu" #define PRIdS "Iu"
#elif defined (DJGPP) #elif defined (DJGPP)
#define PRIdS "u" #define PRIdS "u"

View File

@ -66,6 +66,7 @@ static boolean midimode;
static Mix_Music *music; static Mix_Music *music;
static UINT8 music_volume, midi_volume, sfx_volume; static UINT8 music_volume, midi_volume, sfx_volume;
static float loop_point; static float loop_point;
static boolean songpaused;
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
static Music_Emu *gme; static Music_Emu *gme;
@ -102,6 +103,7 @@ void I_StartupSound(void)
} }
sound_started = true; sound_started = true;
songpaused = false;
Mix_AllocateChannels(256); Mix_AllocateChannels(256);
} }
@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
(void)udata; (void)udata;
// no gme? no music. // no gme? no music.
if (!gme || gme_track_ended(gme)) if (!gme || gme_track_ended(gme) || songpaused)
return; return;
// play gme into stream // play gme into stream
@ -458,7 +460,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
// apply volume to stream // apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++) 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 #endif
@ -476,12 +478,14 @@ void I_PauseSong(INT32 handle)
{ {
(void)handle; (void)handle;
Mix_PauseMusic(); Mix_PauseMusic();
songpaused = true;
} }
void I_ResumeSong(INT32 handle) void I_ResumeSong(INT32 handle)
{ {
(void)handle; (void)handle;
Mix_ResumeMusic(); Mix_ResumeMusic();
songpaused = false;
} }
// //