MCPcopy Create free account
hub / github.com/ddnet/ddnet / SetBuffer

Method SetBuffer

src/game/client/lineinput.cpp:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21char CLineInput::ms_aStars[128] = "";
22
23void CLineInput::SetBuffer(char *pStr, size_t MaxSize, size_t MaxChars)
24{
25 if(m_pStr && m_pStr == pStr)
26 return;
27 const char *pLastStr = m_pStr;
28 m_pStr = pStr;
29 m_MaxSize = MaxSize;
30 m_MaxChars = MaxChars;
31 m_WasChanged = m_pStr && pLastStr && m_WasChanged;
32 m_WasCursorChanged = m_pStr && pLastStr && m_WasCursorChanged;
33 if(!pLastStr)
34 {
35 m_CursorPos = m_SelectionStart = m_SelectionEnd = m_LastCompositionCursorPos = 0;
36 m_ScrollOffset = m_ScrollOffsetChange = 0.0f;
37 m_CaretPosition = vec2(0.0f, 0.0f);
38 m_MouseSelection.m_Selecting = false;
39 m_Hidden = false;
40 m_pEmptyText = nullptr;
41 m_WasRendered = false;
42 }
43 if(m_pStr && m_pStr != pLastStr)
44 UpdateStrData();
45}
46
47void CLineInput::Clear()
48{

Callers 9

CMenusMethod · 0.45
RenderSettingsPlayerMethod · 0.45
RenderSettingsTeeMethod · 0.45
RenderEnvelopeEditorMethod · 0.45
PopupGroupMethod · 0.45
PopupLayerMethod · 0.45
PopupImageMethod · 0.45
PopupSoundMethod · 0.45
PopupMapInfoMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected