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

Method makeSprite

MicropolisCore/src/MicropolisEngine/src/sprite.cpp:350–361  ·  view source on GitHub ↗

* Make a sprite either by re-using the old one, or by making a new one. * @param type Sprite type of the new sprite. * @param x X coordinate of the new sprite. * @param y Y coordinate of the new sprite. */

Source from the content-addressed store, hash-verified

348 * @param y Y coordinate of the new sprite.
349 */
350SimSprite *Micropolis::makeSprite(int type, int x, int y)
351{
352 SimSprite *sprite;
353
354 sprite = globalSprites[type];
355 if (sprite == NULL) {
356 sprite = newSprite("", type, x, y);
357 } else {
358 initSprite(sprite, x, y);
359 }
360 return sprite;
361}
362
363
364/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected