X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmain.c;h=d5dbe91c9d35f12f3f20d6b745c11bf60785d86c;hp=891e93e72e96d47cdf58d1117f9cc8a4e7d46f58;hb=359536f46007d1b9148bed9c529056faa91b8aab;hpb=013255ff68bf77db29470e26ac4cd7777836c8b0 diff --git a/src/main.c b/src/main.c index 891e93e7..d5dbe91c 100644 --- a/src/main.c +++ b/src/main.c @@ -20,10 +20,12 @@ #include "events.h" #include "config.h" +Bitmap *bitmap_db_store; Bitmap *bitmap_db_cross; Bitmap *bitmap_db_field; Bitmap *bitmap_db_panel; Bitmap *bitmap_db_door; +Bitmap *bitmap_db_toons; DrawBuffer *fieldbuffer; DrawBuffer *drawto_field; @@ -38,7 +40,11 @@ SDL_Thread *server_thread; int key_joystick_mapping = 0; +#if 1 +boolean redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2]; +#else boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; +#endif int redraw_x1 = 0, redraw_y1 = 0; short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; @@ -74,6 +80,7 @@ int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxElement[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]; @@ -82,15 +89,33 @@ int ActiveFont[NUM_FONTS]; int lev_fieldx, lev_fieldy; int scroll_x, scroll_y; +int WIN_XSIZE = 672, WIN_YSIZE = 560; +int SCR_FIELDX = 17, SCR_FIELDY = 17; +int SX = 8, SY = 8; +int REAL_SX = 6, REAL_SY = 6; +int DX = 566, DY = 60; +int VX = 566, VY = 400; +int EX = 566, EY = 356; +int dDX, dDY; + +#if 1 +int FX, FY; +#else int FX = SX, FY = SY; +#endif int ScrollStepSize; int ScreenMovDir = MV_NONE, ScreenMovPos = 0; int ScreenGfxPos = 0; int BorderElement = EL_STEELWALL; int GameFrameDelay = GAME_FRAME_DELAY; int FfwdFrameDelay = FFWD_FRAME_DELAY; +#if 1 +int BX1, BY1; +int BX2, BY2; +#else int BX1 = 0, BY1 = 0; int BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1; +#endif int SBX_Left, SBX_Right; int SBY_Upper, SBY_Lower; int ZX, ZY; @@ -110,6 +135,7 @@ struct SetupInfo setup; struct GameInfo game; struct GlobalInfo global; struct BorderInfo border; +struct ViewportInfo viewport; struct TitleFadingInfo fading; struct TitleFadingInfo title_initial_default; struct TitleFadingInfo title_default; @@ -118,6 +144,7 @@ struct TitleMessageInfo titlemessage_initial[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 PreviewInfo preview; @@ -127,6 +154,10 @@ 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 *element_token_hash = NULL; +SetupFileHash *graphic_token_hash = NULL; +SetupFileHash *font_token_hash = NULL; /* ------------------------------------------------------------------------- */ @@ -1255,23 +1286,23 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "sp_gravity_port_right", - "sp_port", - "gravity port (leading right)" + "sp_gravity_port", + "gravity-on/off port (leading right)" }, { "sp_gravity_port_down", - "sp_port", - "gravity port (leading down)" + "sp_gravity_port", + "gravity-on/off port (leading down)" }, { "sp_gravity_port_left", - "sp_port", - "gravity port (leading left)" + "sp_gravity_port", + "gravity-on/off port (leading left)" }, { "sp_gravity_port_up", - "sp_port", - "gravity port (leading up)" + "sp_gravity_port", + "gravity-on/off port (leading up)" }, { "sp_sniksnak", @@ -3435,43 +3466,43 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "sp_gravity_on_port_right", - "sp_port", - "gravity on port (leading right)" + "sp_gravity_on_port", + "gravity-on port (leading right)" }, { "sp_gravity_on_port_down", - "sp_port", - "gravity on port (leading down)" + "sp_gravity_on_port", + "gravity-on port (leading down)" }, { "sp_gravity_on_port_left", - "sp_port", - "gravity on port (leading left)" + "sp_gravity_on_port", + "gravity-on port (leading left)" }, { "sp_gravity_on_port_up", - "sp_port", - "gravity on port (leading up)" + "sp_gravity_on_port", + "gravity-on port (leading up)" }, { "sp_gravity_off_port_right", - "sp_port", - "gravity off port (leading right)" + "sp_gravity_off_port", + "gravity-off port (leading right)" }, { "sp_gravity_off_port_down", - "sp_port", - "gravity off port (leading down)" + "sp_gravity_off_port", + "gravity-off port (leading down)" }, { "sp_gravity_off_port_left", - "sp_port", - "gravity off port (leading left)" + "sp_gravity_off_port", + "gravity-off port (leading left)" }, { "sp_gravity_off_port_up", - "sp_port", - "gravity off port (leading up)" + "sp_gravity_off_port", + "gravity-off port (leading up)" }, { "balloon_switch_none", @@ -4453,6 +4484,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "quicksand", "fast quicksand (with rock)" }, + { + "from_level_template", + "from_level_template", + "element taken from level template" + }, /* ----------------------------------------------------------------------- */ /* "real" (and therefore drawable) runtime elements */ @@ -5074,6 +5110,46 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "sb_default", "-" }, + { + "graphic_1", + "graphic", + "-" + }, + { + "graphic_2", + "graphic", + "-" + }, + { + "graphic_3", + "graphic", + "-" + }, + { + "graphic_4", + "graphic", + "-" + }, + { + "graphic_5", + "graphic", + "-" + }, + { + "graphic_6", + "graphic", + "-" + }, + { + "graphic_7", + "graphic", + "-" + }, + { + "graphic_8", + "graphic", + "-" + }, { "internal_clipboard_custom", "internal", @@ -5370,6 +5446,7 @@ struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] = struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, }, + { ".LOADING", GFX_SPECIAL_ARG_LOADING, }, { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, }, { ".TITLE", GFX_SPECIAL_ARG_TITLE, }, { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, @@ -5440,6 +5517,8 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.game_info" }, { "font.info.elements" }, { "font.info.levelset" }, + + { NULL } }; @@ -5475,6 +5554,7 @@ static void print_usage() " --serveronly only start network server\n" " -v, --verbose verbose mode\n" " --debug display debugging information\n" + " --debug-x11-sync enable X11 synchronous mode\n" " -e, --execute COMMAND execute batch COMMAND\n" "\n" "Valid commands for '--execute' option:\n" @@ -5488,6 +5568,7 @@ static void print_usage() " \"dump tape FILE\" dump tape data from FILE\n" " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n" " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n" + " \"create images DIRECTORY\" write BMP images to DIRECTORY\n" "\n", program.command_basename); }