Merge remote-tracking branch 'def/DDRace64' into econfix

This commit is contained in:
east 2015-06-14 14:19:54 +02:00
commit 0128456ed3
7 changed files with 63 additions and 55 deletions

View file

@ -36,6 +36,7 @@ int str_utf8_is_confusable(int smaller, int bigger)
case 0x0046: return bigger == 0x03DC || bigger == 0x10287 || bigger == 0x102A5 || bigger == 0x10525 || bigger == 0x118A2 || bigger == 0x118C2 || bigger == 0x15B4 || bigger == 0x1D405 || bigger == 0x1D439 || bigger == 0x1D46D || bigger == 0x1D4D5 || bigger == 0x1D509 || bigger == 0x1D53D || bigger == 0x1D571 || bigger == 0x1D5A5 || bigger == 0x1D5D9 || bigger == 0x1D60D || bigger == 0x1D641 || bigger == 0x1D675 || bigger == 0x1D7CA || bigger == 0x2131 || bigger == 0xA4DD || bigger == 0xA798;
case 0x0047: return bigger == 0x050C || bigger == 0x13C0 || bigger == 0x13F3 || bigger == 0x1D406 || bigger == 0x1D43A || bigger == 0x1D46E || bigger == 0x1D4A2 || bigger == 0x1D4D6 || bigger == 0x1D50A || bigger == 0x1D53E || bigger == 0x1D572 || bigger == 0x1D5A6 || bigger == 0x1D5DA || bigger == 0x1D60E || bigger == 0x1D642 || bigger == 0x1D676 || bigger == 0xA4D6;
case 0x0048: return bigger == 0x0397 || bigger == 0x041D || bigger == 0x102CF || bigger == 0x13BB || bigger == 0x157C || bigger == 0x1D407 || bigger == 0x1D43B || bigger == 0x1D46F || bigger == 0x1D4D7 || bigger == 0x1D573 || bigger == 0x1D5A7 || bigger == 0x1D5DB || bigger == 0x1D60F || bigger == 0x1D643 || bigger == 0x1D677 || bigger == 0x1D6AE || bigger == 0x1D6E8 || bigger == 0x1D722 || bigger == 0x1D75C || bigger == 0x1D796 || bigger == 0x210B || bigger == 0x210C || bigger == 0x210D || bigger == 0x2C8E || bigger == 0xA4E7 || bigger == 0xFF28;
case 0x0049: return bigger == 0x006C;
case 0x004A: return bigger == 0x037F || bigger == 0x0408 || bigger == 0x13AB || bigger == 0x148D || bigger == 0x1D409 || bigger == 0x1D43D || bigger == 0x1D471 || bigger == 0x1D4A5 || bigger == 0x1D4D9 || bigger == 0x1D50D || bigger == 0x1D541 || bigger == 0x1D575 || bigger == 0x1D5A9 || bigger == 0x1D5DD || bigger == 0x1D611 || bigger == 0x1D645 || bigger == 0x1D679 || bigger == 0xA4D9 || bigger == 0xFF2A;
case 0x004B: return bigger == 0x039A || bigger == 0x041A || bigger == 0x10518 || bigger == 0x13E6 || bigger == 0x16D5 || bigger == 0x1D40A || bigger == 0x1D43E || bigger == 0x1D472 || bigger == 0x1D4A6 || bigger == 0x1D4DA || bigger == 0x1D50E || bigger == 0x1D542 || bigger == 0x1D576 || bigger == 0x1D5AA || bigger == 0x1D5DE || bigger == 0x1D612 || bigger == 0x1D646 || bigger == 0x1D67A || bigger == 0x1D6B1 || bigger == 0x1D6EB || bigger == 0x1D725 || bigger == 0x1D75F || bigger == 0x1D799 || bigger == 0x212A || bigger == 0x2C94 || bigger == 0xA4D7 || bigger == 0xFF2B;
case 0x004C: return bigger == 0x1041B || bigger == 0x10526 || bigger == 0x118A3 || bigger == 0x118B2 || bigger == 0x13DE || bigger == 0x14AA || bigger == 0x1D40B || bigger == 0x1D43F || bigger == 0x1D473 || bigger == 0x1D4DB || bigger == 0x1D50F || bigger == 0x1D543 || bigger == 0x1D577 || bigger == 0x1D5AB || bigger == 0x1D5DF || bigger == 0x1D613 || bigger == 0x1D647 || bigger == 0x1D67B || bigger == 0x2112 || bigger == 0x216C || bigger == 0x2CD0 || bigger == 0xA4E1;

View file

@ -133,7 +133,7 @@ void CCamera::ToggleDynamic()
if(g_Config.m_ClMouseDeadzone)
{
g_Config.m_ClMouseFollowfactor = 0;
g_Config.m_ClMouseMaxDistance = 400;
g_Config.m_ClMouseMaxDistance = g_Config.m_DefaultMouseMaxDistance;
g_Config.m_ClMouseDeadzone = 0;
}
else

View file

@ -115,7 +115,7 @@ void CStatboard::OnMessage(int MsgType, void *pRawMsg)
void CStatboard::OnRender()
{
if(g_Config.m_ClAutoStatboardScreenshot)
if(g_Config.m_ClAutoStatboardScreenshot && Client()->State() != IClient::STATE_DEMOPLAYBACK)
{
if(m_ScreenshotTime < 0 && m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER)
m_ScreenshotTime = time_get() + time_freq() * 3;
@ -134,23 +134,20 @@ void CStatboard::OnRender()
void CStatboard::RenderGlobalStats()
{
float Width = 400*3.0f*Graphics()->ScreenAspect();
float Height = 400*3.0f;
float w = 250.0f;
float h = 750.0f;
const float StatboardWidth = 400*3.0f*Graphics()->ScreenAspect();
const float StatboardHeight = 400*3.0f;
float StatboardContentWidth = 250.0f;
float StatboardContentHeight = 750.0f;
const CNetObj_PlayerInfo *apPlayers[MAX_CLIENTS] = {0};
int NumPlayers = 0;
int i = 0;
// sort red or dm players by score
for(i = 0; i < MAX_CLIENTS; i++)
for(int i = 0; i < MAX_CLIENTS; i++)
{
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByScore[i];
if(!pInfo || !m_pClient->m_aStats[pInfo->m_ClientID].m_Active || m_pClient->m_aClients[pInfo->m_ClientID].m_Team != TEAM_RED)
continue;
apPlayers[NumPlayers] = pInfo;
NumPlayers++;
}
@ -158,13 +155,11 @@ void CStatboard::RenderGlobalStats()
// sort blue players by score after
if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS)
{
for(i = 0; i < MAX_CLIENTS; i++)
for(int i = 0; i < MAX_CLIENTS; i++)
{
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByScore[i];
if(!pInfo || !m_pClient->m_aStats[pInfo->m_ClientID].m_Active || m_pClient->m_aClients[pInfo->m_ClientID].m_Team != TEAM_BLUE)
continue;
apPlayers[NumPlayers] = pInfo;
NumPlayers++;
}
@ -179,54 +174,54 @@ void CStatboard::RenderGlobalStats()
if(m_pClient->m_pMotd->IsActive())
m_pClient->m_pMotd->Clear();
for(i = 0; i < 9; i++)
{
if(i == 7) // Best Spree
w += 140;
else if(i == 2) // Suicides
w += 110;
else
w += 100;
}
bool gameWithFlags = m_pClient->m_Snap.m_pGameInfoObj &&
m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS;
if(m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS)
w += 100;
StatboardContentWidth += 6 * 100 + 110 + 140; // Best spree 140; Suicides 110; other labels 100
if(gameWithFlags)
StatboardContentWidth += 200; // Grabs & Flags
bool aDisplayWeapon[NUM_WEAPONS] = {false};
w += 10;
for(i=0; i<NumPlayers; i++)
for(int i = 0; i < NumPlayers; i++)
{
const CGameClient::CClientStats pStats = m_pClient->m_aStats[apPlayers[i]->m_ClientID];
for(int j=0; j<NUM_WEAPONS; j++)
aDisplayWeapon[j] = aDisplayWeapon[j] || pStats.m_aFragsWith[j] || pStats.m_aDeathsFrom[j];
}
for(i=0; i<NUM_WEAPONS; i++)
for(int i = 0; i < NUM_WEAPONS; i++)
if(aDisplayWeapon[i])
w += 80;
StatboardContentWidth += 80;
float x = Width/2-w/2;
float x = StatboardWidth/2-StatboardContentWidth/2;
float y = 200.0f;
Graphics()->MapScreen(0, 0, Width, Height);
Graphics()->MapScreen(0, 0, StatboardWidth, StatboardHeight);
Graphics()->BlendNormal();
Graphics()->TextureSet(-1);
Graphics()->QuadsBegin();
Graphics()->SetColor(0,0,0,0.5f);
RenderTools()->DrawRoundRect(x-10.f, y-10.f, w, h, 17.0f);
RenderTools()->DrawRoundRect(x-10.f, y-10.f, StatboardContentWidth, StatboardContentHeight, 17.0f);
Graphics()->QuadsEnd();
float tw;
int px = 325;
TextRender()->Text(0, x+10, y-5, 24.0f, Localize("Name"), -1);
const char *apHeaders[] = { Localize("Frags"), Localize("Deaths"), Localize("Suicides"), Localize("Ratio"), Localize("Net"), Localize("FPM"), Localize("Spree"), Localize("Best spree"), Localize("Grabs") };
for(i = 0; i < 9; i++)
const char *apHeaders[] = {
Localize("Frags"), Localize("Deaths"), Localize("Suicides"),
Localize("Ratio"), Localize("Net"), Localize("FPM"),
Localize("Spree"), Localize("Best spree"), Localize("Grabs")
};
for(int i = 0; i < 9; i++)
{
if(i == 2)
px += 10.0f; // Suicides
if(i == 7) // Best Spree
px += 40.0f;
if(i == 8 && !gameWithFlags) // Don't draw "Grabs" in game with no flag
continue;
tw = TextRender()->TextWidth(0, 24.0f, apHeaders[i], -1);
TextRender()->Text(0, x+px-tw, y-5, 24.0f, apHeaders[i], -1);
px += 100;
@ -234,7 +229,8 @@ void CStatboard::RenderGlobalStats()
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin();
for(i = 0, px-=40; i < NUM_WEAPONS; i++)
px -= 40;
for(int i = 0; i < NUM_WEAPONS; i++)
{
if(!aDisplayWeapon[i])
continue;
@ -246,11 +242,9 @@ void CStatboard::RenderGlobalStats()
px += 80;
}
Graphics()->QuadsEnd();
px += 40;
if(m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS)
if(gameWithFlags)
{
px -= 40;
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin();
Graphics()->QuadsSetRotation(0.78f);
@ -258,6 +252,10 @@ void CStatboard::RenderGlobalStats()
RenderTools()->DrawSprite(x+px, y+15, 48);
Graphics()->QuadsEnd();
}
else
{
px += 40;
}
y += 29.0f;
@ -279,13 +277,14 @@ void CStatboard::RenderGlobalStats()
const CNetObj_PlayerInfo *pInfo = apPlayers[j];
const CGameClient::CClientStats Stats = m_pClient->m_aStats[pInfo->m_ClientID];
if(m_pClient->m_Snap.m_LocalClientID == pInfo->m_ClientID || (m_pClient->m_Snap.m_SpecInfo.m_Active && pInfo->m_ClientID == m_pClient->m_Snap.m_SpecInfo.m_SpectatorID))
if(m_pClient->m_Snap.m_LocalClientID == pInfo->m_ClientID
|| (m_pClient->m_Snap.m_SpecInfo.m_Active && pInfo->m_ClientID == m_pClient->m_Snap.m_SpecInfo.m_SpectatorID))
{
// background so it's easy to find the local player
Graphics()->TextureSet(-1);
Graphics()->QuadsBegin();
Graphics()->SetColor(1,1,1,0.25f);
RenderTools()->DrawRoundRect(x, y, w-20, LineHeight*0.95f, 17.0f);
RenderTools()->DrawRoundRect(x, y, StatboardContentWidth-20, LineHeight*0.95f, 17.0f);
Graphics()->QuadsEnd();
}
@ -302,21 +301,21 @@ void CStatboard::RenderGlobalStats()
px = 325;
// DETAILED_STATS_FRAGS
// FRAGS
{
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_Frags);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_DEATHS
// DEATHS
{
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_Deaths);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_SUICIDES
// SUICIDES
{
px += 10;
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_Suicides);
@ -324,7 +323,7 @@ void CStatboard::RenderGlobalStats()
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_RATIO
// RATIO
{
if(Stats.m_Deaths == 0)
str_format(aBuf, sizeof(aBuf), "--");
@ -334,14 +333,14 @@ void CStatboard::RenderGlobalStats()
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_NET
// NET
{
str_format(aBuf, sizeof(aBuf), "%+d", Stats.m_Frags-Stats.m_Deaths);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_FPM
// FPM
{
float Fpm = (float)(Stats.m_Frags*60)/((float)(Client()->GameTick()-Stats.m_JoinDate)/Client()->GameTickSpeed());
str_format(aBuf, sizeof(aBuf), "%.1f", Fpm);
@ -349,14 +348,14 @@ void CStatboard::RenderGlobalStats()
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_SPREE
// SPREE
{
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_CurrentSpree);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
// DETAILED_STATS_BESTSPREE
// BEST SPREE
{
px += 40;
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_BestSpree);
@ -364,14 +363,17 @@ void CStatboard::RenderGlobalStats()
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
if(m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS)
// GRABS
if(gameWithFlags)
{
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_FlagGrabs);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);
TextRender()->Text(0, x-tw+px, y, FontSize, aBuf, -1);
px += 100;
}
for(i = 0, px=px-40; i < NUM_WEAPONS; i++)
// WEAPONS
px -= 40;
for(int i = 0; i < NUM_WEAPONS; i++)
{
if(!aDisplayWeapon[i])
continue;
@ -381,7 +383,8 @@ void CStatboard::RenderGlobalStats()
TextRender()->Text(0, x+px-tw/2, y, FontSize, aBuf, -1);
px += 80;
}
if(m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS)
// FLAGS
if(gameWithFlags)
{
str_format(aBuf, sizeof(aBuf), "%d", Stats.m_FlagCaptures);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1);

View file

@ -1073,15 +1073,18 @@ void CGameClient::OnNewSnapshot()
}
bool CurrentTickGameOver = m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER;
CServerInfo Info;
Client()->GetServerInfo(&Info);
if(!s_GameOver && CurrentTickGameOver)
OnGameOver();
else if(!(CurrentTickGameOver || CurrentTickPaused) // not in game over or pause state
&& (m_LastRoundStartTick != m_Snap.m_pGameInfoObj->m_RoundStartTick // and (new round started
&& !IsRace(&Info) // and not playing race (race_demo.cpp handles that case)
&& (m_Snap.m_pGameInfoObj->m_RoundStartTick - m_LastRoundStartTick > 2 // and (round start tick was updated more than 2 ticks ago
|| (s_GameOver && !CurrentTickGameOver))) // or game was over and now is not over)
{
m_LastRoundStartTick = m_Snap.m_pGameInfoObj->m_RoundStartTick;
OnStartGame();
}
m_LastRoundStartTick = m_Snap.m_pGameInfoObj->m_RoundStartTick;
s_GameOver = CurrentTickGameOver;
s_GamePaused = CurrentTickPaused;
}

View file

@ -24,7 +24,7 @@ void CGameContext::ConCredits(IConsole::IResult *pResult, void *pUserData)
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
"Help and code by eeeee, HMH, east, CookieMichal, Learath2,");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
"Savander, laxa, Tobii, BeaR, Wohoo, nuborn, DoNe & others.");
"Savander, laxa, Tobii, BeaR, Wohoo, nuborn, DoNe, Shiki & others.");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
"Based on DDRace by the DDRace developers,");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",

View file

@ -50,6 +50,7 @@ MACRO_CONFIG_INT(ClMouseMaxDistance, cl_mouse_max_distance, 800, 0, 0, CFGFLAG_C
#endif
MACRO_CONFIG_INT(DynCamMaxDistance, cl_dyn_cam_max_distance, 1000, 0, 2000, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Maximal dynamic camera distance")
MACRO_CONFIG_INT(DefaultMouseMaxDistance, cl_default_mouse_max_distance, 400, 0, 2000, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Default mouse max distance. Dyncam switches back to it")
MACRO_CONFIG_INT(DynCamDeadZone, cl_dyn_cam_dead_zone, 300, 1, 1300, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Dynamic camera dead zone")
MACRO_CONFIG_INT(DynCamFollowFactor, cl_dyn_cam_follow_factor, 60, 0, 200, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Dynamic camera follow factor")

View file

@ -3,8 +3,8 @@
#ifndef GAME_VERSION_H
#define GAME_VERSION_H
#include "generated/nethash.cpp"
#define GAME_VERSION "0.6.3, 7.7.1"
#define GAME_VERSION "0.6.3, 7.7.2"
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
static const char GAME_RELEASE_VERSION[8] = "7.7.1";
static const char GAME_RELEASE_VERSION[8] = "7.7.2";
#define CLIENT_VERSIONNR 707
#endif