1 /* 2 This file is part of Warzone 2100. 3 Copyright (C) 1999-2004 Eidos Interactive 4 Copyright (C) 2005-2020 Warzone 2100 Project 5 6 Warzone 2100 is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 Warzone 2100 is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with Warzone 2100; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 /** @file 21 * Warzone Global configuration functions. 22 */ 23 24 #ifndef __INCLUDED_SRC_WARZONECONFIG_H__ 25 #define __INCLUDED_SRC_WARZONECONFIG_H__ 26 27 #include "lib/framework/frame.h" 28 #include "lib/sequence/sequence.h" 29 #include "lib/sound/sounddefs.h" 30 #include <string> 31 32 #define CAMERASPEED_MAX (5000) 33 #define CAMERASPEED_MIN (100) 34 #define CAMERASPEED_DEFAULT (2500) 35 #define CAMERASPEED_STEP (100) 36 37 /***************************************************************************/ 38 /* 39 * Global Definitions 40 */ 41 /***************************************************************************/ 42 enum FMV_MODE 43 { 44 FMV_FULLSCREEN, 45 FMV_1X, 46 FMV_2X, 47 FMV_MAX 48 }; 49 50 enum class JS_BACKEND 51 { 52 quickjs, 53 num_backends // Must be last! 54 }; 55 56 bool js_backend_from_str(const char *str, JS_BACKEND &output_backend); 57 std::string to_string(JS_BACKEND backend); 58 59 /***************************************************************************/ 60 /* 61 * Global ProtoTypes 62 */ 63 /***************************************************************************/ 64 void war_SetDefaultStates(); 65 void war_SetFMVmode(FMV_MODE mode); 66 FMV_MODE war_GetFMVmode(); 67 void war_SetAllowSubtitles(bool); 68 bool war_GetAllowSubtitles(); 69 void war_setWindowMode(WINDOW_MODE); 70 WINDOW_MODE war_getWindowMode(); 71 void war_setAntialiasing(int); 72 int war_getAntialiasing(); 73 void war_SetTrapCursor(bool b); 74 bool war_GetTrapCursor(); 75 bool war_GetColouredCursor(); 76 void war_SetColouredCursor(bool enabled); 77 void war_SetVsync(int value); 78 int war_GetVsync(); 79 void war_SetDisplayScale(unsigned int scale); 80 unsigned int war_GetDisplayScale(); 81 void war_SetWidth(UDWORD width); 82 UDWORD war_GetWidth(); 83 void war_SetScreen(int screen); 84 int war_GetScreen(); 85 void war_SetHeight(UDWORD height); 86 UDWORD war_GetHeight(); 87 void war_SetVideoBufferDepth(UDWORD videoBufferDepth); 88 UDWORD war_GetVideoBufferDepth(); 89 void war_SetPauseOnFocusLoss(bool enabled); 90 bool war_GetPauseOnFocusLoss(); 91 bool war_GetMusicEnabled(); 92 void war_SetMusicEnabled(bool enabled); 93 HRTFMode war_GetHRTFMode(); 94 void war_SetHRTFMode(HRTFMode mode); 95 int war_GetMapZoom(); 96 void war_SetMapZoom(int mapZoom); 97 int war_GetMapZoomRate(); 98 void war_SetMapZoomRate(int mapZoomRate); 99 int war_GetRadarZoom(); 100 void war_SetRadarZoom(int radarZoom); 101 bool war_GetRadarJump(); 102 void war_SetRadarJump(bool radarJump); 103 int war_GetCameraSpeed(); 104 void war_SetCameraSpeed(int cameraSpeed); 105 int war_GetScrollEvent(); 106 void war_SetScrollEvent(int scrollEvent); 107 int8_t war_GetSPcolor(); 108 void war_SetSPcolor(int color); 109 void war_setMPcolour(int colour); 110 int war_getMPcolour(); 111 void war_setScanlineMode(SCANLINE_MODE mode); 112 SCANLINE_MODE war_getScanlineMode(); 113 video_backend war_getGfxBackend(); 114 void war_setGfxBackend(video_backend backend); 115 JS_BACKEND war_getJSBackend(); 116 void war_setJSBackend(JS_BACKEND backend); 117 bool war_getAutoAdjustDisplayScale(); 118 void war_setAutoAdjustDisplayScale(bool autoAdjustDisplayScale); 119 120 /** 121 * Enable or disable sound initialization 122 * 123 * \param soundEnabled enable sound (or not) 124 */ 125 void war_setSoundEnabled(bool soundEnabled); 126 127 /** 128 * Whether we should initialize sound or not 129 * 130 * \return Enable sound (or not) 131 */ 132 bool war_getSoundEnabled(); 133 134 #endif // __INCLUDED_SRC_WARZONECONFIG_H__ 135