Skip to content

Commit

Permalink
Cleanup and named some unknown seat fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelima committed Jun 4, 2012
1 parent 2a4d1e8 commit a827cd7
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 164 deletions.
4 changes: 0 additions & 4 deletions TestProject1/ExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@

namespace TestProject1
{


/// <summary>
///This is a test class for ExtensionsTest and is intended
///to contain all ExtensionsTest Unit Tests
///</summary>
[TestClass()]
public class ExtensionsTest
{


private TestContext testContextInstance;

/// <summary>
Expand Down
27 changes: 4 additions & 23 deletions TestProject1/FormMainTest.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
using System.Diagnostics.Contracts;
using System.Linq;
using System.Linq;
using System.Windows.Forms;
using VehicleGarage;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using VehicleGarage.DBCStores;
using VehicleGarage.DBCStructures;
using VehicleGarage.Forms;

namespace TestProject1
{


/// <summary>
///This is a test class for FormMainTest and is intended
///to contain all FormMainTest Unit Tests
///</summary>
[TestClass()]
public class FormMainTest
{


private TestContext testContextInstance;

/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
public TestContext TestContext { get; set; }

#region Additional test attributes
//
Expand Down Expand Up @@ -68,15 +50,14 @@ public TestContext TestContext
//
#endregion


/// <summary>
///A test for _lvSearchResults_SelectedIndexChanged
///</summary>
[TestMethod()]
[DeploymentItem("VehicleGarage.exe")]
public void _lvSearchResults_SelectedIndexChangedTest()
{
FormMain_Accessor target = new FormMain_Accessor(); // TODO: Initialize to an appropriate value
var target = new FormMain_Accessor(); // TODO: Initialize to an appropriate value
object sender = null; // TODO: Initialize to an appropriate value
EventArgs e = null; // TODO: Initialize to an appropriate value
target._lvSearchResults_SelectedIndexChanged(sender, e);
Expand Down
5 changes: 1 addition & 4 deletions VehicleGarage/DBCStores/DBC.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using VehicleGarage.DBCStructures;
using VehicleGarage.Properties;

Expand Down
11 changes: 3 additions & 8 deletions VehicleGarage/DBCStores/DBCHeader.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

using System.Runtime.InteropServices;

namespace VehicleGarage.DBCStores
{
Expand All @@ -22,12 +17,12 @@ public bool IsDBC

public long DataSize
{
get { return (long)(RecordsCount * RecordSize); }
get { return RecordsCount * RecordSize; }
}

public long StartStringPosition
{
get { return DataSize + (long)Marshal.SizeOf(typeof(DbcHeader)); }
get { return DataSize + Marshal.SizeOf(typeof(DbcHeader)); }
}
};
}
8 changes: 4 additions & 4 deletions VehicleGarage/DBCStores/DBCReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace VehicleGarage.DBCStores
{
public static class DBCReader
{
public static /*unsafe*/ Dictionary<uint, T> ReadDBC<T>(Dictionary<uint, string> strDict) where T : struct
public static Dictionary<uint, T> ReadDBC<T>(Dictionary<uint, string> strDict) where T : struct
{
Contract.Requires(DBC.DBCPath != String.Empty);
Contract.Requires(DBC.DBCPath != null);

var dict = new Dictionary<uint, T>();
string fileName = Path.Combine(DBC.DBCPath, typeof(T).Name + ".dbc").Replace("Entry", String.Empty);
var fileName = Path.Combine(DBC.DBCPath, typeof(T).Name + ".dbc").Replace("Entry", String.Empty);

using (var reader = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read), Encoding.UTF8))
{
Expand All @@ -38,9 +38,9 @@ public static class DBCReader
var key = reader.ReadUInt32();
reader.BaseStream.Position -= 4;

var T_entry = reader.ReadStruct<T>();
var entry = reader.ReadStruct<T>();

dict.Add(key, T_entry);
dict.Add(key, entry);
}

// read dbc strings
Expand Down
11 changes: 3 additions & 8 deletions VehicleGarage/DBCStructures/VehicleEntry.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Runtime.InteropServices;
using VehicleGarage.DBCStores;

namespace VehicleGarage.DBCStructures
Expand Down Expand Up @@ -42,10 +38,9 @@ public struct VehicleEntry
public float MissleTargetImpactTexRadius;
public int SeatIndicatorType;
public int PowerType;
public int Unk1; // New in 3.1 - Either -1 or 0 (most common)
public int Unk2; // New in 3.1 - Always 0
public int Unk1; // New in 3.1 - Either -1 or 0 (most common) - PowerType[1]?
public int Unk2; // New in 3.1 - Always 0 - PowerType[2]?


public string MissleTargetArcTexture
{
get { return DBC.VehicleStrings[_missleTargetArcTexture]; }
Expand Down
3 changes: 1 addition & 2 deletions VehicleGarage/DBCStructures/VehiclePowerTypes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace VehicleGarage.DBCStructures
namespace VehicleGarage.DBCStructures
{
public enum VehiclePowerTypes
{
Expand Down
30 changes: 13 additions & 17 deletions VehicleGarage/DBCStructures/VehicleSeatEntry.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

using System;

namespace VehicleGarage.DBCStructures
namespace VehicleGarage.DBCStructures
{
public struct VehicleSeatEntry
{
Expand Down Expand Up @@ -51,18 +48,17 @@ public struct VehicleSeatEntry
public int ExitUiSoundId;
public int Skin;
public int FlagsB;
public float Unk1; // added in 3.1
public float Unk2; // added in 3.1
public float Unk3; // added in 3.1
public float Unk4; // added in 3.1
public float Unk5; // added in 3.1
public float Unk6; // added in 3.1
public float Unk7; // added in 3.1
public float Unk8; // added in 3.1
public float Unk9; // added in 3.1
public float Unk10; // added in 3.1
public float Unk11; // added in 3.1
public float Unk12; // added in 3.1
public float CameraEnteringDelay;
public float CameraEnteringDuration;
public float CameraExitingDelay;
public float CameraExitingDuration;
public float CameraOffsetX;
public float CameraOffsetY;
public float CameraOffsetZ;
public float CameraPosChaseRate;
public float CameraFacingChaseRate;
public float CameraEnteringZoom;
public float CameraSeatZoomMin;
public float CameraSeatZoomMax;
}

}
3 changes: 1 addition & 2 deletions VehicleGarage/DBCStructures/VehicleUIIndSeatEntry.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace VehicleGarage.DBCStructures
namespace VehicleGarage.DBCStructures
{
public struct VehicleUIIndSeatEntry
{
Expand Down
3 changes: 1 addition & 2 deletions VehicleGarage/DBCStructures/VehicleUIIndicatorEntry.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace VehicleGarage.DBCStructures
namespace VehicleGarage.DBCStructures
{
public struct VehicleUIIndicatorEntry
{
Expand Down
Loading

0 comments on commit a827cd7

Please sign in to comment.