Accommodate Kart splitscreen code for CHAT via #define NETSPLITSCREEN

This commit is contained in:
mazmazz 2018-12-22 20:52:32 -05:00
parent 0f0e30924f
commit fb3722a6f3
3 changed files with 21 additions and 16 deletions

View file

@ -22,6 +22,7 @@
#define MAXNETNODES 32 #define MAXNETNODES 32
#define BROADCASTADDR MAXNETNODES #define BROADCASTADDR MAXNETNODES
#define MAXSPLITSCREENPLAYERS 2 // Max number of players on a single computer #define MAXSPLITSCREENPLAYERS 2 // Max number of players on a single computer
//#define NETSPLITSCREEN // Kart's splitscreen netgame feature
#define STATLENGTH (TICRATE*2) #define STATLENGTH (TICRATE*2)

View file

@ -1488,27 +1488,27 @@ static void HU_drawChatLog(INT32 offset)
if (chat_scroll > chat_maxscroll) if (chat_scroll > chat_maxscroll)
chat_scroll = chat_maxscroll; chat_scroll = chat_maxscroll;
/*if (splitscreen) #ifdef NETSPLITSCREEN
if (splitscreen)
{ {
boxh = max(6, boxh/2); boxh = max(6, boxh/2);
if (splitscreen > 1) if (splitscreen > 1)
boxw = max(64, boxw/2); boxw = max(64, boxw/2);
}*/ }
#endif
// Unused SRB2KART splitscreen stuff. I'll leave it here in case it ever happens in Vanilla?
y = chaty - offset*charheight - (chat_scroll*charheight) - boxh*charheight - 12; y = chaty - offset*charheight - (chat_scroll*charheight) - boxh*charheight - 12;
/*if (splitscreen) #ifdef NETSPLITSCREEN
if (splitscreen)
{ {
y -= BASEVIDHEIGHT/2; y -= BASEVIDHEIGHT/2;
if (splitscreen > 1) if (splitscreen > 1)
y += 16; y += 16;
}*/ }
#endif
y -= (G_RingSlingerGametype() ? 16 : 0); y -= (G_RingSlingerGametype() ? 16 : 0);
// Unused SRB2KART splitscreen stuff. I'll leave it here in case it ever happens in Vanilla? (x2)
chat_topy = y + chat_scroll*charheight; chat_topy = y + chat_scroll*charheight;
chat_bottomy = chat_topy + boxh*charheight; chat_bottomy = chat_topy + boxh*charheight;
@ -1607,7 +1607,8 @@ static void HU_DrawChat(void)
const char *talk = ntalk; const char *talk = ntalk;
const char *mute = "Chat has been muted."; const char *mute = "Chat has been muted.";
/*if (splitscreen) #ifdef NETSPLITSCREEN
if (splitscreen)
{ {
y -= BASEVIDHEIGHT/2; y -= BASEVIDHEIGHT/2;
if (splitscreen > 1) if (splitscreen > 1)
@ -1615,11 +1616,10 @@ static void HU_DrawChat(void)
y += 16; y += 16;
boxw = max(64, boxw/2); boxw = max(64, boxw/2);
} }
}*/ }
#endif
y -= (G_RingSlingerGametype() ? 16 : 0); y -= (G_RingSlingerGametype() ? 16 : 0);
// More unused SRB2KART stuff.
if (teamtalk) if (teamtalk)
{ {
talk = ttalk; talk = ttalk;
@ -1703,16 +1703,16 @@ static void HU_DrawChat(void)
{ {
INT32 count = 0; INT32 count = 0;
INT32 p_dispy = chaty - charheight -1; INT32 p_dispy = chaty - charheight -1;
/*if (splitscreen) #ifdef NETSPLITSCREEN
if (splitscreen)
{ {
p_dispy -= BASEVIDHEIGHT/2; p_dispy -= BASEVIDHEIGHT/2;
if (splitscreen > 1) if (splitscreen > 1)
p_dispy += 16; p_dispy += 16;
}*/ }
#endif
p_dispy -= (G_RingSlingerGametype() ? 16 : 0); p_dispy -= (G_RingSlingerGametype() ? 16 : 0);
// more kart leftovers.
i = 0; i = 0;
for(i=0; (i<MAXPLAYERS); i++) for(i=0; (i<MAXPLAYERS); i++)
{ {

View file

@ -58,7 +58,11 @@ typedef struct
//------------------------------------ //------------------------------------
#define HU_MAXMSGLEN 224 #define HU_MAXMSGLEN 224
#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
#ifdef NETSPLITSCREEN
#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640) #define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640)
#else
#define OLDCHAT (!splitscreen && (cv_consolechat.value == 1 || dedicated || vid.width < 640))
#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 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 OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.