diff options
| author | oy <Tom_Adams@web.de> | 2011-04-13 20:37:12 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-13 20:37:12 +0200 |
| commit | 06115dd49dca2f8eb5f14606437e8fd20037cc4d (patch) | |
| tree | 5ec4bca6158319b3f5285d7689c5f94ae8da8c93 /src/game/client/lineinput.cpp | |
| parent | 63e059b8fff6498e42b765a1dca000e53005ea77 (diff) | |
| download | zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.tar.gz zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.zip | |
added "Whitespace and line Endings cleanup" by GreYFoX
Diffstat (limited to 'src/game/client/lineinput.cpp')
| -rw-r--r-- | src/game/client/lineinput.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/client/lineinput.cpp b/src/game/client/lineinput.cpp index b5d35ef8..29b891c2 100644 --- a/src/game/client/lineinput.cpp +++ b/src/game/client/lineinput.cpp @@ -27,19 +27,19 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p int CursorPos = *pCursorPosPtr; int Len = *pStrLenPtr; bool Changes = false; - + if(CursorPos > Len) CursorPos = Len; - + int Code = e.m_Unicode; int k = e.m_Key; - + // 127 is produced on Mac OS X and corresponds to the delete key if (!(Code >= 0 && Code < 32) && Code != 127) { char Tmp[8]; int CharSize = str_utf8_encode(Tmp, Code); - + if (Len < StrMaxSize - CharSize && CursorPos < StrMaxSize - CharSize) { mem_move(pStr + CursorPos + CharSize, pStr + CursorPos, Len - CursorPos + CharSize); @@ -50,7 +50,7 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p Changes = true; } } - + if(e.m_Flags&IInput::FLAG_PRESS) { if (k == KEY_BACKSPACE && CursorPos > 0) @@ -79,7 +79,7 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int *p else if (k == KEY_END) CursorPos = Len; } - + *pCursorPosPtr = CursorPos; *pStrLenPtr = Len; |