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

Method UpdateZ

src/GameObjects/LandObject.cpp:64–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void CLandObject::UpdateZ(int zTop, int zRight, int zBottom)
65{
66 if (IsStretched)
67 {
68 Serial = ((m_Z + zTop + zRight + zBottom) / 4);
69
70 m_Rect.x = m_Z * 4 + 1;
71 m_Rect.y = zTop * 4;
72 m_Rect.w = zRight * 4;
73 m_Rect.h = zBottom * 4 + 1;
74
75 if (abs(m_Z - zRight) <= abs(zBottom - zTop))
76 {
77 AverageZ = (m_Z + zRight) >> 1;
78 }
79 else
80 {
81 AverageZ = (zBottom + zTop) >> 1;
82 }
83
84 MinZ = m_Z;
85
86 if (zTop < MinZ)
87 {
88 MinZ = zTop;
89 }
90
91 if (zRight < MinZ)
92 {
93 MinZ = zRight;
94 }
95
96 if (zBottom < MinZ)
97 {
98 MinZ = zBottom;
99 }
100 }
101}
102
103void CLandObject::Draw(int x, int y)
104{

Callers 1

CreateLandTextureRectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected