History

use NodeSet in place of QSet<NodeType_t> where possible

Stephen Birarda committed 12 years ago

Commit 423e1591 parent 4de270b4 files · +9 −10Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+5−6
@@ -229,7 +229,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 228 unmodified lines
229 #endif229 #endif
230 230
231 // tell the NodeList instance who to tell the domain server we care about231 // tell the NodeList instance who to tell the domain server we care about
232 nodeList->addSetOfNodeTypesToNodeInterestSet(QSet<NodeType_t>() << NodeType::AudioMixer << NodeType::AvatarMixer232 nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer
233 << NodeType::VoxelServer << NodeType::ParticleServer233 << NodeType::VoxelServer << NodeType::ParticleServer
234 << NodeType::MetavoxelServer);234 << NodeType::MetavoxelServer);
235 235
@@ -648,8 +648,7 @@ void Application::resetProfile(const QString& username) { · 412 unmodified lines
648 updateWindowTitle();648 updateWindowTitle();
649}649}
650 650
651void Application::controlledBroadcastToNodes(const QByteArray& packet,651void Application::controlledBroadcastToNodes(const QByteArray& packet, const NodeSet& destinationNodeTypes) {
652 const QSet<NodeType_t>& destinationNodeTypes) {
653 foreach(NodeType_t type, destinationNodeTypes) {652 foreach(NodeType_t type, destinationNodeTypes) {
654 // Intercept data to voxel server when voxels are disabled653 // Intercept data to voxel server when voxels are disabled
655 if (type == NodeType::VoxelServer && !Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) {654 if (type == NodeType::VoxelServer && !Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) {
@@ -657,7 +656,7 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, · 1 unmodified line
657 }656 }
658 657
659 // Perform the broadcast for one type658 // Perform the broadcast for one type
660 int nReceivingNodes = NodeList::getInstance()->broadcastToNodes(packet, QSet<NodeType_t>() << type);659 int nReceivingNodes = NodeList::getInstance()->broadcastToNodes(packet, NodeSet() << type);
661 660
662 // Feed number of bytes to corresponding channel of the bandwidth meter, if any (done otherwise)661 // Feed number of bytes to corresponding channel of the bandwidth meter, if any (done otherwise)
663 BandwidthMeter::ChannelIndex channel;662 BandwidthMeter::ChannelIndex channel;
@@ -1332,7 +1331,7 @@ void Application::wheelEvent(QWheelEvent* event) { · 668 unmodified lines
1332 1331
1333void Application::sendPingPackets() {1332void Application::sendPingPackets() {
1334 QByteArray pingPacket = NodeList::getInstance()->constructPingPacket();1333 QByteArray pingPacket = NodeList::getInstance()->constructPingPacket();
1335 getInstance()->controlledBroadcastToNodes(pingPacket, QSet<NodeType_t>() << NodeType::VoxelServer1334 getInstance()->controlledBroadcastToNodes(pingPacket, NodeSet() << NodeType::VoxelServer
1336 << NodeType::ParticleServer1335 << NodeType::ParticleServer
1337 << NodeType::AudioMixer << NodeType::AvatarMixer1336 << NodeType::AudioMixer << NodeType::AvatarMixer
1338 << NodeType::MetavoxelServer);1337 << NodeType::MetavoxelServer);
@@ -2363,7 +2362,7 @@ void Application::updateAvatar(float deltaTime) { · 1024 unmodified lines
2363 QByteArray avatarData = byteArrayWithPopluatedHeader(PacketTypeAvatarData);2362 QByteArray avatarData = byteArrayWithPopluatedHeader(PacketTypeAvatarData);
2364 avatarData.append(_myAvatar.toByteArray());2363 avatarData.append(_myAvatar.toByteArray());
2365 2364
2366 controlledBroadcastToNodes(avatarData, QSet<NodeType_t>() << NodeType::AvatarMixer);2365 controlledBroadcastToNodes(avatarData, NodeSet() << NodeType::AvatarMixer);
2367 2366
2368 // Update _viewFrustum with latest camera and view frustum data...2367 // Update _viewFrustum with latest camera and view frustum data...
2369 // NOTE: we get this from the view frustum, to make it simpler, since the2368 // NOTE: we get this from the view frustum, to make it simpler, since the

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t