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

Method setScreenPosition

bwapi/BWAPI/Source/BWAPI/GameImpl.cpp:193–211  ·  view source on GitHub ↗

------------------------------------------- SET SCREEN POSITION ------------------------------------------

Source from the content-addressed store, hash-verified

191 }
192 //------------------------------------------- SET SCREEN POSITION ------------------------------------------
193 void GameImpl::setScreenPosition(int x, int y)
194 {
195 this->setLastError();
196 if ( !data->hasGUI ) return;
197
198 Position scrSize(BW::BWDATA::GameScreenBuffer.width(), BW::BWDATA::GameScreenBuffer.height()-108);
199 Position mapSize( TilePosition(Map::getWidth(), Map::getHeight()) );
200
201 // Sets the screen's position relative to the map
202 Position movePos(x,y);
203 movePos.setMin(0, 0);
204 movePos.setMax( mapSize - scrSize);
205
206 movePos &= 0xFFFFFFF8;
207 BW::BWDATA::MoveToX = movePos.x;
208 BW::BWDATA::MoveToY = movePos.y;
209 BW::BWDATA::Game.screenTilePosition = BW::TilePosition(movePos);
210 BW::BWFXN_UpdateScreenPosition();
211 }
212 //---------------------------------------------- PING MINIMAP ----------------------------------------------
213 void GameImpl::pingMinimap(int x, int y)
214 {

Callers 2

moveToSelectedUnitsMethod · 0.95
processCommandsMethod · 0.45

Calls 3

setLastErrorMethod · 0.95
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected