MCPcopy Create free account
hub / github.com/crossuo/crossuo / UpdateTextCoordinates

Method UpdateTextCoordinates

src/GameObjects/RenderStaticObject.cpp:85–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void CRenderStaticObject::UpdateTextCoordinates()
86{
87 int offset = 0;
88
89 if (IsGameObject() && ((CGameObject *)this)->Container != 0xFFFFFFFF)
90 {
91 for (CTextData *item = (CTextData *)m_TextControl->Last(); item != nullptr;
92 item = (CTextData *)item->m_Prev)
93 {
94 CTextData &text = *item;
95
96 if ((offset == 0) && text.Timer < g_Ticks)
97 {
98 continue;
99 }
100
101 offset += text.m_TextSprite.Height;
102
103 text.RealDrawX = text.GetX() - (text.m_TextSprite.Width / 2);
104 text.RealDrawY = text.GetY() - offset;
105 }
106 }
107 else
108 {
109 int y = DrawY - (m_TiledataPtr->Height + 20);
110
111 for (CTextData *item = (CTextData *)m_TextControl->Last(); item != nullptr;
112 item = (CTextData *)item->m_Prev)
113 {
114 CTextData &text = *item;
115
116 if ((offset == 0) && text.Timer < g_Ticks)
117 {
118 continue;
119 }
120
121 offset += text.m_TextSprite.Height;
122
123 text.RealDrawX = DrawX - (text.m_TextSprite.Width / 2);
124 text.RealDrawY = y - offset;
125 }
126 }
127}
128
129void CRenderStaticObject::FixTextCoordinates()
130{

Callers

nothing calls this directly

Calls 3

LastMethod · 0.80
GetYMethod · 0.80
GetXMethod · 0.45

Tested by

no test coverage detected