main/newdemo.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <malloc.h>
#include <limits.h>
#include "inferno.h"
#include "game.h"
#include "gr.h"
#include "bm.h"
#include "mono.h"
#include "3d.h"
#include "segment.h"
#include "texmap.h"
#include "laser.h"
#include "key.h"
#include "gameseg.h"
#include "object.h"
#include "physics.h"
#include "slew.h"
#include "render.h"
#include "wall.h"
#include "vclip.h"
#include "polyobj.h"
#include "fireball.h"
#include "error.h"
#include "ai.h"
#include "hostage.h"
#include "morph.h"
#include "powerup.h"
#include "fuelcen.h"
#include "sounds.h"
#include "collide.h"
#include "lighting.h"
#include "newdemo.h"
#include "gameseq.h"
#include "gamesave.h"
#include "gamemine.h"
#include "switch.h"
#include "gauges.h"
#include "player.h"
#include "vecmat.h"
#include "newmenu.h"
#include "args.h"
#include "palette.h"
#include "multi.h"
#include "network.h"
#include "text.h"
#include "cntrlcen.h"
#include "aistruct.h"
#include "mission.h"
#include "piggy.h"
#include "d_glob.h"
#include "d_io.h"
#include "u_mem.h"

Defines

#define ND_EVENT_EOF   0
#define ND_EVENT_START_DEMO   1
#define ND_EVENT_START_FRAME   2
#define ND_EVENT_VIEWER_OBJECT   3
#define ND_EVENT_RENDER_OBJECT   4
#define ND_EVENT_SOUND   5
#define ND_EVENT_SOUND_ONCE   6
#define ND_EVENT_SOUND_3D   7
#define ND_EVENT_WALL_HIT_PROCESS   8
#define ND_EVENT_TRIGGER   9
#define ND_EVENT_HOSTAGE_RESCUED   10
#define ND_EVENT_SOUND_3D_ONCE   11
#define ND_EVENT_MORPH_FRAME   12
#define ND_EVENT_WALL_TOGGLE   13
#define ND_EVENT_HUD_MESSAGE   14
#define ND_EVENT_CONTROL_CENTER_DESTROYED   15
#define ND_EVENT_PALETTE_EFFECT   16
#define ND_EVENT_PLAYER_ENERGY   17
#define ND_EVENT_PLAYER_SHIELD   18
#define ND_EVENT_PLAYER_FLAGS   19
#define ND_EVENT_PLAYER_WEAPON   20
#define ND_EVENT_EFFECT_BLOWUP   21
#define ND_EVENT_HOMING_DISTANCE   22
#define ND_EVENT_LETTERBOX   23
#define ND_EVENT_RESTORE_COCKPIT   24
#define ND_EVENT_REARVIEW   25
#define ND_EVENT_WALL_SET_TMAP_NUM1   26
#define ND_EVENT_WALL_SET_TMAP_NUM2   27
#define ND_EVENT_NEW_LEVEL   28
#define ND_EVENT_MULTI_CLOAK   29
#define ND_EVENT_MULTI_DECLOAK   30
#define ND_EVENT_RESTORE_REARVIEW   31
#define ND_EVENT_MULTI_DEATH   32
#define ND_EVENT_MULTI_KILL   33
#define ND_EVENT_MULTI_CONNECT   34
#define ND_EVENT_MULTI_RECONNECT   35
#define ND_EVENT_MULTI_DISCONNECT   36
#define ND_EVENT_MULTI_SCORE   37
#define ND_EVENT_PLAYER_SCORE   38
#define ND_EVENT_PRIMARY_AMMO   39
#define ND_EVENT_SECONDARY_AMMO   40
#define ND_EVENT_DOOR_OPENING   41
#define ND_EVENT_LASER_LEVEL   42
#define NORMAL_PLAYBACK   0
#define SKIP_PLAYBACK   1
#define INTERPOLATE_PLAYBACK   2
#define INTERPOL_FACTOR   (F1_0 + (F1_0/5))
#define DEMO_VERSION   13
#define DEMO_FILENAME   "tmpdemo.dem"
#define DEMO_MAX_LEVELS   29
#define DEMO_GAME_TYPE   2
#define VEL_PRECISION   12
#define N_PLAYER_SHIP_TEXTURES   6
#define BUF_SIZE   16384

Functions

void DoJasonInterpolate (fix recorded_time)
int newdemo_get_percent_done ()
void my_extract_shortpos (object *objp, shortpos *spp)
int newdemo_read (void *buffer, int elsize, int nelem)
int newdemo_write (void *buffer, int elsize, int nelem)
static void nd_write_byte (byte b)
static void nd_write_short (short s)
static void nd_write_int (int i)
static void nd_write_string (char *str)
static void nd_write_fix (fix f)
static void nd_write_fixang (fixang f)
static void nd_write_vector (vms_vector *v)
static void nd_write_angvec (vms_angvec *v)
void nd_write_shortpos (object *obj)
static void nd_read_byte (byte *b)
static void nd_read_short (short *s)
static void nd_read_int (int *i)
static void nd_read_string (char *str)
static void nd_read_fix (fix *f)
static void nd_read_fixang (fixang *f)
static void nd_read_vector (vms_vector *v)
static void nd_read_angvec (vms_angvec *v)
static void nd_read_shortpos (object *obj)
void nd_read_object (object *obj)
void nd_write_object (object *obj)
void newdemo_record_start_demo ()
void newdemo_record_start_frame (int frame_number, fix frame_time)
void newdemo_record_render_object (object *obj)
void newdemo_record_viewer_object (object *obj)
void newdemo_record_sound (int soundno)
void newdemo_record_sound_3d (int soundno, int angle, int volume)
void newdemo_record_sound_3d_once (int soundno, int angle, int volume)
void newdemo_record_wall_hit_process (int segnum, int side, int damage, int playernum)
void newdemo_record_trigger (int segnum, int side, int objnum)
void newdemo_record_hostage_rescued (int hostage_number)
void newdemo_record_morph_frame (morph_data *md)
void newdemo_record_wall_toggle (int segnum, int side)
void newdemo_record_control_center_destroyed ()
void newdemo_record_hud_message (char *message)
void newdemo_record_palette_effect (short r, short g, short b)
void newdemo_record_player_energy (int old_energy, int energy)
void newdemo_record_player_shields (int old_shield, int shield)
void newdemo_record_player_flags (uint oflags, uint flags)
void newdemo_record_player_weapon (int weapon_type, int weapon_num)
void newdemo_record_effect_blowup (short segment, int side, vms_vector *pnt)
void newdemo_record_homing_distance (fix distance)
void newdemo_record_letterbox (void)
void newdemo_record_rearview (void)
void newdemo_record_restore_cockpit (void)
void newdemo_record_restore_rearview (void)
void newdemo_record_wall_set_tmap_num1 (short seg, ubyte side, short cseg, ubyte cside, short tmap)
void newdemo_record_wall_set_tmap_num2 (short seg, ubyte side, short cseg, ubyte cside, short tmap)
void newdemo_record_multi_cloak (int pnum)
void newdemo_record_multi_decloak (int pnum)
void newdemo_record_multi_death (int pnum)
void newdemo_record_multi_kill (int pnum, byte kill)
void newdemo_record_multi_connect (int pnum, int new_player, char *new_callsign)
void newdemo_record_multi_reconnect (int pnum)
void newdemo_record_multi_disconnect (int pnum)
void newdemo_record_player_score (int score)
void newdemo_record_multi_score (int pnum, int score)
void newdemo_record_primary_ammo (int old_ammo, int new_ammo)
void newdemo_record_secondary_ammo (int old_ammo, int new_ammo)
void newdemo_record_door_opening (int segnum, int side)
void newdemo_record_laser_level (byte old_level, byte new_level)
void newdemo_set_new_level (int level_num)
int newdemo_read_demo_start (int rnd_demo)
void newdemo_pop_ctrlcen_triggers ()
int newdemo_read_frame_information ()
void newdemo_goto_beginning ()
void newdemo_goto_end ()
void newdemo_back_frames (int frames)
void interpolate_frame (fix d_play, fix d_recorded)
void newdemo_playback_one_frame ()
void newdemo_start_recording ()
void newdemo_stop_recording ()
void newdemo_start_playback (char *filename)
void newdemo_stop_playback ()
void newdemo_strip_frames (char *outname, int bytes_to_strip)

Variables

int Auto_demo = 0
int mekh_demo_paused = 0
char nd_save_callsign [CALLSIGN_LEN+1]
int Newdemo_state = 0
int Newdemo_vcr_state = 0
int Newdemo_start_frame = -1
unsigned int Newdemo_size
int Newdemo_num_written
int Newdemo_game_mode
int Newdemo_old_cockpit
byte Newdemo_no_space
byte Newdemo_at_eof
byte Newdemo_do_interpolate = 1
byte Newdemo_players_cloaked
byte Newdemo_warning_given = 0
byte Newdemo_cntrlcen_destroyed = 0
static byte nd_bad_read
int NewdemoFrameCount
short frame_bytes_written = 0
fix nd_playback_total
fix nd_recorded_total
fix nd_recorded_time
byte playback_style
byte First_time_playback = 1
fix JasonPlaybackTotal = 0
FILE * infile
FILE * outfile
objectprev_obj = NULL
char demoname_allowed_chars [] = "azAZ09__--"

Define Documentation

#define BUF_SIZE   16384
 

#define DEMO_FILENAME   "tmpdemo.dem"
 

#define DEMO_GAME_TYPE   2
 

#define DEMO_MAX_LEVELS   29
 

#define DEMO_VERSION   13
 

#define INTERPOL_FACTOR   (F1_0 + (F1_0/5))
 

#define INTERPOLATE_PLAYBACK   2
 

#define N_PLAYER_SHIP_TEXTURES   6
 

#define ND_EVENT_CONTROL_CENTER_DESTROYED   15
 

#define ND_EVENT_DOOR_OPENING   41
 

#define ND_EVENT_EFFECT_BLOWUP   21
 

#define ND_EVENT_EOF   0
 

#define ND_EVENT_HOMING_DISTANCE   22
 

#define ND_EVENT_HOSTAGE_RESCUED   10
 

#define ND_EVENT_HUD_MESSAGE   14
 

#define ND_EVENT_LASER_LEVEL   42
 

#define ND_EVENT_LETTERBOX   23
 

#define ND_EVENT_MORPH_FRAME   12
 

#define ND_EVENT_MULTI_CLOAK   29
 

#define ND_EVENT_MULTI_CONNECT   34
 

#define ND_EVENT_MULTI_DEATH   32
 

#define ND_EVENT_MULTI_DECLOAK   30
 

#define ND_EVENT_MULTI_DISCONNECT   36
 

#define ND_EVENT_MULTI_KILL   33
 

#define ND_EVENT_MULTI_RECONNECT   35
 

#define ND_EVENT_MULTI_SCORE   37
 

#define ND_EVENT_NEW_LEVEL   28
 

#define ND_EVENT_PALETTE_EFFECT   16
 

#define ND_EVENT_PLAYER_ENERGY   17
 

#define ND_EVENT_PLAYER_FLAGS   19
 

#define ND_EVENT_PLAYER_SCORE   38
 

#define ND_EVENT_PLAYER_SHIELD   18
 

#define ND_EVENT_PLAYER_WEAPON   20
 

#define ND_EVENT_PRIMARY_AMMO   39
 

#define ND_EVENT_REARVIEW   25
 

#define ND_EVENT_RENDER_OBJECT   4
 

#define ND_EVENT_RESTORE_COCKPIT   24
 

#define ND_EVENT_RESTORE_REARVIEW   31
 

#define ND_EVENT_SECONDARY_AMMO   40
 

#define ND_EVENT_SOUND   5
 

#define ND_EVENT_SOUND_3D   7
 

#define ND_EVENT_SOUND_3D_ONCE   11
 

#define ND_EVENT_SOUND_ONCE   6
 

#define ND_EVENT_START_DEMO   1
 

#define ND_EVENT_START_FRAME   2
 

#define ND_EVENT_TRIGGER   9
 

#define ND_EVENT_VIEWER_OBJECT   3
 

#define ND_EVENT_WALL_HIT_PROCESS   8
 

#define ND_EVENT_WALL_SET_TMAP_NUM1   26
 

#define ND_EVENT_WALL_SET_TMAP_NUM2   27
 

#define ND_EVENT_WALL_TOGGLE   13
 

#define NORMAL_PLAYBACK   0
 

#define SKIP_PLAYBACK   1
 

#define VEL_PRECISION   12
 


Function Documentation

void DoJasonInterpolate fix  recorded_time  ) 
 

void interpolate_frame fix  d_play,
fix  d_recorded
 

void my_extract_shortpos object objp,
shortpos spp
 

static void nd_read_angvec vms_angvec v  )  [static]
 

static void nd_read_byte byte b  )  [static]
 

static void nd_read_fix fix f  )  [static]
 

static void nd_read_fixang fixang f  )  [static]
 

static void nd_read_int int *  i  )  [static]
 

void nd_read_object object obj  ) 
 

static void nd_read_short short *  s  )  [static]
 

static void nd_read_shortpos object obj  )  [static]
 

static void nd_read_string char *  str  )  [static]
 

static void nd_read_vector vms_vector v  )  [static]
 

static void nd_write_angvec vms_angvec v  )  [static]
 

static void nd_write_byte byte  b  )  [static]
 

static void nd_write_fix fix  f  )  [static]
 

static void nd_write_fixang fixang  f  )  [static]
 

static void nd_write_int int  i  )  [static]
 

void nd_write_object object obj  ) 
 

static void nd_write_short short  s  )  [static]
 

void nd_write_shortpos object obj  ) 
 

static void nd_write_string char *  str  )  [static]
 

static void nd_write_vector vms_vector v  )  [static]
 

void newdemo_back_frames int  frames  ) 
 

int newdemo_get_percent_done  ) 
 

void newdemo_goto_beginning  ) 
 

void newdemo_goto_end  ) 
 

void newdemo_playback_one_frame  ) 
 

void newdemo_pop_ctrlcen_triggers  ) 
 

int newdemo_read void *  buffer,
int  elsize,
int  nelem
 

int newdemo_read_demo_start int  rnd_demo  ) 
 

int newdemo_read_frame_information  ) 
 

void newdemo_record_control_center_destroyed  ) 
 

void newdemo_record_door_opening int  segnum,
int  side
 

void newdemo_record_effect_blowup short  segment,
int  side,
vms_vector pnt
 

void newdemo_record_homing_distance fix  distance  ) 
 

void newdemo_record_hostage_rescued int  hostage_number  ) 
 

void newdemo_record_hud_message char *  message  ) 
 

void newdemo_record_laser_level byte  old_level,
byte  new_level
 

void newdemo_record_letterbox void   ) 
 

void newdemo_record_morph_frame morph_data md  ) 
 

void newdemo_record_multi_cloak int  pnum  ) 
 

void newdemo_record_multi_connect int  pnum,
int  new_player,
char *  new_callsign
 

void newdemo_record_multi_death int  pnum  ) 
 

void newdemo_record_multi_decloak int  pnum  ) 
 

void newdemo_record_multi_disconnect int  pnum  ) 
 

void newdemo_record_multi_kill int  pnum,
byte  kill
 

void newdemo_record_multi_reconnect int  pnum  ) 
 

void newdemo_record_multi_score int  pnum,
int  score
 

void newdemo_record_palette_effect short  r,
short  g,
short  b
 

void newdemo_record_player_energy int  old_energy,
int  energy
 

void newdemo_record_player_flags uint  oflags,
uint  flags
 

void newdemo_record_player_score int  score  ) 
 

void newdemo_record_player_shields int  old_shield,
int  shield
 

void newdemo_record_player_weapon int  weapon_type,
int  weapon_num
 

void newdemo_record_primary_ammo int  old_ammo,
int  new_ammo
 

void newdemo_record_rearview void   ) 
 

void newdemo_record_render_object object obj  ) 
 

void newdemo_record_restore_cockpit void   ) 
 

void newdemo_record_restore_rearview void   ) 
 

void newdemo_record_secondary_ammo int  old_ammo,
int  new_ammo
 

void newdemo_record_sound int  soundno  ) 
 

void newdemo_record_sound_3d int  soundno,
int  angle,
int  volume
 

void newdemo_record_sound_3d_once int  soundno,
int  angle,
int  volume
 

void newdemo_record_start_demo  ) 
 

void newdemo_record_start_frame int  frame_number,
fix  frame_time
 

void newdemo_record_trigger int  segnum,
int  side,
int  objnum
 

void newdemo_record_viewer_object object obj  ) 
 

void newdemo_record_wall_hit_process int  segnum,
int  side,
int  damage,
int  playernum
 

void newdemo_record_wall_set_tmap_num1 short  seg,
ubyte  side,
short  cseg,
ubyte  cside,
short  tmap
 

void newdemo_record_wall_set_tmap_num2 short  seg,
ubyte  side,
short  cseg,
ubyte  cside,
short  tmap
 

void newdemo_record_wall_toggle int  segnum,
int  side
 

void newdemo_set_new_level int  level_num  ) 
 

void newdemo_start_playback char *  filename  ) 
 

void newdemo_start_recording  ) 
 

void newdemo_stop_playback  ) 
 

void newdemo_stop_recording  ) 
 

void newdemo_strip_frames char *  outname,
int  bytes_to_strip
 

int newdemo_write void *  buffer,
int  elsize,
int  nelem
 


Variable Documentation

int Auto_demo = 0
 

char demoname_allowed_chars[] = "azAZ09__--"
 

byte First_time_playback = 1
 

short frame_bytes_written = 0
 

FILE* infile
 

fix JasonPlaybackTotal = 0
 

int mekh_demo_paused = 0
 

byte nd_bad_read [static]
 

fix nd_playback_total
 

fix nd_recorded_time
 

fix nd_recorded_total
 

char nd_save_callsign[CALLSIGN_LEN+1]
 

byte Newdemo_at_eof
 

byte Newdemo_cntrlcen_destroyed = 0
 

byte Newdemo_do_interpolate = 1
 

int Newdemo_game_mode
 

byte Newdemo_no_space
 

int Newdemo_num_written
 

int Newdemo_old_cockpit
 

byte Newdemo_players_cloaked
 

unsigned int Newdemo_size
 

int Newdemo_start_frame = -1
 

int Newdemo_state = 0
 

int Newdemo_vcr_state = 0
 

byte Newdemo_warning_given = 0
 

int NewdemoFrameCount
 

FILE* outfile
 

byte playback_style
 

object* prev_obj = NULL
 


Generated on Mon Aug 28 20:55:33 2006 for D1X-Rebirth by  doxygen 1.4.6