MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / playingLoop

Function playingLoop

src/bzflag/guiplaying.cpp:5921–6028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5919//
5920
5921static void playingLoop() {
5922 // start timing
5923 BzTime::setTick();
5924 updateDaylight(epochOffset);
5925
5926 worldDownLoader = new WorldDownLoader;
5927
5928 // main loop
5929 while (!CommandsStandard::isQuit()) {
5930 BZDBCache::update();
5931 canSpawn = true;
5932
5933 // set this step game time
5934 GameTime::setStepTime();
5935
5936 // get delta time
5937 BzTime prevTime = BzTime::getTick();
5938 BzTime::setTick();
5939 const float dt = float(BzTime::getTick() - prevTime);
5940
5941 mainWindow->getWindow()->yieldCurrent();
5942
5943 doMessages(); // handle incoming packets
5944
5945 updateHubLink();
5946
5947 if (world) { // update the world collision grid if required
5948 world->checkCollisionManager();
5949 }
5950
5951 mainWindow->getWindow()->yieldCurrent();
5952
5953 handlePendingJoins();
5954
5955 struct in_addr inAddress;
5956 if (dnsLookupDone(inAddress)) {
5957 joinInternetGame(&inAddress);
5958 scoreboard->huntReset();
5959 }
5960
5961 mainWindow->getWindow()->yieldCurrent();
5962
5963 // handle pending events for some small fraction of time
5964 clockAdjust = 0.0f;
5965 processInputEvents(0.1f);
5966
5967 handleJoyStick();
5968
5969 mainWindow->getWindow()->yieldCurrent();
5970
5971 callPlayingCallbacks(); // invoke callbacks
5972
5973 mainWindow->getWindow()->yieldCurrent();
5974
5975 if (CommandsStandard::isQuit()) {
5976 break; // quick out
5977 }
5978

Callers 1

startPlayingFunction · 0.70

Calls 15

updateDaylightFunction · 0.85
updateFunction · 0.85
doMessagesFunction · 0.85
updateHubLinkFunction · 0.85
handlePendingJoinsFunction · 0.85
dnsLookupDoneFunction · 0.85
joinInternetGameFunction · 0.85
processInputEventsFunction · 0.85
handleJoyStickFunction · 0.85
callPlayingCallbacksFunction · 0.85
prepareTheHUDFunction · 0.85
drawFrameFunction · 0.85

Tested by

no test coverage detected