mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
Remove Application friend
This commit is contained in:
parent
311edabe51
commit
38f23ef79e
3 changed files with 11 additions and 12 deletions
|
@ -101,10 +101,12 @@ class Application;
|
||||||
class Application : public QApplication, public AbstractViewStateInterface, public AbstractScriptingServicesInterface {
|
class Application : public QApplication, public AbstractViewStateInterface, public AbstractScriptingServicesInterface {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
// TODO? Get rid of those
|
||||||
friend class OctreePacketProcessor;
|
friend class OctreePacketProcessor;
|
||||||
friend class DatagramProcessor;
|
friend class PluginContainerProxy;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// FIXME? Empty methods, do we still need them?
|
||||||
static void initPlugins();
|
static void initPlugins();
|
||||||
static void shutdownPlugins();
|
static void shutdownPlugins();
|
||||||
|
|
||||||
|
@ -205,6 +207,8 @@ public:
|
||||||
const ApplicationCompositor& getApplicationCompositor() const { return _compositor; }
|
const ApplicationCompositor& getApplicationCompositor() const { return _compositor; }
|
||||||
Overlays& getOverlays() { return _overlays; }
|
Overlays& getOverlays() { return _overlays; }
|
||||||
|
|
||||||
|
bool isForeground() const { return _isForeground; }
|
||||||
|
|
||||||
float getFps() const { return _fps; }
|
float getFps() const { return _fps; }
|
||||||
|
|
||||||
float getFieldOfView() { return _fieldOfView.get(); }
|
float getFieldOfView() { return _fieldOfView.get(); }
|
||||||
|
@ -239,8 +243,6 @@ public:
|
||||||
DisplayPlugin* getActiveDisplayPlugin();
|
DisplayPlugin* getActiveDisplayPlugin();
|
||||||
const DisplayPlugin* getActiveDisplayPlugin() const;
|
const DisplayPlugin* getActiveDisplayPlugin() const;
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
FileLogger* getLogger() { return _logger; }
|
FileLogger* getLogger() { return _logger; }
|
||||||
|
|
||||||
glm::vec2 getViewportDimensions() const;
|
glm::vec2 getViewportDimensions() const;
|
||||||
|
@ -608,8 +610,6 @@ private:
|
||||||
quint64 _lastSimsPerSecondUpdate = 0;
|
quint64 _lastSimsPerSecondUpdate = 0;
|
||||||
bool _isForeground = true; // starts out assumed to be in foreground
|
bool _isForeground = true; // starts out assumed to be in foreground
|
||||||
bool _inPaint = false;
|
bool _inPaint = false;
|
||||||
|
|
||||||
friend class PluginContainerProxy;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Application_h
|
#endif // hifi_Application_h
|
||||||
|
|
|
@ -17,7 +17,7 @@ PluginContainerProxy::PluginContainerProxy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PluginContainerProxy::isForeground() {
|
bool PluginContainerProxy::isForeground() {
|
||||||
return qApp->_isForeground && !qApp->getWindow()->isMinimized();
|
return qApp->isForeground() && !qApp->getWindow()->isMinimized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginContainerProxy::addMenu(const QString& menuName) {
|
void PluginContainerProxy::addMenu(const QString& menuName) {
|
||||||
|
|
|
@ -37,7 +37,6 @@ void OctreePacketProcessor::processPacket(QSharedPointer<NLPacket> packet, Share
|
||||||
qDebug("OctreePacketProcessor::processPacket() packets to process=%d", packetsToProcessCount());
|
qDebug("OctreePacketProcessor::processPacket() packets to process=%d", packetsToProcessCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
Application* app = qApp;
|
|
||||||
bool wasStatsPacket = false;
|
bool wasStatsPacket = false;
|
||||||
|
|
||||||
PacketType octreePacketType = packet->getType();
|
PacketType octreePacketType = packet->getType();
|
||||||
|
@ -46,7 +45,7 @@ void OctreePacketProcessor::processPacket(QSharedPointer<NLPacket> packet, Share
|
||||||
// immediately following them inside the same packet. So, we process the PacketType_OCTREE_STATS first
|
// immediately following them inside the same packet. So, we process the PacketType_OCTREE_STATS first
|
||||||
// then process any remaining bytes as if it was another packet
|
// then process any remaining bytes as if it was another packet
|
||||||
if (octreePacketType == PacketType::OctreeStats) {
|
if (octreePacketType == PacketType::OctreeStats) {
|
||||||
int statsMessageLength = app->processOctreeStats(*packet, sendingNode);
|
int statsMessageLength = qApp->processOctreeStats(*packet, sendingNode);
|
||||||
|
|
||||||
wasStatsPacket = true;
|
wasStatsPacket = true;
|
||||||
int piggybackBytes = packet->getPayloadSize() - statsMessageLength;
|
int piggybackBytes = packet->getPayloadSize() - statsMessageLength;
|
||||||
|
@ -84,7 +83,7 @@ void OctreePacketProcessor::processPacket(QSharedPointer<NLPacket> packet, Share
|
||||||
return; // bail since piggyback version doesn't match
|
return; // bail since piggyback version doesn't match
|
||||||
}
|
}
|
||||||
|
|
||||||
app->trackIncomingOctreePacket(*packet, sendingNode, wasStatsPacket);
|
qApp->trackIncomingOctreePacket(*packet, sendingNode, wasStatsPacket);
|
||||||
|
|
||||||
// seek back to beginning of packet after tracking
|
// seek back to beginning of packet after tracking
|
||||||
packet->seek(0);
|
packet->seek(0);
|
||||||
|
@ -92,13 +91,13 @@ void OctreePacketProcessor::processPacket(QSharedPointer<NLPacket> packet, Share
|
||||||
switch(packetType) {
|
switch(packetType) {
|
||||||
case PacketType::EntityErase: {
|
case PacketType::EntityErase: {
|
||||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||||
app->_entities.processEraseMessage(*packet, sendingNode);
|
qApp->getEntities()->processEraseMessage(*packet, sendingNode);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PacketType::EntityData: {
|
case PacketType::EntityData: {
|
||||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||||
app->_entities.processDatagram(*packet, sendingNode);
|
qApp->getEntities()->processDatagram(*packet, sendingNode);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue