gba-sprite-engine/engine/include/libgba-sprite-engine/sprites/affine_sprite.h

35 lines
824 B
C++

//
// Created by Wouter Groeneveld on 28/07/18.
//
#ifndef GBA_SPRITE_ENGINE_AFFINE_SPRITE_H
#define GBA_SPRITE_ENGINE_AFFINE_SPRITE_H
#include "sprite.h"
class SpriteManager;
class AffineSprite : public Sprite {
private:
int affIndex;
std::unique_ptr<OBJ_AFFINE> affine;
void setTransformationMatrix(OBJ_AFFINE *matrix);
void rebuildOamAttr1ForAffineIndex();
protected:
void buildOam(int tileIndex) override;
void syncOam() override;
public:
void setAffineIndex(int index) { this->affIndex = index; }
void identity();
void rotate(u16 alpha);
AffineSprite(const void* imgData, int imgSize, int xC, int yC, SpriteSize spriteSize) : Sprite(imgData, imgSize, xC, yC, spriteSize), affIndex(0) {
}
friend class SpriteManager;
};
#endif //GBA_SPRITE_ENGINE_AFFINE_SPRITE_H