MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / updateTileState

Method updateTileState

source/gamemap/MiniMapDrawnFull.cpp:467–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467void MiniMapDrawnFull::updateTileState(uint32_t minimapXMin, uint32_t minimapXMax,
468 uint32_t minimapYMin, uint32_t minimapYMax, uint32_t tileXMin,
469 uint32_t tileXMax, uint32_t tileYMin, uint32_t tileYMax)
470{
471 Seat& localPlayerSeat = *(mGameMap.getLocalPlayer()->getSeat());
472 // We compute the tile representation
473 MiniMapDrawnFullPixel curValue = MiniMapDrawnFullPixel::dirtFull;
474 Seat* seatIfClaimed = nullptr;
475 for(uint32_t xxx = tileXMin; xxx < tileXMax; ++xxx)
476 {
477 for(uint32_t yyy = tileYMin; yyy < tileYMax; ++yyy)
478 {
479 Tile* tile = mGameMap.getTile(xxx, yyy);
480 if(tile == nullptr)
481 continue;
482
483 MiniMapDrawnFullPixel value = getPixelValueFromTile(localPlayerSeat,
484 *tile);
485 if(value > curValue)
486 {
487 curValue = value;
488 switch(value)
489 {
490 case MiniMapDrawnFullPixel::claimedGround:
491 case MiniMapDrawnFullPixel::claimedFull:
492 seatIfClaimed = tile->getSeat();
493 break;
494 default:
495 break;
496 }
497 }
498 }
499 }
500
501 // We paint corresponding pixels
502 colourFromPixelValue(curValue, seatIfClaimed, mPixelBuffer, mPixelBox,
503 mWidth, mHeight, minimapXMin, minimapXMax, minimapYMin, minimapYMax);
504}
505
506bool MiniMapDrawnFull::crossSegment(const Ogre::Vector3& p1, const Ogre::Vector3& p2,
507 uint32_t xMin, uint32_t xMax, uint32_t yMin, uint32_t yMax)

Callers 1

fireTileStateChangedMethod · 0.80

Calls 5

getPixelValueFromTileFunction · 0.85
colourFromPixelValueFunction · 0.85
getLocalPlayerMethod · 0.80
getSeatMethod · 0.45
getTileMethod · 0.45

Tested by

no test coverage detected