| 475 | } |
| 476 | |
| 477 | void CMapLocation::UpdateSpotPointer(CUICustomMap* map, CMapSpotPointer* sp, const Fvector2& position_on_map) |
| 478 | { |
| 479 | if (sp->GetParent()) |
| 480 | return; // already is child |
| 481 | float heading; |
| 482 | Fvector2 pointer_pos; |
| 483 | |
| 484 | if (map->GetPointerTo(position_on_map, sp->GetWidth() / 2, pointer_pos, heading)) |
| 485 | { |
| 486 | sp->SetWndPos(pointer_pos); |
| 487 | sp->SetHeading(heading); |
| 488 | |
| 489 | Frect clip_rect = map->GetClipperRect(); |
| 490 | sp->SetClipRect(clip_rect); |
| 491 | |
| 492 | map->AttachChild(sp); |
| 493 | |
| 494 | Fvector2 t = position_on_map; |
| 495 | Fvector target; |
| 496 | target.set(t.x, 0.0f, t.y); |
| 497 | |
| 498 | Fvector s = Level().CurrentEntity()->Position(); |
| 499 | Fvector source; |
| 500 | source.set(s.x, 0.0f, s.z); |
| 501 | |
| 502 | float dist_to_target = source.distance_to(target); |
| 503 | map->SetPointerDistance(dist_to_target); |
| 504 | |
| 505 | // Msg("m_position_on_map x=%f y=%f", m_position_on_map.x, m_position_on_map.y); |
| 506 | // Msg("t x=%f y=%f", t.x, t.y); |
| 507 | // Msg("CurrentEntity()->Position() x=%f y=%f z=%f", Level().CurrentEntity()->Position().x, Level().CurrentEntity()->Position().y, Level().CurrentEntity()->Position().z); |
| 508 | // Msg("dist_to_target = %f", dist_to_target); |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | void CMapLocation::UpdateMiniMap(CUICustomMap* map) |
| 513 | { |
nothing calls this directly
no test coverage detected