|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: gfx.c,v 1.29 2003/12/31 01:00:11 stpohle Exp $ */
|
|
|
|
/* $Id: gfx.c,v 1.30 2004/01/25 02:21:01 stpohle Exp $ */
|
|
|
|
/* gfx.c */
|
|
|
|
/* gfx.c */
|
|
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
@ -25,9 +25,9 @@ gfx_load_players (int sx, int sy)
|
|
|
|
|
|
|
|
|
|
|
|
/* loading the player images */
|
|
|
|
/* loading the player images */
|
|
|
|
for (j = i = 0; i < MAX_PLAYERS; i++) {
|
|
|
|
for (j = i = 0; i < MAX_PLAYERS; i++) {
|
|
|
|
sprintf (filename, "%s/player/player%d.bmp", bman.datapath, j);
|
|
|
|
sprintf (filename, "%s/player/player%d.png", bman.datapath, j);
|
|
|
|
j++;
|
|
|
|
j++;
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (j == 0) { // try again with the first image, if this don't work give up.
|
|
|
|
if (j == 0) { // try again with the first image, if this don't work give up.
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
@ -71,8 +71,8 @@ gfx_load_players (int sx, int sy)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* load the death image */
|
|
|
|
/* load the death image */
|
|
|
|
sprintf (filename, "%s/player/dead0.bmp", bman.datapath);
|
|
|
|
sprintf (filename, "%s/player/dead0.png", bman.datapath);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
/* no image found - set field clear */
|
|
|
|
/* no image found - set field clear */
|
|
|
|
printf ("Player Animation Could not be loaded (%s)\n", filename);
|
|
|
|
printf ("Player Animation Could not be loaded (%s)\n", filename);
|
|
|
@ -91,8 +91,8 @@ gfx_load_players (int sx, int sy)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* load the illnessthing */
|
|
|
|
/* load the illnessthing */
|
|
|
|
sprintf (filename, "%s/player/playersick.bmp", bman.datapath);
|
|
|
|
sprintf (filename, "%s/player/playersick.png", bman.datapath);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
@ -164,12 +164,12 @@ gfx_loaddata ()
|
|
|
|
*tmpimage1;
|
|
|
|
*tmpimage1;
|
|
|
|
|
|
|
|
|
|
|
|
/* load the logo */
|
|
|
|
/* load the logo */
|
|
|
|
sprintf (filename, "%s/gfx/logo.bmp", bman.datapath);
|
|
|
|
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
sprintf (bman.datapath, "data");
|
|
|
|
sprintf (bman.datapath, "data");
|
|
|
|
sprintf (filename, "%s/gfx/logo.bmp", bman.datapath);
|
|
|
|
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
@ -185,8 +185,8 @@ gfx_loaddata ()
|
|
|
|
|
|
|
|
|
|
|
|
/* load the menugraphics */
|
|
|
|
/* load the menugraphics */
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
sprintf (filename, "%s/gfx/menu%d.bmp", bman.datapath, i);
|
|
|
|
sprintf (filename, "%s/gfx/menu%d.png", bman.datapath, i);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
@ -201,8 +201,8 @@ gfx_loaddata ()
|
|
|
|
/* load menu buttongraphic */
|
|
|
|
/* load menu buttongraphic */
|
|
|
|
for (j = 0; j < 3; j++)
|
|
|
|
for (j = 0; j < 3; j++)
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
sprintf (filename, "%s/gfx/menubutton%d_%d.bmp", bman.datapath, j, i);
|
|
|
|
sprintf (filename, "%s/gfx/menubutton%d_%d.png", bman.datapath, j, i);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
@ -215,8 +215,8 @@ gfx_loaddata ()
|
|
|
|
/* load menu buttongraphic */
|
|
|
|
/* load menu buttongraphic */
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
sprintf (filename, "%s/gfx/menuentry%d_%d.bmp", bman.datapath, j, i);
|
|
|
|
sprintf (filename, "%s/gfx/menuentry%d_%d.png", bman.datapath, j, i);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
@ -229,8 +229,8 @@ gfx_loaddata ()
|
|
|
|
/* load menu listgraphic */
|
|
|
|
/* load menu listgraphic */
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
sprintf (filename, "%s/gfx/menulist%d_%d.bmp", bman.datapath, j, i);
|
|
|
|
sprintf (filename, "%s/gfx/menulist%d_%d.png", bman.datapath, j, i);
|
|
|
|
tmpimage = SDL_LoadBMP (filename);
|
|
|
|
tmpimage = IMG_Load (filename);
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
if (tmpimage == NULL) {
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
printf ("Can't load image: %s\n", SDL_GetError ());
|
|
|
|
exit (1);
|
|
|
|
exit (1);
|
|
|
|