mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Light ImGui cleanup
* CTextLogger: Explicit cast return value of size() to int when testing int value against size_t. * CBrowser: Run think and request thread on client.dll, but for the request, only the refresh.
This commit is contained in:
parent
ade1de41a9
commit
f015667f88
@ -43,22 +43,22 @@ History:
|
|||||||
CBrowser::CBrowser(void)
|
CBrowser::CBrowser(void)
|
||||||
{
|
{
|
||||||
memset(m_szServerAddressBuffer, '\0', sizeof(m_szServerAddressBuffer));
|
memset(m_szServerAddressBuffer, '\0', sizeof(m_szServerAddressBuffer));
|
||||||
#ifndef CLIENT_DLL
|
static std::thread request([this]()
|
||||||
static std::thread hostingServerRequestThread([this]()
|
|
||||||
{
|
{
|
||||||
RefreshServerList();
|
RefreshServerList();
|
||||||
|
#ifndef CLIENT_DLL
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
UpdateHostingStatus();
|
UpdateHostingStatus();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||||
}
|
}
|
||||||
|
#endif // !CLIENT_DLL
|
||||||
});
|
});
|
||||||
|
|
||||||
hostingServerRequestThread.detach();
|
request.detach();
|
||||||
|
|
||||||
std::thread think(&CBrowser::Think, this);
|
std::thread think(&CBrowser::Think, this);
|
||||||
think.detach();
|
think.detach();
|
||||||
#endif // !CLIENT_DLL
|
|
||||||
|
|
||||||
m_pszBrowserTitle = "Server Browser";
|
m_pszBrowserTitle = "Server Browser";
|
||||||
m_rLockedIconBlob = GetModuleResource(IDB_PNG2);
|
m_rLockedIconBlob = GetModuleResource(IDB_PNG2);
|
||||||
|
12
r5dev/thirdparty/imgui/src/imgui_logger.cpp
vendored
12
r5dev/thirdparty/imgui/src/imgui_logger.cpp
vendored
@ -257,7 +257,7 @@ CTextLogger::Coordinates CTextLogger::ScreenPosToCoordinates(const ImVec2& aPosi
|
|||||||
int columnIndex = 0;
|
int columnIndex = 0;
|
||||||
float columnX = 0.0f;
|
float columnX = 0.0f;
|
||||||
|
|
||||||
while ((size_t)columnIndex < line.size())
|
while (columnIndex < static_cast<int>(line.size()))
|
||||||
{
|
{
|
||||||
float columnWidth = 0.0f;
|
float columnWidth = 0.0f;
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ CTextLogger::Coordinates CTextLogger::FindNextWord(const Coordinates & aFrom) co
|
|||||||
|
|
||||||
while (!isword || skip)
|
while (!isword || skip)
|
||||||
{
|
{
|
||||||
if (at.m_nLine >= m_Lines.size())
|
if (at.m_nLine >= static_cast<int>(m_Lines.size()))
|
||||||
{
|
{
|
||||||
int l = std::max(0, static_cast<int>(m_Lines.size() - 1));
|
int l = std::max(0, static_cast<int>(m_Lines.size() - 1));
|
||||||
return Coordinates(l, GetLineMaxColumn(l));
|
return Coordinates(l, GetLineMaxColumn(l));
|
||||||
@ -408,7 +408,7 @@ CTextLogger::Coordinates CTextLogger::FindNextWord(const Coordinates & aFrom) co
|
|||||||
|
|
||||||
int CTextLogger::GetCharacterIndex(const Coordinates& aCoordinates) const
|
int CTextLogger::GetCharacterIndex(const Coordinates& aCoordinates) const
|
||||||
{
|
{
|
||||||
if (aCoordinates.m_nLine >= m_Lines.size())
|
if (aCoordinates.m_nLine >= static_cast<int>(m_Lines.size()))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
const Line& line = m_Lines[aCoordinates.m_nLine];
|
const Line& line = m_Lines[aCoordinates.m_nLine];
|
||||||
@ -1193,7 +1193,7 @@ void CTextLogger::MoveRight(int aAmount, bool aSelect, bool aWordMode)
|
|||||||
{
|
{
|
||||||
const Coordinates oldPos = m_State.m_CursorPosition;
|
const Coordinates oldPos = m_State.m_CursorPosition;
|
||||||
|
|
||||||
if (m_Lines.empty() || oldPos.m_nLine >= m_Lines.size())
|
if (m_Lines.empty() || oldPos.m_nLine >= static_cast<int>(m_Lines.size()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int cindex = GetCharacterIndex(m_State.m_CursorPosition);
|
int cindex = GetCharacterIndex(m_State.m_CursorPosition);
|
||||||
@ -1202,9 +1202,9 @@ void CTextLogger::MoveRight(int aAmount, bool aSelect, bool aWordMode)
|
|||||||
int lindex = m_State.m_CursorPosition.m_nLine;
|
int lindex = m_State.m_CursorPosition.m_nLine;
|
||||||
const Line& line = m_Lines[lindex];
|
const Line& line = m_Lines[lindex];
|
||||||
|
|
||||||
if (cindex >= line.size()) // !CAST: SIZE_T
|
if (cindex >= static_cast<int>(line.size()))
|
||||||
{
|
{
|
||||||
if (m_State.m_CursorPosition.m_nLine < m_Lines.size() - 1)
|
if (m_State.m_CursorPosition.m_nLine < static_cast<int>(m_Lines.size()) - 1)
|
||||||
{
|
{
|
||||||
m_State.m_CursorPosition.m_nLine = std::max(0, std::min(static_cast<int>(m_Lines.size()) - 1, m_State.m_CursorPosition.m_nLine + 1));
|
m_State.m_CursorPosition.m_nLine = std::max(0, std::min(static_cast<int>(m_Lines.size()) - 1, m_State.m_CursorPosition.m_nLine + 1));
|
||||||
m_State.m_CursorPosition.m_nColumn = 0;
|
m_State.m_CursorPosition.m_nColumn = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user