Merge branch 'DDRace' of github.com:def-/teeworlds into DDRace

This commit is contained in:
def 2013-12-19 23:04:12 +01:00
commit faca94b084
8 changed files with 29 additions and 19 deletions

View file

@ -770,7 +770,7 @@ const char *CClient::ErrorString()
void CClient::Render()
{
if(g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats)
if(g_Config.m_ClShowEntities)
{
vec3 bg = HslToRgb(vec3(g_Config.m_ClBackgroundEntitiesHue/255.0f, g_Config.m_ClBackgroundEntitiesSat/255.0f, g_Config.m_ClBackgroundEntitiesLht/255.0f));
Graphics()->Clear(bg.r, bg.g, bg.b);
@ -1207,6 +1207,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
{
int InputPredTick = Unpacker.GetInt();
int TimeLeft = Unpacker.GetInt();
int64 Now = time_get();
// adjust our prediction time
int64 Target = 0;
@ -1214,12 +1215,15 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
{
if(m_aInputs[k].m_Tick == InputPredTick)
{
Target = m_aInputs[k].m_PredictedTime + (time_get() - m_aInputs[k].m_Time);
Target = m_aInputs[k].m_PredictedTime + (Now - m_aInputs[k].m_Time);
Target = Target - (int64)(((TimeLeft-PREDICTION_MARGIN)/1000.0f)*time_freq());
break;
}
}
if ((Target - m_GameTime.Get(Now)) / 1000 < g_Config.m_ClSetPing)
Target = m_GameTime.Get(Now) + g_Config.m_ClSetPing * 1000;
if(Target)
m_PredictedTime.Update(&m_InputtimeMarginGraph, Target, TimeLeft, 1);
}

View file

@ -120,7 +120,6 @@ MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can ha
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off")
MACRO_CONFIG_INT(SvTestingCommands, sv_test_cmds, 0, 0, 1, CFGFLAG_SERVER, "Turns testing commands aka cheats on/off")
MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)")
MACRO_CONFIG_INT(ClDDRaceCheats, cl_race_cheats, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Cheats Such as Zoom")
MACRO_CONFIG_INT(ClDDRaceBinds, cl_race_binds, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Default DDRace builds when pressing the reset binds button")
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether the DDRace binds set or not (this is automated you don't need to use this)")
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off")

View file

@ -84,7 +84,7 @@ void CCamera::ConZoomPlus(IConsole::IResult *pResult, void *pUserData)
CCamera *pSelf = (CCamera *)pUserData;
CServerInfo Info;
pSelf->Client()->GetServerInfo(&Info);
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || (g_Config.m_ClDDRaceCheats == 1 && (str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap"))))
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || (str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap")))
((CCamera *)pUserData)->m_Zoom *= ZoomStep;
}
void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData)
@ -92,7 +92,7 @@ void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData)
CCamera *pSelf = (CCamera *)pUserData;
CServerInfo Info;
pSelf->Client()->GetServerInfo(&Info);
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || (g_Config.m_ClDDRaceCheats == 1 && (str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap"))))
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || (str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap")))
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
}
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData)

View file

@ -226,7 +226,7 @@ void CMapLayers::OnRender()
}
}
if((Render && !IsGameLayer && (!g_Config.m_ClShowEntities || !g_Config.m_ClDDRaceCheats)) || ((g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats) && IsGameLayer))
if((Render && !IsGameLayer && !g_Config.m_ClShowEntities) || (g_Config.m_ClShowEntities && IsGameLayer))
{
//layershot_begin();
@ -270,7 +270,7 @@ void CMapLayers::OnRender()
//layershot_end();
}
else if((g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats) && IsFrontLayer)
else if(g_Config.m_ClShowEntities && IsFrontLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;
Graphics()->TextureSet(m_pClient->m_pMapimages->GetEntities());
@ -284,7 +284,7 @@ void CMapLayers::OnRender()
RenderTools()->RenderTilemap(pFrontTiles, pTMap->m_Width, pTMap->m_Height, 32.0f, Color, TILERENDERFLAG_EXTEND|LAYERRENDERFLAG_TRANSPARENT,
EnvelopeEval, this, pTMap->m_ColorEnv, pTMap->m_ColorEnvOffset);
}
else if((g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats) && IsSwitchLayer)
else if(g_Config.m_ClShowEntities && IsSwitchLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;
Graphics()->TextureSet(m_pClient->m_pMapimages->GetEntities());
@ -297,7 +297,7 @@ void CMapLayers::OnRender()
RenderTools()->RenderSwitchmap(pSwitchTiles, pTMap->m_Width, pTMap->m_Height, 32.0f, Color, TILERENDERFLAG_EXTEND|LAYERRENDERFLAG_TRANSPARENT);
RenderTools()->RenderSwitchOverlay(pSwitchTiles, pTMap->m_Width, pTMap->m_Height, 32.0f);
}
else if((g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats) && IsTeleLayer)
else if(g_Config.m_ClShowEntities && IsTeleLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;
Graphics()->TextureSet(m_pClient->m_pMapimages->GetEntities());
@ -310,7 +310,7 @@ void CMapLayers::OnRender()
RenderTools()->RenderTelemap(pTeleTiles, pTMap->m_Width, pTMap->m_Height, 32.0f, Color, TILERENDERFLAG_EXTEND|LAYERRENDERFLAG_TRANSPARENT);
RenderTools()->RenderTeleOverlay(pTeleTiles, pTMap->m_Width, pTMap->m_Height, 32.0f);
}
else if((g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats) && IsSpeedupLayer)
else if(g_Config.m_ClShowEntities && IsSpeedupLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;
Graphics()->TextureSet(m_pClient->m_pMapimages->GetEntities());

View file

@ -1029,13 +1029,7 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
}
MainView.HSplitTop(20.0f, &Button, &MainView);
if(DoButton_CheckBox(&g_Config.m_ClDDRaceCheats, Localize("Enable DDRace cheats like zoom"), g_Config.m_ClDDRaceCheats, &Button))
{
g_Config.m_ClDDRaceCheats ^= 1;
}
MainView.HSplitTop(20.0f, &Button, &MainView);
if(DoButton_CheckBox(&g_Config.m_ClShowEntities, Localize("Cheat: Shows entities in game (can also be toggled via console cl_show_entities)"), g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats, &Button))
if(DoButton_CheckBox(&g_Config.m_ClShowEntities, Localize("Cheat: Shows entities in game (can also be toggled via console cl_show_entities)"), g_Config.m_ClShowEntities, &Button))
{
g_Config.m_ClShowEntities ^= 1;
}
@ -1118,6 +1112,18 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
g_Config.m_ClShowChat ^= 1;
}
// Set Ping
{
char aBuf[64];
str_format(aBuf, sizeof(aBuf), "%d", g_Config.m_ClSetPing);
MainView.HSplitTop(20.0f, &Button, &MainView);
UI()->DoLabelScaled(&Button, Localize("Set Ping (increase prediction)"), 14.0f, -1);
Button.VSplitLeft(300.0f, 0, &Button);
static float Offset = 0.0f;
DoEditBox(&g_Config.m_ClSetPing, &Button, aBuf, sizeof(aBuf), 14.0f, &Offset);
g_Config.m_ClSetPing = min(900, max(0, str_toint(aBuf)));
}
CUIRect aRects[2];
CUIRect Label;
MainView.HSplitTop(5.0f, 0, &MainView);

View file

@ -85,7 +85,7 @@ static void Rotate(CPoint *pCenter, CPoint *pPoint, float Rotation)
void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, ENVELOPE_EVAL pfnEval, void *pUser)
{
if(!g_Config.m_ClShowQuads || (g_Config.m_ClShowEntities && g_Config.m_ClDDRaceCheats))
if(!g_Config.m_ClShowQuads || g_Config.m_ClShowEntities)
return;
Graphics()->QuadsBegin();

View file

@ -7,6 +7,7 @@
// client
MACRO_CONFIG_INT(ClPredict, cl_predict, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Predict client movements")
MACRO_CONFIG_INT(ClSetPing, cl_setping, 0, 0, 900, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Set ping (in ms; prediction time is increased as if you have that ping)")
MACRO_CONFIG_INT(ClAntiPing, cl_antiping, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Antiping (predict other players' movements)")
MACRO_CONFIG_INT(ClAntiPingGrenade, cl_antiping_grenade, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Antiping (predict grenades)")
MACRO_CONFIG_INT(ClNameplates, cl_nameplates, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show name plates")

View file

@ -3,7 +3,7 @@
#ifndef GAME_VERSION_H
#define GAME_VERSION_H
#include "generated/nethash.cpp"
#define GAME_VERSION "0.6 trunk, 1.23"
#define GAME_VERSION "0.6 trunk, 1.24"
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
static const char GAME_RELEASE_VERSION[8] = {'0', '.', '6', '1', 0};
#endif