From: Holger Schemel Date: Thu, 24 Dec 1998 01:18:22 +0000 (+0100) Subject: rnd-19981224-1 X-Git-Tag: 1.3.0^2~47 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9cfd3853252303df85d4fb925993448788d03483;p=rocksndiamonds.git rnd-19981224-1 --- diff --git a/src/editor.c b/src/editor.c index f1536aae..54741f74 100644 --- a/src/editor.c +++ b/src/editor.c @@ -180,7 +180,8 @@ static int new_element1 = EL_MAUERWERK; static int new_element2 = EL_LEERRAUM; static int new_element3 = EL_ERDREICH; -int element_shift; +int element_shift = 0; + int editor_element[] = { EL_CHAR_A + ('B' - 'A'), @@ -472,7 +473,63 @@ int editor_element[] = EL_CHAR_OE, EL_CHAR_UE, - EL_CHAR_COPY + EL_CHAR_COPY, + EL_LEERRAUM, + + EL_LEERRAUM, + EL_LEERRAUM, + EL_LEERRAUM, + EL_LEERRAUM, + + EL_LEERRAUM, + EL_SP_ZONK, + EL_SP_BASE, + EL_SP_MURPHY, + + EL_SP_INFOTRON, + EL_SP_CHIP_SINGLE, + EL_SP_HARD_GRAY, + EL_SP_EXIT, + + EL_SP_DISK_ORANGE, + EL_SP_PORT1_RIGHT, + EL_SP_PORT1_DOWN, + EL_SP_PORT1_LEFT, + + EL_SP_PORT1_UP, + EL_SP_PORT2_RIGHT, + EL_SP_PORT2_DOWN, + EL_SP_PORT2_LEFT, + + EL_SP_PORT2_UP, + EL_SP_SNIKSNAK, + EL_SP_DISK_YELLOW, + EL_SP_TERMINAL, + + EL_SP_DISK_RED, + EL_SP_PORT_Y, + EL_SP_PORT_X, + EL_SP_PORT_XY, + + EL_SP_ELECTRON, + EL_SP_BUG, + EL_SP_CHIP_LEFT, + EL_SP_CHIP_RIGHT, + + EL_SP_HARD_BASE1, + EL_SP_HARD_GREEN, + EL_SP_HARD_BLUE, + EL_SP_HARD_RED, + + EL_SP_HARD_YELLOW, + EL_SP_HARD_BASE2, + EL_SP_HARD_BASE3, + EL_SP_HARD_BASE4, + + EL_SP_HARD_BASE5, + EL_SP_HARD_BASE6, + EL_SP_CHIP_UPPER, + EL_SP_CHIP_LOWER }; int elements_in_list = sizeof(editor_element)/sizeof(int); @@ -789,7 +846,6 @@ void DrawLevelEd() level_ypos=-1; edit_mode = ED_MODE_DRAWING; name_typing = FALSE; - element_shift = 0; CloseDoor(DOOR_CLOSE_ALL); @@ -829,7 +885,7 @@ void DrawLevelEd() for(i=0;i= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE) + { + graphic -= GFX_START_ROCKSMORE; + XCopyArea(display, pix[PIX_MORE], d, gc, + (graphic % MORE_PER_LINE) * TILEX, + (graphic / MORE_PER_LINE) * TILEY, + TILEX, TILEY, x, y); + } else if (graphic >= GFX_START_ROCKSHEROES && graphic <= GFX_END_ROCKSHEROES) { graphic -= GFX_START_ROCKSHEROES; @@ -677,6 +685,14 @@ void DrawGraphicThruMaskExt(Drawable d, int dest_x, int dest_y, int graphic) src_x = SX + (graphic % GFX_PER_LINE) * TILEX; src_y = SY + (graphic / GFX_PER_LINE) * TILEY; } + else if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE) + { + src_pixmap = pix[PIX_MORE]; + drawing_gc = clip_gc[PIX_MORE]; + graphic -= GFX_START_ROCKSMORE; + src_x = (graphic % MORE_PER_LINE) * TILEX; + src_y = (graphic / MORE_PER_LINE) * TILEY; + } else if (graphic >= GFX_START_ROCKSHEROES && graphic <= GFX_END_ROCKSHEROES) { src_pixmap = pix[PIX_HEROES]; @@ -726,6 +742,14 @@ void DrawMiniGraphicExt(Drawable d, GC gc, int x, int y, int graphic) MINI_GFX_STARTY + (graphic / MINI_GFX_PER_LINE) * MINI_TILEY, MINI_TILEX, MINI_TILEY, x, y); } + else if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE) + { + graphic -= GFX_START_ROCKSMORE; + XCopyArea(display, pix[PIX_MORE], d, gc, + MINI_MORE_STARTX + (graphic % MINI_MORE_PER_LINE) * MINI_TILEX, + MINI_MORE_STARTY + (graphic / MINI_MORE_PER_LINE) * MINI_TILEY, + MINI_TILEX, MINI_TILEY, x, y); + } else if (graphic >= GFX_START_ROCKSFONT && graphic <= GFX_END_ROCKSFONT) { graphic -= GFX_START_ROCKSFONT; @@ -827,6 +851,14 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, src_x = SX + (graphic % GFX_PER_LINE) * TILEX + cx; src_y = SY + (graphic / GFX_PER_LINE) * TILEY + cy; } + else if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE) + { + src_pixmap = pix[PIX_MORE]; + drawing_gc = clip_gc[PIX_MORE]; + graphic -= GFX_START_ROCKSMORE; + src_x = (graphic % MORE_PER_LINE) * TILEX + cx; + src_y = (graphic / MORE_PER_LINE) * TILEY + cy; + } else if (graphic >= GFX_START_ROCKSHEROES && graphic <= GFX_END_ROCKSHEROES) { src_pixmap = pix[PIX_HEROES]; @@ -1259,10 +1291,16 @@ void DrawMicroElement(int xpos, int ypos, int element) graphic = el2gfx(element); - XCopyArea(display, pix[PIX_BACK], drawto, gc, - MICRO_GFX_STARTX + (graphic % MICRO_GFX_PER_LINE) * MICRO_TILEX, - MICRO_GFX_STARTY + (graphic / MICRO_GFX_PER_LINE) * MICRO_TILEY, - MICRO_TILEX, MICRO_TILEY, xpos, ypos); + if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE) + XCopyArea(display, pix[PIX_MORE], drawto, gc, + MICRO_MORE_STARTX + (graphic % MICRO_MORE_PER_LINE) *MICRO_TILEX, + MICRO_MORE_STARTY + (graphic / MICRO_MORE_PER_LINE) *MICRO_TILEY, + MICRO_TILEX, MICRO_TILEY, xpos, ypos); + else + XCopyArea(display, pix[PIX_BACK], drawto, gc, + MICRO_GFX_STARTX + (graphic % MICRO_GFX_PER_LINE) * MICRO_TILEX, + MICRO_GFX_STARTY + (graphic / MICRO_GFX_PER_LINE) * MICRO_TILEY, + MICRO_TILEX, MICRO_TILEY, xpos, ypos); } void DrawLevel() @@ -1877,6 +1915,8 @@ int el2gfx(int element) { if (IS_CHAR(element)) return GFX_CHAR_START + (element - EL_CHAR_START); + else if (element >= EL_SP_START && element <= EL_SP_END) + return GFX_START_ROCKSMORE + (element - EL_SP_START); else return -1; }