You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
#ifndef SPRITE_H_
|
|
#define SPRITE_H_
|
|
#include "raylib.h"
|
|
#include "../IsometricMap/isometricMap.h"
|
|
#include "../Textures/animationHandler.h"
|
|
#include "../Textures/textureatlas.h"
|
|
|
|
typedef struct Sprite Sprite;
|
|
typedef struct SpriteList SpriteList;
|
|
|
|
typedef struct Sprite {
|
|
Texture2D *texture;
|
|
float x;
|
|
float y;
|
|
float z;
|
|
float depth;
|
|
|
|
Sprite *next;
|
|
Sprite *prev;
|
|
} Sprite;
|
|
|
|
typedef struct SpriteList {
|
|
Sprite *head;
|
|
Sprite *tail;
|
|
int spriteAmount;
|
|
} SpriteList;
|
|
|
|
void DrawSpriteToWorld(Sprite *sprite, IsometricMap *map, Camera2D *camera);
|
|
void DrawSpriteToScreen(Sprite *sprite);
|
|
void SpriteUpdate(Sprite *sprite);
|
|
|
|
Sprite * SpriteCreate(TextureAtlas *atlas, int textureID, int x, int y);
|
|
|
|
//Print the list in order
|
|
void SpriteListPrintForward(SpriteList *list);
|
|
void SpriteListInsertBefore(SpriteList *list, Sprite *new, Sprite *current);
|
|
void SpriteListInsertAfter(SpriteList *list, Sprite *new, Sprite *current);
|
|
void SpriteListInsert(SpriteList *list, Sprite *new);
|
|
void SpriteListRemove(SpriteList *list, Sprite *remove);
|
|
void SpriteListSpriteChanged(SpriteList *list, Sprite *changed);
|
|
SpriteList * SpriteListInit();
|
|
void SpriteListDrawAllSprites(SpriteList *list, IsometricMap *map, Camera2D *camera);
|
|
|
|
#endif
|