From a9022b5972dc49d86f617a27940fafe9c4d0e7e7 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 9 Jun 2011 13:46:28 +0000 Subject: Initial import of (very old) vidoom sources. --- editlump.c | 330 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 330 insertions(+) create mode 100644 editlump.c (limited to 'editlump.c') diff --git a/editlump.c b/editlump.c new file mode 100644 index 0000000..f55d269 --- /dev/null +++ b/editlump.c @@ -0,0 +1,330 @@ +/* + + viDOOM - level editor for DOOM + + Copyright (C) 2000 Ian Cowburn (ianc@noddybox.demon.co.uk) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------- + + Editor LUMP manipulations + +*/ +static const char rcs_id[]="$Id$"; + +#include "config.h" +#include "globals.h" +#include "editvar.h" +#include "platgui.h" +#include "runcmd.h" +#include "file.h" +#include "mem.h" +#include "util.h" + + +#define M_CANCEL -1 +#define M_SWITCH_DOOM 0 +#define M_SWITCH_HEXEN 1 +#define M_EDIT_MAPINFO 2 +#define M_EDIT_SCRIPTS 3 +#define M_MAKE_BEHAVIOR 4 + +static PLAT_MENU menu[6]; +static int no=0; + + +/* ---------------------------------------- PRIVATE UTILS +*/ +static void NewMenu(void) +{ + int f; + + for(f=0;ft.z=0; + + for(r=0;r<5;r++) + t->t.args[r]=0; + } + + for(f=0;fl.tag=0; + + for(r=0;r<5;r++) + l->l.args[r]=0; + } + } + break; + + case M_EDIT_MAPINFO: + { + char *new; + + if (!mapinfo) + mapinfo=Strdup(""); + + if ((new=GUI_text_edit("MAPINFO lump",mapinfo))) + { + Release(mapinfo); + mapinfo=new; + } + break; + } + + case M_EDIT_SCRIPTS: + { + char *new; + + if (!scripts) + scripts=Strdup(""); + + if ((new=GUI_text_edit("SCRIPTS lump",scripts))) + { + Release(scripts); + scripts=new; + scripts_size=strlen(scripts); + } + break; + } + + case M_MAKE_BEHAVIOR: + if (!scripts) + GUI_alert("Error","Need to create a script by editing|" + "it before it can be compiled","OK"); + else + MakeBehavior(); + break; + } + + if (redraw) + FullRedraw(); +} + + +/* END OF FILE */ -- cgit v1.2.3