dxx-rebirth/main/playsave.h

105 lines
2.9 KiB
C
Raw Normal View History

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
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
2006-03-20 16:43:15 +00:00
/*
*
* Header for playsave.c
2006-03-20 16:43:15 +00:00
*
*/
#ifndef _PLAYSAVE_H
#define _PLAYSAVE_H
2008-04-24 14:27:54 +00:00
#include "pstypes.h"
#include "kconfig.h"
#include "mission.h"
#include "weapon.h"
#include "multi.h"
2008-04-24 14:27:54 +00:00
#include "player.h"
2006-03-20 16:43:15 +00:00
#define N_SAVE_SLOTS 10
#define GAME_NAME_LEN 25 //+1 for terminating zero = 26
// NOTE: Obsolete structure - only kept for compability of the plr file
typedef struct saved_game {
char name[GAME_NAME_LEN+1]; //extra char for terminating zero
2008-04-24 14:27:54 +00:00
struct player player;
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?
} __pack__ saved_game;
typedef struct hli {
char Shortname[9];
ubyte LevelNum;
} hli;
typedef struct player_config
{
ubyte ControlType;
ubyte PrimaryOrder[MAX_PRIMARY_WEAPONS+1];
ubyte SecondaryOrder[MAX_SECONDARY_WEAPONS+1];
ubyte KeySettings[CONTROL_MAX_TYPES][MAX_CONTROLS];
ubyte KeySettingsD1X[MAX_D1X_CONTROLS];
int DefaultDifficulty;
int AutoLeveling;
short NHighestLevels;
hli HighestLevels[MAX_MISSIONS];
Giving credits function ability to use custom creditfile (again); Made laser-offset for laser exclusive so Prox mines won't go tru doors; Preventing cycling tru cockpit modes while dead, but allowing to load a state; Implemented D2X' lighting code to D1X (faster, better, sexier - weeee); Try to hop over some errors regarding walls/doors in levels instead of using -1 indexes for arrays; Made the briefing text ptr a bit more failsafe in case the file is corrupt/non-standard; Made scores use the menu screen even in GAME OVER; Fixed bug in neighbour fields of Weapon Keys table; Added the Weapon Keys stuff to TABLE_CREATION; Fixed bug where D2X did not recall applied resolution in the resolutions menu; Simpler check to create DEMO_DIR; Seperated X/Y sensitivity for mouse and joystick; Flush controls when Automap toggles so keypress won't deactivate it again; Made FrameCount in Demos aligned to the Dropframe condition; Added KEy to ttoggle playback text off; Gracefully exit demo code if demo is corrupt; Removed that new percent counter because many old demos seem to have corrupted last frames; Closing endlevel data file if IFF error so the mission still can be freed; Fixed Cruising for keyboard which was not aligned to FPS correctly; Used mouse delta scaling in kconfig.c instead of mouse.c to not screw up when delta is requested in non-ingame situations - it actually belongs to the controls IMHO; Now support up to 8 joysticks; Changed some leftover malloc's to d_malloc and free to d_free
2008-10-16 17:27:02 +00:00
ubyte MouseSensitivityX;
ubyte MouseSensitivityY;
int MouseFilter;
Giving credits function ability to use custom creditfile (again); Made laser-offset for laser exclusive so Prox mines won't go tru doors; Preventing cycling tru cockpit modes while dead, but allowing to load a state; Implemented D2X' lighting code to D1X (faster, better, sexier - weeee); Try to hop over some errors regarding walls/doors in levels instead of using -1 indexes for arrays; Made the briefing text ptr a bit more failsafe in case the file is corrupt/non-standard; Made scores use the menu screen even in GAME OVER; Fixed bug in neighbour fields of Weapon Keys table; Added the Weapon Keys stuff to TABLE_CREATION; Fixed bug where D2X did not recall applied resolution in the resolutions menu; Simpler check to create DEMO_DIR; Seperated X/Y sensitivity for mouse and joystick; Flush controls when Automap toggles so keypress won't deactivate it again; Made FrameCount in Demos aligned to the Dropframe condition; Added KEy to ttoggle playback text off; Gracefully exit demo code if demo is corrupt; Removed that new percent counter because many old demos seem to have corrupted last frames; Closing endlevel data file if IFF error so the mission still can be freed; Fixed Cruising for keyboard which was not aligned to FPS correctly; Used mouse delta scaling in kconfig.c instead of mouse.c to not screw up when delta is requested in non-ingame situations - it actually belongs to the controls IMHO; Now support up to 8 joysticks; Changed some leftover malloc's to d_malloc and free to d_free
2008-10-16 17:27:02 +00:00
ubyte JoystickSensitivityX;
ubyte JoystickSensitivityY;
int JoystickDeadzone;
int CockpitMode;
char NetworkMessageMacro[4][MAX_MESSAGE_LEN];
int NetlifeKills;
int NetlifeKilled;
ubyte ReticleOn;
int HudMode;
int PersistentDebris;
int PRShot;
int OglAlphaEffects;
int OglReticle;
2008-04-24 14:27:54 +00:00
} __pack__ player_config;
extern struct player_config PlayerCfg;
2006-03-20 16:43:15 +00:00
extern int Default_leveling_on;
// adb: EZERO looks like a watcom extension that's only used here
#ifndef EZERO
#define EZERO 0
#endif
//Used to save kconfig values to disk.
int write_player_file();
int new_player_config();
int read_player_file();
//set a new highest level for player for this mission
void set_highest_level(int levelnum);
//gets the player's highest level from the file for this mission
int get_highest_level(void);
void plyr_read_stats();
void plyr_save_stats();
#endif