From: Holger Schemel Date: Sat, 1 Apr 2023 00:27:59 +0000 (+0200) Subject: white space changes X-Git-Tag: 4.3.5.3~7 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=c42db18f39053cf2ec85943c37a20b8caa742d09 white space changes --- diff --git a/src/editor.c b/src/editor.c index 21cee41c..41bb5d88 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3800,7 +3800,7 @@ static struct -1, ED_AREA_1X1_SETTINGS_YPOS(1), 0, ED_AREA_1X1_SETTINGS_YOFF, GADGET_ID_CUSTOM_GRAPHIC, GADGET_ID_CUSTOM_USE_GRAPHIC, - &custom_element.gfx_element_initial,1, 1, + &custom_element.gfx_element_initial, 1, 1, NULL, NULL, NULL, NULL, "custom graphic element" }, @@ -3914,7 +3914,7 @@ static int level_xpos = -1, level_ypos = -1; static int ed_tilesize = DEFAULT_EDITOR_TILESIZE; static int ed_tilesize_default = DEFAULT_EDITOR_TILESIZE; -#define IN_ED_FIELD(x,y) IN_FIELD(x, y, ed_fieldx, ed_fieldy) +#define IN_ED_FIELD(x, y) IN_FIELD(x, y, ed_fieldx, ed_fieldy) // drawing elements on the three mouse buttons static int new_element1 = EL_WALL; @@ -7676,7 +7676,7 @@ static void MapCheckbuttonGadget(int id) // set position for gadgets with dynamically determined position if (checkbutton_info[id].x != -1) // do not change dynamic positions - ModifyGadget(gi, GDI_X, SX + ED_SETTINGS_X(checkbutton_info[id].x),GDI_END); + ModifyGadget(gi, GDI_X, SX + ED_SETTINGS_X(checkbutton_info[id].x), GDI_END); ModifyGadget(gi, GDI_Y, SY + ED_SETTINGS_Y(checkbutton_info[id].y), GDI_END); x_left = gi->x - xoffset_left; @@ -9972,9 +9972,9 @@ static struct { EL_NUT, &level.score[SC_NUT], TEXT_CRACKING }, { EL_DYNAMITE, &level.score[SC_DYNAMITE], TEXT_COLLECTING }, { EL_EM_DYNAMITE, &level.score[SC_DYNAMITE], TEXT_COLLECTING }, - { EL_DYNABOMB_INCREASE_NUMBER,&level.score[SC_DYNAMITE],TEXT_COLLECTING }, - { EL_DYNABOMB_INCREASE_SIZE, &level.score[SC_DYNAMITE],TEXT_COLLECTING }, - { EL_DYNABOMB_INCREASE_POWER, &level.score[SC_DYNAMITE],TEXT_COLLECTING }, + { EL_DYNABOMB_INCREASE_NUMBER,&level.score[SC_DYNAMITE], TEXT_COLLECTING }, + { EL_DYNABOMB_INCREASE_SIZE, &level.score[SC_DYNAMITE], TEXT_COLLECTING }, + { EL_DYNABOMB_INCREASE_POWER, &level.score[SC_DYNAMITE], TEXT_COLLECTING }, { EL_SHIELD_NORMAL, &level.score[SC_SHIELD], TEXT_COLLECTING }, { EL_SHIELD_DEADLY, &level.score[SC_SHIELD], TEXT_COLLECTING }, { EL_EXTRA_TIME, &level.extra_time_score, TEXT_COLLECTING }, @@ -12249,7 +12249,7 @@ static void DrawCircle(int from_x, int from_y, int to_x, int to_y, DrawArcExt(from_x, from_y, to_x2, to_y2, element, change_level); DrawArcExt(from_x, from_y, mirror_to_x2, to_y2, element, change_level); DrawArcExt(from_x, from_y, to_x2, mirror_to_y2, element, change_level); - DrawArcExt(from_x, from_y, mirror_to_x2, mirror_to_y2, element,change_level); + DrawArcExt(from_x, from_y, mirror_to_x2, mirror_to_y2, element, change_level); } #endif @@ -14816,7 +14816,7 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) sy = ly - level_ypos; } - if (IN_ED_FIELD(sx,sy) && IN_LEV_FIELD(lx, ly)) + if (IN_ED_FIELD(sx, sy) && IN_LEV_FIELD(lx, ly)) { if (button_status) // if (gi->state == GD_BUTTON_PRESSED) { diff --git a/src/files.c b/src/files.c index 093855df..889136ff 100644 --- a/src/files.c +++ b/src/files.c @@ -114,7 +114,7 @@ CONF_CONTENT_NUM_BYTES : 1) #define CONF_ELEMENT_BYTE_POS(i) ((i) * CONF_ELEMENT_NUM_BYTES) -#define CONF_ELEMENTS_ELEMENT(b,i) ((b[CONF_ELEMENT_BYTE_POS(i)] << 8) | \ +#define CONF_ELEMENTS_ELEMENT(b, i) ((b[CONF_ELEMENT_BYTE_POS(i)] << 8) | \ (b[CONF_ELEMENT_BYTE_POS(i) + 1])) #define CONF_CONTENT_ELEMENT_POS(c,x,y) ((c) * CONF_CONTENT_NUM_ELEMENTS + \ @@ -12110,7 +12110,7 @@ static void InitMenuDesignSettings_SpecialPostProcessing(void) vp_playfield->width = MIN(vp_playfield->width, vp_playfield->max_width); if (vp_playfield->max_height != -1) - vp_playfield->height = MIN(vp_playfield->height,vp_playfield->max_height); + vp_playfield->height = MIN(vp_playfield->height, vp_playfield->max_height); // adjust playfield position according to specified alignment diff --git a/src/game.c b/src/game.c index eed53906..dafcbbd4 100644 --- a/src/game.c +++ b/src/game.c @@ -962,7 +962,7 @@ static struct GamePanelControlInfo game_panel_controls[] = ELEMENT_CAN_ENTER_FIELD_BASE_3(e, x, y, Tile[x][y] == EL_DIAMOND) #define DARK_YAMYAM_CAN_ENTER_FIELD(e, x, y) \ - ELEMENT_CAN_ENTER_FIELD_BASE_3(e, x,y, IS_FOOD_DARK_YAMYAM(Tile[x][y])) + ELEMENT_CAN_ENTER_FIELD_BASE_3(e, x, y, IS_FOOD_DARK_YAMYAM(Tile[x][y])) #define PACMAN_CAN_ENTER_FIELD(e, x, y) \ ELEMENT_CAN_ENTER_FIELD_BASE_3(e, x, y, IS_AMOEBOID(Tile[x][y])) @@ -1069,9 +1069,9 @@ static void HandleElementChange(int, int, int); static void ExecuteCustomElementAction(int, int, int, int); static boolean ChangeElement(int, int, int, int); -static boolean CheckTriggeredElementChangeExt(int, int, int, int, int,int,int); +static boolean CheckTriggeredElementChangeExt(int, int, int, int, int, int, int); #define CheckTriggeredElementChange(x, y, e, ev) \ - CheckTriggeredElementChangeExt(x,y,e,ev, CH_PLAYER_ANY,CH_SIDE_ANY, -1) + CheckTriggeredElementChangeExt(x,y,e,ev, CH_PLAYER_ANY, CH_SIDE_ANY, -1) #define CheckTriggeredElementChangeByPlayer(x, y, e, ev, p, s) \ CheckTriggeredElementChangeExt(x, y, e, ev, p, s, -1) #define CheckTriggeredElementChangeBySide(x, y, e, ev, s) \ @@ -5440,7 +5440,7 @@ static int MovingOrBlocked2Element(int x, int y) static int MovingOrBlocked2ElementIfNotLeaving(int x, int y) { // like MovingOrBlocked2Element(), but if element is moving - // and (x,y) is the field the moving element is just leaving, + // and (x, y) is the field the moving element is just leaving, // return EL_BLOCKED instead of the element value int element = Tile[x][y]; @@ -7543,7 +7543,7 @@ static void TurnRoundExt(int x, int y) boolean can_turn_left = CUSTOM_ELEMENT_CAN_ENTER_FIELD(element, left_x, left_y); boolean can_turn_right = - CUSTOM_ELEMENT_CAN_ENTER_FIELD(element, right_x,right_y); + CUSTOM_ELEMENT_CAN_ENTER_FIELD(element, right_x, right_y); if (element_info[element].move_stepsize == 0) // "not moving" return; @@ -8373,7 +8373,7 @@ static void StartMoving(int x, int y) PlayLevelSound(newx, newy, SND_PENGUIN_PASSING); if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) - DrawGraphicThruMask(SCREENX(newx),SCREENY(newy), el2img(element), 0); + DrawGraphicThruMask(SCREENX(newx), SCREENY(newy), el2img(element), 0); game.friends_still_needed--; if (!game.friends_still_needed && @@ -8385,7 +8385,7 @@ static void StartMoving(int x, int y) } else if (IS_FOOD_PENGUIN(Tile[newx][newy])) { - if (DigField(local_player, x, y, newx, newy, 0,0, DF_DIG) == MP_MOVING) + if (DigField(local_player, x, y, newx, newy, 0, 0, DF_DIG) == MP_MOVING) TEST_DrawLevelField(newx, newy); else GfxDir[x][y] = MovDir[x][y] = MV_NONE; @@ -8690,7 +8690,7 @@ void ContinueMoving(int x, int y) if (pushed_by_player) // special case: moving object pushed by player { - MovPos[x][y] = SIGN(MovPos[x][y]) * (TILEX - ABS(PLAYERINFO(x,y)->MovPos)); + MovPos[x][y] = SIGN(MovPos[x][y]) * (TILEX - ABS(PLAYERINFO(x, y)->MovPos)); } else if (use_step_delay) // special case: moving object has step delay { @@ -8952,7 +8952,7 @@ void ContinueMoving(int x, int y) CheckElementChangeByPlayer(newx, newy, element, CE_PUSHED_BY_PLAYER, player->index_bit, push_side); - CheckTriggeredElementChangeByPlayer(newx,newy, element, CE_PLAYER_PUSHES_X, + CheckTriggeredElementChangeByPlayer(newx, newy, element, CE_PLAYER_PUSHES_X, player->index_bit, push_side); } @@ -12434,7 +12434,7 @@ void GameActions_RND(void) element == EL_DIAGONAL_SHRINKING || element == EL_DIAGONAL_GROWING) { - graphic = el_act_dir2img(GfxElement[x][y], GfxAction[x][y],GfxDir[x][y]); + graphic = el_act_dir2img(GfxElement[x][y], GfxAction[x][y], GfxDir[x][y]); DrawLevelGraphicAnimationIfNeeded(x, y, graphic); } @@ -12479,7 +12479,7 @@ void GameActions_RND(void) y = RND(lev_fieldy); element = Tile[x][y]; - if (!IS_PLAYER(x,y) && + if (!IS_PLAYER(x, y) && (element == EL_EMPTY || CAN_GROW_INTO(element) || element == EL_QUICKSAND_EMPTY || @@ -12855,7 +12855,7 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, !AllPlayersInSight(player, new_jx, new_jy)) return MP_NO_ACTION; - can_move = DigField(player, jx, jy, new_jx, new_jy, real_dx,real_dy, DF_DIG); + can_move = DigField(player, jx, jy, new_jx, new_jy, real_dx, real_dy, DF_DIG); if (can_move != MP_MOVING) return can_move; @@ -14173,7 +14173,7 @@ static int DigField(struct PlayerInfo *player, if (IS_WALKABLE(old_element) && !ACCESS_FROM(old_element, move_direction)) return MP_NO_ACTION; // field has no opening in this direction - if (IS_PASSABLE(old_element) && !ACCESS_FROM(old_element,opposite_direction)) + if (IS_PASSABLE(old_element) && !ACCESS_FROM(old_element, opposite_direction)) return MP_NO_ACTION; // field has no opening in this direction if (player_can_move && element == EL_ACID && move_direction == MV_DOWN) diff --git a/src/game_em/cave.c b/src/game_em/cave.c index 40b2dc6f..25d7785a 100644 --- a/src/game_em/cave.c +++ b/src/game_em/cave.c @@ -126,7 +126,7 @@ boolean LoadNativeLevel_EM(char *filename, boolean level_info_only) return FALSE; } - file_version = cleanup_em_level(raw_leveldata, raw_leveldata_length,filename); + file_version = cleanup_em_level(raw_leveldata, raw_leveldata_length, filename); if (file_version == FILE_VERSION_EM_UNKNOWN) { diff --git a/src/game_em/reademc.c b/src/game_em/reademc.c index dfa293a6..48eb9121 100644 --- a/src/game_em/reademc.c +++ b/src/game_em/reademc.c @@ -801,7 +801,7 @@ if(len >= 2110 && (buf[2106] == 255 && buf[2107] == 53 && buf[2108] == 48 && buf if(len >= 2106 && (buf[1983] == 116 || buf[2047] == 116)) // v4 if(len >= 2106 && (buf[1983] == 27 || buf[2047] == 219)) // v3 -buf[0]=241;buf[1]=248;for(i=0,j=101;i<2106;i++,j+=7)buf[i]=(buf[i]^j)-17; // decrypt +buf[0] = 241; buf[1] = 248; for(i = 0, j = 101; i < 2106; i++, j += 7) buf[i] = (buf[i] ^ j) - 17; // decrypt number of movements (calls to logic) = time * 50 / 8 diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 4c98623d..014f5deb 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -198,8 +198,10 @@ struct EngineSnapshotInfo_MM short Box[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT]; short Angle[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT]; - short LX,LY, XS,YS, ELX,ELY; - short CT,Ct; + short LX, LY; + short XS, YS; + short ELX, ELY; + short CT, Ct; int last_LX, last_LY, last_hit_mask; int hold_x, hold_y; diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index d5142cf2..496cc916 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -2883,26 +2883,28 @@ static void TurnRound(int x, int y) int x, y; } move_xy[] = { - { 0, 0 }, - {-1, 0 }, - {+1, 0 }, - { 0, 0 }, - { 0, -1 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, +1 } + { 0, 0 }, + { -1, 0 }, + { +1, 0 }, + { 0, 0 }, + { 0, -1 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, +1 } }; static struct { int left, right, back; } turn[] = { - { 0, 0, 0 }, + { 0, 0, 0 }, { MV_DOWN, MV_UP, MV_RIGHT }, - { MV_UP, MV_DOWN, MV_LEFT }, - { 0, 0, 0 }, - { MV_LEFT, MV_RIGHT, MV_DOWN }, - { 0,0,0 }, { 0,0,0 }, { 0,0,0 }, - { MV_RIGHT, MV_LEFT, MV_UP } + { MV_UP, MV_DOWN, MV_LEFT }, + { 0, 0, 0 }, + { MV_LEFT, MV_RIGHT, MV_DOWN }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { MV_RIGHT, MV_LEFT, MV_UP } }; int element = Tile[x][y]; diff --git a/src/game_mm/mm_init.c b/src/game_mm/mm_init.c index d982d190..b7dcbe35 100644 --- a/src/game_mm/mm_init.c +++ b/src/game_mm/mm_init.c @@ -31,7 +31,7 @@ unsigned int InitEngineRandom_MM(int seed) void InitElementProperties_MM(void) { - int i,j; + int i, j; static int ep_grid[] = { diff --git a/src/game_mm/mm_main.c b/src/game_mm/mm_main.c index 77f7e3a2..048d8fd3 100644 --- a/src/game_mm/mm_main.c +++ b/src/game_mm/mm_main.c @@ -28,8 +28,10 @@ unsigned int Elementeigenschaften[MAX_ELEMENTS]; struct LaserInfo laser; -short LX,LY, XS,YS, ELX,ELY; -short CT,Ct; +short LX, LY; +short XS, YS; +short ELX, ELY; +short CT, Ct; int dSX, dSY; int cSX, cSY; diff --git a/src/game_mm/mm_main.h b/src/game_mm/mm_main.h index 16246b2b..40397e8a 100644 --- a/src/game_mm/mm_main.h +++ b/src/game_mm/mm_main.h @@ -138,14 +138,12 @@ #define ENVELOPE_OPENING_NR(e) ((e) - EL_ENVELOPE_1_OPENING) #define CAN_MOVE(e) ((e) == EL_PACMAN) -#define IS_FREE(x,y) (Tile[x][y] == EL_EMPTY) +#define IS_FREE(x, y) (Tile[x][y] == EL_EMPTY) -#define IS_MOVING(x,y) (MovPos[x][y] != 0) -#define IS_BLOCKED(x,y) (Tile[x][y] == EL_BLOCKED) -#define IS_DRAWABLE(e) ((e) < EL_BLOCKED) -#define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) - -#define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_SPIELER1]) +#define IS_MOVING(x, y) (MovPos[x][y] != 0) +#define IS_BLOCKED(x, y) (Tile[x][y] == EL_BLOCKED) +#define IS_DRAWABLE(e) ((e) < EL_BLOCKED) +#define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) #define WALL_BASE(e) ((e) & 0xfff0) #define WALL_BITS(e) ((e) & 0x000f) diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 8d77a8c0..15b540aa 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -72,7 +72,7 @@ void DrawGraphicAnimation_MM(int x, int y, int graphic, int frame) void DrawGraphic_MM(int x, int y, int graphic) { #if DEBUG - if (!IN_SCR_FIELD(x,y)) + if (!IN_SCR_FIELD(x, y)) { Debug("game:mm:DrawGraphic_MM", "x = %d, y = %d, graphic = %d", x, y, graphic); @@ -102,9 +102,9 @@ void DrawGraphicExt_MM(DrawBuffer *d, int x, int y, int graphic) void DrawGraphicThruMask_MM(int x, int y, int graphic, int frame) { #if DEBUG - if (!IN_SCR_FIELD(x,y)) + if (!IN_SCR_FIELD(x, y)) { - Debug("game:mm:DrawGraphicThruMask_MM", "x = %d,y = %d, graphic = %d", + Debug("game:mm:DrawGraphicThruMask_MM", "x = %d, y = %d, graphic = %d", x, y, graphic); Debug("game:mm:DrawGraphicThruMask_MM", "This should never happen!"); @@ -115,7 +115,7 @@ void DrawGraphicThruMask_MM(int x, int y, int graphic, int frame) DrawGraphicThruMaskExt_MM(drawto_mm, cFX + x * TILEX, cFY + y * TILEY, graphic, frame); - MarkTileDirty(x,y); + MarkTileDirty(x, y); } void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y, @@ -150,8 +150,8 @@ void DrawMiniGraphicExt_MM(DrawBuffer *d, int x, int y, int graphic) BlitBitmap(bitmap, d, src_x, src_y, MINI_TILEX, MINI_TILEY, x, y); } -void DrawGraphicShifted_MM(int x,int y, int dx,int dy, int graphic, - int cut_mode, int mask_mode) +void DrawGraphicShifted_MM(int x, int y, int dx, int dy, int graphic, + int cut_mode, int mask_mode) { int width = TILEX, height = TILEY; int cx = 0, cy = 0; @@ -242,7 +242,7 @@ void DrawGraphicShifted_MM(int x,int y, int dx,int dy, int graphic, dest_y = cFY + y * TILEY + dy; #if DEBUG - if (!IN_SCR_FIELD(x,y)) + if (!IN_SCR_FIELD(x, y)) { Debug("game:mm:DrawGraphicShifted_MM", "x = %d, y = %d, graphic = %d", x, y, graphic); @@ -259,7 +259,7 @@ void DrawGraphicShifted_MM(int x,int y, int dx,int dy, int graphic, BlitBitmap(src_bitmap, drawto_mm, src_x, src_y, width, height, dest_x, dest_y); - MarkTileDirty(x,y); + MarkTileDirty(x, y); } void DrawScreenElementExt_MM(int x, int y, int dx, int dy, int element, @@ -368,7 +368,7 @@ void DrawLevelField_MM(int x, int y) DrawScreenField_MM(SCREENX(x), SCREENY(y)); else if (IS_MOVING(x, y)) { - int newx,newy; + int newx, newy; Moving2Blocked(x, y, &newx, &newy); if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) @@ -419,7 +419,7 @@ void DrawField_MM(int x, int y) void DrawLevel_MM(void) { - int x,y; + int x, y; ClearWindow(); @@ -647,7 +647,7 @@ static int xsn_percent(void) int xsn_m3 = xsn_m2 + 10; time_t xsn_e0 = time(NULL); struct tm *xsn_t0 = localtime(&xsn_e0); - struct tm xsn_t1 = { 0,0,0, xsn_m2*3, xsn_m3/3, xsn_t0->tm_year, 0,0,-1 }; + struct tm xsn_t1 = { 0,0,0, xsn_m2 * 3, xsn_m3 / 3, xsn_t0->tm_year, 0,0,-1 }; time_t xsn_e1 = mktime(&xsn_t1); int xsn_c0 = (25 * xsn_m3) << xsn_m1; int xsn_c1 = (xsn_t1.tm_wday - xsn_m1) * !!xsn_t1.tm_wday; diff --git a/src/libgame/hash.c b/src/libgame/hash.c index 6bd7f1b9..e021da5c 100644 --- a/src/libgame/hash.c +++ b/src/libgame/hash.c @@ -43,7 +43,7 @@ struct hashtable * create_hashtable(unsigned int minsize, float maxloadfactor, unsigned int (*hashf) (void*), - int (*eqf) (void*,void*)) + int (*eqf) (void*, void*)) { struct hashtable *h; unsigned int i, size = 1u; @@ -134,7 +134,7 @@ hashtable_expand(struct hashtable *h) while ((e = h->table[i]) != NULL) { h->table[i] = e->next; - index = indexFor(newsize,e->h); + index = indexFor(newsize, e->h); e->next = newtable[index]; newtable[index] = e; } @@ -160,7 +160,7 @@ hashtable_expand(struct hashtable *h) { for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) { - index = indexFor(newsize,e->h); + index = indexFor(newsize, e->h); if (index == i) { @@ -216,8 +216,8 @@ hashtable_insert(struct hashtable *h, void *k, void *v) return 0; } - e->h = hash(h,k); - index = indexFor(h->tablelength,e->h); + e->h = hash(h, k); + index = indexFor(h->tablelength, e->h); e->k = k; e->v = v; e->next = h->table[index]; @@ -233,8 +233,8 @@ hashtable_change(struct hashtable *h, void *k, void *v) struct entry *e; unsigned int hashvalue, index; - hashvalue = hash(h,k); - index = indexFor(h->tablelength,hashvalue); + hashvalue = hash(h, k); + index = indexFor(h->tablelength, hashvalue); e = h->table[index]; while (e != NULL) @@ -261,8 +261,8 @@ hashtable_search(struct hashtable *h, void *k) struct entry *e; unsigned int hashvalue, index; - hashvalue = hash(h,k); - index = indexFor(h->tablelength,hashvalue); + hashvalue = hash(h, k); + index = indexFor(h->tablelength, hashvalue); e = h->table[index]; while (e != NULL) @@ -287,7 +287,7 @@ hashtable_remove(struct hashtable *h, void *k) struct entry *e; struct entry **pE; void *v; - unsigned int index = indexFor(h->tablelength,hash(h,k)); + unsigned int index = indexFor(h->tablelength, hash(h, k)); pE = &(h->table[index]); e = *pE; @@ -379,7 +379,7 @@ hashtable_iterator(struct hashtable *h) } /*****************************************************************************/ -/* key - return the key of the (key,value) pair at the current position */ +/* key - return the key of the (key, value) pair at the current position */ void * hashtable_iterator_key(struct hashtable_itr *i) @@ -388,7 +388,7 @@ hashtable_iterator_key(struct hashtable_itr *i) } /*****************************************************************************/ -/* value - return the value of the (key,value) pair at the current position */ +/* value - return the value of the (key, value) pair at the current position */ void * hashtable_iterator_value(struct hashtable_itr *i) @@ -403,7 +403,7 @@ hashtable_iterator_value(struct hashtable_itr *i) int hashtable_iterator_advance(struct hashtable_itr *itr) { - unsigned int j,tablelength; + unsigned int j, tablelength; struct entry **table; struct entry *next; diff --git a/src/libgame/hash.h b/src/libgame/hash.h index 004d9c58..f87f8b90 100644 --- a/src/libgame/hash.h +++ b/src/libgame/hash.h @@ -134,7 +134,7 @@ struct hashtable_itr struct hashtable * create_hashtable(unsigned int minsize, float maxloadfactor, unsigned int (*hashfunction) (void*), - int (*key_eq_fn) (void*,void*)); + int (*key_eq_fn) (void*, void*)); /***************************************************************************** * hashtable_insert @@ -161,7 +161,7 @@ hashtable_insert(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ static int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ - return hashtable_insert(h,k,v); \ + return hashtable_insert(h, k, v); \ } /***************************************************************************** @@ -180,7 +180,7 @@ hashtable_change(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_CHANGE(fnname, keytype, valuetype) \ static int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ - return hashtable_change(h,k,v); \ + return hashtable_change(h, k, v); \ } /***************************************************************************** @@ -198,7 +198,7 @@ hashtable_search(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ static valuetype * fnname (struct hashtable *h, keytype *k) \ { \ - return (valuetype *) (hashtable_search(h,k)); \ + return (valuetype *) (hashtable_search(h, k)); \ } /***************************************************************************** @@ -216,7 +216,7 @@ hashtable_remove(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \ static valuetype * fnname (struct hashtable *h, keytype *k) \ { \ - return (valuetype *) (hashtable_remove(h,k)); \ + return (valuetype *) (hashtable_remove(h, k)); \ } @@ -249,13 +249,13 @@ struct hashtable_itr * hashtable_iterator(struct hashtable *h); /*****************************************************************************/ -/* key - return the key of the (key,value) pair at the current position */ +/* key - return the key of the (key, value) pair at the current position */ void * hashtable_iterator_key(struct hashtable_itr *i); /*****************************************************************************/ -/* value - return the value of the (key,value) pair at the current position */ +/* value - return the value of the (key, value) pair at the current position */ void * hashtable_iterator_value(struct hashtable_itr *i); diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 9f97f536..2d2551a2 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1454,14 +1454,14 @@ static void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) case 1: { // Assuming 8-bpp - *((Uint8 *)surface->pixels + y*surface->pitch + x) = color; + *((Uint8 *)surface->pixels + y * surface->pitch + x) = color; } break; case 2: { // Probably 15-bpp or 16-bpp - *((Uint16 *)surface->pixels + y*surface->pitch/2 + x) = color; + *((Uint16 *)surface->pixels + y * surface->pitch / 2 + x) = color; } break; @@ -1472,20 +1472,20 @@ static void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) int shift; // Gack - slow, but endian correct - pix = (Uint8 *)surface->pixels + y * surface->pitch + x*3; + pix = (Uint8 *)surface->pixels + y * surface->pitch + x * 3; shift = surface->format->Rshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Gshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Bshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; } break; case 4: { // Probably 32-bpp - *((Uint32 *)surface->pixels + y*surface->pitch/4 + x) = color; + *((Uint32 *)surface->pixels + y * surface->pitch / 4 + x) = color; } break; } @@ -1501,12 +1501,12 @@ static void _PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y, static void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { - *((Uint8 *)surface->pixels + y*surface->pitch + x) = color; + *((Uint8 *)surface->pixels + y * surface->pitch + x) = color; } static void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { - *((Uint16 *)surface->pixels + y*surface->pitch/2 + x) = color; + *((Uint16 *)surface->pixels + y * surface->pitch / 2 + x) = color; } static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) @@ -1515,38 +1515,38 @@ static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) int shift; // Gack - slow, but endian correct - pix = (Uint8 *)surface->pixels + y * surface->pitch + x*3; + pix = (Uint8 *)surface->pixels + y * surface->pitch + x * 3; shift = surface->format->Rshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Gshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Bshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; } static void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { - *((Uint32 *)surface->pixels + y*surface->pitch/4 + x) = color; + *((Uint32 *)surface->pixels + y * surface->pitch / 4 + x) = color; } -static void _PutPixelX(SDL_Surface *dest,Sint16 x,Sint16 y,Uint32 color) +static void _PutPixelX(SDL_Surface *dest, Sint16 x, Sint16 y, Uint32 color) { switch (dest->format->BytesPerPixel) { case 1: - *((Uint8 *)dest->pixels + y*dest->pitch + x) = color; + *((Uint8 *)dest->pixels + y * dest->pitch + x) = color; break; case 2: - *((Uint16 *)dest->pixels + y*dest->pitch/2 + x) = color; + *((Uint16 *)dest->pixels + y * dest->pitch / 2 + x) = color; break; case 3: - _PutPixel24(dest,x,y,color); + _PutPixel24(dest, x, y, color); break; case 4: - *((Uint32 *)dest->pixels + y*dest->pitch/4 + x) = color; + *((Uint32 *)dest->pixels + y * dest->pitch / 4 + x) = color; break; } } @@ -1584,19 +1584,19 @@ static Sint32 sge_CalcYPitch(SDL_Surface *dest, Sint16 y) switch (dest->format->BytesPerPixel) { case 1: - return y*dest->pitch; + return y * dest->pitch; break; case 2: - return y*dest->pitch/2; + return y * dest->pitch / 2; break; case 3: - return y*dest->pitch; + return y * dest->pitch; break; case 4: - return y*dest->pitch/4; + return y * dest->pitch / 4; break; } } @@ -1632,13 +1632,13 @@ static void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch, int shift; // Gack - slow, but endian correct - pix = (Uint8 *)surface->pixels + ypitch + x*3; + pix = (Uint8 *)surface->pixels + ypitch + x * 3; shift = surface->format->Rshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Gshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; shift = surface->format->Bshift; - *(pix+shift/8) = color>>shift; + *(pix + shift / 8) = color>>shift; } break; diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 86c5af99..2b1ccd87 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -48,10 +48,10 @@ #define SOUND_VOLUME_LEFT(x) (stereo_volume[x]) #define SOUND_VOLUME_RIGHT(x) (stereo_volume[SOUND_MAX_LEFT2RIGHT-x]) -#define SAME_SOUND_NR(x,y) ((x).nr == (y).nr) -#define SAME_SOUND_DATA(x,y) ((x).data_ptr == (y).data_ptr) +#define SAME_SOUND_NR(x, y) ((x).nr == (y).nr) +#define SAME_SOUND_DATA(x, y) ((x).data_ptr == (y).data_ptr) -#define SOUND_VOLUME_FROM_PERCENT(v,p) ((p) < 0 ? SOUND_MIN_VOLUME : \ +#define SOUND_VOLUME_FROM_PERCENT(v, p) ((p) < 0 ? SOUND_MIN_VOLUME : \ (p) > 100 ? (v) : \ (p) * (v) / 100) @@ -59,7 +59,7 @@ #define SOUND_VOLUME_LOOPS(v) SOUND_VOLUME_FROM_PERCENT(v, setup.volume_loops) #define SOUND_VOLUME_MUSIC(v) SOUND_VOLUME_FROM_PERCENT(v, setup.volume_music) -#define SETUP_SOUND_VOLUME(v,s) ((s) & SND_CTRL_MUSIC ? \ +#define SETUP_SOUND_VOLUME(v, s) ((s) & SND_CTRL_MUSIC ? \ SOUND_VOLUME_MUSIC(v) : \ (s) & SND_CTRL_LOOP ? \ SOUND_VOLUME_LOOPS(v) : \ diff --git a/src/libgame/system.h b/src/libgame/system.h index 77002274..02e58143 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -482,9 +482,9 @@ #define VALIGN_MIDDLE (1 << 2) #define VALIGN_DEFAULT VALIGN_TOP -#define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \ +#define ALIGNED_XPOS(x, w, a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \ (a) == ALIGN_RIGHT ? (x) - (w) : (x)) -#define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \ +#define ALIGNED_YPOS(y, h, v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \ (v) == VALIGN_BOTTOM ? (y) - (h) : (y)) #define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align) #define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign) @@ -1998,7 +1998,7 @@ Bitmap *CreateBitmap(int, int, int); void ReCreateBitmap(Bitmap **, int, int); void FreeBitmap(Bitmap *); void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int); -void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int); +void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int, int); void FadeRectangle(int, int, int, int, int, int, int, void (*draw_border_function)(void)); void FillRectangle(Bitmap *, int, int, int, int, Pixel); @@ -2017,7 +2017,7 @@ void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int); void DrawSimpleWhiteLine(Bitmap *, int, int, int, int); void DrawLines(Bitmap *, struct XY *, int, Pixel); Pixel GetPixel(Bitmap *, int, int); -Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int); +Pixel GetPixelFromRGB(Bitmap *, unsigned int, unsigned int, unsigned int); void KeyboardAutoRepeatOn(void); void KeyboardAutoRepeatOff(void); diff --git a/src/libgame/types.h b/src/libgame/types.h index 5129f1c8..0c935a21 100644 --- a/src/libgame/types.h +++ b/src/libgame/types.h @@ -41,11 +41,11 @@ typedef unsigned char byte; #define AUTO -1 #ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif #ifndef ABS diff --git a/src/libgame/zip/ioapi.c b/src/libgame/zip/ioapi.c index 5d9c10bd..0aa6347a 100644 --- a/src/libgame/zip/ioapi.c +++ b/src/libgame/zip/ioapi.c @@ -45,11 +45,11 @@ long call_zseek64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, ui { uint32_t offset_truncated = 0; if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque, filestream, offset, origin); offset_truncated = (uint32_t)offset; if (offset_truncated != offset) return -1; - return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream, offset_truncated, origin); + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque, filestream, offset_truncated, origin); } uint64_t call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream) diff --git a/src/libgame/zip/ioapi.h b/src/libgame/zip/ioapi.h index 3689881d..1c70d61a 100644 --- a/src/libgame/zip/ioapi.h +++ b/src/libgame/zip/ioapi.h @@ -127,24 +127,24 @@ typedef struct zlib_filefunc64_32_def_s seek_file_func zseek32_file; } zlib_filefunc64_32_def; -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -/*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))*/ -/*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))*/ -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64(const zlib_filefunc64_32_def *pfilefunc,const void*filename, int mode); +#define ZREAD64(filefunc, filestream, buf, size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque, filestream, buf, size)) +#define ZWRITE64(filefunc, filestream, buf, size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque, filestream, buf, size)) +/*#define ZTELL64(filefunc, filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque, filestream))*/ +/*#define ZSEEK64(filefunc, filestream, pos, mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque, filestream, pos, mode))*/ +#define ZCLOSE64(filefunc, filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque, filestream)) +#define ZERROR64(filefunc, filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque, filestream)) + +voidpf call_zopen64(const zlib_filefunc64_32_def *pfilefunc, const void *filename, int mode); voidpf call_zopendisk64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, uint32_t number_disk, int mode); long call_zseek64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, uint64_t offset, int origin); uint64_t call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, const zlib_filefunc_def *p_filefunc32); -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZOPENDISK64(filefunc,filestream,diskn,mode) (call_zopendisk64((&(filefunc)),(filestream),(diskn),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) +#define ZOPEN64(filefunc, filename, mode) (call_zopen64((&(filefunc)), (filename), (mode))) +#define ZOPENDISK64(filefunc, filestream, diskn, mode) (call_zopendisk64((&(filefunc)), (filestream), (diskn), (mode))) +#define ZTELL64(filefunc, filestream) (call_ztell64((&(filefunc)), (filestream))) +#define ZSEEK64(filefunc, filestream, pos, mode) (call_zseek64((&(filefunc)), (filestream), (pos), (mode))) #ifdef __cplusplus } diff --git a/src/libgame/zip/miniunz.c b/src/libgame/zip/miniunz.c index cf9839b1..1ca632a9 100644 --- a/src/libgame/zip/miniunz.c +++ b/src/libgame/zip/miniunz.c @@ -389,7 +389,7 @@ static int miniunz_extract_currentfile(unzFile uf, int opt_extract_without_path, err = unzGetCurrentFileInfo64(uf, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); if (err != UNZ_OK) { - debug_printf("error %d with zipfile in unzGetCurrentFileInfo\n",err); + debug_printf("error %d with zipfile in unzGetCurrentFileInfo\n", err); return err; } diff --git a/src/main.h b/src/main.h index 67e652d5..a6ec11b0 100644 --- a/src/main.h +++ b/src/main.h @@ -201,9 +201,9 @@ #define EP_BITMASK_DEFAULT 0 #define PROPERTY_BIT(p) (1u << ((p) % 32)) -#define PROPERTY_VAR(e,p) (element_info[e].properties[(p) / 32]) -#define HAS_PROPERTY(e,p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0) -#define SET_PROPERTY(e,p,v) ((v) ? \ +#define PROPERTY_VAR(e, p) (element_info[e].properties[(p) / 32]) +#define HAS_PROPERTY(e, p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0) +#define SET_PROPERTY(e, p, v) ((v) ? \ (PROPERTY_VAR(e,p) |= PROPERTY_BIT(p)) : \ (PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p))) @@ -273,19 +273,19 @@ #define CH_EVENT_BITFIELD_NR(e) (e / 32) #define CH_EVENT_BIT(e) (1 << ((e) % 32)) -#define CH_EVENT_VAR(e,c) (element_info[e].change->has_event[c]) -#define CH_ANY_EVENT_VAR(e,c) (element_info[e].has_change_event[c]) +#define CH_EVENT_VAR(e, c) (element_info[e].change->has_event[c]) +#define CH_ANY_EVENT_VAR(e, c) (element_info[e].has_change_event[c]) -#define PAGE_HAS_CHANGE_EVENT(p,c) ((p)->has_event[c]) -#define HAS_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \ - CH_EVENT_VAR(e,c)) -#define HAS_ANY_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \ - CH_ANY_EVENT_VAR(e,c)) +#define PAGE_HAS_CHANGE_EVENT(p, c) ((p)->has_event[c]) +#define HAS_CHANGE_EVENT(e, c) (IS_CUSTOM_ELEMENT(e) && \ + CH_EVENT_VAR(e, c)) +#define HAS_ANY_CHANGE_EVENT(e, c) (IS_CUSTOM_ELEMENT(e) && \ + CH_ANY_EVENT_VAR(e, c)) -#define SET_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \ - CH_EVENT_VAR(e,c) = (v) : 0) -#define SET_ANY_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \ - CH_ANY_EVENT_VAR(e,c) = (v) : 0) +#define SET_CHANGE_EVENT(e, c, v) (IS_CUSTOM_ELEMENT(e) ? \ + CH_EVENT_VAR(e, c) = (v) : 0) +#define SET_ANY_CHANGE_EVENT(e, c, v) (IS_CUSTOM_ELEMENT(e) ? \ + CH_ANY_EVENT_VAR(e, c) = (v) : 0) // values for player bitmasks #define PLAYER_BITS_NONE 0 @@ -871,9 +871,9 @@ #define IS_FREE(x, y) (Tile[x][y] == EL_EMPTY && !IS_PLAYER(x, y)) #define IS_FREE_OR_PLAYER(x, y) (Tile[x][y] == EL_EMPTY) -#define IS_MOVING(x,y) (MovPos[x][y] != 0) -#define IS_FALLING(x,y) (MovPos[x][y] != 0 && MovDir[x][y] == MV_DOWN) -#define IS_BLOCKED(x,y) (Tile[x][y] == EL_BLOCKED) +#define IS_MOVING(x, y) (MovPos[x][y] != 0) +#define IS_FALLING(x, y) (MovPos[x][y] != 0 && MovDir[x][y] == MV_DOWN) +#define IS_BLOCKED(x, y) (Tile[x][y] == EL_BLOCKED) #define IS_MV_DIAGONAL(x) ((x) & MV_HORIZONTAL && (x) & MV_VERTICAL) @@ -901,13 +901,13 @@ #define TAPE_IS_EMPTY(x) ((x).length == 0) #define TAPE_IS_STOPPED(x) (!(x).recording && !(x).playing) -#define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_PLAYER_1]) +#define PLAYERINFO(x, y) (&stored_player[StorePlayer[x][y] - EL_PLAYER_1]) #define SHIELD_ON(p) ((p)->shield_normal_time_left > 0) -#define ENEMY_PROTECTED_FIELD(x,y) (IS_PROTECTED(Tile[x][y]) || \ +#define ENEMY_PROTECTED_FIELD(x, y) (IS_PROTECTED(Tile[x][y]) || \ IS_PROTECTED(Back[x][y])) -#define EXPLOSION_PROTECTED_FIELD(x,y) (IS_EXPLOSION_PROOF(Tile[x][y])) -#define PLAYER_ENEMY_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ +#define EXPLOSION_PROTECTED_FIELD(x, y) (IS_EXPLOSION_PROOF(Tile[x][y])) +#define PLAYER_ENEMY_PROTECTED(x, y) (SHIELD_ON(PLAYERINFO(x, y)) || \ ENEMY_PROTECTED_FIELD(x, y)) #define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ EXPLOSION_PROTECTED_FIELD(x, y)) @@ -918,7 +918,7 @@ #define PLAYER_DROPPING(p,x,y) ((p)->is_dropping && \ (p)->drop_x == (x) && (p)->drop_y == (y)) -#define PLAYER_NR_GFX(g,i) ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1)) +#define PLAYER_NR_GFX(g, i) ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1)) #define GET_PLAYER_ELEMENT(e) ((e) >= EL_PLAYER_1 && (e) <= EL_PLAYER_4 ? \ (e) : EL_PLAYER_1) diff --git a/src/screens.c b/src/screens.c index 3761775a..47b37a34 100644 --- a/src/screens.c +++ b/src/screens.c @@ -5937,7 +5937,7 @@ static void execSetupGame_setScrollDelays(void) // set current scroll delay value to configured scroll delay value scroll_delay_current = - getTreeInfoFromIdentifier(scroll_delays,i_to_a(setup.scroll_delay_value)); + getTreeInfoFromIdentifier(scroll_delays, i_to_a(setup.scroll_delay_value)); // if that fails, set current scroll delay to reliable default value if (scroll_delay_current == NULL) @@ -6497,7 +6497,7 @@ static void execSetupSound(void) // set current volume value to configured volume value volume_simple_current = - getTreeInfoFromIdentifier(volumes_simple,i_to_a(setup.volume_simple)); + getTreeInfoFromIdentifier(volumes_simple, i_to_a(setup.volume_simple)); // if that fails, set current volume to reliable default value if (volume_simple_current == NULL) @@ -6565,7 +6565,7 @@ static void execSetupSound(void) // set current volume value to configured volume value volume_loops_current = - getTreeInfoFromIdentifier(volumes_loops,i_to_a(setup.volume_loops)); + getTreeInfoFromIdentifier(volumes_loops, i_to_a(setup.volume_loops)); // if that fails, set current volume to reliable default value if (volume_loops_current == NULL) @@ -6633,7 +6633,7 @@ static void execSetupSound(void) // set current volume value to configured volume value volume_music_current = - getTreeInfoFromIdentifier(volumes_music,i_to_a(setup.volume_music)); + getTreeInfoFromIdentifier(volumes_music, i_to_a(setup.volume_music)); // if that fails, set current volume to reliable default value if (volume_music_current == NULL) @@ -10376,47 +10376,47 @@ static void HandleScreenGadgets(struct GadgetInfo *gi) case SCREEN_CTRL_ID_SCROLL_UP: if (game_status == GAME_MODE_NAMES) - HandleChoosePlayerName(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleChoosePlayerName(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_LEVELS) - HandleChooseLevelSet(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleChooseLevelSet(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_LEVELNR) - HandleChooseLevelNr(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleChooseLevelNr(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_SETUP) - HandleSetupScreen(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleSetupScreen(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_INFO) - HandleInfoScreen(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleInfoScreen(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_SCORES) - HandleHallOfFame(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); + HandleHallOfFame(0, 0, 0, -1 * SCROLL_LINE, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_DOWN: if (game_status == GAME_MODE_NAMES) - HandleChoosePlayerName(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleChoosePlayerName(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_LEVELS) - HandleChooseLevelSet(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleChooseLevelSet(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_LEVELNR) - HandleChooseLevelNr(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleChooseLevelNr(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_SETUP) - HandleSetupScreen(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleSetupScreen(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_INFO) - HandleInfoScreen(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleInfoScreen(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); else if (game_status == GAME_MODE_SCORES) - HandleHallOfFame(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); + HandleHallOfFame(0, 0, 0, +1 * SCROLL_LINE, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_VERTICAL: if (game_status == GAME_MODE_NAMES) - HandleChoosePlayerName(0,0,999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleChoosePlayerName(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); else if (game_status == GAME_MODE_LEVELS) - HandleChooseLevelSet(0,0,999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleChooseLevelSet(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); else if (game_status == GAME_MODE_LEVELNR) - HandleChooseLevelNr(0,0,999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleChooseLevelNr(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); else if (game_status == GAME_MODE_SETUP) - HandleSetupScreen(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleSetupScreen(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); else if (game_status == GAME_MODE_INFO) - HandleInfoScreen(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleInfoScreen(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); else if (game_status == GAME_MODE_SCORES) - HandleHallOfFame(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE); + HandleHallOfFame(0, 0, 999, gi->event.item_position, MB_MENU_INITIALIZE); break; case SCREEN_CTRL_ID_NETWORK_SERVER: diff --git a/src/tools.c b/src/tools.c index 45447912..fde8811d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1728,7 +1728,7 @@ void DrawGraphicThruMask(int x, int y, int graphic, int frame) #if DEBUG if (!IN_SCR_FIELD(x, y)) { - Debug("draw:DrawGraphicThruMask", "x = %d,y = %d, graphic = %d", + Debug("draw:DrawGraphicThruMask", "x = %d, y = %d, graphic = %d", x, y, graphic); Debug("draw:DrawGraphicThruMask", "This should never happen!"); @@ -1747,7 +1747,7 @@ void DrawFixedGraphicThruMask(int x, int y, int graphic, int frame) #if DEBUG if (!IN_SCR_FIELD(x, y)) { - Debug("draw:DrawFixedGraphicThruMask", "x = %d,y = %d, graphic = %d", + Debug("draw:DrawFixedGraphicThruMask", "x = %d, y = %d, graphic = %d", x, y, graphic); Debug("draw:DrawFixedGraphicThruMask", "This should never happen!"); @@ -1821,7 +1821,7 @@ void DrawSizedGraphicThruMaskExt(DrawBuffer *d, int x, int y, int graphic, void DrawMiniGraphic(int x, int y, int graphic) { - DrawMiniGraphicExt(drawto, SX + x * MINI_TILEX,SY + y * MINI_TILEY, graphic); + DrawMiniGraphicExt(drawto, SX + x * MINI_TILEX, SY + y * MINI_TILEY, graphic); MarkTileDirty(x / 2, y / 2); } @@ -2024,9 +2024,9 @@ static void DrawGraphicShifted(int x, int y, int dx, int dy, } if (graphic_info[graphic].double_movement) // EM style movement images - DrawGraphicShiftedDouble(x, y, dx, dy, graphic, frame, cut_mode,mask_mode); + DrawGraphicShiftedDouble(x, y, dx, dy, graphic, frame, cut_mode, mask_mode); else - DrawGraphicShiftedNormal(x, y, dx, dy, graphic, frame, cut_mode,mask_mode); + DrawGraphicShiftedNormal(x, y, dx, dy, graphic, frame, cut_mode, mask_mode); } static void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, @@ -2711,7 +2711,7 @@ void DrawLevelField(int x, int y) DrawScreenField(SCREENX(x), SCREENY(y)); else if (IS_MOVING(x, y)) { - int newx,newy; + int newx, newy; Moving2Blocked(x, y, &newx, &newy); if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) @@ -3405,7 +3405,7 @@ static void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize) void DrawLevel(int draw_background_mask) { - int x,y; + int x, y; SetMainBackgroundImage(IMG_BACKGROUND_PLAYING); SetDrawBackgroundMask(draw_background_mask); @@ -3422,7 +3422,7 @@ void DrawLevel(int draw_background_mask) void DrawSizedLevel(int size_x, int size_y, int scroll_x, int scroll_y, int tilesize) { - int x,y; + int x, y; for (x = 0; x < size_x; x++) for (y = 0; y < size_y; y++) @@ -3433,7 +3433,7 @@ void DrawSizedLevel(int size_x, int size_y, int scroll_x, int scroll_y, void DrawMiniLevel(int size_x, int size_y, int scroll_x, int scroll_y) { - int x,y; + int x, y; for (x = 0; x < size_x; x++) for (y = 0; y < size_y; y++) @@ -4074,7 +4074,7 @@ static int getPlayerGraphic(struct PlayerInfo *player, int move_dir) return graphic; } else - return el_act_dir2img(player->artwork_element, player->GfxAction,move_dir); + return el_act_dir2img(player->artwork_element, player->GfxAction, move_dir); } static boolean equalGraphics(int graphic1, int graphic2)