@@ -73,6 +73,23 @@ struct FColorVertexBuffer4
73
73
}
74
74
};
75
75
76
+ #if DAYSGONE
77
+
78
+ struct FDGPackedVector
79
+ {
80
+ FVectorFixed48 V;
81
+ uint16 Pad;
82
+
83
+ friend FArchive& operator <<(FArchive& Ar, FDGPackedVector& PV)
84
+ {
85
+ return Ar << PV.V << PV.Pad ;
86
+ }
87
+ };
88
+
89
+ SIMPLE_TYPE (FDGPackedVector, uint16);
90
+
91
+ #endif // DAYSGONE
92
+
76
93
struct FPositionVertexBuffer4
77
94
{
78
95
TArray<FVector> Verts;
@@ -85,6 +102,36 @@ struct FPositionVertexBuffer4
85
102
86
103
Ar << S.Stride << S.NumVertices ;
87
104
DBG_MESH (" PositionStream: IS:%d NV:%d\n " , S.Stride , S.NumVertices );
105
+
106
+ #if DAYSGONE
107
+ if (Ar.Game == GAME_DaysGone)
108
+ {
109
+ // This happens only for StaticMesh
110
+ if (S.Stride == 8 )
111
+ {
112
+ TArray<FDGPackedVector> PackedVerts;
113
+ PackedVerts.BulkSerialize (Ar);
114
+ S.Verts .AddUninitialized (PackedVerts.Num ());
115
+ for (int i = 0 ; i < PackedVerts.Num (); i++)
116
+ {
117
+ S.Verts [i] = PackedVerts[i].V ;
118
+ }
119
+ // todo: should use some bounds to unpack positions, almost works but a bit distorted data
120
+ return Ar;
121
+ }
122
+ else if (S.Stride == 4 )
123
+ {
124
+ TArray<uint32> PackedVerts;
125
+ // No idea which format is used here
126
+ PackedVerts.BulkSerialize (Ar);
127
+ // todo: should use some bounds to unpack positions; position is 32-bit, with full use of all bits
128
+ return Ar;
129
+ }
130
+ // else - use standard format
131
+ assert (S.Stride == 12 );
132
+ }
133
+ #endif // DAYSGONE
134
+
88
135
S.Verts .BulkSerialize (Ar);
89
136
return Ar;
90
137
@@ -504,6 +551,14 @@ struct FSkeletalMaterial
504
551
505
552
Ar << M.Material ;
506
553
554
+ #if DAYSGONE
555
+ if (Ar.Game == GAME_DaysGone)
556
+ {
557
+ int32 unk1;
558
+ Ar << unk1;
559
+ }
560
+ #endif // DAYSGONE
561
+
507
562
if (FEditorObjectVersion::Get (Ar) >= FEditorObjectVersion::RefactorMeshEditorMaterials)
508
563
{
509
564
Ar << M.MaterialSlotName ;
@@ -1217,6 +1272,15 @@ struct FStaticLODModel4
1217
1272
1218
1273
if (Ar.ArVer >= VER_UE4_APEX_CLOTH && Lod.HasClothData ())
1219
1274
Ar << Lod.ClothVertexBuffer ;
1275
+
1276
+ #if DAYSGONE
1277
+ if (Ar.Game == GAME_DaysGone)
1278
+ {
1279
+ FMultisizeIndexContainer unk1;
1280
+ int32 unk2, unk3, unk4;
1281
+ Ar << unk1 << unk2 << unk3 << unk4;
1282
+ }
1283
+ #endif // DAYSGONE
1220
1284
}
1221
1285
}
1222
1286
@@ -2267,6 +2331,14 @@ void UStaticMesh4::Serialize(FArchive &Ar)
2267
2331
// serialize FStaticMeshRenderData
2268
2332
if (bCooked)
2269
2333
{
2334
+ #if DAYSGONE
2335
+ if (Ar.Game == GAME_DaysGone)
2336
+ {
2337
+ int32 unk;
2338
+ Ar << unk;
2339
+ }
2340
+ #endif // DAYSGONE
2341
+
2270
2342
// Note: code below still contains 'if (bCooked)' switches, this is because the same
2271
2343
// code could be used to read data from DDC, for non-cooked assets.
2272
2344
DBG_STAT (" Serializing RenderData\n " );
0 commit comments