2007-01-15 12:09:25 -08:00
|
|
|
/*
|
|
|
|
This file is part of Warzone 2100.
|
|
|
|
Copyright (C) 1999-2004 Eidos Interactive
|
|
|
|
Copyright (C) 2005-2007 Warzone Resurrection Project
|
|
|
|
|
|
|
|
Warzone 2100 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 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Warzone 2100 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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Warzone 2100; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2008-02-16 05:12:58 -08:00
|
|
|
/**
|
|
|
|
* @file warzoneConfig.c
|
2007-06-28 10:47:08 -07:00
|
|
|
*
|
2008-02-16 05:12:58 -08:00
|
|
|
* Warzone Global configuration functions.
|
2007-06-28 10:47:08 -07:00
|
|
|
*/
|
|
|
|
|
2006-05-27 09:37:17 -07:00
|
|
|
#include "lib/framework/frame.h"
|
2007-06-28 10:47:08 -07:00
|
|
|
#include "warzoneconfig.h"
|
2006-05-27 09:37:17 -07:00
|
|
|
#include "lib/ivis_common/piestate.h"
|
2007-06-28 10:47:08 -07:00
|
|
|
#include "advvis.h"
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global Variables
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Local Definitions
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
typedef struct _warzoneGlobals
|
|
|
|
{
|
|
|
|
SEQ_MODE seqMode;
|
|
|
|
BOOL bFog;
|
|
|
|
SWORD effectsLevel;
|
|
|
|
BOOL allowSubtitles;
|
|
|
|
BOOL playAudioCDs;
|
|
|
|
BOOL Fullscreen;
|
2006-09-03 05:41:55 -07:00
|
|
|
BOOL soundEnabled;
|
2007-11-25 14:52:58 -08:00
|
|
|
BOOL trapCursor;
|
2007-12-02 03:35:25 -08:00
|
|
|
UDWORD width;
|
|
|
|
UDWORD height;
|
2008-03-30 05:26:50 -07:00
|
|
|
bool pauseOnFocusLoss;
|
2008-03-30 08:44:50 -07:00
|
|
|
bool ColouredCursor;
|
2007-06-28 10:47:08 -07:00
|
|
|
} WARZONE_GLOBALS;
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Local Variables
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
static WARZONE_GLOBALS warGlobs;//STATIC use or write an access function if you need any of this
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Local ProtoTypes
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Source
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
void war_SetDefaultStates(void)//Sets all states
|
|
|
|
{
|
|
|
|
//set those here and reset in clParse or loadConfig
|
2008-03-24 09:51:17 -07:00
|
|
|
war_SetFog(false);
|
|
|
|
war_SetPlayAudioCDs(true);
|
|
|
|
war_setSoundEnabled( true );
|
2008-03-30 05:26:50 -07:00
|
|
|
war_SetPauseOnFocusLoss(true);
|
2008-03-30 08:44:50 -07:00
|
|
|
war_SetColouredCursor(true);
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void war_SetPlayAudioCDs(BOOL b) {
|
|
|
|
warGlobs.playAudioCDs = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL war_GetPlayAudioCDs(void) {
|
|
|
|
return warGlobs.playAudioCDs;
|
|
|
|
}
|
|
|
|
|
|
|
|
void war_SetAllowSubtitles(BOOL b) {
|
|
|
|
warGlobs.allowSubtitles = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL war_GetAllowSubtitles(void) {
|
|
|
|
return warGlobs.allowSubtitles;
|
|
|
|
}
|
|
|
|
|
|
|
|
void war_setFullscreen(BOOL b) {
|
|
|
|
warGlobs.Fullscreen = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL war_getFullscreen(void) {
|
|
|
|
return warGlobs.Fullscreen;
|
|
|
|
}
|
|
|
|
|
2007-11-25 14:52:58 -08:00
|
|
|
void war_SetTrapCursor(BOOL b)
|
|
|
|
{
|
|
|
|
warGlobs.trapCursor = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL war_GetTrapCursor(void)
|
|
|
|
{
|
|
|
|
return warGlobs.trapCursor;
|
|
|
|
}
|
|
|
|
|
2007-12-02 03:35:25 -08:00
|
|
|
void war_SetWidth(UDWORD width)
|
|
|
|
{
|
|
|
|
warGlobs.width = width;
|
|
|
|
}
|
|
|
|
|
|
|
|
UDWORD war_GetWidth(void)
|
|
|
|
{
|
|
|
|
return warGlobs.width;
|
|
|
|
}
|
|
|
|
|
|
|
|
void war_SetHeight(UDWORD height)
|
|
|
|
{
|
|
|
|
warGlobs.height = height;
|
|
|
|
}
|
|
|
|
|
|
|
|
UDWORD war_GetHeight(void)
|
|
|
|
{
|
|
|
|
return warGlobs.height;
|
|
|
|
}
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
|
|
|
void war_SetFog(BOOL val)
|
|
|
|
{
|
2007-12-16 07:15:01 -08:00
|
|
|
debug(LOG_FOG, "Visual fog turned %s", val ? "ON" : "OFF");
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
if (warGlobs.bFog != val)
|
|
|
|
{
|
|
|
|
warGlobs.bFog = val;
|
|
|
|
}
|
2008-03-24 09:51:17 -07:00
|
|
|
if (warGlobs.bFog == true)
|
2007-06-28 10:47:08 -07:00
|
|
|
{
|
2008-03-24 09:51:17 -07:00
|
|
|
setRevealStatus(false);
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-11-25 15:06:24 -08:00
|
|
|
PIELIGHT black;
|
|
|
|
|
2008-03-24 09:51:17 -07:00
|
|
|
setRevealStatus(true);
|
2008-04-05 15:33:22 -07:00
|
|
|
black.rgba = 0;
|
2007-11-25 15:06:24 -08:00
|
|
|
black.byte.a = 255;
|
|
|
|
pie_SetFogColour(black);
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL war_GetFog(void)
|
|
|
|
{
|
|
|
|
return warGlobs.bFog;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
|
|
|
void war_SetSeqMode(SEQ_MODE mode)
|
|
|
|
{
|
|
|
|
warGlobs.seqMode = mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
SEQ_MODE war_GetSeqMode(void)
|
|
|
|
{
|
|
|
|
return warGlobs.seqMode;
|
|
|
|
}
|
|
|
|
|
2008-03-30 05:26:50 -07:00
|
|
|
void war_SetPauseOnFocusLoss(bool enabled)
|
|
|
|
{
|
|
|
|
warGlobs.pauseOnFocusLoss = enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool war_GetPauseOnFocusLoss()
|
|
|
|
{
|
|
|
|
return warGlobs.pauseOnFocusLoss;
|
|
|
|
}
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2008-03-30 08:44:50 -07:00
|
|
|
void war_SetColouredCursor(bool enabled)
|
|
|
|
{
|
|
|
|
warGlobs.ColouredCursor = enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool war_GetColouredCursor(void)
|
|
|
|
{
|
|
|
|
return warGlobs.ColouredCursor;
|
|
|
|
}
|
|
|
|
|
2006-09-03 05:41:55 -07:00
|
|
|
void war_setSoundEnabled( BOOL soundEnabled )
|
2007-06-28 10:47:08 -07:00
|
|
|
{
|
2006-09-03 05:41:55 -07:00
|
|
|
warGlobs.soundEnabled = soundEnabled;
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
|
2006-09-03 05:41:55 -07:00
|
|
|
BOOL war_getSoundEnabled( void )
|
2007-06-28 10:47:08 -07:00
|
|
|
{
|
2006-09-03 05:41:55 -07:00
|
|
|
return warGlobs.soundEnabled;
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|