Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2154


Ignore:
Timestamp:
Nov 7, 2008, 11:28:58 PM (16 years ago)
Author:
scheusso
Message:

optimizations in gamestate generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/network/packet/Gamestate.cc

    r2132 r2154  
    358358    objectOffset=sizeof(synchronisableHeader); //skip the size and the availableData variables in the objectheader
    359359    if(it->second->doSelection(HEADER->id)){
    360       newobjectheader->dataAvailable=true; //TODO: probably not neccessary
    361       while(objectOffset<objectsize){
    362         *(newdata + objectOffset)=*(origdata + objectOffset);    // copy the data
    363         objectOffset++;
    364       }
     360      assert(newobjectheader->dataAvailable==true);
     361      memcpy(newdata+objectOffset, origdata+objectOffset, objectsize-objectOffset);
    365362    }else{
    366363      newobjectheader->dataAvailable=false;
    367       while(objectOffset<objectsize){
    368         *(newdata+objectOffset)=0;    // set to 0
    369         objectOffset++;
    370       }
     364      memset(newdata+objectOffset, 0, objectsize-objectOffset);
    371365      assert(objectOffset==objectsize);
    372366    }
Note: See TracChangeset for help on using the changeset viewer.