mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-30 17:00:48 +00:00
Update to ZDoom r2198:
- let players check MF2_NOTRANSLATE so that mods can create player classes which are not subject to default player color handling. - fixed: The ChexPlayer was missing default colorset definitions. - Final Doom needs its finale flats changed, too. - It's "BGCASTCALL", not "BOSSBACK". - Added BOOM/MBF BEX-style narrative background text substitution. There are two changes because of this: * A cluster's flat definition can now be preceded by a $ to do a string table lookup. * Since the standard flat names are now in the LANGUAGE lump, the normal Dehacked substitution for these is no longer handled specially and so will not be automatically disabled merely by providing your own MAPINFO. - Setting a Player.ColorRange now completely disables the translation rather than just making it an identity map. - Added support for the original games' player translations, including Hexen's table-based ones. - Fixed: CheckActorClass needed a NULL check. - Fixed: FFont::StringWidth() counted the ']' character of a named color escape sequence in its width calculation. - Fixed: FSinglePicFont should set the character size by the scaled size of the texture. - Fixed: snd_musicvolume needs to check GSnd for NULL, since somebody might have set an atexit for it, which gets executed after the sound system shuts down. - Fixed: FPlayList::Backup() failed to wrap around below entry 0 because Position is unsigned now. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@744 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
3a83e3ed57
commit
30c977090c
37 changed files with 490 additions and 109 deletions
|
@ -65,6 +65,7 @@ EXTERN_CVAR (Bool, teamplay)
|
|||
CVAR (Float, autoaim, 5000.f, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (String, name, "Player", CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (Color, color, 0x40cf00, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (Int, colorset, 0, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (String, skin, "base", CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (Int, team, TEAM_NONE, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
CVAR (String, gender, "male", CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
|
@ -85,6 +86,7 @@ enum
|
|||
INFO_MoveBob,
|
||||
INFO_StillBob,
|
||||
INFO_PlayerClass,
|
||||
INFO_ColorSet,
|
||||
};
|
||||
|
||||
const char *GenderNames[3] = { "male", "female", "other" };
|
||||
|
@ -101,6 +103,7 @@ static const char *UserInfoStrings[] =
|
|||
"movebob",
|
||||
"stillbob",
|
||||
"playerclass",
|
||||
"colorset",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -184,10 +187,24 @@ int D_PlayerClassToInt (const char *classname)
|
|||
}
|
||||
}
|
||||
|
||||
void D_GetPlayerColor (int player, float *h, float *s, float *v)
|
||||
void D_GetPlayerColor (int player, float *h, float *s, float *v, FPlayerColorSet **set)
|
||||
{
|
||||
userinfo_t *info = &players[player].userinfo;
|
||||
int color = info->color;
|
||||
FPlayerColorSet *colorset = NULL;
|
||||
int color;
|
||||
|
||||
if (players[player].mo != NULL)
|
||||
{
|
||||
colorset = P_GetPlayerColorSet(players[player].mo->GetClass()->TypeName, info->colorset);
|
||||
}
|
||||
if (colorset != NULL)
|
||||
{
|
||||
color = GPalette.BaseColors[GPalette.Remap[colorset->RepresentativeColor]];
|
||||
}
|
||||
else
|
||||
{
|
||||
color = info->color;
|
||||
}
|
||||
|
||||
RGBtoHSV (RPART(color)/255.f, GPART(color)/255.f, BPART(color)/255.f,
|
||||
h, s, v);
|
||||
|
@ -206,6 +223,10 @@ void D_GetPlayerColor (int player, float *h, float *s, float *v)
|
|||
*s = clamp(ts + *s * 0.15f - 0.075f, 0.f, 1.f);
|
||||
*v = clamp(tv + *v * 0.5f - 0.25f, 0.f, 1.f);
|
||||
}
|
||||
if (set != NULL)
|
||||
{
|
||||
*set = colorset;
|
||||
}
|
||||
}
|
||||
|
||||
// Find out which teams are present. If there is only one,
|
||||
|
@ -379,6 +400,7 @@ void D_SetupUserInfo ()
|
|||
coninfo->aimdist = abs ((int)(autoaim * (float)ANGLE_1));
|
||||
}
|
||||
coninfo->color = color;
|
||||
coninfo->colorset = colorset;
|
||||
coninfo->skin = R_FindSkin (skin, 0);
|
||||
coninfo->gender = D_GenderToInt (gender);
|
||||
coninfo->neverswitch = neverswitchonpickup;
|
||||
|
@ -564,6 +586,7 @@ void D_WriteUserInfoStrings (int i, BYTE **stream, bool compact)
|
|||
"\\name\\%s"
|
||||
"\\autoaim\\%g"
|
||||
"\\color\\%x %x %x"
|
||||
"\\colorset\\%d"
|
||||
"\\skin\\%s"
|
||||
"\\team\\%d"
|
||||
"\\gender\\%s"
|
||||
|
@ -574,6 +597,7 @@ void D_WriteUserInfoStrings (int i, BYTE **stream, bool compact)
|
|||
,
|
||||
D_EscapeUserInfo(info->netname).GetChars(),
|
||||
(double)info->aimdist / (float)ANGLE_1,
|
||||
info->colorset,
|
||||
RPART(info->color), GPART(info->color), BPART(info->color),
|
||||
D_EscapeUserInfo(skins[info->skin].name).GetChars(),
|
||||
info->team,
|
||||
|
@ -600,6 +624,7 @@ void D_WriteUserInfoStrings (int i, BYTE **stream, bool compact)
|
|||
"\\%g" // movebob
|
||||
"\\%g" // stillbob
|
||||
"\\%s" // playerclass
|
||||
"\\%d" // colorset
|
||||
,
|
||||
D_EscapeUserInfo(info->netname).GetChars(),
|
||||
(double)info->aimdist / (float)ANGLE_1,
|
||||
|
@ -612,7 +637,8 @@ void D_WriteUserInfoStrings (int i, BYTE **stream, bool compact)
|
|||
(float)(info->MoveBob) / 65536.f,
|
||||
(float)(info->StillBob) / 65536.f,
|
||||
info->PlayerClass == -1 ? "Random" :
|
||||
D_EscapeUserInfo(type->Meta.GetMetaString (APMETA_DisplayName)).GetChars()
|
||||
D_EscapeUserInfo(type->Meta.GetMetaString (APMETA_DisplayName)).GetChars(),
|
||||
info->colorset
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -716,7 +742,15 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
|
|||
break;
|
||||
|
||||
case INFO_Color:
|
||||
info->color = V_GetColorFromString (NULL, value);
|
||||
case INFO_ColorSet:
|
||||
if (infotype == INFO_Color)
|
||||
{
|
||||
info->color = V_GetColorFromString (NULL, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
info->colorset = atoi(value);
|
||||
}
|
||||
R_BuildPlayerTranslation (i);
|
||||
if (StatusBar != NULL && i == StatusBar->GetPlayer())
|
||||
{
|
||||
|
@ -806,6 +840,10 @@ FArchive &operator<< (FArchive &arc, userinfo_t &info)
|
|||
arc.Read (&info.netname, sizeof(info.netname));
|
||||
}
|
||||
arc << info.team << info.aimdist << info.color << info.skin << info.gender << info.neverswitch;
|
||||
if (SaveVersion >= 2193)
|
||||
{
|
||||
arc << info.colorset;
|
||||
}
|
||||
return arc;
|
||||
}
|
||||
|
||||
|
@ -831,6 +869,7 @@ CCMD (playerinfo)
|
|||
Printf ("Team: %s (%d)\n", ui->team == TEAM_NONE ? "None" : Teams[ui->team].GetName (), ui->team);
|
||||
Printf ("Aimdist: %d\n", ui->aimdist);
|
||||
Printf ("Color: %06x\n", ui->color);
|
||||
Printf ("ColorSet: %d\n", ui->colorset);
|
||||
Printf ("Skin: %s (%d)\n", skins[ui->skin].name, ui->skin);
|
||||
Printf ("Gender: %s (%d)\n", GenderNames[ui->gender], ui->gender);
|
||||
Printf ("NeverSwitch: %d\n", ui->neverswitch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue