diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 298f5f9ee..77b18ef8b 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -567,58 +567,7 @@ void SendKick(UINT8 playernum, UINT8 msg) // end of extra data function // ----------------------------------------------------------------- -// ----------------------------------------------------------------- -// extra data function for lmps -// ----------------------------------------------------------------- - -// if extradatabit is set, after the ziped tic you find this: -// -// type | description -// ---------+-------------- -// byte | size of the extradata -// byte | the extradata (xd) bits: see XD_... -// with this byte you know what parameter folow -// if (xd & XDNAMEANDCOLOR) -// byte | color -// char[MAXPLAYERNAME] | name of the player -// endif -// if (xd & XD_WEAPON_PREF) -// byte | original weapon switch: boolean, true if use the old -// | weapon switch methode -// char[NUMWEAPONS] | the weapon switch priority -// byte | autoaim: true if use the old autoaim system -// endif -/*boolean AddLmpExtradata(UINT8 **demo_point, INT32 playernum) -{ - UINT8 *textcmd = D_GetExistingTextcmd(gametic, playernum); - - if (!textcmd) - return false; - - M_Memcpy(*demo_point, textcmd, textcmd[0]+1); - *demo_point += textcmd[0]+1; - return true; -} - -void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum) -{ - UINT8 nextra; - UINT8 *textcmd; - - if (!demo_pointer) - return; - - textcmd = D_GetTextcmd(gametic, playernum); - nextra = **demo_pointer; - M_Memcpy(textcmd, *demo_pointer, nextra + 1); - // increment demo pointer - *demo_pointer += nextra + 1; -}*/ - -// ----------------------------------------------------------------- -// end extra data function for lmps -// ----------------------------------------------------------------- - +// can we get rid of this finally lmao // ----------------------------------------------------------------- // resynch player data // ----------------------------------------------------------------- @@ -1590,70 +1539,6 @@ static boolean CL_SendJoin(void) return HSendPacket(servernode, false, 0, sizeof (clientconfig_pak)); } -static void -CopyCaretColors (char *p, const char *s, int n) -{ - char *t; - int m; - int c; - if (!n) - return; - while (( t = strchr(s, '^') )) - { - m = ( t - s ); - - if (m >= n) - { - memcpy(p, s, n); - return; - } - else - memcpy(p, s, m); - - p += m; - n -= m; - s += m; - - if (!n) - return; - - if (s[1]) - { - c = toupper(s[1]); - if (isdigit(c)) - c = 0x80 + ( c - '0' ); - else if (c >= 'A' && c <= 'F') - c = 0x80 + ( c - 'A' ); - else - c = 0; - - if (c) - { - *p++ = c; - n--; - - if (!n) - return; - } - else - { - if (n < 2) - break; - - memcpy(p, s, 2); - - p += 2; - n -= 2; - } - - s += 2; - } - else - break; - } - strncpy(p, s, n); -} - static void SV_SendServerInfo(INT32 node, tic_t servertime) { UINT8 *p; diff --git a/src/m_misc.c b/src/m_misc.c index 944fbb73c..5a2bc44e3 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1805,6 +1805,72 @@ INT32 axtoi(const char *hexStg) return intValue; } +void CopyCaretColors(char *p, const char *s, int n) +{ + char *t; + int m; + int c; + + if (!n) + return; + + while (( t = strchr(s, '^') )) + { + m = ( t - s ); + + if (m >= n) + { + memcpy(p, s, n); + return; + } + else + memcpy(p, s, m); + + p += m; + n -= m; + s += m; + + if (!n) + return; + + if (s[1]) + { + c = toupper(s[1]); + if (isdigit(c)) + c = 0x80 + ( c - '0' ); + else if (c >= 'A' && c <= 'F') + c = 0x80 + ( c - 'A' ); + else + c = 0; + + if (c) + { + *p++ = c; + n--; + + if (!n) + return; + } + else + { + if (n < 2) + break; + + memcpy(p, s, 2); + + p += 2; + n -= 2; + } + + s += 2; + } + else + break; + } + + strncpy(p, s, n); +} + /** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line. * Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too. * Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped. diff --git a/src/m_misc.h b/src/m_misc.h index 98fbdaee7..eed9cf552 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -81,6 +81,8 @@ void M_SaveConfig(const char *filename); INT32 axtoi(const char *hexStg); +void CopyCaretColors(char *p, const char *s, int n); + const char *GetRevisionString(void); // Vector/matrix math