mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-27 08:07:17 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96bf729c54 | ||
|
|
edcf521506 | ||
|
|
9e7991f4b1 | ||
|
|
86e7a24b38 | ||
|
|
ff587a8444 | ||
|
|
c3e98ed681 | ||
|
|
cc2d698fe2 | ||
|
|
420161095f | ||
|
|
58b0d335e7 | ||
|
|
ce336e8962 | ||
|
|
5b72eb189a | ||
|
|
7600d3ca02 | ||
|
|
8c3be9d549 | ||
|
|
2ddb534321 | ||
|
|
21a1f61b04 | ||
|
|
7219848655 | ||
|
|
4695449fc7 | ||
|
|
af3dd2602b |
No files matched your search
@@ -2,22 +2,23 @@
|
||||
|
||||
| Path | Description |
|
||||
| ---------------------|-------------------------------------------------------------------
|
||||
| build/ | Output files |
|
||||
| code/ | OpenMoHAA source code |
|
||||
| code/cgame | Client game code |
|
||||
| code/client | Client (network stuff, snapshots, etc) |
|
||||
| code/game | Server game code (game logic stuff, etc) |
|
||||
| code/gamespy | Gamespy SDK |
|
||||
| code/mohui | MoHAA User Interface |
|
||||
| code/null | Null redirector (used by the OpenMoHAA Dedicated Server) |
|
||||
| code/parser | Flex/Bison parser |
|
||||
| code/qcommon | Global shared stuff such as maths |
|
||||
| code/renderer | OpenMoHAA renderer |
|
||||
| code/sdl(12) | SDL code |
|
||||
| code/script | Script engine |
|
||||
| code/server | Server code (networkn snapshots, handling clients etc) |
|
||||
| code/server | Server code (network, snapshots, handling clients etc) |
|
||||
| code/skeletor | Skeleton model engine |
|
||||
| code/sys | Main application system |
|
||||
| code/tiki | Complete TIKI engine |
|
||||
| code/uilib | UI library (Ubertools stuff) |
|
||||
| code/{win32,unix} | Platform-specific code |
|
||||
| docker | Docker files, for compiling on various linux versions |
|
||||
| docs | Documentation stuff |
|
||||
| misc/ | Project stuff, definition files and various resources stuff. |
|
||||
@@ -41,7 +41,7 @@ Here is the current working state for each part of the engine:
|
||||
| Server module (fgame) | | x | | | | | Actor, vehicle, and few gameplay bugs |
|
||||
| UI | | | | x | | | Has core features only (menu, widgets, console, hud, urc loading) |
|
||||
|
||||
NOTE: Both client and server version can be compiled to target **Medal of Honor: Spearhead* and **Medal of Honor: Breakthrough**.
|
||||
NOTE: Both client and server version can be compiled to target **Medal of Honor: Spearhead** and **Medal of Honor: Breakthrough**.
|
||||
|
||||
## Running
|
||||
|
||||
@@ -74,6 +74,8 @@ The installation directory can be set to MOHAA directory.
|
||||
|
||||
The client build can be built by adding `-DWITH_CLIENT=1` to the CMake command line. This will compile the cgame module and the full app with rendering, ui and sound suppport, alongside the dedicated server version.
|
||||
|
||||
To compile for either Spearhead or Breakthrough, append `-DTARGET_GAME_TYPE=x` where x can be 1 for Team Assault (Spearhead), and 2 for Team Tactics (Breakthrough). 2 is recommended because Team Tactics can connect to both Spearhead and Breakthrough servers.
|
||||
|
||||
### Linux
|
||||
|
||||
These are the tools required on Unix :
|
||||
|
||||
@@ -1023,6 +1023,118 @@ void CG_DrawInstantMessageMenu()
|
||||
cgi.R_DrawStretchPic(x, y, w, h, 0.0, 0.0, 1.0, 1.0, handle);
|
||||
}
|
||||
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
void CG_DrawSpectatorView()
|
||||
{
|
||||
const char* pszString;
|
||||
int iKey1, iKey2;
|
||||
int iKey1b, iKey2b;
|
||||
float fX, fY;
|
||||
qboolean bOnTeam;
|
||||
|
||||
if (!(cg.predicted_player_state.pm_flags & PMF_SPECTATING)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bOnTeam = qfalse;
|
||||
if (cg.snap->ps.stats[STAT_TEAM] == TEAM_ALLIES || cg.snap->ps.stats[STAT_TEAM] == TEAM_AXIS) {
|
||||
bOnTeam = 1;
|
||||
}
|
||||
|
||||
if (!bOnTeam)
|
||||
{
|
||||
cgi.Key_GetKeysForCommand("+attackprimary", &iKey1, &iKey2);
|
||||
pszString = cgi.LV_ConvertString(va("Press Fire(%s) to join the battle!", cgi.Key_KeynumToBindString(iKey1)));
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = cgs.glconfig.vidHeight - 64.0;
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX, fY, -1, qfalse);
|
||||
}
|
||||
|
||||
if (cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)
|
||||
{
|
||||
cgi.Key_GetKeysForCommand("+moveup", &iKey1, &iKey2);
|
||||
cgi.Key_GetKeysForCommand("+movedown", &iKey1b, &iKey2b);
|
||||
|
||||
pszString = cgi.LV_ConvertString(
|
||||
va(
|
||||
"Press Jump(%s) or Duck(%s) to follow a different player.",
|
||||
cgi.Key_KeynumToBindString(iKey1),
|
||||
cgi.Key_KeynumToBindString(iKey1b)
|
||||
)
|
||||
);
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 40.0;
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX, fY, -1, 0);
|
||||
}
|
||||
|
||||
if (!bOnTeam && (cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW))
|
||||
{
|
||||
cgi.Key_GetKeysForCommand("+use", &iKey1, &iKey2);
|
||||
pszString = cgi.LV_ConvertString(va("Press Use(%s) to enter free spectate mode.", cgi.Key_KeynumToBindString(iKey1)));
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0;
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX, fY, -1, 0);
|
||||
}
|
||||
|
||||
if (!(cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)) {
|
||||
cgi.Key_GetKeysForCommand("+use", &iKey1, &iKey2);
|
||||
|
||||
pszString = cgi.LV_ConvertString(
|
||||
va(
|
||||
"Press Use(%s) to enter player following spectate mode.",
|
||||
cgi.Key_KeynumToBindString(iKey1)
|
||||
)
|
||||
);
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0;
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX, fY, -1, 0);
|
||||
}
|
||||
|
||||
if ((cg.predicted_player_state.pm_flags & 0x80) != 0 && cg.snap && cg.snap->ps.stats[STAT_INFOCLIENT] != -1)
|
||||
{
|
||||
int iClientNum;
|
||||
qhandle_t hShader;
|
||||
vec4_t color;
|
||||
char buf[128];
|
||||
|
||||
iClientNum = cg.snap->ps.stats[STAT_INFOCLIENT];
|
||||
sprintf(buf, "%s : %i", cg.clientinfo[iClientNum].name, cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]);
|
||||
|
||||
color[0] = 0.5;
|
||||
color[1] = 1.0;
|
||||
color[2] = 0.5;
|
||||
color[3] = 1.0;
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) - 16) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 80.0;
|
||||
cgi.R_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, buf, fX, fY, -1, 0);
|
||||
|
||||
if (cg.clientinfo[iClientNum].team == TEAM_ALLIES) {
|
||||
hShader = cgi.R_RegisterShader("textures/hud/allies");
|
||||
} else if (cg.clientinfo[iClientNum].team == TEAM_AXIS) {
|
||||
hShader = cgi.R_RegisterShader("textures/hud/axis");
|
||||
}
|
||||
|
||||
if (hShader)
|
||||
{
|
||||
fX -= 20.0;
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawStretchPic(fX, fY, 16.0, 16.0, 0.0, 0.0, 1.0, 1.0, hShader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void CG_DrawSpectatorView()
|
||||
{
|
||||
const char* pszString;
|
||||
@@ -1083,6 +1195,8 @@ void CG_DrawSpectatorView()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
==============
|
||||
CG_Draw2D
|
||||
|
||||
@@ -160,6 +160,7 @@ typedef struct markPoly_s
|
||||
#define MAX_CUSTOM_SOUNDS 32
|
||||
typedef struct {
|
||||
int team;
|
||||
char name[64];
|
||||
} clientInfo_t;
|
||||
|
||||
typedef struct cobjective_s {
|
||||
|
||||
@@ -373,6 +373,25 @@ void CG_ProcessConfigString(int num)
|
||||
{
|
||||
CG_SetLightStyle(num - CS_LIGHTSTYLES, str);
|
||||
}
|
||||
else if (num >= CS_PLAYERS && num < CS_PLAYERS + MAX_CLIENTS)
|
||||
{
|
||||
const char* value;
|
||||
|
||||
value = Info_ValueForKey(str, "name");
|
||||
if (value) {
|
||||
strncpy(cg.clientinfo[num - CS_PLAYERS].name, value, sizeof(cg.clientinfo[num - CS_PLAYERS].name));
|
||||
}
|
||||
else {
|
||||
strncpy(cg.clientinfo[num - CS_PLAYERS].name, "UnnamedSoldier", sizeof(cg.clientinfo[num - CS_PLAYERS].name));
|
||||
}
|
||||
|
||||
value = Info_ValueForKey(str, "team");
|
||||
if (value) {
|
||||
cg.clientinfo[num - CS_PLAYERS].team = atoi(value);
|
||||
} else {
|
||||
cg.clientinfo[num - CS_PLAYERS].team = TEAM_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
|
||||
@@ -28,6 +28,183 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
void CG_PlayerTeamUpdate(refEntity_t* pModel, entityState_t* pPlayerState)
|
||||
{
|
||||
qboolean bInArtillery, bInTeam, bSpecialIcon;
|
||||
|
||||
#if TARGET_GAME_PROTOCOL < 15
|
||||
if (pPlayerState->eFlags & EF_ALLIES)
|
||||
{
|
||||
cg.clientinfo[pPlayerState->number].team = TEAM_ALLIES;
|
||||
} else if (pPlayerState->eFlags & EF_AXIS) {
|
||||
cg.clientinfo[pPlayerState->number].team = TEAM_AXIS;
|
||||
} else {
|
||||
cg.clientinfo[pPlayerState->number].team = TEAM_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pPlayerState->number == cg.snap->ps.clientNum) {
|
||||
return;
|
||||
}
|
||||
|
||||
bInTeam = qfalse;
|
||||
bSpecialIcon = qfalse;
|
||||
if (cgs.gametype > GT_FFA
|
||||
&& (cg.snap->ps.stats[STAT_TEAM] == TEAM_ALLIES && (pPlayerState->eFlags & EF_ALLIES)
|
||||
|| cg.snap->ps.stats[STAT_TEAM] == TEAM_AXIS && (pPlayerState->eFlags & EF_AXIS)
|
||||
|| cg.snap->ps.stats[STAT_TEAM] != TEAM_AXIS && cg.snap->ps.stats[STAT_TEAM] != TEAM_ALLIES && (pPlayerState->eFlags & EF_ANY_TEAM) != 0))
|
||||
{
|
||||
bInTeam = qtrue;
|
||||
}
|
||||
|
||||
if (cgs.gametype <= GT_FFA) {
|
||||
return;
|
||||
}
|
||||
|
||||
bInArtillery = qfalse;
|
||||
if (pPlayerState->eFlags & EF_PLAYER_ARTILLERY) {
|
||||
bInArtillery = qtrue;
|
||||
}
|
||||
|
||||
if (bInTeam || (pPlayerState->eFlags & (EF_PLAYER_IN_MENU | EF_PLAYER_TALKING)) || bInArtillery)
|
||||
{
|
||||
int i;
|
||||
int iTag;
|
||||
float fAlpha;
|
||||
float fDist;
|
||||
vec3_t vTmp;
|
||||
refEntity_t iconEnt;
|
||||
|
||||
memset(&iconEnt, 0, sizeof(iconEnt));
|
||||
if ((pPlayerState->eFlags & EF_PLAYER_TALKING) != 0 && ((cg.time >> 8) & 1) != 0)
|
||||
{
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/talking_headicon.spr");
|
||||
bSpecialIcon = 1;
|
||||
}
|
||||
else if ((pPlayerState->eFlags & EF_PLAYER_IN_MENU) != 0)
|
||||
{
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/inmenu_headicon.spr");
|
||||
bSpecialIcon = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bInTeam) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (bInArtillery)
|
||||
{
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/inmenu_artilleryicon.spr");
|
||||
bSpecialIcon = qtrue;
|
||||
}
|
||||
else if ((pPlayerState->eFlags & 0x80) != 0)
|
||||
{
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/allies_headicon.spr");
|
||||
}
|
||||
else
|
||||
{
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/axis_headicon.spr");
|
||||
}
|
||||
}
|
||||
|
||||
memset(vTmp, 0, sizeof(vTmp));
|
||||
AnglesToAxis(vTmp, iconEnt.axis);
|
||||
|
||||
iconEnt.scale = 0.5;
|
||||
iconEnt.renderfx = 0;
|
||||
iconEnt.reType = RT_SPRITE;
|
||||
iconEnt.shaderTime = 0.0;
|
||||
iconEnt.frameInfo[0].index = 0;
|
||||
iconEnt.shaderRGBA[0] = -1;
|
||||
iconEnt.shaderRGBA[1] = -1;
|
||||
iconEnt.shaderRGBA[2] = -1;
|
||||
VectorCopy(pModel->origin, iconEnt.origin);
|
||||
|
||||
iTag = cgi.Tag_NumForName(pModel->tiki, "eyes bone");
|
||||
if (iTag == -1)
|
||||
{
|
||||
iconEnt.origin[2] = iconEnt.origin[2] + 96.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
orientation_t oEyes = cgi.TIKI_Orientation(pModel, iTag);
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
VectorMA(iconEnt.origin, oEyes.origin[i], pModel->axis[i], iconEnt.origin);
|
||||
}
|
||||
|
||||
iconEnt.origin[2] = iconEnt.origin[2] + 20.0;
|
||||
}
|
||||
|
||||
VectorSubtract(iconEnt.origin, cg.refdef.vieworg, vTmp);
|
||||
fDist = VectorLength(vTmp);
|
||||
|
||||
if (fDist >= 256)
|
||||
{
|
||||
if (fDist > 512.0) {
|
||||
iconEnt.scale = (fDist - 512.0) / 2560.0 + 0.5;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iconEnt.scale = fDist / 853.0 + 0.2;
|
||||
}
|
||||
|
||||
if (iconEnt.scale > 1.0) {
|
||||
iconEnt.scale = 1.0;
|
||||
}
|
||||
|
||||
if (fDist > 256.0) {
|
||||
fAlpha = 1.0;
|
||||
}
|
||||
else if (fDist >= 72.0) {
|
||||
fAlpha = (fDist - 72.0) / 184.0;
|
||||
}
|
||||
else {
|
||||
fAlpha = 0.0;
|
||||
}
|
||||
|
||||
if (cg.snap->ps.stats[STAT_TEAM] == 4 || cg.snap->ps.stats[STAT_TEAM] == 3) {
|
||||
fAlpha = fAlpha * 0.65;
|
||||
}
|
||||
else {
|
||||
fAlpha = fAlpha * 0.4;
|
||||
}
|
||||
|
||||
if (bSpecialIcon)
|
||||
{
|
||||
int value = (int)((fAlpha + 0.60000002) * 255.0);
|
||||
if (value > 255) value = 255;
|
||||
iconEnt.shaderRGBA[3] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
iconEnt.shaderRGBA[3] = (int)(fAlpha * 255.0);
|
||||
}
|
||||
|
||||
if (fAlpha > 0.0 || bSpecialIcon)
|
||||
{
|
||||
if (bSpecialIcon)
|
||||
{
|
||||
VectorMA(iconEnt.origin, -2.0, cg.refdef.viewaxis[0], iconEnt.origin);
|
||||
iconEnt.scale = iconEnt.scale + 0.05;
|
||||
}
|
||||
|
||||
cgi.R_AddRefSpriteToScene(&iconEnt);
|
||||
|
||||
if (bSpecialIcon && bInTeam && fAlpha > 0.0)
|
||||
{
|
||||
if (pPlayerState->eFlags & EF_ALLIES) {
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/allies_headicon.spr");
|
||||
}
|
||||
else {
|
||||
iconEnt.hModel = cgi.R_RegisterModel("textures/hud/axis_headicon.spr");
|
||||
}
|
||||
VectorMA(iconEnt.origin, 4.0, cg.refdef.viewaxis[0], iconEnt.origin);
|
||||
iconEnt.scale = iconEnt.scale - 0.1;
|
||||
iconEnt.shaderRGBA[3] = (int)(fAlpha * 255.0);
|
||||
cgi.R_AddRefSpriteToScene(&iconEnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ typedef struct {
|
||||
// FIXME
|
||||
//prof_cgame_t* profStruct;
|
||||
|
||||
qboolean (*CG_Command_ProcessFile)(char* name, qboolean quiet, dtiki_t* curTiki);
|
||||
qboolean (*CG_Command_ProcessFile)(const char* name, qboolean quiet, dtiki_t* curTiki);
|
||||
|
||||
} clientGameExport_t;
|
||||
|
||||
|
||||
+428
-72
@@ -54,63 +54,419 @@ int CG_GetScoreBoardDrawHeader()
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* CG_GetColumnName(int iColumnNum, int* iColumnWidth)
|
||||
{
|
||||
int iReturnWidth;
|
||||
const char* pszReturnString;
|
||||
|
||||
switch (iColumnNum) {
|
||||
case 0:
|
||||
iReturnWidth = 128;
|
||||
pszReturnString = "Name";
|
||||
break;
|
||||
case 1:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Kills";
|
||||
break;
|
||||
case 2:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Deaths";
|
||||
if (cgs.gametype > GT_TEAM) {
|
||||
pszReturnString = "Total";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Time";
|
||||
break;
|
||||
case 4:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Ping";
|
||||
break;
|
||||
default:
|
||||
iReturnWidth = 0;
|
||||
pszReturnString = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (iColumnWidth) {
|
||||
*iColumnWidth = iReturnWidth;
|
||||
}
|
||||
|
||||
return pszReturnString;
|
||||
}
|
||||
|
||||
void CG_PrepScoreBoardInfo()
|
||||
{
|
||||
switch (cgs.gametype) {
|
||||
switch (cgs.gametype) {
|
||||
case GT_TEAM_ROUNDS:
|
||||
strcpy(cg.scoresMenuName, "DM_Round_Scoreboard");
|
||||
break;
|
||||
case GT_OBJECTIVE:
|
||||
strcpy(cg.scoresMenuName, "Obj_Scoreboard");
|
||||
break;
|
||||
case GT_TEAM_ROUNDS:
|
||||
strcpy(cg.scoresMenuName, "DM_Round_Scoreboard");
|
||||
break;
|
||||
break;
|
||||
case GT_TOW:
|
||||
strcpy(cg.scoresMenuName, "Tow_Scoreboard");
|
||||
break;
|
||||
case GT_LIBERATION:
|
||||
strcpy(cg.scoresMenuName, "Lib_Scoreboard");
|
||||
break;
|
||||
default:
|
||||
strcpy(cg.scoresMenuName, "DM_Scoreboard");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
const char* CG_GetColumnName(int iColumnNum, int* iColumnWidth)
|
||||
{
|
||||
int iReturnWidth;
|
||||
const char* pszReturnString;
|
||||
|
||||
switch (iColumnNum) {
|
||||
case 0:
|
||||
iReturnWidth = 24;
|
||||
pszReturnString = "#";
|
||||
break;
|
||||
case 1:
|
||||
iReturnWidth = 128;
|
||||
pszReturnString = "Name";
|
||||
break;
|
||||
case 2:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Kills";
|
||||
break;
|
||||
case 3:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Deaths";
|
||||
if (cgs.gametype > GT_TEAM) {
|
||||
pszReturnString = "Total";
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Time";
|
||||
break;
|
||||
case 5:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Ping";
|
||||
break;
|
||||
default:
|
||||
iReturnWidth = 0;
|
||||
pszReturnString = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (iColumnWidth) {
|
||||
*iColumnWidth = iReturnWidth;
|
||||
}
|
||||
|
||||
return pszReturnString;
|
||||
}
|
||||
|
||||
void CG_ParseScores()
|
||||
{
|
||||
int i;
|
||||
int iEntryCount;
|
||||
int iClientTeam, iClientNum;
|
||||
int iDatumCount;
|
||||
int iMatchTeam;
|
||||
int iCurrentEntry;
|
||||
qboolean bIsDead, bIsHeader;
|
||||
char szString2[MAX_STRING_TOKENS];
|
||||
char szString3[MAX_STRING_TOKENS];
|
||||
char szString4[MAX_STRING_TOKENS];
|
||||
char szString5[MAX_STRING_TOKENS];
|
||||
char szString6[MAX_STRING_TOKENS];
|
||||
char szString7[MAX_STRING_TOKENS];
|
||||
float vSameTeamTextColor[4];
|
||||
float vSameTeamBackColor[4];
|
||||
float vOtherTeamTextColor[4];
|
||||
float vOtherTeamBackColor[4];
|
||||
float vNoTeamTextColor[4];
|
||||
float vNoTeamBackColor[4];
|
||||
float vThisClientTextColor[4];
|
||||
float vThisClientBackColor[4];
|
||||
float vDeadTextColorDead[4];
|
||||
float* pItemTextColor;
|
||||
float* pItemBackColor;
|
||||
|
||||
iMatchTeam = -1;
|
||||
vSameTeamTextColor[0] = 1.0f;
|
||||
vSameTeamTextColor[1] = 1.0f;
|
||||
vSameTeamTextColor[2] = 1.0f;
|
||||
vSameTeamTextColor[3] = 1.0f;
|
||||
vSameTeamBackColor[0] = 0.1f;
|
||||
vSameTeamBackColor[1] = 0.5f;
|
||||
vSameTeamBackColor[2] = 0.1f;
|
||||
vSameTeamBackColor[3] = 0.4f;
|
||||
vOtherTeamTextColor[0] = 1.0f;
|
||||
vOtherTeamTextColor[1] = 1.0f;
|
||||
vOtherTeamTextColor[2] = 1.0f;
|
||||
vOtherTeamTextColor[3] = 1.0f;
|
||||
vOtherTeamBackColor[0] = 0.5f;
|
||||
vOtherTeamBackColor[1] = 0.1f;
|
||||
vOtherTeamBackColor[2] = 0.1f;
|
||||
vOtherTeamBackColor[3] = 0.4f;
|
||||
vNoTeamTextColor[0] = 1.0f;
|
||||
vNoTeamTextColor[1] = 1.0f;
|
||||
vNoTeamTextColor[2] = 1.0f;
|
||||
vNoTeamTextColor[3] = 1.0f;
|
||||
vNoTeamBackColor[0] = 0.1f;
|
||||
vNoTeamBackColor[1] = 0.1f;
|
||||
vNoTeamBackColor[2] = 0.1f;
|
||||
vNoTeamBackColor[3] = 0.4f;
|
||||
vDeadTextColorDead[0] = 1.0f;
|
||||
vDeadTextColorDead[1] = 0.1f;
|
||||
vDeadTextColorDead[2] = 0.1f;
|
||||
vDeadTextColorDead[3] = 1.0f;
|
||||
|
||||
vThisClientTextColor[0] = 0.0f;
|
||||
vThisClientTextColor[1] = 0.0f;
|
||||
vThisClientTextColor[2] = 0.0f;
|
||||
vThisClientTextColor[3] = 1.0f;
|
||||
|
||||
if (cgs.gametype > GT_FFA)
|
||||
{
|
||||
vThisClientBackColor[0] = 0.5f;
|
||||
vThisClientBackColor[1] = 0.75f;
|
||||
vThisClientBackColor[2] = 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
vThisClientBackColor[0] = 0.75f;
|
||||
vThisClientBackColor[1] = 0.75f;
|
||||
vThisClientBackColor[2] = 0.75f;
|
||||
}
|
||||
|
||||
vThisClientBackColor[3] = 0.8f;
|
||||
|
||||
iCurrentEntry = 1;
|
||||
if (cgs.gametype > GT_FFA)
|
||||
{
|
||||
iDatumCount = 6;
|
||||
iMatchTeam = cg.snap->ps.stats[STAT_TEAM];
|
||||
if (iMatchTeam != TEAM_ALLIES && iMatchTeam != TEAM_AXIS)
|
||||
{
|
||||
iMatchTeam = TEAM_ALLIES;
|
||||
vThisClientTextColor[0] = 0.0f;
|
||||
vThisClientTextColor[1] = 0.0f;
|
||||
vThisClientTextColor[2] = 0.0f;
|
||||
vThisClientBackColor[0] = 0.75f;
|
||||
vThisClientBackColor[1] = 0.75f;
|
||||
vThisClientBackColor[2] = 0.75f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// free-for-all
|
||||
iDatumCount = 5;
|
||||
}
|
||||
|
||||
iEntryCount = atoi(cgi.Argv(iCurrentEntry++));
|
||||
if (iEntryCount > MAX_CLIENTS) {
|
||||
iEntryCount = MAX_CLIENTS;
|
||||
}
|
||||
|
||||
if (cgs.gametype == GT_TOW)
|
||||
{
|
||||
cgi.Cvar_Set("tow_allied_obj1", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_allied_obj2", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_allied_obj3", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_allied_obj4", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_allied_obj5", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_axis_obj1", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_axis_obj2", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_axis_obj3", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_axis_obj4", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("tow_axis_obj5", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
}
|
||||
|
||||
if (cgs.gametype == GT_LIBERATION)
|
||||
{
|
||||
cgi.Cvar_Set("scoreboard_toggle1", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
cgi.Cvar_Set("scoreboard_toggle2", va("%i", cgi.Argv(iCurrentEntry++)));
|
||||
}
|
||||
|
||||
for (i = 0; i < iEntryCount; ++i)
|
||||
{
|
||||
bIsHeader = qfalse;
|
||||
if (cgs.gametype > GT_FFA)
|
||||
{
|
||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||
iClientTeam = atoi(cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
if (iClientTeam >= 0) {
|
||||
bIsDead = qfalse;
|
||||
}
|
||||
else {
|
||||
bIsDead = qtrue;
|
||||
iClientTeam = -iClientTeam;
|
||||
}
|
||||
|
||||
if (iClientNum == -1)
|
||||
{
|
||||
szString2[0] = 0;
|
||||
bIsHeader = qtrue;
|
||||
|
||||
switch (iClientTeam)
|
||||
{
|
||||
case 1:
|
||||
strcpy(szString3, cgi.LV_ConvertString("Spectators"));
|
||||
break;
|
||||
case 2:
|
||||
strcpy(szString3, cgi.LV_ConvertString("Free-For-Allers"));
|
||||
break;
|
||||
case 3:
|
||||
sprintf(
|
||||
szString3,
|
||||
"%s - %d %s",
|
||||
cgi.LV_ConvertString("Allies"),
|
||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||
cgi.LV_ConvertString("Players")
|
||||
);
|
||||
iCurrentEntry++;
|
||||
break;
|
||||
case 4:
|
||||
sprintf(
|
||||
szString3,
|
||||
"%s - %d %s",
|
||||
cgi.LV_ConvertString("Axis"),
|
||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||
cgi.LV_ConvertString("Players")
|
||||
);
|
||||
iCurrentEntry++;
|
||||
break;
|
||||
default:
|
||||
strcpy(szString3, cgi.LV_ConvertString("No Team"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (iClientNum == -2)
|
||||
{
|
||||
// spectating
|
||||
szString2[0] = 0;
|
||||
szString3[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(szString2, va("%i", iClientNum));
|
||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
||||
}
|
||||
|
||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString7, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
||||
|
||||
if (cgs.gametype >= GT_TEAM_ROUNDS && iClientNum == -1 && iClientTeam == TEAM_ALLIES || iClientTeam == TEAM_AXIS)
|
||||
{
|
||||
strcat(szString4, va(" %s", cgi.LV_ConvertString("Wins")));
|
||||
szString5[0] = 0;
|
||||
}
|
||||
|
||||
if (iClientNum == cg.snap->ps.clientNum)
|
||||
{
|
||||
pItemTextColor = vThisClientTextColor;
|
||||
pItemBackColor = vThisClientBackColor;
|
||||
}
|
||||
else if (iClientNum == -2)
|
||||
{
|
||||
pItemTextColor = vNoTeamTextColor;
|
||||
pItemBackColor = vNoTeamBackColor;
|
||||
}
|
||||
else if (iClientTeam == TEAM_ALLIES || iClientTeam == TEAM_AXIS)
|
||||
{
|
||||
if (iClientTeam == iMatchTeam)
|
||||
{
|
||||
pItemTextColor = vSameTeamTextColor;
|
||||
pItemBackColor = vSameTeamBackColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
pItemTextColor = vOtherTeamTextColor;
|
||||
pItemBackColor = vOtherTeamBackColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pItemTextColor = vNoTeamTextColor;
|
||||
pItemBackColor = vNoTeamBackColor;
|
||||
}
|
||||
|
||||
if (bIsDead) {
|
||||
pItemTextColor = vDeadTextColorDead;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iClientNum = atoi(cgi.Argv(iDatumCount * i));
|
||||
if (iClientNum >= 0)
|
||||
{
|
||||
strcpy(szString2, va("%i", iClientNum));
|
||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
||||
strcpy(szString4, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString7, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
}
|
||||
else
|
||||
{
|
||||
szString2[0] = 0;
|
||||
if (iClientNum == -3)
|
||||
{
|
||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
||||
bIsHeader = qtrue;
|
||||
}
|
||||
else if (iClientNum == -2)
|
||||
{
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
bIsHeader = qtrue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// unknown
|
||||
szString3[0] = 0;
|
||||
}
|
||||
szString4[0] = 0;
|
||||
szString5[0] = 0;
|
||||
szString6[0] = 0;
|
||||
szString7[0] = 0;
|
||||
}
|
||||
|
||||
if (iClientNum == cg.snap->ps.clientNum)
|
||||
{
|
||||
pItemTextColor = vThisClientTextColor;
|
||||
pItemBackColor = vThisClientBackColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
pItemTextColor = vNoTeamTextColor;
|
||||
pItemBackColor = vNoTeamBackColor;
|
||||
}
|
||||
}
|
||||
|
||||
cgi.UI_SetScoreBoardItem(
|
||||
i,
|
||||
szString2,
|
||||
szString3,
|
||||
szString4,
|
||||
szString5,
|
||||
szString6,
|
||||
szString7,
|
||||
NULL,
|
||||
NULL,
|
||||
pItemTextColor,
|
||||
pItemBackColor,
|
||||
bIsHeader
|
||||
);
|
||||
}
|
||||
|
||||
cgi.UI_DeleteScoreBoardItems(iEntryCount);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
const char* CG_GetColumnName(int iColumnNum, int* iColumnWidth)
|
||||
{
|
||||
int iReturnWidth;
|
||||
const char* pszReturnString;
|
||||
|
||||
switch (iColumnNum) {
|
||||
case 0:
|
||||
iReturnWidth = 128;
|
||||
pszReturnString = "Name";
|
||||
break;
|
||||
case 1:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Kills";
|
||||
break;
|
||||
case 2:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Deaths";
|
||||
if (cgs.gametype > GT_TEAM) {
|
||||
pszReturnString = "Total";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Time";
|
||||
break;
|
||||
case 4:
|
||||
iReturnWidth = 64;
|
||||
pszReturnString = "Ping";
|
||||
break;
|
||||
default:
|
||||
iReturnWidth = 0;
|
||||
pszReturnString = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (iColumnWidth) {
|
||||
*iColumnWidth = iReturnWidth;
|
||||
}
|
||||
|
||||
return pszReturnString;
|
||||
}
|
||||
|
||||
void CG_ParseScores()
|
||||
{
|
||||
int i;
|
||||
@@ -118,13 +474,13 @@ void CG_ParseScores()
|
||||
int iClientTeam, iClientNum;
|
||||
int iDatumCount;
|
||||
int iMatchTeam;
|
||||
int iCurrentEntry;
|
||||
qboolean bIsDead, bIsHeader;
|
||||
char szString2[MAX_STRING_TOKENS];
|
||||
char szString3[MAX_STRING_TOKENS];
|
||||
char szString4[MAX_STRING_TOKENS];
|
||||
char szString5[MAX_STRING_TOKENS];
|
||||
char szString6[MAX_STRING_TOKENS];
|
||||
const char* pszClientInfo;
|
||||
float vSameTeamTextColor[4];
|
||||
float vSameTeamBackColor[4];
|
||||
float vOtherTeamTextColor[4];
|
||||
@@ -187,6 +543,7 @@ void CG_ParseScores()
|
||||
|
||||
vThisClientBackColor[3] = 0.8f;
|
||||
|
||||
iCurrentEntry = 1;
|
||||
if (cgs.gametype > GT_FFA)
|
||||
{
|
||||
iDatumCount = 6;
|
||||
@@ -208,7 +565,7 @@ void CG_ParseScores()
|
||||
iDatumCount = 5;
|
||||
}
|
||||
|
||||
iEntryCount = atoi(cgi.Argv(1));
|
||||
iEntryCount = atoi(cgi.Argv(iCurrentEntry++));
|
||||
if (iEntryCount > MAX_CLIENTS) {
|
||||
iEntryCount = MAX_CLIENTS;
|
||||
}
|
||||
@@ -218,8 +575,8 @@ void CG_ParseScores()
|
||||
bIsHeader = qfalse;
|
||||
if (cgs.gametype > GT_FFA)
|
||||
{
|
||||
iClientNum = atoi(cgi.Argv(2 + iDatumCount * i));
|
||||
iClientTeam = atoi(cgi.Argv(3 + iDatumCount * i));
|
||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||
iClientTeam = atoi(cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
if (iClientTeam >= 0) {
|
||||
bIsDead = qfalse;
|
||||
}
|
||||
@@ -235,19 +592,19 @@ void CG_ParseScores()
|
||||
switch (iClientTeam)
|
||||
{
|
||||
case 1:
|
||||
strcpy(szString2, "Spectators");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
break;
|
||||
case 2:
|
||||
strcpy(szString2, "Free-For-Allers");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Free-For-Allers"));
|
||||
break;
|
||||
case 3:
|
||||
strcpy(szString2, "Allies");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Allies"));
|
||||
break;
|
||||
case 4:
|
||||
strcpy(szString2, "Axis");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Axis"));
|
||||
break;
|
||||
default:
|
||||
strcpy(szString2, "No Team");
|
||||
strcpy(szString2, cgi.LV_ConvertString("No Team"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -257,15 +614,14 @@ void CG_ParseScores()
|
||||
szString2[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pszClientInfo = CG_ConfigString(CS_PLAYERS + iClientNum);
|
||||
strcpy(szString2, Info_ValueForKey(pszClientInfo, "name"));
|
||||
{
|
||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
||||
}
|
||||
|
||||
strcpy(szString3, cgi.Argv(4 + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(5 + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(6 + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(7 + iDatumCount * i));
|
||||
strcpy(szString3, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
||||
|
||||
if (iClientNum == cg.snap->ps.clientNum)
|
||||
{
|
||||
@@ -302,26 +658,25 @@ void CG_ParseScores()
|
||||
}
|
||||
else
|
||||
{
|
||||
iClientNum = atoi(cgi.Argv(2 + iDatumCount * i));
|
||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||
if (iClientNum >= 0)
|
||||
{
|
||||
pszClientInfo = CG_ConfigString(CS_PLAYERS + iClientNum);
|
||||
strcpy(szString2, Info_ValueForKey(pszClientInfo, "name"));
|
||||
strcpy(szString3, cgi.Argv(3 + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(4 + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(5 + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(6 + iDatumCount * i));
|
||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
||||
strcpy(szString3, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iClientNum == -3)
|
||||
{
|
||||
strcpy(szString2, "Players");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
||||
bIsHeader = qtrue;
|
||||
}
|
||||
else if (iClientNum == -2)
|
||||
{
|
||||
strcpy(szString2, "Spectators");
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
bIsHeader = qtrue;
|
||||
}
|
||||
else
|
||||
@@ -365,3 +720,4 @@ void CG_ParseScores()
|
||||
|
||||
cgi.UI_DeleteScoreBoardItems(iEntryCount);
|
||||
}
|
||||
#endif
|
||||
@@ -120,7 +120,7 @@ void CG_ParseServerinfo(void)
|
||||
cgi.Cvar_Set("cg_obj_axistext3", Info_ValueForKey(info, "cg_obj_axistext3"));
|
||||
cgi.Cvar_Set("cg_scoreboardpic", Info_ValueForKey(info, "g_scoreboardpic"));
|
||||
cgi.Cvar_Set("cg_scoreboardpicover", Info_ValueForKey(info, "g_scoreboardpicover"));
|
||||
cgs.mapChecksum = Info_ValueForKey(info, "sv_mapChecksum");
|
||||
cgs.mapChecksum = atoi(Info_ValueForKey(info, "sv_mapChecksum"));
|
||||
|
||||
mapname = Info_ValueForKey(info, "mapname");
|
||||
|
||||
|
||||
+18
-12
@@ -99,6 +99,7 @@ cvar_t *wombat;
|
||||
cvar_t *cl_r_fullscreen;
|
||||
|
||||
cvar_t *cl_consoleKeys;
|
||||
cvar_t *name;
|
||||
|
||||
cvar_t* j_pitch;
|
||||
cvar_t* j_yaw;
|
||||
@@ -220,7 +221,7 @@ CL_ChangeReliableCommand
|
||||
======================
|
||||
*/
|
||||
void CL_ChangeReliableCommand( void ) {
|
||||
int r, index, l;
|
||||
size_t r, index, l;
|
||||
|
||||
r = clc.reliableSequence - (random() * 5);
|
||||
index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
|
||||
@@ -248,7 +249,7 @@ Dumps the current net message, prefixed by the length
|
||||
====================
|
||||
*/
|
||||
void CL_WriteDemoMessage ( msg_t *msg, int headerBytes ) {
|
||||
int len, swlen;
|
||||
size_t len, swlen;
|
||||
|
||||
// write the packet sequence
|
||||
len = clc.serverMessageSequence;
|
||||
@@ -327,7 +328,7 @@ void CL_Record_f( void ) {
|
||||
byte bufData[MAX_MSGLEN];
|
||||
msg_t buf;
|
||||
int i;
|
||||
int len;
|
||||
size_t len;
|
||||
entityState_t *ent;
|
||||
entityState_t nullstate;
|
||||
char *s;
|
||||
@@ -559,7 +560,7 @@ CL_ReadDemoMessage
|
||||
=================
|
||||
*/
|
||||
void CL_ReadDemoMessage( void ) {
|
||||
int r;
|
||||
size_t r;
|
||||
msg_t buf;
|
||||
byte bufData[ MAX_MSGLEN ];
|
||||
int s;
|
||||
@@ -1060,7 +1061,8 @@ in anyway.
|
||||
*/
|
||||
void CL_RequestAuthorization( void ) {
|
||||
char nums[64];
|
||||
int i, j, l;
|
||||
int i, j;
|
||||
size_t l;
|
||||
cvar_t *fs;
|
||||
|
||||
if ( !cls.authorizeServer.port ) {
|
||||
@@ -1781,7 +1783,6 @@ void CL_CheckForResend( void ) {
|
||||
int port, i;
|
||||
char info[MAX_INFO_STRING];
|
||||
char data[MAX_INFO_STRING];
|
||||
char buf[1024];
|
||||
|
||||
// don't send anything if playing back a demo
|
||||
if ( clc.demoplaying ) {
|
||||
@@ -2156,8 +2157,6 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
|
||||
|
||||
// cd check
|
||||
if ( !Q_stricmp(c, "getKey") ) {
|
||||
char buf[1024];
|
||||
|
||||
cls.state = CA_AUTHORIZING;
|
||||
gcd_compute_response(cl_cdkey, Cmd_Argv(1), cls.gcdResponse, CDResponseMethod_NEWAUTH);
|
||||
NET_OutOfBandPrint(NS_CLIENT, from, "authorizeThis %s", cls.gcdResponse);
|
||||
@@ -2292,7 +2291,7 @@ qboolean CL_CheckPaused(void)
|
||||
// if paused->modified is set, the cvar has only been changed in
|
||||
// this frame. Keep paused in this frame to ensure the server doesn't
|
||||
// lag behind.
|
||||
if(paused->integer || paused->modified)
|
||||
if(paused->integer)
|
||||
return qtrue;
|
||||
|
||||
return qfalse;
|
||||
@@ -2307,6 +2306,8 @@ CL_CheckUserinfo
|
||||
==================
|
||||
*/
|
||||
void CL_CheckUserinfo( void ) {
|
||||
char szSanitizedName[MAX_NAME_LENGTH];
|
||||
|
||||
// don't add reliable commands when not yet connected
|
||||
if(cls.state < CA_CHALLENGING)
|
||||
return;
|
||||
@@ -2318,6 +2319,10 @@ void CL_CheckUserinfo( void ) {
|
||||
// send a reliable userinfo update if needed
|
||||
if(cvar_modifiedFlags & CVAR_USERINFO)
|
||||
{
|
||||
if (Com_SanitizeName(name->string, szSanitizedName)) {
|
||||
Cvar_Set("name", szSanitizedName);
|
||||
}
|
||||
|
||||
cvar_modifiedFlags &= ~CVAR_USERINFO;
|
||||
CL_AddReliableCommand( va("userinfo \"%s\"", Cvar_InfoString( CVAR_USERINFO ) ) );
|
||||
}
|
||||
@@ -3119,7 +3124,7 @@ void CL_Init( void ) {
|
||||
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE );
|
||||
|
||||
// userinfo
|
||||
Cvar_Get ("name", "UnnamedSoldier", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
name = Cvar_Get ("name", "UnnamedSoldier", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("rate", "5000", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("password", "", CVAR_USERINFO);
|
||||
@@ -3511,7 +3516,7 @@ void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
|
||||
const char *s;
|
||||
char info[MAX_INFO_STRING];
|
||||
int i, l, score, ping;
|
||||
int len;
|
||||
size_t len;
|
||||
serverStatus_t *serverStatus;
|
||||
|
||||
serverStatus = NULL;
|
||||
@@ -4270,7 +4275,8 @@ qboolean CL_CDKeyValidate( const char *key, const char *checksum ) {
|
||||
char ch;
|
||||
byte sum;
|
||||
char chs[3];
|
||||
int i, len;
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
len = strlen(key);
|
||||
if( len != CDKEY_LEN ) {
|
||||
|
||||
@@ -189,11 +189,13 @@ void UIDMBox::RemoveTopItem( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < m_numitems - 1; i++) {
|
||||
m_items[i] = m_items[i + 1];
|
||||
}
|
||||
if (m_numitems > 0) {
|
||||
for (i = 0; i < m_numitems - 1; i++) {
|
||||
m_items[i] = m_items[i + 1];
|
||||
}
|
||||
|
||||
m_numitems--;
|
||||
m_numitems--;
|
||||
}
|
||||
}
|
||||
|
||||
str UIDMBox::CalculateBreaks( UIFont *font, str text, float max_width )
|
||||
|
||||
@@ -186,11 +186,13 @@ void UIGMBox::RemoveTopItem( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < m_numitems - 1; i++) {
|
||||
m_items[i] = m_items[i + 1];
|
||||
}
|
||||
if (m_numitems > 0) {
|
||||
for (i = 0; i < m_numitems - 1; i++) {
|
||||
m_items[i] = m_items[i + 1];
|
||||
}
|
||||
|
||||
m_numitems--;
|
||||
m_numitems--;
|
||||
}
|
||||
}
|
||||
|
||||
str UIGMBox::CalculateBreaks( UIFont *font, str text, float max_width )
|
||||
|
||||
@@ -152,6 +152,10 @@ typedef enum {
|
||||
GT_TEAM, // team deathmatch
|
||||
GT_TEAM_ROUNDS,
|
||||
GT_OBJECTIVE,
|
||||
// Team Assault game mode
|
||||
GT_TOW,
|
||||
// Team Tactics game mode
|
||||
GT_LIBERATION,
|
||||
GT_MAX_GAME_TYPE
|
||||
} gametype_t;
|
||||
|
||||
@@ -261,6 +265,28 @@ typedef enum {
|
||||
#define PMF_LEVELEXIT (1<<20) // use camera view instead of ps view
|
||||
#endif
|
||||
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
// moh pm_flags
|
||||
#define PMF_DUCKED (1<<0)
|
||||
#define PMF_VIEW_PRONE (1<<1)
|
||||
#define PMF_SPECTATING (1<<2)
|
||||
#define PMF_RESPAWNED (1<<3)
|
||||
#define PMF_NO_PREDICTION (1<<4)
|
||||
#define PMF_FROZEN (1<<5)
|
||||
#define PMF_INTERMISSION (1<<6)
|
||||
#define PMF_SPECTATE_FOLLOW (1<<7)
|
||||
#define PMF_CAMERA_VIEW (1<<7) // use camera view instead of ps view
|
||||
#define PMF_NO_MOVE (1<<8)
|
||||
#define PMF_VIEW_DUCK_RUN (1<<9)
|
||||
#define PMF_VIEW_JUMP_START (1<<10)
|
||||
#define PMF_LEVELEXIT (1<<11)
|
||||
#define PMF_NO_GRAVITY (1<<12)
|
||||
#define PMF_NO_HUD (1<<13)
|
||||
#define PMF_UNKNOWN (1<<14)
|
||||
|
||||
#else
|
||||
|
||||
// moh pm_flags
|
||||
#define PMF_DUCKED (1<<0)
|
||||
#define PMF_VIEW_PRONE (1<<1)
|
||||
@@ -279,6 +305,8 @@ typedef enum {
|
||||
#define PMF_NO_HUD (1<<15)
|
||||
#define PMF_UNKNOWN (1<<16)
|
||||
|
||||
#endif
|
||||
|
||||
// moveposflags
|
||||
#define MPF_POSITION_STANDING (1<<0)
|
||||
#define MPF_POSITION_CROUCHING (1<<1)
|
||||
@@ -425,6 +453,12 @@ typedef enum {
|
||||
#define EF_AXIS 0x00000100 // su44: this player is in axis team
|
||||
#define EF_ANY_TEAM (EF_ALLIES | EF_AXIS)
|
||||
#define EF_DEAD 0x00000200 // don't draw a foe marker over players with EF_DEAD
|
||||
//
|
||||
// Team assault flags
|
||||
//
|
||||
#define EF_PLAYER_IN_MENU 0x00000400 // Player is in menu
|
||||
#define EF_PLAYER_TALKING 0x00000800 // Player is talking
|
||||
#define EF_PLAYER_ARTILLERY 0x00002000 // Player is using an artillery
|
||||
|
||||
|
||||
// su44: q3 remnants
|
||||
|
||||
@@ -37,7 +37,7 @@ extern "C" {
|
||||
// These values are the only one that must be set for the version
|
||||
#define PRODUCT_VERSION_MAJOR 0
|
||||
#define PRODUCT_VERSION_MINOR 53
|
||||
#define PRODUCT_VERSION_PATCH 0
|
||||
#define PRODUCT_VERSION_PATCH 1
|
||||
#define PRODUCT_VERSION_STAGE "alpha"
|
||||
|
||||
//
|
||||
@@ -1625,7 +1625,7 @@ typedef enum
|
||||
|
||||
#define RESERVED_CONFIGSTRINGS 2 // game can't modify below this, only the system can
|
||||
|
||||
#define MAX_GAMESTATE_CHARS 32000
|
||||
#define MAX_GAMESTATE_CHARS 41952
|
||||
typedef struct {
|
||||
int stringOffsets[MAX_CONFIGSTRINGS];
|
||||
char stringData[MAX_GAMESTATE_CHARS];
|
||||
|
||||
@@ -2085,7 +2085,7 @@ Loads any of the supported image types into a cannonical
|
||||
=================
|
||||
*/
|
||||
static void R_LoadImage(const char* name, byte** pic, int* width, int* height, qboolean* hasAlpha, int* glCompressMode, int* numMipmaps, int* piMipmapsAvailable) {
|
||||
int len;
|
||||
size_t len;
|
||||
char tempName[MAX_STRING_TOKENS + 1];
|
||||
|
||||
*hasAlpha = qfalse;
|
||||
@@ -2099,17 +2099,23 @@ static void R_LoadImage(const char* name, byte** pic, int* width, int* height, q
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Q_stricmp(name + len - 4, ".tga")) {
|
||||
LoadTGA(name, pic, width, height); // try tga first
|
||||
if (!*pic) { //
|
||||
char altname[MAX_QPATH]; // try jpg in place of tga
|
||||
strcpy(altname, name);
|
||||
if (!Q_stricmp(name + len - 4, ".tga") || !Q_stricmp(name + len - 4, ".jpg")) {
|
||||
char altname[MAX_QPATH];
|
||||
strcpy(altname, name);
|
||||
if (r_loadjpg->integer) {
|
||||
len = strlen(altname);
|
||||
altname[len - 3] = 'j';
|
||||
altname[len - 2] = 'p';
|
||||
altname[len - 1] = 'g';
|
||||
// try jpg first
|
||||
LoadJPG(altname, pic, width, height);
|
||||
}
|
||||
if (!*pic) {
|
||||
altname[len - 3] = 't';
|
||||
altname[len - 2] = 'g';
|
||||
altname[len - 1] = 'a';
|
||||
LoadTGA(name, pic, width, height);
|
||||
}
|
||||
*piMipmapsAvailable = 1;
|
||||
}
|
||||
else if (!Q_stricmp(name + len - 4, ".pcx")) {
|
||||
@@ -2171,7 +2177,7 @@ image_t* R_FindImageFile(const char* name, qboolean mipmap, qboolean allowPicmip
|
||||
if (image->allowPicmip != allowPicmip) {
|
||||
ri.Printf(PRINT_DEVELOPER, "WARNING: reused image %s with mixed allowPicmip parm\n", name);
|
||||
}
|
||||
if (image->wrapClampModeX != glWrapClampModeX || image != glWrapClampModeY) {
|
||||
if (image->wrapClampModeX != glWrapClampModeX || image->wrapClampModeY != glWrapClampModeY) {
|
||||
ri.Printf(PRINT_ALL, "WARNING: reused image %s with mixed glWrapClampMode parm\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "win_localization.h"
|
||||
#include <tiki.h>
|
||||
|
||||
#define MAX_BUFFERS 3
|
||||
#define MAX_LOCALIZATION_LENGTH 1024
|
||||
|
||||
cLocalization *g_localization;
|
||||
static char buf[ 1024 ];
|
||||
static char global_buf[MAX_BUFFERS][MAX_LOCALIZATION_LENGTH];
|
||||
static char szTemp[ 100 ];
|
||||
static size_t buf_index = 0;
|
||||
|
||||
void Sys_InitLocalization()
|
||||
{
|
||||
@@ -342,6 +346,7 @@ const char *cLocalization::ConvertString( const char *var )
|
||||
n++;
|
||||
}
|
||||
|
||||
char* buf = global_buf[(buf_index++) % MAX_BUFFERS];
|
||||
for( i = 1; i <= m_entries.NumObjects(); i++ )
|
||||
{
|
||||
entry = &m_entries.ObjectAt( i );
|
||||
@@ -354,12 +359,12 @@ const char *cLocalization::ConvertString( const char *var )
|
||||
|
||||
if( !( m + n ) )
|
||||
{
|
||||
strncpy( buf, entry->m_locName, sizeof( buf ) );
|
||||
bjb_rebreak( var, buf, sizeof( buf ) );
|
||||
strncpy( buf, entry->m_locName, MAX_LOCALIZATION_LENGTH );
|
||||
bjb_rebreak( var, buf, MAX_LOCALIZATION_LENGTH );
|
||||
return buf;
|
||||
}
|
||||
|
||||
if( entry->m_l1_rep + m + n < sizeof( buf ) )
|
||||
if( entry->m_l1_rep + m + n < MAX_LOCALIZATION_LENGTH )
|
||||
{
|
||||
memcpy( buf, var, n );
|
||||
memcpy( &buf[ n ], entry->m_locName.c_str(), entry->m_l1_rep );
|
||||
|
||||
Reference in new issue
Block a user