X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.c;h=a727eaa53439274ce584613a0c1d062cc879bc55;hb=4eff89df72ffc45c4ad59fcd01860eb8f4179b9c;hp=79390657382cccc35e86959196d1ae3d2f28b686;hpb=6b8725835d5397aadb73411c6f48b5f861256181;p=rocksndiamonds.git diff --git a/src/main.c b/src/main.c index 79390657..a727eaa5 100644 --- a/src/main.c +++ b/src/main.c @@ -20,166 +20,166 @@ #include "events.h" #include "config.h" -Bitmap *bitmap_db_field; -Bitmap *bitmap_db_door_1; -Bitmap *bitmap_db_door_2; -Bitmap *bitmap_db_store_1; -Bitmap *bitmap_db_store_2; -DrawBuffer *fieldbuffer; -DrawBuffer *drawto_field; +Bitmap *bitmap_db_field; +Bitmap *bitmap_db_door_1; +Bitmap *bitmap_db_door_2; +Bitmap *bitmap_db_store_1; +Bitmap *bitmap_db_store_2; +DrawBuffer *fieldbuffer; +DrawBuffer *drawto_field; -int game_status = -1; -int game_status_last_screen = -1; -boolean level_editor_test_game = FALSE; -boolean score_info_tape_play = FALSE; -boolean network_playing = FALSE; +int game_status = -1; +int game_status_last_screen = -1; +boolean level_editor_test_game = FALSE; +boolean score_info_tape_play = FALSE; +boolean network_playing = FALSE; -int key_joystick_mapping = 0; +int key_joystick_mapping = 0; -short Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short AmoebaCnt[MAX_NUM_AMOEBA]; -short AmoebaCnt2[MAX_NUM_AMOEBA]; -short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short AmoebaCnt[MAX_NUM_AMOEBA]; +short AmoebaCnt2[MAX_NUM_AMOEBA]; +short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxRandomStatic[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxElementEmpty[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxRandomStatic[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxElementEmpty[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int ActiveElement[MAX_NUM_ELEMENTS]; -int ActiveButton[NUM_IMAGE_FILES]; -int ActiveFont[NUM_FONTS]; +int ActiveElement[MAX_NUM_ELEMENTS]; +int ActiveButton[NUM_IMAGE_FILES]; +int ActiveFont[NUM_FONTS]; -int lev_fieldx, lev_fieldy; -int scroll_x, scroll_y; +int lev_fieldx, lev_fieldy; +int scroll_x, scroll_y; -int WIN_XSIZE = WIN_XSIZE_DEFAULT; -int WIN_YSIZE = WIN_YSIZE_DEFAULT; +int WIN_XSIZE = WIN_XSIZE_DEFAULT; +int WIN_YSIZE = WIN_YSIZE_DEFAULT; -int SCR_FIELDX = SCR_FIELDX_DEFAULT; -int SCR_FIELDY = SCR_FIELDY_DEFAULT; +int SCR_FIELDX = SCR_FIELDX_DEFAULT; +int SCR_FIELDY = SCR_FIELDY_DEFAULT; -int REAL_SX = 6, REAL_SY = 6; -int SX = 8, SY = 8; -int DX = 566, DY = 60; -int VX = 566, VY = 400; -int EX = 566, EY = 356; -int dDX, dDY; +int REAL_SX = 6, REAL_SY = 6; +int SX = 8, SY = 8; +int DX = 566, DY = 60; +int VX = 566, VY = 400; +int EX = 566, EY = 356; +int dDX, dDY; -int FULL_SXSIZE = 2 + SXSIZE_DEFAULT + 2; -int FULL_SYSIZE = 2 + SYSIZE_DEFAULT + 2; -int SXSIZE = SXSIZE_DEFAULT; -int SYSIZE = SYSIZE_DEFAULT; +int FULL_SXSIZE = 2 + SXSIZE_DEFAULT + 2; +int FULL_SYSIZE = 2 + SYSIZE_DEFAULT + 2; +int SXSIZE = SXSIZE_DEFAULT; +int SYSIZE = SYSIZE_DEFAULT; -int FADE_SX = 6, FADE_SY = 6; -int FADE_SXSIZE = 2 + SXSIZE_DEFAULT + 2; -int FADE_SYSIZE = 2 + SXSIZE_DEFAULT + 2; +int FADE_SX = 6, FADE_SY = 6; +int FADE_SXSIZE = 2 + SXSIZE_DEFAULT + 2; +int FADE_SYSIZE = 2 + SXSIZE_DEFAULT + 2; -int DXSIZE = 100; -int DYSIZE = 280; -int VXSIZE = 100; -int VYSIZE = 100; -int EXSIZE = 100; -int EYSIZE = 144; -int TILESIZE_VAR = TILESIZE; +int DXSIZE = 100; +int DYSIZE = 280; +int VXSIZE = 100; +int VYSIZE = 100; +int EXSIZE = 100; +int EYSIZE = 144; +int TILESIZE_VAR = TILESIZE; -int FX, FY; -int ScrollStepSize; -int ScreenMovDir = MV_NONE, ScreenMovPos = 0; -int ScreenGfxPos = 0; -int BorderElement = EL_STEELWALL; -int MenuFrameDelay = MENU_FRAME_DELAY; -int GameFrameDelay = GAME_FRAME_DELAY; -int FfwdFrameDelay = FFWD_FRAME_DELAY; -int BX1, BY1; -int BX2, BY2; -int SBX_Left, SBX_Right; -int SBY_Upper, SBY_Lower; +int FX, FY; +int ScrollStepSize; +int ScreenMovDir = MV_NONE, ScreenMovPos = 0; +int ScreenGfxPos = 0; +int BorderElement = EL_STEELWALL; +int MenuFrameDelay = MENU_FRAME_DELAY; +int GameFrameDelay = GAME_FRAME_DELAY; +int FfwdFrameDelay = FFWD_FRAME_DELAY; +int BX1, BY1; +int BX2, BY2; +int SBX_Left, SBX_Right; +int SBY_Upper, SBY_Lower; -int TimeFrames, TimePlayed, TimeLeft; -int TapeTimeFrames, TapeTime; +int TimeFrames, TimePlayed, TimeLeft; +int TapeTimeFrames, TapeTime; -boolean network_player_action_received = FALSE; +boolean network_player_action_received = FALSE; -struct LevelInfo level, level_template; -struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL; -struct ScoreInfo scores, server_scores; -struct TapeInfo tape; -struct GameInfo game; -struct GlobalInfo global; -struct BorderInfo border; -struct ViewportInfo viewport; -struct TitleFadingInfo fading; -struct TitleFadingInfo title_initial_first_default; -struct TitleFadingInfo title_initial_default; -struct TitleFadingInfo title_first_default; -struct TitleFadingInfo title_default; -struct TitleMessageInfo titlescreen_initial_first_default; -struct TitleMessageInfo titlescreen_initial_first[MAX_NUM_TITLE_IMAGES]; -struct TitleMessageInfo titlescreen_initial_default; -struct TitleMessageInfo titlescreen_initial[MAX_NUM_TITLE_IMAGES]; -struct TitleMessageInfo titlescreen_first_default; -struct TitleMessageInfo titlescreen_first[MAX_NUM_TITLE_IMAGES]; -struct TitleMessageInfo titlescreen_default; -struct TitleMessageInfo titlescreen[MAX_NUM_TITLE_IMAGES]; -struct TitleMessageInfo titlemessage_initial_first_default; -struct TitleMessageInfo titlemessage_initial_first[MAX_NUM_TITLE_MESSAGES]; -struct TitleMessageInfo titlemessage_initial_default; -struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES]; -struct TitleMessageInfo titlemessage_first_default; -struct TitleMessageInfo titlemessage_first[MAX_NUM_TITLE_MESSAGES]; -struct TitleMessageInfo titlemessage_default; -struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES]; -struct TitleMessageInfo readme; -struct InitInfo init, init_last; -struct MenuInfo menu; -struct DoorInfo door_1, door_2; -struct RequestInfo request; -struct PreviewInfo preview; -struct EditorInfo editor; +struct LevelInfo level, level_template; +struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL; +struct ScoreInfo scores, server_scores; +struct TapeInfo tape; +struct GameInfo game; +struct GlobalInfo global; +struct BorderInfo border; +struct ViewportInfo viewport; +struct TitleFadingInfo fading; +struct TitleFadingInfo title_initial_first_default; +struct TitleFadingInfo title_initial_default; +struct TitleFadingInfo title_first_default; +struct TitleFadingInfo title_default; +struct TitleMessageInfo titlescreen_initial_first_default; +struct TitleMessageInfo titlescreen_initial_first[MAX_NUM_TITLE_IMAGES]; +struct TitleMessageInfo titlescreen_initial_default; +struct TitleMessageInfo titlescreen_initial[MAX_NUM_TITLE_IMAGES]; +struct TitleMessageInfo titlescreen_first_default; +struct TitleMessageInfo titlescreen_first[MAX_NUM_TITLE_IMAGES]; +struct TitleMessageInfo titlescreen_default; +struct TitleMessageInfo titlescreen[MAX_NUM_TITLE_IMAGES]; +struct TitleMessageInfo titlemessage_initial_first_default; +struct TitleMessageInfo titlemessage_initial_first[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo titlemessage_initial_default; +struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo titlemessage_first_default; +struct TitleMessageInfo titlemessage_first[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo titlemessage_default; +struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo readme; +struct InitInfo init, init_last; +struct MenuInfo menu; +struct DoorInfo door_1, door_2; +struct RequestInfo request; +struct PreviewInfo preview; +struct EditorInfo editor; -struct GraphicInfo *graphic_info = NULL; -struct SoundInfo *sound_info = NULL; -struct MusicInfo *music_info = NULL; -struct MusicFileInfo *music_file_info = NULL; -struct HelpAnimInfo *helpanim_info = NULL; +struct GraphicInfo *graphic_info = NULL; +struct SoundInfo *sound_info = NULL; +struct MusicInfo *music_info = NULL; +struct MusicFileInfo *music_file_info = NULL; +struct HelpAnimInfo *helpanim_info = NULL; -SetupFileHash *helptext_info = NULL; -SetupFileHash *image_config_hash = NULL; -SetupFileHash *sound_config_hash = NULL; -SetupFileHash *element_token_hash = NULL; -SetupFileHash *graphic_token_hash = NULL; -SetupFileHash *font_token_hash = NULL; -SetupFileHash *hide_setup_hash = NULL; -SetupFileHash *anim_url_hash = NULL; +SetupFileHash *helptext_info = NULL; +SetupFileHash *image_config_hash = NULL; +SetupFileHash *sound_config_hash = NULL; +SetupFileHash *element_token_hash = NULL; +SetupFileHash *graphic_token_hash = NULL; +SetupFileHash *font_token_hash = NULL; +SetupFileHash *hide_setup_hash = NULL; +SetupFileHash *anim_url_hash = NULL; // ---------------------------------------------------------------------------- @@ -3764,7 +3764,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "bd_expandable_wall", - "wall", + "bd_expandable_wall", "growing wall (horizontal, BD style)" }, { @@ -6463,9 +6463,9 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "slope (DF style) (315\xb0)" }, { - "bd_player", - "bd_player", - "player" + "bd_empty_space", + "empty_space", + "empty space" }, { "bd_sand", @@ -6475,7 +6475,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_sand_2", "bd_sand", - "sand (alternative)" + "sand 2" }, { "bd_sand_ball", @@ -6509,7 +6509,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "bd_sand_glued", - "bd_sane_glued", + "bd_sand_glued", "glued sand" }, { @@ -6539,7 +6539,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "bd_wall_diggable", - "bd_wall_diggable", + "bd_wall", "diggable wall" }, { @@ -6549,22 +6549,22 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "bd_wall_key_1", - "bd_wall_key", + "bd_wall", "wall with key 1" }, { "bd_wall_key_2", - "bd_wall_key", + "bd_wall", "wall with key 2" }, { "bd_wall_key_3", - "bd_wall_key", + "bd_wall", "wall with key 3" }, { "bd_falling_wall", - "bd_falling_wall", + "bd_wall", "falling wall" }, { @@ -6594,12 +6594,12 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "bd_steelwall_explodable", - "bd_steelwall_explodable", + "bd_steelwall", "explodable steel wall" }, { "bd_steelwall_diggable", - "bd_steelwall_diggable", + "bd_steelwall", "diggable steel wall" }, { @@ -6645,7 +6645,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_inbox", "bd_inbox", - "inbox" + "inbox with player" }, { "bd_exit_closed", @@ -6710,7 +6710,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_amoeba_2", "bd_amoeba", - "amoeba (alternative)" + "amoeba 2 (BD style)" }, { "bd_bladder", @@ -6965,52 +6965,52 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_butterfly_2", "bd_butterfly", - "butterfly (alternative, random start direction)" + "butterfly 2 (random start direction)" }, { "bd_butterfly_2.right", "bd_butterfly", - "butterfly (alternative, starts moving right)" + "butterfly 2 (starts moving right)" }, { "bd_butterfly_2.up", "bd_butterfly", - "butterfly (alternative, starts moving up)" + "butterfly 2 (starts moving up)" }, { "bd_butterfly_2.left", "bd_butterfly", - "butterfly (alternative, starts moving left)" + "butterfly 2 (starts moving left)" }, { "bd_butterfly_2.down", "bd_butterfly", - "butterfly (alternative, starts moving down)" + "butterfly 2 (starts moving down)" }, { - "bd_firefly_2.right", + "bd_firefly_2", "bd_firefly", - "firefly (alternative, starts moving right)" + "firefly 2 (random start direction)" }, { - "bd_firefly_2", + "bd_firefly_2.right", "bd_firefly", - "firefly (alternative, random start direction)" + "firefly 2 (starts moving right)" }, { "bd_firefly_2.up", "bd_firefly", - "firefly (alternative, starts moving up)" + "firefly 2 (starts moving up)" }, { "bd_firefly_2.left", "bd_firefly", - "firefly (alternative, starts moving left)" + "firefly 2 (starts moving left)" }, { "bd_firefly_2.down", "bd_firefly", - "firefly (alternative, starts moving down)" + "firefly 2 (starts moving down)" }, { "bd_stonefly", @@ -7097,6 +7097,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "bd_nitro_pack", "nitro pack" }, + { + "bd_player", + "bd_player", + "player" + }, { "bd_player_with_bomb", "bd_player", @@ -7863,6 +7868,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "graphic", "-" }, + { + "bd_game_graphics_color_template", + "-", + "-" + }, { "internal_clipboard_custom", "internal",