converted bmp to png and added support for it.

origin
stpohle 22 years ago
parent 7655c2ae6c
commit a51e57c047

@ -1,4 +1,4 @@
$Id: ChangeLog,v 1.54 2004/01/24 23:52:39 stpohle Exp $
$Id: ChangeLog,v 1.55 2004/01/25 02:20:56 stpohle Exp $
- Added: Kick Bombs special
@ -21,6 +21,9 @@ $Id: ChangeLog,v 1.54 2004/01/24 23:52:39 stpohle Exp $
- Fixed: (Network) three more stones will be restored if a new
bombdata packet reaches the player.
- Changed all Images to PNG. From now on there is alpha blending
supported too.
Version 0.11.0
==============

@ -1,9 +1,9 @@
$Id: TODO,v 1.36 2004/01/22 20:55:16 stpohle Exp $
$Id: TODO,v 1.37 2004/01/25 02:20:56 stpohle Exp $
* start settings for Speed, Ticking time of the bombs.
How many bombs and so on.
* bug: which creates just some explosions on the field.
- bug: which creates just some explosions on the field.
- support for more player on one keyboard

@ -4,11 +4,10 @@ dnl If you don't want it to overwrite it,
dnl Please disable it in the Anjuta project configuration
AC_INIT(configure.in)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(bomberclone, 0.11.1)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_EXEEXT
AC_OBJEXT
@ -75,6 +74,11 @@ else
AC_MSG_WARN(Enable Debuging)
fi
dnl SDL_image library *****************************
AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , AC_MSG_ERROR([
*** Unable to find SDL_image libary with PNG support
(http://www.libsdl.org/projects/SDL_image/)
]))
dnl SDL_mixer **********************************

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.15 2004/01/06 19:52:02 stpohle Exp $ */
/* $Id: bomberclone.h,v 1.16 2004/01/25 02:21:00 stpohle Exp $ */
/* bomberclone.h */
#ifndef _BOMBERCLONE_H_
@ -34,6 +34,7 @@
#include <dirent.h>
#endif
#include <SDL.h>
#include <SDL_image.h>
#if HAVE_CONFIG_H
#include "config.h"

@ -1,4 +1,4 @@
/* $Id: font.c,v 1.11 2003/12/24 02:38:15 stpohle Exp $ */
/* $Id: font.c,v 1.12 2004/01/25 02:21:01 stpohle Exp $ */
// Using Fonts in SDL
#include <string.h>
@ -69,8 +69,8 @@ void font_load () {
/* load the font */
for (i = 0; i < 3; i++) {
sprintf (filename, "%s/gfx/font%d.bmp", bman.datapath, i);
tmp = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/font%d.png", bman.datapath, i);
tmp = IMG_Load (filename);
if (tmp == NULL) {
printf ("Could not load font.\n");
exit (1);

@ -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 */
#include "bomberclone.h"
@ -25,9 +25,9 @@ gfx_load_players (int sx, int sy)
/* loading the player images */
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++;
tmpimage = SDL_LoadBMP (filename);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
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 ());
@ -71,8 +71,8 @@ gfx_load_players (int sx, int sy)
}
/* load the death image */
sprintf (filename, "%s/player/dead0.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/player/dead0.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
/* no image found - set field clear */
printf ("Player Animation Could not be loaded (%s)\n", filename);
@ -91,8 +91,8 @@ gfx_load_players (int sx, int sy)
/* load the illnessthing */
sprintf (filename, "%s/player/playersick.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/player/playersick.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
@ -164,12 +164,12 @@ gfx_loaddata ()
*tmpimage1;
/* load the logo */
sprintf (filename, "%s/gfx/logo.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
sprintf (bman.datapath, "data");
sprintf (filename, "%s/gfx/logo.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
@ -185,8 +185,8 @@ gfx_loaddata ()
/* load the menugraphics */
for (i = 0; i < 9; i++) {
sprintf (filename, "%s/gfx/menu%d.bmp", bman.datapath, i);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/menu%d.png", bman.datapath, i);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
@ -201,8 +201,8 @@ gfx_loaddata ()
/* load menu buttongraphic */
for (j = 0; j < 3; j++)
for (i = 0; i < 3; i++) {
sprintf (filename, "%s/gfx/menubutton%d_%d.bmp", bman.datapath, j, i);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/menubutton%d_%d.png", bman.datapath, j, i);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
@ -215,8 +215,8 @@ gfx_loaddata ()
/* load menu buttongraphic */
for (j = 0; j < 2; j++)
for (i = 0; i < 3; i++) {
sprintf (filename, "%s/gfx/menuentry%d_%d.bmp", bman.datapath, j, i);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/menuentry%d_%d.png", bman.datapath, j, i);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
@ -229,8 +229,8 @@ gfx_loaddata ()
/* load menu listgraphic */
for (j = 0; j < 2; j++)
for (i = 0; i < 9; i++) {
sprintf (filename, "%s/gfx/menulist%d_%d.bmp", bman.datapath, j, i);
tmpimage = SDL_LoadBMP (filename);
sprintf (filename, "%s/gfx/menulist%d_%d.png", bman.datapath, j, i);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);

@ -1,4 +1,4 @@
/* $Id: gfxpixelimage.c,v 1.7 2004/01/22 20:55:39 stpohle Exp $ */
/* $Id: gfxpixelimage.c,v 1.8 2004/01/25 02:21:01 stpohle Exp $ */
/* gfx pixel manipulation and image manipulation */
#include "bomberclone.h"
@ -212,14 +212,14 @@ scale_image (SDL_Surface *orginal, int newx, int newy)
short int ypattern[SCALE_MAXRES];
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0x0000ff00;
rmask = 0xff000000;
gmask = 0x00ff0000;
bmask = 0xff000000;
bmask = 0x0000ff00;
amask = 0x000000ff;
#else /* */
rmask = 0x00ff0000;
rmask = 0x000000ff;
gmask = 0x0000ff00;
bmask = 0x000000ff;
bmask = 0x00ff0000;
amask = 0xff000000;
#endif /* */
@ -300,17 +300,18 @@ makegray_image (SDL_Surface * org)
gray;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0x0000ff00;
rmask = 0xff000000;
gmask = 0x00ff0000;
bmask = 0xff000000;
bmask = 0x0000ff00;
amask = 0x000000ff;
#else
rmask = 0x00ff0000;
#else /* */
rmask = 0x000000ff;
gmask = 0x0000ff00;
bmask = 0x000000ff;
bmask = 0x00ff0000;
amask = 0xff000000;
#endif
dest = SDL_CreateRGBSurface (SDL_SWSURFACE, org->w, org->h, org->format->BitsPerPixel,
#endif /* */
dest = SDL_CreateRGBSurface (SDL_SWSURFACE, org->w, org->h, org->format->BitsPerPixel,
org->format->Rmask, org->format->Gmask,
org->format->Bmask, org->format->Amask);
if (dest == NULL) {

@ -1,4 +1,4 @@
/* $Id: tileset.c,v 1.12 2004/01/07 23:04:32 patty21 Exp $ */
/* $Id: tileset.c,v 1.13 2004/01/25 02:21:01 stpohle Exp $ */
/* load and select tilesets */
#include "bomberclone.h"
@ -76,14 +76,14 @@ tileset_load (char *tilesetname)
gfx.offset.y = gfx.res.y - (gfx.block.y * map.size.y);
/* load the fire */
sprintf (fullname, "%s/tileset/%s/fire.bmp", bman.datapath, tileset);
tmpimage = SDL_LoadBMP (fullname);
sprintf (fullname, "%s/tileset/%s/fire.png", bman.datapath, tileset);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
/* file could not be load, so load teh default tileset */
sprintf (fullname, "%s/tileset/default/fire.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (fullname);
sprintf (fullname, "%s/tileset/default/fire.png", bman.datapath);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
printf ("default tileset could not be loaded.\n");
printf ("default tileset could not be loaded. [%s]\n", fullname);
exit (1);
}
}
@ -98,14 +98,14 @@ tileset_load (char *tilesetname)
SDL_FreeSurface (tmpimage1);
/* load the bomb */
sprintf (fullname, "%s/tileset/%s/bomb.bmp", bman.datapath, tileset);
tmpimage = SDL_LoadBMP (fullname);
sprintf (fullname, "%s/tileset/%s/bomb.png", bman.datapath, tileset);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
/* file could not be load, so load teh default tileset */
sprintf (fullname, "%s/tileset/default/bomb.bmp", bman.datapath);
tmpimage = SDL_LoadBMP (fullname);
sprintf (fullname, "%s/tileset/default/bomb.png", bman.datapath);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
printf ("default tileset could not be loaded.\n");
printf ("default tileset could not be loaded. [%s]\n", fullname);
exit (1);
}
}
@ -123,24 +123,24 @@ tileset_load (char *tilesetname)
for (i = 0; i < PWUP_max; i++) {
switch (i) {
case (PWUP_good):
sprintf (filename, "powerup.bmp");
sprintf (filename, "powerup.png");
break;
case (PWUP_bad):
sprintf (filename, "powerbad.bmp");
sprintf (filename, "powerbad.png");
break;
default:
sprintf (filename, "powersp.bmp");
sprintf (filename, "powersp.png");
break;
}
sprintf (fullname, "%s/tileset/%s/%s", bman.datapath, tileset, filename);
tmpimage = SDL_LoadBMP (fullname);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
/* file could not be load, so load teh default tileset */
sprintf (fullname, "%s/tileset/default/%s", bman.datapath, filename);
tmpimage = SDL_LoadBMP (fullname);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
printf ("default tileset could not be loaded.\n");
printf ("default tileset could not be loaded. [%s]\n", fullname);
exit (1);
}
}
@ -200,18 +200,18 @@ tileset_load (char *tilesetname)
break;
}
if (i != FT_mixed) {
sprintf (fullname, "%s/tileset/%s/%s.bmp", bman.datapath, tileset, filename);
sprintf (fullname, "%s/tileset/%s/%s.png", bman.datapath, tileset, filename);
gfx.field[i].w = GFX_IMGSIZE;
gfx.field[i].h = GFX_IMGSIZE;
tmpimage = SDL_LoadBMP (fullname);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
sprintf (fullname, "%s/tileset/%s/%s96.bmp", bman.datapath, tileset, filename);
sprintf (fullname, "%s/tileset/%s/%s96.png", bman.datapath, tileset, filename);
gfx.field[i].h = GFX_IMGBIGSIZE;
tmpimage = SDL_LoadBMP (fullname);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
sprintf (fullname, "%s/tileset/default/%s.bmp", bman.datapath, filename);
sprintf (fullname, "%s/tileset/default/%s.png", bman.datapath, filename);
gfx.field[i].h = GFX_IMGSIZE;
tmpimage = SDL_LoadBMP (fullname);
tmpimage = IMG_Load (fullname);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);

Loading…
Cancel
Save