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
|
2023-02-05 02:09:32 +01:00
|
|
|
#if !XASH_NSWITCH // SDL2 messageboxes not available
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_SDL
|
|
|
|
#endif
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_MESSAGEBOX
|
|
|
|
#endif
|
|
|
|
#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
|
|
|
|
2023-03-27 16:28:19 +02:00
|
|
|
#define XASH_USE_EVDEV 1
|
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
|
2023-02-05 02:09:32 +01:00
|
|
|
#elif XASH_NSWITCH
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_NSWITCH
|
2019-11-24 01:01:43 +01:00
|
|
|
#else // !XASH_WIN32
|
|
|
|
#define XASH_MESSAGEBOX MSGBOX_STDERR
|
|
|
|
#endif // !XASH_WIN32
|
|
|
|
#endif // XASH_MESSAGEBOX
|
|
|
|
|
|
|
|
//
|
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
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
/*
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
Default build-depended cvar and constant values
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
*/
|
|
|
|
|
2023-02-09 03:55:35 +01:00
|
|
|
// Platform overrides
|
|
|
|
#if XASH_NSWITCH
|
2018-04-13 18:56:43 +02:00
|
|
|
#define DEFAULT_TOUCH_ENABLE "0"
|
2023-02-09 03:55:35 +01:00
|
|
|
#define DEFAULT_M_IGNORE "1"
|
|
|
|
#define DEFAULT_MODE_WIDTH 1280
|
|
|
|
#define DEFAULT_MODE_HEIGHT 720
|
|
|
|
#define DEFAULT_ALLOWCONSOLE 1
|
2023-02-13 20:53:17 +01:00
|
|
|
#elif XASH_PSVITA
|
|
|
|
#define DEFAULT_TOUCH_ENABLE "0"
|
|
|
|
#define DEFAULT_M_IGNORE "1"
|
|
|
|
#define DEFAULT_MODE_WIDTH 960
|
|
|
|
#define DEFAULT_MODE_HEIGHT 544
|
|
|
|
#define DEFAULT_ALLOWCONSOLE 1
|
2023-06-05 19:29:05 +02:00
|
|
|
#elif XASH_ANDROID
|
|
|
|
#define DEFAULT_TOUCH_ENABLE "1"
|
2023-02-09 03:55:35 +01:00
|
|
|
#elif XASH_MOBILE_PLATFORM
|
|
|
|
#define DEFAULT_TOUCH_ENABLE "1"
|
|
|
|
#define DEFAULT_M_IGNORE "1"
|
|
|
|
#endif // !XASH_MOBILE_PLATFORM && !XASH_NSWITCH
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2019-11-24 01:01:43 +01:00
|
|
|
#if XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
2023-02-09 03:55:35 +01:00
|
|
|
// 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
|
|
|
|
#define XASH_INTERNAL_GAMELIBS
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2023-02-09 03:55:35 +01:00
|
|
|
// Defaults
|
|
|
|
#ifndef DEFAULT_TOUCH_ENABLE
|
|
|
|
#define DEFAULT_TOUCH_ENABLE "0"
|
|
|
|
#endif // DEFAULT_TOUCH_ENABLE
|
|
|
|
|
|
|
|
#ifndef DEFAULT_M_IGNORE
|
|
|
|
#define DEFAULT_M_IGNORE "0"
|
|
|
|
#endif // DEFAULT_M_IGNORE
|
|
|
|
|
2023-03-23 17:13:17 +01:00
|
|
|
#ifndef DEFAULT_JOY_DEADZONE
|
|
|
|
#define DEFAULT_JOY_DEADZONE "4096"
|
|
|
|
#endif // DEFAULT_JOY_DEADZONE
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
#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
|
|
|
|
2023-02-09 03:55:35 +01:00
|
|
|
#ifndef DEFAULT_ALLOWCONSOLE
|
|
|
|
#define DEFAULT_ALLOWCONSOLE 0
|
|
|
|
#endif // DEFAULT_ALLOWCONSOLE
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
#ifndef DEFAULT_FULLSCREEN
|
2023-05-19 04:14:24 +02:00
|
|
|
#define DEFAULT_FULLSCREEN "1" // must be a string
|
2019-11-24 01:01:43 +01:00
|
|
|
#endif // DEFAULT_FULLSCREEN
|
2018-04-13 18:56:43 +02:00
|
|
|
|
2023-11-20 15:32:19 +01:00
|
|
|
#ifndef DEFAULT_MAX_EDICTS
|
|
|
|
#define DEFAULT_MAX_EDICTS 1200 // was 900 before HL25
|
|
|
|
#endif // DEFAULT_MAX_EDICTS
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
#endif // DEFAULTS_H
|