2016-03-01 15:47:10 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// Copyright 1993-1996 id Software
|
|
|
|
// Copyright 1999-2016 Randy Heit
|
|
|
|
// Copyright 2002-2016 Christoph Oelckers
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// 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.
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
2016-03-01 15:47:10 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2017-04-17 11:33:19 +00:00
|
|
|
// 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/
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// System specific interface stuff.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __D_MAIN__
|
|
|
|
#define __D_MAIN__
|
|
|
|
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "gametype.h"
|
|
|
|
|
|
|
|
struct event_t;
|
|
|
|
|
|
|
|
//
|
|
|
|
// D_DoomMain()
|
|
|
|
// Not a globally visible function, just included for source reference,
|
|
|
|
// calls all startup code, parses command line options.
|
|
|
|
// If not overrided by user input, calls N_AdvanceDemo.
|
|
|
|
//
|
|
|
|
|
|
|
|
struct CRestartException
|
|
|
|
{
|
|
|
|
char dummy;
|
|
|
|
};
|
|
|
|
|
2019-10-06 22:37:56 +00:00
|
|
|
int D_DoomMain (void);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
void D_Display ();
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// BASE LEVEL
|
|
|
|
//
|
|
|
|
void D_PageTicker (void);
|
|
|
|
void D_PageDrawer (void);
|
|
|
|
void D_AdvanceDemo (void);
|
|
|
|
void D_StartTitle (void);
|
|
|
|
bool D_AddFile (TArray<FString> &wadfiles, const char *file, bool check = true, int position = -1);
|
|
|
|
|
|
|
|
|
|
|
|
// [RH] Set this to something to draw an icon during the next screen refresh.
|
|
|
|
extern const char *D_DrawIcon;
|
|
|
|
|
2017-07-29 15:03:40 +00:00
|
|
|
// [SP] Store the capabilities of the renderer in a global variable, to prevent excessive per-frame processing
|
|
|
|
extern uint32_t r_renderercaps;
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
struct WadStuff
|
|
|
|
{
|
|
|
|
FString Path;
|
|
|
|
FString Name;
|
|
|
|
};
|
|
|
|
|
2017-10-14 21:41:43 +00:00
|
|
|
struct FStartupInfo
|
|
|
|
{
|
|
|
|
FString Name;
|
|
|
|
uint32_t FgColor; // Foreground color for title banner
|
|
|
|
uint32_t BkColor; // Background color for title banner
|
|
|
|
FString Song;
|
|
|
|
int Type;
|
2018-12-19 00:37:48 +00:00
|
|
|
int LoadLights = -1;
|
|
|
|
int LoadBrightmaps = -1;
|
2017-10-14 21:41:43 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
DefaultStartup,
|
|
|
|
DoomStartup,
|
|
|
|
HereticStartup,
|
|
|
|
HexenStartup,
|
|
|
|
StrifeStartup,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
struct FIWADInfo
|
|
|
|
{
|
|
|
|
FString Name; // Title banner text for this IWAD
|
|
|
|
FString Autoname; // Name of autoload ini section for this IWAD
|
2017-08-19 17:30:48 +00:00
|
|
|
FString IWadname; // Default name this game would use - this is for IWAD detection in GAMEINFO.
|
|
|
|
int prio = 0; // selection priority for given IWAD name.
|
2016-03-01 15:47:10 +00:00
|
|
|
FString Configname; // Name of config section for this IWAD
|
|
|
|
FString Required; // Requires another IWAD
|
2017-08-19 17:30:48 +00:00
|
|
|
uint32_t FgColor = 0; // Foreground color for title banner
|
|
|
|
uint32_t BkColor = 0xc0c0c0; // Background color for title banner
|
2018-04-27 10:32:38 +00:00
|
|
|
FString Song;
|
2017-08-19 17:30:48 +00:00
|
|
|
EGameType gametype = GAME_Doom; // which game are we playing?
|
2017-10-14 21:41:43 +00:00
|
|
|
int StartupType = FStartupInfo::DefaultStartup; // alternate startup type
|
2016-03-01 15:47:10 +00:00
|
|
|
FString MapInfo; // Base mapinfo to load
|
|
|
|
TArray<FString> Load; // Wads to be loaded with this one.
|
|
|
|
TArray<FString> Lumps; // Lump names for identification
|
2019-04-11 01:02:23 +00:00
|
|
|
TArray<FString> DeleteLumps; // Lumps which must be deleted from the directory.
|
2017-08-19 17:30:48 +00:00
|
|
|
int flags = 0;
|
|
|
|
};
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2017-08-19 17:30:48 +00:00
|
|
|
struct FFoundWadInfo
|
|
|
|
{
|
|
|
|
FString mFullPath;
|
|
|
|
FString mRequiredPath;
|
|
|
|
int mInfoIndex = -1; // must be an index because of reallocation
|
|
|
|
|
|
|
|
FFoundWadInfo() {}
|
|
|
|
FFoundWadInfo(const FString &s1, const FString &s2, int index)
|
|
|
|
: mFullPath(s1), mRequiredPath(s2), mInfoIndex(index)
|
|
|
|
{
|
|
|
|
}
|
2016-03-01 15:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern FStartupInfo DoomStartupInfo;
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// IWAD identifier class
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
class FIWadManager
|
|
|
|
{
|
2017-08-19 17:30:48 +00:00
|
|
|
TArray<FIWADInfo> mIWadInfos;
|
2016-03-01 15:47:10 +00:00
|
|
|
TArray<FString> mIWadNames;
|
2017-08-19 17:30:48 +00:00
|
|
|
TArray<FString> mSearchPaths;
|
|
|
|
TArray<FString> mOrderNames;
|
|
|
|
TArray<FFoundWadInfo> mFoundWads;
|
2016-03-01 15:47:10 +00:00
|
|
|
TArray<int> mLumpsFound;
|
|
|
|
|
2017-08-19 17:30:48 +00:00
|
|
|
void ParseIWadInfo(const char *fn, const char *data, int datasize, FIWADInfo *result = nullptr);
|
2016-03-01 15:47:10 +00:00
|
|
|
int ScanIWAD (const char *iwad);
|
2017-08-19 17:30:48 +00:00
|
|
|
int CheckIWADInfo(const char *iwad);
|
2017-09-09 10:36:20 +00:00
|
|
|
int IdentifyVersion (TArray<FString> &wadfiles, const char *iwad, const char *zdoom_wad, const char *optional_wad);
|
2017-08-19 17:30:48 +00:00
|
|
|
void CollectSearchPaths();
|
|
|
|
void AddIWADCandidates(const char *dir);
|
|
|
|
void ValidateIWADs();
|
2016-03-01 15:47:10 +00:00
|
|
|
public:
|
2019-07-16 18:22:15 +00:00
|
|
|
FIWadManager(const char *fn, const char *fnopt);
|
2017-09-09 10:36:20 +00:00
|
|
|
const FIWADInfo *FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad, const char *optionalwad);
|
2016-03-01 15:47:10 +00:00
|
|
|
const FString *GetAutoname(unsigned int num) const
|
|
|
|
{
|
2017-08-19 17:30:48 +00:00
|
|
|
if (num < mIWadInfos.Size()) return &mIWadInfos[num].Autoname;
|
2016-03-01 15:47:10 +00:00
|
|
|
else return NULL;
|
|
|
|
}
|
|
|
|
int GetIWadFlags(unsigned int num) const
|
|
|
|
{
|
2017-08-19 17:30:48 +00:00
|
|
|
if (num < mIWadInfos.Size()) return mIWadInfos[num].flags;
|
- allow the language table to supersede the title patches, if appropriate
For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font.
This also required removing the 'en' label from the default table, because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen.
Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
2019-02-14 23:29:24 +00:00
|
|
|
else return 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|