Changeset View
Changeset View
Standalone View
Standalone View
source/ps/CConsole.cpp
/* Copyright (C) 2016 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | case SDLK_DELETE: | ||||
return; | return; | ||||
case SDLK_HOME: | case SDLK_HOME: | ||||
if (g_keys[SDLK_RCTRL] || g_keys[SDLK_LCTRL]) | if (g_keys[SDLK_RCTRL] || g_keys[SDLK_LCTRL]) | ||||
{ | { | ||||
CScopeLock lock(m_Mutex); // needed for safe access to m_deqMsgHistory | CScopeLock lock(m_Mutex); // needed for safe access to m_deqMsgHistory | ||||
int linesShown = (int)m_fHeight/m_iFontHeight - 4; | int linesShown = (int)m_fHeight/m_iFontHeight - 4; | ||||
m_iMsgHistPos = clamp((int)m_deqMsgHistory.size() - linesShown, 1, (int)m_deqMsgHistory.size()); | m_iMsgHistPos = Clamp(static_cast<int>(m_deqMsgHistory.size()) - linesShown, 1, static_cast<int>(m_deqMsgHistory.size())); | ||||
Stan: static_cast | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
m_iBufferPos = 0; | m_iBufferPos = 0; | ||||
} | } | ||||
return; | return; | ||||
case SDLK_END: | case SDLK_END: | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
static_cast