From 30eb586d06bc4d1ee7388dced1c20e530292aa93 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 19 Sep 2018 08:50:46 +0200 Subject: [PATCH] fixed compiler warnings (after adding "-Wmissing-prototypes") Adding this warning option revealed lots of unused functions (which are deactivated in the code using preprocessor directives for now and which will be checked and probably removed in a later step). --- src/Makefile | 2 +- src/anim.c | 14 +++--- src/editor.c | 14 +++--- src/events.c | 12 ++--- src/files.c | 31 ++++++------ src/game.c | 97 ++++++++++++++++++++------------------ src/game_em/export.h | 5 ++ src/game_em/init.c | 3 -- src/game_em/input.c | 2 +- src/game_em/synchro_1.c | 2 - src/game_em/tab_generate.c | 12 ++--- src/game_mm/mm_game.c | 16 +++---- src/game_mm/mm_tools.c | 16 +++++-- src/game_sp/file.c | 2 +- src/game_sp/main.c | 2 +- src/init.c | 30 ++++++------ src/libgame/hash.h | 8 ++-- src/libgame/image.c | 2 +- src/libgame/joystick.c | 4 +- src/libgame/misc.c | 27 +++++++---- src/libgame/sdl.c | 85 ++++++++++++++++++--------------- src/libgame/setup.c | 16 +++---- src/libgame/snapshot.c | 2 +- src/libgame/sound.c | 2 +- src/libgame/system.c | 10 ++-- src/main.h | 1 + src/netserv.c | 2 +- src/network.c | 2 +- src/screens.c | 42 +++++++++-------- src/tape.c | 8 ++-- src/tools.c | 79 ++++++++++++++++--------------- 31 files changed, 295 insertions(+), 255 deletions(-) diff --git a/src/Makefile b/src/Makefile index f1f99be9..0f98d356 100644 --- a/src/Makefile +++ b/src/Makefile @@ -108,7 +108,7 @@ DEBUG = -DDEBUG -g # OPTIONS = $(DEBUG) -Wall # only for debugging purposes # OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes # OPTIONS = $(DEBUG) -Wall # only for debugging purposes -OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes # only for debugging purposes +OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes # OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes # OPTIONS = -O3 -Wall -ansi -pedantic # OPTIONS = -O3 -Wall diff --git a/src/anim.c b/src/anim.c index b79d5cc6..cdde4236 100644 --- a/src/anim.c +++ b/src/anim.c @@ -407,7 +407,7 @@ static void InitToonControls(void) ctrl->num_anims++; } -void InitGlobalAnimControls(void) +static void InitGlobalAnimControls(void) { int i, m, a, p; int mode_nr, anim_nr, part_nr; @@ -573,7 +573,7 @@ void InitGlobalAnimations(void) InitGlobalAnimControls(); } -void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) +static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) { Bitmap *fade_bitmap = (drawing_target == DRAW_TO_FADE_SOURCE ? gfx.fade_bitmap_source : @@ -806,7 +806,7 @@ void DrawGlobalAnimations(int drawing_target, int drawing_stage) ResetGlobalAnim_Clicked(); } -boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part) +static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part) { int viewport_x; int viewport_y; @@ -1035,7 +1035,8 @@ static boolean clickConsumed(struct GlobalAnimPartControlInfo *part) return (part->control_info.style & STYLE_PASSTHROUGH ? FALSE : TRUE); } -int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) +static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, + int state) { struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[part->mode_nr]; struct GlobalAnimMainControlInfo *anim = &ctrl->anim[part->anim_nr]; @@ -1279,7 +1280,8 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) return ANIM_STATE_RUNNING; } -void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action) +static void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, + int action) { struct GlobalAnimPartControlInfo *part; struct GraphicInfo *c = &anim->control_info; @@ -1431,7 +1433,7 @@ void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action) anim->last_active_part_nr = active_part_nr; } -void HandleGlobalAnim_Mode(struct GlobalAnimControlInfo *ctrl, int action) +static void HandleGlobalAnim_Mode(struct GlobalAnimControlInfo *ctrl, int action) { int i; diff --git a/src/editor.c b/src/editor.c index 3c03f132..2a34d4c3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5457,7 +5457,7 @@ static char *getElementDescriptionFilenameExt(char *basename) return NULL; } -char *getElementDescriptionFilename(int element) +static char *getElementDescriptionFilename(int element) { char basename[MAX_FILENAME_LEN]; char *filename; @@ -6035,8 +6035,8 @@ static void ScrollEditorLevel(int from_x, int from_y, int scroll) BackToFront(); } -void getEditorGraphicSource(int element, int tile_size, Bitmap **bitmap, - int *x, int *y) +static void getEditorGraphicSource(int element, int tile_size, Bitmap **bitmap, + int *x, int *y) { getSizedGraphicSource(el2edimg(element), 0, tile_size, bitmap, x, y); } @@ -8308,7 +8308,7 @@ static void CopyElementPropertiesToGame(int element) CopyClassicElementPropertiesToGame(element); } -void CheckElementDescriptions(void) +static void CheckElementDescriptions(void) { int i; @@ -8338,7 +8338,7 @@ static int getMaxEdFieldY(boolean has_scrollbar) return max_ed_fieldy; } -void InitZoomLevelSettings(int zoom_tilesize) +static void InitZoomLevelSettings(int zoom_tilesize) { static int last_game_engine_type = GAME_ENGINE_TYPE_UNKNOWN; @@ -8448,7 +8448,7 @@ static boolean useEditorDoorAnimation(void) return (door_1_viewport_unchanged && door_1_contains_toolbox); } -void DrawEditorDoorContent(void) +static void DrawEditorDoorContent(void) { /* needed for gadgets drawn on background (like palette scrollbar) */ SetDoorBackgroundImage(IMG_UNDEFINED); @@ -12284,7 +12284,7 @@ static void RandomPlacement(int new_element) CopyLevelToUndoBuffer(UNDO_IMMEDIATE); } -void WrapLevel(int dx, int dy) +static void WrapLevel(int dx, int dy) { int wrap_dx = lev_fieldx - dx; int wrap_dy = lev_fieldy - dy; diff --git a/src/events.c b/src/events.c index 036f8a07..417d149b 100644 --- a/src/events.c +++ b/src/events.c @@ -164,7 +164,7 @@ boolean NextValidEvent(Event *event) return FALSE; } -void HandleEvents(void) +static void HandleEvents(void) { Event event; unsigned int event_frame_delay = 0; @@ -283,7 +283,7 @@ void HandleOtherEvents(Event *event) } } -void HandleMouseCursor(void) +static void HandleMouseCursor(void) { if (game_status == GAME_MODE_TITLE) { @@ -394,7 +394,7 @@ void ClearEventQueue(void) } } -void ClearPlayerMouseAction(void) +static void ClearPlayerMouseAction(void) { local_player->mouse_action.lx = 0; local_player->mouse_action.ly = 0; @@ -414,7 +414,7 @@ void ClearPlayerAction(void) ClearPlayerMouseAction(); } -void SetPlayerMouseAction(int mx, int my, int button) +static void SetPlayerMouseAction(int mx, int my, int button) { int lx = getLevelFromScreenX(mx); int ly = getLevelFromScreenY(my); @@ -693,7 +693,7 @@ static struct Key key; } touch_info[NUM_TOUCH_FINGERS]; -void HandleFingerEvent_VirtualButtons(FingerEvent *event) +static void HandleFingerEvent_VirtualButtons(FingerEvent *event) { #if 1 int x = event->x * overlay.grid_xsize; @@ -853,7 +853,7 @@ void HandleFingerEvent_VirtualButtons(FingerEvent *event) } } -void HandleFingerEvent_WipeGestures(FingerEvent *event) +static void HandleFingerEvent_WipeGestures(FingerEvent *event) { static Key motion_key_x = KSYM_UNDEFINED; static Key motion_key_y = KSYM_UNDEFINED; diff --git a/src/files.c b/src/files.c index 29847d96..4ca23663 100644 --- a/src/files.c +++ b/src/files.c @@ -2311,7 +2311,7 @@ static void copyLevelFileInfo(struct LevelFileInfo *lfi_from, /* functions for loading R'n'D level */ /* ------------------------------------------------------------------------- */ -int getMappedElement(int element) +static int getMappedElement(int element) { /* remap some (historic, now obsolete) elements */ @@ -2362,7 +2362,7 @@ int getMappedElement(int element) return element; } -int getMappedElementByVersion(int element, int game_version) +static int getMappedElementByVersion(int element, int game_version) { /* remap some elements due to certain game version */ @@ -3484,7 +3484,7 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, /* functions for loading EM level */ /* ------------------------------------------------------------------------- */ -void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) +static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) { static int ball_xy[8][2] = { @@ -3612,7 +3612,7 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) } } -void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) +static void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) { static int ball_xy[8][2] = { @@ -3713,7 +3713,7 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) /* functions for loading SP level */ /* ------------------------------------------------------------------------- */ -void CopyNativeLevel_RND_to_SP(struct LevelInfo *level) +static void CopyNativeLevel_RND_to_SP(struct LevelInfo *level) { struct LevelInfo_SP *level_sp = level->native_sp_level; LevelInfoType *header = &level_sp->header; @@ -3797,7 +3797,7 @@ void CopyNativeLevel_RND_to_SP(struct LevelInfo *level) } } -void CopyNativeLevel_SP_to_RND(struct LevelInfo *level) +static void CopyNativeLevel_SP_to_RND(struct LevelInfo *level) { struct LevelInfo_SP *level_sp = level->native_sp_level; LevelInfoType *header = &level_sp->header; @@ -4010,7 +4010,7 @@ static void CopyNativeTape_SP_to_RND(struct LevelInfo *level) /* functions for loading MM level */ /* ------------------------------------------------------------------------- */ -void CopyNativeLevel_RND_to_MM(struct LevelInfo *level) +static void CopyNativeLevel_RND_to_MM(struct LevelInfo *level) { struct LevelInfo_MM *level_mm = level->native_mm_level; int x, y; @@ -4047,7 +4047,7 @@ void CopyNativeLevel_RND_to_MM(struct LevelInfo *level) level_mm->field[x][y] = map_element_RND_to_MM(level->field[x][y]); } -void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) +static void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) { struct LevelInfo_MM *level_mm = level->native_mm_level; int x, y; @@ -4093,7 +4093,8 @@ void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) #define DC_LEVEL_HEADER_SIZE 344 -unsigned short getDecodedWord_DC(unsigned short data_encoded, boolean init) +static unsigned short getDecodedWord_DC(unsigned short data_encoded, + boolean init) { static int last_data_encoded; static int offset1; @@ -4132,7 +4133,7 @@ unsigned short getDecodedWord_DC(unsigned short data_encoded, boolean init) return data_decoded; } -int getMappedElement_DC(int element) +static int getMappedElement_DC(int element) { switch (element) { @@ -7784,7 +7785,7 @@ static int LoadTape_BODY(File *file, int chunk_size, struct TapeInfo *tape) return chunk_size; } -void LoadTape_SokobanSolution(char *filename) +static void LoadTape_SokobanSolution(char *filename) { File *file; int move_delay = TILESIZE / level.initial_player_stepsize[0]; @@ -10604,8 +10605,8 @@ void LoadMusicInfo(void) } } -void add_helpanim_entry(int element, int action, int direction, int delay, - int *num_list_entries) +static void add_helpanim_entry(int element, int action, int direction, + int delay, int *num_list_entries) { struct HelpAnimInfo *new_list_entry; (*num_list_entries)++; @@ -10621,7 +10622,7 @@ void add_helpanim_entry(int element, int action, int direction, int delay, new_list_entry->delay = delay; } -void print_unknown_token(char *filename, char *token, int token_nr) +static void print_unknown_token(char *filename, char *token, int token_nr) { if (token_nr == 0) { @@ -10633,7 +10634,7 @@ void print_unknown_token(char *filename, char *token, int token_nr) Error(ERR_INFO, "- token: '%s'", token); } -void print_unknown_token_end(int token_nr) +static void print_unknown_token_end(int token_nr) { if (token_nr > 0) Error(ERR_INFO_LINE, "-"); diff --git a/src/game.c b/src/game.c index 50cc34f2..70b9b811 100644 --- a/src/game.c +++ b/src/game.c @@ -2103,7 +2103,7 @@ int getPlayerInventorySize(int player_nr) return stored_player[player_nr].inventory_size; } -void InitGameControlValues(void) +static void InitGameControlValues(void) { int i; @@ -2148,7 +2148,7 @@ void InitGameControlValues(void) sizeof(struct GamePanelOrderInfo), compareGamePanelOrderInfo); } -void UpdatePlayfieldElementCount(void) +static void UpdatePlayfieldElementCount(void) { boolean use_element_count = FALSE; int i, j, x, y; @@ -2176,7 +2176,7 @@ void UpdatePlayfieldElementCount(void) element_info[j].element_count; } -void UpdateGameControlValues(void) +static void UpdateGameControlValues(void) { int i, k; int time = (local_player->LevelSolved ? @@ -2507,7 +2507,7 @@ void UpdateGameControlValues(void) } } -void DisplayGameControlValues(void) +static void DisplayGameControlValues(void) { boolean redraw_panel = FALSE; int i; @@ -2767,10 +2767,12 @@ void UpdateAndDisplayGameControlValues(void) DisplayGameControlValues(); } -void UpdateGameDoorValues(void) +#if 0 +static void UpdateGameDoorValues(void) { UpdateGameControlValues(); } +#endif void DrawGameDoorValues(void) { @@ -3243,7 +3245,8 @@ static void InitGameEngine(void) level.time = 0; } -int get_num_special_action(int element, int action_first, int action_last) +static int get_num_special_action(int element, int action_first, + int action_last) { int num_special_action = 0; int i, j; @@ -4873,7 +4876,7 @@ static void ResetRandomAnimationValue(int x, int y) GfxRandom[x][y] = INIT_GFX_RANDOM(); } -void InitMovingField(int x, int y, int direction) +static void InitMovingField(int x, int y, int direction) { int element = Feld[x][y]; int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); @@ -4946,7 +4949,7 @@ void Blocked2Moving(int x, int y, int *comes_from_x, int *comes_from_y) *comes_from_y = oldy; } -int MovingOrBlocked2Element(int x, int y) +static int MovingOrBlocked2Element(int x, int y) { int element = Feld[x][y]; @@ -5004,7 +5007,7 @@ static void RemoveField(int x, int y) GfxDir[x][y] = MV_NONE; } -void RemoveMovingField(int x, int y) +static void RemoveMovingField(int x, int y) { int oldx = x, oldy = y, newx = x, newy = y; int element = Feld[x][y]; @@ -5085,7 +5088,7 @@ void DrawDynamite(int x, int y) DrawGraphic(sx, sy, graphic, frame); } -void CheckDynamite(int x, int y) +static void CheckDynamite(int x, int y) { if (MovDelay[x][y] != 0) /* dynamite is still waiting to explode */ { @@ -5155,8 +5158,8 @@ static void setScreenCenteredToAllPlayers(int *sx, int *sy) *sy = (sy1 + sy2) / 2; } -void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, - boolean center_screen, boolean quick_relocation) +static void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, + boolean center_screen, boolean quick_relocation) { unsigned int frame_delay_value_old = GetVideoFrameDelay(); boolean ffwd_delay = (tape.playing && tape.fast_forward); @@ -5246,7 +5249,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, SetVideoFrameDelay(frame_delay_value_old); } -void RelocatePlayer(int jx, int jy, int el_player_raw) +static void RelocatePlayer(int jx, int jy, int el_player_raw) { int el_player = GET_PLAYER_ELEMENT(el_player_raw); int player_nr = GET_PLAYER_NR(el_player); @@ -5351,7 +5354,7 @@ void RelocatePlayer(int jx, int jy, int el_player_raw) } } -void Explode(int ex, int ey, int phase, int mode) +static void Explode(int ex, int ey, int phase, int mode) { int x, y; int last_phase; @@ -5654,7 +5657,7 @@ void Explode(int ex, int ey, int phase, int mode) } } -void DynaExplode(int ex, int ey) +static void DynaExplode(int ex, int ey) { int i, j; int dynabomb_element = Feld[ex][ey]; @@ -5779,7 +5782,7 @@ void Bang(int x, int y) CheckTriggeredElementChange(x, y, element, CE_EXPLOSION_OF_X); } -void SplashAcid(int x, int y) +static void SplashAcid(int x, int y) { if (IN_LEV_FIELD(x - 1, y - 1) && IS_FREE(x - 1, y - 1) && (!IN_LEV_FIELD(x - 1, y - 2) || @@ -6231,7 +6234,7 @@ static void ActivateTimegateSwitch(int x, int y) EL_DC_TIMEGATE_SWITCH_ACTIVE); } -void Impact(int x, int y) +static void Impact(int x, int y) { boolean last_line = (y == lev_fieldy - 1); boolean object_hit = FALSE; @@ -7335,7 +7338,7 @@ static boolean JustBeingPushed(int x, int y) return FALSE; } -void StartMoving(int x, int y) +static void StartMoving(int x, int y) { boolean started_moving = FALSE; /* some elements can fall _and_ move */ int element = Feld[x][y]; @@ -8514,7 +8517,7 @@ int AmoebeNachbarNr(int ax, int ay) return group_nr; } -void AmoebenVereinigen(int ax, int ay) +static void AmoebenVereinigen(int ax, int ay) { int i, x, y, xx, yy; int new_group_nr = AmoebaNr[ax][ay]; @@ -8621,7 +8624,7 @@ void AmoebeUmwandeln(int ax, int ay) } } -void AmoebeUmwandelnBD(int ax, int ay, int new_element) +static void AmoebeUmwandelnBD(int ax, int ay, int new_element) { int x, y; int group_nr = AmoebaNr[ax][ay]; @@ -8657,7 +8660,7 @@ void AmoebeUmwandelnBD(int ax, int ay, int new_element) SND_BD_AMOEBA_TURNING_TO_GEM)); } -void AmoebeWaechst(int x, int y) +static void AmoebeWaechst(int x, int y) { static unsigned int sound_delay = 0; static unsigned int sound_delay_value = 0; @@ -8693,7 +8696,7 @@ void AmoebeWaechst(int x, int y) } } -void AmoebaDisappearing(int x, int y) +static void AmoebaDisappearing(int x, int y) { static unsigned int sound_delay = 0; static unsigned int sound_delay_value = 0; @@ -8729,7 +8732,7 @@ void AmoebaDisappearing(int x, int y) } } -void AmoebeAbleger(int ax, int ay) +static void AmoebeAbleger(int ax, int ay) { int i; int element = Feld[ax][ay]; @@ -8884,7 +8887,7 @@ void AmoebeAbleger(int ax, int ay) TEST_DrawLevelField(newax, neway); } -void Life(int ax, int ay) +static void Life(int ax, int ay) { int x1, y1, x2, y2; int life_time = 40; @@ -9031,7 +9034,7 @@ static void ActivateMagicBall(int bx, int by) game.ball_content_nr = (game.ball_content_nr + 1) % level.num_ball_contents; } -void CheckExit(int x, int y) +static void CheckExit(int x, int y) { if (local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || @@ -9054,7 +9057,7 @@ void CheckExit(int x, int y) PlayLevelSoundNearest(x, y, SND_CLASS_EXIT_OPENING); } -void CheckExitEM(int x, int y) +static void CheckExitEM(int x, int y) { if (local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || @@ -9077,7 +9080,7 @@ void CheckExitEM(int x, int y) PlayLevelSoundNearest(x, y, SND_CLASS_EM_EXIT_OPENING); } -void CheckExitSteel(int x, int y) +static void CheckExitSteel(int x, int y) { if (local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || @@ -9100,7 +9103,7 @@ void CheckExitSteel(int x, int y) PlayLevelSoundNearest(x, y, SND_CLASS_STEEL_EXIT_OPENING); } -void CheckExitSteelEM(int x, int y) +static void CheckExitSteelEM(int x, int y) { if (local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || @@ -9123,7 +9126,7 @@ void CheckExitSteelEM(int x, int y) PlayLevelSoundNearest(x, y, SND_CLASS_EM_STEEL_EXIT_OPENING); } -void CheckExitSP(int x, int y) +static void CheckExitSP(int x, int y) { if (local_player->gems_still_needed > 0) { @@ -9161,7 +9164,7 @@ static void CloseAllOpenTimegates(void) } } -void DrawTwinkleOnField(int x, int y) +static void DrawTwinkleOnField(int x, int y) { if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y)) return; @@ -9188,7 +9191,7 @@ void DrawTwinkleOnField(int x, int y) } } -void MauerWaechst(int x, int y) +static void MauerWaechst(int x, int y) { int delay = 6; @@ -9238,7 +9241,7 @@ void MauerWaechst(int x, int y) } } -void MauerAbleger(int ax, int ay) +static void MauerAbleger(int ax, int ay) { int element = Feld[ax][ay]; int graphic = el2img(element); @@ -9346,7 +9349,7 @@ void MauerAbleger(int ax, int ay) PlayLevelSoundAction(ax, ay, ACTION_GROWING); } -void MauerAblegerStahl(int ax, int ay) +static void MauerAblegerStahl(int ax, int ay) { int element = Feld[ax][ay]; int graphic = el2img(element); @@ -9448,7 +9451,7 @@ void MauerAblegerStahl(int ax, int ay) PlayLevelSoundAction(ax, ay, ACTION_GROWING); } -void CheckForDragon(int x, int y) +static void CheckForDragon(int x, int y) { int i, j; boolean dragon_found = FALSE; @@ -11243,7 +11246,7 @@ void StartGameActions(boolean init_network_game, boolean record_tape, InitGame(); } -void GameActionsExt(void) +static void GameActionsExt(void) { #if 0 static unsigned int game_frame_delay = 0; @@ -15108,7 +15111,7 @@ void FreeEngineSnapshotList(void) FreeSnapshotList(); } -ListNode *SaveEngineSnapshotBuffers(void) +static ListNode *SaveEngineSnapshotBuffers(void) { ListNode *buffers = NULL; @@ -15264,7 +15267,7 @@ void SaveEngineSnapshotToListInitial(void) SaveEngineSnapshotToList(); } -void LoadEngineSnapshotValues(void) +static void LoadEngineSnapshotValues(void) { /* restore special values from snapshot structure */ @@ -15285,14 +15288,14 @@ void LoadEngineSnapshotSingle(void) LoadEngineSnapshotValues(); } -void LoadEngineSnapshot_Undo(int steps) +static void LoadEngineSnapshot_Undo(int steps) { LoadSnapshotFromList_Older(steps); LoadEngineSnapshotValues(); } -void LoadEngineSnapshot_Redo(int steps) +static void LoadEngineSnapshot_Redo(int steps) { LoadSnapshotFromList_Newer(steps); @@ -15570,7 +15573,7 @@ void UnmapUndoRedoButtons(void) ModifyGadget(game_gadget[GAME_CTRL_ID_PAUSE2], GDI_CHECKED, FALSE, GDI_END); } -void MapGameButtonsExt(boolean on_tape) +static void MapGameButtonsExt(boolean on_tape) { int i; @@ -15585,7 +15588,7 @@ void MapGameButtonsExt(boolean on_tape) RedrawGameButtons(); } -void UnmapGameButtonsExt(boolean on_tape) +static void UnmapGameButtonsExt(boolean on_tape) { int i; @@ -15594,7 +15597,7 @@ void UnmapGameButtonsExt(boolean on_tape) UnmapGadget(game_gadget[i]); } -void RedrawGameButtonsExt(boolean on_tape) +static void RedrawGameButtonsExt(boolean on_tape) { int i; @@ -15606,7 +15609,7 @@ void RedrawGameButtonsExt(boolean on_tape) redraw_mask &= ~REDRAW_ALL; } -void SetGadgetState(struct GadgetInfo *gi, boolean state) +static void SetGadgetState(struct GadgetInfo *gi, boolean state) { if (gi == NULL) return; @@ -15614,7 +15617,7 @@ void SetGadgetState(struct GadgetInfo *gi, boolean state) gi->checked = state; } -void RedrawSoundButtonGadget(int id) +static void RedrawSoundButtonGadget(int id) { int id2 = (id == SOUND_CTRL_ID_MUSIC ? SOUND_CTRL_ID_PANEL_MUSIC : id == SOUND_CTRL_ID_LOOPS ? SOUND_CTRL_ID_PANEL_LOOPS : @@ -15658,7 +15661,7 @@ void RedrawGameButtonsOnTape(void) RedrawGameButtonsExt(TRUE); } -void GameUndoRedoExt(void) +static void GameUndoRedoExt(void) { ClearPlayerAction(); @@ -15675,7 +15678,7 @@ void GameUndoRedoExt(void) BackToFront(); } -void GameUndo(int steps) +static void GameUndo(int steps) { if (!CheckEngineSnapshotList()) return; @@ -15685,7 +15688,7 @@ void GameUndo(int steps) GameUndoRedoExt(); } -void GameRedo(int steps) +static void GameRedo(int steps) { if (!CheckEngineSnapshotList()) return; diff --git a/src/game_em/export.h b/src/game_em/export.h index d0056ca9..400bdc6f 100644 --- a/src/game_em/export.h +++ b/src/game_em/export.h @@ -757,4 +757,9 @@ extern void RedrawPlayfield_EM(boolean); extern void LoadEngineSnapshotValues_EM(void); extern void SaveEngineSnapshotValues_EM(void); +extern boolean checkIfAllPlayersFitToScreen(void); + +extern void tab_generate(void); +extern void tab_generate_graphics_info_em(void); + #endif /* EXPORT_H */ diff --git a/src/game_em/init.c b/src/game_em/init.c index 699e4b69..5f8ea918 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -24,9 +24,6 @@ struct GameInfo_EM game_em; char *progname; char *arg_basedir; -extern void tab_generate(void); -extern void tab_generate_graphics_info_em(void); - int open_all(void) { Bitmap *emc_bitmaps[2]; diff --git a/src/game_em/input.c b/src/game_em/input.c index 27814ee8..1e641bcf 100644 --- a/src/game_em/input.c +++ b/src/game_em/input.c @@ -67,7 +67,7 @@ void InitGameEngine_EM(void) RedrawPlayfield_EM(FALSE); } -void UpdateGameDoorValues_EM(void) +static void UpdateGameDoorValues_EM(void) { } diff --git a/src/game_em/synchro_1.c b/src/game_em/synchro_1.c index 475fea1c..cea29bb2 100644 --- a/src/game_em/synchro_1.c +++ b/src/game_em/synchro_1.c @@ -10,8 +10,6 @@ #define USE_CHANGED_ACID_STUFF 1 -extern boolean checkIfAllPlayersFitToScreen(void); - static void check_player(struct PLAYER *); static void kill_player(struct PLAYER *); static boolean player_digfield(struct PLAYER *, int, int); diff --git a/src/game_em/tab_generate.c b/src/game_em/tab_generate.c index c9b950e1..7fe7bc24 100644 --- a/src/game_em/tab_generate.c +++ b/src/game_em/tab_generate.c @@ -4438,7 +4438,7 @@ struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8]; /* map player number, frames and action to graphic info */ struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8]; -void create_tab(int *invert, unsigned char *array) +static void create_tab(int *invert, unsigned char *array) { int i; int buffer[TILE_MAX]; @@ -4453,7 +4453,7 @@ void create_tab(int *invert, unsigned char *array) array[i] = buffer[i]; } -void create_explode(void) +static void create_explode(void) { int i; int *tile = tile_explode; @@ -4476,7 +4476,7 @@ void create_explode(void) tab_explode_dynamite[i] = buffer[i]; } -void create_obj(void) +static void create_obj(void) { int i, j; int *map = obj_map; @@ -4507,7 +4507,7 @@ void create_obj(void) map_obj[i][j] = buffer[7 - i][j]; } -void create_obj_graphics_info_em(void) +static void create_obj_graphics_info_em(void) { int i, j; @@ -4543,7 +4543,7 @@ void create_obj_graphics_info_em(void) } } -void create_spr(void) +static void create_spr(void) { int i, j, k; int *map = spr_map; @@ -4564,7 +4564,7 @@ void create_spr(void) map_spr[i][j][k] = buffer[i][7 - j][k]; } -void create_spr_graphics_info_em(void) +static void create_spr_graphics_info_em(void) { int i, j, k; diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index ce811d88..00da7f4f 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -778,7 +778,7 @@ void AddDamagedField(int ex, int ey) laser.num_damages++; } -boolean StepBehind(void) +static boolean StepBehind(void) { if (laser.num_edges) { @@ -805,7 +805,7 @@ static int getMaskFromElement(int element) return IMG_MM_MASK_CIRCLE; } -int ScanPixel(void) +static int ScanPixel(void) { int hit_mask = 0; @@ -1069,7 +1069,7 @@ void ScanLaser(void) #endif } -void DrawLaserExt(int start_edge, int num_edges, int mode) +static void DrawLaserExt(int start_edge, int num_edges, int mode) { int element; int elx, ely; @@ -2286,7 +2286,7 @@ boolean HitAbsorbingWalls(int element, int hit_mask) return TRUE; } -void OpenExit(int x, int y) +static void OpenExit(int x, int y) { int delay = 6; @@ -2311,7 +2311,7 @@ void OpenExit(int x, int y) } } -void OpenSurpriseBall(int x, int y) +static void OpenSurpriseBall(int x, int y) { int delay = 2; @@ -2348,7 +2348,7 @@ void OpenSurpriseBall(int x, int y) } } -void MeltIce(int x, int y) +static void MeltIce(int x, int y) { int frames = 5; int delay = 5; @@ -2397,7 +2397,7 @@ void MeltIce(int x, int y) } } -void GrowAmoeba(int x, int y) +static void GrowAmoeba(int x, int y) { int frames = 5; int delay = 1; @@ -2959,7 +2959,7 @@ void RotateMirror(int x, int y, int button) } } -void AutoRotateMirrors(void) +static void AutoRotateMirrors(void) { int x, y; diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 54c25728..47c4af12 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -127,10 +127,12 @@ void DrawMiniGraphic_MM(int x, int y, int graphic) MarkTileDirty(x / 2, y / 2); } -void getMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) +#if 0 +static void getMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { getSizedGraphicSource(graphic, 0, TILESIZE / 4, bitmap, x, y); } +#endif void DrawMiniGraphicExt_MM(DrawBuffer *d, int x, int y, int graphic) { @@ -551,7 +553,8 @@ void DrawElement_MM(int x, int y, int element) DrawGraphic_MM(x, y, el2gfx(element)); } -void DrawMicroWalls_MM(int x, int y, int element) +#if 0 +static void DrawMicroWalls_MM(int x, int y, int element) { Bitmap *bitmap; int graphic = el2gfx(WALL_BASE(element)); @@ -572,7 +575,7 @@ void DrawMicroWalls_MM(int x, int y, int element) } } -void DrawMicroElement_MM(int x, int y, int element) +static void DrawMicroElement_MM(int x, int y, int element) { Bitmap *bitmap; int graphic = el2gfx(element); @@ -594,7 +597,7 @@ void DrawMicroElement_MM(int x, int y, int element) MICROLEV_XPOS + x * MICRO_TILEX, MICROLEV_YPOS + y * MICRO_TILEY); } -void DrawMicroLevelExt_MM(int xpos, int ypos) +static void DrawMicroLevelExt_MM(int xpos, int ypos) { int x, y; @@ -606,6 +609,7 @@ void DrawMicroLevelExt_MM(int xpos, int ypos) redraw_mask |= REDRAW_FIELD; } +#endif void DrawMiniLevel_MM(int size_x, int size_y, int scroll_x, int scroll_y) { @@ -618,7 +622,8 @@ void DrawMiniLevel_MM(int size_x, int size_y, int scroll_x, int scroll_y) redraw_mask |= REDRAW_FIELD; } -int REQ_in_range(int x, int y) +#if 0 +static int REQ_in_range(int x, int y) { if (y > DY + 249 && y < DY + 278) { @@ -630,6 +635,7 @@ int REQ_in_range(int x, int y) return 0; } +#endif Pixel ReadPixel(DrawBuffer *bitmap, int x, int y) { diff --git a/src/game_sp/file.c b/src/game_sp/file.c index d6d62c7b..8467cbf0 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -7,7 +7,7 @@ /* functions for loading Supaplex level */ /* ------------------------------------------------------------------------- */ -void setTapeInfoToDefaults_SP(void) +static void setTapeInfoToDefaults_SP(void) { native_sp_level.demo.is_available = FALSE; native_sp_level.demo.length = 0; diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 7aafb996..9e5ff836 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -64,7 +64,7 @@ void RedrawPlayfield_SP(boolean force_redraw) UpdatePlayfield(force_redraw); } -void UpdateGameDoorValues_SP(void) +static void UpdateGameDoorValues_SP(void) { game_sp.time_played = TimerVar / FRAMES_PER_SECOND; game_sp.infotrons_still_needed = InfotronsNeeded; diff --git a/src/init.c b/src/init.c index c1faec09..5fc105b6 100644 --- a/src/init.c +++ b/src/init.c @@ -88,7 +88,7 @@ static int copy_properties[][5] = static int get_graphic_parameter_value(char *, char *, int); -void DrawInitAnim(void) +static void DrawInitAnim(void) { struct GraphicInfo *graphic_info_last = graphic_info; int graphic = 0; @@ -136,7 +136,7 @@ void DrawInitAnim(void) FrameCounter++; } -void FreeGadgets(void) +static void FreeGadgets(void) { FreeLevelEditorGadgets(); FreeGameButtons(); @@ -171,7 +171,7 @@ inline static void InitElementSmallImagesScaledUp(int graphic) CreateImageWithSmallImages(graphic, g->scale_up_factor, g->tile_size); } -void InitElementSmallImages(void) +static void InitElementSmallImages(void) { print_timestamp_init("InitElementSmallImages"); @@ -233,7 +233,7 @@ inline static void InitScaledImagesScaledUp(int graphic) ScaleImage(graphic, g->scale_up_factor); } -void InitScaledImages(void) +static void InitScaledImages(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -248,7 +248,7 @@ void InitScaledImages(void) InitScaledImagesScaledUp(property_mapping[i].artwork_index); } -void InitBitmapPointers(void) +static void InitBitmapPointers(void) { int num_images = getImageListSize(); int i; @@ -333,7 +333,7 @@ static int getFontFromToken(char *token) return FONT_INITIAL_1; } -void InitFontGraphicInfo(void) +static void InitFontGraphicInfo(void) { static struct FontBitmapInfo *font_bitmap_info = NULL; struct PropertyMapping *property_mapping = getImageListPropertyMapping(); @@ -572,7 +572,7 @@ void InitFontGraphicInfo(void) getFontBitmapID, getFontFromToken); } -void InitGlobalAnimGraphicInfo(void) +static void InitGlobalAnimGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -644,7 +644,7 @@ void InitGlobalAnimGraphicInfo(void) #endif } -void InitGlobalAnimSoundInfo(void) +static void InitGlobalAnimSoundInfo(void) { struct PropertyMapping *property_mapping = getSoundListPropertyMapping(); int num_property_mappings = getSoundListPropertyMappingSize(); @@ -693,7 +693,7 @@ void InitGlobalAnimSoundInfo(void) #endif } -void InitGlobalAnimMusicInfo(void) +static void InitGlobalAnimMusicInfo(void) { struct PropertyMapping *property_mapping = getMusicListPropertyMapping(); int num_property_mappings = getMusicListPropertyMappingSize(); @@ -742,7 +742,7 @@ void InitGlobalAnimMusicInfo(void) #endif } -void InitElementGraphicInfo(void) +static void InitElementGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -1123,7 +1123,7 @@ void InitElementGraphicInfo(void) UPDATE_BUSY_STATE(); } -void InitElementSpecialGraphicInfo(void) +static void InitElementSpecialGraphicInfo(void) { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); int num_property_mappings = getImageListPropertyMappingSize(); @@ -4874,7 +4874,7 @@ static void InitGlobal(void) global.use_envelope_request = FALSE; } -void Execute_Command(char *command) +static void Execute_Command(char *command) { int i; @@ -5321,7 +5321,7 @@ void InitGfxBuffers(void) InitGfxBuffers_SP(); } -void InitGfx(void) +static void InitGfx(void) { struct GraphicInfo *graphic_info_last = graphic_info; char *filename_font_initial = NULL; @@ -5490,7 +5490,7 @@ void InitGfx(void) init_last = init; } -void InitGfxBackground(void) +static void InitGfxBackground(void) { fieldbuffer = bitmap_db_field; SetDrawtoField(DRAW_TO_BACKBUFFER); @@ -5634,7 +5634,7 @@ static void InitArtworkDone(void) InitGlobalAnimations(); } -void InitNetworkSettings(void) +static void InitNetworkSettings(void) { InitNetworkInfo(options.network || setup.network_mode, FALSE, diff --git a/src/libgame/hash.h b/src/libgame/hash.h index 90c5896c..ff76f01a 100644 --- a/src/libgame/hash.h +++ b/src/libgame/hash.h @@ -159,7 +159,7 @@ int hashtable_insert(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ -int fnname (struct hashtable *h, keytype *k, valuetype *v) \ +static int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ return hashtable_insert(h,k,v); \ } @@ -178,7 +178,7 @@ int hashtable_change(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_CHANGE(fnname, keytype, valuetype) \ -int fnname (struct hashtable *h, keytype *k, valuetype *v) \ +static int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ return hashtable_change(h,k,v); \ } @@ -196,7 +196,7 @@ void * hashtable_search(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ -valuetype * fnname (struct hashtable *h, keytype *k) \ +static valuetype * fnname (struct hashtable *h, keytype *k) \ { \ return (valuetype *) (hashtable_search(h,k)); \ } @@ -214,7 +214,7 @@ void * /* returns value */ hashtable_remove(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \ -valuetype * fnname (struct hashtable *h, keytype *k) \ +static valuetype * fnname (struct hashtable *h, keytype *k) \ { \ return (valuetype *) (hashtable_remove(h,k)); \ } diff --git a/src/libgame/image.c b/src/libgame/image.c index 60c06082..3d959cba 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -370,7 +370,7 @@ void CreateImageTextures(int pos) img_info->contains_textures = TRUE; } -void FreeImageTextures(int pos) +static void FreeImageTextures(int pos) { ImageInfo *img_info = getImageInfoEntryFromImageID(pos); diff --git a/src/libgame/joystick.c b/src/libgame/joystick.c index 109ea9ea..f092c11d 100644 --- a/src/libgame/joystick.c +++ b/src/libgame/joystick.c @@ -24,7 +24,7 @@ #define TRANSLATE_JOYSYMBOL_TO_JOYNAME 0 #define TRANSLATE_JOYNAME_TO_JOYSYMBOL 1 -void translate_joyname(int *joysymbol, char **name, int mode) +static void translate_joyname(int *joysymbol, char **name, int mode) { static struct { @@ -249,7 +249,7 @@ int Joystick(int player_nr) return JoystickExt(player_nr, FALSE); } -int JoystickButtonExt(int player_nr, boolean use_as_joystick_nr) +static int JoystickButtonExt(int player_nr, boolean use_as_joystick_nr) { static int last_joy_button[MAX_PLAYERS] = { 0, 0, 0, 0 }; int joy_button = (JoystickExt(player_nr, use_as_joystick_nr) & JOY_BUTTON); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 48fd6e12..e4939b19 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1507,7 +1507,7 @@ void WriteUnusedBytesToFile(FILE *file, unsigned int bytes) #define TRANSLATE_KEYNAME_TO_KEYSYM 2 #define TRANSLATE_X11KEYNAME_TO_KEYSYM 3 -void translate_keyname(Key *keysym, char **x11name, char **name, int mode) +static void translate_keyname(Key *keysym, char **x11name, char **name, int mode) { static struct { @@ -2145,7 +2145,8 @@ int getNumNodes(ListNode *node_first) return (node_first ? 1 + getNumNodes(node_first->next) : 0); } -void dumpList(ListNode *node_first) +#if 0 +static void dumpList(ListNode *node_first) { ListNode *node = node_first; @@ -2158,6 +2159,7 @@ void dumpList(ListNode *node_first) printf("[%d nodes]\n", getNumNodes(node_first)); } +#endif /* ------------------------------------------------------------------------- */ @@ -2544,7 +2546,8 @@ boolean fileExists(char *filename) return success; } -boolean fileHasPrefix(char *basename, char *prefix) +#if 0 +static boolean fileHasPrefix(char *basename, char *prefix) { static char *basename_lower = NULL; int basename_length, prefix_length; @@ -2565,8 +2568,9 @@ boolean fileHasPrefix(char *basename, char *prefix) return FALSE; } +#endif -boolean fileHasSuffix(char *basename, char *suffix) +static boolean fileHasSuffix(char *basename, char *suffix) { static char *basename_lower = NULL; int basename_length, suffix_length; @@ -2670,7 +2674,8 @@ char *get_mapped_token(char *token) return NULL; } -char *get_special_base_token(struct ArtworkListInfo *artwork_info, char *token) +static char *get_special_base_token(struct ArtworkListInfo *artwork_info, + char *token) { /* !!! make this dynamically configurable (init.c:InitArtworkConfig) !!! */ static struct ConfigTypeInfo prefix_list[] = @@ -2768,7 +2773,7 @@ static boolean string_has_parameter(char *s, char *s_contained) return string_has_parameter(substring, s_contained); } -int get_anim_parameter_value(char *s) +static int get_anim_parameter_value(char *s) { char *pattern_1 = "click:anim_"; char *pattern_2 = ".part_"; @@ -2835,7 +2840,7 @@ int get_anim_parameter_value(char *s) return result; } -int get_anim_action_parameter_value(char *token) +static int get_anim_action_parameter_value(char *token) { int result = getImageIDFromToken(token); @@ -3968,7 +3973,7 @@ static double Counter_Microseconds(void) } #endif -char *debug_print_timestamp_get_padding(int padding_size) +static char *debug_print_timestamp_get_padding(int padding_size) { static char *padding = NULL; int max_padding_size = 100; @@ -4017,7 +4022,8 @@ void debug_print_timestamp(int counter_nr, char *message) unit); } -void debug_print_parent_only(char *format, ...) +#if 0 +static void debug_print_parent_only(char *format, ...) { if (!IS_PARENT_PROCESS()) return; @@ -4033,10 +4039,11 @@ void debug_print_parent_only(char *format, ...) printf("\n"); } } +#endif #endif /* DEBUG */ -void print_timestamp_ext(char *message, char *mode) +static void print_timestamp_ext(char *message, char *mode) { #if DEBUG_PRINT_INIT_TIMESTAMPS static char *debug_message = NULL; diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 882aa11c..a794a153 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1522,7 +1522,7 @@ Pixel SDLGetPixel(Bitmap *src_bitmap, int x, int y) /* http://www.etek.chalmers.se/~e8cal1/sge/index.html */ /* ========================================================================= */ -void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { if (x >= 0 && x <= surface->w - 1 && y >= 0 && y <= surface->h - 1) { @@ -1569,23 +1569,24 @@ void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) } } -void _PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y, - Uint8 R, Uint8 G, Uint8 B) +#if 0 +static void _PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y, + Uint8 R, Uint8 G, Uint8 B) { _PutPixel(surface, x, y, SDL_MapRGB(surface->format, R, G, B)); } -void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { *((Uint8 *)surface->pixels + y*surface->pitch + x) = color; } -void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { *((Uint16 *)surface->pixels + y*surface->pitch/2 + x) = color; } -void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { Uint8 *pix; int shift; @@ -1600,12 +1601,12 @@ void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) *(pix+shift/8) = color>>shift; } -void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { *((Uint32 *)surface->pixels + y*surface->pitch/4 + x) = color; } -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) { @@ -1626,8 +1627,9 @@ void _PutPixelX(SDL_Surface *dest,Sint16 x,Sint16 y,Uint32 color) break; } } +#endif -void sge_PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) +static void sge_PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) { if (SDL_MUSTLOCK(surface)) { @@ -1645,13 +1647,14 @@ void sge_PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color) } } -void sge_PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y, - Uint8 r, Uint8 g, Uint8 b) +#if 0 +static void sge_PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y, + Uint8 r, Uint8 g, Uint8 b) { sge_PutPixel(surface, x, y, SDL_MapRGB(surface->format, r, g, b)); } -Sint32 sge_CalcYPitch(SDL_Surface *dest, Sint16 y) +static Sint32 sge_CalcYPitch(SDL_Surface *dest, Sint16 y) { if (y >= 0 && y <= dest->h - 1) { @@ -1678,7 +1681,8 @@ Sint32 sge_CalcYPitch(SDL_Surface *dest, Sint16 y) return -1; } -void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch, Uint32 color) +static void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch, + Uint32 color) { if (x >= 0 && x <= surface->w - 1 && ypitch >= 0) { @@ -1725,8 +1729,8 @@ void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch, Uint32 color) } } -void sge_HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, - Uint32 Color) +static void sge_HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, + Uint32 Color) { SDL_Rect l; @@ -1766,13 +1770,14 @@ void sge_HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, } } -void sge_HLineRGB(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, - Uint8 R, Uint8 G, Uint8 B) +static void sge_HLineRGB(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, + Uint8 R, Uint8 G, Uint8 B) { sge_HLine(Surface, x1, x2, y, SDL_MapRGB(Surface->format, R, G, B)); } -void _HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, Uint32 Color) +static void _HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, + Uint32 Color) { SDL_Rect l; @@ -1799,8 +1804,8 @@ void _HLine(SDL_Surface *Surface, Sint16 x1, Sint16 x2, Sint16 y, Uint32 Color) SDL_FillRect(Surface, &l, Color); } -void sge_VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, - Uint32 Color) +static void sge_VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, + Uint32 Color) { SDL_Rect l; @@ -1840,13 +1845,14 @@ void sge_VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, } } -void sge_VLineRGB(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, - Uint8 R, Uint8 G, Uint8 B) +static void sge_VLineRGB(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, + Uint8 R, Uint8 G, Uint8 B) { sge_VLine(Surface, x, y1, y2, SDL_MapRGB(Surface->format, R, G, B)); } -void _VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, Uint32 Color) +static void _VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, + Uint32 Color) { SDL_Rect l; @@ -1872,11 +1878,12 @@ void _VLine(SDL_Surface *Surface, Sint16 x, Sint16 y1, Sint16 y2, Uint32 Color) SDL_FillRect(Surface, &l, Color); } +#endif -void sge_DoLine(SDL_Surface *Surface, Sint16 x1, Sint16 y1, - Sint16 x2, Sint16 y2, Uint32 Color, - void Callback(SDL_Surface *Surf, Sint16 X, Sint16 Y, - Uint32 Color)) +static void sge_DoLine(SDL_Surface *Surface, Sint16 x1, Sint16 y1, + Sint16 x2, Sint16 y2, Uint32 Color, + void Callback(SDL_Surface *Surf, Sint16 X, Sint16 Y, + Uint32 Color)) { Sint16 dx, dy, sdx, sdy, x, y, px, py; @@ -1928,14 +1935,16 @@ void sge_DoLine(SDL_Surface *Surface, Sint16 x1, Sint16 y1, } } -void sge_DoLineRGB(SDL_Surface *Surface, Sint16 X1, Sint16 Y1, - Sint16 X2, Sint16 Y2, Uint8 R, Uint8 G, Uint8 B, - void Callback(SDL_Surface *Surf, Sint16 X, Sint16 Y, - Uint32 Color)) +#if 0 +static void sge_DoLineRGB(SDL_Surface *Surface, Sint16 X1, Sint16 Y1, + Sint16 X2, Sint16 Y2, Uint8 R, Uint8 G, Uint8 B, + void Callback(SDL_Surface *Surf, Sint16 X, Sint16 Y, + Uint32 Color)) { sge_DoLine(Surface, X1, Y1, X2, Y2, SDL_MapRGB(Surface->format, R, G, B), Callback); } +#endif void sge_Line(SDL_Surface *Surface, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 Color) @@ -1956,11 +1965,13 @@ void sge_Line(SDL_Surface *Surface, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, } } -void sge_LineRGB(SDL_Surface *Surface, Sint16 x1, Sint16 y1, Sint16 x2, - Sint16 y2, Uint8 R, Uint8 G, Uint8 B) +#if 0 +static void sge_LineRGB(SDL_Surface *Surface, Sint16 x1, Sint16 y1, Sint16 x2, + Sint16 y2, Uint8 R, Uint8 G, Uint8 B) { sge_Line(Surface, x1, y1, x2, y2, SDL_MapRGB(Surface->format, R, G, B)); } +#endif void SDLPutPixel(Bitmap *dst_bitmap, int x, int y, Pixel pixel) { @@ -2031,7 +2042,7 @@ typedef struct Uint8 a; } tColorRGBA; -int zoomSurfaceRGBA_scaleDownBy2(SDL_Surface *src, SDL_Surface *dst) +static int zoomSurfaceRGBA_scaleDownBy2(SDL_Surface *src, SDL_Surface *dst) { int x, y; tColorRGBA *sp, *csp, *dp; @@ -2082,7 +2093,7 @@ int zoomSurfaceRGBA_scaleDownBy2(SDL_Surface *src, SDL_Surface *dst) return 0; } -int zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst) +static int zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst) { int x, y, *sax, *say, *csax, *csay; float sx, sy; @@ -2155,7 +2166,7 @@ int zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst) ----------------------------------------------------------------------------- */ -int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) +static int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) { Uint32 x, y, sx, sy, *sax, *say, *csax, *csay, csx, csy; Uint8 *sp, *dp, *csp; @@ -2255,7 +2266,7 @@ int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) ----------------------------------------------------------------------------- */ -SDL_Surface *zoomSurface(SDL_Surface *src, int dst_width, int dst_height) +static SDL_Surface *zoomSurface(SDL_Surface *src, int dst_width, int dst_height) { SDL_Surface *zoom_src = NULL; SDL_Surface *zoom_dst = NULL; diff --git a/src/libgame/setup.c b/src/libgame/setup.c index b7c59ffd..50060391 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -659,7 +659,7 @@ char *getLevelSetInfoFilename(void) return NULL; } -char *getLevelSetTitleMessageBasename(int nr, boolean initial) +static char *getLevelSetTitleMessageBasename(int nr, boolean initial) { static char basename[32]; @@ -1095,7 +1095,7 @@ void InitLevelSetupDirectory(char *level_subdir) createDirectory(getLevelSetupDir(level_subdir), "level setup", PERMS_PRIVATE); } -void InitCacheDirectory(void) +static void InitCacheDirectory(void) { createDirectory(getUserGameDataDir(), "user data", PERMS_PRIVATE); createDirectory(getCacheDir(), "cache data", PERMS_PRIVATE); @@ -1240,8 +1240,8 @@ TreeInfo *getTreeInfoFromIdentifier(TreeInfo *node, char *identifier) return NULL; } -TreeInfo *cloneTreeNode(TreeInfo **node_top, TreeInfo *node_parent, - TreeInfo *node, boolean skip_sets_without_levels) +static TreeInfo *cloneTreeNode(TreeInfo **node_top, TreeInfo *node_parent, + TreeInfo *node, boolean skip_sets_without_levels) { TreeInfo *node_new; @@ -1268,7 +1268,7 @@ TreeInfo *cloneTreeNode(TreeInfo **node_top, TreeInfo *node_parent, return node_new; } -void cloneTree(TreeInfo **ti_new, TreeInfo *ti, boolean skip_empty_sets) +static void cloneTree(TreeInfo **ti_new, TreeInfo *ti, boolean skip_empty_sets) { TreeInfo *ti_cloned = cloneTreeNode(ti_new, NULL, ti, skip_empty_sets); @@ -2207,7 +2207,7 @@ static boolean loadSetupFileData(void *setup_file_data, char *filename, return TRUE; } -void saveSetupFileHash(SetupFileHash *hash, char *filename) +static void saveSetupFileHash(SetupFileHash *hash, char *filename) { FILE *file; @@ -3503,8 +3503,8 @@ void LoadArtworkInfo(void) #endif } -void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node, - LevelDirTree *level_node) +static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node, + LevelDirTree *level_node) { int type = (*artwork_node)->type; diff --git a/src/libgame/snapshot.c b/src/libgame/snapshot.c index 221b9b61..599a8293 100644 --- a/src/libgame/snapshot.c +++ b/src/libgame/snapshot.c @@ -127,7 +127,7 @@ void FreeSnapshotList(void) snapshot_current = NULL; } -void ReduceSnapshotList(void) +static void ReduceSnapshotList(void) { #if DEBUG_SNAPSHOTS printf("::: (Reducing number of snapshots from %d ", diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 6f9dcaf1..9d894b3c 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -578,7 +578,7 @@ static void *Load_WAV_or_MOD(char *filename) return NULL; } -void LoadCustomMusic_NoConf(void) +static void LoadCustomMusic_NoConf(void) { static boolean draw_init_text = TRUE; /* only draw at startup */ static char *last_music_directory = NULL; diff --git a/src/libgame/system.c b/src/libgame/system.c index 0e3a2728..64f67a17 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -445,7 +445,7 @@ void SetDrawBackgroundMask(int draw_background_mask) gfx.draw_background_mask = draw_background_mask; } -void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) +static void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) { if (background_bitmap_tile != NULL) gfx.background_bitmap_mask |= mask; @@ -659,9 +659,11 @@ void ReCreateBitmap(Bitmap **bitmap, int width, int height) } } -void CloseWindow(DrawWindow *window) +#if 0 +static void CloseWindow(DrawWindow *window) { } +#endif void SetRedrawMaskFromArea(int x, int y, int width, int height) { @@ -1018,8 +1020,8 @@ void DrawSimpleWhiteLine(Bitmap *bitmap, int from_x, int from_y, SDLDrawSimpleLine(bitmap, from_x, from_y, to_x, to_y, WHITE_PIXEL); } -void DrawLine(Bitmap *bitmap, int from_x, int from_y, - int to_x, int to_y, Pixel pixel, int line_width) +static void DrawLine(Bitmap *bitmap, int from_x, int from_y, + int to_x, int to_y, Pixel pixel, int line_width) { int x, y; diff --git a/src/main.h b/src/main.h index 27441310..e051e8b3 100644 --- a/src/main.h +++ b/src/main.h @@ -24,6 +24,7 @@ #include "game_em/game_em.h" #include "game_sp/game_sp.h" #include "game_mm/game_mm.h" +#include "engines.h" #include "conf_gfx.h" /* include auto-generated data structure definitions */ #include "conf_snd.h" /* include auto-generated data structure definitions */ diff --git a/src/netserv.c b/src/netserv.c index 9bebe38d..4c09803f 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -824,7 +824,7 @@ static void Handle_OP_LEVEL_FILE(struct NetworkServerPlayerInfo *player) SendNetworkBufferToAllButOne(write_buffer, player); } -void ExitNetworkServer(int exit_value) +static void ExitNetworkServer(int exit_value) { Error(ERR_NETWORK_SERVER, "exiting network server"); diff --git a/src/network.c b/src/network.c index 226ce34c..eb2c5bd0 100644 --- a/src/network.c +++ b/src/network.c @@ -142,7 +142,7 @@ static void SendNetworkBufferToServer(struct NetworkBuffer *nb) SDLNet_TCP_Send(sfd, nb->buffer, nb->size); } -struct NetworkClientPlayerInfo *getNetworkPlayer(int player_nr) +static struct NetworkClientPlayerInfo *getNetworkPlayer(int player_nr) { struct NetworkClientPlayerInfo *player = NULL; diff --git a/src/screens.c b/src/screens.c index 12fc3bfe..33968129 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1415,13 +1415,13 @@ static void drawChooseTreeCursor(int ypos, boolean active) drawCursorExt(0, ypos, active, -1); } -void DrawHeadline(void) +static void DrawHeadline(void) { DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, main_text_title_1); DrawTextSCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, main_text_title_2); } -void DrawTitleScreenImage(int nr, boolean initial) +static void DrawTitleScreenImage(int nr, boolean initial) { int graphic = getTitleScreenGraphic(nr, initial); Bitmap *bitmap = graphic_info[graphic].bitmap; @@ -1465,7 +1465,7 @@ void DrawTitleScreenImage(int nr, boolean initial) redraw_mask = REDRAW_ALL; } -void DrawTitleScreenMessage(int nr, boolean initial) +static void DrawTitleScreenMessage(int nr, boolean initial) { char *filename = getLevelSetTitleMessageFilename(nr, initial); struct TitleMessageInfo *tmi = getTitleMessageInfo(nr, initial); @@ -1516,14 +1516,14 @@ void DrawTitleScreenMessage(int nr, boolean initial) ResetFontStatus(); } -void DrawTitleScreen(void) +static void DrawTitleScreen(void) { KeyboardAutoRepeatOff(); HandleTitleScreen(0, 0, 0, 0, MB_MENU_INITIALIZE); } -boolean CheckTitleScreen(boolean levelset_has_changed) +static boolean CheckTitleScreen(boolean levelset_has_changed) { static boolean show_title_initial = TRUE; boolean show_titlescreen = FALSE; @@ -1887,7 +1887,8 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } } -void HandleMainMenu_SelectLevel(int step, int direction, int selected_level_nr) +static void HandleMainMenu_SelectLevel(int step, int direction, + int selected_level_nr) { int old_level_nr = level_nr; int new_level_nr; @@ -2367,8 +2368,9 @@ static void DrawInfoScreen_Main(void) static void changeSetupValue(int, int, int); -void HandleMenuScreen(int mx, int my, int dx, int dy, int button, - int mode, int num_page_entries, int max_page_entries) +static void HandleMenuScreen(int mx, int my, int dx, int dy, int button, + int mode, int num_page_entries, + int max_page_entries) { static int num_page_entries_all_last[NUM_SPECIAL_GFX_ARGS][MAX_MENU_MODES]; static int choice_stores[NUM_SPECIAL_GFX_ARGS][MAX_MENU_MODES]; @@ -2885,7 +2887,7 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) TRUE, FALSE, FALSE); } -void DrawInfoScreen_TitleScreen(void) +static void DrawInfoScreen_TitleScreen(void) { SetGameStatus(GAME_MODE_TITLE); @@ -2897,7 +2899,7 @@ void HandleInfoScreen_TitleScreen(int button) HandleTitleScreen(0, 0, 0, 0, button); } -void DrawInfoScreen_Elements(void) +static void DrawInfoScreen_Elements(void) { SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_ELEMENTS); @@ -2990,7 +2992,7 @@ void HandleInfoScreen_Elements(int button) } } -void DrawInfoScreen_Music(void) +static void DrawInfoScreen_Music(void) { SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_MUSIC); @@ -3401,7 +3403,7 @@ static void DrawInfoScreen_CreditsScreen(int screen_nr) "Press any key or button for next page"); } -void DrawInfoScreen_Credits(void) +static void DrawInfoScreen_Credits(void) { SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS); @@ -3471,7 +3473,7 @@ void HandleInfoScreen_Credits(int button) } } -void DrawInfoScreen_Program(void) +static void DrawInfoScreen_Program(void) { int font_title = MENU_INFO_FONT_TITLE; int font_head = MENU_INFO_FONT_HEAD; @@ -3556,7 +3558,7 @@ void HandleInfoScreen_Program(int button) } } -void DrawInfoScreen_Version(void) +static void DrawInfoScreen_Version(void) { int font_title = MENU_INFO_FONT_TITLE; int font_head = MENU_INFO_FONT_HEAD; @@ -3753,7 +3755,7 @@ void HandleInfoScreen_Version(int button) } } -void DrawInfoScreen_LevelSet(void) +static void DrawInfoScreen_LevelSet(void) { struct TitleMessageInfo *tmi = &readme; char *filename = getLevelSetInfoFilename(); @@ -3815,7 +3817,7 @@ void DrawInfoScreen_LevelSet(void) FadeIn(REDRAW_FIELD); } -void HandleInfoScreen_LevelSet(int button) +static void HandleInfoScreen_LevelSet(int button) { if (button == MB_MENU_LEAVE) { @@ -6643,7 +6645,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) setup_mode, num_setup_info, max_setup_info); } -void DrawSetupScreen_Input(void) +static void DrawSetupScreen_Input(void) { int i; @@ -6797,7 +6799,7 @@ static void drawPlayerSetupInputInfo(int player_nr, boolean active) static int input_player_nr = 0; -void HandleSetupScreen_Input_Player(int step, int direction) +static void HandleSetupScreen_Input_Player(int step, int direction) { int old_player_nr = input_player_nr; int new_player_nr; @@ -7551,7 +7553,7 @@ void ConfigureJoystick(int player_nr) DrawSetupScreen_Input(); } -boolean ConfigureVirtualButtonsMain(void) +static boolean ConfigureVirtualButtonsMain(void) { static char *customize_step_text[] = { @@ -8333,7 +8335,7 @@ void MapScreenMenuGadgets(int screen_mask) MapGadget(screen_gadget[menubutton_info[i].gadget_id]); } -void UnmapScreenMenuGadgets(int screen_mask) +static void UnmapScreenMenuGadgets(int screen_mask) { int i; diff --git a/src/tape.c b/src/tape.c index bcec56b0..8e2f627d 100644 --- a/src/tape.c +++ b/src/tape.c @@ -349,17 +349,17 @@ void DrawVideoDisplay(unsigned int state, unsigned int value) DrawVideoDisplay_DateTime(state, value); } -void DrawVideoDisplayLabel(unsigned int state) +static void DrawVideoDisplayLabel(unsigned int state) { DrawVideoDisplay(state, VIDEO_DISPLAY_LABEL_ONLY); } -void DrawVideoDisplaySymbol(unsigned int state) +static void DrawVideoDisplaySymbol(unsigned int state) { DrawVideoDisplay(state, VIDEO_DISPLAY_SYMBOL_ONLY); } -void DrawVideoDisplayCurrentState(void) +static void DrawVideoDisplayCurrentState(void) { int state = 0; @@ -465,7 +465,7 @@ void TapeDeactivateDisplayOff(boolean redraw_display) /* tape logging functions */ /* ========================================================================= */ -void PrintTapeReplayProgress(boolean replay_finished) +static void PrintTapeReplayProgress(boolean replay_finished) { static unsigned int counter_last = -1; unsigned int counter = Counter(); diff --git a/src/tools.c b/src/tools.c index 82a58803..bccbc9ab 100644 --- a/src/tools.c +++ b/src/tools.c @@ -711,7 +711,7 @@ void BlitScreenToBitmap(Bitmap *target_bitmap) redraw_mask |= REDRAW_FIELD; } -void DrawFramesPerSecond(void) +static void DrawFramesPerSecond(void) { char text[100]; int font_nr = FONT_TEXT_2; @@ -1147,7 +1147,7 @@ void FadeSkipNextFadeOut(void) FadeExt(0, FADE_MODE_SKIP_FADE_OUT, FADE_TYPE_SKIP); } -Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic) +static Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic) { boolean redefined = getImageListEntryFromImageID(graphic)->redefined; @@ -1157,12 +1157,12 @@ Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic) graphic_info[default_graphic].bitmap); } -Bitmap *getBackgroundBitmap(int graphic) +static Bitmap *getBackgroundBitmap(int graphic) { return getBitmapFromGraphicOrDefault(graphic, IMG_BACKGROUND); } -Bitmap *getGlobalBorderBitmap(int graphic) +static Bitmap *getGlobalBorderBitmap(int graphic) { return getBitmapFromGraphicOrDefault(graphic, IMG_GLOBAL_BORDER); } @@ -1282,7 +1282,10 @@ boolean CheckIfGlobalBorderHasChanged(void) return (global_border_bitmap_last != global_border_bitmap); } -boolean CheckIfGlobalBorderRedrawIsNeeded(void) +#define ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED 0 + +#if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED +static boolean CheckIfGlobalBorderRedrawIsNeeded(void) { // if game status has not changed, nothing has to be redrawn if (game_status == game_status_last) @@ -1318,8 +1321,9 @@ boolean CheckIfGlobalBorderRedrawIsNeeded(void) return FALSE; } +#endif -void RedrawGlobalBorderFromBitmap(Bitmap *bitmap) +static void RedrawGlobalBorderFromBitmap(Bitmap *bitmap) { if (bitmap) BlitBitmap(bitmap, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); @@ -1336,8 +1340,6 @@ void RedrawGlobalBorder(void) redraw_mask = REDRAW_ALL; } -#define ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED 0 - static void RedrawGlobalBorderIfNeeded(void) { #if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED @@ -1974,8 +1976,8 @@ static void DrawGraphicShifted(int x, int y, int dx, int dy, DrawGraphicShiftedNormal(x, y, dx, dy, graphic, frame, cut_mode,mask_mode); } -void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, int graphic, - int frame, int cut_mode) +static void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, + int graphic, int frame, int cut_mode) { DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, USE_MASKING); } @@ -2627,15 +2629,15 @@ void DrawSizedWallParts_MM(int x, int y, int element, int tilesize, element, tilesize, el2edimg, masked, element_bits_draw); } -void DrawSizedWall_MM(int dst_x, int dst_y, int element, int tilesize, - int (*el2img_function)(int)) +static void DrawSizedWall_MM(int dst_x, int dst_y, int element, int tilesize, + int (*el2img_function)(int)) { DrawSizedWallExt_MM(dst_x, dst_y, element, tilesize, el2img_function, FALSE, 0x000f); } -void DrawSizedElementExt(int x, int y, int element, int tilesize, - boolean masked) +static void DrawSizedElementExt(int x, int y, int element, int tilesize, + boolean masked) { if (IS_MM_WALL(element)) { @@ -2696,9 +2698,9 @@ void DrawMiniElementOrWall(int sx, int sy, int scroll_x, int scroll_y) DrawMiniGraphic(sx, sy, el2edimg(getBorderElement(x, y))); } -void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty, - int x, int y, int xsize, int ysize, - int tile_width, int tile_height) +static void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty, + int x, int y, int xsize, int ysize, + int tile_width, int tile_height) { Bitmap *src_bitmap; int src_x, src_y; @@ -2735,8 +2737,9 @@ void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty, dst_x, dst_y); } -void DrawEnvelopeBackground(int graphic, int startx, int starty, - int x, int y, int xsize, int ysize, int font_nr) +static void DrawEnvelopeBackground(int graphic, int startx, int starty, + int x, int y, int xsize, int ysize, + int font_nr) { int font_width = getFontWidth(font_nr); int font_height = getFontHeight(font_nr); @@ -2745,7 +2748,7 @@ void DrawEnvelopeBackground(int graphic, int startx, int starty, font_width, font_height); } -void AnimateEnvelope(int envelope_nr, int anim_mode, int action) +static void AnimateEnvelope(int envelope_nr, int anim_mode, int action) { int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr; Bitmap *src_bitmap = graphic_info[graphic].bitmap; @@ -2917,7 +2920,7 @@ static void setRequestPosition(int *x, int *y, boolean add_border_size) setRequestPositionExt(x, y, request.width, request.height, add_border_size); } -void DrawEnvelopeRequest(char *text) +static void DrawEnvelopeRequest(char *text) { char *text_final = text; char *text_door_style = NULL; @@ -3004,7 +3007,7 @@ void DrawEnvelopeRequest(char *text) free(text_door_style); } -void AnimateEnvelopeRequest(int anim_mode, int action) +static void AnimateEnvelopeRequest(int anim_mode, int action) { int graphic = IMG_BACKGROUND_REQUEST; boolean draw_masked = graphic_info[graphic].draw_masked; @@ -3091,7 +3094,7 @@ void AnimateEnvelopeRequest(int anim_mode, int action) ClearAutoRepeatKeyEvents(); } -void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) +static void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) { int graphic = IMG_BACKGROUND_REQUEST; int sound_opening = SND_REQUEST_OPENING; @@ -3172,7 +3175,7 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) SetDrawtoField(DRAW_TO_FIELDBUFFER); } -void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize) +static void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize) { if (IS_MM_WALL(element)) { @@ -3510,7 +3513,7 @@ static void DrawPreviewLevelExt(boolean restart) } } -void DrawPreviewPlayers(void) +static void DrawPreviewPlayers(void) { if (game_status != GAME_MODE_MAIN) return; @@ -3612,7 +3615,7 @@ static void DrawNetworkPlayer(int x, int y, int player_nr, int tile_size, DrawText(x + xoffset_text, y + yoffset_text, player_name, font_nr); } -void DrawNetworkPlayersExt(boolean force) +static void DrawNetworkPlayersExt(boolean force) { if (game_status != GAME_MODE_MAIN) return; @@ -5070,7 +5073,7 @@ unsigned int SetDoorState(unsigned int door_state) return MoveDoor(door_state | DOOR_SET_STATE); } -int euclid(int a, int b) +static int euclid(int a, int b) { return (b ? euclid(b, a % b) : a); } @@ -8290,10 +8293,12 @@ inline static void set_crumbled_graphics_EM(struct GraphicInfo_EM *g_em, } } +#if 0 void ResetGfxAnimation_EM(int x, int y, int tile) { GfxFrame[x][y] = 0; } +#endif void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em, int tile, int frame_em, int x, int y) @@ -9039,10 +9044,10 @@ void InitGraphicInfo_EM(void) #endif } -void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame, - boolean any_player_moving, - boolean any_player_snapping, - boolean any_player_dropping) +static void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame, + boolean any_player_moving, + boolean any_player_snapping, + boolean any_player_dropping) { if (frame == 0 && !any_player_dropping) { @@ -9060,8 +9065,8 @@ void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame, } } -void CheckSaveEngineSnapshot_SP(boolean murphy_is_waiting, - boolean murphy_is_dropping) +static void CheckSaveEngineSnapshot_SP(boolean murphy_is_waiting, + boolean murphy_is_dropping) { if (murphy_is_waiting) { @@ -9079,8 +9084,8 @@ void CheckSaveEngineSnapshot_SP(boolean murphy_is_waiting, } } -void CheckSaveEngineSnapshot_MM(boolean element_clicked, - boolean button_released) +static void CheckSaveEngineSnapshot_MM(boolean element_clicked, + boolean button_released) { if (button_released) { @@ -9332,8 +9337,8 @@ void ToggleFullscreenOrChangeWindowScalingIfNeeded(void) } } -void JoinRectangles(int *x, int *y, int *width, int *height, - int x2, int y2, int width2, int height2) +static void JoinRectangles(int *x, int *y, int *width, int *height, + int x2, int y2, int width2, int height2) { // do not join with "off-screen" rectangle if (x2 == -1 || y2 == -1) -- 2.34.1