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
|
|
|
|
2017-06-25 20:46:03 +00:00
|
|
|
#include <type_traits>
|
2016-09-24 18:06:10 +00:00
|
|
|
#include "dxxsconf.h"
|
2014-09-17 02:16:33 +00:00
|
|
|
#include <cstdint>
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2016-09-24 18:06:11 +00:00
|
|
|
#if DXX_USE_OGL
|
2014-08-05 19:07:54 +00:00
|
|
|
// GL Sync methods
|
2015-12-24 04:01:27 +00:00
|
|
|
enum SyncGLMethod : uint8_t {
|
2014-08-05 19:07:54 +00:00
|
|
|
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
|
2015-12-24 04:01:27 +00:00
|
|
|
};
|
2014-08-05 19:07:54 +00:00
|
|
|
|
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"
|
2016-03-19 19:08:10 +00:00
|
|
|
#include "dsx-ns.h"
|
2015-07-04 21:01:17 +00:00
|
|
|
#include "pack.h"
|
2013-10-06 02:23:03 +00:00
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
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-10-18 21:01:21 +00:00
|
|
|
bool DbgSafelog;
|
2015-11-24 04:05:35 +00:00
|
|
|
bool SysShowCmdHelp;
|
2015-12-24 04:01:26 +00:00
|
|
|
bool SysLowMem;
|
2016-07-22 02:25:17 +00:00
|
|
|
int8_t SysUsePlayersDir;
|
2015-12-24 04:01:27 +00:00
|
|
|
bool SysAutoRecordDemo;
|
2015-12-24 04:01:27 +00:00
|
|
|
bool SysWindow;
|
2015-12-24 04:01:27 +00:00
|
|
|
bool SysAutoDemo;
|
2015-12-24 04:01:26 +00:00
|
|
|
bool GfxSkipHiresFNT;
|
2015-11-24 04:05:36 +00:00
|
|
|
bool SndNoSound;
|
2015-12-24 04:01:26 +00:00
|
|
|
bool SndNoMusic;
|
2015-12-24 04:01:27 +00:00
|
|
|
bool SysNoBorders;
|
2015-12-24 04:01:27 +00:00
|
|
|
bool SysNoTitles;
|
2016-09-11 18:49:15 +00:00
|
|
|
#if DXX_USE_SDLMIXER
|
2015-11-24 04:05:36 +00:00
|
|
|
bool SndDisableSdlMixer;
|
|
|
|
#else
|
2017-06-25 20:46:03 +00:00
|
|
|
static constexpr std::true_type SndDisableSdlMixer{};
|
2015-11-26 02:56:55 +00:00
|
|
|
#endif
|
2016-09-25 04:52:48 +00:00
|
|
|
#if DXX_MAX_JOYSTICKS
|
2015-11-26 02:56:55 +00:00
|
|
|
bool CtlNoJoystick;
|
|
|
|
#else
|
2017-06-25 20:46:03 +00:00
|
|
|
static constexpr std::true_type CtlNoJoystick{};
|
2015-12-18 04:08:23 +00:00
|
|
|
#endif
|
2016-09-24 18:06:11 +00:00
|
|
|
#if DXX_USE_OGL
|
2015-12-24 04:01:27 +00:00
|
|
|
bool OglFixedFont;
|
2015-12-24 04:01:27 +00:00
|
|
|
SyncGLMethod OglSyncMethod;
|
2016-08-29 15:07:30 +00:00
|
|
|
bool OglDarkEdges;
|
2015-12-18 04:08:24 +00:00
|
|
|
bool DbgUseOldTextureMerge;
|
2015-12-18 04:08:23 +00:00
|
|
|
bool DbgGlIntensity4Ok;
|
2015-12-18 04:08:24 +00:00
|
|
|
bool DbgGlReadPixelsOk;
|
2015-12-18 04:08:24 +00:00
|
|
|
bool DbgGlGetTexLevelParamOk;
|
2015-12-18 04:08:24 +00:00
|
|
|
bool DbgGlLuminance4Alpha4Ok;
|
2015-12-18 04:08:24 +00:00
|
|
|
bool DbgGlRGBA2Ok;
|
2021-03-09 20:59:20 +00:00
|
|
|
bool OglStereo;
|
2021-03-15 18:32:10 +00:00
|
|
|
uint8_t OglStereoView;
|
|
|
|
unsigned OglSyncWait;
|
2015-12-24 04:01:27 +00:00
|
|
|
#else
|
|
|
|
bool DbgSdlHWSurface;
|
2015-12-24 04:01:28 +00:00
|
|
|
bool DbgSdlASyncBlit;
|
2015-11-24 04:05:36 +00:00
|
|
|
#endif
|
2015-12-24 04:01:28 +00:00
|
|
|
bool DbgNoRun;
|
2015-12-24 04:01:28 +00:00
|
|
|
bool DbgNoDoubleBuffer;
|
2015-12-24 04:01:28 +00:00
|
|
|
bool DbgNoCompressPigBitmap;
|
2015-12-24 04:01:28 +00:00
|
|
|
bool DbgRenderStats;
|
2015-12-18 04:08:23 +00:00
|
|
|
uint8_t DbgBpp;
|
2015-12-24 04:01:26 +00:00
|
|
|
int8_t DbgVerbose;
|
2015-12-24 04:01:26 +00:00
|
|
|
bool SysNoNiceFPS;
|
2015-11-24 04:05:35 +00:00
|
|
|
int SysMaxFPS;
|
2015-12-24 04:01:28 +00:00
|
|
|
uint16_t MplUdpHostPort;
|
2015-12-24 04:01:29 +00:00
|
|
|
uint16_t MplUdpMyPort;
|
2016-09-11 18:49:15 +00:00
|
|
|
#if DXX_USE_TRACKER
|
2015-12-24 04:01:29 +00:00
|
|
|
uint16_t MplTrackerPort;
|
2015-12-24 04:01:29 +00:00
|
|
|
std::string MplTrackerAddr;
|
2015-12-24 04:01:29 +00:00
|
|
|
#endif
|
2015-11-24 04:05:35 +00:00
|
|
|
std::string SysMissionDir;
|
2015-12-24 04:01:26 +00:00
|
|
|
std::string SysHogDir;
|
2015-12-24 04:01:26 +00:00
|
|
|
std::string SysPilot;
|
2015-12-24 04:01:26 +00:00
|
|
|
std::string SysRecordDemoNameTemplate;
|
2015-12-24 04:01:27 +00:00
|
|
|
std::string MplUdpHostAddr;
|
2015-12-24 04:01:28 +00:00
|
|
|
std::string DbgAltTex;
|
2017-11-01 02:01:20 +00:00
|
|
|
#if !DXX_USE_OGL
|
2015-12-24 04:01:28 +00:00
|
|
|
std::string DbgTexMap;
|
2017-11-01 02:01:20 +00:00
|
|
|
#endif
|
2015-07-18 21:01:56 +00:00
|
|
|
};
|
2015-12-13 18:00:48 +00:00
|
|
|
extern CArg CGameArg;
|
|
|
|
}
|
2015-07-18 21:01:56 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2015-07-04 21:01:17 +00:00
|
|
|
struct Arg : prohibit_void_ptr<Arg>
|
2007-07-14 20:33:42 +00:00
|
|
|
{
|
2019-01-20 05:36:56 +00:00
|
|
|
#if DXX_USE_SHAREPATH
|
|
|
|
bool SysNoHogDir;
|
|
|
|
#endif
|
2015-07-04 21:01:17 +00:00
|
|
|
#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;
|
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
|
2013-12-22 22:03:07 +00:00
|
|
|
};
|
2007-07-14 20:33:42 +00:00
|
|
|
|
|
|
|
extern struct Arg GameArg;
|
|
|
|
|
2015-12-13 18:00:48 +00:00
|
|
|
bool InitArgs(int argc, char **argv);
|
2015-12-24 04:01:26 +00:00
|
|
|
}
|
2015-12-13 18:00:48 +00:00
|
|
|
|
2016-07-21 01:43:22 +00:00
|
|
|
namespace dcx {
|
|
|
|
#define PLAYER_DIRECTORY_TEXT "Players/"
|
|
|
|
|
|
|
|
__attribute_format_arg(1)
|
|
|
|
static inline const char *PLAYER_DIRECTORY_STRING(const char *s);
|
|
|
|
static inline const char *PLAYER_DIRECTORY_STRING(const char *s)
|
2013-10-06 02:23:03 +00:00
|
|
|
{
|
2016-07-22 02:25:17 +00:00
|
|
|
return &s[CGameArg.SysUsePlayersDir + sizeof(PLAYER_DIRECTORY_TEXT) - 1];
|
2016-07-21 01:43:22 +00:00
|
|
|
}
|
|
|
|
#define PLAYER_DIRECTORY_STRING(S) ((PLAYER_DIRECTORY_STRING)(PLAYER_DIRECTORY_TEXT S))
|
2013-10-06 02:23:03 +00:00
|
|
|
}
|
|
|
|
#endif
|