code cleanup, no warnings anymore..

origin
steffen 14 years ago
parent bbed289558
commit e3dba53004

@ -1,4 +1,6 @@
$Id: ChangeLog,v 1.133 2010/12/11 21:27:55 steffen Exp $ $Id: ChangeLog,v 1.134 2012/01/28 21:53:19 steffen Exp $
- code cleanup: compiling should work now without any warnings.
Version 0.11.9 Version 0.11.9
============== ==============

@ -1,4 +1,4 @@
/* $Id: bomb.c,v 1.71 2009/05/11 20:51:25 stpohle Exp $ */ /* $Id: bomb.c,v 1.72 2012/01/28 21:53:19 steffen Exp $ */
/* everything what have to do with the bombs */ /* everything what have to do with the bombs */
#include "bomberclone.h" #include "bomberclone.h"
@ -503,17 +503,12 @@ int explosion_check_field (int x, int y, _bomb *bomb)
* the bomb was kicked.. so move the bomb in the right way.. * the bomb was kicked.. so move the bomb in the right way..
*/ */
void bomb_kicked (_bomb * bomb) { void bomb_kicked (_bomb * bomb) {
float dist, dX, dY, pX, pY; float dX, dY, pX, pY;
pX = dX = bomb->dest.x - bomb->source.x; pX = dX = bomb->dest.x - bomb->source.x;
pY = dY = bomb->dest.y - bomb->source.y; pY = dY = bomb->dest.y - bomb->source.y;
if (pX < 0.0f) pX = -dX; if (pX < 0.0f) pX = -dX;
if (pY < 0.0f) pY = -dY; if (pY < 0.0f) pY = -dY;
if (pX == 0.0f) dist = pY;
else if (pY == 0.0f) dist = pX;
else {
dist = sqrtf (powf (pX,2) + powf (pY,2));
}
bomb->fdata += timediff; // * (SPECIAL_KICK_MAXDIST / dist); bomb->fdata += timediff; // * (SPECIAL_KICK_MAXDIST / dist);
if (bomb->fdata >= 1.0f) { if (bomb->fdata >= 1.0f) {

@ -1,4 +1,4 @@
/* $Id: gfx.c,v 1.42 2009/10/10 09:43:55 stpohle Exp $ */ /* $Id: gfx.c,v 1.43 2012/01/28 21:53:19 steffen Exp $ */
/* gfx.c */ /* gfx.c */
#include "bomberclone.h" #include "bomberclone.h"
@ -37,8 +37,7 @@ int gfx_get_nr_of_playergfx () {
void void
gfx_load_players (int sx, int sy) gfx_load_players (int sx, int sy)
{ {
float sfkt, float sfkt;
ssfkt;
char filename[255]; char filename[255];
int i, int i,
r, r,
@ -47,7 +46,6 @@ gfx_load_players (int sx, int sy)
SDL_Surface *tmpimage, SDL_Surface *tmpimage,
*tmpimage1; *tmpimage1;
sfkt = ((float) sx) / ((float) GFX_IMGSIZE); sfkt = ((float) sx) / ((float) GFX_IMGSIZE);
ssfkt = ((float) GFX_SMALLPLAYERIMGSIZE_X) / ((float) GFX_IMGSIZE);
d_printf ("gfx_load_players (%d, %d)\n", sx, sy); d_printf ("gfx_load_players (%d, %d)\n", sx, sy);
@ -72,10 +70,10 @@ gfx_load_players (int sx, int sy)
gfx.players[i].ani.image = SDL_DisplayFormat (tmpimage1); gfx.players[i].ani.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage1); SDL_FreeSurface (tmpimage1);
/* calculate the numbers of images for the animation */ /* calculate the numbers of images for the animation */
gfx.players[i].offset.x = (sx - gfx.players[i].ani.w) / 2; gfx.players[i].offset.x = (sx - gfx.players[i].ani.w) / 2;
gfx.players[i].offset.y = -sy; gfx.players[i].offset.y = -sy;
SDL_FreeSurface (tmpimage); SDL_FreeSurface (tmpimage);
} }
} }

@ -1,4 +1,4 @@
/* $Id: gfxpixelimage.c,v 1.13 2005/04/09 18:22:41 stpohle Exp $ */ /* $Id: gfxpixelimage.c,v 1.14 2012/01/28 21:53:19 steffen Exp $ */
/* gfx pixel manipulation and image manipulation */ /* gfx pixel manipulation and image manipulation */
#include "bomberclone.h" #include "bomberclone.h"
@ -285,10 +285,6 @@ scale_image (SDL_Surface *orginal, int newx, int newy)
SDL_Surface * SDL_Surface *
makegray_image (SDL_Surface * org) makegray_image (SDL_Surface * org)
{ {
Uint32 rmask,
gmask,
bmask,
amask;
Uint32 pixel, Uint32 pixel,
transpixel = 0; transpixel = 0;
SDL_Surface *dest; SDL_Surface *dest;
@ -300,18 +296,6 @@ makegray_image (SDL_Surface * org)
b, b,
gray; gray;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0xff000000;
gmask = 0x00ff0000;
bmask = 0x0000ff00;
amask = 0x000000ff;
#else /* */
rmask = 0x000000ff;
gmask = 0x0000ff00;
bmask = 0x00ff0000;
amask = 0xff000000;
#endif /* */
dest = SDL_CreateRGBSurface (SDL_SWSURFACE, org->w, org->h, org->format->BitsPerPixel, dest = SDL_CreateRGBSurface (SDL_SWSURFACE, org->w, org->h, org->format->BitsPerPixel,
org->format->Rmask, org->format->Gmask, org->format->Rmask, org->format->Gmask,
org->format->Bmask, org->format->Amask); org->format->Bmask, org->format->Amask);

@ -1,4 +1,4 @@
/* $Id: keyb.c,v 1.7 2008/07/27 11:24:37 stpohle Exp $ /* $Id: keyb.c,v 1.8 2012/01/28 21:53:19 steffen Exp $
* keyb.c * keyb.c
*/ */
@ -180,19 +180,13 @@ void keyb_config_createkeymenu (_menu *menu, int key, int x, int y, int menu_nr)
void keyb_config_joypad (int key) { void keyb_config_joypad (int key) {
unsigned int n = 0; unsigned int n = 0;
SDL_Event event; SDL_Event event;
Uint8 *keys; int done = 0, eventstate = 0, reorder = 0, i, j;
int keypressed = 0, done = 0, eventstate = 0, reorder = 0, i, j;
if (joy[0] == NULL || key < 0 || key >= BCK_max) return; if (joy[0] == NULL || key < 0 || key >= BCK_max) return;
SDL_JoystickUpdate (); SDL_JoystickUpdate ();
menu_displaytext ("Joypad Config", "Please press the new key\nfor this function."); menu_displaytext ("Joypad Config", "Please press the new key\nfor this function.");
keys = SDL_GetKeyState (NULL);
if (keys[SDLK_RETURN] || keys[SDLK_ESCAPE])
keypressed = 1;
timestamp = SDL_GetTicks (); // needed for time sync. timestamp = SDL_GetTicks (); // needed for time sync.
while (!reorder && !done && bman.state != GS_quit) { while (!reorder && !done && bman.state != GS_quit) {
@ -205,7 +199,6 @@ void keyb_config_joypad (int key) {
reorder = 0; reorder = 0;
} }
// eventstate = s_fetchevent (&event);
SDL_JoystickEventState ( SDL_QUERY ); // js SDL_JoystickEventState ( SDL_QUERY ); // js
SDL_JoystickUpdate (); SDL_JoystickUpdate ();
@ -245,9 +238,7 @@ void keyb_config_joypad (int key) {
void keyb_config_readkey (int key) { void keyb_config_readkey (int key) {
int newkey; int newkey;
SDL_Event event; SDL_Event event;
Uint8 *keys; int done = 0,
int keypressed = 0,
done = 0,
eventstate = 0, eventstate = 0,
reorder = 0; reorder = 0;
newkey = 0; newkey = 0;
@ -257,11 +248,6 @@ void keyb_config_readkey (int key) {
return; return;
menu_displaytext ("Keyboard Config", "Please press the new key\nfor this function."); menu_displaytext ("Keyboard Config", "Please press the new key\nfor this function.");
keys = SDL_GetKeyState (NULL);
if (keys[SDLK_RETURN] || keys[SDLK_ESCAPE])
keypressed = 1;
timestamp = SDL_GetTicks (); // needed for time sync. timestamp = SDL_GetTicks (); // needed for time sync.
while (!reorder && !done && bman.state != GS_quit) { while (!reorder && !done && bman.state != GS_quit) {

@ -1,4 +1,4 @@
/* $Id: mapmenu.c,v 1.27 2006/07/30 11:44:58 stpohle Exp $ */ /* $Id: mapmenu.c,v 1.28 2012/01/28 21:53:19 steffen Exp $ */
/* map/tileset selection menu */ /* map/tileset selection menu */
#include "bomberclone.h" #include "bomberclone.h"
@ -174,15 +174,14 @@ mapinfo ()
{ {
_keybinput ki; _keybinput ki;
SDL_Event event; SDL_Event event;
int x, int y,
y,
eventstate, eventstate,
done = 0; done = 0;
char text[255]; char text[255];
// draw_menubox (WIN_X, WIN_Y); // draw_menubox (WIN_X, WIN_Y);
x = gfx.res.x / 2; // x = gfx.res.x / 2;
y = gfx.res.y / 2 - WIN_Y / 2; y = gfx.res.y / 2 - WIN_Y / 2;
sprintf (text, "Map Settings"); sprintf (text, "Map Settings");

@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.53 2006/02/06 21:18:01 stpohle Exp $ /* $Id: menu.c,v 1.54 2012/01/28 21:53:19 steffen Exp $
* Menuhandling */ * Menuhandling */
#include "basic.h" #include "basic.h"
@ -591,11 +591,10 @@ menu_dir_select (char *title, char *path, signed char dirflags)
menuselect; menuselect;
_charlist *selfile = flist; _charlist *selfile = flist;
_menu *menu; _menu *menu;
_menuitem *dirmi;
flcnt = menu_create_dirlist (path, dirflags, flist, MAX_DIRENTRYS); flcnt = menu_create_dirlist (path, dirflags, flist, MAX_DIRENTRYS);
menu = menu_new (title, 300, 300); menu = menu_new (title, 300, 300);
dirmi = menu_create_list (menu, "Dir", -1, 50, 200, 200, flist, &selfile, 1); menu_create_list (menu, "Dir", -1, 50, 200, 200, flist, &selfile, 1);
menu_create_button (menu, "OK", -1, 270, 150, 0); menu_create_button (menu, "OK", -1, 270, 150, 0);
menu_focus_id (menu, 1); menu_focus_id (menu, 1);

@ -1,4 +1,4 @@
/* $Id: netsrvlist.c,v 1.17 2005/08/07 17:46:21 stpohle Exp $ /* $Id: netsrvlist.c,v 1.18 2012/01/28 21:53:19 steffen Exp $
* netsrvlist.c - shows a list of possible servers.*/ * netsrvlist.c - shows a list of possible servers.*/
#include "basic.h" #include "basic.h"
@ -124,7 +124,6 @@ void net_getserver () {
_charlist *sel_entry = &srvlst_text[0]; _charlist *sel_entry = &srvlst_text[0];
_menu *menu; _menu *menu;
_menuitem *srvlst_listmenu; _menuitem *srvlst_listmenu;
_menuitem *srvlst_entry;
SDL_Event event; SDL_Event event;
d_printf ("net_getserver\n"); d_printf ("net_getserver\n");
@ -137,7 +136,7 @@ void net_getserver () {
menu = menu_new ("Join a Game", 500, 400); menu = menu_new ("Join a Game", 500, 400);
srvlst_listmenu = menu_create_list (menu, "Host a Game", -1, 50, 475, 250, srvlst_text, &sel_entry, 1); srvlst_listmenu = menu_create_list (menu, "Host a Game", -1, 50, 475, 250, srvlst_text, &sel_entry, 1);
srvlst_entry = menu_create_entry (menu, "IP :", -1, 320, 475, bman.servername, LEN_SERVERNAME+LEN_PORT + 2, MENU_entrytext, 2); menu_create_entry (menu, "IP :", -1, 320, 475, bman.servername, LEN_SERVERNAME+LEN_PORT + 2, MENU_entrytext, 2);
menu_create_button (menu, "OK", -1, 350, 150, 0); menu_create_button (menu, "OK", -1, 350, 150, 0);
menu_focus_id (menu, 1); menu_focus_id (menu, 1);

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.79 2007/01/12 22:42:31 stpohle Exp $ */ /* $Id: network.c,v 1.80 2012/01/28 21:53:19 steffen Exp $ */
/* /*
network routines. network routines.
*/ */
@ -460,7 +460,6 @@ void
net_transmit_gamedata () net_transmit_gamedata ()
{ {
int done = 0, int done = 0,
keypressed = 0,
x, x,
y, // network upload status for one step y, // network upload status for one step
p, p,
@ -621,12 +620,10 @@ net_transmit_gamedata ()
if (keys[SDLK_ESCAPE] && event.type == SDL_KEYDOWN) { if (keys[SDLK_ESCAPE] && event.type == SDL_KEYDOWN) {
done = 1; done = 1;
bman.p_nr = -1; bman.p_nr = -1;
keypressed = 1;
bman.state = GS_startup; bman.state = GS_startup;
} }
if (event.type == SDL_KEYUP) // if (event.type == SDL_KEYUP)
keypressed = 0;
} }
timestamp = SDL_GetTicks (); // needed for time sync. timestamp = SDL_GetTicks (); // needed for time sync.

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.108 2009/10/11 17:14:47 stpohle Exp $ /* $Id: player.c,v 1.109 2012/01/28 21:53:19 steffen Exp $
* player.c - everything what have to do with the player */ * player.c - everything what have to do with the player */
#include <SDL.h> #include <SDL.h>
@ -120,7 +120,6 @@ restore_players_screen ()
{ {
int i, int i,
x, x,
xs,
xe, xe,
y, y,
ys, ys,
@ -155,7 +154,6 @@ restore_players_screen ()
if (ye >= map.size.y) if (ye >= map.size.y)
ye = map.size.y - 1; ye = map.size.y - 1;
// redrawing of the stone // redrawing of the stone
xs = x;
for (; x <= xe; x++) for (; x <= xe; x++)
for (y = ys; y <= ye; y++) for (y = ys; y <= ye; y++)
stonelist_add (x, y); stonelist_add (x, y);
@ -445,7 +443,7 @@ get_killer_for_explosion (short int x, short int y)
void void
player_move (int pl_nr) player_move (int pl_nr)
{ {
int oldd, coll_speed; int oldd;
_player *p = &players[pl_nr]; _player *p = &players[pl_nr];
if (p->tunnelto > 0.0f) { if (p->tunnelto > 0.0f) {
@ -460,7 +458,6 @@ player_move (int pl_nr)
player_animation (p); player_animation (p);
oldd = p->d; oldd = p->d;
p->stepsleft = p->speed * timefactor; p->stepsleft = p->speed * timefactor;
coll_speed = p->collect_shoes;
do { do {
p->d = oldd; p->d = oldd;
} while ((p->stepsleft = stepmove_player (pl_nr)) > 0); } while ((p->stepsleft = stepmove_player (pl_nr)) > 0);
@ -677,9 +674,7 @@ void
player_calcpos () player_calcpos ()
{ {
_player *pl; _player *pl;
int oldm, int p;
oldd,
p;
float oldspeed; float oldspeed;
for (p = 0; p < MAX_PLAYERS; p++) { for (p = 0; p < MAX_PLAYERS; p++) {
@ -687,8 +682,6 @@ player_calcpos ()
if (PS_IS_netplayer (pl->state) && PS_IS_alife (pl->state) && pl->m != 0) { if (PS_IS_netplayer (pl->state) && PS_IS_alife (pl->state) && pl->m != 0) {
player_animation (pl); player_animation (pl);
oldspeed = pl->speed; oldspeed = pl->speed;
oldm = pl->m;
oldd = pl->d;
if (pl->speed > 0.0) { if (pl->speed > 0.0) {
pl->speed *= timefactor; pl->speed *= timefactor;
stepmove_player (p); stepmove_player (p);

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.86 2006/08/19 23:41:47 stpohle Exp $ */ /* $Id: single.c,v 1.87 2012/01/28 21:53:19 steffen Exp $ */
/* single player */ /* single player */
#include "basic.h" #include "basic.h"
@ -711,7 +711,6 @@ single_menu ()
_charlist nrplayerlist[MAX_PLAYERS + 1]; _charlist nrplayerlist[MAX_PLAYERS + 1];
_charlist *selnrplayer = &nrplayerlist[bman.ai_players]; _charlist *selnrplayer = &nrplayerlist[bman.ai_players];
_menu *menu; _menu *menu;
_menuitem *aiplayer = NULL;
SDL_Event event; SDL_Event event;
/* fill in the nrplayerlist */ /* fill in the nrplayerlist */
@ -729,7 +728,7 @@ single_menu ()
menu = menu_new ("Single Game", 380,240); menu = menu_new ("Single Game", 380,240);
menu_create_text (menu, "numpl", 20, 50, 12, 2, COLOR_yellow, "Number of\nAI Players"); menu_create_text (menu, "numpl", 20, 50, 12, 2, COLOR_yellow, "Number of\nAI Players");
aiplayer = menu_create_list (menu, "AI Players", 40, 90, 50, 100, nrplayerlist, &selnrplayer, 3); menu_create_list (menu, "AI Players", 40, 90, 50, 100, nrplayerlist, &selnrplayer, 3);
menu_create_button (menu,"Change Playernames" ,160, 50, 210, 4); menu_create_button (menu,"Change Playernames" ,160, 50, 210, 4);

@ -1,4 +1,4 @@
/* $Id: tileset.c,v 1.16 2004/09/26 02:28:07 stpohle Exp $ */ /* $Id: tileset.c,v 1.17 2012/01/28 21:53:19 steffen Exp $ */
/* load and select tilesets */ /* load and select tilesets */
#include "bomberclone.h" #include "bomberclone.h"
@ -72,7 +72,6 @@ tileset_load (char *tilesetname, int dx, int dy)
char tileset[LEN_TILESETNAME]; char tileset[LEN_TILESETNAME];
SDL_Surface *tmpimage, SDL_Surface *tmpimage,
*tmpimage1; *tmpimage1;
float sfkt;
d_printf ("Loading Tileset: %s\n", tilesetname); d_printf ("Loading Tileset: %s\n", tilesetname);
strncpy (tileset, tilesetname, LEN_TILESETNAME); strncpy (tileset, tilesetname, LEN_TILESETNAME);
@ -101,7 +100,6 @@ tileset_load (char *tilesetname, int dx, int dy)
/* create Table of points */ /* create Table of points */
scale (gfx.postab, gfx.block.x, 256); scale (gfx.postab, gfx.block.x, 256);
sfkt = ((float) gfx.block.x) / ((float) GFX_IMGSIZE);
/* calculating the best offset for the field on the screen */ /* calculating the best offset for the field on the screen */
gfx.offset.x = (gfx.res.x - (gfx.block.x * map.size.x)) / 2; gfx.offset.x = (gfx.res.x - (gfx.block.x * map.size.x)) / 2;

Loading…
Cancel
Save