2018-08-01 16:03:16 +02:00
|
|
|
//
|
|
|
|
// Created by Wouter Groeneveld on 26/07/18.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef GBA_SPRITE_ENGINE_SPRITE_MANAGER_H
|
|
|
|
#define GBA_SPRITE_ENGINE_SPRITE_MANAGER_H
|
|
|
|
|
2018-08-08 13:00:27 +02:00
|
|
|
#include <libgba-sprite-engine/gba/tonc_types.h>
|
2018-08-01 16:03:16 +02:00
|
|
|
#include "sprite.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class SpriteManager {
|
|
|
|
private:
|
|
|
|
bool initialized;
|
|
|
|
std::vector<Sprite*> sprites;
|
|
|
|
|
|
|
|
void copyOverSpriteOAMToVRAM();
|
2018-08-09 11:35:52 +02:00
|
|
|
void copyOverImageDataToVRAM(Sprite* s);
|
2018-08-01 16:03:16 +02:00
|
|
|
void copyOverImageDataToVRAM();
|
|
|
|
|
|
|
|
public:
|
|
|
|
int getSpriteSize() { return sprites.size(); }
|
|
|
|
|
2018-12-15 19:34:47 +01:00
|
|
|
void hideAll();
|
2018-08-09 11:35:52 +02:00
|
|
|
void add(Sprite* sprite);
|
2018-08-01 16:03:16 +02:00
|
|
|
void set(std::vector<Sprite*> sprites);
|
|
|
|
void persist(); // copies over image and palette data to VRAM, modifies sprite OAM indiches
|
|
|
|
void render(); // copies over OAM buffer to OAM RAM, called in game loop
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //GBA_SPRITE_ENGINE_SPRITE_MANAGER_H
|