dxx-rebirth/common/include/args.h

171 lines
4.1 KiB
C
Raw Normal View History

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.
*/
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
#include "dxxsconf.h"
#include <cstdint>
#if DXX_USE_OGL
// GL Sync methods
2015-12-24 04:01:27 +00:00
enum SyncGLMethod : uint8_t {
SYNC_GL_NONE=0,
SYNC_GL_FENCE,
SYNC_GL_FENCE_SLEEP,
SYNC_GL_FINISH_AFTER_SWAP,
SYNC_GL_FINISH_BEFORE_SWAP,
SYNC_GL_AUTO
2015-12-24 04:01:27 +00:00
};
#define OGL_SYNC_METHOD_DEFAULT SYNC_GL_AUTO
#define OGL_SYNC_WAIT_DEFAULT 2 /* milliseconds */
#endif
// 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
// Edi - Editor Options
// Dbg - Debugging/Undocumented Options
2015-03-22 18:49:20 +00:00
#include <string>
#include "dxxsconf.h"
#include "dsx-ns.h"
2015-07-04 21:01:17 +00:00
#include "pack.h"
#include "compiler-type_traits.h"
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;
bool DbgShowMemInfo;
2015-10-18 21:01:21 +00:00
bool DbgSafelog;
#if defined(__unix__)
bool SysNoHogDir;
#endif
bool SysShowCmdHelp;
2015-12-24 04:01:26 +00:00
bool SysLowMem;
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;
#if DXX_USE_SDLMIXER
2015-11-24 04:05:36 +00:00
bool SndDisableSdlMixer;
#else
static constexpr tt::true_type SndDisableSdlMixer{};
2015-11-26 02:56:55 +00:00
#endif
#if DXX_MAX_JOYSTICKS
2015-11-26 02:56:55 +00:00
bool CtlNoJoystick;
#else
static constexpr tt::true_type CtlNoJoystick{};
2015-12-18 04:08:23 +00:00
#endif
#if DXX_USE_OGL
2015-12-24 04:01:27 +00:00
bool OglFixedFont;
2015-12-24 04:01:27 +00:00
SyncGLMethod OglSyncMethod;
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;
2015-12-24 04:01:27 +00:00
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;
int8_t DbgVerbose;
2015-12-24 04:01:26 +00:00
bool SysNoNiceFPS;
int SysMaxFPS;
2015-12-24 04:01:28 +00:00
uint16_t MplUdpHostPort;
2015-12-24 04:01:29 +00:00
uint16_t MplUdpMyPort;
#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
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;
2015-12-24 04:01:28 +00:00
std::string DbgTexMap;
2015-07-18 21:01:56 +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>
{
2015-07-04 21:01:17 +00:00
#ifdef DXX_BUILD_DESCENT_I
bool EdiNoBm;
2013-11-10 05:25:08 +00:00
#endif
#ifdef DXX_BUILD_DESCENT_II
2015-07-04 21:01:17 +00:00
bool SysNoMovies;
bool GfxSkipHiresMovie;
bool GfxSkipHiresGFX;
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
#endif
};
extern struct Arg GameArg;
bool InitArgs(int argc, char **argv);
2015-12-24 04:01:26 +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)
{
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))
}
#endif