SHARE
TWEET

Untitled

a guest Jul 17th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool FNetCompressedRegion::NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess) {
  2.     TArray<uint8> compressed;
  3.     if(Ar.IsLoading()) {
  4.         Ar << compressed;
  5.         FArchiveLoadCompressedProxy decompressor(compressed, NAME_Zlib);
  6.  
  7.         for(int x=0; x < 32; x++) {
  8.             for(int y=0; y < 32; y++) {
  9.                 for(int z=0; z < 32; z++) {
  10.                     decompressor << data[x][y][z][0];
  11.                     decompressor << data[x][y][z][1];
  12.                 }
  13.             }
  14.         }
  15.  
  16.        
  17.         decompressor.Flush();
  18.         decompressor.Close();
  19.  
  20.     } else {
  21.         FArchiveSaveCompressedProxy compressor(compressed, NAME_Zlib);
  22.         for(int x=0; x < 32; x++) {
  23.             for(int y=0; y < 32; y++) {
  24.                 for(int z=0; z < 32; z++) {
  25.                     compressor << data[x][y][z][0];
  26.                     compressor << data[x][y][z][1];
  27.                 }
  28.             }
  29.         }
  30.         compressor.Flush();
  31.         Ar << compressed;
  32.         compressor.Close();
  33.     }
  34.     UE_LOG(LogTemp, Warning, TEXT("archive size %d b"),Ar.TotalSize())
  35.     return true;
  36.     //Ar << data;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top