home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume11 / bt / part01 / pack.c < prev    next >
C/C++ Source or Header  |  1990-12-11  |  760b  |  39 lines

  1. /* pack.c: Functions for packing of Broken Throne data for transmission
  2.    via sockets. Copyright 1990, Tom Boutell. */
  3.  
  4. #include "types.h"
  5. #include "pack.h"
  6.  
  7. void packint(offset,contents)
  8.   int offset;
  9.   int contents; 
  10. {
  11.   outputline[offset]=(contents % 32)+32;
  12.   contents/=32;
  13.   outputline[offset+1]=(contents % 32)+32;
  14.   contents/=32;
  15.   outputline[offset+2]=(contents % 32)+32;
  16. }
  17.  
  18. void striplocation(at,specific,offset)
  19.   location* at;
  20.   char* specific;
  21.   int* offset;
  22. {
  23.   at->x=specific[*offset]-64;
  24.   at->y=specific[*offset+1]-64;
  25.   *offset+=2;
  26. }
  27.  
  28. void stripint(number,specific,offset)
  29.   int* number;
  30.   char* specific;
  31.   int* offset;
  32. {
  33.   *number=specific[*offset]-32+(specific[*offset+1]-32)*32+
  34.           (specific[*offset+2]-32)*1024;
  35.   *offset+=3;
  36. }
  37.  
  38.  
  39.