| 449 | GEngine->DrawText(Point2DFloat(_x, top), _size, Rect2DFloat(_x, top, _w, _h), _font, color, line); |
| 450 | *line = 0; |
| 451 | |
| 452 | row--; |
| 453 | if (row < 0) |
| 454 | { |
| 455 | return; |
| 456 | } |
| 457 | top -= _h; |
| 458 | } |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | void ChatList::GetSpeakingPlayers() |
| 463 | { |
| 464 | AutoArray<NetVoiceSpeakerInfo, Poseidon::Foundation::MemAllocSA> activeSpeakers; |
| 465 | GetNetworkManager().GetVoiceSpeakers(activeSpeakers); |
| 466 | |
| 467 | AutoArray<SpeakingIndication> speaking; |
| 468 | auto& testSpeakers = TestSpeakingIndications(); |
| 469 | for (int i = 0; i < testSpeakers.Size(); i++) |
| 470 | { |
| 471 | SpeakingIndication item = testSpeakers[i]; |
| 472 | item.lastSpeaking = Glob.uiTime; |
| 473 | speaking.Append() = item; |
| 474 | _lastSpeaking = Glob.uiTime; |
| 475 | } |
| 476 | |
| 477 | for (int i = 0; i < activeSpeakers.Size(); i++) |
| 478 | { |
| 479 | const NetVoiceSpeakerInfo& speaker = activeSpeakers[i]; |
| 480 | if (!speaker.active) |
| 481 | { |
| 482 | continue; |
| 483 | } |
| 484 | |
| 485 | SpeakingIndication& item = speaking.Append(); |
| 486 | const PlayerIdentity* identity = GetNetworkManager().FindIdentity(speaker.player); |
| 487 | item.name = identity ? identity->GetName() : Format("Player %d", speaker.player); |
| 488 | item.channel = VoNChatChannelToChatChannel(speaker.channel); |
| 489 | item.lastSpeaking = Glob.uiTime; |
| 490 | _lastSpeaking = Glob.uiTime; |
| 491 | } |
| 492 | |
| 493 | for (int i = 0; i < speaking.Size(); i++) |
| 494 | { |
| 495 | const SpeakingIndication& item = speaking[i]; |
| 496 | bool alreadyThere = false; |
| 497 | for (int j = 0; j < _speaking.Size(); j++) |
| 498 | { |
| 499 | SpeakingIndication& stable = _speaking[j]; |
| 500 | if (strcmp(stable.name, item.name) == 0) |
| 501 | { |
| 502 | stable.lastSpeaking = item.lastSpeaking; |
| 503 | stable.channel = item.channel; |
| 504 | alreadyThere = true; |
| 505 | break; |
| 506 | } |
| 507 | } |
| 508 | if (!alreadyThere) |
no test coverage detected