tornem a deixar els fitxers balloon.png com estaven
@@ -2,15 +2,29 @@ frameWidth=10
|
|||||||
frameHeight=10
|
frameHeight=10
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=normal
|
name=orange
|
||||||
speed=10
|
speed=10
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=0,1,2,3,4,5,6,7,8,9
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=stopped
|
name=blue
|
||||||
speed=20
|
speed=20
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=10,11,12,13,14,15,16,17,18,19
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=green
|
||||||
|
speed=10
|
||||||
|
loop=0
|
||||||
|
frames=20,21,22,23,24,25,26,27,28,29
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=red
|
||||||
|
speed=20
|
||||||
|
loop=0
|
||||||
|
frames=30,31,32,33,34,35,36,37,38,39
|
||||||
[/animation]
|
[/animation]
|
||||||
|
Before Width: | Height: | Size: 265 B |
BIN
data/gfx/balloon1.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
@@ -2,15 +2,29 @@ frameWidth=16
|
|||||||
frameHeight=16
|
frameHeight=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=normal
|
name=orange
|
||||||
speed=10
|
speed=10
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=0,1,2,3,4,5,6,7,8,9
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=stopped
|
name=blue
|
||||||
speed=20
|
speed=20
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=10,11,12,13,14,15,16,17,18,19
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=green
|
||||||
|
speed=10
|
||||||
|
loop=0
|
||||||
|
frames=20,21,22,23,24,25,26,27,28,29
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=red
|
||||||
|
speed=20
|
||||||
|
loop=0
|
||||||
|
frames=30,31,32,33,34,35,36,37,38,39
|
||||||
[/animation]
|
[/animation]
|
||||||
|
Before Width: | Height: | Size: 484 B |
BIN
data/gfx/balloon2.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
@@ -2,15 +2,29 @@ frameWidth=26
|
|||||||
frameHeight=26
|
frameHeight=26
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=normal
|
name=orange
|
||||||
speed=10
|
speed=10
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=0,1,2,3,4,5,6,7,8,9
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=stopped
|
name=blue
|
||||||
speed=20
|
speed=20
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=10,11,12,13,14,15,16,17,18,19
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=green
|
||||||
|
speed=10
|
||||||
|
loop=0
|
||||||
|
frames=20,21,22,23,24,25,26,27,28,29
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=red
|
||||||
|
speed=20
|
||||||
|
loop=0
|
||||||
|
frames=30,31,32,33,34,35,36,37,38,39
|
||||||
[/animation]
|
[/animation]
|
||||||
|
Before Width: | Height: | Size: 908 B |
BIN
data/gfx/balloon3.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
@@ -2,15 +2,29 @@ frameWidth=46
|
|||||||
frameHeight=46
|
frameHeight=46
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=normal
|
name=orange
|
||||||
speed=10
|
speed=10
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=0,1,2,3,4,5,6,7,8,9
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=stopped
|
name=blue
|
||||||
speed=20
|
speed=20
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5,6,7,8,9
|
frames=10,11,12,13,14,15,16,17,18,19
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=green
|
||||||
|
speed=10
|
||||||
|
loop=0
|
||||||
|
frames=20,21,22,23,24,25,26,27,28,29
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=red
|
||||||
|
speed=20
|
||||||
|
loop=0
|
||||||
|
frames=30,31,32,33,34,35,36,37,38,39
|
||||||
[/animation]
|
[/animation]
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB |
BIN
data/gfx/balloon4.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 760 B After Width: | Height: | Size: 760 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -2,7 +2,7 @@ frameWidth=46
|
|||||||
frameHeight=46
|
frameHeight=46
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=powerball
|
||||||
speed=10
|
speed=10
|
||||||
loop=-1
|
loop=-1
|
||||||
frames=0
|
frames=0
|
||||||
|
|||||||
@@ -317,14 +317,12 @@ void Balloon::render()
|
|||||||
else if (isBeingCreated())
|
else if (isBeingCreated())
|
||||||
{
|
{
|
||||||
// Aplica alpha blending
|
// Aplica alpha blending
|
||||||
//sprite->getTexture()->setPalette(1);
|
|
||||||
sprite->getTexture()->setAlpha(255 - (int)((float)creationCounter * (255.0f / (float)creationCounterIni)));
|
sprite->getTexture()->setAlpha(255 - (int)((float)creationCounter * (255.0f / (float)creationCounterIni)));
|
||||||
sprite->render();
|
sprite->render();
|
||||||
sprite->getTexture()->setAlpha(255);
|
sprite->getTexture()->setAlpha(255);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//sprite->getTexture()->setPalette(0);
|
|
||||||
sprite->render();
|
sprite->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,18 +568,18 @@ void Balloon::updateState()
|
|||||||
// Establece la animación correspondiente al estado
|
// Establece la animación correspondiente al estado
|
||||||
void Balloon::updateAnimation()
|
void Balloon::updateAnimation()
|
||||||
{
|
{
|
||||||
std::string creatingAnimation = "stopped";
|
std::string creatingAnimation = "blue";
|
||||||
std::string normalAnimation = "normal";
|
std::string normalAnimation = "orange";
|
||||||
|
|
||||||
if (kind == POWER_BALL)
|
if (kind == POWER_BALL)
|
||||||
{
|
{
|
||||||
creatingAnimation = "default";
|
creatingAnimation = "powerball";
|
||||||
normalAnimation = "default";
|
normalAnimation = "powerball";
|
||||||
}
|
}
|
||||||
else if (getClass() == HEXAGON_CLASS)
|
else if (getClass() == HEXAGON_CLASS)
|
||||||
{
|
{
|
||||||
creatingAnimation = "stopped";
|
creatingAnimation = "red";
|
||||||
normalAnimation = "normal";
|
normalAnimation = "green";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece el frame de animación
|
// Establece el frame de animación
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ void uncompress( int code_length,
|
|||||||
int stop_code; // one more than clear code
|
int stop_code; // one more than clear code
|
||||||
int match_len;
|
int match_len;
|
||||||
|
|
||||||
|
|
||||||
clear_code = 1 << ( code_length );
|
clear_code = 1 << ( code_length );
|
||||||
stop_code = clear_code + 1;
|
stop_code = clear_code + 1;
|
||||||
// To handle clear codes
|
// To handle clear codes
|
||||||
@@ -141,7 +142,7 @@ void uncompress( int code_length,
|
|||||||
{
|
{
|
||||||
code = 0x0;
|
code = 0x0;
|
||||||
// Always read one more bit than the code length
|
// Always read one more bit than the code length
|
||||||
for ( i = 0; i < ( code_length + 1 ); i++ )
|
for ( i = 0; i < ( code_length + 1 ); ++i )
|
||||||
{
|
{
|
||||||
// This is different than in the file read example; that
|
// This is different than in the file read example; that
|
||||||
// was a call to "next_bit"
|
// was a call to "next_bit"
|
||||||
|
|||||||
@@ -1,204 +0,0 @@
|
|||||||
#include "surface.h"
|
|
||||||
#include "gif.c"
|
|
||||||
|
|
||||||
struct jSurface_s
|
|
||||||
{
|
|
||||||
Uint8 *data;
|
|
||||||
Uint16 w, h;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
Surface::Surface(const char *filename, jSurface dest)
|
|
||||||
{
|
|
||||||
surface = loadSurface(filename);
|
|
||||||
destSurface = dest;
|
|
||||||
texture = nullptr;
|
|
||||||
|
|
||||||
loadPalette(filename);
|
|
||||||
transparentColor = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
Surface::Surface(int width, int height, SDL_Texture *tex)
|
|
||||||
{
|
|
||||||
surface = newSurface(width, height);
|
|
||||||
destSurface = nullptr;
|
|
||||||
texture = tex;
|
|
||||||
|
|
||||||
clearPalette(0);
|
|
||||||
transparentColor = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
Surface::~Surface()
|
|
||||||
{
|
|
||||||
deleteSurface(surface);
|
|
||||||
deleteSurface(destSurface);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Crea una surface
|
|
||||||
jSurface Surface::newSurface(int w, int h)
|
|
||||||
{
|
|
||||||
jSurface surf = (jSurface)malloc(sizeof(jSurface_s));
|
|
||||||
surf->w = w;
|
|
||||||
surf->h = h;
|
|
||||||
surf->data = (Uint8 *)malloc(w * h);
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Borra una surface
|
|
||||||
void Surface::deleteSurface(jSurface surf)
|
|
||||||
{
|
|
||||||
if (surf == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (surf->data != nullptr)
|
|
||||||
{
|
|
||||||
free(surf->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(surf);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Establece una surface de destino donde hacer el blit
|
|
||||||
void Surface::setDest(jSurface surf)
|
|
||||||
{
|
|
||||||
destSurface = surf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Establece una textura donde hacer el flip
|
|
||||||
void Surface::setTexture(SDL_Texture *tex)
|
|
||||||
{
|
|
||||||
texture = tex;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Crea una surface a partir de un fichero .gif
|
|
||||||
jSurface Surface::loadSurface(const char *filename)
|
|
||||||
{
|
|
||||||
FILE *f = fopen(filename, "rb");
|
|
||||||
if (!f)
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
|
||||||
long size = ftell(f);
|
|
||||||
fseek(f, 0, SEEK_SET);
|
|
||||||
Uint8 *buffer = (Uint8 *)malloc(size);
|
|
||||||
fread(buffer, size, 1, f);
|
|
||||||
fclose(f);
|
|
||||||
|
|
||||||
Uint16 w, h;
|
|
||||||
Uint8 *pixels = LoadGif(buffer, &w, &h);
|
|
||||||
if (pixels == nullptr)
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
jSurface surf = (jSurface)malloc(sizeof(jSurface_s));
|
|
||||||
surf->w = w;
|
|
||||||
surf->h = h;
|
|
||||||
surf->data = pixels;
|
|
||||||
free(buffer);
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Carga una palette desde un fichero .gif
|
|
||||||
void Surface::loadPalette(const char *filename)
|
|
||||||
{
|
|
||||||
FILE *f = fopen(filename, "rb");
|
|
||||||
if (!f)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
|
||||||
long size = ftell(f);
|
|
||||||
fseek(f, 0, SEEK_SET);
|
|
||||||
Uint8 *buffer = (Uint8 *)malloc(size);
|
|
||||||
fread(buffer, size, 1, f);
|
|
||||||
fclose(f);
|
|
||||||
|
|
||||||
Uint32 *pal = LoadPalette(buffer);
|
|
||||||
if (pal == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
free(buffer);
|
|
||||||
for (int i = 0; i < 256; ++i)
|
|
||||||
{
|
|
||||||
palette[i] = pal[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cambia un color de la palette
|
|
||||||
void Surface::setPaletteColor(int index, Uint32 color)
|
|
||||||
{
|
|
||||||
palette[index] = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limpia la surface
|
|
||||||
void Surface::cls(Uint8 color)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < surface->w * surface->h; ++i)
|
|
||||||
{
|
|
||||||
surface->data[i] = color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Volca la surface a una textura
|
|
||||||
void Surface::flip(SDL_Texture *texture)
|
|
||||||
{
|
|
||||||
Uint32 *pixels;
|
|
||||||
int pitch;
|
|
||||||
SDL_LockTexture(texture, nullptr, (void **)&pixels, &pitch);
|
|
||||||
for (int i = 0; i < surface->w * surface->h; ++i)
|
|
||||||
{
|
|
||||||
pixels[i] = palette[surface->data[i]];
|
|
||||||
}
|
|
||||||
SDL_UnlockTexture(texture);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Escribe pixels en destSurface
|
|
||||||
void Surface::putPixel(int x, int y, Uint8 color)
|
|
||||||
{
|
|
||||||
// if (x < 0 || y < 0 || x >= jDestSurf->w || y >= jDestSurf->h || color == transparentColor)
|
|
||||||
if (x < 0 || y < 0 || x >= destSurface->w || y >= destSurface->h)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
destSurface->data[x + y * destSurface->w] = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lee pixels en surface
|
|
||||||
Uint8 Surface::getPixel(int x, int y)
|
|
||||||
{
|
|
||||||
return surface->data[x + y * surface->w];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copia pixels desde surface a destSurface
|
|
||||||
void Surface::blit(int dx, int dy, int sx, int sy, int w, int h)
|
|
||||||
{
|
|
||||||
if (surface == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int iy = 0; iy < h; ++iy)
|
|
||||||
{
|
|
||||||
for (int ix = 0; ix < w; ++ix)
|
|
||||||
{
|
|
||||||
putPixel(dx + ix, dy + iy, getPixel(sx + ix, sy + iy));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limpia la paleta
|
|
||||||
void Surface::clearPalette(Uint32 color)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 256; ++i)
|
|
||||||
{
|
|
||||||
palette[i] = color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
|
||||||
|
|
||||||
typedef struct jSurface_s *jSurface;
|
|
||||||
|
|
||||||
class Surface
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
// Variables
|
|
||||||
jSurface surface;
|
|
||||||
jSurface destSurface;
|
|
||||||
SDL_Texture *texture;
|
|
||||||
Uint32 palette[256];
|
|
||||||
int transparentColor;
|
|
||||||
|
|
||||||
// Escribe pixels en destSurface
|
|
||||||
void putPixel(int x, int y, Uint8 color);
|
|
||||||
|
|
||||||
// Lee pixels en surface
|
|
||||||
Uint8 getPixel(int x, int y);
|
|
||||||
|
|
||||||
// Limpia la paleta
|
|
||||||
void clearPalette(Uint32 color);
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Constructor
|
|
||||||
Surface(const char *filename, jSurface dest);
|
|
||||||
Surface(int width, int height, SDL_Texture *tex);
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
~Surface();
|
|
||||||
|
|
||||||
// Crea una surface
|
|
||||||
jSurface newSurface(int w, int h);
|
|
||||||
|
|
||||||
// Borra una surface
|
|
||||||
void deleteSurface(jSurface surf);
|
|
||||||
|
|
||||||
// Establece una surface de destino donde hacer el blit
|
|
||||||
void setDest(jSurface surf);
|
|
||||||
|
|
||||||
// Establece una textura donde hacer el flip
|
|
||||||
void setTexture(SDL_Texture *tex);
|
|
||||||
|
|
||||||
// Crea una surface a partir de un fichero .gif
|
|
||||||
jSurface loadSurface(const char *filename);
|
|
||||||
|
|
||||||
// Carga una paleta desde un fichero .gif
|
|
||||||
void loadPalette(const char *filename);
|
|
||||||
|
|
||||||
// Copia pixels desde surface a destSurface
|
|
||||||
void blit(int dx, int dy, int sx, int sy, int w, int h);
|
|
||||||
|
|
||||||
// Cambia un color de la paleta
|
|
||||||
void setPaletteColor(int index, Uint32 color);
|
|
||||||
|
|
||||||
// Limpia la surface
|
|
||||||
void cls(Uint8 color);
|
|
||||||
|
|
||||||
// Volca la surface a una textura
|
|
||||||
void flip(SDL_Texture *texture);
|
|
||||||
};
|
|
||||||
@@ -320,25 +320,24 @@ bool Director::setFileList()
|
|||||||
asset->add(prefix + "/data/shaders/crtpi.glsl", t_data);
|
asset->add(prefix + "/data/shaders/crtpi.glsl", t_data);
|
||||||
|
|
||||||
// Texturas
|
// Texturas
|
||||||
asset->add(prefix + "/data/gfx/balloon1.gif", t_bitmap);
|
asset->add(prefix + "/data/gfx/balloon1.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon1.ani", t_animation);
|
asset->add(prefix + "/data/gfx/balloon1.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon2.gif", t_bitmap);
|
asset->add(prefix + "/data/gfx/balloon2.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon2.ani", t_animation);
|
asset->add(prefix + "/data/gfx/balloon2.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon3.gif", t_bitmap);
|
asset->add(prefix + "/data/gfx/balloon3.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon3.ani", t_animation);
|
asset->add(prefix + "/data/gfx/balloon3.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon4.gif", t_bitmap);
|
asset->add(prefix + "/data/gfx/balloon4.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon4.ani", t_animation);
|
asset->add(prefix + "/data/gfx/balloon4.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon1_explosion.png", t_bitmap);
|
|
||||||
asset->add(prefix + "/data/gfx/balloon1_explosion.ani", t_animation);
|
asset->add(prefix + "/data/gfx/explosion1.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon2_explosion.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/explosion1.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon2_explosion.ani", t_animation);
|
asset->add(prefix + "/data/gfx/explosion2.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon3_explosion.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/explosion2.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon3_explosion.ani", t_animation);
|
asset->add(prefix + "/data/gfx/explosion3.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon4_explosion.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/explosion3.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon4_explosion.ani", t_animation);
|
asset->add(prefix + "/data/gfx/explosion4.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/balloon_blue_pal.gif", t_palette);
|
asset->add(prefix + "/data/gfx/explosion4.ani", t_animation);
|
||||||
asset->add(prefix + "/data/gfx/balloon_yellow_pal.gif", t_palette);
|
|
||||||
asset->add(prefix + "/data/gfx/balloon_green_pal.gif", t_palette);
|
|
||||||
asset->add(prefix + "/data/gfx/powerball.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/powerball.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/powerball.ani", t_animation);
|
asset->add(prefix + "/data/gfx/powerball.ani", t_animation);
|
||||||
|
|
||||||
@@ -353,11 +352,10 @@ bool Director::setFileList()
|
|||||||
asset->add(prefix + "/data/gfx/game_text.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/game_text.png", t_bitmap);
|
||||||
|
|
||||||
asset->add(prefix + "/data/gfx/intro.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/intro.png", t_bitmap);
|
||||||
|
|
||||||
asset->add(prefix + "/data/gfx/logo_jailgames.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/logo_jailgames.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/logo_jailgames_mini.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/logo_jailgames_mini.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/logo_since_1998.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/logo_since_1998.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/menu_game_over.png", t_bitmap);
|
|
||||||
asset->add(prefix + "/data/gfx/menu_game_over_end.png", t_bitmap);
|
|
||||||
|
|
||||||
asset->add(prefix + "/data/gfx/item_points1_disk.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/item_points1_disk.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/item_points1_disk.ani", t_animation);
|
asset->add(prefix + "/data/gfx/item_points1_disk.ani", t_animation);
|
||||||
|
|||||||
@@ -331,48 +331,34 @@ void Game::loadMedia()
|
|||||||
// Texturas
|
// Texturas
|
||||||
bulletTexture = new Texture(renderer, asset->get("bullet.png"));
|
bulletTexture = new Texture(renderer, asset->get("bullet.png"));
|
||||||
gameTextTexture = new Texture(renderer, asset->get("game_text.png"));
|
gameTextTexture = new Texture(renderer, asset->get("game_text.png"));
|
||||||
gameOverTexture = new Texture(renderer, asset->get("menu_game_over.png"));
|
|
||||||
gameOverEndTexture = new Texture(renderer, asset->get("menu_game_over_end.png"));
|
|
||||||
|
|
||||||
// Texturas - Globos
|
// Texturas - Globos
|
||||||
Texture *balloon1Texture = new Texture(renderer, asset->get("balloon1.gif"));
|
Texture *balloon1Texture = new Texture(renderer, asset->get("balloon1.png"));
|
||||||
balloon1Texture->addPalette(asset->get("balloon_blue_pal.gif"));
|
|
||||||
balloon1Texture->addPalette(asset->get("balloon_yellow_pal.gif"));
|
|
||||||
balloon1Texture->addPalette(asset->get("balloon_green_pal.gif"));
|
|
||||||
balloonTextures.push_back(balloon1Texture);
|
balloonTextures.push_back(balloon1Texture);
|
||||||
|
|
||||||
Texture *balloon2Texture = new Texture(renderer, asset->get("balloon2.gif"));
|
Texture *balloon2Texture = new Texture(renderer, asset->get("balloon2.png"));
|
||||||
balloon2Texture->addPalette(asset->get("balloon_blue_pal.gif"));
|
|
||||||
balloon2Texture->addPalette(asset->get("balloon_yellow_pal.gif"));
|
|
||||||
balloon2Texture->addPalette(asset->get("balloon_green_pal.gif"));
|
|
||||||
balloonTextures.push_back(balloon2Texture);
|
balloonTextures.push_back(balloon2Texture);
|
||||||
|
|
||||||
Texture *balloon3Texture = new Texture(renderer, asset->get("balloon3.gif"));
|
Texture *balloon3Texture = new Texture(renderer, asset->get("balloon3.png"));
|
||||||
balloon3Texture->addPalette(asset->get("balloon_blue_pal.gif"));
|
|
||||||
balloon3Texture->addPalette(asset->get("balloon_yellow_pal.gif"));
|
|
||||||
balloon3Texture->addPalette(asset->get("balloon_green_pal.gif"));
|
|
||||||
balloonTextures.push_back(balloon3Texture);
|
balloonTextures.push_back(balloon3Texture);
|
||||||
|
|
||||||
Texture *balloon4Texture = new Texture(renderer, asset->get("balloon4.gif"));
|
Texture *balloon4Texture = new Texture(renderer, asset->get("balloon4.png"));
|
||||||
balloon4Texture->addPalette(asset->get("balloon_blue_pal.gif"));
|
|
||||||
balloon4Texture->addPalette(asset->get("balloon_yellow_pal.gif"));
|
|
||||||
balloon4Texture->addPalette(asset->get("balloon_green_pal.gif"));
|
|
||||||
balloonTextures.push_back(balloon4Texture);
|
balloonTextures.push_back(balloon4Texture);
|
||||||
|
|
||||||
Texture *balloon5Texture = new Texture(renderer, asset->get("powerball.png"));
|
Texture *balloon5Texture = new Texture(renderer, asset->get("powerball.png"));
|
||||||
balloonTextures.push_back(balloon5Texture);
|
balloonTextures.push_back(balloon5Texture);
|
||||||
|
|
||||||
// Texturas - Explosiones
|
// Texturas - Explosiones
|
||||||
Texture *explosion1Texture = new Texture(renderer, asset->get("balloon1_explosion.png"));
|
Texture *explosion1Texture = new Texture(renderer, asset->get("explosion1.png"));
|
||||||
explosionsTextures.push_back(explosion1Texture);
|
explosionsTextures.push_back(explosion1Texture);
|
||||||
|
|
||||||
Texture *explosion2Texture = new Texture(renderer, asset->get("balloon2_explosion.png"));
|
Texture *explosion2Texture = new Texture(renderer, asset->get("explosion2.png"));
|
||||||
explosionsTextures.push_back(explosion2Texture);
|
explosionsTextures.push_back(explosion2Texture);
|
||||||
|
|
||||||
Texture *explosion3Texture = new Texture(renderer, asset->get("balloon3_explosion.png"));
|
Texture *explosion3Texture = new Texture(renderer, asset->get("explosion3.png"));
|
||||||
explosionsTextures.push_back(explosion3Texture);
|
explosionsTextures.push_back(explosion3Texture);
|
||||||
|
|
||||||
Texture *explosion4Texture = new Texture(renderer, asset->get("balloon4_explosion.png"));
|
Texture *explosion4Texture = new Texture(renderer, asset->get("explosion4.png"));
|
||||||
explosionsTextures.push_back(explosion4Texture);
|
explosionsTextures.push_back(explosion4Texture);
|
||||||
|
|
||||||
// Texturas - Items
|
// Texturas - Items
|
||||||
@@ -454,19 +440,19 @@ void Game::loadMedia()
|
|||||||
|
|
||||||
// Animaciones -- Explosiones
|
// Animaciones -- Explosiones
|
||||||
std::vector<std::string> *explosions1Animation = new std::vector<std::string>;
|
std::vector<std::string> *explosions1Animation = new std::vector<std::string>;
|
||||||
loadAnimations(asset->get("balloon1_explosion.ani"), explosions1Animation);
|
loadAnimations(asset->get("explosion1.ani"), explosions1Animation);
|
||||||
explosionsAnimations.push_back(explosions1Animation);
|
explosionsAnimations.push_back(explosions1Animation);
|
||||||
|
|
||||||
std::vector<std::string> *explosions2Animation = new std::vector<std::string>;
|
std::vector<std::string> *explosions2Animation = new std::vector<std::string>;
|
||||||
loadAnimations(asset->get("balloon2_explosion.ani"), explosions2Animation);
|
loadAnimations(asset->get("explosion2.ani"), explosions2Animation);
|
||||||
explosionsAnimations.push_back(explosions2Animation);
|
explosionsAnimations.push_back(explosions2Animation);
|
||||||
|
|
||||||
std::vector<std::string> *explosions3Animation = new std::vector<std::string>;
|
std::vector<std::string> *explosions3Animation = new std::vector<std::string>;
|
||||||
loadAnimations(asset->get("balloon3_explosion.ani"), explosions3Animation);
|
loadAnimations(asset->get("explosion3.ani"), explosions3Animation);
|
||||||
explosionsAnimations.push_back(explosions3Animation);
|
explosionsAnimations.push_back(explosions3Animation);
|
||||||
|
|
||||||
std::vector<std::string> *explosions4Animation = new std::vector<std::string>;
|
std::vector<std::string> *explosions4Animation = new std::vector<std::string>;
|
||||||
loadAnimations(asset->get("balloon4_explosion.ani"), explosions4Animation);
|
loadAnimations(asset->get("explosion4.ani"), explosions4Animation);
|
||||||
explosionsAnimations.push_back(explosions4Animation);
|
explosionsAnimations.push_back(explosions4Animation);
|
||||||
|
|
||||||
// Animaciones -- Items
|
// Animaciones -- Items
|
||||||
@@ -530,8 +516,6 @@ void Game::unloadMedia()
|
|||||||
// Texturas
|
// Texturas
|
||||||
delete bulletTexture;
|
delete bulletTexture;
|
||||||
delete gameTextTexture;
|
delete gameTextTexture;
|
||||||
delete gameOverTexture;
|
|
||||||
delete gameOverEndTexture;
|
|
||||||
|
|
||||||
for (auto texture : player1Textures)
|
for (auto texture : player1Textures)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,8 +101,6 @@ private:
|
|||||||
std::vector<std::vector<Texture *>> playerTextures; // Vector con todas las texturas de los jugadores;
|
std::vector<std::vector<Texture *>> playerTextures; // Vector con todas las texturas de los jugadores;
|
||||||
|
|
||||||
Texture *gameTextTexture; // Textura para los sprites con textos
|
Texture *gameTextTexture; // Textura para los sprites con textos
|
||||||
Texture *gameOverTexture; // Textura para la pantalla de game over
|
|
||||||
Texture *gameOverEndTexture; // Textura para la pantalla de game over de acabar el juego
|
|
||||||
|
|
||||||
std::vector<std::vector<std::string> *> itemAnimations; // Vector con las animaciones de los items
|
std::vector<std::vector<std::string> *> itemAnimations; // Vector con las animaciones de los items
|
||||||
std::vector<std::vector<std::string> *> playerAnimations; // Vector con las animaciones del jugador
|
std::vector<std::vector<std::string> *> playerAnimations; // Vector con las animaciones del jugador
|
||||||
|
|||||||