Fallo parcial en la carga de animaciones desde streams

This commit is contained in:
2022-10-04 07:09:28 +02:00
parent 95d6396dfa
commit ddb70c8c85
6 changed files with 237 additions and 93 deletions

View File

@@ -18,6 +18,7 @@
#include "text.h"
#include "utils.h"
#include "writer.h"
#include "iostream"
#ifndef GAME_H
#define GAME_H
@@ -150,6 +151,11 @@ private:
LTexture *mTextureGameText; // Textura para los sprites con textos
LTexture *mTextureItems; // Textura para los items
std::stringstream *balloon1Animation; // Información para la animación de los globos
std::stringstream *balloon2Animation; // Información para la animación de los globos
std::stringstream *balloon3Animation; // Información para la animación de los globos
std::stringstream *balloon4Animation; // Información para la animación de los globos
Text *mText; // Fuente para los textos del juego
Text *mTextBig; // Fuente de texto grande
Text *mTextScoreBoard; // Fuente para el marcador del juego
@@ -315,7 +321,7 @@ private:
void renderBalloons();
// Crea un globo nuevo en el vector de globos
Uint8 createNewBalloon(float x, int y, Uint8 kind, float velx, float speed, Uint16 stoppedcounter);
Uint8 createBalloon(float x, int y, Uint8 kind, float velx, float speed, Uint16 stoppedcounter);
// Crea una PowerBall
void createPowerBall();
@@ -357,7 +363,7 @@ private:
LTexture *balloonTexture(int kind);
// Obtiene la animacion correspondiente en funcion del tipo
std::string balloonAnimation(int kind);
std::stringstream *balloonStreamAnimation(int kind);
// Vacia el vector de globos
void freeBalloons();
@@ -461,7 +467,6 @@ private:
// Dibuja el fondo
void renderBackground();
// Gestiona la entrada durante el juego
void checkGameInput();
@@ -504,6 +509,9 @@ private:
// Comprueba si todos los jugadores han muerto
bool allPlayersAreDead();
// Carga las animaciones
void loadAnimations(std::string filePath, std::stringstream *buffer);
public:
// Constructor
Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *mAsset, Lang *lang, Input *input, bool demo, options_t *options);