Data Structures | |
struct | msg_s |
Typedefs | |
typedef struct msg_s | qmsg_t |
Functions | |
void | MSG_BeginReading (qmsg_t *msg) |
Reset the message read status. More... | |
int | MSG_GetReadCount (qmsg_t *msg) |
Get the number of bytes that have been read from the message. More... | |
float | MSG_ReadAngle (qmsg_t *msg) |
Read an 8-bit encoded angle from the message. More... | |
float | MSG_ReadAngle16 (qmsg_t *msg) |
Read a little-endian 16-bit encoded angle from the message. More... | |
void | MSG_ReadAngle16V (qmsg_t *msg, vec3_t angles) |
Read three little-endian 16-bit encoded angle values from the message. More... | |
void | MSG_ReadAngleV (qmsg_t *msg, vec3_t angles) |
Read three 8-bit encoded angle values from the message. More... | |
int | MSG_ReadByte (qmsg_t *msg) |
Read a single byte from the message. More... | |
int | MSG_ReadBytes (qmsg_t *msg, void *buf, int len) |
Read a block of bytes from the message. More... | |
float | MSG_ReadCoord (qmsg_t *msg) |
Read a little-endian 16-bit fixed point (13.3) coordinate value from the message. More... | |
void | MSG_ReadCoordAngleV (qmsg_t *msg, vec3_t coord, vec3_t angles) |
Read interleaved little-endian 16-bit coordinate/8-bit angle vectors from the message. More... | |
void | MSG_ReadCoordV (qmsg_t *msg, vec3_t coord) |
Read three little-endian 16-bit fixed point (s12.3) coordinate values from the message. More... | |
float | MSG_ReadFloat (qmsg_t *msg) |
Read a single little-endian float from the message. More... | |
int | MSG_ReadLong (qmsg_t *msg) |
Read a single little-endian long from the message. More... | |
int | MSG_ReadShort (qmsg_t *msg) |
Read a single little-endian unsigned short from the message. More... | |
const char * | MSG_ReadString (qmsg_t *msg) |
Read a nul terminated string from the message. More... | |
int | MSG_ReadUTF8 (qmsg_t *msg) |
Read a single UTF-8 encoded value. More... | |
void | MSG_WriteAngle (sizebuf_t *sb, float angle) |
void | MSG_WriteAngle16 (sizebuf_t *sb, float angle) |
void | MSG_WriteAngle16V (sizebuf_t *sb, const vec3_t angle) |
void | MSG_WriteAngleV (sizebuf_t *sb, const vec3_t angles) |
void | MSG_WriteByte (sizebuf_t *sb, int c) |
void | MSG_WriteBytes (sizebuf_t *sb, const void *buf, int len) |
void | MSG_WriteCoord (sizebuf_t *sb, float coord) |
void | MSG_WriteCoordAngleV (sizebuf_t *sb, const vec3_t coord, const vec3_t angles) |
void | MSG_WriteCoordV (sizebuf_t *sb, const vec3_t coord) |
void | MSG_WriteFloat (sizebuf_t *sb, float f) |
void | MSG_WriteLong (sizebuf_t *sb, int c) |
void | MSG_WriteShort (sizebuf_t *sb, int c) |
void | MSG_WriteString (sizebuf_t *sb, const char *s) |
void | MSG_WriteUTF8 (sizebuf_t *sb, unsigned utf8) |
void MSG_BeginReading | ( | qmsg_t * | msg | ) |
Reset the message read status.
Clears the error flag and resets the read index to 0.
msg | The message to be reset. |
Get the number of bytes that have been read from the message.
The result can also be used as the index to the next byte to be read.
msg | The message to check. |
float MSG_ReadAngle | ( | qmsg_t * | msg | ) |
Read an 8-bit encoded angle from the message.
Advances the read index.
msg | The message from which the angle will be read. |
float MSG_ReadAngle16 | ( | qmsg_t * | msg | ) |
Read a little-endian 16-bit encoded angle from the message.
Advances the read index.
msg | The message from which the angle will be read. |
Read three little-endian 16-bit encoded angle values from the message.
Advances the read index.
msg | The message from which the angles will be read. |
angles | The vector into which the three angles will be placed. |
Read three 8-bit encoded angle values from the message.
Advances the read index.
msg | The message from which the angles will be read. |
angles | The vector into which the three angles will be placed. |
Read a single byte from the message.
Advances the read index.
msg | The message from which the byte will be read. |
Read a block of bytes from the message.
Advances the read index to the first byte after the block.
If not all bytes could be read, qmsg_t::badread will be set to true.
msg | The message from which the string will be read. |
buf | Pointer to the buffer into which the bytes will be placed. |
len | The number of bytes to read. |
float MSG_ReadCoord | ( | qmsg_t * | msg | ) |
Read a little-endian 16-bit fixed point (13.3) coordinate value from the message.
Advances the read index to the first byte after the block.
msg | The message from which the coordinate will be read. |
Read interleaved little-endian 16-bit coordinate/8-bit angle vectors from the message.
Advances the read index.
msg | The message from which the angle will be read. |
coord | The vector into which the converted coordinate vector will be placed. |
angles | The vector into which the converted coordinate angles will be placed. |
Read three little-endian 16-bit fixed point (s12.3) coordinate values from the message.
Advances the read index.
msg | The message from which the coordinates will be read. |
coord | The vector into which the three coordinates will be placed. |
float MSG_ReadFloat | ( | qmsg_t * | msg | ) |
Read a single little-endian float from the message.
Advances the read index.
msg | The message from which the float will be read. |
Read a single little-endian long from the message.
Advances the read index.
msg | The message from which the long will be read. |
Read a single little-endian unsigned short from the message.
Advances the read index.
msg | The message from which the short will be read. |
Read a nul terminated string from the message.
Advances the read index to the first byte after the string.
The returned string is guaranteed to be valid. If the string in the message is not nul terminated, the string will be safely extracted, qmst_t::badread set to true, and the extracted string will be returned.
msg | The message from which the string will be read. |
Read a single UTF-8 encoded value.
Advances the read index the the first byte after the value. However, the read index will not be advanced if any error is detected.
A successfull read will read between 1 and 6 bytes from the message.
msg | The message from which the UTF-8 encoded value will be read. |
void MSG_WriteAngle | ( | sizebuf_t * | sb, |
float | angle | ||
) |
void MSG_WriteAngle16 | ( | sizebuf_t * | sb, |
float | angle | ||
) |
void MSG_WriteCoord | ( | sizebuf_t * | sb, |
float | coord | ||
) |
void MSG_WriteFloat | ( | sizebuf_t * | sb, |
float | f | ||
) |
void MSG_WriteUTF8 | ( | sizebuf_t * | sb, |
unsigned | utf8 | ||
) |