Skip to content

Commit

Permalink
Added Msg_SetOffset()
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 23, 2003
1 parent 1a4424a commit 3b31e10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions doomsday/Include/net_msg.h
Expand Up @@ -13,6 +13,7 @@ short Msg_ReadPackedShort();
int Msg_ReadLong();
void Msg_Read(void *dest, int len);
int Msg_Offset();
void Msg_SetOffset(int offset);
int Msg_MemoryLeft();
boolean Msg_End();

Expand Down
11 changes: 8 additions & 3 deletions doomsday/Src/net_msg.c
Expand Up @@ -136,17 +136,22 @@ void Msg_Read(void *dest, int len)
netbuffer.cursor += len;
}

int Msg_Offset()
int Msg_Offset(void)
{
return netbuffer.cursor - netbuffer.msg.data;
}

int Msg_MemoryLeft()
void Msg_SetOffset(int offset)
{
netbuffer.cursor = netbuffer.msg.data + offset;
}

int Msg_MemoryLeft(void)
{
return NETBUFFER_MAXDATA - (netbuffer.cursor - netbuffer.msg.data);
}

boolean Msg_End()
boolean Msg_End(void)
{
return (netbuffer.cursor-netbuffer.msg.data >= netbuffer.length);
}

0 comments on commit 3b31e10

Please sign in to comment.