Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement