mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 00:43:00 +08:00
Fix for XmlMeta not importing Vector3 arrays properly, Added extra texture sampler options
This commit is contained in:
parent
f3c7538d78
commit
d7d4054971
@ -2136,6 +2136,7 @@ namespace CodeWalker.GameFiles
|
||||
DiffuseNoBorderTexSampler = 1732587965,
|
||||
DiffuseSampler = 4059966321,
|
||||
DiffuseSampler2 = 181641832,
|
||||
DiffuseSampler3 = 1429813046, //thanks CP
|
||||
DiffuseSamplerFur = 1282320680,
|
||||
DiffuseSamplerPhase2 = 3227619449,
|
||||
DiffuseSamplerPoint = 4015001285,
|
||||
@ -2158,6 +2159,7 @@ namespace CodeWalker.GameFiles
|
||||
dirtLevel = 47191856,
|
||||
dirtLevelMod = 3961814809,
|
||||
DirtSampler = 2124031998,
|
||||
DirtBumpSampler = 3157820509,//thanks CP
|
||||
DiskBrakeGlow = 1035405954,
|
||||
displParams = 1163050293,
|
||||
distanceMapSampler = 1616890976,
|
||||
|
@ -589,39 +589,61 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
var items = new List<Vector4>();
|
||||
|
||||
|
||||
var split = node.InnerText.Split('\n');// Regex.Split(node.InnerText, @"[\s\r\n\t]");
|
||||
|
||||
|
||||
float x = 0f;
|
||||
float y = 0f;
|
||||
float z = 0f;
|
||||
float w = 0f;
|
||||
|
||||
for (int i = 0; i < split.Length; i++)
|
||||
var cnodes = node.SelectNodes("Item");
|
||||
if (cnodes.Count > 0)
|
||||
{
|
||||
var s = split[i]?.Trim();
|
||||
if (string.IsNullOrEmpty(s)) continue;
|
||||
var split2 = Regex.Split(s, @"[\s\t]");
|
||||
int c = 0;
|
||||
x = 0f; y = 0f; z = 0f;
|
||||
for (int n = 0; n < split2.Length; n++)
|
||||
foreach (XmlNode cnode in cnodes)
|
||||
{
|
||||
var ts = split2[n]?.Trim();
|
||||
if (string.IsNullOrEmpty(ts)) continue;
|
||||
var f = FloatUtil.Parse(ts);
|
||||
switch (c)
|
||||
var str = cnode.InnerText;
|
||||
var strs = str.Split(',');
|
||||
if (strs.Length >= 3)
|
||||
{
|
||||
case 0: x = f; break;
|
||||
case 1: y = f; break;
|
||||
case 2: z = f; break;
|
||||
x = FloatUtil.Parse(strs[0].Trim());
|
||||
y = FloatUtil.Parse(strs[1].Trim());
|
||||
z = FloatUtil.Parse(strs[2].Trim());
|
||||
if (strs.Length >= 4)
|
||||
{
|
||||
w = FloatUtil.Parse(strs[3].Trim());
|
||||
}
|
||||
var val = new Vector4(x, y, z, w);
|
||||
items.Add(val);
|
||||
}
|
||||
c++;
|
||||
}
|
||||
if (c >= 3)
|
||||
}
|
||||
else
|
||||
{
|
||||
var split = node.InnerText.Split('\n');// Regex.Split(node.InnerText, @"[\s\r\n\t]");
|
||||
|
||||
for (int i = 0; i < split.Length; i++)
|
||||
{
|
||||
var val = new Vector4(x, y, z, w);
|
||||
items.Add(val);
|
||||
var s = split[i]?.Trim();
|
||||
if (string.IsNullOrEmpty(s)) continue;
|
||||
var split2 = Regex.Split(s, @"[\s\t]");
|
||||
int c = 0;
|
||||
x = 0f; y = 0f; z = 0f;
|
||||
for (int n = 0; n < split2.Length; n++)
|
||||
{
|
||||
var ts = split2[n]?.Trim();
|
||||
if (string.IsNullOrEmpty(ts)) continue;
|
||||
var f = FloatUtil.Parse(ts);
|
||||
switch (c)
|
||||
{
|
||||
case 0: x = f; break;
|
||||
case 1: y = f; break;
|
||||
case 2: z = f; break;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
if (c >= 3)
|
||||
{
|
||||
var val = new Vector4(x, y, z, w);
|
||||
items.Add(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,8 +434,10 @@ namespace CodeWalker.Rendering
|
||||
MetaName.lookupSampler, //TF_RSN_Msk_CS1_DesHill1, bh1_43_golf_blendmap_04_LOD
|
||||
MetaName.heightSampler, //nxg_prop_tree_palm2_displ_l
|
||||
MetaName.FoamSampler, //bj_beachfoam01_lod, CS_RSN_SL_RiverFoam_01_A_lodCS_RSN_SL_RiverFoam_01_A
|
||||
MetaName.textureSamp,
|
||||
MetaName.DirtSampler,
|
||||
MetaName.DirtBumpSampler,
|
||||
MetaName.DiffuseSampler2,
|
||||
MetaName.DiffuseSampler3,
|
||||
MetaName.DiffuseHfSampler,
|
||||
MetaName.ComboHeightSamplerFur01,
|
||||
MetaName.ComboHeightSamplerFur23,
|
||||
|
@ -573,8 +573,9 @@ namespace CodeWalker.Rendering
|
||||
//case MetaName.SnowSampler0:
|
||||
//case MetaName.SnowSampler1:
|
||||
//case MetaName.DiffuseSampler2:
|
||||
//case MetaName.DiffuseSampler3:
|
||||
//case MetaName.DirtSampler:
|
||||
//case (MetaName)3157820509://normal?
|
||||
//case MetaName.DirtBumpSampler:
|
||||
break;
|
||||
case MetaName.FlowSampler:
|
||||
case MetaName.FogSampler:
|
||||
|
Loading…
Reference in New Issue
Block a user