MCPcopy Create free account
hub / github.com/bwapi/bwapi / updateOverlays

Method updateOverlays

bwapi/BWAPI/Source/GameUpdate.cpp:227–262  ·  view source on GitHub ↗

------------------------------------------------- OVERLAYS -------------------------------------------------

Source from the content-addressed store, hash-verified

225
226//------------------------------------------------- OVERLAYS -------------------------------------------------
227void GameImpl::updateOverlays()
228{
229 if ( !data->hasGUI )
230 return;
231
232 // grid
233 if ( grid )
234 {
235 BWAPI::Position scrPos = getScreenPosition();
236
237 // draw mtx grid
238 for ( int y = scrPos.y/32; y < (scrPos.y + BW::BWDATA::GameScreenBuffer.height())/32 + 1; ++y )
239 {
240 for ( int x = scrPos.x/32; x < (scrPos.x + BW::BWDATA::GameScreenBuffer.width())/32 + 1; ++x )
241 {
242 for ( int i = 0; i < 32; i += 4 )
243 {
244 drawLineMap(x*32 + 32, y*32 + i, x*32 + 32, y*32 + i + 2, BWAPI::Colors::Grey);
245 drawLineMap(x*32 + i, y*32 + 32, x*32 + i + 2, y*32 + 32, BWAPI::Colors::Grey);
246 }
247 }
248 }
249 setTextSize(Text::Size::Small);
250 drawTextScreen(64, 288, "%c(%u, %u)", Text::White, (scrPos.x+this->getMousePosition().x)/32, (scrPos.y+this->getMousePosition().y)/32);
251 setTextSize();
252 } // grid
253
254 // fps display
255 if ( showfps )
256 {
257 setTextSize(Text::Size::Small);
258 drawTextScreen(1,1, "%cFrame Rate (Logical Frames)\nLFPS: %d\nAvg LFPS:%.3lf", BWAPI::Text::Yellow, this->getFPS(), this->getAverageFPS());
259 setTextSize();
260 } // fps
261
262}
263
264//--------------------------------------------- TOURNAMENT MODULE ----------------------------------------------
265void GameImpl::initializeTournamentModule()

Callers

nothing calls this directly

Calls 5

getMousePositionMethod · 0.95
getFPSMethod · 0.95
getAverageFPSMethod · 0.95
heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected