- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/libraries/network/packet/Gamestate.cc
r5929 r6412 95 95 return false; 96 96 } 97 97 98 98 // create the header object 99 99 assert( header_ == 0 ); … … 105 105 ObjectList<Synchronisable>::iterator it; 106 106 for(it = ObjectList<Synchronisable>::begin(); it; ++it){ 107 107 108 108 // tempsize=it->getSize(id, mode); 109 109 … … 111 111 if ( tempsize != 0 ) 112 112 dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) ); 113 113 114 114 #ifndef NDEBUG 115 115 if(currentsize+tempsize > size){ … … 362 362 assert(!header_->isCompressed() && !base->header_->isCompressed()); 363 363 assert(!header_->isDiffed()); 364 364 365 365 uint8_t *basep = GAMESTATE_START(base->data_); 366 366 uint8_t *gs = GAMESTATE_START(this->data_); 367 367 uint32_t dest_length = header_->getDataSize(); 368 368 369 369 if(dest_length==0) 370 370 return NULL; 371 371 372 372 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; 373 373 uint8_t *dest = GAMESTATE_START(ndata); 374 374 375 375 rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() ); 376 376 #ifndef NDEBUG … … 398 398 assert(!header_->isCompressed() && !base->header_->isCompressed()); 399 399 assert(header_->isDiffed()); 400 400 401 401 uint8_t *basep = GAMESTATE_START(base->data_); 402 402 uint8_t *gs = GAMESTATE_START(this->data_); 403 403 uint32_t dest_length = header_->getDataSize(); 404 404 405 405 if(dest_length==0) 406 406 return NULL; 407 407 408 408 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; 409 409 uint8_t *dest = ndata + GamestateHeader::getSize(); 410 410 411 411 rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() ); 412 412 413 413 Gamestate *g = new Gamestate(ndata, getClientID()); 414 414 assert(g->header_); … … 437 437 // uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; 438 438 // uint8_t *dest = ndata + GamestateHeader::getSize(); 439 // 440 // 439 // 440 // 441 441 // // LOOP-UNROLLED DIFFING 442 442 // uint32_t *dest32 = (uint32_t*)dest, *base32 = (uint32_t*)basep, *gs32 = (uint32_t*)gs; … … 465 465 // } 466 466 // } 467 // 467 // 468 468 // Gamestate *g = new Gamestate(ndata, getClientID()); 469 469 // *(g->header_) = *header_; … … 481 481 uint64_t* bd = (uint64_t*)basedata; 482 482 uint64_t* nd = (uint64_t*)newdata; 483 483 484 484 unsigned int i; 485 485 for( i=0; i<datalength/8; i++ ) … … 529 529 // COUT(0) << "myvector contains:"; 530 530 // for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ ) 531 // COUT(0) << " "<< (*itt).objID;531 // COUT(0) << ' ' << (*itt).objID; 532 532 // COUT(0) << endl; 533 533 for(it=dataVector_.begin(); it!=dataVector_.end();){ 534 534 SynchronisableHeader oldobjectheader(origdata); 535 535 SynchronisableHeader newobjectheader(newdata); 536 if ( (*it).objSize == 0 )536 if ( it->objSize == 0 ) 537 537 { 538 538 ++it; … … 541 541 objectsize = oldobjectheader.getDataSize(); 542 542 objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader 543 if ( (*it).objID == oldobjectheader.getObjectID() ){543 if ( it->objID == oldobjectheader.getObjectID() ){ 544 544 memcpy(newdata, origdata, objectsize); 545 545 assert(newobjectheader.isDataAvailable()==true);
Note: See TracChangeset
for help on using the changeset viewer.