Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Jisk/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
117 results
Select Git revision
Show changes
Commits on Source (1)
...@@ -1121,32 +1121,10 @@ consvar_t *CV_FindVar(const char *name) ...@@ -1121,32 +1121,10 @@ consvar_t *CV_FindVar(const char *name)
return NULL; return NULL;
} }
/** Builds a unique Net Variable identifier number, which is used
* in network packets instead of the full name.
*
* \param s Name of the variable.
* \return A new unique identifier.
* \sa CV_FindNetVar
*/
static inline UINT16 CV_ComputeNetid(const char *s)
{
UINT16 ret = 0, i = 0;
static UINT16 premiers[16] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};
while (*s)
{
ret = (UINT16)(ret + (*s)*premiers[i]);
s++;
i = (UINT16)((i+1) % 16);
}
return ret;
}
/** Finds a net variable based on its identifier number. /** Finds a net variable based on its identifier number.
* *
* \param netid The variable's identifier number. * \param netid The variable's identifier number.
* \return A pointer to the variable itself if found, or NULL. * \return A pointer to the variable itself if found, or NULL.
* \sa CV_ComputeNetid
*/ */
static consvar_t *CV_FindNetVar(UINT16 netid) static consvar_t *CV_FindNetVar(UINT16 netid)
{ {
...@@ -1167,6 +1145,8 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth); ...@@ -1167,6 +1145,8 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth);
*/ */
void CV_RegisterVar(consvar_t *variable) void CV_RegisterVar(consvar_t *variable)
{ {
static UINT16 id = 1;
// first check to see if it has already been defined // first check to see if it has already been defined
if (CV_FindVar(variable->name)) if (CV_FindVar(variable->name))
{ {
...@@ -1185,7 +1165,8 @@ void CV_RegisterVar(consvar_t *variable) ...@@ -1185,7 +1165,8 @@ void CV_RegisterVar(consvar_t *variable)
if (variable->flags & CV_NETVAR) if (variable->flags & CV_NETVAR)
{ {
const consvar_t *netvar; const consvar_t *netvar;
variable->netid = CV_ComputeNetid(variable->name); variable->netid = id;
id++;
netvar = CV_FindNetVar(variable->netid); netvar = CV_FindNetVar(variable->netid);
if (netvar) if (netvar)
I_Error("Variables %s and %s have same netid\n", variable->name, netvar->name); I_Error("Variables %s and %s have same netid\n", variable->name, netvar->name);
......