Merge branch SRB2:next into issue1211

This commit is contained in:
SSNTails 2024-02-28 02:36:38 +00:00
commit 3db69342d9
18 changed files with 277 additions and 100 deletions

View file

@ -603,6 +603,7 @@ typedef struct player_s
boolean spectator;
boolean outofcoop;
boolean removing;
boolean muted;
UINT8 bot;
struct player_s *botleader;
UINT16 lastbuttons;

View file

@ -465,9 +465,12 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
numwords = COM_Argc() - usedargs;
I_Assert(numwords > 0);
if (CHAT_MUTE) // TODO: Per Player mute.
if (CHAT_MUTE)
{
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
if (cv_mute.value)
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
else
HU_AddChatText(va("%s>ERROR: You have been muted. You can't say anything.", "\x85"), false);
return;
}
@ -644,9 +647,9 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
msg = (char *)*p;
SKIPSTRINGL(*p, HU_MAXMSGLEN + 1);
if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
if ((cv_mute.value || players[playernum].muted || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
{
CONS_Alert(CONS_WARNING, cv_mute.value ?
CONS_Alert(CONS_WARNING, (cv_mute.value || players[playernum].muted) ?
M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"),
player_names[playernum]);
if (server)
@ -962,7 +965,10 @@ static void HU_sendChatMessage(void)
// last minute mute check
if (CHAT_MUTE)
{
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
if (cv_mute.value)
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
else
HU_AddChatText(va("%s>ERROR: You have been muted. You can't say anything.", "\x85"), false);
return;
}
@ -1567,7 +1573,6 @@ static void HU_DrawChat(void)
INT32 cflag = 0;
const char *ntalk = "Say: ", *ttalk = "Team: ";
const char *talk = ntalk;
const char *mute = "Chat has been muted.";
#ifdef NETSPLITSCREEN
if (splitscreen)
@ -1594,7 +1599,10 @@ static void HU_DrawChat(void)
if (CHAT_MUTE)
{
talk = mute;
if (cv_mute.value)
talk = "Chat has been muted.";
else
talk = "You have been muted.";
typelines = 1;
cflag = V_GRAYMAP; // set text in gray if chat is muted.
}

View file

@ -69,8 +69,8 @@ typedef struct
#else
#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640 || splitscreen)
#endif
#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
#define CHAT_MUTE ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
#define OLD_MUTE (OLDCHAT && (cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
// some functions
void HU_AddChatText(const char *text, boolean playsound);

View file

@ -19,6 +19,7 @@ enum hud {
hud_stagetitle = 0,
hud_textspectator,
hud_crosshair,
hud_powerups,
// Singleplayer / Co-op
hud_score,
hud_time,

View file

@ -41,6 +41,7 @@ static const char *const hud_disable_options[] = {
"stagetitle",
"textspectator",
"crosshair",
"powerups",
"score",
"time",

View file

@ -1432,14 +1432,22 @@ void OP_ObjectplaceMovement(player_t *player)
//
// Objectplace related commands.
//
/*void Command_Writethings_f(void)
void Command_Writethings_f(void)
{
REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER;
REQUIRE_OBJECTPLACE;
P_WriteThings();
}*/
if (COM_Argc() > 1)
{
P_WriteThings(COM_Argv(1));
}
else
{
CONS_Printf(M_GetText("writethings <filename>: write out map things to a file, .txt or .lmp automatically appended.\n"));
return;
}
}
void Command_ObjectPlace_f(void)
{

View file

@ -26,7 +26,7 @@ void cht_Init(void);
// ObjectPlace
//
void Command_ObjectPlace_f(void);
//void Command_Writethings_f(void);
void Command_Writethings_f(void);
extern consvar_t cv_opflags, cv_ophoopflags, cv_mapthingnum, cv_speed;
//extern consvar_t cv_snapto, cv_grid;

View file

@ -41,6 +41,8 @@ typedef struct banreason_s
static banreason_t *reasontail = NULL; //last entry, use prev
static banreason_t *reasonhead = NULL; //1st entry, use next
static boolean bans_loaded = false;
void Ban_Add(const char *reason)
{
banreason_t *reasonlist = malloc(sizeof(*reasonlist));
@ -85,6 +87,8 @@ void Ban_Load_File(boolean warning)
if (!I_ClearBans)
return;
bans_loaded = true;
f = fopen(va("%s"PATHSEP"%s", srb2home, "ban.txt"), "r");
if (!f)
@ -124,6 +128,12 @@ void D_SaveBan(void)
const char *address, *mask;
const char *path = va("%s"PATHSEP"%s", srb2home, "ban.txt");
if (!bans_loaded)
{
// don't save bans if they were never loaded.
return;
}
if (!reasonhead)
{
remove(path);

View file

@ -149,6 +149,10 @@ static void Command_Teamchange_f(void);
static void Command_Teamchange2_f(void);
static void Command_ServerTeamChange_f(void);
static void Command_MutePlayer_f(void);
static void Command_UnmutePlayer_f(void);
static void Got_MutePlayer(UINT8 **cp, INT32 playernum);
static void Command_Clearscores_f(void);
// Remote Administration
@ -488,6 +492,10 @@ void D_RegisterServerCommands(void)
RegisterNetXCmd(XD_TEAMCHANGE, Got_Teamchange);
COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, COM_LUA);
RegisterNetXCmd(XD_MUTEPLAYER, Got_MutePlayer);
COM_AddCommand("muteplayer", Command_MutePlayer_f, COM_LUA);
COM_AddCommand("unmuteplayer", Command_UnmutePlayer_f, COM_LUA);
RegisterNetXCmd(XD_CLEARSCORES, Got_Clearscores);
COM_AddCommand("clearscores", Command_Clearscores_f, COM_LUA);
COM_AddCommand("map", Command_Map_f, COM_LUA);
@ -913,7 +921,7 @@ void D_RegisterClientCommands(void)
// ingame object placing
COM_AddCommand("objectplace", Command_ObjectPlace_f, COM_LUA);
//COM_AddCommand("writethings", Command_Writethings_f);
COM_AddCommand("writethings", Command_Writethings_f, COM_LUA);
CV_RegisterVar(&cv_speed);
CV_RegisterVar(&cv_opflags);
CV_RegisterVar(&cv_ophoopflags);
@ -1315,7 +1323,7 @@ static void SendNameAndColor(void)
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
HU_AddChatText("\x85*You must wait to change your name again", false);
}
else if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
else if ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer)))
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
else // Cleanup name if changing it
CleanupPlayerName(consoleplayer, cv_playername.zstring);
@ -2490,6 +2498,91 @@ static void Command_Teamchange2_f(void)
SendNetXCmd2(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
}
static void MutePlayer(boolean mute)
{
UINT8 data[2];
if (!(server || (IsPlayerAdmin(consoleplayer))))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
}
if (COM_Argc() < 2)
{
CONS_Printf(M_GetText("muteplayer <playernum>: mute a player\n"));
return;
}
data[0] = atoi(COM_Argv(1));
if (data[0] >= MAXPLAYERS || !playeringame[data[0]])
{
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %u!\n"), (unsigned int)data[0]);
return;
}
if (players[data[0]].muted && mute)
{
CONS_Printf(M_GetText("%s is already muted!\n"), player_names[data[0]]);
return;
}
else if (!players[data[0]].muted && !mute)
{
CONS_Printf(M_GetText("%s is not muted!\n"), player_names[data[0]]);
return;
}
data[1] = mute;
SendNetXCmd(XD_MUTEPLAYER, &data, sizeof(data));
}
static void Command_MutePlayer_f(void)
{
MutePlayer(true);
}
static void Command_UnmutePlayer_f(void)
{
MutePlayer(false);
}
static void Got_MutePlayer(UINT8 **cp, INT32 playernum)
{
UINT8 player = READUINT8(*cp);
UINT8 muted = READUINT8(*cp);
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal mute received from player %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
return;
}
if (player >= MAXPLAYERS || !playeringame[player])
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal mute received from player %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
return;
}
if (!players[player].muted && muted)
{
if (player == consoleplayer)
CONS_Printf(M_GetText("You have been muted.\n"));
else
CONS_Printf(M_GetText("%s has been muted.\n"), player_names[player]);
}
else if (players[player].muted && !muted)
{
if (player == consoleplayer)
CONS_Printf(M_GetText("You are no longer muted.\n"));
else
CONS_Printf(M_GetText("%s is no longer muted.\n"), player_names[player]);
}
players[player].muted = muted;
}
static void Command_ServerTeamChange_f(void)
{
changeteam_union NetPacket;
@ -4787,7 +4880,7 @@ static void ForceSkin_OnChange(void)
//Allows the player's name to be changed if cv_mute is off.
static void Name_OnChange(void)
{
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
if ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer)))
{
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
@ -4798,7 +4891,7 @@ static void Name_OnChange(void)
static void Name2_OnChange(void)
{
if (cv_mute.value) //Secondary player can't be admin.
if (cv_mute.value || players[consoleplayer].muted) //Secondary player can't be admin.
{
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
CV_StealthSet(&cv_playername2, player_names[secondarydisplayplayer]);

View file

@ -147,6 +147,7 @@ typedef enum
XD_LUACMD, // 22
XD_LUAVAR, // 23
XD_LUAFILE, // 24
XD_MUTEPLAYER, // 25
MAXNETXCMD
} netxcmd_t;

View file

@ -170,6 +170,7 @@ static void P_NetArchivePlayers(void)
WRITEUINT8(save_p, players[i].panim);
WRITEUINT8(save_p, players[i].stronganim);
WRITEUINT8(save_p, players[i].spectator);
WRITEUINT8(save_p, players[i].muted);
WRITEUINT16(save_p, players[i].flashpal);
WRITEUINT16(save_p, players[i].flashcount);
@ -399,6 +400,7 @@ static void P_NetUnArchivePlayers(void)
players[i].panim = READUINT8(save_p);
players[i].stronganim = READUINT8(save_p);
players[i].spectator = READUINT8(save_p);
players[i].muted = READUINT8(save_p);
players[i].flashpal = READUINT16(save_p);
players[i].flashcount = READUINT16(save_p);

View file

@ -877,14 +877,32 @@ static void P_SpawnMapThings(boolean spawnemblems)
P_SpawnEmeraldHunt();
}
static void P_WriteTextmap_Things(FILE *f, const mapthing_t *wmapthings); // proto
// Experimental groovy write function!
/*void P_WriteThings(void)
void P_WriteThings(const char *filepath)
{
size_t i, length;
mapthing_t *mt;
UINT8 *savebuffer, *savebuf_p;
INT16 temp;
if (udmf)
{
FILE *f = fopen(va("%s.txt", filepath), "w");
if (!f)
{
CONS_Alert(CONS_ERROR, M_GetText("Couldn't write to file %s\n"), filepath);
return;
}
P_WriteTextmap_Things(f, mapthings);
fclose(f);
CONS_Printf(M_GetText("%s.txt saved.\n"), filepath);
return;
}
savebuf_p = savebuffer = (UINT8 *)malloc(nummapthings * sizeof (mapthing_t));
if (!savebuf_p)
@ -908,12 +926,12 @@ static void P_SpawnMapThings(boolean spawnemblems)
length = savebuf_p - savebuffer;
FIL_WriteFile(va("newthings%d.lmp", gamemap), savebuffer, length);
FIL_WriteFile(va("%s.lmp", filepath), savebuffer, length);
free(savebuffer);
savebuf_p = NULL;
CONS_Printf(M_GetText("newthings%d.lmp saved.\n"), gamemap);
}*/
CONS_Printf(M_GetText("%s.lmp saved.\n"), filepath);
}
//
// MAP LOADING FUNCTIONS
@ -2150,6 +2168,60 @@ typedef struct
mapthing_t *angleanchor;
} sectorspecialthings_t;
static void P_WriteTextmap_Things(FILE *f, const mapthing_t *wmapthings)
{
size_t i, j;
mtag_t firsttag;
// Actual writing
for (i = 0; i < nummapthings; i++)
{
fprintf(f, "thing // %s\n", sizeu1(i));
fprintf(f, "{\n");
firsttag = Tag_FGet(&wmapthings[i].tags);
if (firsttag != 0)
fprintf(f, "id = %d;\n", firsttag);
if (wmapthings[i].tags.count > 1)
{
fprintf(f, "moreids = \"");
for (j = 1; j < wmapthings[i].tags.count; j++)
{
if (j > 1)
fprintf(f, " ");
fprintf(f, "%d", wmapthings[i].tags.tags[j]);
}
fprintf(f, "\";\n");
}
fprintf(f, "x = %d;\n", wmapthings[i].x);
fprintf(f, "y = %d;\n", wmapthings[i].y);
if (wmapthings[i].z != 0)
fprintf(f, "height = %d;\n", wmapthings[i].z);
fprintf(f, "angle = %d;\n", wmapthings[i].angle);
if (wmapthings[i].pitch != 0)
fprintf(f, "pitch = %d;\n", wmapthings[i].pitch);
if (wmapthings[i].roll != 0)
fprintf(f, "roll = %d;\n", wmapthings[i].roll);
if (wmapthings[i].type != 0)
fprintf(f, "type = %d;\n", wmapthings[i].type);
if (wmapthings[i].spritexscale != FRACUNIT)
fprintf(f, "scalex = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spritexscale));
if (wmapthings[i].spriteyscale != FRACUNIT)
fprintf(f, "scaley = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spriteyscale));
if (wmapthings[i].scale != FRACUNIT)
fprintf(f, "mobjscale = %f;\n", FIXED_TO_FLOAT(wmapthings[i].scale));
if (wmapthings[i].options & MTF_OBJECTFLIP)
fprintf(f, "flip = true;\n");
for (j = 0; j < NUMMAPTHINGARGS; j++)
if (wmapthings[i].args[j] != 0)
fprintf(f, "arg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]);
for (j = 0; j < NUMMAPTHINGSTRINGARGS; j++)
if (mapthings[i].stringargs[j])
fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]);
fprintf(f, "}\n");
fprintf(f, "\n");
}
}
static void P_WriteTextmap(void)
{
size_t i, j;
@ -2417,52 +2489,7 @@ static void P_WriteTextmap(void)
}
fprintf(f, "namespace = \"srb2\";\n");
for (i = 0; i < nummapthings; i++)
{
fprintf(f, "thing // %s\n", sizeu1(i));
fprintf(f, "{\n");
firsttag = Tag_FGet(&wmapthings[i].tags);
if (firsttag != 0)
fprintf(f, "id = %d;\n", firsttag);
if (wmapthings[i].tags.count > 1)
{
fprintf(f, "moreids = \"");
for (j = 1; j < wmapthings[i].tags.count; j++)
{
if (j > 1)
fprintf(f, " ");
fprintf(f, "%d", wmapthings[i].tags.tags[j]);
}
fprintf(f, "\";\n");
}
fprintf(f, "x = %d;\n", wmapthings[i].x);
fprintf(f, "y = %d;\n", wmapthings[i].y);
if (wmapthings[i].z != 0)
fprintf(f, "height = %d;\n", wmapthings[i].z);
fprintf(f, "angle = %d;\n", wmapthings[i].angle);
if (wmapthings[i].pitch != 0)
fprintf(f, "pitch = %d;\n", wmapthings[i].pitch);
if (wmapthings[i].roll != 0)
fprintf(f, "roll = %d;\n", wmapthings[i].roll);
if (wmapthings[i].type != 0)
fprintf(f, "type = %d;\n", wmapthings[i].type);
if (wmapthings[i].spritexscale != FRACUNIT)
fprintf(f, "scalex = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spritexscale));
if (wmapthings[i].spriteyscale != FRACUNIT)
fprintf(f, "scaley = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spriteyscale));
if (wmapthings[i].scale != FRACUNIT)
fprintf(f, "mobjscale = %f;\n", FIXED_TO_FLOAT(wmapthings[i].scale));
if (wmapthings[i].options & MTF_OBJECTFLIP)
fprintf(f, "flip = true;\n");
for (j = 0; j < NUMMAPTHINGARGS; j++)
if (wmapthings[i].args[j] != 0)
fprintf(f, "arg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]);
for (j = 0; j < NUMMAPTHINGSTRINGARGS; j++)
if (mapthings[i].stringargs[j])
fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]);
fprintf(f, "}\n");
fprintf(f, "\n");
}
P_WriteTextmap_Things(f, wmapthings);
for (i = 0; i < numvertexes; i++)
{

View file

@ -71,7 +71,7 @@ boolean P_AddFolder(const char *folderpath);
boolean P_RunSOC(const char *socfilename);
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
void P_LoadMusicsRange(UINT16 wadnum, UINT16 first, UINT16 num);
//void P_WriteThings(void);
void P_WriteThings(const char *filepath);
size_t P_PrecacheLevelFlats(void);
void P_AllocMapHeader(INT16 i);

View file

@ -186,7 +186,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (frontsector->numlights)
{
dc_numlights = frontsector->numlights;
if (dc_numlights >= dc_maxlights)
if (dc_numlights > dc_maxlights)
{
dc_maxlights = dc_numlights;
dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL);
@ -342,7 +342,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
{
lighttable_t **xwalllights;
sprbotscreen = INT32_MAX;
sprtopscreen = windowtop = (centeryfrac - FixedMul(dc_texturemid, spryscale));
realbot = FixedMul(textureheight[texnum], spryscale) + sprtopscreen;
@ -449,10 +448,13 @@ static void R_DrawRepeatMaskedColumn(column_t *col, unsigned lengthcol)
static void R_DrawRepeatFlippedMaskedColumn(column_t *col, unsigned lengthcol)
{
do {
while (sprtopscreen < sprbotscreen) {
R_DrawFlippedMaskedColumn(col, lengthcol);
sprtopscreen += dc_texheight*spryscale;
} while (sprtopscreen < sprbotscreen);
if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
sprtopscreen = INT32_MAX;
else
sprtopscreen += dc_texheight*spryscale;
}
}
// Returns true if a fake floor is translucent.
@ -742,7 +744,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (textures[texnum]->flip & 2) // vertically flipped?
colfunc_2s = R_DrawRepeatFlippedMaskedColumn;
else
colfunc_2s = R_DrawRepeatMaskedColumn; // render the usual 2sided single-patch packed texture
colfunc_2s = R_DrawRepeatMaskedColumn;
lengthcol = textures[texnum]->height;
@ -787,6 +789,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
else if (bottom_frac > (INT64)CLAMPMIN) sprbotscreen = windowbottom = (fixed_t)bottom_frac;
else sprbotscreen = windowbottom = CLAMPMIN;
fixed_t bottomclip = sprbotscreen;
top_frac += top_step;
bottom_frac += bottom_step;
@ -819,14 +823,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
lighttable_t **xwalllights;
fixed_t height;
fixed_t bheight = 0;
INT32 solid = 0;
INT32 lighteffect = 0;
boolean lighteffect = false;
for (i = 0; i < dc_numlights; i++)
{
// Check if the current light effects the colormap/lightlevel
rlight = &dc_lightlist[i];
lighteffect = !(dc_lightlist[i].flags & FOF_NOSHADE);
lighteffect = !(rlight->flags & FOF_NOSHADE);
if (lighteffect)
{
lightnum = rlight->lightnum;
@ -859,11 +862,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
}
}
solid = 0; // don't carry over solid-cutting flag from the previous light
// Check if the current light can cut the current 3D floor.
boolean solid = false;
if (rlight->flags & FOF_CUTSOLIDS && !(pfloor->fofflags & FOF_EXTRA))
solid = 1;
solid = true;
else if (rlight->flags & FOF_CUTEXTRA && pfloor->fofflags & FOF_EXTRA)
{
if (rlight->flags & FOF_EXTRA)
@ -871,13 +874,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
// The light is from an extra 3D floor... Check the flags so
// there are no undesired cuts.
if ((rlight->flags & (FOF_FOG|FOF_SWIMMABLE)) == (pfloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)))
solid = 1;
solid = true;
}
else
solid = 1;
solid = true;
}
else
solid = 0;
solid = false;
height = rlight->height;
rlight->height += rlight->heightstep;
@ -893,14 +896,14 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (lighteffect)
dc_colormap = rlight->rcolormap;
if (solid && windowtop < bheight)
windowtop = bheight;
sprtopscreen = windowtop = bheight;
continue;
}
windowbottom = height;
if (windowbottom >= sprbotscreen)
sprbotscreen = windowbottom = height;
if (windowbottom >= bottomclip)
{
windowbottom = sprbotscreen;
sprbotscreen = windowbottom = bottomclip;
// draw the texture
colfunc_2s (col, lengthcol);
for (i++; i < dc_numlights; i++)
@ -918,10 +921,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
windowtop = bheight;
else
windowtop = windowbottom + 1;
sprtopscreen = windowtop;
if (lighteffect)
dc_colormap = rlight->rcolormap;
}
windowbottom = sprbotscreen;
sprbotscreen = windowbottom = bottomclip;
// draw the texture, if there is any space left
if (windowtop < windowbottom)
colfunc_2s (col, lengthcol);
@ -1022,6 +1026,9 @@ static void R_RenderSegLoop (void)
if (bottomtexture)
R_CheckTextureCache(bottomtexture);
if (dc_numlights)
colfunc = colfuncs[COLDRAWFUNC_SHADOWED];
for (; rw_x < rw_stopx; rw_x++)
{
// mark floor / ceiling areas
@ -1234,8 +1241,6 @@ static void R_RenderSegLoop (void)
dc_lightlist[i].rcolormap = dc_lightlist[i].extra_colormap->colormap + (xwalllights[pindex] - colormaps);
else
dc_lightlist[i].rcolormap = xwalllights[pindex];
colfunc = colfuncs[COLDRAWFUNC_SHADOWED];
}
}
@ -2449,7 +2454,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (frontsector->numlights)
{
dc_numlights = frontsector->numlights;
if (dc_numlights >= dc_maxlights)
if (dc_numlights > dc_maxlights)
{
dc_maxlights = dc_numlights;
dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL);

View file

@ -44,6 +44,8 @@
// SRB2Kart
#include "r_fps.h" // R_GetFramerateCap
#include "lua_hud.h" // LUA_HudEnabled
// --------------------------------------------
// assembly or c drawer routines for 8bpp/16bpp
// --------------------------------------------
@ -494,6 +496,7 @@ void SCR_ClosedCaptions(void)
basey -= 8;
else if ((modeattacking == ATTACKING_NIGHTS)
|| (!(maptol & TOL_NIGHTS)
&& LUA_HudEnabled(hud_powerups)
&& ((cv_powerupdisplay.value == 2) // "Always"
|| (cv_powerupdisplay.value == 1 && !camera.chase)))) // "First-person only"
basey -= 16;

View file

@ -191,7 +191,8 @@
<ClCompile>
<DisableSpecificWarnings>4244;4267;4146;4003</DisableSpecificWarnings>
<PreprocessorDefinitions>HAVE_CURL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\libs\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\libs\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<CustomBuild>
<Command />
@ -204,7 +205,7 @@
</CustomBuild>
<Link>
<AdditionalDependencies>libcurl.dll.a;libz32.a;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\libs\zlib\win32;..\libs\curl\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\libs\zlib\win32;..\..\libs\curl\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

View file

@ -140,15 +140,18 @@ static void Midiplayer_Onchange(void)
restart = true;
}
if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
{
if (!Mix_SetSoundFonts(cv_midisoundfontpath.string)) // == 0 means error
CONS_Alert(CONS_ERROR, "Sound font error: %s", Mix_GetError());
else
restart = true;
}
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string);
#endif
if (restart)
S_StartEx(true);
@ -159,7 +162,7 @@ static void MidiSoundfontPath_Onchange(void)
if (Mix_GetMidiPlayer() != MIDI_Fluidsynth || (I_SongType() != MU_NONE && I_SongType() != MU_MID_EX))
return;
if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
{
char *miditoken;
char *source = strdup(cv_midisoundfontpath.string);
@ -286,8 +289,12 @@ void I_StartupSound(void)
#ifdef HAVE_MIXERX
Mix_SetMidiPlayer(cv_midiplayer.value);
Mix_SetSoundFonts(cv_midisoundfontpath.string);
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string);
#endif
#endif
#if SDL_MIXER_VERSION_ATLEAST(1,2,11)
Mix_Init(MIX_INIT_FLAC|MIX_INIT_MP3|MIX_INIT_OGG|MIX_INIT_MOD);
#endif
@ -942,7 +949,12 @@ UINT32 I_GetSongLength(void)
else
{
#ifdef HAVE_MIXERX
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
double xlength = Mix_MusicDuration(music);
#else
double xlength = Mix_GetMusicTotalTime(music);
#endif
if (xlength >= 0)
return (UINT32)(xlength*1000);
#endif
@ -1198,10 +1210,14 @@ boolean I_LoadSong(char *data, size_t len)
#ifdef HAVE_MIXERX
if (Mix_GetMidiPlayer() != cv_midiplayer.value)
Mix_SetMidiPlayer(cv_midiplayer.value);
if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
Mix_SetSoundFonts(cv_midisoundfontpath.string);
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string); // this overwrites previous custom path
#endif
#endif
#ifdef HAVE_OPENMPT
/*

View file

@ -2821,14 +2821,14 @@ static void ST_overlayDrawer(void)
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase))
{
ST_drawFirstPersonHUD();
if (cv_powerupdisplay.value)
if (cv_powerupdisplay.value && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
}
else if (cv_powerupdisplay.value == 2)
else if (cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
}
else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2)
else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
if (!(netgame || multiplayer) || !hu_showscores)