MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / init

Method init

src/Battlescape/Map.cpp:126–150  ·  view source on GitHub ↗

* Initializes the map. */

Source from the content-addressed store, hash-verified

124 * Initializes the map.
125 */
126void Map::init()
127{
128 // load the tiny arrow into a surface
129 int f = Palette::blockOffset(1); // yellow
130 int b = 15; // black
131 int pixels[81] = { 0, 0, b, b, b, b, b, 0, 0,
132 0, 0, b, f, f, f, b, 0, 0,
133 0, 0, b, f, f, f, b, 0, 0,
134 b, b, b, f, f, f, b, b, b,
135 b, f, f, f, f, f, f, f, b,
136 0, b, f, f, f, f, f, b, 0,
137 0, 0, b, f, f, f, b, 0, 0,
138 0, 0, 0, b, f, b, 0, 0, 0,
139 0, 0, 0, 0, b, 0, 0, 0, 0 };
140
141 _arrow = new Surface(9, 9);
142 _arrow->setPalette(this->getPalette());
143 _arrow->lock();
144 for (int y = 0; y < 9;++y)
145 for (int x = 0; x < 9; ++x)
146 _arrow->setPixel(x, y, pixels[x+(y*9)]);
147 _arrow->unlock();
148
149 _projectile = 0;
150}
151
152/**
153 * Keeps the animation timers running.

Callers

nothing calls this directly

Calls 5

setPixelMethod · 0.80
unlockMethod · 0.80
setPaletteMethod · 0.45
getPaletteMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected