diff options
Diffstat (limited to 'indra/newview/llvlmanager.cpp')
-rwxr-xr-x | indra/newview/llvlmanager.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index d8de979f56..895ceed880 100755 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -29,45 +29,49 @@ #include "llvlmanager.h" #include "indra_constants.h" -#include "bitpack.h" #include "patch_code.h" #include "patch_dct.h" #include "llviewerregion.h" #include "llframetimer.h" #include "llsurface.h" +#include "llbitpack.h" + +const char LAND_LAYER_CODE = 'L'; +const char WIND_LAYER_CODE = '7'; +const char CLOUD_LAYER_CODE = '8'; LLVLManager gVLManager; LLVLManager::~LLVLManager() { S32 i; - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { delete mPacketData[i]; } - mPacketData.reset(); + mPacketData.clear(); } -void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) +void LLVLManager::addLayerData(LLVLData *vl_datap, const S32Bytes mesg_size) { if (LAND_LAYER_CODE == vl_datap->mType) { - mLandBits += mesg_size * 8; + mLandBits += mesg_size; } else if (WIND_LAYER_CODE == vl_datap->mType) { - mWindBits += mesg_size * 8; + mWindBits += mesg_size; } else if (CLOUD_LAYER_CODE == vl_datap->mType) { - mCloudBits += mesg_size * 8; + mCloudBits += mesg_size; } else { - llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl; + LL_ERRS() << "Unknown layer type!" << (S32)vl_datap->mType << LL_ENDL; } - mPacketData.put(vl_datap); + mPacketData.push_back(vl_datap); } void LLVLManager::unpackData(const S32 num_packets) @@ -75,7 +79,7 @@ void LLVLManager::unpackData(const S32 num_packets) static LLFrameTimer decode_timer; S32 i; - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { LLVLData *datap = mPacketData[i]; @@ -98,35 +102,35 @@ void LLVLManager::unpackData(const S32 num_packets) } } - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { delete mPacketData[i]; } - mPacketData.reset(); + mPacketData.clear(); } void LLVLManager::resetBitCounts() { - mLandBits = mWindBits = mCloudBits = 0; + mLandBits = mWindBits = mCloudBits = (S32Bits)0; } -S32 LLVLManager::getLandBits() const +U32Bits LLVLManager::getLandBits() const { return mLandBits; } -S32 LLVLManager::getWindBits() const +U32Bits LLVLManager::getWindBits() const { return mWindBits; } -S32 LLVLManager::getCloudBits() const +U32Bits LLVLManager::getCloudBits() const { return mCloudBits; } -S32 LLVLManager::getTotalBytes() const +S32Bytes LLVLManager::getTotalBytes() const { return mLandBits + mWindBits + mCloudBits; } @@ -134,12 +138,12 @@ S32 LLVLManager::getTotalBytes() const void LLVLManager::cleanupData(LLViewerRegion *regionp) { S32 cur = 0; - while (cur < mPacketData.count()) + while (cur < mPacketData.size()) { if (mPacketData[cur]->mRegionp == regionp) { delete mPacketData[cur]; - mPacketData.remove(cur); + mPacketData.erase(mPacketData.begin() + cur); } else { |