Advertisement
spiritovod

valorant

Feb 2nd, 2023 (edited)
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. struct FPositionVertexBuffer4
  2. {
  3.     TArray<FVector> Verts;
  4.     int32           Stride;
  5.     int32           NumVertices;
  6.  
  7.     friend FArchive& operator<<(FArchive& Ar, FPositionVertexBuffer4& S)
  8.     {
  9.         guard(FPositionVertexBuffer4<<);
  10.  
  11.         Ar << S.Stride << S.NumVertices;
  12.  
  13.         if (Ar.Game == GAME_Valorant)
  14.         {
  15.             int32 isPacked;
  16.             Ar << isPacked;
  17.             if (isPacked > 1) Ar.Seek(Ar.Tell() - 4);
  18.             else
  19.             {
  20.                 int32 check;
  21.                 Ar << check;
  22.                 Ar.Seek(Ar.Tell() - 4);
  23.                 if (check != 8 || check != 12)
  24.                 {
  25.                     FBoxSphereBounds Bounds;
  26.                     Ar << Bounds;
  27.                 }
  28.             }
  29.         }
  30.  
  31.         DBG_MESH("PositionStream: IS:%d NV:%d\n", S.Stride, S.NumVertices);
  32.  
  33. #if DAYSGONE
  34.         // Days Gone stuff
  35. #endif // DAYSGONE
  36.  
  37.         // Scavengers & Destroy All Humans 2020 & Valorant
  38.         if (S.Stride == 8)
  39.         {
  40.             TArray<FVectorHalf4> HalfVerts;
  41.             HalfVerts.BulkSerialize(Ar);
  42.             CopyArray(S.Verts, HalfVerts);
  43.             return Ar;
  44.         }
  45.  
  46.         S.Verts.BulkSerialize(Ar);
  47.         return Ar;
  48.  
  49.         unguard;
  50.     }
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement