Advertisement
spiritovod

Apex

Jul 25th, 2022 (edited)
1,614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.67 KB | None | 0 0
  1. struct FStaticMeshSection4
  2.  
  3.         // Apex Legends Mobile (new2)
  4.         int32 unk_index, unk_verts;
  5.         Ar.Seek(Ar.Tell() + 28);
  6.         Ar << unk_index;
  7.         Ar.Seek(Ar.Tell() + unk_index * 2);
  8.         Ar << unk_verts;
  9.         Ar.Seek(Ar.Tell() + unk_verts * 16);
  10.  
  11. #if DAUNTLESS
  12.         if (Ar.Game == GAME_Dauntless) Ar.Seek(Ar.Tell()+8); // 8 zero-filled bytes here
  13. #endif
  14.         //?? Has editor-only data?
  15.         return Ar;
  16.  
  17. ----------------------------------------------------
  18.  
  19. struct FStaticMeshLODModel4
  20.  
  21.         // Crackdown 3 & Apex Legends Mobile
  22.         int32 unk_size, unk;
  23.         Ar << unk_size << unk;
  24.  
  25.         FStripDataFlags StripFlags(Ar);
  26.  
  27.         Ar << Lod.Sections;
  28.  
  29.         ...
  30.  
  31.         uint32 SerializedBuffersSize, DepthOnlyIBSize, ReversedIBsSize;
  32.         if (!bIsLODCookedOut)
  33.         Ar << SerializedBuffersSize << DepthOnlyIBSize << ReversedIBsSize;
  34.  
  35. ----------------------------------------------------
  36.  
  37. static void SerializeBuffers
  38.  
  39.         // Apex Legends Mobile (new2)
  40.         for (int i = 0; i < 2; i++)
  41.         {
  42.             FColorVertexBuffer4 DummyColorVertexBuffer;
  43.             Ar << DummyColorVertexBuffer;
  44.         }
  45.  
  46.         Ar << Lod.IndexBuffer;
  47.  
  48. ----------------------------------------------------
  49.  
  50. struct FColorVertexBuffer4
  51.  
  52.         // Apex Legends Mobile (beta)
  53.         if (S.Stride > 4)
  54.         {
  55.             SkipBulkArrayData(Ar);
  56.             return Ar;
  57.         }
  58.  
  59.         DBG_MESH("ColorStream: IS:%d NV:%d\n", S.Stride, S.NumVertices);
  60.  
  61. ----------------------------------------------------
  62.  
  63. postprocessing after Lods.Serialize2<FStaticMeshLODModel4::Serialize>(Ar)
  64.  
  65.         // Apex Legends Mobile (new2)
  66.         Ar.Seek(Ar.Tell() + 4);
  67.  
  68.         Ar << Bounds;
  69.  
  70.         if (Ar.Game >= GAME_UE4(15) && Ar.Game < GAME_UE4(16)) goto no_LODShareStaticLighting;
  71.  
  72.         // Apex Legends Mobile (new)
  73.         int32 Count;
  74.         Ar << Count;
  75.         Ar.Seek(Ar.Tell() + Count * 12);
  76.  
  77.         ...
  78.  
  79.         // Apex Legends Mobile
  80.         Ar.Seek(Ar.Tell() + 4);
  81.  
  82.         unguard;
  83.     } // end of FStaticMeshRenderData
  84.  
  85.     ...
  86.  
  87.     if (bHasOccluderData)
  88.         {
  89.             // Apex Legends Mobile
  90.             int unkSize;
  91.             Ar << unkSize;
  92.             for (int i = 0; i < unkSize; i++)
  93.             {
  94.                 Ar.Seek(Ar.Tell() + 16 * 4);
  95.                 int elemSize;
  96.                 Ar << elemSize;
  97.                 Ar.Seek(Ar.Tell() + elemSize * 16);
  98.             }
  99.             Ar << unkSize;
  100.             Ar.Seek(Ar.Tell() + unkSize * 12);
  101.         }
  102.    
  103. ----------------------------------------------------
  104.  
  105. scaling from ExtendedBounds (doesnt work properly from Bounds) 
  106.  
  107.     // Apex Legends Mobile (new2)
  108.         UStaticMesh4* LoadingMesh = (UStaticMesh4*)UObject::GLoadingObj;
  109.         FVector Scale = LoadingMesh->ExtendedBounds.BoxExtent;
  110.         Scale.Scale(2);
  111.         for (FStaticMeshLODModel4& Lod : Lods)
  112.         {
  113.             if (Lod.PositionVertexBuffer.Stride == 12) // depends on implementation of unpacking
  114.             {
  115.                 for (FVector& V : Lod.PositionVertexBuffer.Verts)
  116.                     V.Scale(Scale);
  117.             }
  118.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement