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

Method Init

src/game/map/render_layer.cpp:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149};
150
151bool CRenderLayerTile::CTileLayerVisuals::Init(unsigned int Width, unsigned int Height)
152{
153 m_Width = Width;
154 m_Height = Height;
155 if(Width == 0 || Height == 0)
156 return false;
157 if constexpr(sizeof(unsigned int) >= sizeof(ptrdiff_t))
158 if(Width >= std::numeric_limits<std::ptrdiff_t>::max() || Height >= std::numeric_limits<std::ptrdiff_t>::max())
159 return false;
160
161 m_vTilesOfLayer.resize((size_t)Height * (size_t)Width);
162
163 m_vBorderTop.resize(Width);
164 m_vBorderBottom.resize(Width);
165
166 m_vBorderLeft.resize(Height);
167 m_vBorderRight.resize(Height);
168 return true;
169}
170
171/**************
172 * Base Layer *

Callers 1

UploadTileDataMethod · 0.45

Calls 11

GraphicsFunction · 0.85
fx2fFunction · 0.85
CreateBufferContainerMethod · 0.80
ColorRGBAClass · 0.50
NumMethod · 0.45
GetMethod · 0.45
InvalidateMethod · 0.45
OnInitMethod · 0.45
CreateBufferObjectMethod · 0.45

Tested by

no test coverage detected