From: Holger Schemel Date: Sun, 15 Dec 2002 01:57:56 +0000 (+0100) Subject: rnd-20021215-1-src X-Git-Tag: 3.0.0^2~202 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c6f9fba81fc59eff4b6b454dff92adecd28a7ad5;p=rocksndiamonds.git rnd-20021215-1-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 5fedea5a..8b43852e 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -830,6 +830,7 @@ struct ConfigInfo image_config[] = { "amoeba.creating.frames", "3" }, { "amoeba.creating.delay", "2" }, { "amoeba.creating.mode_linear", "1" }, + { "amoeba.creating.global_sync", "0" }, { "amoeba.shrinking", "RocksElements.pcx" }, { "amoeba.shrinking.xpos", "5" }, { "amoeba.shrinking.ypos", "6" }, @@ -837,6 +838,7 @@ struct ConfigInfo image_config[] = { "amoeba.shrinking.delay", "2" }, { "amoeba.shrinking.mode_linear", "1" }, { "amoeba.shrinking.mode_reverse", "1" }, + { "amoeba.shrinking.global_sync", "0" }, { "amoeba_wet", "RocksElements.pcx" }, { "amoeba_wet.xpos", "8" }, { "amoeba_wet.ypos", "6" }, @@ -1015,7 +1017,7 @@ struct ConfigInfo image_config[] = { "balloon_send_down.ypos", "7" }, { "balloon_send_down.frames", "1" }, { "balloon_send_any_direction", "RocksDC.pcx" }, - { "balloon_send_any_direction.xpos", "7" }, + { "balloon_send_any_direction.xpos", "15" }, { "balloon_send_any_direction.ypos", "0" }, { "balloon_send_any_direction.frames", "1" }, @@ -1663,24 +1665,28 @@ struct ConfigInfo image_config[] = { "wall_growing_active_left.ypos", "10" }, { "wall_growing_active_left.frames", "3" }, { "wall_growing_active_left.delay", "6" }, + { "wall_growing_active_left.mode_linear", "1" }, { "wall_growing_active_left.global_sync", "0" }, { "wall_growing_active_right", "RocksElements.pcx" }, { "wall_growing_active_right.xpos", "5" }, { "wall_growing_active_right.ypos", "10" }, { "wall_growing_active_right.frames", "3" }, { "wall_growing_active_right.delay", "6" }, + { "wall_growing_active_right.mode_linear", "1" }, { "wall_growing_active_right.global_sync", "0" }, { "wall_growing_active_up", "RocksHeroes.pcx" }, { "wall_growing_active_up.xpos", "3" }, { "wall_growing_active_up.ypos", "12" }, { "wall_growing_active_up.frames", "3" }, { "wall_growing_active_up.delay", "6" }, + { "wall_growing_active_up.mode_linear", "1" }, { "wall_growing_active_up.global_sync", "0" }, { "wall_growing_active_down", "RocksHeroes.pcx" }, { "wall_growing_active_down.xpos", "0" }, { "wall_growing_active_down.ypos", "12" }, { "wall_growing_active_down.frames", "3" }, { "wall_growing_active_down.delay", "6" }, + { "wall_growing_active_down.mode_linear", "1" }, { "wall_growing_active_down.global_sync", "0" }, { "black_orb", "RocksElements.pcx" }, @@ -2550,6 +2556,32 @@ struct ConfigInfo image_config[] = { "menu.font_medium", "RocksFontMedium.pcx" }, { "menu.font_em", "RocksFontEM.pcx" }, + { "info.font_em_1", "RocksFontEM.pcx" }, + { "info.font_em_1.xpos", "0" }, + { "info.font_em_1.ypos", "0" }, + { "info.font_em_1.frames", "16" }, + { "info.font_em_1.delay", "10" }, + { "info.font_em_2", "RocksFontEM.pcx" }, + { "info.font_em_2.xpos", "0" }, + { "info.font_em_2.ypos", "1" }, + { "info.font_em_2.frames", "16" }, + { "info.font_em_2.delay", "10" }, + { "info.font_em_3", "RocksFontEM.pcx" }, + { "info.font_em_3.xpos", "0" }, + { "info.font_em_3.ypos", "2" }, + { "info.font_em_3.frames", "16" }, + { "info.font_em_3.delay", "10" }, + { "info.font_em_4", "RocksFontEM.pcx" }, + { "info.font_em_4.xpos", "0" }, + { "info.font_em_4.ypos", "3" }, + { "info.font_em_4.frames", "16" }, + { "info.font_em_4.delay", "10" }, + { "info.font_em_5", "RocksFontEM.pcx" }, + { "info.font_em_5.xpos", "0" }, + { "info.font_em_5.ypos", "4" }, + { "info.font_em_5.frames", "4" }, + { "info.font_em_5.delay", "10" }, + { "old.pix_elements", "RocksElements.pcx" }, { "old.pix_heroes", "RocksHeroes.pcx" }, { "old.pix_sp", "RocksSP.pcx" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index b2fe3673..0a98f7f8 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -659,13 +659,18 @@ #define IMG_MENU_FONT_SMALL 638 #define IMG_MENU_FONT_MEDIUM 639 #define IMG_MENU_FONT_EM 640 -#define IMG_OLD_PIX_ELEMENTS 641 -#define IMG_OLD_PIX_HEROES 642 -#define IMG_OLD_PIX_SP 643 -#define IMG_OLD_PIX_DC 644 -#define IMG_OLD_PIX_MORE 645 -#define IMG_OLD_PIX_FONT_EM 646 +#define IMG_INFO_FONT_EM_1 641 +#define IMG_INFO_FONT_EM_2 642 +#define IMG_INFO_FONT_EM_3 643 +#define IMG_INFO_FONT_EM_4 644 +#define IMG_INFO_FONT_EM_5 645 +#define IMG_OLD_PIX_ELEMENTS 646 +#define IMG_OLD_PIX_HEROES 647 +#define IMG_OLD_PIX_SP 648 +#define IMG_OLD_PIX_DC 649 +#define IMG_OLD_PIX_MORE 650 +#define IMG_OLD_PIX_FONT_EM 651 -#define NUM_IMAGE_FILES 647 +#define NUM_IMAGE_FILES 652 #endif /* CONF_GFX_H */ diff --git a/src/conftime.h b/src/conftime.h index 722ce91f..26b62252 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-12-11 23:34]" +#define COMPILE_DATE_STRING "[2002-12-15 02:57]" diff --git a/src/editor.c b/src/editor.c index cbf6de4a..952dbc68 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2649,6 +2649,43 @@ static void DrawElementContentAreas() MapDrawingArea(GADGET_ID_ELEM_CONTENT_0 + i); } +#if 0 +static void DrawPropertiesElement(int xstart, int ystart, int element) +{ + int x, y; + + /* draw some decorative border for the object */ + for (y=0; y<3; y++) + for (x=0; x<3; x++) + DrawMiniElement(xstart + x , ystart + y, EL_SAND); + + ClearRectangle(drawto, + SX + xstart * MINI_TILEX + MINI_TILEX/2 - 1, + SY + ystart * MINI_TILEY + MINI_TILEY/2 - 1, + TILEX + 2, TILEY + 2); + + /* copy border to the right location */ + BlitBitmap(drawto, drawto, + SX + xstart * MINI_TILEX, + SY + ystart * MINI_TILEY, + 2 * TILEX, 2 * TILEY, + SX + xstart * MINI_TILEX - MINI_TILEX/2, + SY + ystart * MINI_TILEY - MINI_TILEY/2); + + DrawGraphicAnimation(xstart / 2, ystart / 2, el2img(element)); + + /* copy the whole stuff to the definitive location */ + BlitBitmap(drawto, drawto, + SX + xstart * MINI_TILEX - MINI_TILEX/2, + SY + ystart * MINI_TILEY - MINI_TILEY, + 2 * TILEX, 2 * TILEY, + SX + xstart * MINI_TILEX - MINI_TILEX/2, + SY + ystart * MINI_TILEY - MINI_TILEY/2); + + FrameCounter++; /* increase animation frame counter */ +} +#endif + #define TEXT_COLLECTING "Score for collecting" #define TEXT_SMASHING "Score for smashing" #define TEXT_CRACKING "Score for cracking" @@ -2729,6 +2766,7 @@ static void DrawPropertiesWindow() DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS_YPOS, "Element Settings", FS_BIG, FC_YELLOW); +#if 1 /* draw some decorative border for the object */ for (y=0; y<3; y++) for (x=0; x<3; x++) @@ -2747,7 +2785,11 @@ static void DrawPropertiesWindow() SX + xstart * MINI_TILEX - MINI_TILEX/2, SY + ystart * MINI_TILEY - MINI_TILEY/2); +#if 0 DrawGraphic(xstart / 2, ystart / 2, el2img(properties_element), 0); +#else + DrawGraphicAnimation(xstart / 2, ystart / 2, el2img(properties_element)); +#endif /* copy the whole stuff to the definitive location */ BlitBitmap(drawto, drawto, @@ -2757,6 +2799,15 @@ static void DrawPropertiesWindow() SX + xstart * MINI_TILEX - MINI_TILEX/2, SY + ystart * MINI_TILEY - MINI_TILEY/2); + FrameCounter = 0; /* restart animation frame counter */ + +#else + + FrameCounter = 0; /* restart animation frame counter */ + DrawPropertiesElement(xstart, ystart, properties_element); + +#endif + DrawTextF((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY, font_color, getElementInfoText(properties_element)); @@ -4127,6 +4178,32 @@ void HandleLevelEditorKeyInput(Key key) } } +void HandleLevelEditorIdle() +{ + static unsigned long action_delay = 0; + unsigned long action_delay_value = GameFrameDelay; + int xpos = 1, ypos = 2; + + if (edit_mode != ED_MODE_PROPERTIES) + return; + + if (!DelayReached(&action_delay, action_delay_value)) + return; + + FY += MINI_TILEY / 2; +#if 1 + DrawGraphicAnimation(xpos, ypos, el2img(properties_element)); +#else + DrawGraphicAnimation(xpos, ypos, el_dir_act2img(properties_element, + MV_NO_MOVING, + ...)); +#endif + FY -= MINI_TILEY / 2; + MarkTileDirty(xpos, ypos + 1); + + FrameCounter++; /* increase animation frame counter */ +} + void ClearEditorGadgetInfoText() { ClearRectangle(drawto, diff --git a/src/editor.h b/src/editor.h index 7966bda1..d2338f15 100644 --- a/src/editor.h +++ b/src/editor.h @@ -28,6 +28,7 @@ void CreateLevelEditorGadgets(); void UnmapLevelEditorGadgets(); void DrawLevelEd(void); void HandleLevelEditorKeyInput(Key); +void HandleLevelEditorIdle(); void HandleEditorGadgetInfoText(void *ptr); void RequestExitLevelEditor(boolean); diff --git a/src/events.c b/src/events.c index fc6140fc..8daab243 100644 --- a/src/events.c +++ b/src/events.c @@ -871,6 +871,10 @@ void HandleJoystick() HandleHelpScreen(!newbutton); break; + case LEVELED: + HandleLevelEditorIdle(); + break; + case PLAYING: if (tape.playing || keyboard) newbutton = ((joy & JOY_BUTTON) != 0); diff --git a/src/screens.c b/src/screens.c index 6e2948aa..0532cdd1 100644 --- a/src/screens.c +++ b/src/screens.c @@ -435,8 +435,8 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) static long helpscreen_state; static int helpscreen_step[MAX_HELPSCREEN_ELS]; static int helpscreen_frame[MAX_HELPSCREEN_ELS]; -static int helpscreen_delay[MAX_HELPSCREEN_ELS]; -static int helpscreen_action[] = +#if 0 +static int OLD_helpscreen_action[] = { GFX_SPIELER1_DOWN,4,2, GFX_SPIELER1_UP,4,2, @@ -544,6 +544,219 @@ static int helpscreen_action[] = GFX_SPEED_PILL,1,100, HA_NEXT, HA_END }; +#endif + +static int helpscreen_action[] = +{ + IMG_PLAYER1_DOWN_MOVING, 16, + IMG_PLAYER1_UP_MOVING, 16, + IMG_PLAYER1_LEFT_MOVING, 16, + IMG_PLAYER1_RIGHT_MOVING, 16, + IMG_PLAYER1_LEFT_PUSHING, 16, + IMG_PLAYER1_RIGHT_PUSHING, 16, HA_NEXT, + + IMG_SAND, -1, HA_NEXT, + + IMG_EMPTY_SPACE, -1, HA_NEXT, + + IMG_QUICKSAND_EMPTY, -1, HA_NEXT, + + IMG_STEELWALL, -1, HA_NEXT, + + IMG_WALL, -1, HA_NEXT, + + IMG_WALL_GROWING_ACTIVE_LEFT, 20, + IMG_WALL, 50, + IMG_EMPTY_SPACE, 20, + IMG_WALL_GROWING_ACTIVE_RIGHT, 20, + IMG_WALL, 50, + IMG_EMPTY_SPACE, 20, + IMG_WALL_GROWING_ACTIVE_UP, 20, + IMG_WALL, 50, + IMG_EMPTY_SPACE, 20, + IMG_WALL_GROWING_ACTIVE_DOWN, 20, + IMG_WALL, 50, + IMG_EMPTY_SPACE, 20, HA_NEXT, + + IMG_INVISIBLE_WALL, -1, HA_NEXT, + + IMG_WALL_CRUMBLED, -1, HA_NEXT, + + IMG_INFO_FONT_EM_1, 160, + IMG_INFO_FONT_EM_2, 160, + IMG_INFO_FONT_EM_3, 160, + IMG_INFO_FONT_EM_4, 160, + IMG_INFO_FONT_EM_5, 40, HA_NEXT, + + IMG_EMERALD, -1, HA_NEXT, + + IMG_DIAMOND, -1, HA_NEXT, + + IMG_BD_DIAMOND, -1, HA_NEXT, + + IMG_EMERALD_YELLOW, 50, + IMG_EMERALD_RED, 50, + IMG_EMERALD_PURPLE, 50, HA_NEXT, + + IMG_BD_ROCK, -1, HA_NEXT, + + IMG_BOMB, 100, + IMG_EXPLOSION, 16, + IMG_EMPTY_SPACE, 10, HA_NEXT, + + IMG_NUT, 100, + IMG_NUT_CRACKING, 6, + IMG_EMERALD, 20, HA_NEXT, + + IMG_WALL_EMERALD, 100, + IMG_EXPLOSION, 16, + IMG_EMERALD, 20, HA_NEXT, + + IMG_WALL_DIAMOND, 100, + IMG_EXPLOSION, 16, + IMG_DIAMOND, 20, HA_NEXT, + + IMG_WALL_BD_DIAMOND, 100, + IMG_EXPLOSION, 16, + IMG_BD_DIAMOND, 20, HA_NEXT, + + IMG_WALL_EMERALD_YELLOW, 100, + IMG_EXPLOSION, 16, + IMG_EMERALD_YELLOW, 20, + IMG_WALL_EMERALD_RED, 100, + IMG_EXPLOSION, 16, + IMG_EMERALD_RED, 20, + IMG_WALL_EMERALD_PURPLE, 100, + IMG_EXPLOSION, 16, + IMG_EMERALD_PURPLE, 20, HA_NEXT, + + IMG_ACID, -1, HA_NEXT, + + IMG_KEY1, 50, + IMG_KEY2, 50, + IMG_KEY3, 50, + IMG_KEY4, 50, HA_NEXT, + + IMG_GATE1, 50, + IMG_GATE2, 50, + IMG_GATE3, 50, + IMG_GATE4, 50, HA_NEXT, + + IMG_GATE1_GRAY, 50, + IMG_GATE2_GRAY, 50, + IMG_GATE3_GRAY, 50, + IMG_GATE4_GRAY, 50, HA_NEXT, + + IMG_DYNAMITE, -1, HA_NEXT, + + IMG_DYNAMITE_ACTIVE, 96, + IMG_EXPLOSION, 16, + IMG_EMPTY_SPACE, 20, HA_NEXT, + + IMG_DYNABOMB_ACTIVE, 100, + IMG_EXPLOSION, 16, + IMG_EMPTY_SPACE, 20, HA_NEXT, + + IMG_DYNABOMB_NR, -1, HA_NEXT, + + IMG_DYNABOMB_SZ, -1, HA_NEXT, + + IMG_SPACESHIP_RIGHT, 16, + IMG_SPACESHIP_UP, 16, + IMG_SPACESHIP_LEFT, 16, + IMG_SPACESHIP_DOWN, 16, HA_NEXT, + + IMG_BUG_RIGHT, 16, + IMG_BUG_UP, 16, + IMG_BUG_LEFT, 16, + IMG_BUG_DOWN, 16, HA_NEXT, + + IMG_BD_BUTTERFLY, -1, HA_NEXT, + + IMG_BD_FIREFLY, -1, HA_NEXT, + + IMG_PACMAN_RIGHT, 16, + IMG_PACMAN_UP, 16, + IMG_PACMAN_LEFT, 16, + IMG_PACMAN_DOWN, 16, HA_NEXT, + + IMG_YAMYAM, -1, HA_NEXT, + + IMG_DARK_YAMYAM, -1, HA_NEXT, + + IMG_ROBOT, -1, HA_NEXT, + + IMG_MOLE_RIGHT_MOVING, 16, + IMG_MOLE_UP_MOVING, 16, + IMG_MOLE_LEFT_MOVING, 16, + IMG_MOLE_DOWN_MOVING, 16, HA_NEXT, + + IMG_PENGUIN_RIGHT_MOVING, 16, + IMG_PENGUIN_UP_MOVING, 16, + IMG_PENGUIN_LEFT_MOVING, 16, + IMG_PENGUIN_DOWN_MOVING, 16, HA_NEXT, + + IMG_PIG_RIGHT_MOVING, 16, + IMG_PIG_UP_MOVING, 16, + IMG_PIG_LEFT_MOVING, 16, + IMG_PIG_DOWN_MOVING, 16, HA_NEXT, + + IMG_DRAGON_RIGHT_MOVING, 16, + IMG_DRAGON_UP_MOVING, 16, + IMG_DRAGON_LEFT_MOVING, 16, + IMG_DRAGON_DOWN_MOVING, 16, HA_NEXT, + + IMG_SATELLITE, -1, HA_NEXT, + + IMG_ROBOT_WHEEL, 50, + IMG_ROBOT_WHEEL_ACTIVE, 100, HA_NEXT, + + IMG_LAMP, 50, + IMG_LAMP_ACTIVE, 50, HA_NEXT, + + IMG_TIME_ORB_FULL, 50, + IMG_TIME_ORB_EMPTY, 50, HA_NEXT, + + IMG_AMOEBA_DROP, 50, + IMG_AMOEBA_CREATING, 6, + IMG_AMOEBA_WET, 20, HA_NEXT, + + IMG_AMOEBA_DEAD, -1, HA_NEXT, + + IMG_AMOEBA_WET, -1, HA_NEXT, + + IMG_AMOEBA_WET, 100, + IMG_AMOEBA_CREATING, 6, HA_NEXT, + + IMG_AMOEBA_FULL, 50, + IMG_AMOEBA_DEAD, 50, + IMG_EXPLOSION, 16, + IMG_DIAMOND, 20, HA_NEXT, + + IMG_GAMEOFLIFE, -1, HA_NEXT, + + IMG_BIOMAZE, -1, HA_NEXT, + + IMG_MAGIC_WALL_ACTIVE, -1, HA_NEXT, + + IMG_BD_MAGIC_WALL_ACTIVE, -1, HA_NEXT, + + IMG_EXIT_CLOSED, 200, + IMG_EXIT_OPENING, 16, + IMG_EXIT_OPEN, 100, HA_NEXT, + + IMG_EXIT_OPEN, -1, HA_NEXT, + + IMG_SOKOBAN_OBJECT, -1, HA_NEXT, + + IMG_SOKOBAN_FIELD_EMPTY, -1, HA_NEXT, + + IMG_SOKOBAN_FIELD_FULL, -1, HA_NEXT, + + IMG_SPEED_PILL, -1, HA_NEXT, + + HA_END +}; static char *helpscreen_eltext[][2] = { {"THE HERO:", "(Is _this_ guy good old Rockford?)"}, @@ -608,7 +821,7 @@ static char *helpscreen_eltext[][2] = {"Sokoban element: Field with object", "which can be pushed away"}, {"Speed pill: Lets the player run", "twice as fast as normally"}, }; -static int num_helpscreen_els = sizeof(helpscreen_eltext)/(2*sizeof(char *)); +static int num_helpscreen_els = sizeof(helpscreen_eltext) / (2*sizeof(char *)); static char *helpscreen_music[][3] = { @@ -623,7 +836,8 @@ static char *helpscreen_music[][3] = static int num_helpscreen_music = 7; static int helpscreen_musicpos; -void DrawHelpScreenElAction(int start) +#if 0 +void OLD_DrawHelpScreenElAction(int start) { int i = 0, j = 0; int frame, graphic; @@ -685,6 +899,81 @@ void DrawHelpScreenElAction(int start) MarkTileDirty(1,i); } } +#endif + +void DrawHelpScreenElAction(int start) +{ + int i = 0, j = 0; + int xstart = SX + 16; + int ystart = SY + 64 + 2 * 32; + int ystep = TILEY + 4; + int graphic; + int frame_count; + int sync_frame; + int frame; + + while (helpscreen_action[j] != HA_END) + { + if (i >= start + MAX_HELPSCREEN_ELS || i >= num_helpscreen_els) + break; + else if (i < start) + { + while (helpscreen_action[j] != HA_NEXT) + j++; + + j++; + i++; + + continue; + } + + j += 2 * helpscreen_step[i-start]; + graphic = helpscreen_action[j++]; + frame_count = helpscreen_action[j++]; + if (frame_count == -1) + frame_count = 1000000; + + if (helpscreen_frame[i-start] == 0) + { + sync_frame = 0; + helpscreen_frame[i-start] = frame_count - 1; + } + else + { + sync_frame = frame_count - helpscreen_frame[i-start]; + helpscreen_frame[i-start]--; + } + + if (helpscreen_action[j] == HA_NEXT) + { + if (!helpscreen_frame[i-start]) + helpscreen_step[i-start] = 0; + } + else + { + if (!helpscreen_frame[i-start]) + helpscreen_step[i-start]++; + while(helpscreen_action[j] != HA_NEXT) + j++; + } + j++; + + frame = getGraphicAnimationFrame(graphic, sync_frame); + + DrawGraphicExt(drawto, xstart, ystart + (i-start) * ystep, + graphic, frame); + + i++; + } + + for(i=2; i<16; i++) + { + MarkTileDirty(0, i); + MarkTileDirty(1, i); + } + + FrameCounter++; +} void DrawHelpScreenElText(int start) { @@ -812,7 +1101,7 @@ void DrawHelpScreen() CloseDoor(DOOR_CLOSE_2); for(i=0;i