From 12a8fd3a64d6bee5ca5f5b89e4a00b49d78bbd2c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 23 Oct 2018 23:50:21 +0200 Subject: [PATCH] changed comments from old to new style (multiple-line comments) --- src/conf_gfx.c | 14 +++--- src/conf_hlp.c | 6 +-- src/conf_mus.c | 12 ++--- src/conf_snd.c | 6 +-- src/editor.c | 66 +++++++++++-------------- src/events.c | 34 +++++++------ src/files.c | 50 +++++++++---------- src/game.c | 106 ++++++++++++++++++++--------------------- src/game_mm/mm_files.c | 6 +-- src/game_mm/mm_game.c | 4 +- src/game_mm/mm_main.h | 35 +++++++------- src/game_mm/mm_tools.c | 22 ++++----- src/game_mm/mm_tools.h | 22 ++++----- src/game_sp/file.c | 26 +++++----- src/init.c | 24 +++++----- src/libgame/misc.c | 31 ++++++------ src/libgame/sdl.c | 54 +++++++++------------ src/libgame/setup.c | 10 ++-- src/libgame/system.c | 14 +++--- src/libgame/system.h | 9 ++-- src/main.c | 6 +-- src/netserv.c | 4 +- src/screens.c | 4 +- src/tape.c | 6 +-- src/tape.h | 4 +- src/tools.c | 38 +++++++-------- 26 files changed, 290 insertions(+), 323 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index dc4613a6..cc4e3fcb 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -13,9 +13,9 @@ #include "main.h" -/* List values that are not defined in the configuration file are set to - reliable default values. If that value is GFX_ARG_UNDEFINED, it will - be dynamically determined, using some of the other list values. */ +// List values that are not defined in the configuration file are set to +// reliable default values. If that value is GFX_ARG_UNDEFINED, it will +// be dynamically determined, using some of the other list values. struct ConfigTypeInfo image_config_suffix[] = { @@ -7354,8 +7354,8 @@ struct ConfigInfo image_config[] = { "door_2.top_border_correction.width", "108" }, { "door_2.top_border_correction.height", "8" }, - /* the last image entry apparently gets overwritten by very last entry - of "image_config[]"; so far this bug could not be found and fixed */ + // the last image entry apparently gets overwritten by very last entry + // of "image_config[]"; so far this bug could not be found and fixed { "last_image_entry_bug", UNDEFINED_FILENAME }, @@ -7363,8 +7363,8 @@ struct ConfigInfo image_config[] = // non-image definitions // ========================================================================== - /* the following directives are not associated with an image, but - probably make sense to be defined in "graphicsinfo.conf", too */ + // the following directives are not associated with an image, but + // probably make sense to be defined in "graphicsinfo.conf", too // keyword to start parser: "CONFIG_VARS_START" <-- do not change! diff --git a/src/conf_hlp.c b/src/conf_hlp.c index c8422e9b..9b8f9b3c 100644 --- a/src/conf_hlp.c +++ b/src/conf_hlp.c @@ -13,9 +13,9 @@ #include "main.h" -/* List values that are not defined in the configuration file are set to - reliable default values. If that value is GFX_ARG_UNDEFINED, it will - be dynamically determined, using some of the other list values. */ +// List values that are not defined in the configuration file are set to +// reliable default values. If that value is GFX_ARG_UNDEFINED, it will +// be dynamically determined, using some of the other list values. struct ConfigInfo helpanim_config[] = { diff --git a/src/conf_mus.c b/src/conf_mus.c index 5ecd0775..94aad15f 100644 --- a/src/conf_mus.c +++ b/src/conf_mus.c @@ -13,9 +13,9 @@ #include "main.h" -/* List values that are not defined in the configuration file are set to - reliable default values. If that value is MUS_ARG_UNDEFINED, it will - be dynamically determined, using some of the other list values. */ +// List values that are not defined in the configuration file are set to +// reliable default values. If that value is MUS_ARG_UNDEFINED, it will +// be dynamically determined, using some of the other list values. struct ConfigTypeInfo music_config_suffix[] = { @@ -58,9 +58,9 @@ struct ConfigInfo music_config[] = { "background.titlemessage_4", UNDEFINED_FILENAME }, { "background.titlemessage_5", UNDEFINED_FILENAME }, - /* there is no definition for "background.PLAYING", because this would - prevent selecting music from music directory that is not defined in - "musicinfo.conf", when no default music is defined here */ + // there is no definition for "background.PLAYING", because this would + // prevent selecting music from music directory that is not defined in + // "musicinfo.conf", when no default music is defined here { NULL, NULL } }; diff --git a/src/conf_snd.c b/src/conf_snd.c index 745fdffc..a3a42c86 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -13,9 +13,9 @@ #include "main.h" -/* List values that are not defined in the configuration file are set to - reliable default values. If that value is SND_ARG_UNDEFINED, it will - be dynamically determined, using some of the other list values. */ +// List values that are not defined in the configuration file are set to +// reliable default values. If that value is SND_ARG_UNDEFINED, it will +// be dynamically determined, using some of the other list values. struct ConfigTypeInfo sound_config_suffix[] = { diff --git a/src/editor.c b/src/editor.c index 6a0e6be2..7757fe51 100644 --- a/src/editor.c +++ b/src/editor.c @@ -25,11 +25,9 @@ #define INFOTEXT_UNKNOWN_ELEMENT "unknown" -/* - ----------------------------------------------------------------------------- - screen and artwork graphic pixel position definitions - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// screen and artwork graphic pixel position definitions +// ---------------------------------------------------------------------------- // values for the control window #define ED_CTRL1_BUTTONS_HORIZ 4 // toolbox @@ -354,11 +352,9 @@ SYSIZE - INFOTEXT_YSIZE) -/* - ----------------------------------------------------------------------------- - editor gadget definitions - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// editor gadget definitions +// ---------------------------------------------------------------------------- enum { @@ -1079,11 +1075,9 @@ enum #define ED_DRAWING_ID_EDITOR_LAST ED_DRAWING_ID_RANDOM_BACKGROUND -/* - ----------------------------------------------------------------------------- - some internally used definitions - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// some internally used definitions +// ---------------------------------------------------------------------------- // values for CopyLevelToUndoBuffer() #define UNDO_IMMEDIATE 0 @@ -1138,11 +1132,9 @@ enum #define DEFAULT_EDITOR_TILESIZE_MM TILESIZE -/* - ----------------------------------------------------------------------------- - some internally used data structure definitions - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// some internally used data structure definitions +// ---------------------------------------------------------------------------- static struct { @@ -1154,8 +1146,8 @@ static struct char shortcut; } controlbutton_info[ED_NUM_CTRL_BUTTONS] = { - /* note: some additional characters are already reserved for "cheat mode" - shortcuts (":XYZ" style) -- for details, see "events.c" */ + // note: some additional characters are already reserved for "cheat mode" + // shortcuts (":XYZ" style) -- for details, see "events.c" // ---------- toolbox control buttons --------------------------------------- @@ -3747,11 +3739,9 @@ static struct }; -/* - ----------------------------------------------------------------------------- - some internally used variables - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// some internally used variables +// ---------------------------------------------------------------------------- // maximal size of level editor drawing area static int MAX_ED_FIELDX, MAX_ED_FIELDY; @@ -5419,11 +5409,9 @@ editor_elements_info[] = }; -/* - ----------------------------------------------------------------------------- - functions - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// functions +// ---------------------------------------------------------------------------- static int getMaxInfoTextLength(void) { @@ -6682,9 +6670,9 @@ static void CreateSelectboxGadgets(void) if (selectbox_info[i].size == -1) // dynamically determine size { - /* (we cannot use -1 for uninitialized values if we directly compare - with results from strlen(), because the '<' and '>' operation will - implicitely cast -1 to an unsigned integer value!) */ + // (we cannot use -1 for uninitialized values if we directly compare + // with results from strlen(), because the '<' and '>' operation will + // implicitely cast -1 to an unsigned integer value!) selectbox_info[i].size = 0; for (j = 0; selectbox_info[i].options[j].text != NULL; j++) @@ -11769,8 +11757,8 @@ static void DrawArcExt(int from_x, int from_y, int to_x2, int to_y2, radius = (int)(sqrt((float)(len_x * len_x + len_y * len_y)) + 0.5); - /* not optimal (some points get drawn twice) but simple, - and fast enough for the few points we are drawing */ + // not optimal (some points get drawn twice) but simple, + // and fast enough for the few points we are drawing for (x = 0; x <= radius; x++) { @@ -13571,8 +13559,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) case GADGET_ID_SAVE: { - /* saving read-only levels into personal level set modifies global vars - "leveldir_current" and "level_nr"; restore them after saving level */ + // saving read-only levels into personal level set modifies global vars + // "leveldir_current" and "level_nr"; restore them after saving level LevelDirTree *leveldir_former = leveldir_current; int level_nr_former = level_nr; char *level_filename; diff --git a/src/events.c b/src/events.c index 5a0d5775..73624acc 100644 --- a/src/events.c +++ b/src/events.c @@ -45,12 +45,12 @@ static void HandleNoEvent(void); static void HandleEventActions(void); -/* event filter especially needed for SDL event filtering due to - delay problems with lots of mouse motion events when mouse button - not pressed (X11 can handle this with 'PointerMotionHintMask') */ +// event filter especially needed for SDL event filtering due to +// delay problems with lots of mouse motion events when mouse button +// not pressed (X11 can handle this with 'PointerMotionHintMask') -/* event filter addition for SDL2: as SDL2 does not have a function to enable - or disable keyboard auto-repeat, filter repeated keyboard events instead */ +// event filter addition for SDL2: as SDL2 does not have a function to enable +// or disable keyboard auto-repeat, filter repeated keyboard events instead static int FilterEvents(const Event *event) { @@ -106,9 +106,9 @@ static int FilterEvents(const Event *event) return 1; } -/* to prevent delay problems, skip mouse motion events if the very next - event is also a mouse motion event (and therefore effectively only - handling the last of a row of mouse motion events in the event queue) */ +// to prevent delay problems, skip mouse motion events if the very next +// event is also a mouse motion event (and therefore effectively only +// handling the last of a row of mouse motion events in the event queue) static boolean SkipPressedMouseMotionEvent(const Event *event) { @@ -238,8 +238,8 @@ void HandleOtherEvents(Event *event) case EVENT_UNMAPNOTIFY: #if 0 - /* This causes the game to stop not only when iconified, but also - when on another virtual desktop, which might be not desired. */ + // This causes the game to stop not only when iconified, but also + // when on another virtual desktop, which might be not desired. SleepWhileUnmapped(); #endif break; @@ -330,8 +330,8 @@ void EventLoop(void) // execute event related actions after pending events have been processed HandleEventActions(); - /* don't use all CPU time when idle; the main loop while playing - has its own synchronization and is CPU friendly, too */ + // don't use all CPU time when idle; the main loop while playing + // has its own synchronization and is CPU friendly, too if (game_status == GAME_MODE_PLAYING) HandleGameActions(); @@ -479,10 +479,9 @@ void SleepWhileUnmapped(void) break; case EVENT_UNMAPNOTIFY: - /* this is only to surely prevent the 'should not happen' case - * of recursively looping between 'SleepWhileUnmapped()' and - * 'HandleOtherEvents()' which usually calls this funtion. - */ + // this is only to surely prevent the 'should not happen' case + // of recursively looping between 'SleepWhileUnmapped()' and + // 'HandleOtherEvents()' which usually calls this funtion. break; default: @@ -1520,8 +1519,7 @@ void HandleFocusEvent(FocusChangeEvent *event) The effect would be keyboard auto repeat while playing the game (game_status == GAME_MODE_PLAYING), which is not desired. To avoid this special case, we just wait 1/10 second before - processing the 'FocusIn' event. - */ + processing the 'FocusIn' event. */ if (game_status == GAME_MODE_PLAYING) { diff --git a/src/files.c b/src/files.c index 37e69816..0b0c37d3 100644 --- a/src/files.c +++ b/src/files.c @@ -1906,13 +1906,13 @@ static void ActivateLevelTemplate(void) } } - /* Currently there is no special action needed to activate the template - data, because 'element_info' property settings overwrite the original - level data, while all other variables do not change. */ + // Currently there is no special action needed to activate the template + // data, because 'element_info' property settings overwrite the original + // level data, while all other variables do not change. - /* Exception: 'from_level_template' elements in the original level playfield - are overwritten with the corresponding elements at the same position in - playfield from the level template. */ + // Exception: 'from_level_template' elements in the original level playfield + // are overwritten with the corresponding elements at the same position in + // playfield from the level template. for (x = 0; x < level.fieldx; x++) for (y = 0; y < level.fieldy; y++) @@ -2018,8 +2018,8 @@ static int getFileTypeFromMagicBytes(char *filename, int type) static boolean checkForPackageFromBasename(char *basename) { - /* !!! WON'T WORK ANYMORE IF getFileTypeFromBasename() ALSO DETECTS !!! - !!! SINGLE LEVELS (CURRENTLY ONLY DETECTS LEVEL PACKAGES !!! */ + // !!! WON'T WORK ANYMORE IF getFileTypeFromBasename() ALSO DETECTS !!! + // !!! SINGLE LEVELS (CURRENTLY ONLY DETECTS LEVEL PACKAGES !!! return (getFileTypeFromBasename(basename) != LEVEL_FILE_TYPE_UNKNOWN); } @@ -2667,8 +2667,8 @@ static int LoadLevel_CUS1(File *file, int chunk_size, struct LevelInfo *level) else Error(ERR_WARN, "invalid custom element number %d", element); - /* older game versions that wrote level files with CUS1 chunks used - different default push delay values (not yet stored in level file) */ + // older game versions that wrote level files with CUS1 chunks used + // different default push delay values (not yet stored in level file) element_info[element].push_delay_fixed = 2; element_info[element].push_delay_random = 8; } @@ -3469,9 +3469,9 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, int chunk_size_expected = (chunk_info[i].loader)(file, chunk_size, level); - /* the size of some chunks cannot be checked before reading other - chunks first (like "HEAD" and "BODY") that contain some header - information, so check them here */ + // the size of some chunks cannot be checked before reading other + // chunks first (like "HEAD" and "BODY") that contain some header + // information, so check them here if (chunk_size_expected != chunk_size) { Error(ERR_WARN, "wrong size (%d) of chunk '%s' in level file '%s'", @@ -3768,8 +3768,8 @@ static void CopyNativeLevel_RND_to_SP(struct LevelInfo *level) else if (element >= EL_SP_GRAVITY_PORT_RIGHT && element <= EL_SP_GRAVITY_PORT_UP) { - /* change R'n'D style gravity inverting special port to normal port - (there are no gravity inverting ports in native Supaplex engine) */ + // change R'n'D style gravity inverting special port to normal port + // (there are no gravity inverting ports in native Supaplex engine) gravity_port_found = TRUE; gravity_port_valid = FALSE; @@ -3885,8 +3885,8 @@ static void CopyNativeLevel_SP_to_RND(struct LevelInfo *level) continue; } - /* change previous (wrong) gravity inverting special port to either - gravity enabling special port or gravity disabling special port */ + // change previous (wrong) gravity inverting special port to either + // gravity enabling special port or gravity disabling special port level->field[port_x][port_y] += (gravity == 1 ? EL_SP_GRAVITY_ON_PORT_RIGHT : EL_SP_GRAVITY_OFF_PORT_RIGHT) - EL_SP_GRAVITY_PORT_RIGHT; @@ -5718,8 +5718,8 @@ static void LoadLevelFromFileStream_DC(File *file, struct LevelInfo *level, level->extra_time = header[56] | (header[57] << 8); level->shield_normal_time = header[58] | (header[59] << 8); - /* Diamond Caves has the same (strange) behaviour as Emerald Mine that gems - can slip down from flat walls, like normal walls and steel walls */ + // Diamond Caves has the same (strange) behaviour as Emerald Mine that gems + // can slip down from flat walls, like normal walls and steel walls level->em_slippery_gems = TRUE; } @@ -6437,9 +6437,9 @@ static void LoadLevel_InitCustomElements(struct LevelInfo *level) { int i, j; - /* map custom element change events that have changed in newer versions - (these following values were accidentally changed in version 3.0.1) - (this seems to be needed only for 'ab_levelset3' and 'ab_levelset4') */ + // map custom element change events that have changed in newer versions + // (these following values were accidentally changed in version 3.0.1) + // (this seems to be needed only for 'ab_levelset3' and 'ab_levelset4') if (level->game_version <= VERSION_IDENT(3,0,0,0)) { for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) @@ -7993,9 +7993,9 @@ void LoadTapeFromFilename(char *filename) int chunk_size_expected = (chunk_info[i].loader)(file, chunk_size, &tape); - /* the size of some chunks cannot be checked before reading other - chunks first (like "HEAD" and "BODY") that contain some header - information, so check them here */ + // the size of some chunks cannot be checked before reading other + // chunks first (like "HEAD" and "BODY") that contain some header + // information, so check them here if (chunk_size_expected != chunk_size) { Error(ERR_WARN, "wrong size (%d) of chunk '%s' in tape file '%s'", diff --git a/src/game.c b/src/game.c index 0d8c032e..2eb944d2 100644 --- a/src/game.c +++ b/src/game.c @@ -2046,8 +2046,8 @@ static int get_next_dropped_element(struct PlayerInfo *player) static int get_inventory_element_from_pos(struct PlayerInfo *player, int pos) { - /* pos >= 0: get element from bottom of the stack; - pos < 0: get element from top of the stack */ + // pos >= 0: get element from bottom of the stack; + // pos < 0: get element from top of the stack if (pos < 0) { @@ -2780,13 +2780,11 @@ void DrawGameDoorValues(void) } -/* - ============================================================================= - InitGameEngine() - ----------------------------------------------------------------------------- - initialize game engine due to level / tape version number - ============================================================================= -*/ +// ============================================================================ +// InitGameEngine() +// ---------------------------------------------------------------------------- +// initialize game engine due to level / tape version number +// ============================================================================ static void InitGameEngine(void) { @@ -3270,13 +3268,11 @@ static int get_num_special_action(int element, int action_first, } -/* - ============================================================================= - InitGame() - ----------------------------------------------------------------------------- - initialize and start new game - ============================================================================= -*/ +// ============================================================================ +// InitGame() +// ---------------------------------------------------------------------------- +// initialize and start new game +// ============================================================================ #if DEBUG_INIT_PLAYER static void DebugPrintPlayerStatus(char *message) @@ -3724,8 +3720,8 @@ void InitGame(void) } else if (network.enabled) { - /* add team mode players connected over the network (needed for correct - assignment of player figures from level to locally playing players) */ + // add team mode players connected over the network (needed for correct + // assignment of player figures from level to locally playing players) for (i = 0; i < MAX_PLAYERS; i++) if (stored_player[i].connected_network) @@ -3733,8 +3729,8 @@ void InitGame(void) } else if (game.team_mode) { - /* try to guess locally connected team mode players (needed for correct - assignment of player figures from level to locally playing players) */ + // try to guess locally connected team mode players (needed for correct + // assignment of player figures from level to locally playing players) for (i = 0; i < MAX_PLAYERS; i++) if (setup.input[i].use_joystick || @@ -4006,8 +4002,8 @@ void InitGame(void) if (EVEN(SCR_FIELDY) && full_lev_fieldy > SCR_FIELDY) SBY_Upper--; - /* if local player not found, look for custom element that might create - the player (make some assumptions about the right custom element) */ + // if local player not found, look for custom element that might create + // the player (make some assumptions about the right custom element) if (!local_player->present) { int start_x = 0, start_y = 0; @@ -4893,9 +4889,9 @@ static void InitMovingField(int x, int y, int direction) is_moving_before = (WasJustMoving[x][y] != 0); is_moving_after = (getElementMoveStepsizeExt(x, y, direction) != 0); - /* reset animation only for moving elements which change direction of moving - or which just started or stopped moving - (else CEs with property "can move" / "not moving" are reset each frame) */ + // reset animation only for moving elements which change direction of moving + // or which just started or stopped moving + // (else CEs with property "can move" / "not moving" are reset each frame) if (is_moving_before != is_moving_after || direction != MovDir[x][y]) ResetGfxAnimation(x, y); @@ -4970,9 +4966,9 @@ 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, - return EL_BLOCKED instead of the element value */ + // like MovingOrBlocked2Element(), but if element is moving + // and (x,y) is the field the moving element is just leaving, + // return EL_BLOCKED instead of the element value int element = Feld[x][y]; if (IS_MOVING(x, y)) @@ -5026,9 +5022,9 @@ static void RemoveMovingField(int x, int y) if (Feld[newx][newy] != EL_BLOCKED) { - /* element is moving, but target field is not free (blocked), but - already occupied by something different (example: acid pool); - in this case, only remove the moving field, but not the target */ + // element is moving, but target field is not free (blocked), but + // already occupied by something different (example: acid pool); + // in this case, only remove the moving field, but not the target RemoveField(oldx, oldy); @@ -5493,8 +5489,8 @@ static void Explode(int ex, int ey, int phase, int mode) Store[x][y] = EL_EMPTY; } - /* !!! check this case -- currently needed for rnd_rado_negundo_v, - !!! levels 015 018 019 020 021 022 023 026 027 028 !!! */ + // !!! check this case -- currently needed for rnd_rado_negundo_v, + // !!! levels 015 018 019 020 021 022 023 026 027 028 !!! else if (ELEM_IS_PLAYER(center_element)) Store[x][y] = EL_EMPTY; else if (center_element == EL_YAMYAM) @@ -5502,9 +5498,9 @@ static void Explode(int ex, int ey, int phase, int mode) else if (element_info[center_element].content.e[xx][yy] != EL_EMPTY) Store[x][y] = element_info[center_element].content.e[xx][yy]; #if 1 - /* needed because EL_BD_BUTTERFLY is not defined as "CAN_EXPLODE" - (killing EL_BD_BUTTERFLY with dynamite would result in BD diamond - otherwise) -- FIX THIS !!! */ + // needed because EL_BD_BUTTERFLY is not defined as "CAN_EXPLODE" + // (killing EL_BD_BUTTERFLY with dynamite would result in BD diamond + // otherwise) -- FIX THIS !!! else if (!CAN_EXPLODE(element) && element != EL_BD_BUTTERFLY) Store[x][y] = element_info[element].content.e[1][1]; #else @@ -5580,9 +5576,9 @@ static void Explode(int ex, int ey, int phase, int mode) border_explosion = TRUE; } - /* if an element just explodes due to another explosion (chain-reaction), - do not immediately end the new explosion when it was the last frame of - the explosion (as it would be done in the following "if"-statement!) */ + // if an element just explodes due to another explosion (chain-reaction), + // do not immediately end the new explosion when it was the last frame of + // the explosion (as it would be done in the following "if"-statement!) if (border_explosion && phase == last_phase) return; } @@ -7781,8 +7777,8 @@ static void StartMoving(int x, int y) if (!MovDelay[x][y]) // start new movement phase { - /* all objects that can change their move direction after each step - (YAMYAM, DARK_YAMYAM and PACMAN go straight until they hit a wall */ + // all objects that can change their move direction after each step + // (YAMYAM, DARK_YAMYAM and PACMAN go straight until they hit a wall if (element != EL_YAMYAM && element != EL_DARK_YAMYAM && @@ -8729,8 +8725,8 @@ static void AmoebaDisappearing(int x, int y) Feld[x][y] = EL_EMPTY; TEST_DrawLevelField(x, y); - /* don't let mole enter this field in this cycle; - (give priority to objects falling to this field from above) */ + // don't let mole enter this field in this cycle; + // (give priority to objects falling to this field from above) Stop[x][y] = TRUE; } } @@ -10217,8 +10213,8 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change) TEST_DrawLevelFieldCrumbledNeighbours(x, y); } - /* check if element under the player changes from accessible to unaccessible - (needed for special case of dropping element which then changes) */ + // check if element under the player changes from accessible to unaccessible + // (needed for special case of dropping element which then changes) // (must be checked after creating new element for walkable group elements) if (IS_PLAYER(x, y) && !player_explosion_protected && IS_ACCESSIBLE(old_element) && !IS_ACCESSIBLE(new_element)) @@ -10253,8 +10249,8 @@ static void CreateElementFromChange(int x, int y, int element) { int old_element = Feld[x][y]; - /* prevent changed element from moving in same engine frame - unless both old and new element can either fall or move */ + // prevent changed element from moving in same engine frame + // unless both old and new element can either fall or move if ((!CAN_FALL(old_element) || !CAN_FALL(element)) && (!CAN_MOVE(old_element) || !CAN_MOVE(element))) Stop[x][y] = TRUE; @@ -10507,8 +10503,8 @@ static void HandleElementChange(int x, int y, int page) This can also be seen from the debug output for this test element.) */ - /* when a custom element is about to change (for example by change delay), - do not reset graphic animation when the custom element is moving */ + // when a custom element is about to change (for example by change delay), + // do not reset graphic animation when the custom element is moving if (game.graphics_engine_version < 4 && !IS_MOVING(x, y)) { @@ -10629,9 +10625,9 @@ static boolean CheckTriggeredElementChangeExt(int trigger_x, int trigger_y, { if (change->can_change && !change_done) { - /* if element already changed in this frame, not only prevent - another element change (checked in ChangeElement()), but - also prevent additional element actions for this element */ + // if element already changed in this frame, not only prevent + // another element change (checked in ChangeElement()), but + // also prevent additional element actions for this element if (ChangeCount[x][y] >= game.max_num_changes_per_frame && !level.use_action_after_change_bug) @@ -10644,9 +10640,9 @@ static boolean CheckTriggeredElementChangeExt(int trigger_x, int trigger_y, } else if (change->has_action) { - /* if element already changed in this frame, not only prevent - another element change (checked in ChangeElement()), but - also prevent additional element actions for this element */ + // if element already changed in this frame, not only prevent + // another element change (checked in ChangeElement()), but + // also prevent additional element actions for this element if (ChangeCount[x][y] >= game.max_num_changes_per_frame && !level.use_action_after_change_bug) diff --git a/src/game_mm/mm_files.c b/src/game_mm/mm_files.c index b2899f01..fc59d798 100644 --- a/src/game_mm/mm_files.c +++ b/src/game_mm/mm_files.c @@ -346,9 +346,9 @@ boolean LoadNativeLevel_MM(char *filename, boolean level_info_only) int chunk_size_expected = (chunk_info[i].loader)(file, chunk_size, &native_mm_level); - /* the size of some chunks cannot be checked before reading other - chunks first (like "HEAD" and "BODY") that contain some header - information, so check them here */ + // the size of some chunks cannot be checked before reading other + // chunks first (like "HEAD" and "BODY") that contain some header + // information, so check them here if (chunk_size_expected != chunk_size) Error(ERR_WARN, "wrong size (%d) of chunk '%s' in level file '%s'", chunk_size, chunk_name, filename); diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index e4f4ba1b..1e859b19 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -2889,8 +2889,8 @@ void RotateMirror(int x, int y, int button) { if (button == MB_LEFTBUTTON) { - /* left mouse button only for manual adjustment, no auto-rotating; - freeze mirror for until mouse button released */ + // left mouse button only for manual adjustment, no auto-rotating; + // freeze mirror for until mouse button released hold_x = x; hold_y = y; } diff --git a/src/game_mm/mm_main.h b/src/game_mm/mm_main.h index 38cb0e79..cc93b922 100644 --- a/src/game_mm/mm_main.h +++ b/src/game_mm/mm_main.h @@ -333,10 +333,10 @@ extern int num_element_info; #define WALL_TOP (WALL_TOPLEFT | WALL_TOPRIGHT) #define WALL_BOTTOM (WALL_BOTTOMLEFT | WALL_BOTTOMRIGHT) -/* game elements: -** 0 - 499: real elements, stored in level file -** 500 - 699: flag elements, only used at runtime -*/ +// game elements: +// 0 - 499: real elements, stored in level file +// 500 - 699: flag elements, only used at runtime + // "real" level elements #define EL_MM_START 0 #define EL_MM_START_1 EL_MM_START @@ -701,12 +701,11 @@ extern int num_element_info; #define EL_MM_MASK_CIRCLE 709 -/* game graphics: -** 0 - 191: graphics from "MirrorScreen" -** 192 - 255: pseudo graphics mapped to "MirrorScreen" -** 256 - 511: graphics from "MirrorFont" -** 512 - 767: graphics from "MirrorDF" -*/ +// game graphics: +// 0 - 191: graphics from "MirrorScreen" +// 192 - 255: pseudo graphics mapped to "MirrorScreen" +// 256 - 511: graphics from "MirrorFont" +// 512 - 767: graphics from "MirrorDF" #define IMG_EMPTY IMG_EMPTY_SPACE @@ -1180,17 +1179,17 @@ extern int num_element_info; #define MM_VERSION_MINOR(x) VERSION_PART_2(x) #define MM_VERSION_PATCH(x) VERSION_PART_3(x) -/* file version numbers for resource files (levels, score, setup, etc.) -** currently supported/known file version numbers: -** 1.4 (still in use) -** 2.0 (actual) -*/ +// file version numbers for resource files (levels, score, setup, etc.) +// currently supported/known file version numbers: +// 1.4 (still in use) +// 2.0 (actual) + #define MM_FILE_VERSION_1_4 MM_VERSION_IDENT(1,4,0) #define MM_FILE_VERSION_2_0 MM_VERSION_IDENT(2,0,0) -/* file version does not change for every program version, but is changed - when new features are introduced that are incompatible with older file - versions, so that they can be treated accordingly */ +// file version does not change for every program version, but is changed +// when new features are introduced that are incompatible with older file +// versions, so that they can be treated accordingly #define MM_FILE_VERSION_ACTUAL MM_FILE_VERSION_2_0 #define MM_GAME_VERSION_ACTUAL MM_VERSION_IDENT(PROGRAM_VERSION_MAJOR, \ diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index b4decbac..7a221b67 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -1,15 +1,13 @@ -/*********************************************************** -* Mirror Magic -- McDuffin's Revenge * -*----------------------------------------------------------* -* (c) 1994-2001 Artsoft Entertainment * -* Holger Schemel * -* Detmolder Strasse 189 * -* 33604 Bielefeld * -* Germany * -* e-mail: info@artsoft.org * -*----------------------------------------------------------* -* tools.c * -***********************************************************/ +// ============================================================================ +// Mirror Magic -- McDuffin's Revenge +// ---------------------------------------------------------------------------- +// (c) 1994-2017 by Artsoft Entertainment +// Holger Schemel +// info@artsoft.org +// http://www.artsoft.org/ +// ---------------------------------------------------------------------------- +// mm_tools.c +// ============================================================================ #include "main_mm.h" diff --git a/src/game_mm/mm_tools.h b/src/game_mm/mm_tools.h index 7b3df48c..45d42f69 100644 --- a/src/game_mm/mm_tools.h +++ b/src/game_mm/mm_tools.h @@ -1,15 +1,13 @@ -/*********************************************************** -* Mirror Magic -- McDuffin's Revenge * -*----------------------------------------------------------* -* (c) 1994-2001 Artsoft Entertainment * -* Holger Schemel * -* Detmolder Strasse 189 * -* 33604 Bielefeld * -* Germany * -* e-mail: info@artsoft.org * -*----------------------------------------------------------* -* tools.h * -***********************************************************/ +// ============================================================================ +// Mirror Magic -- McDuffin's Revenge +// ---------------------------------------------------------------------------- +// (c) 1994-2017 by Artsoft Entertainment +// Holger Schemel +// info@artsoft.org +// http://www.artsoft.org/ +// ---------------------------------------------------------------------------- +// mm_tools.h +// ============================================================================ #ifndef MM_TOOLS_H #define MM_TOOLS_H diff --git a/src/game_sp/file.c b/src/game_sp/file.c index a1ff3e80..4e8c9a8f 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -142,8 +142,8 @@ static void LoadNativeLevelFromFileStream_SP(File *file, int width, int height, LevelInfoType *header = &native_sp_level.header; int i, x, y; - /* for details of the Supaplex level format, see Herman Perk's Supaplex - documentation file "SPFIX63.DOC" from his Supaplex "SpeedFix" package */ + // for details of the Supaplex level format, see Herman Perk's Supaplex + // documentation file "SPFIX63.DOC" from his Supaplex "SpeedFix" package native_sp_level.width = MIN(width, SP_MAX_PLAYFIELD_WIDTH); native_sp_level.height = MIN(height, SP_MAX_PLAYFIELD_HEIGHT); @@ -179,9 +179,9 @@ static void LoadNativeLevelFromFileStream_SP(File *file, int width, int height, // initial "freeze zonks": 2 == "on", anything else (0, 1) == "off" header->InitialFreezeZonks = getFile8Bit(file); - /* number of infotrons needed; 0 means that Supaplex will count the total - amount of infotrons in the level and use the low byte of that number - (a multiple of 256 infotrons will result in "0 infotrons needed"!) */ + // number of infotrons needed; 0 means that Supaplex will count the total + // amount of infotrons in the level and use the low byte of that number + // (a multiple of 256 infotrons will result in "0 infotrons needed"!) header->InfotronsNeeded = getFile8Bit(file); // number of special ("gravity") port entries below (maximum 10 allowed) @@ -418,8 +418,8 @@ boolean LoadNativeLevel_SP(char *filename, int level_pos, if (!reading_multipart_level && !is_multipart_level) { - /* the current level is simply a normal single-part level, and we are - not reading a multi-part level yet, so return the level as it is */ + // the current level is simply a normal single-part level, and we are + // not reading a multi-part level yet, so return the level as it is break; } @@ -428,9 +428,9 @@ boolean LoadNativeLevel_SP(char *filename, int level_pos, if (!reading_multipart_level && is_multipart_level && !is_first_part) { - /* this is a part of a multi-part level, but not the first part - (and we are not already reading parts of a multi-part level); - in this case, use an empty level instead of the single part */ + // this is a part of a multi-part level, but not the first part + // (and we are not already reading parts of a multi-part level); + // in this case, use an empty level instead of the single part use_empty_level = TRUE; @@ -444,9 +444,9 @@ boolean LoadNativeLevel_SP(char *filename, int level_pos, !strEqualN(header->LevelTitle, multipart_level.header.LevelTitle, SP_LEVEL_NAME_LEN))) { - /* we are already reading parts of a multi-part level, but this level is - either not a multi-part level, or a part of a different multi-part - level; in both cases, the multi-part level seems to be complete */ + // we are already reading parts of a multi-part level, but this level is + // either not a multi-part level, or a part of a different multi-part + // level; in both cases, the multi-part level seems to be complete break; } diff --git a/src/init.c b/src/init.c index 8d410a56..3ab46d0f 100644 --- a/src/init.c +++ b/src/init.c @@ -481,8 +481,8 @@ static void InitFontGraphicInfo(void) } // reset non-redefined ".active" font graphics if normal font is redefined - /* (this different treatment is needed because normal and active fonts are - independently defined ("active" is not a property of font definitions!) */ + // (this different treatment is needed because normal and active fonts are + // independently defined ("active" is not a property of font definitions!) for (i = 0; i < NUM_FONTS; i++) { int font_nr_base = i; @@ -515,8 +515,8 @@ static void InitFontGraphicInfo(void) boolean active_redefined = getImageListEntryFromImageID(active_graphic)->redefined; - /* same as above, but check special graphic definitions, for example: - redefined "font.menu_1.MAIN" invalidates "font.menu_1.active.MAIN" */ + // same as above, but check special graphic definitions, for example: + // redefined "font.menu_1.MAIN" invalidates "font.menu_1.active.MAIN" if (base_redefined && !active_redefined) { font_info[font_nr_active].special_graphic[j] = @@ -955,8 +955,8 @@ static void InitElementGraphicInfo(void) UPDATE_BUSY_STATE(); - /* adjust graphics with 2nd tile for movement according to direction - (do this before correcting '-1' values to minimize calculations) */ + // adjust graphics with 2nd tile for movement according to direction + // (do this before correcting '-1' values to minimize calculations) for (i = 0; i < MAX_NUM_ELEMENTS; i++) { for (act = 0; act < NUM_ACTIONS; act++) @@ -1970,8 +1970,8 @@ static void InitElementSoundInfo(void) } } - /* copy sound settings to some elements that are only stored in level file - in native R'n'D levels, but are used by game engine in native EM levels */ + // copy sound settings to some elements that are only stored in level file + // in native R'n'D levels, but are used by game engine in native EM levels for (i = 0; copy_properties[i][0] != -1; i++) for (j = 1; j <= 4; j++) for (act = 0; act < NUM_ACTIONS; act++) @@ -2151,8 +2151,8 @@ static void InitGameModeMusicInfo(void) } // now set all '-1' values to menu specific default values - /* (undefined values of "levelset.music[]" might stay at "-1" to - allow dynamic selection of music files from music directory!) */ + // (undefined values of "levelset.music[]" might stay at "-1" to + // allow dynamic selection of music files from music directory!) for (i = 0; i < MAX_LEVELS; i++) if (levelset.music[i] == -1) levelset.music[i] = default_levelset_music; @@ -3687,8 +3687,8 @@ void InitElementPropertiesStatic(void) EL_WALL_PEARL, EL_WALL_CRYSTAL, - /* the following elements are a direct copy of "indestructible" elements, - except "EL_ACID", which is "indestructible", but not "solid"! */ + // the following elements are a direct copy of "indestructible" elements, + // except "EL_ACID", which is "indestructible", but not "solid"! #if 0 EL_ACID, #endif diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 37a2760b..0a1383fd 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -259,8 +259,7 @@ void PrintLineWithPrefix(char *prefix, char *line_chars, int line_length) the used memory is static, but will be overwritten by later calls, so if you want to save the result, copy it to a private string buffer; there can be 10 local calls of int2str() without buffering the result -- - the 11th call will then destroy the result from the first call and so on. -*/ + the 11th call will then destroy the result from the first call and so on. */ char *int2str(int number, int size) { @@ -286,9 +285,9 @@ char *int2str(int number, int size) } -/* something similar to "int2str()" above, but allocates its own memory - and has a different interface; we cannot use "itoa()", because this - seems to be already defined when cross-compiling to the win32 target */ +// something similar to "int2str()" above, but allocates its own memory +// and has a different interface; we cannot use "itoa()", because this +// seems to be already defined when cross-compiling to the win32 target char *i_to_a(unsigned int i) { @@ -307,8 +306,8 @@ char *i_to_a(unsigned int i) } -/* calculate base-2 logarithm of argument (rounded down to integer; - this function returns the number of the highest bit set in argument) */ +// calculate base-2 logarithm of argument (rounded down to integer; +// this function returns the number of the highest bit set in argument) int log_2(unsigned int x) { @@ -535,13 +534,13 @@ static char *get_corrected_real_name(char *real_name) // copy the name string, but not more than MAX_USERNAME_LEN characters while (*from_ptr && (int)(to_ptr - real_name_new) < MAX_USERNAME_LEN - 1) { - /* the name field read from "passwd" file may also contain additional - user information, separated by commas, which will be removed here */ + // the name field read from "passwd" file may also contain additional + // user information, separated by commas, which will be removed here if (*from_ptr == ',') break; - /* the user's real name may contain 'german sharp s' characters, - which have no equivalent in upper case letters (used by our fonts) */ + // the user's real name may contain 'german sharp s' characters, + // which have no equivalent in upper case letters (used by our fonts) if (*from_ptr == CHAR_BYTE_SHARP_S) { from_ptr++; @@ -2736,8 +2735,8 @@ static char *get_special_base_token(struct ArtworkListInfo *artwork_info, return getStringCopyN(token, strlen(token) - len_suffix); } -/* This function checks if a string of the format "string1, string2, ..." - exactly contains a string . */ +// This function checks if a string of the format "string1, string2, ..." +// exactly contains a string . static boolean string_has_parameter(char *s, char *s_contained) { @@ -3758,9 +3757,9 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, // check if the old and the new artwork file are the same if (*listnode && strEqual((*listnode)->source_filename, filename)) { - /* The old and new artwork are the same (have the same filename and path). - This usually means that this artwork does not exist in this artwork set - and a fallback to the existing artwork is done. */ + // The old and new artwork are the same (have the same filename and path). + // This usually means that this artwork does not exist in this artwork set + // and a fallback to the existing artwork is done. return; } diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 6d2cb4d1..bdbe5a4b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -261,8 +261,8 @@ void Delay_WithScreenUpdates(unsigned int delay) static void SDLSetWindowIcon(char *basename) { - /* (setting the window icon on Mac OS X would replace the high-quality - dock icon with the currently smaller (and uglier) icon from file) */ + // (setting the window icon on Mac OS X would replace the high-quality + // dock icon with the currently smaller (and uglier) icon from file) #if !defined(PLATFORM_MACOSX) char *filename = getCustomImageFilename(basename); @@ -1996,11 +1996,9 @@ void SDLPutPixel(Bitmap *dst_bitmap, int x, int y, Pixel pixel) } -/* - ----------------------------------------------------------------------------- - quick (no, it's slow) and dirty hack to "invert" rectangle inside SDL surface - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// quick (no, it's slow) and dirty hack to "invert" rectangle inside SDL surface +// ---------------------------------------------------------------------------- void SDLInvertArea(Bitmap *bitmap, int src_x, int src_y, int width, int height, Uint32 color) @@ -2043,13 +2041,11 @@ void SDLCopyInverseMasked(Bitmap *src_bitmap, Bitmap *dst_bitmap, // http://www.ferzkopp.net/Software/SDL_gfx-2.0/index.html // ============================================================================ -/* - ----------------------------------------------------------------------------- - 32 bit zoomer - - zoomes 32bit RGBA/ABGR 'src' surface to 'dst' surface. - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// 32 bit zoomer +// +// zoomes 32bit RGBA/ABGR 'src' surface to 'dst' surface. +// ---------------------------------------------------------------------------- typedef struct { @@ -2175,13 +2171,11 @@ static int zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst) return 0; } -/* - ----------------------------------------------------------------------------- - 8 bit zoomer - - zoomes 8 bit palette/Y 'src' surface to 'dst' surface - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// 8 bit zoomer +// +// zoomes 8 bit palette/Y 'src' surface to 'dst' surface +// ---------------------------------------------------------------------------- static int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) { @@ -2272,16 +2266,14 @@ static int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) return 0; } -/* - ----------------------------------------------------------------------------- - zoomSurface() - - Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. - 'zoomx' and 'zoomy' are scaling factors for width and height. - If the surface is not 8bit or 32bit RGBA/ABGR it will be converted - into a 32bit RGBA format on the fly. - ----------------------------------------------------------------------------- -*/ +// ---------------------------------------------------------------------------- +// zoomSurface() +// +// Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. +// 'zoomx' and 'zoomy' are scaling factors for width and height. +// If the surface is not 8bit or 32bit RGBA/ABGR it will be converted +// into a 32bit RGBA format on the fly. +// ---------------------------------------------------------------------------- static SDL_Surface *zoomSurface(SDL_Surface *src, int dst_width, int dst_height) { diff --git a/src/libgame/setup.c b/src/libgame/setup.c index ccac1c30..626bb1f9 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1559,8 +1559,8 @@ void createDirectory(char *dir, char *text, int permission_class) if (directoryExists(dir)) return; - /* leave "other" permissions in umask untouched, but ensure group parts - of USERDATA_DIR_MODE are not masked */ + // leave "other" permissions in umask untouched, but ensure group parts + // of USERDATA_DIR_MODE are not masked mode_t dir_mode = (permission_class == PERMS_PRIVATE ? DIR_PERMS_PRIVATE : DIR_PERMS_PUBLIC); mode_t last_umask = posix_umask(0); @@ -2036,9 +2036,9 @@ static boolean getTokenValueFromSetupLineExt(char *line, boolean getTokenValueFromSetupLine(char *line, char **token, char **value) { - /* while the internal (old) interface does not require a token/value - separator (for downwards compatibility with existing files which - don't use them), it is mandatory for the external (new) interface */ + // while the internal (old) interface does not require a token/value + // separator (for downwards compatibility with existing files which + // don't use them), it is mandatory for the external (new) interface return getTokenValueFromSetupLineExt(line, token, value, NULL, NULL, 0, TRUE); } diff --git a/src/libgame/system.c b/src/libgame/system.c index 7b67677c..702a86bc 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -820,8 +820,8 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, if (src_bitmap == dst_bitmap) { - /* needed when blitting directly to same bitmap -- should not be needed with - recent SDL libraries, but apparently does not work in 1.2.11 directly */ + // needed when blitting directly to same bitmap -- should not be needed with + // recent SDL libraries, but apparently does not work in 1.2.11 directly static Bitmap *tmp_bitmap = NULL; static int tmp_bitmap_xsize = 0; @@ -1175,9 +1175,9 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) if (strEqual(filename, bitmap->source_filename)) { - /* The old and new image are the same (have the same filename and path). - This usually means that this image does not exist in this graphic set - and a fallback to the existing image is done. */ + // The old and new image are the same (have the same filename and path). + // This usually means that this image does not exist in this graphic set + // and a fallback to the existing image is done. return; } @@ -1503,8 +1503,8 @@ static const char *cursor_image_dot[] = }; static const char **cursor_image_playfield = cursor_image_dot; #else -/* some people complained about a "white dot" on the screen and thought it - was a graphical error... OK, let's just remove the whole pointer :-) */ +// some people complained about a "white dot" on the screen and thought it +// was a graphical error... OK, let's just remove the whole pointer :-) static const char **cursor_image_playfield = cursor_image_none; #endif diff --git a/src/libgame/system.h b/src/libgame/system.h index be48d889..f2ac0c1d 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -654,11 +654,10 @@ // areas in bitmap PIX_DOOR -/* meaning in PIX_DB_DOOR: (3 PAGEs) - PAGEX1: 1. buffer for DOOR_1 - PAGEX2: 2. buffer for DOOR_1 - PAGEX3: buffer for animations -*/ +// meaning in PIX_DB_DOOR: (3 PAGEs) +// PAGEX1: 1. buffer for DOOR_1 +// PAGEX2: 2. buffer for DOOR_1 +// PAGEX3: buffer for animations // these values are hard-coded to be able to use them in initialization #define DOOR_GFX_PAGE_WIDTH 100 // should be set to "gfx.dxsize" diff --git a/src/main.c b/src/main.c index 48b5d577..f35974bc 100644 --- a/src/main.c +++ b/src/main.c @@ -7444,9 +7444,9 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = // font definitions // ---------------------------------------------------------------------------- -/* Important: When one entry is a prefix of another entry, the longer entry - must come first, because the dynamic configuration does prefix matching! - (These definitions must match the corresponding definitions in "main.h"!) */ +// Important: When one entry is a prefix of another entry, the longer entry +// must come first, because the dynamic configuration does prefix matching! +// (These definitions must match the corresponding definitions in "main.h"!) struct FontInfo font_info[NUM_FONTS + 1] = { diff --git a/src/netserv.c b/src/netserv.c index a2325b14..25055e01 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -831,8 +831,8 @@ static void ExitNetworkServer(int exit_value) exit(exit_value); } -/* the following is not used for a standalone server; - the pointer points to an integer containing the port-number */ +// the following is not used for a standalone server; +// the pointer points to an integer containing the port-number int NetworkServerThread(void *ptr) { NetworkServer(*((int *) ptr), 0); diff --git a/src/screens.c b/src/screens.c index f5ffa0c5..06732b87 100644 --- a/src/screens.c +++ b/src/screens.c @@ -7603,8 +7603,8 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) break; case SDL_JOYHATMOTION: - /* ignore centering; we're probably just coming back - to the center from the previous item we set */ + // ignore centering; we're probably just coming back + // to the center from the previous item we set if (event.jhat.value == SDL_HAT_CENTERED) break; diff --git a/src/tape.c b/src/tape.c index d1d4aa6b..852b82d7 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1128,9 +1128,9 @@ boolean PlaySolutionTape(void) } -/* ------------------------------------------------------------------------- * - * tape autoplay functions - * ------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------- +// tape autoplay functions +// ---------------------------------------------------------------------------- void AutoPlayTape(void) { diff --git a/src/tape.h b/src/tape.h index dfb0a627..40ddd094 100644 --- a/src/tape.h +++ b/src/tape.h @@ -95,8 +95,8 @@ #define VIDEO_PRESS_EJECT(x) ((x) ? VIDEO_PRESS_EJECT_ON: VIDEO_PRESS_EJECT_OFF) // tags to draw video display labels or symbols only -/* (negative values to prevent misinterpretation in DrawVideoDisplay(), where - the variable "value" is also used for tape length -- better fix this) */ +// (negative values to prevent misinterpretation in DrawVideoDisplay(), where +// the variable "value" is also used for tape length -- better fix this) #define VIDEO_DISPLAY_DEFAULT 0 #define VIDEO_DISPLAY_LABEL_ONLY -1 #define VIDEO_DISPLAY_SYMBOL_ONLY -2 diff --git a/src/tools.c b/src/tools.c index 8d8fba9c..251bfbe0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1907,8 +1907,8 @@ static void DrawGraphicShiftedDouble(int x, int y, int dx, int dy, int x2 = x + SIGN(dx); int y2 = y + SIGN(dy); - /* movement with two-tile animations must be sync'ed with movement position, - not with current GfxFrame (which can be higher when using slow movement) */ + // movement with two-tile animations must be sync'ed with movement position, + // not with current GfxFrame (which can be higher when using slow movement) int anim_pos = (dx ? ABS(dx) : ABS(dy)); int anim_frames = graphic_info[graphic].anim_frames; @@ -3870,8 +3870,8 @@ void DrawPlayer(struct PlayerInfo *player) int last_player_frame = player->Frame; int frame = 0; - /* GfxElement[][] is set to the element the player is digging or collecting; - remove also for off-screen player if the player is not moving anymore */ + // GfxElement[][] is set to the element the player is digging or collecting; + // remove also for off-screen player if the player is not moving anymore if (IN_LEV_FIELD(jx, jy) && !player_is_moving) GfxElement[jx][jy] = EL_UNDEFINED; @@ -3989,8 +3989,8 @@ void DrawPlayer(struct PlayerInfo *player) graphic = getPlayerGraphic(player, move_dir); - /* in the case of changed player action or direction, prevent the current - animation frame from being restarted for identical animations */ + // in the case of changed player action or direction, prevent the current + // animation frame from being restarted for identical animations if (player->Frame == 0 && equalGraphics(graphic, last_player_graphic)) player->Frame = last_player_frame; @@ -4094,8 +4094,8 @@ void DrawPlayer(struct PlayerInfo *player) graphic = getPlayerGraphic(player, move_dir); - /* in the case of changed player action or direction, prevent the current - animation frame from being restarted for identical animations */ + // in the case of changed player action or direction, prevent the current + // animation frame from being restarted for identical animations if (player->Frame == 0 && equalGraphics(graphic, last_player_graphic)) player->Frame = last_player_frame; @@ -8266,9 +8266,9 @@ static void set_crumbled_graphics_EM(struct GraphicInfo_EM *g_em, boolean has_crumbled_graphics, int crumbled, int sync_frame) { - /* if element can be crumbled, but certain action graphics are just empty - space (like instantly snapping sand to empty space in 1 frame), do not - treat these empty space graphics as crumbled graphics in EMC engine */ + // if element can be crumbled, but certain action graphics are just empty + // space (like instantly snapping sand to empty space in 1 frame), do not + // treat these empty space graphics as crumbled graphics in EMC engine if (crumbled == IMG_EMPTY_SPACE) has_crumbled_graphics = FALSE; @@ -8332,9 +8332,9 @@ void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em, action == ACTION_FILLING || action == ACTION_EMPTYING); - /* special case: graphic uses "2nd movement tile" and has defined - 7 frames for movement animation (or less) => use default graphic - for last (8th) frame which ends the movement animation */ + // special case: graphic uses "2nd movement tile" and has defined + // 7 frames for movement animation (or less) => use default graphic + // for last (8th) frame which ends the movement animation if (g->double_movement && g->anim_frames < 8 && frame_em == 7) { action = ACTION_DEFAULT; // (keep action_* unchanged for now) @@ -8427,9 +8427,9 @@ void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *g_em, struct GraphicInfo *g = &graphic_info[graphic]; int sync_frame; - /* special case: graphic uses "2nd movement tile" and has defined - 7 frames for movement animation (or less) => use default graphic - for last (8th) frame which ends the movement animation */ + // special case: graphic uses "2nd movement tile" and has defined + // 7 frames for movement animation (or less) => use default graphic + // for last (8th) frame which ends the movement animation if (g->double_movement && g->anim_frames < 8 && frame_em == 7) { effective_action = ACTION_DEFAULT; @@ -8463,8 +8463,8 @@ void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *g_em, getGraphicSourceExt(graphic, frame, &g_em->bitmap, &g_em->src_x, &g_em->src_y, g->double_movement && is_backside); - /* (updating the "crumbled" graphic definitions is probably not really needed, - as animations for crumbled graphics can't be longer than one EMC cycle) */ + // (updating the "crumbled" graphic definitions is probably not really needed, + // as animations for crumbled graphics can't be longer than one EMC cycle) set_crumbled_graphics_EM(g_em, has_crumbled_graphics, crumbled, sync_frame); } -- 2.34.1