//----------------------------------------------------------------------------- // // Copyright 1993-1996 id Software // Copyright 1999-2016 Randy Heit // Copyright 2002-2016 Christoph Oelckers // // 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 3 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, see http://www.gnu.org/licenses/ // //----------------------------------------------------------------------------- // // DESCRIPTION: // Setup a game, startup stuff. // //----------------------------------------------------------------------------- #ifndef __P_SETUP__ #define __P_SETUP__ #include "resourcefiles/resourcefile.h" #include "doomdata.h" #include "r_defs.h" struct MapData { private: struct MapLump { char Name[8] = { 0 }; FileReader Reader; } MapLumps[ML_MAX]; FileReader nofile; public: bool HasBehavior = false; bool Encrypted = false; bool isText = false; bool InWad = false; int lumpnum = -1; FResourceFile * resource = nullptr; ~MapData() { if (resource != nullptr) delete resource; resource = nullptr; } /* void Seek(unsigned int lumpindex) { if (lumpindexSeek(0, FileReader::SeekSet); } } */ FileReader &Reader(unsigned int lumpindex) { if (lumpindex < countof(MapLumps)) { auto &file = MapLumps[lumpindex].Reader; file.Seek(0, FileReader::SeekSet); return file; } return nofile; } void Read(unsigned int lumpindex, void * buffer, int size = -1) { if (lumpindex 0) { auto &file = MapLumps[lumpindex].Reader; file.Seek(0, FileReader::SeekSet); file.Read(buffer, size); } } } uint32_t Size(unsigned int lumpindex) { if (lumpindex FMissingTextureTracker; extern TMap MapThingsUserDataIndex; // from mapthing idx -> user data idx extern TArray MapThingsUserData; #endif