X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=952dbc6866bacbde8eb5b22aa7e37af026779447;hb=c6f9fba81fc59eff4b6b454dff92adecd28a7ad5;hp=6dc35c7c3270b3ecc6102684314bed2c30d92c1c;hpb=ab939d25272479b99688fb27fd9c09dbbe05b2bb;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 6dc35c7c..952dbc68 100644 --- a/src/editor.c +++ b/src/editor.c @@ -754,7 +754,7 @@ int editor_element[] = EL_CHAR('S'), EL_CHAR('H'), - EL_PLAYER, + EL_PLAYER1, EL_EMPTY, EL_SAND, EL_STEELWALL, @@ -799,7 +799,7 @@ int editor_element[] = EL_PLAYER3, EL_PLAYER4, - EL_PLAYER, + EL_PLAYER1, EL_EMPTY, EL_SAND, EL_ROCK, @@ -1182,10 +1182,70 @@ int editor_element[] = EL_CHAR('R'), */ - EL_EMPTY, - EL_EMPTY, - EL_EMPTY, - EL_EMPTY, + EL_CHAR('C'), + EL_CHAR('U'), + EL_CHAR('S'), + EL_CHAR('-'), + + EL_CHAR('T'), + EL_CHAR('O'), + EL_CHAR('M'), + EL_CHAR(' '), + + EL_CHAR('E'), + EL_CHAR('L'), + EL_CHAR('E'), + EL_CHAR('M'), + + EL_CHAR('E'), + EL_CHAR('N'), + EL_CHAR('T'), + EL_CHAR('S'), + + EL_GENERIC_START + 0, + EL_GENERIC_START + 1, + EL_GENERIC_START + 2, + EL_GENERIC_START + 3, + + EL_GENERIC_START + 4, + EL_GENERIC_START + 5, + EL_GENERIC_START + 6, + EL_GENERIC_START + 7, + + EL_GENERIC_START + 8, + EL_GENERIC_START + 9, + EL_GENERIC_START + 10, + EL_GENERIC_START + 11, + + EL_GENERIC_START + 12, + EL_GENERIC_START + 13, + EL_GENERIC_START + 14, + EL_GENERIC_START + 15, + + EL_GENERIC_START + 16, + EL_GENERIC_START + 17, + EL_GENERIC_START + 18, + EL_GENERIC_START + 19, + + EL_GENERIC_START + 20, + EL_GENERIC_START + 21, + EL_GENERIC_START + 22, + EL_GENERIC_START + 23, + + EL_GENERIC_START + 24, + EL_GENERIC_START + 25, + EL_GENERIC_START + 26, + EL_GENERIC_START + 27, + + EL_GENERIC_START + 28, + EL_GENERIC_START + 29, + EL_GENERIC_START + 30, + EL_GENERIC_START + 31, + + EL_CHAR('T'), + EL_CHAR('E'), + EL_CHAR('X'), + EL_CHAR('T'), EL_CHAR(' '), EL_CHAR('!'), @@ -1265,7 +1325,12 @@ int editor_element[] = EL_CHAR('Ö'), EL_CHAR('Ü'), EL_CHAR('^'), - EL_CHAR(' ') + EL_CHAR('_'), + + EL_CHAR(' '), + EL_CHAR('°'), + EL_CHAR('´'), + EL_CHAR('|') }; int elements_in_list = sizeof(editor_element)/sizeof(int); @@ -1273,7 +1338,8 @@ static char *getElementInfoText(int element) { char *info_text = "unknown"; - if (element < NUM_FILE_ELEMENTS) + if (element < NUM_FILE_ELEMENTS && + element_info[element].editor_description != NULL) info_text = element_info[element].editor_description; else Error(ERR_WARN, "no element description for element %d", element); @@ -1313,7 +1379,7 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll) static void CreateControlButtons() { - Bitmap *gd_bitmap = pix[PIX_DOOR]; + Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap; struct GadgetInfo *gi; unsigned long event_mask; int i; @@ -1490,7 +1556,7 @@ static void CreateControlButtons() gd_x2 = DOOR_GFX_PAGEX6 + ED_ELEMENTLIST_XPOS; gd_y = DOOR_GFX_PAGEY1 + ED_ELEMENTLIST_YPOS; - getMiniGraphicSource(el2gfx(editor_element[i]), + getMiniGraphicSource(el2img(editor_element[i]), &deco_bitmap, &deco_x, &deco_y); deco_xpos = (ED_ELEMENTLIST_XSIZE - MINI_TILEX) / 2; deco_ypos = (ED_ELEMENTLIST_YSIZE - MINI_TILEY) / 2; @@ -1534,7 +1600,7 @@ static void CreateCounterButtons() for (j=0; j<2; j++) { - Bitmap *gd_bitmap = pix[PIX_DOOR]; + Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap; struct GadgetInfo *gi; int id = (j == 0 ? counterbutton_info[i].gadget_id_down : @@ -1756,7 +1822,7 @@ static void CreateTextInputGadgets() for (i=0; i= 0 && x - level_xpos < ed_fieldx && @@ -3475,11 +3591,11 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) DrawMiniGraphicExt(drawto, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, - el2gfx(new_element)); + el2img(new_element)); DrawMiniGraphicExt(window, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, - el2gfx(new_element)); + el2img(new_element)); if (id == GADGET_ID_AMOEBA_CONTENT) level.amoeba_content = new_element; @@ -3801,7 +3917,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) int element = editor_element[element_shift + i]; UnmapGadget(gi); - getMiniGraphicSource(el2gfx(element), &gd->bitmap, &gd->x, &gd->y); + getMiniGraphicSource(el2img(element), &gd->bitmap, &gd->x, &gd->y); ModifyGadget(gi, GDI_INFO_TEXT, getElementInfoText(element), GDI_END); MapGadget(gi); } @@ -4062,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, @@ -4259,7 +4401,7 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed) else { CloseDoor(DOOR_CLOSE_1); - BlitBitmap(pix[PIX_DB_DOOR], pix[PIX_DB_DOOR], + BlitBitmap(bitmap_db_door, bitmap_db_door, DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE,DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); OpenDoor(DOOR_OPEN_1);