2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
2008-04-06 20:23:28 +00:00
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Prototypes for accessing arguments.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-25 05:32:44 +00:00
|
|
|
#pragma once
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2014-09-17 02:16:33 +00:00
|
|
|
#include <cstdint>
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2015-01-28 03:42:53 +00:00
|
|
|
bool InitArgs(int argc, char **argv);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-03-22 17:17:11 +00:00
|
|
|
#ifdef OGL
|
2014-08-05 19:07:54 +00:00
|
|
|
// GL Sync methods
|
|
|
|
typedef enum {
|
|
|
|
SYNC_GL_NONE=0,
|
|
|
|
SYNC_GL_FENCE,
|
|
|
|
SYNC_GL_FENCE_SLEEP,
|
|
|
|
SYNC_GL_FINISH_AFTER_SWAP,
|
|
|
|
SYNC_GL_FINISH_BEFORE_SWAP,
|
2015-03-22 17:17:11 +00:00
|
|
|
SYNC_GL_AUTO
|
2014-08-05 19:07:54 +00:00
|
|
|
} SyncGLMethod;
|
|
|
|
|
2015-03-22 17:17:11 +00:00
|
|
|
#define OGL_SYNC_METHOD_DEFAULT SYNC_GL_AUTO
|
|
|
|
#define OGL_SYNC_WAIT_DEFAULT 2 /* milliseconds */
|
|
|
|
|
|
|
|
#endif
|
2014-08-05 19:07:54 +00:00
|
|
|
|
2007-07-14 20:33:42 +00:00
|
|
|
// Struct that keeps all variables used by FindArg
|
|
|
|
// Prefixes are:
|
|
|
|
// Sys - System Options
|
|
|
|
// Ctl - Control Options
|
|
|
|
// Snd - Sound Options
|
|
|
|
// Gfx - Graphics Options
|
|
|
|
// Ogl - OpenGL Options
|
|
|
|
// Mpl - Multiplayer Options
|
2007-07-14 22:36:04 +00:00
|
|
|
// Edi - Editor Options
|
2007-07-14 20:33:42 +00:00
|
|
|
// Dbg - Debugging/Undocumented Options
|
2015-03-22 18:49:20 +00:00
|
|
|
#include <string>
|
2013-10-06 02:23:03 +00:00
|
|
|
#include "dxxsconf.h"
|
2015-07-04 21:01:17 +00:00
|
|
|
#include "pack.h"
|
2015-02-08 17:43:29 +00:00
|
|
|
#include "compiler-type_traits.h"
|
2013-10-06 02:23:03 +00:00
|
|
|
|
2015-07-18 21:01:56 +00:00
|
|
|
struct CArg : prohibit_void_ptr<CArg>
|
|
|
|
{
|
|
|
|
bool CtlNoCursor;
|
|
|
|
bool CtlNoMouse;
|
|
|
|
bool CtlNoStickyKeys;
|
|
|
|
bool DbgForbidConsoleGrab;
|
2015-08-11 03:05:55 +00:00
|
|
|
bool DbgShowMemInfo;
|
2015-07-18 21:01:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
|
2015-07-04 21:01:17 +00:00
|
|
|
struct Arg : prohibit_void_ptr<Arg>
|
2007-07-14 20:33:42 +00:00
|
|
|
{
|
|
|
|
int SysMaxFPS;
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string SysHogDir;
|
2015-10-11 22:21:00 +00:00
|
|
|
std::string SysMissionDir;
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string SysPilot;
|
|
|
|
std::string SysRecordDemoNameTemplate;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysShowCmdHelp;
|
|
|
|
bool SysNoNiceFPS;
|
2015-09-22 02:28:38 +00:00
|
|
|
#if defined(__unix__)
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysNoHogDir;
|
2015-09-22 02:28:38 +00:00
|
|
|
#endif
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysUsePlayersDir;
|
|
|
|
bool SysLowMem;
|
2015-02-28 19:36:02 +00:00
|
|
|
bool SysAutoRecordDemo;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysWindow;
|
|
|
|
bool SysNoBorders;
|
2015-10-09 02:46:09 +00:00
|
|
|
bool SysNoTitles;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysAutoDemo;
|
|
|
|
bool CtlNoJoystick;
|
|
|
|
bool SndNoSound;
|
|
|
|
bool SndNoMusic;
|
2013-11-10 05:25:08 +00:00
|
|
|
#ifdef USE_SDLMIXER
|
2015-02-08 17:43:29 +00:00
|
|
|
bool SndDisableSdlMixer;
|
|
|
|
#else
|
|
|
|
static constexpr tt::true_type SndDisableSdlMixer{};
|
2015-07-04 21:01:17 +00:00
|
|
|
#endif
|
|
|
|
bool GfxSkipHiresFNT;
|
|
|
|
#ifdef DXX_BUILD_DESCENT_I
|
|
|
|
bool EdiNoBm;
|
2013-11-10 05:25:08 +00:00
|
|
|
#endif
|
2013-03-03 01:03:33 +00:00
|
|
|
#ifdef DXX_BUILD_DESCENT_II
|
2015-07-04 21:01:17 +00:00
|
|
|
bool SysNoMovies;
|
|
|
|
bool GfxSkipHiresMovie;
|
|
|
|
bool GfxSkipHiresGFX;
|
2013-03-03 22:46:28 +00:00
|
|
|
int SndDigiSampleRate;
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2007-07-15 21:22:07 +00:00
|
|
|
#ifdef OGL
|
2015-07-04 21:01:17 +00:00
|
|
|
bool DbgUseOldTextureMerge;
|
|
|
|
bool OglFixedFont;
|
2015-03-22 17:17:11 +00:00
|
|
|
SyncGLMethod OglSyncMethod;
|
|
|
|
int OglSyncWait;
|
2007-07-15 21:22:07 +00:00
|
|
|
#endif
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string MplUdpHostAddr;
|
2015-01-25 05:32:44 +00:00
|
|
|
uint16_t MplUdpHostPort;
|
2014-09-17 02:16:33 +00:00
|
|
|
uint16_t MplUdpMyPort;
|
2011-04-05 00:24:34 +00:00
|
|
|
#ifdef USE_TRACKER
|
2015-01-24 19:16:35 +00:00
|
|
|
uint16_t MplTrackerPort;
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string MplTrackerAddr;
|
2011-04-05 00:24:34 +00:00
|
|
|
#endif
|
2013-03-03 01:03:33 +00:00
|
|
|
#ifdef DXX_BUILD_DESCENT_II
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string EdiAutoLoad;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool EdiSaveHoardData;
|
|
|
|
bool EdiMacData; // also used for some read routines in non-editor build
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2007-07-18 20:13:17 +00:00
|
|
|
int DbgVerbose;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool DbgSafelog;
|
|
|
|
bool DbgNoRun;
|
|
|
|
bool DbgRenderStats;
|
2015-03-22 18:49:20 +00:00
|
|
|
std::string DbgAltTex;
|
|
|
|
std::string DbgTexMap;
|
2015-07-04 21:01:17 +00:00
|
|
|
bool DbgNoDoubleBuffer;
|
|
|
|
bool DbgNoCompressPigBitmap;
|
2010-01-29 21:53:17 +00:00
|
|
|
int DbgBpp;
|
2007-07-18 20:13:17 +00:00
|
|
|
#ifdef OGL
|
2007-07-23 18:13:49 +00:00
|
|
|
int DbgGlIntensity4Ok;
|
|
|
|
int DbgGlLuminance4Alpha4Ok;
|
|
|
|
int DbgGlRGBA2Ok;
|
|
|
|
int DbgGlReadPixelsOk;
|
|
|
|
int DbgGlGetTexLevelParamOk;
|
|
|
|
#else
|
|
|
|
int DbgSdlHWSurface;
|
2008-10-28 17:04:35 +00:00
|
|
|
int DbgSdlASyncBlit;
|
2007-07-15 21:22:07 +00:00
|
|
|
#endif
|
2013-12-22 22:03:07 +00:00
|
|
|
};
|
2007-07-14 20:33:42 +00:00
|
|
|
|
|
|
|
extern struct Arg GameArg;
|
2015-07-18 21:01:56 +00:00
|
|
|
#endif
|
|
|
|
extern CArg CGameArg;
|
2007-07-14 20:33:42 +00:00
|
|
|
|
2015-07-04 21:01:17 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
|
2013-10-06 02:23:03 +00:00
|
|
|
static inline const char *PLAYER_DIRECTORY_STRING(const char *s, const char *f) __attribute_format_arg(2);
|
2015-01-18 01:58:33 +00:00
|
|
|
static inline const char *PLAYER_DIRECTORY_STRING(const char *s, const char *)
|
2013-10-06 02:23:03 +00:00
|
|
|
{
|
|
|
|
return (GameArg.SysUsePlayersDir) ? s : (s + sizeof("Players/") - 1);
|
|
|
|
}
|
|
|
|
#define PLAYER_DIRECTORY_STRING(S) ((PLAYER_DIRECTORY_STRING)("Players/" S, S))
|
|
|
|
#endif
|
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|