| 258 | } |
| 259 | |
| 260 | void CStaticMapMain::DrawCommands() |
| 261 | { |
| 262 | for (int i = 0; i < GMainMapInfo.commands.Size();) |
| 263 | { |
| 264 | CommandInfo& cmd = GMainMapInfo.commands[i]; |
| 265 | if (cmd.state == CSFailed || // command failed |
| 266 | (cmd.state != CSSent && cmd.subgrp == nullptr) // subgroup destroyed |
| 267 | ) |
| 268 | { |
| 269 | GMainMapInfo.commands.Delete(i); |
| 270 | } |
| 271 | else |
| 272 | { |
| 273 | DrawCoord pt = WorldToScreen(cmd.position); |
| 274 | DrawSign(_infoCommand.icon, _infoCommand.color, pt, _infoCommand.size, _infoCommand.size, 0); |
| 275 | if (cmd.subgrp) |
| 276 | { |
| 277 | pt.x += 0.015; |
| 278 | |
| 279 | char buffer[256]; |
| 280 | PackedBoolArray list = cmd.subgrp->GetUnitsList(); |
| 281 | CreateUnitsList(list, buffer); |
| 282 | float h = _size; |
| 283 | float w = GEngine->GetTextWidth(_size, _font, buffer); |
| 284 | |
| 285 | // FIX clipping |
| 286 | if (pt.x + w < _x || pt.y + 0.5 * h < _y || pt.x > _x + _w || pt.y - 0.5 * h > _y + _h) |
| 287 | { |
| 288 | i++; |
| 289 | continue; |
| 290 | } |
| 291 | GEngine->DrawText(Point2DFloat(pt.x, pt.y - 0.5 * h), _size, Rect2DFloat(_x, _y, _w, _h), _font, |
| 292 | _ftColor, buffer); |
| 293 | } |
| 294 | i++; |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | void CStaticMapMain::DrawMarkers() |
| 300 | { |
nothing calls this directly
no test coverage detected