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

Method draw

src/Battlescape/UnitSprite.cpp:141–159  ·  view source on GitHub ↗

* Draws a unit, using the drawing rules of the unit. * This function is called by Map, for each unit on the screen. */

Source from the content-addressed store, hash-verified

139 * This function is called by Map, for each unit on the screen.
140 */
141void UnitSprite::draw()
142{
143 Surface::draw();
144 _drawingRoutine = _unit->getArmor()->getDrawingRoutine();
145 // Array of drawing routines
146 void (UnitSprite::*routines[])() = {&UnitSprite::drawRoutine0,
147 &UnitSprite::drawRoutine1,
148 &UnitSprite::drawRoutine2,
149 &UnitSprite::drawRoutine3,
150 &UnitSprite::drawRoutine4,
151 &UnitSprite::drawRoutine5,
152 &UnitSprite::drawRoutine6,
153 &UnitSprite::drawRoutine7,
154 &UnitSprite::drawRoutine8,
155 &UnitSprite::drawRoutine9,
156 &UnitSprite::drawRoutine0};
157 // Call the matching routine
158 (this->*(routines[_drawingRoutine]))();
159}
160
161/**
162 * Drawing routine for XCom soldiers in overalls and Sectoids and Mutons (routine 10).

Callers

nothing calls this directly

Calls 2

getDrawingRoutineMethod · 0.80
getArmorMethod · 0.45

Tested by

no test coverage detected