parent
49848705f7
commit
8a4ac55c90
@ -0,0 +1,14 @@
|
||||
#ifndef ANIMATIONHANDLER_H_
|
||||
#define ANIMATIONHANDLER_H_
|
||||
#include "raylib.h"
|
||||
|
||||
|
||||
struct AnimationHandler;
|
||||
|
||||
typedef struct AnimationHandler{
|
||||
Texture2D *textures;
|
||||
|
||||
|
||||
} AnimationHandler;
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,34 @@
|
||||
#include "textureatlas.h"
|
||||
#include "stdlib.h"
|
||||
#include "raylib.h"
|
||||
|
||||
TextureAtlas * TextureAtlasInit(){
|
||||
TextureAtlas *textures = (TextureAtlas *) malloc(sizeof(TextureAtlas));
|
||||
|
||||
LoadCursorTextures(textures->cursorTextures);
|
||||
LoadWorkerTextures(textures->workerTextures);
|
||||
|
||||
return textures;
|
||||
}
|
||||
|
||||
void LoadCursorTextures(Texture2D *cursorTextures){
|
||||
*cursorTextures = LoadTexture("assets/cursor.gif");
|
||||
*(cursorTextures + 1) = LoadTexture("assets/cursor_down.gif");
|
||||
}
|
||||
|
||||
void LoadWorkerTextures(Texture2D *workerTextures){
|
||||
Image worker1flip = LoadImage("assets/worker/worker-1.png");
|
||||
ImageFlipHorizontal(&worker1flip);
|
||||
Image worker2flip = LoadImage("assets/worker/worker-2.png");
|
||||
ImageFlipHorizontal(&worker2flip);
|
||||
Image worker3flip = LoadImage("assets/worker/worker-3.png");
|
||||
ImageFlipHorizontal(&worker3flip);
|
||||
textures->workerTextures[6] = LoadTexture("assets/worker/worker-0.png");
|
||||
textures->workerTextures[5] = LoadTexture("assets/worker/worker-1.png");
|
||||
textures->workerTextures[7] = LoadTextureFromImage(worker1flip);
|
||||
textures->workerTextures[4] = LoadTexture("assets/worker/worker-2.png");
|
||||
textures->workerTextures[0] = LoadTextureFromImage(worker2flip);
|
||||
textures->workerTextures[3] = LoadTexture("assets/worker/worker-3.png");
|
||||
textures->workerTextures[1] = LoadTextureFromImage(worker3flip);
|
||||
textures->workerTextures[2] = LoadTexture("assets/worker/worker-4.png");
|
||||
}
|
||||
Loading…
Reference in new issue