• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

VariableListDeltaTracker.cpp

Go to the documentation of this file.
00001 #include "VariableListDeltaTracker.h"
00002 
00003 using namespace RakNet;
00004 
00005 VariableListDeltaTracker::VariableListDeltaTracker() {nextWriteIndex=0;}
00006 VariableListDeltaTracker::~VariableListDeltaTracker()
00007 {
00008         unsigned int i;
00009         for (i=0; i < variableList.Size(); i++)
00010                 rakFree_Ex(variableList[i].lastData,__FILE__,__LINE__);
00011 }
00012 
00013 // Call before using a series of WriteVar
00014 void VariableListDeltaTracker::StartWrite(void) {nextWriteIndex=0;}
00015 
00016 void VariableListDeltaTracker::FlagDirtyFromBitArray(unsigned char *bArray)
00017 {
00018         unsigned short readOffset=0;
00019         for (readOffset=0; readOffset < variableList.Size(); readOffset++)
00020         {
00021                 bool result = ( bArray[ readOffset >> 3 ] & ( 0x80 >> ( readOffset & 7 ) ) ) !=0;
00022 
00023                 if (result==true)
00024                         variableList[readOffset].isDirty=true;
00025         }
00026 }
00027 VariableListDeltaTracker::VariableLastValueNode::VariableLastValueNode()
00028 {
00029         lastData=0;
00030 }
00031 VariableListDeltaTracker::VariableLastValueNode::VariableLastValueNode(const unsigned char *data, int _byteLength)
00032 {
00033         lastData=(char*) rakMalloc_Ex(_byteLength,__FILE__,__LINE__);
00034         memcpy(lastData,data,_byteLength);
00035         byteLength=_byteLength;
00036         isDirty=false;
00037 }
00038 VariableListDeltaTracker::VariableLastValueNode::~VariableLastValueNode()
00039 {
00040 }

Generated on Thu Sep 30 2010 01:27:29 for RakNet by  doxygen 1.7.1