Skip to content

Commit

Permalink
1.1: SDL_image: PNG version
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Dec 6, 2019
1 parent 1a6cb67 commit b44c448
Show file tree
Hide file tree
Showing 153 changed files with 55 additions and 2,821 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ $ ./domino

## Screenshots

![Start game](https://raw.githubusercontent.com/pakozm/domino-clips/master/screenshots/start_game.png)
![Start game](doc/screenshots/start_game.png)

![In game](https://raw.githubusercontent.com/pakozm/domino-clips/master/screenshots/in_game.png)
![In game](doc/screenshots/in_game.png)

![Finish game](https://raw.githubusercontent.com/pakozm/domino-clips/master/screenshots/finish_game.png)
![Finish game](doc/screenshots/finish_game.png)
File renamed without changes.
Binary file added doc/screenshots/finish_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/in_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/start_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshots/finish_game.png
Binary file not shown.
Binary file removed screenshots/in_game.png
Binary file not shown.
Binary file removed screenshots/start_game.png
Binary file not shown.
25 changes: 13 additions & 12 deletions src/C_elige_jugadores.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "C_defs.h"
#include "SDL.h"
#include "SDL_image.h"

/* Superficies */
extern SDL_Surface *screen, *msg, *mesa;
Expand All @@ -15,9 +16,9 @@ SDL_Surface *load(const char *file);
SDL_Surface *load(const char *file)
{
Uint32 blanco;
SDL_Surface *tmp=SDL_LoadBMP(file), *aux;
SDL_Surface *tmp=IMG_Load (file), *aux;
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: mesa.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: mesa.png\n%s\n",
SDL_GetError());
return NULL;
}
Expand All @@ -40,17 +41,17 @@ void C_elige_jugadores(void *environment, DATA_OBJECT_PTR returnValuePtr)
SDL_Rect rect;
int i;

j[0]=load("seleccion/jugador0.bmp");
j[1]=load("seleccion/jugador1.bmp");
j[2]=load("seleccion/jugador2.bmp");
j[3]=load("seleccion/jugador3.bmp");
j[0]=load("seleccion/jugador0.png");
j[1]=load("seleccion/jugador1.png");
j[2]=load("seleccion/jugador2.png");
j[3]=load("seleccion/jugador3.png");

mano_negro=load("seleccion/mano_negro.bmp");
mano_rojo=load("seleccion/mano_rojo.bmp");
humano_negro=load("seleccion/humano_negro.bmp");
humano_rojo=load("seleccion/humano_rojo.bmp");
cpu_negro=load("seleccion/cpu_negro.bmp");
cpu_rojo=load("seleccion/cpu_rojo.bmp");
mano_negro=load("seleccion/mano_negro.png");
mano_rojo=load("seleccion/mano_rojo.png");
humano_negro=load("seleccion/humano_negro.png");
humano_rojo=load("seleccion/humano_rojo.png");
cpu_negro=load("seleccion/cpu_negro.png");
cpu_rojo=load("seleccion/cpu_rojo.png");

do {
rect.x = MSG_X;
Expand Down
23 changes: 12 additions & 11 deletions src/C_fichas.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#include <stdio.h>
#include "SDL.h"
#include "SDL_image.h"
#include "C_defs.h"

extern SDL_Surface *num_fichas;

const char * const fichas_str[]={
"cantidades/jugador0.bmp",
"cantidades/jugador1.bmp",
"cantidades/jugador2.bmp",
"cantidades/jugador3.bmp",
"cantidades/cero.bmp", "cantidades/uno.bmp",
"cantidades/dos.bmp",
"cantidades/tres.bmp", "cantidades/cuatro.bmp",
"cantidades/cinco.bmp", "cantidades/seis.bmp",
"cantidades/siete.bmp"
"cantidades/jugador0.png",
"cantidades/jugador1.png",
"cantidades/jugador2.png",
"cantidades/jugador3.png",
"cantidades/cero.png", "cantidades/uno.png",
"cantidades/dos.png",
"cantidades/tres.png", "cantidades/cuatro.png",
"cantidades/cinco.png", "cantidades/seis.png",
"cantidades/siete.png"
};

void C_fichas(void *environment)
Expand All @@ -22,14 +23,14 @@ void C_fichas(void *environment)
unsigned long int j=EnvRtnLong(environment, 1),
n=EnvRtnLong(environment, 2);
SDL_Surface *tmp, *aux, *num;
tmp = SDL_LoadBMP(fichas_str[j]);
tmp = IMG_Load (fichas_str[j]);
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: %s\n%s\n", fichas_str[j],
SDL_GetError());
}
aux=SDL_DisplayFormat(tmp);
SDL_FreeSurface (tmp);
tmp=SDL_LoadBMP(fichas_str[n+4]);
tmp=IMG_Load (fichas_str[n+4]);
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: %s\n%s\n", fichas_str[n+4],
SDL_GetError());
Expand Down
23 changes: 12 additions & 11 deletions src/C_msg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include "SDL.h"
#include "SDL_image.h"
#include "C_defs.h"

extern SDL_Surface *msg;
Expand All @@ -16,16 +17,16 @@ enum {
} msg_e;

const char * const msg_str[]={
"msg_bmp/base.bmp", "msg_bmp/ecolocar.bmp",
"msg_bmp/eponer.bmp", "msg_bmp/escoge.bmp",
"msg_bmp/gana0.bmp", "msg_bmp/gana1.bmp",
"msg_bmp/gana2.bmp", "msg_bmp/gana3.bmp",
"msg_bmp/nadie_puede_poner_mas_fichas.bmp",
"msg_bmp/pasa0.bmp", "msg_bmp/pasa1.bmp",
"msg_bmp/pasa2.bmp", "msg_bmp/pasa3.bmp",
"msg_bmp/tipojugador.bmp",
"msg_bmp/turno0.bmp", "msg_bmp/turno1.bmp",
"msg_bmp/turno2.bmp", "msg_bmp/turno3.bmp"
"msg_bmp/base.png", "msg_bmp/ecolocar.png",
"msg_bmp/eponer.png", "msg_bmp/escoge.png",
"msg_bmp/gana0.png", "msg_bmp/gana1.png",
"msg_bmp/gana2.png", "msg_bmp/gana3.png",
"msg_bmp/nadie_puede_poner_mas_fichas.png",
"msg_bmp/pasa0.png", "msg_bmp/pasa1.png",
"msg_bmp/pasa2.png", "msg_bmp/pasa3.png",
"msg_bmp/tipojugador.png",
"msg_bmp/turno0.png", "msg_bmp/turno1.png",
"msg_bmp/turno2.png", "msg_bmp/turno3.png"
};

void C_msg(void *environment)
Expand All @@ -39,7 +40,7 @@ void C_msg(void *environment)
if (EnvRtnArgCount(environment)>1)
msg_time=EnvRtnLong(environment, 2);
else msg_time=-1;
tmp=SDL_LoadBMP(msg_str[m]);
tmp=IMG_Load (msg_str[m]);
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: %s\n%s\n", msg_str[m],
SDL_GetError());
Expand Down
25 changes: 13 additions & 12 deletions src/C_sdl_init.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <time.h>
#include <stdlib.h>
#include "SDL.h"
#include "SDL_image.h"
#include "C_defs.h"

SDL_Surface *screen, *mesa, *msg, *num_fichas;
Expand Down Expand Up @@ -66,9 +67,9 @@ static void GenerarFichas()
Uint32 color;
SDL_Surface *circulo, *tmp;
int i, j, f=0;
tmp = SDL_LoadBMP ("circulo.bmp");
tmp = IMG_Load ("circulo.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: circulo.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: circulo.png\n%s\n",
SDL_GetError());
}
circulo = SDL_DisplayFormat (tmp);
Expand All @@ -79,36 +80,36 @@ static void GenerarFichas()
for (j=i; j<7; ++j, ++f) {
fichas[f].x = i;
fichas[f].y = j;
tmp=SDL_LoadBMP("fichaV.bmp");
tmp=IMG_Load("fichaV.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: fichaV.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: fichaV.png\n%s\n",
SDL_GetError());
}
fichas[f].bmpV[1] = SDL_DisplayFormat (tmp);
SDL_FreeSurface(tmp);
PonerCirculo (circulo, fichas[f].bmpV[1], j, 0);
PonerCirculo (circulo, fichas[f].bmpV[1], i, 1);
tmp=SDL_LoadBMP("fichaV.bmp");
tmp=IMG_Load("fichaV.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: fichaV.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: fichaV.png\n%s\n",
SDL_GetError());
}
fichas[f].bmpV[0] = SDL_DisplayFormat (tmp);
SDL_FreeSurface(tmp);
PonerCirculo (circulo, fichas[f].bmpV[0], i, 0);
PonerCirculo (circulo, fichas[f].bmpV[0], j, 1);
tmp=SDL_LoadBMP("fichaH.bmp");
tmp=IMG_Load("fichaH.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: fichaH.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: fichaH.png\n%s\n",
SDL_GetError());
}
fichas[f].bmpH[1] = SDL_DisplayFormat (tmp);
SDL_FreeSurface(tmp);
PonerCirculo (circulo, fichas[f].bmpH[1], j, 2);
PonerCirculo (circulo, fichas[f].bmpH[1], i, 3);
tmp=SDL_LoadBMP("fichaH.bmp");
tmp=IMG_Load("fichaH.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: fichaH.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: fichaH.png\n%s\n",
SDL_GetError());
}
fichas[f].bmpH[0] = SDL_DisplayFormat (tmp);
Expand Down Expand Up @@ -150,9 +151,9 @@ void C_sdl_init(void *environment)
head.w = fichaW; head.h = fichaH;
tail = head;
tail.x -= fichaH;
tmp = SDL_LoadBMP ("mesa.bmp");
tmp = IMG_Load ("mesa.png");
if (tmp == NULL) {
fprintf (stderr, "Error al cargar la imagen: mesa.bmp\n%s\n",
fprintf (stderr, "Error al cargar la imagen: mesa.png\n%s\n",
SDL_GetError());
}
mesa = SDL_DisplayFormat (tmp);
Expand Down
4 changes: 2 additions & 2 deletions src/makefile → src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ all: domino clips
`sdl-config --cflags` $<

clips : $(OBJS) main.o
gcc -o clips main.o $(OBJS) -lm -ltermcap `sdl-config --cflags --libs`
gcc -o clips main.o $(OBJS) -lm -ltermcap `sdl-config --cflags --libs` -lSDL_image

domino: $(OBJS) domino.o
gcc -o domino domino.o $(OBJS) -lm -ltermcap `sdl-config --cflags --libs`
gcc -o domino domino.o $(OBJS) -lm -ltermcap `sdl-config --cflags --libs` -lSDL_image


agenda.o : agenda.c setup.h envrnmnt.h usrsetup.h argacces.h expressn.h exprnops.h \
Expand Down
Binary file removed src/cantidades/cero.bmp
Binary file not shown.
Binary file added src/cantidades/cero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/cinco.bmp
Binary file not shown.
Binary file added src/cantidades/cinco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/cuatro.bmp
Binary file not shown.
Binary file added src/cantidades/cuatro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/dos.bmp
Binary file not shown.
Binary file added src/cantidades/dos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/jugador0.bmp
Binary file not shown.
Binary file added src/cantidades/jugador0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/jugador1.bmp
Binary file not shown.
Binary file added src/cantidades/jugador1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/jugador2.bmp
Binary file not shown.
Binary file added src/cantidades/jugador2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/jugador3.bmp
Binary file not shown.
Binary file added src/cantidades/jugador3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/seis.bmp
Binary file not shown.
Binary file added src/cantidades/seis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/siete.bmp
Binary file not shown.
Binary file added src/cantidades/siete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/tres.bmp
Binary file not shown.
Binary file added src/cantidades/tres.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/cantidades/uno.bmp
Binary file not shown.
Binary file added src/cantidades/uno.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/circulo.bmp
Binary file not shown.
Binary file added src/circulo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/fichaH.bmp
Binary file not shown.
Binary file added src/fichaH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/fichaV.bmp
Binary file not shown.
Binary file added src/fichaV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/mesa.bmp
Binary file not shown.
Binary file added src/mesa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/msg_bmp/base.bmp
Binary file not shown.
Binary file added src/msg_bmp/base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/msg_bmp/ecolocar.bmp
Binary file not shown.
Binary file added src/msg_bmp/ecolocar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/msg_bmp/eponer.bmp
Binary file not shown.
Binary file added src/msg_bmp/eponer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/msg_bmp/escoge.bmp
Binary file not shown.
Binary file added src/msg_bmp/escoge.png
Binary file removed src/msg_bmp/gana0.bmp
Binary file not shown.
Binary file added src/msg_bmp/gana0.png
Binary file removed src/msg_bmp/gana1.bmp
Binary file not shown.
Binary file added src/msg_bmp/gana1.png
Binary file removed src/msg_bmp/gana2.bmp
Binary file not shown.
Binary file added src/msg_bmp/gana2.png
Binary file removed src/msg_bmp/gana3.bmp
Binary file not shown.
Binary file added src/msg_bmp/gana3.png
Binary file removed src/msg_bmp/nadie_puede_poner_mas_fichas.bmp
Binary file not shown.
Binary file added src/msg_bmp/nadie_puede_poner_mas_fichas.png
Binary file removed src/msg_bmp/pasa0.bmp
Binary file not shown.
Binary file added src/msg_bmp/pasa0.png
Binary file removed src/msg_bmp/pasa1.bmp
Binary file not shown.
Binary file added src/msg_bmp/pasa1.png
Binary file removed src/msg_bmp/pasa2.bmp
Binary file not shown.
Binary file added src/msg_bmp/pasa2.png
Binary file removed src/msg_bmp/pasa3.bmp
Binary file not shown.
Binary file added src/msg_bmp/pasa3.png
Binary file removed src/msg_bmp/tipojugador.bmp
Binary file not shown.
Binary file added src/msg_bmp/tipojugador.png
Binary file removed src/msg_bmp/turno0.bmp
Binary file not shown.
Binary file added src/msg_bmp/turno0.png
Binary file removed src/msg_bmp/turno1.bmp
Binary file not shown.
Binary file added src/msg_bmp/turno1.png
Binary file removed src/msg_bmp/turno2.bmp
Binary file not shown.
Binary file added src/msg_bmp/turno2.png
Binary file removed src/msg_bmp/turno3.bmp
Binary file not shown.
Binary file added src/msg_bmp/turno3.png
Binary file removed src/seleccion/cpu_negro.bmp
Binary file not shown.
Binary file added src/seleccion/cpu_negro.png
Binary file removed src/seleccion/cpu_rojo.bmp
Binary file not shown.
Binary file added src/seleccion/cpu_rojo.png
Binary file removed src/seleccion/humano_negro.bmp
Binary file not shown.
Binary file added src/seleccion/humano_negro.png
Binary file removed src/seleccion/humano_rojo.bmp
Binary file not shown.
Binary file added src/seleccion/humano_rojo.png
Binary file removed src/seleccion/jugador0.bmp
Binary file not shown.
Binary file added src/seleccion/jugador0.png
Binary file removed src/seleccion/jugador1.bmp
Binary file not shown.
Binary file added src/seleccion/jugador1.png
Binary file removed src/seleccion/jugador2.bmp
Binary file not shown.
Binary file added src/seleccion/jugador2.png
Binary file removed src/seleccion/jugador3.bmp
Binary file not shown.
Binary file added src/seleccion/jugador3.png
Binary file removed src/seleccion/mano_negro.bmp
Binary file not shown.
Binary file added src/seleccion/mano_negro.png
Binary file removed src/seleccion/mano_rojo.bmp
Binary file not shown.
Binary file added src/seleccion/mano_rojo.png
Binary file removed src/win/cantidades/cero.bmp
Binary file not shown.
Binary file removed src/win/cantidades/cinco.bmp
Binary file not shown.
Binary file removed src/win/cantidades/cuatro.bmp
Binary file not shown.
Binary file removed src/win/cantidades/dos.bmp
Binary file not shown.
Binary file removed src/win/cantidades/jugador0.bmp
Binary file not shown.
Binary file removed src/win/cantidades/jugador1.bmp
Binary file not shown.
Binary file removed src/win/cantidades/jugador2.bmp
Binary file not shown.
Binary file removed src/win/cantidades/jugador3.bmp
Binary file not shown.
Binary file removed src/win/cantidades/seis.bmp
Binary file not shown.
Binary file removed src/win/cantidades/siete.bmp
Binary file not shown.
Binary file removed src/win/cantidades/tres.bmp
Binary file not shown.
Binary file removed src/win/cantidades/uno.bmp
Binary file not shown.
Binary file removed src/win/circulo.bmp
Binary file not shown.
Loading

0 comments on commit b44c448

Please sign in to comment.