// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id:$ // // Copyright (C) 1993-1996 by id Software, Inc. // // This source is available for distribution and/or modification // only under the terms of the DOOM Source Code License as // published by id Software. All rights reserved. // // The source is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License // for more details. // // DESCRIPTION: // Setup a game, startup stuff. // //----------------------------------------------------------------------------- #ifndef __P_SETUP__ #define __P_SETUP__ #include "w_wad.h" #include "files.h" #include "doomdata.h" struct MapData { wadlump_t MapLumps[ML_MAX]; bool HasBehavior; bool CloseOnDestruct; bool Encrypted; bool isText; int lumpnum; FileReader * file; MapData() { memset(MapLumps, 0, sizeof(MapLumps)); file = NULL; lumpnum = -1; HasBehavior = false; CloseOnDestruct = true; Encrypted = false; isText = false; } ~MapData() { if (CloseOnDestruct && file != NULL) delete file; file = NULL; } void Seek(unsigned int lumpindex) { if (lumpindexSeek(MapLumps[lumpindex].FilePos, SEEK_SET); } } void Read(unsigned int lumpindex, void * buffer, int size = -1) { if (lumpindexSeek(MapLumps[lumpindex].FilePos, SEEK_SET); file->Read(buffer, size); } } DWORD Size(unsigned int lumpindex) { if (lumpindex