|
|
|
@ -7,19 +7,20 @@
|
|
|
|
TextureAtlas * TextureAtlasInit(){
|
|
|
|
TextureAtlas * TextureAtlasInit(){
|
|
|
|
TextureAtlas *textures = (TextureAtlas *) malloc(sizeof(TextureAtlas));
|
|
|
|
TextureAtlas *textures = (TextureAtlas *) malloc(sizeof(TextureAtlas));
|
|
|
|
|
|
|
|
|
|
|
|
LoadCursorTextures(textures->cursorTextures);
|
|
|
|
LoadCursorTextures(textures->cursorTextures, textures->cursorAnimation);
|
|
|
|
LoadWorkerTextures(textures->workerTextures);
|
|
|
|
LoadWorkerTextures(textures->workerTextures);
|
|
|
|
LoadWorkerAnimations(textures->workerAnimations, textures->workerTextures);
|
|
|
|
LoadWorkerAnimations(textures->workerAnimations, textures->workerTextures);
|
|
|
|
|
|
|
|
|
|
|
|
return textures;
|
|
|
|
return textures;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LoadCursorTextures(Texture2D *cursorTextures){
|
|
|
|
void LoadCursorTextures(Texture2D *cursorTextures, Animation **cursorAnimation){
|
|
|
|
*cursorTextures = LoadTexture("assets/cursor.gif");
|
|
|
|
*cursorTextures = LoadTexture("assets/cursor.gif");
|
|
|
|
*(cursorTextures + 1) = LoadTexture("assets/cursor_down.gif");
|
|
|
|
*(cursorTextures + 1) = LoadTexture("assets/cursor_down.gif");
|
|
|
|
|
|
|
|
|
|
|
|
Animation *new = AnimationInit();
|
|
|
|
Animation *new = AnimationInit();
|
|
|
|
AnimationInsertBack(new, cursorTextures);
|
|
|
|
AnimationInsertBack(new, cursorTextures);
|
|
|
|
|
|
|
|
cursorAnimation[0] = new;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LoadWorkerTextures(Texture2D *workerTextures){
|
|
|
|
void LoadWorkerTextures(Texture2D *workerTextures){
|
|
|
|
@ -57,7 +58,7 @@ void LoadWorkerTextures(Texture2D *workerTextures){
|
|
|
|
strcat(filename, number);
|
|
|
|
strcat(filename, number);
|
|
|
|
strcat(filename, ending);
|
|
|
|
strcat(filename, ending);
|
|
|
|
|
|
|
|
|
|
|
|
printf("lol: %s ", filename);
|
|
|
|
//printf("file:%s:file\n", filename);
|
|
|
|
|
|
|
|
|
|
|
|
// Set correct values for next iteration
|
|
|
|
// Set correct values for next iteration
|
|
|
|
int lol = i % 8;
|
|
|
|
int lol = i % 8;
|
|
|
|
@ -122,7 +123,15 @@ void LoadWorkerAnimations(Animation **workerAnimations, Texture2D *workerTexture
|
|
|
|
for(i=0; i < 24; i++){
|
|
|
|
for(i=0; i < 24; i++){
|
|
|
|
Animation *newAnimation = AnimationInit();
|
|
|
|
Animation *newAnimation = AnimationInit();
|
|
|
|
|
|
|
|
|
|
|
|
for(j = 0; j < 8; j++){
|
|
|
|
int obergrenze;
|
|
|
|
|
|
|
|
if(frame <= 79){
|
|
|
|
|
|
|
|
obergrenze = 5;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
obergrenze = 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(j = 0; j < obergrenze; j++){
|
|
|
|
AnimationInsertBack(newAnimation, (workerTextures+frame));
|
|
|
|
AnimationInsertBack(newAnimation, (workerTextures+frame));
|
|
|
|
frame++;
|
|
|
|
frame++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|