diff --git a/Textures/animationHandler.c b/Textures/animationHandler.c index b750ae9..c0d04df 100644 --- a/Textures/animationHandler.c +++ b/Textures/animationHandler.c @@ -8,9 +8,7 @@ AnimationHandler * AnimationHandlerInit(Animation **animations){ new->animations = animations; new->currentAnimation = 0; - //new->currentFrame = new->animations[new->currentAnimation]->head; - new->currentFrame = animations[0]->head; - printf("Hier geht noch\n"); + new->currentFrame = new->animations[new->currentAnimation]->head; new->forward = 1; } diff --git a/Textures/textureatlas.c b/Textures/textureatlas.c index 362e56b..58a9a6d 100644 --- a/Textures/textureatlas.c +++ b/Textures/textureatlas.c @@ -7,19 +7,20 @@ TextureAtlas * TextureAtlasInit(){ TextureAtlas *textures = (TextureAtlas *) malloc(sizeof(TextureAtlas)); - LoadCursorTextures(textures->cursorTextures); + LoadCursorTextures(textures->cursorTextures, textures->cursorAnimation); LoadWorkerTextures(textures->workerTextures); LoadWorkerAnimations(textures->workerAnimations, textures->workerTextures); return textures; } -void LoadCursorTextures(Texture2D *cursorTextures){ +void LoadCursorTextures(Texture2D *cursorTextures, Animation **cursorAnimation){ *cursorTextures = LoadTexture("assets/cursor.gif"); *(cursorTextures + 1) = LoadTexture("assets/cursor_down.gif"); Animation *new = AnimationInit(); AnimationInsertBack(new, cursorTextures); + cursorAnimation[0] = new; } void LoadWorkerTextures(Texture2D *workerTextures){ @@ -57,7 +58,7 @@ void LoadWorkerTextures(Texture2D *workerTextures){ strcat(filename, number); strcat(filename, ending); - printf("lol: %s ", filename); + //printf("file:%s:file\n", filename); // Set correct values for next iteration int lol = i % 8; @@ -122,7 +123,15 @@ void LoadWorkerAnimations(Animation **workerAnimations, Texture2D *workerTexture for(i=0; i < 24; i++){ 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)); frame++; } diff --git a/Textures/textureatlas.h b/Textures/textureatlas.h index 7e13dd6..1199d77 100644 --- a/Textures/textureatlas.h +++ b/Textures/textureatlas.h @@ -7,7 +7,7 @@ typedef struct TextureAtlas TextureAtlas; typedef struct TextureAtlas{ Texture2D cursorTextures[2]; - Animation cursorAnimation; + Animation *cursorAnimation[1]; Texture2D workerTextures[104]; Animation *workerAnimations[24]; @@ -17,7 +17,7 @@ typedef struct TextureAtlas{ // Initialize the full TextureAtlas struct with all Textures used in the game TextureAtlas * TextureAtlasInit(); -void LoadCursorTextures(Texture2D *cursorTextures); +void LoadCursorTextures(Texture2D *cursorTextures, Animation **cursorAnimation); void LoadWorkerTextures(Texture2D *workerTextures); void LoadWorkerAnimations(Animation **workerAnimations, Texture2D *workerTextures); diff --git a/animation.o b/animation.o index ad026d7..273114d 100644 Binary files a/animation.o and b/animation.o differ diff --git a/animationHandler.o b/animationHandler.o index f41671a..6b7ae20 100644 Binary files a/animationHandler.o and b/animationHandler.o differ diff --git a/game.o b/game.o index 047f93c..6108cf5 100644 Binary files a/game.o and b/game.o differ diff --git a/inputHandler.o b/inputHandler.o index 250a841..b323d9c 100644 Binary files a/inputHandler.o and b/inputHandler.o differ diff --git a/isometricMap.o b/isometricMap.o index a630467..8c5b546 100644 Binary files a/isometricMap.o and b/isometricMap.o differ diff --git a/isometricRenderer.o b/isometricRenderer.o index e3faf8f..88ea6fc 100644 Binary files a/isometricRenderer.o and b/isometricRenderer.o differ diff --git a/list.o b/list.o index 22b9aa2..1a5787c 100644 Binary files a/list.o and b/list.o differ diff --git a/main.o b/main.o index a3186b5..ea6344d 100644 Binary files a/main.o and b/main.o differ diff --git a/spiel b/spiel index b0199ef..e1d1523 100755 Binary files a/spiel and b/spiel differ diff --git a/sprite.c b/sprite.c index 00535c5..38845b4 100644 --- a/sprite.c +++ b/sprite.c @@ -74,7 +74,7 @@ Sprite * SpriteCreate(TextureAtlas *atlas, int textureID, int x, int y){ animations = atlas->workerAnimations; } else if(textureID == cursor){ - // Nix + animations = atlas->cursorAnimation; } else{ printf("\n\n\n\n\n\n\n\nSpriteCreate mit falscher ID aufgerufen oder ID nicht bekannt!!!\n\n\n\n\n\n\n\n"); diff --git a/sprite.o b/sprite.o index c71ea63..0c3bae8 100644 Binary files a/sprite.o and b/sprite.o differ diff --git a/textureatlas.o b/textureatlas.o index 38b6db9..8736e79 100644 Binary files a/textureatlas.o and b/textureatlas.o differ diff --git a/tile.o b/tile.o index b7873fa..253af08 100644 Binary files a/tile.o and b/tile.o differ