home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume11
/
bt
/
part01
/
pack.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-11
|
760b
|
39 lines
/* pack.c: Functions for packing of Broken Throne data for transmission
via sockets. Copyright 1990, Tom Boutell. */
#include "types.h"
#include "pack.h"
void packint(offset,contents)
int offset;
int contents;
{
outputline[offset]=(contents % 32)+32;
contents/=32;
outputline[offset+1]=(contents % 32)+32;
contents/=32;
outputline[offset+2]=(contents % 32)+32;
}
void striplocation(at,specific,offset)
location* at;
char* specific;
int* offset;
{
at->x=specific[*offset]-64;
at->y=specific[*offset+1]-64;
*offset+=2;
}
void stripint(number,specific,offset)
int* number;
char* specific;
int* offset;
{
*number=specific[*offset]-32+(specific[*offset+1]-32)*32+
(specific[*offset+2]-32)*1024;
*offset+=3;
}