MCPcopy Create free account
hub / github.com/SimHacker/micropolis / spriteNotInBounds

Method spriteNotInBounds

MicropolisCore/src/MicropolisEngine/src/sprite.cpp:454–460  ·  view source on GitHub ↗

* Check whether a sprite is still entirely on-map. * @param sprite Sprite to check. * @return Sprite is at least partly off-map. */

Source from the content-addressed store, hash-verified

452 * @return Sprite is at least partly off-map.
453 */
454bool Micropolis::spriteNotInBounds(SimSprite *sprite)
455{
456 int x = sprite->x + sprite->xHot;
457 int y = sprite->y + sprite->yHot;
458
459 return x < 0 || y < 0 || x >= (WORLD_W <<4) || y >= (WORLD_H <<4);
460}
461
462/**
463 * Get direction (0..8?) to get from starting point to destination point.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected