diff --git a/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs b/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs index f31f94d..318d7f3 100644 --- a/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs @@ -2284,33 +2284,33 @@ "1 - IgnoreMaxInRange", "2 - NoSpawn", "4 - StationaryReactions", - "8 - Unk", - "16 - Unk", + "8 - OnlySpawnInSameInterior", + "16 - SpawnedPedIsArrestable", "32 - ActivateVehicleSiren", "64 - AggressiveVehicleDriving", - "128 - Unk", - "256 - Unk", - "512 - Unk", + "128 - LandVehicleOnArrival", + "256 - IgnoreThreatsIfLosNotClear", + "512 - EventsInRadiusTriggerDisputes", "1024 - AerialVehiclePoint", "2048 - TerritorialScenario", - "4096 - Unk", - "8192 - Unk", - "16384 - Unk", - "32768 - Unk", + "4096 - EndScenarioIfPlayerWithinRadius", + "8192 - EventsInRadiusTriggerThreatResponse", + "16384 - TaxiPlaneOnGround", + "32768 - FlyOffToOblivion", "65536 - InWater", - "131072 - Unk", + "131072 - AllowInvestigation", "262144 - OpenDoor", "524288 - PreciseUseTime", - "1048576 - Unk", - "2097152 - Unk", + "1048576 - NoRespawnUntilStreamedOut", + "2097152 - NoVehicleSpawnMaxDistance", "4194304 - ExtendedRange", "8388608 - ShortRange", "16777216 - HighPriority", "33554432 - IgnoreLoitering", "67108864 - UseSearchlight", "134217728 - ResetNoCollisionOnCleanUp", - "268435456 - Unk", - "536870912 - Unk", + "268435456 - CheckCrossedArrivalPlane", + "536870912 - UseVehicleFrontForArrival", "1073741824 - IgnoreWeatherRestrictions"}); this.ScenarioClusterPointFlagsCheckedListBox.Location = new System.Drawing.Point(195, 167); this.ScenarioClusterPointFlagsCheckedListBox.Name = "ScenarioClusterPointFlagsCheckedListBox"; diff --git a/CodeWalker/Project/Panels/EditYmapCarGenPanel.Designer.cs b/CodeWalker/Project/Panels/EditYmapCarGenPanel.Designer.cs index e59afab..5b19265 100644 --- a/CodeWalker/Project/Panels/EditYmapCarGenPanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYmapCarGenPanel.Designer.cs @@ -68,11 +68,11 @@ this.CarFlagsCheckedListBox.CheckOnClick = true; this.CarFlagsCheckedListBox.FormattingEnabled = true; this.CarFlagsCheckedListBox.Items.AddRange(new object[] { - "1 - Unk01", + "1 - High priority", "2 - Unk02", - "4 - Unk03", - "8 - Unk04", - "16 - Unk05", + "4 - Police", + "8 - Firetruck", + "16 - Ambulance", "32 - Unk06", "64 - Unk07", "128 - Unk08", diff --git a/CodeWalker/Project/Panels/EditYmapEntityPanel.Designer.cs b/CodeWalker/Project/Panels/EditYmapEntityPanel.Designer.cs index 8fd1fcd..f70cab1 100644 --- a/CodeWalker/Project/Panels/EditYmapEntityPanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYmapEntityPanel.Designer.cs @@ -185,10 +185,10 @@ "8 - Unk04", "16 - Unk05", "32 - Static entity", - "64 - Unk07", + "64 - Object isn't dark at night", "128 - Unk08", "256 - Unk09", - "512 - Unk10", + "512 - Disable embedded light source", "1024 - Unk11", "2048 - Unk12", "4096 - Unk13", @@ -197,13 +197,13 @@ "32768 - Unk16", "65536 - Unk17", "131072 - Unk18", - "262144 - Unk19", + "262144 - Disable archetype extensions", "524288 - Unk20", "1048576 - Unk21", "2097152 - Unk22", - "4194304 - Unk23", - "8388608 - Unk24", - "16777216 - Unk25", + "4194304 - Disable shadow for entity", + "8388608 - Disable entity, shadow casted", + "16777216 - Object will not cast reflections", "33554432 - Interior proxy", "67108864 - Unk27", "134217728 - Reflection proxy", diff --git a/CodeWalker/Project/Panels/EditYmapEntityPanel.cs b/CodeWalker/Project/Panels/EditYmapEntityPanel.cs index 8fb8e9a..e9b2d33 100644 --- a/CodeWalker/Project/Panels/EditYmapEntityPanel.cs +++ b/CodeWalker/Project/Panels/EditYmapEntityPanel.cs @@ -814,5 +814,10 @@ namespace CodeWalker.Project.Panels ProjectForm.ShowEditArchetypePanel(true); } } + + private void EntityFlagsCheckedListBox_SelectedIndexChanged(object sender, EventArgs e) + { + + } } } diff --git a/CodeWalker/Project/Panels/EditYtypArchetypePanel.Designer.cs b/CodeWalker/Project/Panels/EditYtypArchetypePanel.Designer.cs index 72af0a8..da812a6 100644 --- a/CodeWalker/Project/Panels/EditYtypArchetypePanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYtypArchetypePanel.Designer.cs @@ -302,17 +302,17 @@ "16 - Unk05", "32 - Static", "64 - Unk07", - "128 - Unk08", + "128 - Instance", "256 - Unk09", - "512 - Unk10", - "1024 - Unk11", + "512 - Bone anims (YCD)", + "1024 - UV anims (YCD)", "2048 - Unk12", "4096 - Unk13", - "8192 - Unk14", + "8192 - Object won't cast shadow", "16384 - Unk15", "32768 - Unk16", - "65536 - Unk17", - "131072 - Unk18", + "65536 - Double-sided rendering", + "131072 - Dynamic", "262144 - Unk19", "524288 - Unk20", "1048576 - Unk21", @@ -321,12 +321,12 @@ "8388608 - Unk24", "16777216 - Unk25", "33554432 - Unk26", - "67108864 - Unk27", + "67108864 - Enables special atribute for door archetypes", "134217728 - Unk28", - "268435456 - Unk29", - "536870912 - Unk30", - "1073741824 - Unk31", - "2147483648 - Unk32"}); + "268435456 - Disable red vertex channel", + "536870912 - Disable green vertex channel", + "1073741824 - Disable blue vertex channel", + "2147483648 - Disable alpha vertex channel"}); this.EntityFlagsCheckedListBox.Location = new System.Drawing.Point(441, 38); this.EntityFlagsCheckedListBox.Name = "EntityFlagsCheckedListBox"; this.EntityFlagsCheckedListBox.Size = new System.Drawing.Size(182, 274); diff --git a/CodeWalker/Project/Panels/EditYtypMloPortalPanel.Designer.cs b/CodeWalker/Project/Panels/EditYtypMloPortalPanel.Designer.cs index a890aaf..73d4562 100644 --- a/CodeWalker/Project/Panels/EditYtypMloPortalPanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYtypMloPortalPanel.Designer.cs @@ -177,8 +177,8 @@ this.FlagsCheckedListBox.CheckOnClick = true; this.FlagsCheckedListBox.FormattingEnabled = true; this.FlagsCheckedListBox.Items.AddRange(new object[] { - "1 - Hide inside from outside", - "2 - Hide outside from inside", + "1 - Disables exterior rendering", + "2 - Disables interior rendering", "4 - Mirror", "8 - Extra bloom", "16 - Unk05", @@ -190,7 +190,7 @@ "1024 - Mirror limbo entities", "2048 - Unk12", "4096 - Unk13", - "8192 - Unk14"}); + "8192 - Disable farclipping"}); this.FlagsCheckedListBox.Location = new System.Drawing.Point(318, 15); this.FlagsCheckedListBox.Name = "FlagsCheckedListBox"; this.FlagsCheckedListBox.Size = new System.Drawing.Size(184, 214); diff --git a/CodeWalker/Project/Panels/EditYtypMloRoomPanel.Designer.cs b/CodeWalker/Project/Panels/EditYtypMloRoomPanel.Designer.cs index 90c1b0b..b46f11c 100644 --- a/CodeWalker/Project/Panels/EditYtypMloRoomPanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYtypMloRoomPanel.Designer.cs @@ -118,12 +118,12 @@ this.FlagsCheckedListBox.FormattingEnabled = true; this.FlagsCheckedListBox.Items.AddRange(new object[] { "1 - Unk01", - "2 - Unk02", + "2 - Disables wanted level", "4 - Disable exterior shadows", "8 - Unk04", "16 - Unk05", - "32 - Unk06", - "64 - Unk07", + "32 - Reduces vehicle population", + "64 - Reduces ped population", "128 - Unk08", "256 - Disable limbo portals", "512 - Unk10"}); diff --git a/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs b/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs index 7ca5ccc..688be68 100644 --- a/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs +++ b/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs @@ -374,69 +374,83 @@ namespace CodeWalker.Project.Panels + static uint ComputeHash(IReadOnlyList ints, uint seed = 0) + { + var a2 = ints.Count; + var v3 = a2; + var v5 = (uint)(seed + 0xDEADBEEF + 4 * ints.Count); + var v6 = v5; + var v7 = v5; + + var c = 0; + for (var i = 0; i < (ints.Count - 4) / 3 + 1; i++, v3 -= 3, c += 3) + { + var v9 = ints[c + 2] + v5; + var v10 = ints[c + 1] + v6; + var v11 = ints[c] - v9; + var v13 = v10 + v9; + var v14 = (v7 + v11) ^ RotateLeft(v9, 4); + var v15 = v10 - v14; + var v17 = v13 + v14; + var v18 = v15 ^ RotateLeft(v14, 6); + var v19 = v13 - v18; + var v21 = v17 + v18; + var v22 = v19 ^ RotateLeft(v18, 8); + var v23 = v17 - v22; + var v25 = v21 + v22; + var v26 = v23 ^ RotateLeft(v22, 16); + var v27 = v21 - v26; + var v29 = v27 ^ RotateRight(v26, 13); + var v30 = v25 - v29; + v7 = v25 + v26; + v6 = v7 + v29; + v5 = v30 ^ RotateLeft(v29, 4); + } + + if (v3 == 3) + { + v5 += ints[c + 2]; + } + + if (v3 >= 2) + { + v6 += ints[c + 1]; + } + + if (v3 >= 1) + { + var v34 = (v6 ^ v5) - RotateLeft(v6, 14); + var v35 = (v34 ^ (v7 + ints[c])) - RotateLeft(v34, 11); + var v36 = (v35 ^ v6) - RotateRight(v35, 7); + var v37 = (v36 ^ v34) - RotateLeft(v36, 16); + var v38 = RotateLeft(v37, 4); + var v39 = (((v35 ^ v37) - v38) ^ v36) - RotateLeft((v35 ^ v37) - v38, 14); + return (v39 ^ v37) - RotateRight(v39, 8); + } + + return v5; + } + private uint GetLightHash(YmapEntityDef ent, int lightIndex) { unchecked { + var len = 7; - //var aabb1 = GetAABB(ent); - var aabb = GetAABB2(ent); + var center = ent.Position + ent.Archetype.BSCenter; + var aa = center + ent.Archetype.BBMin; + var bb = center + ent.Archetype.BBMax; - var hashData = new int[7]; - hashData[0] = (int)(aabb.Min.X * 10.0f); - hashData[1] = (int)(aabb.Min.Y * 10.0f); - hashData[2] = (int)(aabb.Min.Z * 10.0f); - hashData[3] = (int)(aabb.Max.X * 10.0f); - hashData[4] = (int)(aabb.Max.Y * 10.0f); - hashData[5] = (int)(aabb.Max.Z * 10.0f); - hashData[6] = lightIndex; - - - int v3 = 7; - int v4 = 0;//=hashData index - int v5 = (int)0xDEADBEEF + 28;// -559038709; - int v6 = (int)0xDEADBEEF + 28; - int v7 = (int)0xDEADBEEF + 28; - - uint v8 = 2; - do - { - int v9 = hashData[v4 + 2] + v5; - int v10 = hashData[v4 + 1] + v6; - int v11 = hashData[v4 + 0] - v9; - int v13 = v10 + v9; - int v14 = (v7 + v11) ^ RotateLeft(v9, 4); - int v17 = v13 + v14; - int v18 = (v10 - v14) ^ RotateLeft(v14, 6); - int v21 = v17 + v18; - int v22 = (v13 - v18) ^ RotateLeft(v18, 8); - int v25 = v21 + v22; - int v26 = (v17 - v22) ^ RotateLeft(v22, 16); - int v29 = (v21 - v26) ^ RotateRight(v26, 13); - int v30 = v25 - v29; - v7 = v25 + v26; - v6 = v7 + v29; - v5 = v30 ^ RotateLeft(v29, 4); - v4 += 3; - v3 -= 3; - --v8; - } - while (v8 > 0); - - int v32 = v3 - 1; //should always be 0 - if (v32 != 0) - { } - - int v50 = v7 + hashData[v4]; - int v34 = (v6 ^ v5) - RotateLeft(v6, 14); - int v35 = (v34 ^ v50) - RotateLeft(v34, 11); - int v36 = (v35 ^ v6) - RotateRight(v35, 7); - int v37 = (v36 ^ v34) - RotateLeft(v36, 16); - int v51 = (v35 ^ v37) - RotateLeft(v37, 4); - int v38 = (v51 ^ v36) - RotateLeft(v51, 14); - int v53 = (v38 ^ v37) - RotateRight(v38, 8); - return (uint)v53; + var ints = new uint[len]; + ints[0] = (uint)(aa.X * 10.0f); + ints[1] = (uint)(aa.Y * 10.0f); + ints[2] = (uint)(aa.Z * 10.0f); + ints[3] = (uint)(bb.X * 10.0f); + ints[4] = (uint)(bb.Y * 10.0f); + ints[5] = (uint)(bb.Z * 10.0f); + ints[6] = (uint)lightIndex; + return ComputeHash(ints); } }