Conflicts:
	src/game/variables.h
This commit is contained in:
GreYFoXGTi 2010-10-13 14:08:35 +02:00
commit 47714c9468
10 changed files with 32 additions and 36 deletions

View file

@ -2059,7 +2059,7 @@ int main(int argc, const char **argv) // ignore_convention
{ {
if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention
{ {
ShowWindow(GetConsoleWindow(), SW_HIDE); FreeConsole();
break; break;
} }
} }

View file

@ -48,7 +48,7 @@ void CInput::Init()
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
} }
void CInput::MouseRelative(int *x, int *y) void CInput::MouseRelative(float *x, float *y)
{ {
int nx = 0, ny = 0; int nx = 0, ny = 0;
float Sens = g_Config.m_InpMousesens/100.0f; float Sens = g_Config.m_InpMousesens/100.0f;
@ -65,8 +65,8 @@ void CInput::MouseRelative(int *x, int *y)
} }
} }
*x = (int)(nx*Sens); *x = nx*Sens;
*y = (int)(ny*Sens); *y = ny*Sens;
} }
void CInput::MouseModeAbsolute() void CInput::MouseModeAbsolute()

View file

@ -19,7 +19,7 @@ public:
virtual void Init(); virtual void Init();
virtual void MouseRelative(int *x, int *y); virtual void MouseRelative(float *x, float *y);
virtual void MouseModeAbsolute(); virtual void MouseModeAbsolute();
virtual void MouseModeRelative(); virtual void MouseModeRelative();
virtual int MouseDoubleClick(); virtual int MouseDoubleClick();

View file

@ -72,7 +72,7 @@ public:
virtual void MouseModeAbsolute() = 0; virtual void MouseModeAbsolute() = 0;
virtual int MouseDoubleClick() = 0; virtual int MouseDoubleClick() = 0;
virtual void MouseRelative(int *x, int *y) = 0; virtual void MouseRelative(float *x, float *y) = 0;
}; };

View file

@ -102,7 +102,7 @@ void CEmoticon::OnRender()
m_WasActive = true; m_WasActive = true;
int x, y; float x, y;
Input()->MouseRelative(&x, &y); Input()->MouseRelative(&x, &y);
m_SelectorMouse.x += x; m_SelectorMouse.x += x;

View file

@ -201,7 +201,7 @@ void CHud::RenderTeambalanceWarning()
void CHud::RenderVoting() void CHud::RenderVoting()
{ {
if(!m_pClient->m_pVoting->IsVoting()) if(!m_pClient->m_pVoting->IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK)
return; return;
Graphics()->TextureSet(-1); Graphics()->TextureSet(-1);
@ -229,11 +229,11 @@ void CHud::RenderVoting()
const char *pYesKey = m_pClient->m_pBinds->GetKey("vote yes"); const char *pYesKey = m_pClient->m_pBinds->GetKey("vote yes");
const char *pNoKey = m_pClient->m_pBinds->GetKey("vote no"); const char *pNoKey = m_pClient->m_pBinds->GetKey("vote no");
str_format(Buf, sizeof(Buf), "%s - Vote Yes", pYesKey); str_format(Buf, sizeof(Buf), "%s - %s", pYesKey, Localize("Vote Yes"));
Base.y += Base.h+1; Base.y += Base.h+1;
UI()->DoLabel(&Base, Buf, 6.0f, -1); UI()->DoLabel(&Base, Buf, 6.0f, -1);
str_format(Buf, sizeof(Buf), "Vote No - %s", pNoKey); str_format(Buf, sizeof(Buf), "%s - %s", Localize("Vote No"), pNoKey);
UI()->DoLabel(&Base, Buf, 6.0f, 1); UI()->DoLabel(&Base, Buf, 6.0f, 1);
} }

View file

@ -437,9 +437,9 @@ void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType
else else
{ {
str_format(Item.m_aName, min(static_cast<int>(sizeof(Item.m_aName)), Length), " %s", pName); str_format(Item.m_aName, min(static_cast<int>(sizeof(Item.m_aName)), Length), " %s", pName);
char aBuffer[512]; char aBuffer[512];
str_format(aBuffer, sizeof(aBuffer), "%s/%s", pSelf->m_aCurrentDemoFolder, Item.m_aFilename); str_format(aBuffer, sizeof(aBuffer), "%s/%s", pSelf->m_aCurrentDemoFolder, Item.m_aFilename);
// TODO: many items slow this down, don't load the info from every file when making the filelist // TODO: many items slow this down, don't load the info from every file when making the filelist
Item.m_Valid = pSelf->DemoPlayer()->GetDemoInfo(pSelf->Storage(), aBuffer, StorageType, Item.m_aMap, sizeof(Item.m_aMap)); Item.m_Valid = pSelf->DemoPlayer()->GetDemoInfo(pSelf->Storage(), aBuffer, StorageType, Item.m_aMap, sizeof(Item.m_aMap));
} }
Item.m_IsDir = IsDir != 0; Item.m_IsDir = IsDir != 0;
@ -486,17 +486,17 @@ void CMenus::RenderDemoList(CUIRect MainView)
m_DemolistDelEntry = false; m_DemolistDelEntry = false;
} }
char aFooterLabel[128] = {0}; char aFooterLabel[128] = {0};
if(m_DemolistSelectedIndex >= 0) if(m_DemolistSelectedIndex >= 0)
{ {
if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0) if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0)
str_copy(aFooterLabel, Localize("Parent Folder"), sizeof(aFooterLabel)); str_copy(aFooterLabel, Localize("Parent Folder"), sizeof(aFooterLabel));
else if(m_DemolistSelectedIsDir) else if(m_DemolistSelectedIsDir)
str_copy(aFooterLabel, Localize("Folder"), sizeof(aFooterLabel)); str_copy(aFooterLabel, Localize("Folder"), sizeof(aFooterLabel));
else if(!m_lDemos[m_DemolistSelectedIndex].m_Valid) else if(!m_lDemos[m_DemolistSelectedIndex].m_Valid)
str_copy(aFooterLabel, Localize("Invalid Demo"), sizeof(aFooterLabel)); str_copy(aFooterLabel, Localize("Invalid Demo"), sizeof(aFooterLabel));
else else
str_format(aFooterLabel, sizeof(aFooterLabel), "%s: %s", Localize("Map"), m_lDemos[m_DemolistSelectedIndex].m_aMap); str_format(aFooterLabel, sizeof(aFooterLabel), "%s: %s", Localize("Map"), m_lDemos[m_DemolistSelectedIndex].m_aMap);
} }
// render background // render background

View file

@ -309,9 +309,9 @@ void CGameClient::OnInit()
void CGameClient::DispatchInput() void CGameClient::DispatchInput()
{ {
// handle mouse movement // handle mouse movement
int x=0, y=0; float x = 0.0f, y = 0.0f;
Input()->MouseRelative(&x, &y); Input()->MouseRelative(&x, &y);
if(x || y) if(x != 0.0f || y != 0.0f)
{ {
for(int h = 0; h < m_Input.m_Num; h++) for(int h = 0; h < m_Input.m_Num; h++)
{ {

View file

@ -3286,8 +3286,8 @@ void CEditor::DoMapBorder()
void CEditor::UpdateAndRender() void CEditor::UpdateAndRender()
{ {
static int s_MouseX = 0; static float s_MouseX = 0.0f;
static int s_MouseY = 0; static float s_MouseY = 0.0f;
if(m_Animate) if(m_Animate)
m_AnimateTime = (time_get()-m_AnimateStart)/(float)time_freq(); m_AnimateTime = (time_get()-m_AnimateStart)/(float)time_freq();
@ -3297,7 +3297,7 @@ void CEditor::UpdateAndRender()
// handle mouse movement // handle mouse movement
float mx, my, Mwx, Mwy; float mx, my, Mwx, Mwy;
int rx, ry; float rx, ry;
{ {
Input()->MouseRelative(&rx, &ry); Input()->MouseRelative(&rx, &ry);
m_MouseDeltaX = rx; m_MouseDeltaX = rx;
@ -3309,10 +3309,8 @@ void CEditor::UpdateAndRender()
s_MouseY += ry; s_MouseY += ry;
} }
if(s_MouseX < 0) s_MouseX = 0; clamp(s_MouseX, 0.0f, UI()->Screen()->w);
if(s_MouseY < 0) s_MouseY = 0; clamp(s_MouseY, 0.0f, UI()->Screen()->h);
if(s_MouseX > UI()->Screen()->w) s_MouseX = (int)UI()->Screen()->w;
if(s_MouseY > UI()->Screen()->h) s_MouseY = (int)UI()->Screen()->h;
// update the ui // update the ui
mx = s_MouseX; mx = s_MouseX;

View file

@ -67,9 +67,7 @@ MACRO_CONFIG_INT(SvInactiveKickTime, sv_inactivekick_time, 180, 0, 9999, CFGFLAG
MACRO_CONFIG_INT(SvInactiveKick, sv_inactivekick, 1, 0, 2, CFGFLAG_SERVER, "How to deal with inactive players (0=move to spectator, 1=move to free spectator slot/kick, 2=kick)", 3) MACRO_CONFIG_INT(SvInactiveKick, sv_inactivekick, 1, 0, 2, CFGFLAG_SERVER, "How to deal with inactive players (0=move to spectator, 1=move to free spectator slot/kick, 2=kick)", 3)
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players", 3) MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players", 3)
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 300, 0, 9999, CFGFLAG_SERVER, "The time to ban a player if kicked by vote. 0 makes it just use kick", 3) MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time to ban a player if kicked by vote. 0 makes it just use kick", 3)
/*MACRO_CONFIG_INT(SvVoteScorelimit, sv_vote_scorelimit, 0, 0, 1, CFGFLAG_SERVER, "Allow voting to change score limit")
MACRO_CONFIG_INT(SvVoteTimelimit, sv_vote_timelimit, 0, 0, 1, CFGFLAG_SERVER, "Allow voting to change time limit")*/
// debug // debug
#ifdef CONF_DEBUG // this one can crash the server if not used correctly #ifdef CONF_DEBUG // this one can crash the server if not used correctly