Fix for XML/PSO conversion inaccuracies

This commit is contained in:
dexy 2019-01-14 12:25:03 +11:00
parent fbf57293c1
commit 9af0b41967
5 changed files with 60 additions and 43 deletions

View File

@ -2637,12 +2637,21 @@ namespace CodeWalker.GameFiles
diffpsos.Add(fentry.Path);
}
if (entry.NameLower == "wantedtuning.ymt")
{ }
if (entry.NameLower == "popgroups.ymt")
{ }
if (entry.NameLower == "clip_sets.ymt")
{ }
//if (entry.NameLower == "vfxinteriorinfo.ymt")
//{ }
//if (entry.NameLower == "vfxvehicleinfo.ymt")
//{ }
//if (entry.NameLower == "vfxpedinfo.ymt")
//{ }
//if (entry.NameLower == "vfxregioninfo.ymt")
//{ }
//if (entry.NameLower == "vfxweaponinfo.ymt")
//{ }
if (entry.NameLower == "physicstasks.ymt")
{ }
}
}

View File

@ -3218,8 +3218,8 @@ namespace CodeWalker.GameFiles
vecPlayerPos = 2050268192,
vehglassCrackTextureParams = 3043112491,
vehglassCrackTextureSampler = 3541769459,
Velocity1 = 1362920836,
Velocity2 = 1853341690,
velocity1 = 1362920836,
velocity2 = 1853341690,
VelocityBufferSampler = 415075366,
VelocityMapSampler = 3944176109,
VelocityTexSampler = 2305380067,
@ -8629,6 +8629,18 @@ namespace CodeWalker.GameFiles
yawKp = 922081581,
Velocity2 = 2944635386,

View File

@ -54,13 +54,13 @@ namespace CodeWalker.GameFiles
{
PsoBuilderBlock block = EnsureBlock(type);
int brem = data.Length % 16;
if (brem > 0)
{
int newlen = data.Length - brem + 16;
byte[] newdata = new byte[newlen];
Buffer.BlockCopy(data, 0, newdata, 0, data.Length);
data = newdata; //make sure item size is multiple of 16... so pointers don't need sub offsets!
}
//if (brem > 0)
//{
// int newlen = data.Length - brem + 16;
// byte[] newdata = new byte[newlen];
// Buffer.BlockCopy(data, 0, newdata, 0, data.Length);
// data = newdata; //make sure item size is multiple of 16... so pointers don't need sub offsets!
//}
int idx = block.AddItem(data);
PsoBuilderPointer r = new PsoBuilderPointer();
r.BlockID = block.Index + 1;

View File

@ -9942,7 +9942,8 @@ namespace CodeWalker.GameFiles
new PsoStructureEntryInfo(MetaName.MpActivationModifiers, PsoDataType.Structure, 272, 0, (MetaName)2720813484),
new PsoStructureEntryInfo(MetaName.PlayerBumpedByCloneCarActivationModifier, PsoDataType.Float, 352, 0, 0),
new PsoStructureEntryInfo(MetaName.ClonePlayerBumpedByCarActivationModifier, PsoDataType.Float, 356, 0, 0),
new PsoStructureEntryInfo(MetaName.ClonePlayerBumpedByCloneCarActivationModifier, PsoDataType.Float, 360, 0, 0),
//new PsoStructureEntryInfo(MetaName.ClonePlayerBumpedByCloneCarActivationModifier, PsoDataType.Float, 360, 0, 0),
new PsoStructureEntryInfo((MetaName)2048881690, PsoDataType.Float, 360, 0, 0), //seems to be newer than above..
new PsoStructureEntryInfo(MetaName.MaxVehicleCapsulePushTimeForRagdollActivation, PsoDataType.Float, 364, 0, 0),
new PsoStructureEntryInfo(MetaName.MaxVehicleCapsulePushTimeForPlayerRagdollActivation, PsoDataType.Float, 368, 0, 0),
new PsoStructureEntryInfo(MetaName.VehicleMinSpeedForContinuousPushActivation, PsoDataType.Float, 372, 0, 0),

View File

@ -185,38 +185,33 @@ namespace CodeWalker.Rendering
fragoffset = phys.OwnerFragPhysLod.Unknown_30h;
fragoffset.W = 0.0f;
if (fragtransformid < phys.OwnerFragPhysLod.Children?.data_items?.Length)
switch (phys.BoneTag) //right hand side wheel flip!
{
var pgrp = phys.OwnerFragPhysLod.Children.data_items[fragtransformid];
switch (pgrp.BoneTag) //right hand side wheel flip!
{
//case 27922: //wheel_lf
//case 29921: //wheel_lm1
//case 29922: //wheel_lm2
//case 29923: //wheel_lm3
//case 27902: //wheel_lr
case 26418: //wheel_rf
case 5857: //wheel_rm1
case 5858: //wheel_rm2
case 5859: //wheel_rm3
case 26398: //wheel_rr
fragtransforms[fragtransformid].M11 = -1;
fragtransforms[fragtransformid].M12 = 0;
fragtransforms[fragtransformid].M13 = 0;
fragtransforms[fragtransformid].M21 = 0;
fragtransforms[fragtransformid].M22 = 1;
fragtransforms[fragtransformid].M23 = 0;
fragtransforms[fragtransformid].M31 = 0;
fragtransforms[fragtransformid].M32 = 0;
fragtransforms[fragtransformid].M33 = -1;
break;
default:
break;
}
//case 27922: //wheel_lf
//case 29921: //wheel_lm1
//case 29922: //wheel_lm2
//case 29923: //wheel_lm3
//case 27902: //wheel_lr
case 26418: //wheel_rf
case 5857: //wheel_rm1
case 5858: //wheel_rm2
case 5859: //wheel_rm3
case 26398: //wheel_rr
fragtransforms[fragtransformid].M11 = -1;
fragtransforms[fragtransformid].M12 = 0;
fragtransforms[fragtransformid].M13 = 0;
fragtransforms[fragtransformid].M21 = 0;
fragtransforms[fragtransformid].M22 = 1;
fragtransforms[fragtransformid].M23 = 0;
fragtransforms[fragtransformid].M31 = 0;
fragtransforms[fragtransformid].M32 = 0;
fragtransforms[fragtransformid].M33 = -1;
break;
default:
break;
}
}
}
else if (frag != null)