From: Holger Schemel Date: Sun, 20 Dec 1998 21:54:15 +0000 (+0100) Subject: rnd-19981220-3 X-Git-Tag: 1.3.0^2~49 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=caf79a7cd47eeeb43746bdeae08ec5f738d3bf61;p=rocksndiamonds.git rnd-19981220-3 --- diff --git a/src/editor.c b/src/editor.c index 28d08635..a18b3976 100644 --- a/src/editor.c +++ b/src/editor.c @@ -48,6 +48,9 @@ #define RANDOM_USE_PERCENTAGE 0 #define RANDOM_USE_NUM_OBJECTS 1 +/* values for elements with content */ +#define MAX_ELEMCONT 8 + /* values for the control window */ #define ED_CTRL_BUTTONS_GFX_YPOS 236 #define ED_CTRL_BUTTONS_ALT_GFX_YPOS 142 @@ -114,8 +117,9 @@ #define ED_CTRL_ID_DRAWING_LEVEL 26 #define ED_CTRL_ID_ELEMCONT_0 27 #define ED_CTRL_ID_ELEMCONT_7 34 +#define ED_CTRL_ID_AMOEBA_CONTENT 35 -#define ED_NUM_GADGETS 35 +#define ED_NUM_GADGETS 36 /* values for counter gadgets */ #define ED_COUNTER_SCORE 0 @@ -137,7 +141,7 @@ static struct /* forward declaration for internal use */ static void DrawDrawingWindow(); -static void DrawPropertiesWindow(int); +static void DrawPropertiesWindow(); static void CopyLevelToUndoBuffer(); static void HandleDrawingAreas(struct GadgetInfo *); static void HandleCounterButtons(struct GadgetInfo *); @@ -147,8 +151,9 @@ static struct GadgetInfo *level_editor_gadget[ED_NUM_GADGETS]; static boolean level_editor_gadgets_created = FALSE; static int drawing_function = ED_CTRL_ID_SINGLE_ITEMS; +static int properties_element = 0; -static short ElementContent[8][3][3]; +static short ElementContent[MAX_ELEMCONT][3][3]; static short OrigBackup[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; static short UndoBuffer[NUM_UNDO_STEPS][MAX_LEV_FIELDX][MAX_LEV_FIELDY]; static int undo_buffer_position = 0; @@ -647,13 +652,15 @@ static void CreateDrawingAreas() { struct GadgetInfo *gi; unsigned long event_mask; - int id = ED_CTRL_ID_DRAWING_LEVEL; + int id; int i; event_mask = GD_EVENT_PRESSED | GD_EVENT_RELEASED | GD_EVENT_MOVING | GD_EVENT_OFF_BORDERS; + /* one for the level drawing area ... */ + id = ED_CTRL_ID_DRAWING_LEVEL; gi = CreateGadget(GDI_CUSTOM_ID, id, GDI_X, SX, GDI_Y, SY, @@ -670,12 +677,13 @@ static void CreateDrawingAreas() level_editor_gadget[id] = gi; - for (i=0; i<8; i++) + /* ... up to eight areas for element content ... */ + for (i=0; i 8) - *gadget_areas_value = 8; + else if (*gadget_areas_value > MAX_ELEMCONT) + *gadget_areas_value = MAX_ELEMCONT; DrawCounterValueField(ED_COUNTER_ELEMCONT, *gadget_areas_value); DrawElementContentAreas(); @@ -2629,7 +2692,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) break; case ED_CTRL_ID_PROPERTIES: - DrawPropertiesWindow(new_element); + properties_element = new_element; + DrawPropertiesWindow(); edit_mode = ED_MODE_PROPERTIES; break;