2018-04-13 18:56:43 +02:00
|
|
|
/*
|
|
|
|
defaults.h - set up default configuration
|
|
|
|
Copyright (C) 2016 Mittorn
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DEFAULTS_H
|
|
|
|
#define DEFAULTS_H
|
|
|
|
|
|
|
|
#include "backends.h"
|
2019-11-24 01:01:43 +01:00
|
|
|
#include "build.h"
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
===================================================================
|
|
|
|
|
2018-11-16 14:32:16 +01:00
|
|
|
SETUP BACKENDS DEFINITIONS
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
===================================================================
|
|
|
|
*/
|
2019-11-24 01:52:08 +01:00
|
|
|
#if !XASH_DEDICATED
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_SDL
|
|
|
|
// we are building using libSDL
|
2018-04-13 18:56:43 +02:00
|
|
|
#ifndef XASH_VIDEO
|
|
|
|
#define XASH_VIDEO VIDEO_SDL
|
|
|
|
#endif // XASH_VIDEO
|
|
|
|
|
|
|
|
#ifndef XASH_INPUT
|
|
|
|
#define XASH_INPUT INPUT_SDL
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_INPUT
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef XASH_SOUND
|
|
|
|
#define XASH_SOUND SOUND_SDL
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_SOUND
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_SDL == 2
|
|
|
|
#ifndef XASH_TIMER
|
|
|
|
#define XASH_TIMER TIMER_SDL
|
|
|
|
#endif // XASH_TIMER
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#ifndef XASH_MESSAGEBOX
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_SDL
|
|
|
|
#endif // XASH_MESSAGEBOX
|
|
|
|
#endif
|
|
|
|
#elif XASH_ANDROID
|
|
|
|
// we are building for Android platform, use Android APIs
|
2018-04-13 18:56:43 +02:00
|
|
|
#ifndef XASH_VIDEO
|
|
|
|
#define XASH_VIDEO VIDEO_ANDROID
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_VIDEO
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef XASH_INPUT
|
|
|
|
#define XASH_INPUT INPUT_ANDROID
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_INPUT
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef XASH_SOUND
|
|
|
|
#define XASH_SOUND SOUND_OPENSLES
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_SOUND
|
2019-10-26 03:35:56 +02:00
|
|
|
|
|
|
|
#ifndef XASH_MESSAGEBOX
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_ANDROID
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_MESSAGEBOX
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#define XASH_USE_EVDEV
|
2020-07-08 03:45:24 +02:00
|
|
|
#define XASH_DYNAMIC_DLADDR
|
2019-11-24 01:01:43 +01:00
|
|
|
#elif XASH_LINUX
|
|
|
|
// we are building for Linux without SDL2, can draw only to framebuffer yet
|
2019-10-21 20:41:44 +02:00
|
|
|
#ifndef XASH_VIDEO
|
|
|
|
#define XASH_VIDEO VIDEO_FBDEV
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_VIDEO
|
2019-10-21 20:41:44 +02:00
|
|
|
|
|
|
|
#ifndef XASH_INPUT
|
|
|
|
#define XASH_INPUT INPUT_EVDEV
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_INPUT
|
2019-10-21 20:41:44 +02:00
|
|
|
|
|
|
|
#ifndef XASH_SOUND
|
2019-10-25 04:04:11 +02:00
|
|
|
#define XASH_SOUND SOUND_ALSA
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_SOUND
|
2019-10-26 03:35:56 +02:00
|
|
|
|
2019-10-21 20:41:44 +02:00
|
|
|
#define XASH_USE_EVDEV
|
2020-02-08 17:06:13 +01:00
|
|
|
#elif XASH_DOS4GW
|
|
|
|
#ifndef XASH_VIDEO
|
|
|
|
#define XASH_VIDEO VIDEO_DOS
|
|
|
|
#endif
|
|
|
|
#ifndef XASH_TIMER
|
|
|
|
#define XASH_TIMER TIMER_DOS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// usually only 10-20 fds availiable
|
|
|
|
#define XASH_REDUCE_FD
|
|
|
|
#endif
|
2019-10-21 20:41:44 +02:00
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
#endif // XASH_DEDICATED
|
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
//
|
|
|
|
// select messagebox implementation
|
|
|
|
//
|
|
|
|
#ifndef XASH_MESSAGEBOX
|
|
|
|
#if XASH_WIN32
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_WIN32
|
|
|
|
#else // !XASH_WIN32
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_STDERR
|
|
|
|
#endif // !XASH_WIN32
|
|
|
|
#endif // XASH_MESSAGEBOX
|
|
|
|
|
|
|
|
//
|
2018-04-13 18:56:43 +02:00
|
|
|
// select crashhandler based on defines
|
2019-11-24 01:01:43 +01:00
|
|
|
//
|
2018-04-13 18:56:43 +02:00
|
|
|
#ifndef XASH_CRASHHANDLER
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_WIN32 && defined(DBGHELP)
|
|
|
|
#define XASH_CRASHHANDLER CRASHHANDLER_DBGHELP
|
|
|
|
#elif XASH_LINUX || XASH_BSD
|
2018-04-13 18:56:43 +02:00
|
|
|
#define XASH_CRASHHANDLER CRASHHANDLER_UCONTEXT
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // !(XASH_LINUX || XASH_BSD || XASH_WIN32)
|
2018-04-13 18:56:43 +02:00
|
|
|
#endif
|
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
//
|
2018-04-13 18:56:43 +02:00
|
|
|
// no timer - no xash
|
2019-11-24 01:01:43 +01:00
|
|
|
//
|
2018-04-13 18:56:43 +02:00
|
|
|
#ifndef XASH_TIMER
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_WIN32
|
2018-04-13 18:56:43 +02:00
|
|
|
#define XASH_TIMER TIMER_WIN32
|
2019-11-24 01:01:43 +01:00
|
|
|
#else // !XASH_WIN32
|
2021-06-25 23:19:49 +02:00
|
|
|
#define XASH_TIMER TIMER_POSIX
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // !XASH_WIN32
|
2018-04-13 18:56:43 +02:00
|
|
|
#endif
|
|
|
|
|
2019-11-17 21:31:25 +01:00
|
|
|
#ifdef XASH_STATIC_LIBS
|
|
|
|
#define XASH_LIB LIB_STATIC
|
|
|
|
#define XASH_INTERNAL_GAMELIBS
|
2020-02-08 17:06:13 +01:00
|
|
|
#define XASH_ALLOW_SAVERESTORE_OFFSETS
|
2020-04-25 20:21:00 +02:00
|
|
|
#elif XASH_WIN32
|
2019-11-17 21:31:25 +01:00
|
|
|
#define XASH_LIB LIB_WIN32
|
2020-02-08 17:06:13 +01:00
|
|
|
#elif XASH_POSIX
|
2019-11-17 21:31:25 +01:00
|
|
|
#define XASH_LIB LIB_POSIX
|
|
|
|
#endif
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
//
|
|
|
|
// fallback to NULL
|
|
|
|
//
|
|
|
|
#ifndef XASH_VIDEO
|
2019-04-04 22:13:17 +02:00
|
|
|
#define XASH_VIDEO VIDEO_NULL
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_VIDEO
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef XASH_SOUND
|
|
|
|
#define XASH_SOUND SOUND_NULL
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_SOUND
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef XASH_INPUT
|
|
|
|
#define XASH_INPUT INPUT_NULL
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_INPUT
|
2019-10-26 03:35:56 +02:00
|
|
|
|
2020-07-12 17:08:16 +02:00
|
|
|
#ifndef XASH_CRASHHANDLER
|
|
|
|
#define XASH_CRASHHANDLER CRASHHANDLER_NULL
|
|
|
|
#endif // XASH_CRASHHANDLER
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
/*
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
Default build-depended cvar and constant values
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
*/
|
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_MOBILE_PLATFORM
|
2018-04-13 18:56:43 +02:00
|
|
|
#define DEFAULT_TOUCH_ENABLE "1"
|
|
|
|
#define DEFAULT_M_IGNORE "1"
|
2019-11-24 01:01:43 +01:00
|
|
|
#else // !XASH_MOBILE_PLATFORM
|
2018-04-13 18:56:43 +02:00
|
|
|
#define DEFAULT_TOUCH_ENABLE "0"
|
|
|
|
#define DEFAULT_M_IGNORE "0"
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // !XASH_MOBILE_PLATFORM
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
2018-04-13 18:56:43 +02:00
|
|
|
#define XASH_INTERNAL_GAMELIBS
|
|
|
|
// this means that libraries are provided with engine, but not in game data
|
|
|
|
// You need add library loading code to library.c when adding new platform
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
// allow override for developer/debug builds
|
|
|
|
#ifndef DEFAULT_DEV
|
|
|
|
#define DEFAULT_DEV 0
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // DEFAULT_DEV
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#ifndef DEFAULT_FULLSCREEN
|
2018-04-29 08:21:23 +02:00
|
|
|
#define DEFAULT_FULLSCREEN 1
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // DEFAULT_FULLSCREEN
|
2018-04-13 18:56:43 +02:00
|
|
|
|
|
|
|
#endif // DEFAULTS_H
|