Update of /cvsroot/playerstage/code/player/libplayertcp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10759/libplayertcp
Modified Files:
playertcp.cc playerudp.cc
Log Message:
fixed push/pull, and vfh
Index: playerudp.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/playerudp.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** playerudp.cc 4 Dec 2007 02:28:23 -0000 1.10
--- playerudp.cc 7 Dec 2007 01:50:15 -0000 1.11
***************
*** 559,563 ****
}
// try to pop a pending message
! else if((msg = client->queue->PopReady()))
{
// Note that we make a COPY of the header. This is so that we can
--- 559,563 ----
}
// try to pop a pending message
! else if((msg = client->queue->Pop()))
{
// Note that we make a COPY of the header. This is so that we can
***************
*** 1158,1164 ****
resp = new Message(resphdr, NULL);
assert(resp);
! client->queue->Push(*resp);
delete resp;
! client->queue->MarkAllReady ();
break;
--- 1158,1165 ----
resp = new Message(resphdr, NULL);
assert(resp);
! client->queue->PushFront(*resp,false);
delete resp;
! // Remember that the user requested some
! client->queue->SetDataRequested(true,false);
break;
Index: playertcp.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/playertcp.cc,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** playertcp.cc 4 Dec 2007 02:28:23 -0000 1.70
--- playertcp.cc 7 Dec 2007 01:50:15 -0000 1.71
***************
*** 580,584 ****
}
// try to pop a pending message
! else if((msg = client->queue->PopReady()))
{
// Note that we make a COPY of the header. This is so that we can
--- 580,584 ----
}
// try to pop a pending message
! else if((msg = client->queue->Pop()))
{
// Note that we make a COPY of the header. This is so that we can
***************
*** 637,642 ****
// compress the tile
! if(compress((Bytef*)zipped_data->data,&count,
! (const Bytef*)raw_data->data, raw_data->data_count) !=
Z_OK)
{
PLAYER_ERROR("failed to compress map data");
--- 637,644 ----
// compress the tile
! int ret;
! ret = compress((Bytef*)zipped_data->data,&count,
! (const Bytef*)raw_data->data, raw_data->data_count);
! if((ret != Z_OK) && (ret != Z_STREAM_END))
{
PLAYER_ERROR("failed to compress map data");
***************
*** 943,954 ****
raw_data->width = zipped_data->width;
raw_data->height = zipped_data->height;
! uLongf count = 10*zipped_data->data_count;
! raw_data->data = (int8_t*)calloc(count,sizeof(int8_t));
// uncompress the tile
! if(uncompress((Bytef*)raw_data->data,&count,
! (const Bytef*)zipped_data->data,
! (uLongf)zipped_data->data_count) != Z_OK)
{
PLAYER_ERROR("failed to uncompress map data");
}
else
--- 945,960 ----
raw_data->width = zipped_data->width;
raw_data->height = zipped_data->height;
! //uLongf count = 10*zipped_data->data_count;
! uLongf count = zipped_data->width * zipped_data->height;
! raw_data->data = (int8_t*)calloc(2*count,sizeof(int8_t));
// uncompress the tile
! int ret;
! ret = uncompress((Bytef*)raw_data->data,&count,
! (const Bytef*)zipped_data->data,
! (uLongf)zipped_data->data_count);
! if((ret != Z_OK) && (ret != Z_STREAM_END))
{
PLAYER_ERROR("failed to uncompress map data");
+ printf("ret: %d\n", ret);
}
else
***************
*** 1247,1259 ****
// Request data
case PLAYER_PLAYER_REQ_DATA:
! // Make up and push out the reply
resphdr.type = PLAYER_MSGTYPE_RESP_ACK;
resp = new Message(resphdr, NULL);
assert(resp);
! client->queue->Push(*resp);
delete resp;
// Remember that the user requested some
! client->queue->SetDataRequested(true);
! client->queue->MarkAllReady ();
break;
--- 1253,1264 ----
// Request data
case PLAYER_PLAYER_REQ_DATA:
! // Make up and push the reply onto the front of the queue
resphdr.type = PLAYER_MSGTYPE_RESP_ACK;
resp = new Message(resphdr, NULL);
assert(resp);
! client->queue->PushFront(*resp,false);
delete resp;
// Remember that the user requested some
! client->queue->SetDataRequested(true,false);
break;
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit