components/prboom/g_game.c
/* Demo limits removed -- killough
 * cph - record straight to file
 */
Demo limits removed -- killough
cph - record straight to file
Demo limits removed -- killough cph - record straight to file
void G_WriteDemoTiccmd (ticcmd_t* cmd)
{
  char buf[5];
  char *p = buf;
  *p++ = cmd->forwardmove;
  *p++ = cmd->sidemove;
  if (!longtics) {
    *p++ = (cmd->angleturn+128)>>8;
  } else {
    signed short a = cmd->angleturn;
    *p++ = a & 0xff;
    *p++ = (a >> 8) & 0xff;
  }
  *p++ = cmd->buttons;
  if (fwrite(buf, p-buf, 1, demofp) != 1)
    I_Error("G_WriteDemoTiccmd: error writing demo");
  demo_p = buf;
  G_ReadDemoTiccmd (cmd);         
}
void G_WriteDemoTiccmd ( ticcmd_t * cmd ) { char buf [ 5 ] ; char * p = buf ; * p ++ = cmd -> forwardmove ; * p ++ = cmd -> sidemove ; if ( ! longtics ) { * p ++ = ( cmd -> angleturn + 128 ) >> 8 ; } else { signed short a = cmd -> angleturn ; * p ++ = a & 0xff ; * p ++ = ( a >> 8 ) & 0xff ; } * p ++ = cmd -> buttons ; if ( fwrite ( buf , p - buf , 1 , demofp ) != 1 ) I_Error ( " " ) ; demo_p = buf ; G_ReadDemoTiccmd ( cmd ) ; }
Demo limits removed -- killough
 cph - record straight to file
Demo limits removed -- killough cph - record straight to file
/* cph - alias demo_p to it so we can read it back */ // make SURE it is exactly the same