/* 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 ------------------------------------------------------------------------- Doom I/II editor */ static const char rcs_id[]="$Id$"; #include "config.h" #include "globals.h" #include #include #include #include "wad.h" #include "platgui.h" #include "gui.h" #include "gfx.h" #include "file.h" #include "mem.h" #include "edit.h" #include "texture.h" #include "things.h" #include "runcmd.h" /* ---------------------------------------- VARS */ static WadMap *wad=NULL; static char mapname[32]="NONE"; static GFX_IMAGE doom_image; /* Menu for asking game type */ static PLAT_MENU game_type_menu[]= { {"Doom", DOOM}, {"Ultimate Doom", ULTIMATE_DOOM}, {"Doom II", DOOM_2}, {"TNT:Evilution", FINAL_TNT}, {"The Plutonia Experiment", FINAL_PLUTONIA}, {"ZDoom", ZDOOM}, {NULL,0} }; /* ---------------------------------------- PROTOS */ static void MainMenu(void); static void GPL_clear(void); /* ---------------------------------------- MAIN */ int viDOOM(int argc,char *argv[]) { char *load,*p; int f; GFX_init(); GFX_clear_XOR_mode(); if (GFX_mouse_buttons()<2) GFX_exit(EXIT_FAILURE,"viDOOM expects at least a 2-button mouse\n"); LoadGlobalsPart1(); if ((disp_width<640)||(disp_height<480)) GFX_exit(EXIT_FAILURE,"viDOOM expects at least a display of 640x480\n"); GFX_open(disp_width,disp_height); EditSetScreen(disp_width,disp_height); GuiSetScreen(disp_width,disp_height); GUI_setscreen(disp_width,disp_height); GPL_clear(); /* Ask for game type? */ if (ask_for_game_type) { int new; GFX_redraw(); new=GUI_menu("Select type of game to edit", disp_width/2,disp_height/2,game_type_menu,-666); if (new!=-666) game=(GameType)new; } LoadGlobalsPart2(); if (AddIWAD(IWAD_path)!=WAD_OK) { GuiInfoBox("ERROR","AddIWAD(%s): %s",IWAD_path,WadErrorString()); GFX_close(); return(EXIT_FAILURE); } /* Read in resource WADS from preloaded config */ if (PWAD_preload[0]) { load=Strdup(PWAD_preload); p=strtok(load,";"); while(p) { if (AddPWAD(p)!=WAD_OK) GuiInfoBox("ERROR","AddPWAD(%s): %s",p,WadErrorString()); p=strtok(NULL,";"); } Release(load); } /* Read in WADS from command line */ for(f=1;fname,wd->off,wd->size,Basename(wd->wad)); list[f++]=Strdup(s); } list[f]=NULL; GUI_picklist("WAD DIR (Name, Offset, Size, WAD file)",list); f=0; while(list[f]) Release(list[f++]); Release(list); break; } case MENU_PREVIEW: { char *name; WadMap *preview; if ((name=GuiPickLevel("Pick map to preview"))) if (!(preview=LoadMap(name))) GuiInfoBox("ERROR","LoadMap(%s): %s", name,WadErrorString()); else { EditPreviewWadMap(name,preview); preview=ClearMap(preview); } break; } case MENU_ABOUT: GuiInfoBox ("viDOOM " VIDOOMVER " " VIDOOMRELEASE, "Copyright (c) 2000 Ian Cowburn|" "http://www.noddybox.demon.co.uk/vidoom/| |" "viDOOM comes with ABSOLUTELY NO WARRANTY.|" "For details see LICENSE.| |" "This is free software, and you are welcome|" "to redistribute it under certain conditions.|" "See LICENSE for details.| |" "DOOM, Ultimate DOOM, DOOM 2 and Final DOOM|" "(c) id Software.|" "http://www.idsoftware.com/| |" "Levels in DOOM, DOOM 2 and Ultimate DOOM|" "designed by id Software.| |" "Levels in The Plutonia Experiment designed by|" "Milo & Dario Casali whilst in Team TNT.| |" "Levels in TNT:Evilution designed by|" "various members of Team TNT. Get details at|" "http://www.teamtnt.com/| |" "Thanks to all concerned for some of my favourite|" "Lovecraftian Dark Evil Places.| |" "viDOOM will only work if you have the registered|" "version of any of the follow id Sofwtare games:|" "DOOM, Ultimate DOOM, DOOM 2 or Final DOOM"); break; case MENU_QUIT: if ((map_exit_warn)&&(editted)) quit=GUI_yesno("Map may have been changed " "- really quit?"); else quit=TRUE; break; #ifdef DEBUG case MENU_DEBUG: GuiInfoBox("DEBUG", "block_bit=%d|" "block_mask=%d|" "side2_bit=%d|" "side2_mask=%d|" "upper_bit=%d|" "upper_mask=%d|" "lower_bit=%d|" "lower_mask=%d|" "empty_texture='%s'|" "", block_bit,block_mask, side2_bit,side2_mask, upper_peg_bit,upper_peg_mask, lower_peg_bit,lower_peg_mask, empty_texture); break; #endif default: break; } } } /* END OF FILE */