2006-03-20 16:43:15 +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 16:43:15 +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
2013-02-24 02:39:48 +00:00
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE .
2013-03-03 01:03:33 +00:00
COPYRIGHT 1993 - 1999 PARALLAX SOFTWARE CORPORATION . ALL RIGHTS RESERVED .
2006-03-20 16:43:15 +00:00
*/
2008-04-06 20:23:28 +00:00
2006-03-20 16:43:15 +00:00
/*
*
2008-04-06 20:23:28 +00:00
* Header for playsave . c
2006-03-20 16:43:15 +00:00
*
*/
2013-03-03 01:03:33 +00:00
2006-03-20 16:43:15 +00:00
# ifndef _PLAYSAVE_H
# define _PLAYSAVE_H
2008-04-13 00:28:36 +00:00
# include "kconfig.h"
# include "mission.h"
# include "weapon.h"
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
# include "pstypes.h"
2008-04-24 14:27:54 +00:00
# include "player.h"
2013-03-03 01:03:33 +00:00
# elif defined(DXX_BUILD_DESCENT_II)
# include "escort.h"
# endif
2008-04-13 00:28:36 +00:00
2012-11-11 22:12:51 +00:00
# ifdef __cplusplus
2013-02-21 00:20:26 +00:00
# define N_SAVE_SLOTS 10
# define GAME_NAME_LEN 25 // +1 for terminating zero = 26
2006-03-20 16:43:15 +00:00
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
2010-12-22 00:17:49 +00:00
// NOTE: Obsolete structure - only kept for compability of shareware plr file
2013-12-22 22:03:07 +00:00
struct saved_game_sw
{
2008-04-13 00:28:36 +00:00
char name [ GAME_NAME_LEN + 1 ] ; //extra char for terminating zero
2010-12-22 00:17:49 +00:00
struct player_rw sg_player ;
2008-04-13 00:28:36 +00:00
int difficulty_level ; //which level game is played at
int primary_weapon ; //which weapon selected
int secondary_weapon ; //which weapon selected
int cockpit_mode ; //which cockpit mode selected
int window_w , window_h ; //size of player's window
int next_level_num ; //which level we're going to
int auto_leveling_on ; //does player have autoleveling on?
2013-12-22 22:03:07 +00:00
} __pack__ ;
2008-04-13 00:28:36 +00:00
2013-03-03 01:03:33 +00:00
void plyr_save_stats ( ) ;
# endif
2013-12-22 22:03:07 +00:00
struct hli
{
2008-04-13 00:28:36 +00:00
char Shortname [ 9 ] ;
ubyte LevelNum ;
2013-12-22 22:03:07 +00:00
} ;
2008-04-13 00:28:36 +00:00
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
2013-07-21 00:03:38 +00:00
# include "multi.h"
2012-07-15 03:51:54 +00:00
2013-12-22 22:03:07 +00:00
struct player_config
2008-04-13 00:28:36 +00:00
{
ubyte ControlType ;
2014-08-26 02:59:01 +00:00
array < ubyte , MAX_PRIMARY_WEAPONS + 1 > PrimaryOrder ;
array < ubyte , MAX_SECONDARY_WEAPONS + 1 > SecondaryOrder ;
array < array < ubyte , MAX_CONTROLS > , 3 > KeySettings ;
array < ubyte , MAX_DXX_REBIRTH_CONTROLS > KeySettingsRebirth ;
2008-04-13 00:28:36 +00:00
int DefaultDifficulty ;
int AutoLeveling ;
2014-12-08 04:49:20 +00:00
uint16_t NHighestLevels ;
2014-08-26 02:59:01 +00:00
array < hli , MAX_MISSIONS > HighestLevels ;
array < int , 5 > KeyboardSens ;
array < int , 6 > JoystickSens ;
array < int , 6 > JoystickDead ;
2011-01-04 10:43:30 +00:00
ubyte MouseFlightSim ;
2014-08-26 02:59:01 +00:00
array < int , 6 > MouseSens ;
2011-01-04 10:43:30 +00:00
int MouseFSDead ;
2011-01-10 15:12:00 +00:00
int MouseFSIndicator ;
2014-08-26 02:59:01 +00:00
array < cockpit_mode_t , 2 > CockpitMode ; // 0 saves the "real" cockpit, 1 also saves letterbox and rear. Used to properly switch between modes and restore the real one.
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
2014-08-26 02:59:01 +00:00
array < int , 2 > Cockpit3DView ;
2013-03-03 01:03:33 +00:00
# endif
2008-04-13 00:28:36 +00:00
char NetworkMessageMacro [ 4 ] [ MAX_MESSAGE_LEN ] ;
int NetlifeKills ;
int NetlifeKilled ;
2011-01-10 15:12:00 +00:00
ubyte ReticleType ;
int ReticleRGBA [ 4 ] ;
int ReticleSize ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
int MissileViewEnabled ;
int HeadlightActiveDefault ;
int GuidedInBigWindow ;
char GuidebotName [ GUIDEBOT_NAME_LEN + 1 ] ;
char GuidebotNameReal [ GUIDEBOT_NAME_LEN + 1 ] ;
# endif
2008-04-13 00:28:36 +00:00
int HudMode ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
int EscortHotKeys ;
# endif
2008-04-13 00:28:36 +00:00
int PersistentDebris ;
2008-10-28 17:04:35 +00:00
int PRShot ;
2011-01-03 01:01:09 +00:00
ubyte NoRedundancy ;
ubyte MultiMessages ;
2013-04-08 10:46:05 +00:00
ubyte NoRankings ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
2011-01-03 01:01:09 +00:00
ubyte BombGauge ;
2013-03-03 01:03:33 +00:00
# endif
2011-05-20 10:23:22 +00:00
ubyte AutomapFreeFlight ;
2012-05-10 12:39:24 +00:00
ubyte NoFireAutoselect ;
2013-04-08 13:04:19 +00:00
ubyte CycleAutoselectOnly ;
2011-02-23 16:46:36 +00:00
int AlphaEffects ;
2011-04-07 20:32:47 +00:00
int DynLightColor ;
2013-12-22 22:03:07 +00:00
} ;
2013-03-03 01:03:33 +00:00
# endif
2008-04-13 00:28:36 +00:00
extern struct player_config PlayerCfg ;
2006-03-20 16:43:15 +00:00
# ifndef EZERO
# define EZERO 0
# endif
2013-02-21 00:20:26 +00:00
// Used to save kconfig values to disk.
2013-10-06 17:47:56 +00:00
void write_player_file ( ) ;
2006-03-20 16:43:15 +00:00
int new_player_config ( ) ;
int read_player_file ( ) ;
2013-02-21 00:20:26 +00:00
// set a new highest level for player for this mission
2006-03-20 16:43:15 +00:00
void set_highest_level ( int levelnum ) ;
2013-02-21 00:20:26 +00:00
// gets the player's highest level from the file for this mission
2006-03-20 16:43:15 +00:00
int get_highest_level ( void ) ;
2013-07-21 00:03:38 +00:00
struct netgame_info ;
void read_netgame_profile ( struct netgame_info * ng ) ;
void write_netgame_profile ( struct netgame_info * ng ) ;
2011-04-22 15:14:27 +00:00
2012-11-11 22:12:51 +00:00
# endif
2013-03-03 01:03:33 +00:00
# endif /* _PLAYSAVE_H */