├── packages
├── System.Numerics.Vectors.4.5.0
│ ├── lib
│ │ ├── MonoTouch10
│ │ │ └── _._
│ │ ├── MonoAndroid10
│ │ │ └── _._
│ │ ├── netcoreapp2.0
│ │ │ └── _._
│ │ ├── uap10.0.16299
│ │ │ └── _._
│ │ ├── xamarinios10
│ │ │ └── _._
│ │ ├── xamarinmac20
│ │ │ └── _._
│ │ ├── xamarintvos10
│ │ │ └── _._
│ │ ├── xamarinwatchos10
│ │ │ └── _._
│ │ ├── net46
│ │ │ └── System.Numerics.Vectors.dll
│ │ ├── netstandard1.0
│ │ │ └── System.Numerics.Vectors.dll
│ │ ├── netstandard2.0
│ │ │ └── System.Numerics.Vectors.dll
│ │ └── portable-net45+win8+wp8+wpa81
│ │ │ └── System.Numerics.Vectors.dll
│ ├── ref
│ │ ├── MonoTouch10
│ │ │ └── _._
│ │ ├── MonoAndroid10
│ │ │ └── _._
│ │ ├── netcoreapp2.0
│ │ │ └── _._
│ │ ├── uap10.0.16299
│ │ │ └── _._
│ │ ├── xamarinios10
│ │ │ └── _._
│ │ ├── xamarinmac20
│ │ │ └── _._
│ │ ├── xamarintvos10
│ │ │ └── _._
│ │ ├── xamarinwatchos10
│ │ │ └── _._
│ │ ├── net45
│ │ │ └── System.Numerics.Vectors.dll
│ │ ├── net46
│ │ │ └── System.Numerics.Vectors.dll
│ │ ├── netstandard1.0
│ │ │ └── System.Numerics.Vectors.dll
│ │ └── netstandard2.0
│ │ │ └── System.Numerics.Vectors.dll
│ ├── useSharedDesignerContext.txt
│ ├── version.txt
│ ├── .signature.p7s
│ ├── System.Numerics.Vectors.4.5.0.nupkg
│ └── LICENSE.TXT
├── HelixToolkit.2.7.0
│ ├── .signature.p7s
│ ├── HelixToolkit.2.7.0.nupkg
│ ├── lib
│ │ └── netstandard1.1
│ │ │ ├── HelixToolkit.dll
│ │ │ └── HelixToolkit.xml
│ ├── AUTHORS
│ ├── LICENSE
│ ├── CONTRIBUTORS
│ └── README.md
└── HelixToolkit.Wpf.2.7.0
│ ├── .signature.p7s
│ ├── HelixToolkit.Wpf.2.7.0.nupkg
│ ├── lib
│ └── net45
│ │ └── HelixToolkit.Wpf.dll
│ ├── AUTHORS
│ ├── LICENSE
│ ├── CONTRIBUTORS
│ └── README.md
├── .gitattributes
├── .vs
└── JSRF_Tool_2
│ ├── v17
│ └── .suo
│ └── project-colors.json
├── JSRF_Tool_2
├── Resources
│ ├── EBCDIC.tbl
│ └── EBCDIC-NoSpecialChar.tbl
├── jsrf_soul_icon_64.ico
├── Graphics
│ ├── jsrf_soul_icon.png
│ ├── jsrf_soul_icon_64.ico
│ └── jsrf_soul_icon_64.png
├── bin
│ └── Debug
│ │ └── resources
│ │ ├── tools
│ │ ├── XboxADPCM.exe
│ │ └── VampConvert.exe
│ │ └── settings_dirs.ini
├── DataFormats
│ ├── JSRF
│ │ ├── Compilers
│ │ │ └── Data
│ │ │ │ ├── block_02_base.bin
│ │ │ │ └── block_02_base.bytes
│ │ ├── Material.cs
│ │ ├── Texture_header.cs
│ │ ├── Stage_Bin
│ │ │ ├── header.cs
│ │ │ ├── Parser.cs
│ │ │ └── block_01.cs
│ │ ├── mission_dat.cs
│ │ ├── Stage_Data_Metrics.cs
│ │ └── mission_bin.cs
│ ├── MeshData.cs
│ ├── Vectors.cs
│ ├── Bmp.cs
│ ├── Xbox
│ │ ├── TextureSwizzleParsing.cs
│ │ └── TextureSwizzle.cs
│ └── Vector.cs
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── app.config
├── JSRF_Tool_2.csproj.user
├── Functions
│ ├── MathI.cs
│ ├── ByteConvert.cs
│ ├── IO.cs
│ ├── FileExplorer.cs
│ ├── Math
│ │ └── BoundingSphere.cs
│ └── DynamicParser.cs
├── packages.config
├── HelixModelViewer.xaml.cs
├── MDLB_Import
│ ├── ModelPart_Import_Settings.cs
│ ├── UserControls
│ │ ├── Model_Inspector.cs
│ │ ├── Color.cs
│ │ ├── Model_Inspector.Designer.cs
│ │ ├── Material_Inspector.cs
│ │ ├── Color.resx
│ │ ├── Model_Inspector.resx
│ │ ├── Material_Inspector.resx
│ │ ├── MDLB_import_options_Form.resx
│ │ ├── Color.Designer.cs
│ │ └── Material_Inspector.Designer.cs
│ └── Materials.cs
├── HelixModelViewer.xaml
└── Program.cs
├── .gitignore
├── README.md
└── JSRF_Tool_2.sln
/packages/System.Numerics.Vectors.4.5.0/lib/MonoTouch10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/MonoTouch10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/MonoAndroid10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/netcoreapp2.0/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/uap10.0.16299/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/xamarinios10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/xamarinmac20/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/xamarintvos10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/xamarinwatchos10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/MonoAndroid10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/netcoreapp2.0/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/uap10.0.16299/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/xamarinios10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/xamarinmac20/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/xamarintvos10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/xamarinwatchos10/_._:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/useSharedDesignerContext.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/version.txt:
--------------------------------------------------------------------------------
1 | 30ab651fcb4354552bd4891619a0bdd81e0ebdbf
2 |
--------------------------------------------------------------------------------
/.vs/JSRF_Tool_2/v17/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/.vs/JSRF_Tool_2/v17/.suo
--------------------------------------------------------------------------------
/JSRF_Tool_2/Resources/EBCDIC.tbl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/Resources/EBCDIC.tbl
--------------------------------------------------------------------------------
/JSRF_Tool_2/jsrf_soul_icon_64.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/jsrf_soul_icon_64.ico
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .vs/
3 | .vs/JSRF_Tool_2/FileContentIndex/read.lock
4 | JSRF_Tool_2/bin/Debug/resources/tools/xbadpdec.exe
5 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Graphics/jsrf_soul_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/Graphics/jsrf_soul_icon.png
--------------------------------------------------------------------------------
/JSRF_Tool_2/Graphics/jsrf_soul_icon_64.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/Graphics/jsrf_soul_icon_64.ico
--------------------------------------------------------------------------------
/JSRF_Tool_2/Graphics/jsrf_soul_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/Graphics/jsrf_soul_icon_64.png
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.2.7.0/.signature.p7s
--------------------------------------------------------------------------------
/JSRF_Tool_2/Resources/EBCDIC-NoSpecialChar.tbl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/Resources/EBCDIC-NoSpecialChar.tbl
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.Wpf.2.7.0/.signature.p7s
--------------------------------------------------------------------------------
/JSRF_Tool_2/bin/Debug/resources/tools/XboxADPCM.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/bin/Debug/resources/tools/XboxADPCM.exe
--------------------------------------------------------------------------------
/JSRF_Tool_2/bin/Debug/resources/tools/VampConvert.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/bin/Debug/resources/tools/VampConvert.exe
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/HelixToolkit.2.7.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.2.7.0/HelixToolkit.2.7.0.nupkg
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/.signature.p7s
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Compilers/Data/block_02_base.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/DataFormats/JSRF/Compilers/Data/block_02_base.bin
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/HelixToolkit.Wpf.2.7.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.Wpf.2.7.0/HelixToolkit.Wpf.2.7.0.nupkg
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Compilers/Data/block_02_base.bytes:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/JSRF_Tool_2/DataFormats/JSRF/Compilers/Data/block_02_base.bytes
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/lib/netstandard1.1/HelixToolkit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.2.7.0/lib/netstandard1.1/HelixToolkit.dll
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/lib/net45/HelixToolkit.Wpf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/HelixToolkit.Wpf.2.7.0/lib/net45/HelixToolkit.Wpf.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.4.5.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.4.5.0.nupkg
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/net46/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/lib/net46/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/net45/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/ref/net45/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/net46/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/ref/net46/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/netstandard1.0/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/lib/netstandard1.0/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/netstandard2.0/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/lib/netstandard2.0/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/netstandard1.0/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/ref/netstandard1.0/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/ref/netstandard2.0/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/ref/netstandard2.0/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neodoso/JSRF_ModTool/HEAD/packages/System.Numerics.Vectors.4.5.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll
--------------------------------------------------------------------------------
/JSRF_Tool_2/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/bin/Debug/resources/settings_dirs.ini:
--------------------------------------------------------------------------------
1 | C:\Users\Mike\Desktop\test\tex\tex_import\
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Helix Toolkit authors for copyright purposes.
2 | # This file is distinct from the CONTRIBUTORS file.
3 | # See the latter for an explanation.
4 |
5 | # Names should be added to this file as
6 | # Name or Organization
7 | # The email address is not required for organizations.
8 |
9 | # Please keep the list sorted.
10 | # Please notify the first person on the list to be added here.
11 |
12 | Oystein Bjorke
13 | Lunci Hua
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Helix Toolkit authors for copyright purposes.
2 | # This file is distinct from the CONTRIBUTORS file.
3 | # See the latter for an explanation.
4 |
5 | # Names should be added to this file as
6 | # Name or Organization
7 | # The email address is not required for organizations.
8 |
9 | # Please keep the list sorted.
10 | # Please notify the first person on the list to be added here.
11 |
12 | Oystein Bjorke
13 | Lunci Hua
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JSRF ModTool
2 | Modding tool for the (original) Xbox game: Jet Set Radio Future (JSRF)
3 |
4 | Tutorial about the tool: https://jsrf-inside.blogspot.com/2016/05/jsrf-tool-20b-model-viewer-texture.html
5 |
6 | More info and reverse engineering @ https://jsrf-inside.blogspot.com
7 |
8 | 
9 |
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/MathI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.Functions
8 | {
9 | public class MathI
10 | {
11 | public static Int32 RandomDigits(int length)
12 | {
13 | var random = new Random();
14 | string s = string.Empty;
15 | for (int i = 0; i < length; i++)
16 | s = String.Concat(s, random.Next(10).ToString());
17 |
18 | return Int32.Parse(s);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/HelixModelViewer.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using System.Windows.Media;
5 | using System.Windows.Media.Media3D;
6 | using System.Windows.Input;
7 |
8 | using HelixToolkit.Wpf;
9 |
10 |
11 |
12 |
13 | using JSRF_ModTool.DataFormats;
14 |
15 | using System.Collections.Generic;
16 | using System.IO;
17 |
18 |
19 | namespace JSRF_ModTool
20 | {
21 | ///
22 | /// Interaction logic for HelixModelViewer.xaml
23 | ///
24 | public partial class HelixModelViewer : UserControl
25 | {
26 | public HelixModelViewer()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/ModelPart_Import_Settings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.MDLB_Import
8 | {
9 | public class ModelPart_Import_Settings
10 | {
11 | public string filepath { get; set; }
12 | public int model_type { get; set; }
13 | public int vertex_def_size { get; set; }
14 | public float draw_distance { get; set; }
15 |
16 |
17 | public ModelPart_Import_Settings(string _filepath, int _model_type, int _vertex_def_size, float _draw_distance)
18 | {
19 | this.filepath = _filepath;
20 | this.model_type = _model_type;
21 | this.vertex_def_size = _vertex_def_size;
22 | this.draw_distance = _draw_distance;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/HelixModelViewer.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/ByteConvert.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JSRF_ModTool
4 | {
5 | public class ByteReader
6 | {
7 | // Int16 to Byte Array
8 | public static byte[] ConvertIntToByteArray(Int16 I16)
9 | {
10 | return BitConverter.GetBytes(I16);
11 | }
12 |
13 | // Int32 to Byte array
14 | public static byte[] ConvertInt32ToByteArray(Int32 I32)
15 | {
16 | return BitConverter.GetBytes(I32);
17 | }
18 |
19 | // Int64 to Byte Array
20 | public static byte[] ConvertIntToByteArray(Int64 I64)
21 | {
22 | return BitConverter.GetBytes(I64);
23 | }
24 |
25 | // int to Byte Array
26 | public static byte[] ConvertIntToByteArray(int I)
27 | {
28 | return BitConverter.GetBytes(I);
29 | }
30 |
31 | // Byte to Int32
32 | public static int ConvertByteToInt32(byte[] b)
33 | {
34 | return BitConverter.ToInt32(b, 0);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/IO.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace JSRF_ModTool.Functions
4 | {
5 | class IO
6 | {
7 | public static void DeleteDirectoryContent(string target_dir)
8 | {
9 | if (Directory.Exists(target_dir))
10 | {
11 |
12 | System.IO.DirectoryInfo downloadedMessageInfo = new DirectoryInfo(target_dir);
13 |
14 | foreach (FileInfo file in downloadedMessageInfo.GetFiles())
15 | {
16 | try
17 | {
18 | file.Delete();
19 | }
20 | catch
21 | {
22 | }
23 | }
24 | foreach (DirectoryInfo dir in downloadedMessageInfo.GetDirectories())
25 | {
26 | try
27 | {
28 | dir.Delete(true);
29 | }
30 | catch
31 | {
32 | }
33 | }
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Model_Inspector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace JSRF_ModTool.MDLB_Import
12 | {
13 | public partial class Model_Inspector : UserControl
14 | {
15 | public string filepath;
16 | public Model_Inspector()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | public int get_mdl_type()
22 | {
23 | return cb_mdl_part_type.SelectedIndex;
24 | }
25 |
26 | public int get_vert_def_size()
27 | {
28 | return Convert.ToInt32(cb_vertex_def_size.Text);
29 | }
30 |
31 |
32 | public void set_vert_def_size(int s)
33 | {
34 | if(cb_mdl_part_type.SelectedIndex > 0)
35 | {
36 | s -= 8;
37 | }
38 |
39 | cb_vertex_def_size.SelectedItem = s.ToString();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace JSRF_ModTool.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Helix Toolkit contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a
6 | copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included
14 | in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Helix Toolkit contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a
6 | copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included
14 | in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/packages/System.Numerics.Vectors.4.5.0/LICENSE.TXT:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) .NET Foundation and Contributors
4 |
5 | All rights reserved.
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/Materials.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.MDLB_Import
8 | {
9 | public class Materials
10 | {
11 | public enum materials
12 | {
13 | Standard = 1328128,
14 | Skin = 1360896,
15 | Metal_reflective = 6726306,
16 | Lambert = 16711680,
17 | Metal_reflective_1 = 6693602,
18 | Metal = 1122978,
19 | Semi_Transparent = 4612770,
20 | Self_illuminated = 524287,
21 | UV_scroll_X_ticking = 4661255,
22 | UV_scroll_X_sliding = 459263,
23 | }
24 |
25 |
26 | ///
27 | /// RGBA color
28 | ///
29 | public class color
30 | {
31 | public byte R { get; set; }
32 | public byte G { get; set; }
33 | public byte B { get; set; }
34 | public byte A { get; set; }
35 |
36 | public color(byte _R, byte _G, byte _B, byte _A)
37 | {
38 | this.R = _R;
39 | this.G = _G;
40 | this.B = _B;
41 | this.A = _A;
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/JSRF_Tool_2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25123.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSRF_Tool_2", "JSRF_Tool_2\JSRF_Tool_2.csproj", "{883471F4-3330-4A25-B4E4-0463EEF09315}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Debug|x64.ActiveCfg = Debug|x86
17 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Debug|x64.Build.0 = Debug|x86
18 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Debug|x86.ActiveCfg = Debug|x86
19 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Debug|x86.Build.0 = Debug|x86
20 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Release|x64.ActiveCfg = Release|x64
21 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Release|x64.Build.0 = Release|x64
22 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Release|x86.ActiveCfg = Release|x86
23 | {883471F4-3330-4A25-B4E4-0463EEF09315}.Release|x86.Build.0 = Release|x86
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Forms;
5 | using JSRF_ModTool.DataFormats;
6 | using JSRF_ModTool.DataFormats.JSRF;
7 |
8 | namespace JSRF_ModTool
9 | {
10 | static class Program
11 | {
12 | // /
13 | // / The main entry point for the application.
14 | // /
15 | [STAThread]
16 | static void Main(string[] args)
17 | {
18 |
19 | // if no arguments, run as winforms
20 | if (args.Length == 0)
21 | {
22 | Application.EnableVisualStyles();
23 | Application.SetCompatibleTextRenderingDefault(false);
24 | Application.Run(new Main());
25 | return;
26 | }
27 |
28 | if (args[0] != "stage_compile") { return; }
29 |
30 | if (args.Length != 4)
31 | {
32 | MessageBox.Show("JSRF ModTool\n\n" + "Number of arguments is unexpected.\n\nExpected (4) arguments:\n\n" + "'stage_compile' source_dir media_dir stg00");
33 | return;
34 | }
35 |
36 | Stage_Compiler Stage_compiler = new Stage_Compiler();
37 | // arguments: export_dir, media_dir, stage_num
38 | Stage_compiler.Compile(args[1], args[2], args[3]);
39 | System.Media.SystemSounds.Asterisk.Play();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/MeshData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media;
3 | using System.Windows.Media.Media3D;
4 | using System.Collections.Generic;
5 | namespace JSRF_ModTool.DataFormats
6 | {
7 | ///
8 | /// custom XALM model class
9 | ///
10 | public class MeshData
11 | {
12 | public List bone_weights = new List();
13 | public Point3DCollection vertices = new Point3DCollection();
14 | public Vector3DCollection normals = new Vector3DCollection();
15 | public PointCollection UVs = new PointCollection();
16 | public Int32Collection triangles = new Int32Collection();
17 |
18 | public Point3D mesh_center = new Point3D(0, 0, 0);
19 | public Point3D mesh_bounds = new Point3D(0, 0, 0);
20 | public Point3D avg_distance = new Point3D(0, 0, 0);
21 |
22 | public Int32 texture_id = 0;
23 |
24 | public class bone_weight
25 | {
26 | public byte bone_id_0 { get; set; }
27 | public byte bone_id_1 { get; set; }
28 | public float bone_0_weight { get; set; }
29 | public float bone_1_weight { get; set; }
30 |
31 | public bone_weight(byte _bid0, byte _bid1, float _bw0, float _bw1)
32 | {
33 | this.bone_id_0 = _bid0;
34 | this.bone_id_1 = _bid1;
35 | this.bone_0_weight = _bw0;
36 | this.bone_1_weight = _bw1;
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("JSRF ModTool 2.9.2")]
10 | [assembly: AssemblyDescription("Modding tool for Jet Set Radio Future")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("neodos")]
13 | [assembly: AssemblyProduct("JSRF ModTool 2.9.2")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("9257ca3a-af8d-4d86-b228-854d81aac97d")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Build and Revision Numbers
34 | // by using the '*' as shown below:
35 | // [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyVersion("2.9.2.0")]
37 | [assembly: AssemblyFileVersion("2.9.2.0")]
38 | [assembly: NeutralResourcesLanguage("en-US")]
39 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Color.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace JSRF_ModTool.MDLB_Import
12 | {
13 | public partial class Color : UserControl
14 | {
15 | public Color()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | public void set_colors(int R, int G, int B, int A)
21 | {
22 | this.txtb_R.Text = R.ToString();
23 | this.txtb_G.Text = G.ToString();
24 | this.txtb_B.Text = B.ToString();
25 | this.txtb_A.Text = A.ToString();
26 | }
27 |
28 |
29 | public Materials.color get_colors()
30 | {
31 | return new Materials.color(Convert.ToByte(txtb_R.Text), Convert.ToByte(txtb_G.Text), Convert.ToByte(txtb_B.Text), Convert.ToByte(txtb_A.Text));
32 | }
33 |
34 | private void txtb_numeric_KeyPress(object sender, KeyPressEventArgs e)
35 | {
36 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.'))
37 | {
38 | e.Handled = true;
39 | }
40 | }
41 |
42 | private void txtb_numeric_TextChanged(object sender, EventArgs e)
43 | {
44 | TextBox tb = (TextBox)sender;
45 | if (Convert.ToInt32(tb.Text) > 255)
46 | {
47 | tb.Text = "255";
48 | }
49 |
50 | if (Convert.ToInt32(tb.Text) < 0)
51 | {
52 | tb.Text = "0";
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Material.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace JSRF_ModTool.DataFormats.JSRF
7 | {
8 |
9 | ///
10 | /// JSRF Material definition
11 | ///
12 | ///
13 | ///
14 | /// JSRF materials contain list of texture IDs, or IDs that are unknown (possibly shader id, or material id)
15 | /// if there's more than one id its usually the second id that's the texture id
16 | /// some materials seem to have a List of ids rather than just one or two
17 | /// still need to figure out if this material structure defines RGB values for the shader color
18 | /// or if its just a shader ID for a predefined sets of shaders hard-coded in the game executable file (XBE)
19 | /// most likely models such as menus UI widgets are colored by a texture used as palette, but not sure
20 | ///
21 | /// Structure of a material in game file
22 | /// 0x0 : Int32 number_of_texture_ids
23 | /// 0x4 : Int32 texture_id
24 | /// 0x8 : Int32 texture_id
25 | /// .... etc
26 | ///
27 | class Material
28 | {
29 | // Int32 ids_count = 0;
30 | public List texture_id = new List();
31 |
32 | ///
33 | /// read byte array as materials list
34 | ///
35 | public Material(byte[] data)
36 | {
37 | int ids_count = BitConverter.ToInt32(data, 0);
38 |
39 | for (int i = 4; i < (ids_count * 4) +4 ; i+=4)
40 | {
41 | if (i + 4 >= data.Length) { return; }
42 | texture_id.Add(BitConverter.ToInt32(data, i));
43 | }
44 |
45 | }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Texture_header.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.DataFormats.JSRF
8 | {
9 | class Texture_header
10 | {
11 | public Int32 Texture_ID { get; set; }
12 | public Int32 unk_4 { get; set; }
13 | public Int32 unk_8 { get; set; }
14 | public Int32 unk_12 { get; set; }
15 |
16 | public Int32 unk_16 { get; set; }
17 | public Int32 resolution { get; set; }
18 | public byte compression_format { get; set; } // 5 = dxt1 | 6 = dxt3 | 24
19 | public byte has_alpha { get; set; } // 1 = alpha, 5 = no alpha 25
20 | public byte is_swizzled { get; set; } // 1 = swizzled 26
21 | public byte unk_27 { get; set; }
22 |
23 | public Int16 mipmap_count { get; set; }
24 | public Int16 unk_30 { get; set; }
25 |
26 |
27 | public byte[] serialize()
28 | {
29 | List b = new List();
30 | b.Add(BitConverter.GetBytes(Texture_ID));
31 | b.Add(BitConverter.GetBytes(unk_4));
32 | b.Add(BitConverter.GetBytes(unk_8));
33 | b.Add(BitConverter.GetBytes(unk_12));
34 |
35 | b.Add(BitConverter.GetBytes(unk_16));
36 | b.Add(BitConverter.GetBytes(resolution));
37 | b.Add(new byte[] { compression_format } );
38 | b.Add(new byte[] { has_alpha });
39 |
40 | b.Add(new byte[] { is_swizzled });
41 | b.Add(new byte[] { unk_27 });
42 | b.Add(BitConverter.GetBytes(mipmap_count));
43 | b.Add(BitConverter.GetBytes(unk_30));
44 |
45 | return b.SelectMany(byteArr => byteArr).ToArray();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This is the official list of people who have contributed
2 | # to the Helix Toolkit repository.
3 | # The AUTHORS file lists the copyright holders; this file
4 | # lists people.
5 |
6 | # People submitting code should be listed in this file (by email address).
7 |
8 | # Names should be added to this file like so:
9 | # Name
10 |
11 | # Please keep the list sorted.
12 |
13 | Aleksey Shubin
14 | ando23
15 | Beppe Marazzi
16 | Benglin (Ben) Goh
17 | Brad Phelan
18 | Carl Philipp Bickmeier
19 | ccHanibal
20 | christophano@hotmail.com
21 | Christof Konstantinopoulos
22 | Christof
23 | ck
24 | Clement Bellot
25 | cureos
26 | dgwaldo
27 | dturvey_bhc
28 | Don Waldo
29 | Edward Zhu
30 | Franz Spitaler
31 | Gary Johnson
32 | Ian Keough
33 | Jack Ukleja
34 | Jérémy Ansel
35 | jesperll
36 | Johan Larsson
37 | johnsonlu
38 | lcouz
39 | lrieger
40 | Lunci Hua
41 | mertkokusen
42 | mortalV
43 | omnillogix
44 | Oystein Bjorke
45 | Peter Boyer
46 | PillowSky
47 | Piotr Steclik
48 | przem
49 | Sander Weltje
50 | Samuel Carlsson
51 | smischke
52 | Zonggui Zhu
53 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This is the official list of people who have contributed
2 | # to the Helix Toolkit repository.
3 | # The AUTHORS file lists the copyright holders; this file
4 | # lists people.
5 |
6 | # People submitting code should be listed in this file (by email address).
7 |
8 | # Names should be added to this file like so:
9 | # Name
10 |
11 | # Please keep the list sorted.
12 |
13 | Aleksey Shubin
14 | ando23
15 | Beppe Marazzi
16 | Benglin (Ben) Goh
17 | Brad Phelan
18 | Carl Philipp Bickmeier
19 | ccHanibal
20 | christophano@hotmail.com
21 | Christof Konstantinopoulos
22 | Christof
23 | ck
24 | Clement Bellot
25 | cureos
26 | dgwaldo
27 | dturvey_bhc
28 | Don Waldo
29 | Edward Zhu
30 | Franz Spitaler
31 | Gary Johnson
32 | Ian Keough
33 | Jack Ukleja
34 | Jérémy Ansel
35 | jesperll
36 | Johan Larsson
37 | johnsonlu
38 | lcouz
39 | lrieger
40 | Lunci Hua
41 | mertkokusen
42 | mortalV
43 | omnillogix
44 | Oystein Bjorke
45 | Peter Boyer
46 | PillowSky
47 | Piotr Steclik
48 | przem
49 | Sander Weltje
50 | Samuel Carlsson
51 | smischke
52 | Zonggui Zhu
53 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/Vectors.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace JSRF_HD_Tool
7 | {
8 |
9 | namespace Vectors
10 | {
11 |
12 |
13 |
14 |
15 |
16 | public class Vector3
17 | {
18 | public float X;
19 | public float Y;
20 | public float Z;
21 |
22 |
23 | public Vector3(string x, string y, string z)
24 | {
25 | setVals(x,y,z);
26 | }
27 |
28 | public Vector3(float x, float y, float z)
29 | {
30 | setVals(x, y, z);
31 | }
32 |
33 | private void setVals(object x, object y, object z)
34 | {
35 | if (x is string) { X = Convert.ToSingle(x.ToString().Replace('.', ',')); }
36 | if (y is string) { Y = Convert.ToSingle(y.ToString().Replace('.', ',')); }
37 | if (z is string) { Z = Convert.ToSingle(z.ToString().Replace('.', ',')); }
38 |
39 | if ((x is float) || (x is Single) || (x is int)) { X = Convert.ToSingle(x); }
40 | if ((y is float) || (y is Single) || (y is int)) { Y = Convert.ToSingle(y); }
41 | if ((z is float) || (z is Single) || (z is int)) { Z = Convert.ToSingle(z); }
42 | }
43 |
44 | /*
45 | public void set(object x, object y, object z)
46 | {
47 | if (x is string) { X = Convert.ToSingle(x.ToString().Replace('.', ',')); }
48 | if (y is string) { Y = Convert.ToSingle(y.ToString().Replace('.', ',')); }
49 | if (z is string) { Z = Convert.ToSingle(z.ToString().Replace('.', ',')); }
50 |
51 | if ((x is float) || (x is Single) || (x is int)) { X = Convert.ToSingle(x); }
52 | if ((y is float) || (y is Single) || (y is int)) { Y = Convert.ToSingle(y); }
53 | if ((z is float) || (z is Single) || (z is int)) { Z = Convert.ToSingle(z); }
54 | }
55 | *
56 | * */
57 | }
58 |
59 |
60 |
61 | public class Vector2
62 | {
63 | public float X { get; set; }
64 | public float Y { get; set; }
65 |
66 | public void set(object x, object y)
67 | {
68 | if (x is string) { X = Convert.ToSingle(x.ToString().Replace('.', ',')); }
69 | if (y is string) { Y = Convert.ToSingle(y.ToString().Replace('.', ',')); }
70 | }
71 | }
72 |
73 | /*
74 | public Vector3 AddVector(Vector3 a, Vector3 b)
75 | {
76 | Vector3 result = new Vector3();
77 | result.set(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
78 |
79 | me = result;
80 | }
81 | * */
82 |
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/FileExplorer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using System.IO;
4 |
5 |
6 | namespace JSRF_ModTool
7 | {
8 | class FileExplorer
9 | {
10 |
11 | public static string directory { get; set; }
12 |
13 | public void set_dir(string path)
14 | {
15 | directory = path;
16 | }
17 |
18 | public bool CreateTree(TreeView treeView)
19 | {
20 |
21 | bool returnValue = false;
22 |
23 | try
24 | {
25 | TreeNode files = new TreeNode();
26 | files.Text = directory;
27 | files.Tag = "Files";
28 | files.Nodes.Add("");
29 | treeView.Nodes.Add(files);
30 | files.Expand();
31 | }
32 | catch
33 | {
34 | returnValue = false;
35 | }
36 | return returnValue;
37 |
38 | }
39 |
40 | public TreeNode EnumerateDirectory(TreeNode parentNode)
41 | {
42 |
43 | try
44 | {
45 | DirectoryInfo rootDir;
46 |
47 | Char[] arr = { '\\' };
48 | string[] nameList = parentNode.FullPath.Split(arr);
49 | string path = directory;
50 |
51 | if (nameList.GetValue(0).ToString() == "Files")
52 | {
53 | path = directory;
54 |
55 | for (int i = 1; i < nameList.Length; i++)
56 | {
57 | path = path + nameList[i] + "\\";
58 | }
59 |
60 | rootDir = new DirectoryInfo(path);
61 | }
62 | // for other Directories
63 | else
64 | {
65 |
66 | rootDir = new DirectoryInfo(parentNode.FullPath + "\\");
67 | }
68 |
69 | parentNode.Nodes[0].Remove();
70 | foreach (DirectoryInfo dir in rootDir.GetDirectories())
71 | {
72 |
73 | TreeNode node = new TreeNode();
74 | node.Text = dir.Name;
75 | node.Nodes.Add("");
76 | parentNode.Nodes.Add(node);
77 | }
78 |
79 | // Fill files
80 | foreach (FileInfo file in rootDir.GetFiles())
81 | {
82 | if ((file.Extension == ".dat") || (file.Extension == ".bin"))
83 | {
84 | TreeNode node = new TreeNode();
85 | node.Text = file.Name;
86 | node.ImageIndex = 2;
87 | node.SelectedImageIndex = 2;
88 | parentNode.Nodes.Add(node);
89 | }
90 | }
91 | }
92 |
93 | catch
94 | {
95 | return null;
96 | }
97 |
98 | return parentNode;
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/Bmp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace JSRF_ModTool.DataFormats
9 | {
10 | public class Bmp
11 | {
12 | public int Size { get; set; }
13 | public int Width { get; set; }
14 | public int Height { get; set; }
15 | public Int16 Planes { get; set; }
16 | public Int16 BitsPerPixel { get; set; }
17 | public CompressionMethod Compression { get; set; }
18 | public int DataOffset { get; set; }
19 | public int DibHeaderSize { get; set; }
20 | public int DataSize { get; set; }
21 | public int XPelsPerMeter { get; set; }
22 | public int YPelsPerMeter { get; set; }
23 | public int ColorCount { get; set; }
24 | public int ImportantColorCount { get; set; }
25 | public byte[] Data { get; set; }
26 | public Bmp(byte[] data, int resolution)
27 | {
28 | Data = data;
29 | DibHeaderSize = 40;
30 | DataSize = data.Length;
31 | DataOffset = 10 + DibHeaderSize;
32 | Size = DataOffset + DataSize;
33 | Width = resolution;
34 | Height = resolution;
35 | Planes = 1;
36 | BitsPerPixel = (Int16)(DataSize * 8 / resolution / resolution);
37 | Compression = CompressionMethod.BI_RGB;
38 | XPelsPerMeter = 2835;
39 | YPelsPerMeter = 2835;
40 | ColorCount = 0;
41 | ImportantColorCount = 0;
42 | }
43 | public byte[] ToByteArray()
44 | {
45 | var ms = new MemoryStream();
46 | ms.Write(new byte[] { 0x42, 0x4D }, 0, 2);
47 | ms.Write(BitConverter.GetBytes(Size), 0, 4);
48 | ms.Write(new byte[4], 0, 4);
49 | ms.Write(BitConverter.GetBytes(DataOffset), 0, 4);
50 | ms.Write(BitConverter.GetBytes(DibHeaderSize), 0, 4);
51 | ms.Write(BitConverter.GetBytes(Width), 0, 4);
52 | ms.Write(BitConverter.GetBytes(Height), 0, 4);
53 | ms.Write(BitConverter.GetBytes(Planes), 0, 2);
54 | ms.Write(BitConverter.GetBytes(BitsPerPixel), 0, 2);
55 | ms.Write(BitConverter.GetBytes((int)Compression), 0, 4);
56 | ms.Write(BitConverter.GetBytes(DataSize), 0, 4);
57 | ms.Write(BitConverter.GetBytes(XPelsPerMeter), 0, 4);
58 | ms.Write(BitConverter.GetBytes(YPelsPerMeter), 0, 4);
59 | ms.Write(BitConverter.GetBytes(ColorCount), 0, 4);
60 | ms.Write(BitConverter.GetBytes(ImportantColorCount), 0, 4);
61 | ms.Write(Data, 0, DataSize);
62 | return ms.ToArray();
63 | }
64 | public enum CompressionMethod
65 | {
66 | BI_RGB = 0,
67 | BI_RLE8 = 1,
68 | BI_RLE4 = 2,
69 | BI_BITFIELDS = 3,
70 | BI_JPEG = 4,
71 | BI_PNG = 5,
72 | BI_ALPHABITFIELDS = 6,
73 | BI_CMYK = 11,
74 | BI_CMYKRLE8 = 12,
75 | BI_CMYKRLE4 = 13
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Stage_Bin/header.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.DataFormats.JSRF.Stage_Bin
8 | {
9 | public class header
10 | {
11 | public Int32 block_00_start_offset { get; set; } //
12 | public Int32 block_00_size { get; set; } // 59640
13 |
14 | public Int32 block_01_start_offset { get; set; } //
15 | public Int32 block_01_size { get; set; } //
16 |
17 | public Int32 block_02_start_offset { get; set; } //
18 | public Int32 block_02_size { get; set; } //
19 |
20 | public Int32 Stage_Models_count { get; set; } //
21 | public Int32 unk { get; set; } // zero
22 |
23 | // stage number
24 | public Int32 unk_32 { get; set; } // zero
25 | public Int32 unk_36 { get; set; } // number of StgXX_XX parts
26 | public Int32 unk_40 { get; set; } // number of StgXX_XX parts
27 | public Int32 unk_44 { get; set; } // number of StgXX_XX parts
28 | public Int32 unk_48 { get; set; } // number of StgXX_XX parts
29 | public Int32 unk_52 { get; set; } // number of StgXX_XX parts
30 | public Int32 unk_56 { get; set; } // number of StgXX_XX parts
31 | public Int32 unk_60 { get; set; } // number of StgXX_XX parts
32 | public Int32 unk_64 { get; set; } // number of StgXX_XX parts
33 | public Int32 unk_68 { get; set; } // number of StgXX_XX parts
34 | public Int32 unk_72 { get; set; } // number of StgXX_XX parts
35 | public Int32 unk_76 { get; set; } // number of StgXX_XX parts
36 | public Int32 unk_80 { get; set; } // number of StgXX_XX parts
37 | public Int32 unk_84 { get; set; } // number of StgXX_XX parts
38 | public Int32 unk_88 { get; set; } // number of StgXX_XX parts
39 | public Int32 unk_92 { get; set; } // number of StgXX_XX parts
40 | public Int32 unk_96 { get; set; } // number of StgXX_XX parts
41 | public Int32 unk_100 { get; set; } // number of StgXX_XX parts
42 | public Int32 unk_104 { get; set; } // number of StgXX_XX parts
43 | public Int32 unk_108 { get; set; } // number of StgXX_XX parts
44 | public Int32 unk_112 { get; set; } // number of StgXX_XX parts
45 | public Int32 unk_116 { get; set; } // number of StgXX_XX parts
46 | public Int32 unk_120 { get; set; } // number of StgXX_XX parts
47 | public Int32 unk_124 { get; set; } // number of StgXX_XX parts
48 | public Int32 unk_128 { get; set; } // number of StgXX_XX parts
49 | public Int32 unk_132 { get; set; } // number of StgXX_XX parts
50 | public Int32 unk_136 { get; set; } // number of StgXX_XX parts
51 | public Int32 unk_140 { get; set; } // number of StgXX_XX parts
52 | public Int32 unk_144 { get; set; } // number of StgXX_XX parts
53 | public Int32 unk_148 { get; set; } // number of StgXX_XX parts
54 | public Int32 unk_152 { get; set; } // number of StgXX_XX parts
55 |
56 | public Int32 unk_156 { get; set; } // NaN (indicates end of block or header??)
57 | // END HEADER??
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace JSRF_ModTool.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JSRF_ModTool.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Byte[].
65 | ///
66 | internal static byte[] block_02_base {
67 | get {
68 | object obj = ResourceManager.GetObject("block_02_base", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap jsrf_soul_icon {
77 | get {
78 | object obj = ResourceManager.GetObject("jsrf_soul_icon", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/Math/BoundingSphere.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Numerics;
7 |
8 | namespace JSRF_ModTool.Functions.Math
9 | {
10 | public class BoundingSphere
11 | {
12 | ///
13 | /// Get the almost minimum sphere that contains all of a set of vertices by Ritter's algorithm.
14 | ///
15 | ///
16 | /// A tuple (center, radius) of the bounding sphere.
17 | public static (Vector3, float) GetMinimumBoundingSphere(List vertices)
18 | {
19 | // Initialize the 6 vertices having the extreme single value for each axis
20 | Vector3[] extremes = new Vector3[6] {
21 | new Vector3(Single.PositiveInfinity), // low x
22 | new Vector3(Single.PositiveInfinity), // low y
23 | new Vector3(Single.PositiveInfinity), // low z
24 | new Vector3(Single.NegativeInfinity), // high x
25 | new Vector3(Single.NegativeInfinity), // high y
26 | new Vector3(Single.NegativeInfinity) }; // high z
27 |
28 | // Find exteme vertices
29 | foreach (var vertex in vertices)
30 | {
31 | if (vertex.X < extremes[0].X) extremes[0] = vertex;
32 | if (vertex.Y < extremes[1].Y) extremes[1] = vertex;
33 | if (vertex.Z < extremes[2].Z) extremes[2] = vertex;
34 | if (vertex.X > extremes[3].X) extremes[3] = vertex;
35 | if (vertex.Y > extremes[4].Y) extremes[4] = vertex;
36 | if (vertex.Z > extremes[5].Z) extremes[5] = vertex;
37 | }
38 |
39 | // Find the pair of extremes that are furthest apart from each other
40 | Tuple furthestIndexes = new Tuple(0, 0);
41 | float furthestDistance = 0;
42 | for (int i = 0; i < 6; i++)
43 | {
44 | for (int j = 0; j < 6; j++)
45 | {
46 | if (i == j) continue;
47 | float distance = Vector3.Distance(extremes[i], extremes[j]);
48 | if (distance > furthestDistance)
49 | {
50 | furthestIndexes = new Tuple(i, j);
51 | furthestDistance = distance;
52 | }
53 | }
54 | }
55 |
56 | // Take that pair and make a sphere that has it as its diameter
57 | Vector3 center = Vector3.Lerp(extremes[furthestIndexes.Item1], extremes[furthestIndexes.Item2], 0.5f);
58 | float radius = furthestDistance / 2;
59 |
60 | // From the vertices that aren't enclosed by that sphere, find the furthest out one
61 | Vector3 furthestOutlier = new Vector3(0);
62 | float furthestOutlierDistance = 0;
63 | foreach (var vertex in vertices)
64 | {
65 | float distance = Vector3.Distance(center, vertex);
66 | if (distance > radius)
67 | if (distance > furthestOutlierDistance)
68 | {
69 | furthestOutlierDistance = distance;
70 | furthestOutlier = vertex;
71 | }
72 | }
73 |
74 | // Take that outlier, and the opposite point of the original sphere, and make a new sphere of this new diameter
75 | // If no outliers, return the original sphere
76 | if (furthestOutlierDistance > 0)
77 | {
78 | center = Vector3.Lerp(furthestOutlier, center, (radius / furthestOutlierDistance + 1f) / 2f);
79 | radius = furthestOutlierDistance;
80 | }
81 | return (center, radius);
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Model_Inspector.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace JSRF_ModTool.MDLB_Import
2 | {
3 | partial class Model_Inspector
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.lab_smd_name = new System.Windows.Forms.Label();
32 | this.cb_mdl_part_type = new System.Windows.Forms.ComboBox();
33 | this.cb_vertex_def_size = new System.Windows.Forms.ComboBox();
34 | this.SuspendLayout();
35 | //
36 | // lab_smd_name
37 | //
38 | this.lab_smd_name.AutoSize = true;
39 | this.lab_smd_name.Location = new System.Drawing.Point(4, 6);
40 | this.lab_smd_name.Name = "lab_smd_name";
41 | this.lab_smd_name.Size = new System.Drawing.Size(57, 13);
42 | this.lab_smd_name.TabIndex = 0;
43 | this.lab_smd_name.Text = "model.smd";
44 | //
45 | // cb_mdl_part_type
46 | //
47 | this.cb_mdl_part_type.BackColor = System.Drawing.SystemColors.Control;
48 | this.cb_mdl_part_type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
49 | this.cb_mdl_part_type.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
50 | this.cb_mdl_part_type.Items.AddRange(new object[] {
51 | "Visual model",
52 | "Shadow model",
53 | "Bone"});
54 | this.cb_mdl_part_type.Location = new System.Drawing.Point(181, 2);
55 | this.cb_mdl_part_type.Name = "cb_mdl_part_type";
56 | this.cb_mdl_part_type.Size = new System.Drawing.Size(121, 21);
57 | this.cb_mdl_part_type.TabIndex = 1;
58 | this.cb_mdl_part_type.Visible = false;
59 | //
60 | // cb_vertex_def_size
61 | //
62 | this.cb_vertex_def_size.BackColor = System.Drawing.SystemColors.Control;
63 | this.cb_vertex_def_size.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
64 | this.cb_vertex_def_size.Items.AddRange(new object[] {
65 | "12",
66 | "20",
67 | "24",
68 | "28",
69 | "32",
70 | "36",
71 | "40",
72 | "44",
73 | "48",
74 | "56"});
75 | this.cb_vertex_def_size.Location = new System.Drawing.Point(308, 2);
76 | this.cb_vertex_def_size.Name = "cb_vertex_def_size";
77 | this.cb_vertex_def_size.Size = new System.Drawing.Size(125, 21);
78 | this.cb_vertex_def_size.TabIndex = 6;
79 | //
80 | // Model_Inspector
81 | //
82 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
84 | this.Controls.Add(this.cb_vertex_def_size);
85 | this.Controls.Add(this.cb_mdl_part_type);
86 | this.Controls.Add(this.lab_smd_name);
87 | this.Name = "Model_Inspector";
88 | this.Size = new System.Drawing.Size(441, 25);
89 | this.ResumeLayout(false);
90 | this.PerformLayout();
91 |
92 | }
93 |
94 | #endregion
95 |
96 | private System.Windows.Forms.Label lab_smd_name;
97 | private System.Windows.Forms.ComboBox cb_mdl_part_type;
98 | private System.Windows.Forms.ComboBox cb_vertex_def_size;
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/Xbox/TextureSwizzleParsing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JSRF_ModTool.DataFormats.Xbox
8 | {
9 | public static class TextureSwizzleParsing
10 | {
11 | /* This should be pretty straightforward.
12 | * It creates a bit pattern like ..zyxzyxzyx from ..xxx, ..yyy and ..zzz
13 | * If there are no bits left from any component it will pack the other masks
14 | * more tighly (Example: zzxzxzyx = Fewer x than z and even fewer y)
15 | */
16 | public static Mask generate_swizzle_masks(UInt32 width,
17 | UInt32 height,
18 | UInt32 depth)
19 | {
20 | UInt32 x = 0, y = 0, z = 0;
21 | UInt32 bit = 1;
22 | UInt32 mask_bit = 1;
23 | bool done;
24 | do
25 | {
26 | done = true;
27 | if (bit < width) { x |= mask_bit; mask_bit <<= 1; done = false; }
28 | if (bit < height) { y |= mask_bit; mask_bit <<= 1; done = false; }
29 | if (bit < depth) { z |= mask_bit; mask_bit <<= 1; done = false; }
30 | bit <<= 1;
31 | } while (!done);
32 | if (!((((x ^ y) ^ z) == (mask_bit - 1)))) throw new Exception();
33 | return new Mask { x = x, y = y, z = z };
34 | }
35 | /* This fills a pattern with a value if your value has bits abcd and your
36 | * pattern is 11010100100 this will return: 0a0b0c00d00
37 | */
38 | public static UInt32 fill_pattern(UInt32 pattern, UInt32 value)
39 | {
40 | UInt32 result = 0;
41 | UInt32 bit = 1;
42 | while (value != 0)
43 | {
44 | if (pattern != 0 & bit != 0)
45 | {
46 | /* Copy bit to result */
47 | result |= (value != 0) & true ? bit : 0;
48 | value >>= 1;
49 | }
50 | bit <<= 1;
51 | }
52 | return result;
53 | }
54 |
55 | public static UInt32 get_swizzled_offset(
56 | UInt32 x, UInt32 y, UInt32 z,
57 | UInt32 mask_x, UInt32 mask_y, UInt32 mask_z,
58 | UInt32 bytes_per_pixel)
59 | {
60 | return bytes_per_pixel * (fill_pattern(mask_x, x)
61 | | fill_pattern(mask_y, y)
62 | | fill_pattern(mask_z, z));
63 | }
64 | public static byte[] unswizzle_box(
65 | byte[] src_buf,
66 | UInt32 width,
67 | UInt32 height,
68 | UInt32 depth,
69 |
70 | UInt32 row_pitch,
71 | UInt32 slice_pitch,
72 | UInt32 bytes_per_pixel)
73 | {
74 | Mask mask = generate_swizzle_masks(width, height, depth);
75 | UInt32 sliceOffset = 0;
76 | UInt32 x, y, z;
77 | byte[] dst_buf = new byte[src_buf.Length];
78 | for (z = 0; z < depth; z++)
79 | {
80 | for (y = 0; y < height; y++)
81 | {
82 | for (x = 0; x < width; x++)
83 | {
84 | uint iSrc =
85 | get_swizzled_offset(x, y, z, mask.x, mask.y, mask.z,
86 | bytes_per_pixel);
87 | uint iDst = y * row_pitch + x * bytes_per_pixel;
88 | byte[] pixel = new byte[bytes_per_pixel];
89 | Array.Copy(src_buf, iSrc, dst_buf, iDst, bytes_per_pixel);
90 | }
91 | }
92 | sliceOffset += slice_pitch;
93 | }
94 | return dst_buf;
95 | }
96 | public static byte[] unswizzle_rect(
97 | byte[] src_buf,
98 | UInt32 width,
99 | UInt32 height,
100 |
101 | UInt32 pitch,
102 | UInt32 bytes_per_pixel)
103 | {
104 | return unswizzle_box(src_buf, width, height, 1, pitch, 0, bytes_per_pixel);
105 | }
106 | }
107 |
108 | public struct Mask
109 | {
110 | public UInt32 x;
111 | public UInt32 y;
112 | public UInt32 z;
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Material_Inspector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using JSRF_ModTool.MDLB_Import;
11 |
12 | namespace JSRF_ModTool.MDLB_Import
13 | {
14 | public partial class Material_Inspector : UserControl
15 | {
16 | public int id;
17 |
18 | public Material_Inspector()
19 | {
20 | InitializeComponent();
21 | }
22 |
23 | public void set_values(Materials.color c, int shader_id, int unk_id1, int unk_id2, float hb)
24 | {
25 | // set color
26 | color_0.set_colors(c.R, c.G, c.B, c.A);
27 |
28 | #region set material id
29 |
30 | // set material id
31 | string[] names = Enum.GetNames(typeof(Materials.materials));
32 | int[] values = (int[])Enum.GetValues(typeof(Materials.materials));
33 | bool mat_found = false;
34 |
35 | // find corresponding material id and select item in combobox
36 | for (int i = 0; i < names.Length; i++)
37 | {
38 | //int test = values[i];
39 | if (values[i] == shader_id)
40 | {
41 | mat_found = true;
42 | cb_material_id.SelectedItem = names[i];
43 | break;
44 | }
45 | }
46 |
47 | if(!mat_found)
48 | {
49 | /// search to select the material
50 | cb_material_id.Items.Add(shader_id.ToString());
51 |
52 | for (int i = 0; i < cb_material_id.Items.Count-1; i++)
53 | {
54 |
55 | if (cb_material_id.Items[i].ToString() == shader_id.ToString())
56 | {
57 | cb_material_id.SelectedIndex = i;
58 | break;
59 | }
60 | }
61 | }
62 | #endregion
63 |
64 | txtb_unk_id1.Text = unk_id1.ToString();
65 | txtb_unk_id2.Text = unk_id2.ToString();
66 | txtb_hb.Text = hb.ToString();
67 | lab_id.Text = "[mat_" + id.ToString() + "]";
68 | }
69 |
70 | public int get_shader_type()
71 | {
72 |
73 | string[] names = Enum.GetNames(typeof(Materials.materials));
74 | int[] values = (int[])Enum.GetValues(typeof(Materials.materials));
75 |
76 | int shader_id = 0;
77 | bool is_number = int.TryParse(cb_material_id.Text, out shader_id);
78 |
79 | // if the shader id is defined as a string
80 | if (!is_number)
81 | {
82 | // search shader name and corresponding return shader id from names/values arrays
83 | for (int n = 0; n < names.Length; n++)
84 | {
85 | if (names[n] == cb_material_id.Text)
86 | {
87 | return values[n];
88 | }
89 | }
90 |
91 | }
92 |
93 | return Convert.ToInt32(cb_material_id.Text);
94 |
95 | }
96 |
97 | public int get_unk_id1()
98 | {
99 | return Convert.ToInt32(txtb_unk_id1.Text);
100 | }
101 |
102 | public int get_unk_id2()
103 | {
104 | return Convert.ToInt32(txtb_unk_id2.Text);
105 | }
106 |
107 | public Materials.color get_color()
108 | {
109 | return color_0.get_colors();
110 | }
111 |
112 | public float get_hb()
113 | {
114 | return Convert.ToSingle(txtb_hb.Text);
115 | }
116 |
117 | private void txtb_hb_KeyPress(object sender, KeyPressEventArgs e)
118 | {
119 |
120 | }
121 |
122 | private void txtb_hb_TextChanged(object sender, EventArgs e)
123 | {
124 | TextBox tb = (TextBox)sender;
125 | if (Convert.ToSingle(tb.Text) > Single.MaxValue)
126 | {
127 | tb.Text = Single.MaxValue.ToString();
128 | }
129 |
130 | if (Convert.ToSingle(tb.Text) < Single.MinValue)
131 | {
132 | tb.Text = Single.MinValue.ToString();
133 | }
134 | }
135 |
136 | private void MaterialProperties_Load(object sender, EventArgs e)
137 | {
138 |
139 | foreach (var item in Enum.GetNames(typeof(Materials.materials)))
140 | {
141 | cb_material_id.Items.Add(item);
142 | }
143 |
144 | }
145 |
146 | private void btn_remove_Click(object sender, EventArgs e)
147 | {
148 |
149 | Form ctrl = this.Parent.FindForm();
150 | ((MDLB_import_options_Form)ctrl).remove_mat_inspector(this.id);
151 |
152 |
153 | this.Dispose();
154 | }
155 |
156 | public void set_mat_id()
157 | {
158 | lab_id.Text = "[mat_" + id.ToString() + "]";
159 | }
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/Xbox/TextureSwizzle.cs:
--------------------------------------------------------------------------------
1 | using JSRF_ModTool.Functions;
2 | using System;
3 | using System.Drawing;
4 | using System.IO;
5 | using System.Runtime.InteropServices;
6 | using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
7 |
8 | namespace JSRF_ModTool.DataFormats.Xbox
9 | {
10 | public static class TextureSwizzle
11 | {
12 |
13 | public static void Unswizzle(byte[] texDataBuffer, int Resolution)
14 | {
15 | var pitch = texDataBuffer.Length / Resolution; // (Body.Length - 0x20) / Resolution;
16 | var bytesPerPixel = pitch / Resolution;
17 | if (bytesPerPixel < 1) return;
18 | var pixelData = new byte[texDataBuffer.Length]; // - 0x20
19 | Array.Copy(texDataBuffer, 0x20, pixelData, 0, pixelData.Length);
20 | pixelData = TextureSwizzleParsing.unswizzle_rect(pixelData, (UInt32)Resolution, (UInt32)Resolution, (UInt32)pitch, (UInt32)bytesPerPixel);
21 | Array.Copy(pixelData, 0, texDataBuffer, 0x00, pixelData.Length); // Array.Copy(pixelData, 0, texDataBuffer, 0x20, pixelData.Length);
22 | }
23 |
24 | public static byte[] QuadtreeUnswizzle(byte[] texDataBuffer, int Resolution)
25 | {
26 | var length = texDataBuffer.Length; //buftexDataBuffer.Length
27 | var pitch = length / Resolution;
28 | var bytesPerPixel = pitch / Resolution;
29 | var size = (int)Math.Sqrt(length / bytesPerPixel);
30 | var depth = (int)Math.Log(size, 2);
31 | var tree = new byte[length, depth];
32 | byte[] result = new byte[length];
33 | for (int i = 0; i < length; i += bytesPerPixel)
34 | {
35 | var iOut = UnswizzleOffset(i, size, bytesPerPixel);
36 | for (int b = 0; b < bytesPerPixel; b++)
37 | {
38 | result[iOut + b] = texDataBuffer[i + b]; // buftexDataBuffer[0x20 + i + b];
39 | }
40 | }
41 | return result;
42 | }
43 |
44 | public static int UnswizzleOffset(int offset, int size, int bytesPerPixel)
45 | {
46 | var ordinal = offset / bytesPerPixel;
47 | var depth = (int)Math.Log(size, 2);
48 | if (offset % bytesPerPixel != 0) throw new DataMisalignedException("Offset does not align with start of pixel.");
49 | if (ordinal < 0 || ordinal >= size * size) throw new IndexOutOfRangeException($"Expected offset in [0, {size * size * bytesPerPixel - 1}], got {offset}.");
50 | var tree = new byte[depth];
51 | var index = depth - 1;
52 | if (ordinal == 0)
53 | return 0;
54 |
55 | while (ordinal != 0)
56 | {
57 | int remainder = (ordinal % 4);
58 | tree[index--] = (byte)remainder;
59 | ordinal = ordinal / 4;
60 | }
61 |
62 | var step = size / 2;
63 | var x = 0;
64 | var y = 0;
65 | for (int i = 0; i < depth; i++)
66 | {
67 | x += (tree[i] % 2 == 1) ? step : 0;
68 | y += (tree[i] > 1) ? step : 0;
69 | step /= 2;
70 | }
71 |
72 | return (x + y * size) * bytesPerPixel;
73 | }
74 |
75 | //public static byte[] QuadtreeUnswizzle(byte[] Body, int Resolution)
76 | //{
77 | // var length = Body.Length; //Body.Length - 0x20;
78 | // var pitch = length / Resolution;
79 | // var bytesPerPixel = pitch / Resolution;
80 | // var size = (int)Math.Sqrt(length / bytesPerPixel);
81 | // var depth = (int)Math.Log(size, 2);
82 | // var tree = new byte[length, depth];
83 | // byte[] result = new byte[length];
84 | // for (int i = 0; i < length; i += bytesPerPixel)
85 | // {
86 | // var iOut = UnswizzleOffset(i, size, bytesPerPixel);
87 | // for (int b = 0; b < bytesPerPixel; b++)
88 | // {
89 | // result[iOut + b] = Body[i + b]; //Body[0x20 + i + b];
90 | // }
91 | // }
92 | // return result;
93 | //}
94 |
95 | //public static int UnswizzleOffset(int offset, int size, int bytesPerPixel)
96 | //{
97 | // var ordinal = offset / bytesPerPixel;
98 | // var depth = (int)Math.Log(size, 2);
99 | // if (offset % bytesPerPixel != 0) throw new DataMisalignedException("Offset does not align with start of pixel.");
100 | // if (ordinal < 0 || ordinal >= size * size) throw new IndexOutOfRangeException($"Expected offset in [0, {size * size * bytesPerPixel - 1}], got {offset}.");
101 | // var tree = new byte[depth];
102 | // var index = depth - 1;
103 | // if (ordinal == 0)
104 | // return 0;
105 |
106 | // while (ordinal != 0)
107 | // {
108 | // int remainder = (ordinal % 4);
109 | // tree[index--] = (byte)remainder;
110 | // ordinal = ordinal / 4;
111 | // }
112 |
113 | // var step = size / 2;
114 | // var x = 0;
115 | // var y = 0;
116 | // for (int i = 0; i < depth; i++)
117 | // {
118 | // x += (tree[i] % 2 == 1) ? step : 0;
119 | // y += (tree[i] > 1) ? step : 0;
120 | // step /= 2;
121 | // }
122 |
123 | // return (x + y * size) * bytesPerPixel;
124 | //}
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Color.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Model_Inspector.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Material_Inspector.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/MDLB_import_options_Form.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/lib/netstandard1.1/HelixToolkit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | HelixToolkit
5 |
6 |
7 |
8 |
9 | Extension methods for strings.
10 |
11 |
12 |
13 |
14 | A regular expression containing "a one or more whitespaces" pattern.
15 |
16 |
17 |
18 |
19 | Splits the string on whitespace.
20 |
21 | The input string.
22 | Array of strings.
23 |
24 |
25 |
26 | Creates a string from the items in an enumerable.
27 |
28 | The items.
29 | The prefix.
30 | The separator.
31 |
32 | A string.
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | Logs the specified log level.
44 |
45 | The type of the sg type.
46 | The log level.
47 | The MSG.
48 | The caller.
49 |
50 |
51 |
52 |
53 |
54 | Provide simple log interface for user to log helix toolkit internal logs.
55 |
56 |
57 |
58 |
59 | Logs the specified log level.
60 |
61 | The type of the sg type.
62 | The log level.
63 | The MSG.
64 |
65 | The caller.
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | The trace
76 |
77 |
78 |
79 |
80 | The debug
81 |
82 |
83 |
84 |
85 | The information
86 |
87 |
88 |
89 |
90 | The warning
91 |
92 |
93 |
94 |
95 | The error
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | Initializes a new instance of the class.
106 |
107 |
108 |
109 |
110 | Initializes a new instance of the class.
111 |
112 | The logger.
113 |
114 |
115 |
116 | Logs the specified log level.
117 |
118 | The type of the sg type.
119 | The log level.
120 | The MSG.
121 | The caller.
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | Logs the specified log level.
134 |
135 | The type of the sg type.
136 | The log level.
137 | The MSG.
138 |
139 | The caller.
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Stage_Bin/Parser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using JSRF_ModTool.Functions;
3 | using JSRF_ModTool.Vector;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Text;
7 |
8 |
9 | namespace JSRF_ModTool.DataFormats.JSRF.Stage_Bin
10 | {
11 | public class Parser
12 | {
13 | string debug_data_export_dir = @"C:\Users\Mike\Desktop\JSRF\Stg_Decompiled\stg10\bin\"; // // @"C:\Users\Mike\Desktop\JSRF\Stg_Bin_Export\" // Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName;
14 | public JSRF.Stage_Bin.header header = new JSRF.Stage_Bin.header();
15 |
16 | public block_00 block_00; // stage physics collision 3d model data
17 | public block_01 block_01; // grind paths
18 | public block_02 block_02; // decals, object spawns (spawns/positions:decals, MDLB contained in StgXX_XX.dat and StgObj)
19 |
20 | bool export_data;
21 |
22 | public Parser(string stage_bin_filepath)
23 | {
24 |
25 | #if DEBUG
26 | export_data = true;
27 | #endif
28 |
29 | // load file to byte array
30 | byte[] data = Parsing.FileToByteArray(stage_bin_filepath, 0);
31 |
32 | // load header
33 | header = (JSRF.Stage_Bin.header)(Parsing.binary_to_struct(data, 0, typeof(JSRF.Stage_Bin.header)));
34 |
35 |
36 | #region load block 00
37 |
38 | byte[] array = Parsing.FileToByteArray(stage_bin_filepath, 0L);
39 | byte[] array2 = new byte[header.block_00_size];
40 | Array.Copy(array, header.block_00_start_offset, array2, 0, header.block_00_size);
41 | block_00 = (block_00)Parsing.binary_to_struct(array2, 0, typeof(block_00));
42 |
43 | block_00.block_A_headers_list = new List();
44 | byte[] array3 = new byte[32];
45 |
46 | for (int i = 1; i < block_00.coll_headers_A_chunk_count + 1; i++)
47 | {
48 | Array.Copy(array2, 32 * i, array3, 0, 32);
49 | block_00.block_A_headers_list.Add((block_00.collision_models_list)Parsing.binary_to_struct(array3, 0, typeof(block_00.collision_models_list)));
50 | }
51 | array3 = new byte[112];
52 | for (int j = 0; j < block_00.block_A_headers_list.Count; j++)
53 | {
54 | for (int k = 0; k < block_00.block_A_headers_list[j].models_list_count; k++)
55 | {
56 | Array.Copy(array2, block_00.block_A_headers_list[j].models_list_start_offset + 112 * k, array3, 0, 112);
57 | block_00.block_A_headers_list[j].coll_model_list.Add((block_00.collision_model)Parsing.binary_to_struct(array3, 0, typeof(block_00.collision_model)));
58 | }
59 | }
60 |
61 | for (int l = 0; l < block_00.block_A_headers_list.Count; l++)
62 | {
63 | for (int m = 0; m < block_00.block_A_headers_list[l].models_list_count; m++)
64 | {
65 | block_00.collision_model collision_model = block_00.block_A_headers_list[l].coll_model_list[m];
66 | int num = collision_model.vertices_start_offset + collision_model.vertices_count * 16;
67 | for (int n = 0; collision_model.vertices_start_offset + n < num; n += 16)
68 | {
69 | collision_model.vertex_list.Add((block_00.coll_vertex)Parsing.binary_to_struct(array2, collision_model.vertices_start_offset + n, typeof(block_00.coll_vertex)));
70 | }
71 | int triangles_end_addr = collision_model.triangles_start_offset + collision_model.triangle_count * 8;
72 | for (int bytes_offset = 0; collision_model.triangles_start_offset + bytes_offset < triangles_end_addr; bytes_offset += 8)
73 | {
74 | collision_model.triangles_list.Add(new block_00.coll_triangle((block_00.coll_triangle.raw)Parsing.binary_to_struct(array2, collision_model.triangles_start_offset + bytes_offset, typeof(block_00.coll_triangle.raw))));
75 | }
76 | block_00.block_A_headers_list[l].coll_model_list[m] = collision_model;
77 |
78 |
79 | #region export collision data/models
80 | /*
81 | if (!export_vtx_tri)
82 | {
83 | continue;
84 | }
85 | string text3 = debug_data_export_dir +"\\" + Path.GetFileNameWithoutExtension(lvl_bin_filepath).Replace("_", "") + "\\triangle_data\\";
86 | if (!Directory.Exists(text3))
87 | {
88 | Directory.CreateDirectory(text3);
89 | }
90 |
91 | block_00.export_all_collision_meshes(text3);
92 | List list4 = new List();
93 | List list5 = new List();
94 | list5.Add(String.Format("{0,6} {1,6} {2,6} {3,8} {4,8} {5,8} {6,8} {7,8} {8,8} {9,9} \n\n", "Index1", "Index2", "Index3", "min_x_id", "max_x_id", "min_y_id", "max_y_id", "min_z_id", "max_z_id", "surf_prop"));
95 | for (int num4 = 0; num4 < collision_model.triangles_list.Count; num4++)
96 | {
97 | list5.Add(collision_model.triangles_list[num4].ToString());
98 | }
99 |
100 | File.WriteAllLines(text3 + "tris_" + l + "_" + m + ".txt", list5);
101 | */
102 | #endregion
103 | }
104 | }
105 |
106 | #endregion
107 |
108 |
109 | // load block 01
110 | byte[] data_block_01 = new byte[header.block_01_size];
111 | Array.Copy(data, header.block_01_start_offset, data_block_01, 0, header.block_01_size);
112 | // load block_01 binary data into class instance
113 | block_01 = new block_01(data_block_01);
114 |
115 |
116 | // load block_02
117 | byte[] data_block_02 = new byte[header.block_02_size];
118 | Array.Copy(data, header.block_02_start_offset, data_block_02, 0, header.block_02_size);
119 | // load block_02 binary data into class instance
120 | block_02 = new block_02(data_block_02);
121 |
122 |
123 | #if DEBUG
124 |
125 | if (export_data)
126 | {
127 | string export_dir = debug_data_export_dir + Path.GetFileNameWithoutExtension(stage_bin_filepath).Split('_')[0] + "\\";
128 |
129 | // export collision meshes
130 | block_00.export_all_collision_meshes(debug_data_export_dir);
131 |
132 | //block_00.export_all_collision_meshes(export_dir + "\\coll\\");
133 |
134 | // exports single collision model
135 | //export_coll_mesh(export_dir + "\\coll\\", 14, 3);
136 |
137 | // export grind paths
138 | block_01.export_grind_path_data(export_dir + "grind_paths.txt");
139 | //block_01.export_grind_path_data_blender(export_dir + "grind_paths_blender.obj");
140 |
141 | // export PVS
142 | block_02.export_PVS_data(export_dir);
143 | }
144 |
145 | #endif
146 | }
147 |
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\DataFormats\JSRF\Compilers\Data\block_02_base.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Graphics\jsrf_soul_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.2.7.0/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Helix Toolkit
4 |
5 | **Helix Toolkit is a collection of 3D components for .NET Framework.**
6 |
7 | [**HelixToolkit.WPF:**](/Source/HelixToolkit.Wpf)
8 | Adds variety of functionalities/models on the top of internal WPF 3D model (Media3D namespace).
9 |
10 | [**HelixToolkit.SharpDX.WPF:**](/Source/HelixToolkit.Wpf.SharpDX)
11 | 3D Components and XAML/MVVM compatible Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for high performance usage.
12 |
13 | [**HelixToolkit.UWP:**](/Source/HelixToolkit.UWP)
14 | 3D Components and XAML/MVVM compatible Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for Universal Windows App.
15 |
16 | [**HelixToolkit.SharpDX.Core:**](/Source/HelixToolkit.SharpDX.Core)
17 | 3D Components and Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for netstandard and .NET Core.
18 |
19 | [**HelixToolkit.SharpDX.Assimp:**](/Source/HelixToolkit.Wpf.SharpDX.Assimp)
20 | [Assimp.Net](https://bitbucket.org/Starnick/assimpnet/src/master/) 3D model importer/expoter support for HelixToolkit.SharpDX Components.
21 |
22 | [**Examples:**](/develop/Source/Examples)
23 | Please download full source code to run examples. Or download [compiled version](https://ci.appveyor.com/project/objorke/helix-toolkit/branch/develop/artifacts)
24 |
25 | [](https://github.com/helix-toolkit/helix-toolkit/blob/develop/LICENSE)
26 | [](https://ci.appveyor.com/project/objorke/helix-toolkit)
27 | [](https://www.nuget.org/packages?q=Helix-Toolkit)
28 | [](https://gitter.im/helix-toolkit/helix-toolkit)
29 |
30 | Description | Value
31 | --------------------|-----------------------
32 | Web page | http://helix-toolkit.github.io/
33 | Wiki | https://github.com/helix-toolkit/helix-toolkit/wiki
34 | Documentation | http://helix-toolkit.readthedocs.io/
35 | Chat | https://gitter.im/helix-toolkit/helix-toolkit
36 | Source repository | http://github.com/helix-toolkit/helix-toolkit
37 | Latest build | http://ci.appveyor.com/project/objorke/helix-toolkit
38 | Issue tracker | http://github.com/helix-toolkit/helix-toolkit/issues
39 | NuGet packages | http://www.nuget.org/packages?q=HelixToolkit
40 | MyGet feed | https://www.myget.org/F/helix-toolkit
41 | StackOverflow | http://stackoverflow.com/questions/tagged/helix-3d-toolkit
42 | Twitter | https://twitter.com/hashtag/Helix3DToolkit
43 |
44 | ## Project Build
45 |
46 | **Visual Studio 2017. Windows 10 SDK (Min Ver.10.0.10586.0).**
47 |
48 | **Missing `.cso` error during the build?** Windows 10 SDK **Ver.10.0.10586.0** can be selected and installed using Visual Studio 2017 installer. If you already installed the higher SDK version, please change the target version in **HelixToolkit.Native.ShaderBuilder** property to the version installed on your machine.
49 |
50 | ## Notes
51 |
52 | #### 1. Right-handed Cartesian coordinate system and row major matrix by default
53 | HelixToolkit default is using right-handed Cartesian coordinate system, including Meshbuilder etc. To use left-handed Cartesian coordinate system (Camera.CreateLeftHandedSystem = true), user must manually correct the triangle winding order or IsFrontCounterClockwise in raster state description if using SharpDX. Matrices are row major by default.
54 |
55 | #### 2. Performance [Topics](https://github.com/helix-toolkit/helix-toolkit/wiki/Tips-on-performance-optimization-(WPF.SharpDX-and-UWP)) for WPF.SharpDX and UWP.
56 |
57 | #### 3. Following features are not supported currently on FeatureLevel 10 graphics card:
58 | FXAA, Order Independant Transparent Rendering, Particle system, Tessellation.
59 |
60 | #### 4. [Wiki](https://github.com/helix-toolkit/helix-toolkit/wiki) and useful [External Resources](https://github.com/helix-toolkit/helix-toolkit/wiki/External-References) on Computer Graphics.
61 |
62 | ## News
63 | #### 2019-02-16
64 | [v2.6.1](https://github.com/helix-toolkit/helix-toolkit/tree/release/2.6.1) releases are available on nuget. [Release Note](/CHANGELOG.md)
65 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.6.1)
66 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.6.1)
67 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.6.1)
68 | - [SharpDX.Core](https://www.nuget.org/packages/HelixToolkit.SharpDX.Core/2.6.1)
69 | - [SharpDX.Assimp](https://www.nuget.org/packages/HelixToolkit.SharpDX.Assimp/2.6.1)
70 |
71 | #### 2019-01-04
72 | [v2.6.0](https://github.com/helix-toolkit/helix-toolkit/tree/release/2.6.0) releases are available on nuget. [Release Note](/CHANGELOG.md)
73 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.6.0)
74 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.6.0)
75 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.6.0)
76 | - [SharpDX.Core](https://www.nuget.org/packages/HelixToolkit.SharpDX.Core/2.6.0)
77 | - [SharpDX.Assimp](https://www.nuget.org/packages/HelixToolkit.SharpDX.Assimp/2.6.0)
78 |
79 | **Two new packages have been released on version 2.6.0.**
80 | - `SharpDX.Core` is the base implementation for all HelixToolkit.SharpDX versions(WPF.SharpDX and UWP). It is implemented based on `netstandard` and can be used on other platforms such as WinForms and DotNetCore.
81 | - `SharpDX.Assimp` ports [Assimp.Net](https://bitbucket.org/Starnick/assimpnet/src/master/) into HelixToolkit to support 3D model import/export for HelixToolkit.SharpDX versions. Currently import/export supports [SceneNode](https://github.com/helix-toolkit/helix-toolkit/wiki/Use-Element3D-or-SceneNode-under-WPF.SharpDX-or-UWP) only. For more details, please refer to [FileLoadDemo](/Source/Examples/WPF.SharpDX/FileLoadDemo) or [CoreTest](/Source/Examples/SharpDX.Core/CoreTest).
82 |
83 |
84 | #### 2018-10-19
85 | [V2.5.1](https://github.com/helix-toolkit/helix-toolkit/tree/hotfix/2.5.0) releases are available on nuget. [Release Note](/CHANGELOG.md)
86 |
87 | **Hotfix: Wrong type cast causes null reference exception when uses custom ViewBox texture.** (SharpDX Version Only)
88 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.5.1)
89 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.5.1)
90 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.5.1)
91 |
92 | #### Changes (Please refer to [Release Note](https://github.com/helix-toolkit/helix-toolkit/blob/master/CHANGELOG.md) for details)
93 |
94 | ##### Note: 2.0 Breaking changes from version 1.x.x. (HelixToolkit.SharpDX only) see [ChangeLog](/CHANGELOG.md)
95 |
--------------------------------------------------------------------------------
/packages/HelixToolkit.Wpf.2.7.0/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Helix Toolkit
4 |
5 | **Helix Toolkit is a collection of 3D components for .NET Framework.**
6 |
7 | [**HelixToolkit.WPF:**](/Source/HelixToolkit.Wpf)
8 | Adds variety of functionalities/models on the top of internal WPF 3D model (Media3D namespace).
9 |
10 | [**HelixToolkit.SharpDX.WPF:**](/Source/HelixToolkit.Wpf.SharpDX)
11 | 3D Components and XAML/MVVM compatible Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for high performance usage.
12 |
13 | [**HelixToolkit.UWP:**](/Source/HelixToolkit.UWP)
14 | 3D Components and XAML/MVVM compatible Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for Universal Windows App.
15 |
16 | [**HelixToolkit.SharpDX.Core:**](/Source/HelixToolkit.SharpDX.Core)
17 | 3D Components and Scene Graphs based on [SharpDX](https://github.com/sharpdx/SharpDX)(DirectX 11) for netstandard and .NET Core.
18 |
19 | [**HelixToolkit.SharpDX.Assimp:**](/Source/HelixToolkit.Wpf.SharpDX.Assimp)
20 | [Assimp.Net](https://bitbucket.org/Starnick/assimpnet/src/master/) 3D model importer/expoter support for HelixToolkit.SharpDX Components.
21 |
22 | [**Examples:**](/develop/Source/Examples)
23 | Please download full source code to run examples. Or download [compiled version](https://ci.appveyor.com/project/objorke/helix-toolkit/branch/develop/artifacts)
24 |
25 | [](https://github.com/helix-toolkit/helix-toolkit/blob/develop/LICENSE)
26 | [](https://ci.appveyor.com/project/objorke/helix-toolkit)
27 | [](https://www.nuget.org/packages?q=Helix-Toolkit)
28 | [](https://gitter.im/helix-toolkit/helix-toolkit)
29 |
30 | Description | Value
31 | --------------------|-----------------------
32 | Web page | http://helix-toolkit.github.io/
33 | Wiki | https://github.com/helix-toolkit/helix-toolkit/wiki
34 | Documentation | http://helix-toolkit.readthedocs.io/
35 | Chat | https://gitter.im/helix-toolkit/helix-toolkit
36 | Source repository | http://github.com/helix-toolkit/helix-toolkit
37 | Latest build | http://ci.appveyor.com/project/objorke/helix-toolkit
38 | Issue tracker | http://github.com/helix-toolkit/helix-toolkit/issues
39 | NuGet packages | http://www.nuget.org/packages?q=HelixToolkit
40 | MyGet feed | https://www.myget.org/F/helix-toolkit
41 | StackOverflow | http://stackoverflow.com/questions/tagged/helix-3d-toolkit
42 | Twitter | https://twitter.com/hashtag/Helix3DToolkit
43 |
44 | ## Project Build
45 |
46 | **Visual Studio 2017. Windows 10 SDK (Min Ver.10.0.10586.0).**
47 |
48 | **Missing `.cso` error during the build?** Windows 10 SDK **Ver.10.0.10586.0** can be selected and installed using Visual Studio 2017 installer. If you already installed the higher SDK version, please change the target version in **HelixToolkit.Native.ShaderBuilder** property to the version installed on your machine.
49 |
50 | ## Notes
51 |
52 | #### 1. Right-handed Cartesian coordinate system and row major matrix by default
53 | HelixToolkit default is using right-handed Cartesian coordinate system, including Meshbuilder etc. To use left-handed Cartesian coordinate system (Camera.CreateLeftHandedSystem = true), user must manually correct the triangle winding order or IsFrontCounterClockwise in raster state description if using SharpDX. Matrices are row major by default.
54 |
55 | #### 2. Performance [Topics](https://github.com/helix-toolkit/helix-toolkit/wiki/Tips-on-performance-optimization-(WPF.SharpDX-and-UWP)) for WPF.SharpDX and UWP.
56 |
57 | #### 3. Following features are not supported currently on FeatureLevel 10 graphics card:
58 | FXAA, Order Independant Transparent Rendering, Particle system, Tessellation.
59 |
60 | #### 4. [Wiki](https://github.com/helix-toolkit/helix-toolkit/wiki) and useful [External Resources](https://github.com/helix-toolkit/helix-toolkit/wiki/External-References) on Computer Graphics.
61 |
62 | ## News
63 | #### 2019-02-16
64 | [v2.6.1](https://github.com/helix-toolkit/helix-toolkit/tree/release/2.6.1) releases are available on nuget. [Release Note](/CHANGELOG.md)
65 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.6.1)
66 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.6.1)
67 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.6.1)
68 | - [SharpDX.Core](https://www.nuget.org/packages/HelixToolkit.SharpDX.Core/2.6.1)
69 | - [SharpDX.Assimp](https://www.nuget.org/packages/HelixToolkit.SharpDX.Assimp/2.6.1)
70 |
71 | #### 2019-01-04
72 | [v2.6.0](https://github.com/helix-toolkit/helix-toolkit/tree/release/2.6.0) releases are available on nuget. [Release Note](/CHANGELOG.md)
73 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.6.0)
74 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.6.0)
75 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.6.0)
76 | - [SharpDX.Core](https://www.nuget.org/packages/HelixToolkit.SharpDX.Core/2.6.0)
77 | - [SharpDX.Assimp](https://www.nuget.org/packages/HelixToolkit.SharpDX.Assimp/2.6.0)
78 |
79 | **Two new packages have been released on version 2.6.0.**
80 | - `SharpDX.Core` is the base implementation for all HelixToolkit.SharpDX versions(WPF.SharpDX and UWP). It is implemented based on `netstandard` and can be used on other platforms such as WinForms and DotNetCore.
81 | - `SharpDX.Assimp` ports [Assimp.Net](https://bitbucket.org/Starnick/assimpnet/src/master/) into HelixToolkit to support 3D model import/export for HelixToolkit.SharpDX versions. Currently import/export supports [SceneNode](https://github.com/helix-toolkit/helix-toolkit/wiki/Use-Element3D-or-SceneNode-under-WPF.SharpDX-or-UWP) only. For more details, please refer to [FileLoadDemo](/Source/Examples/WPF.SharpDX/FileLoadDemo) or [CoreTest](/Source/Examples/SharpDX.Core/CoreTest).
82 |
83 |
84 | #### 2018-10-19
85 | [V2.5.1](https://github.com/helix-toolkit/helix-toolkit/tree/hotfix/2.5.0) releases are available on nuget. [Release Note](/CHANGELOG.md)
86 |
87 | **Hotfix: Wrong type cast causes null reference exception when uses custom ViewBox texture.** (SharpDX Version Only)
88 | - [WPF](https://www.nuget.org/packages/HelixToolkit.Wpf/2.5.1)
89 | - [WPF.SharpDX](https://www.nuget.org/packages/HelixToolkit.Wpf.SharpDX/2.5.1)
90 | - [UWP](https://www.nuget.org/packages/HelixToolkit.UWP/2.5.1)
91 |
92 | #### Changes (Please refer to [Release Note](https://github.com/helix-toolkit/helix-toolkit/blob/master/CHANGELOG.md) for details)
93 |
94 | ##### Note: 2.0 Breaking changes from version 1.x.x. (HelixToolkit.SharpDX only) see [ChangeLog](/CHANGELOG.md)
95 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Color.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace JSRF_ModTool.MDLB_Import
2 | {
3 | partial class Color
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.txtb_R = new System.Windows.Forms.TextBox();
32 | this.txtb_G = new System.Windows.Forms.TextBox();
33 | this.txtb_B = new System.Windows.Forms.TextBox();
34 | this.txtb_A = new System.Windows.Forms.TextBox();
35 | this.label1 = new System.Windows.Forms.Label();
36 | this.label2 = new System.Windows.Forms.Label();
37 | this.label3 = new System.Windows.Forms.Label();
38 | this.label4 = new System.Windows.Forms.Label();
39 | this.SuspendLayout();
40 | //
41 | // txtb_R
42 | //
43 | this.txtb_R.Location = new System.Drawing.Point(4, 21);
44 | this.txtb_R.Name = "txtb_R";
45 | this.txtb_R.Size = new System.Drawing.Size(34, 20);
46 | this.txtb_R.TabIndex = 0;
47 | this.txtb_R.Text = "255";
48 | this.txtb_R.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
49 | this.txtb_R.TextChanged += new System.EventHandler(this.txtb_numeric_TextChanged);
50 | this.txtb_R.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_numeric_KeyPress);
51 | //
52 | // txtb_G
53 | //
54 | this.txtb_G.Location = new System.Drawing.Point(43, 21);
55 | this.txtb_G.Name = "txtb_G";
56 | this.txtb_G.Size = new System.Drawing.Size(34, 20);
57 | this.txtb_G.TabIndex = 1;
58 | this.txtb_G.Text = "255";
59 | this.txtb_G.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
60 | this.txtb_G.TextChanged += new System.EventHandler(this.txtb_numeric_TextChanged);
61 | this.txtb_G.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_numeric_KeyPress);
62 | //
63 | // txtb_B
64 | //
65 | this.txtb_B.Location = new System.Drawing.Point(83, 21);
66 | this.txtb_B.Name = "txtb_B";
67 | this.txtb_B.Size = new System.Drawing.Size(34, 20);
68 | this.txtb_B.TabIndex = 2;
69 | this.txtb_B.Text = "255";
70 | this.txtb_B.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
71 | this.txtb_B.TextChanged += new System.EventHandler(this.txtb_numeric_TextChanged);
72 | this.txtb_B.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_numeric_KeyPress);
73 | //
74 | // txtb_A
75 | //
76 | this.txtb_A.Location = new System.Drawing.Point(124, 21);
77 | this.txtb_A.Name = "txtb_A";
78 | this.txtb_A.Size = new System.Drawing.Size(34, 20);
79 | this.txtb_A.TabIndex = 3;
80 | this.txtb_A.Text = "255";
81 | this.txtb_A.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
82 | this.txtb_A.TextChanged += new System.EventHandler(this.txtb_numeric_TextChanged);
83 | this.txtb_A.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_numeric_KeyPress);
84 | //
85 | // label1
86 | //
87 | this.label1.AutoSize = true;
88 | this.label1.Location = new System.Drawing.Point(14, 5);
89 | this.label1.Name = "label1";
90 | this.label1.Size = new System.Drawing.Size(15, 13);
91 | this.label1.TabIndex = 1;
92 | this.label1.Text = "R";
93 | //
94 | // label2
95 | //
96 | this.label2.AutoSize = true;
97 | this.label2.Location = new System.Drawing.Point(53, 5);
98 | this.label2.Name = "label2";
99 | this.label2.Size = new System.Drawing.Size(15, 13);
100 | this.label2.TabIndex = 1;
101 | this.label2.Text = "G";
102 | //
103 | // label3
104 | //
105 | this.label3.AutoSize = true;
106 | this.label3.Location = new System.Drawing.Point(93, 5);
107 | this.label3.Name = "label3";
108 | this.label3.Size = new System.Drawing.Size(14, 13);
109 | this.label3.TabIndex = 1;
110 | this.label3.Text = "B";
111 | //
112 | // label4
113 | //
114 | this.label4.AutoSize = true;
115 | this.label4.Location = new System.Drawing.Point(134, 5);
116 | this.label4.Name = "label4";
117 | this.label4.Size = new System.Drawing.Size(14, 13);
118 | this.label4.TabIndex = 1;
119 | this.label4.Text = "A";
120 | //
121 | // Color
122 | //
123 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
124 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
125 | this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
126 | this.Controls.Add(this.label4);
127 | this.Controls.Add(this.label3);
128 | this.Controls.Add(this.label2);
129 | this.Controls.Add(this.label1);
130 | this.Controls.Add(this.txtb_A);
131 | this.Controls.Add(this.txtb_B);
132 | this.Controls.Add(this.txtb_G);
133 | this.Controls.Add(this.txtb_R);
134 | this.Name = "Color";
135 | this.Size = new System.Drawing.Size(164, 45);
136 | this.ResumeLayout(false);
137 | this.PerformLayout();
138 |
139 | }
140 |
141 | #endregion
142 |
143 | private System.Windows.Forms.TextBox txtb_R;
144 | private System.Windows.Forms.TextBox txtb_G;
145 | private System.Windows.Forms.TextBox txtb_B;
146 | private System.Windows.Forms.TextBox txtb_A;
147 | private System.Windows.Forms.Label label1;
148 | private System.Windows.Forms.Label label2;
149 | private System.Windows.Forms.Label label3;
150 | private System.Windows.Forms.Label label4;
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/Functions/DynamicParser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Reflection;
4 | using JSRF_Tool_2.Vector;
5 |
6 | using System.Windows.Media.Media3D;
7 |
8 | namespace JSRF_Tool_2
9 | {
10 |
11 | public class DynamicParser
12 | {
13 |
14 | ///
15 | /// Goes through a class/struct's properties and reads a byte array as typeof, for each property in the class/struct.
16 | ///
17 | ///
18 | /// This is used to load most JSRF classes dynamically.
19 | ///
20 | /// This uses reflection, so the downside is that it may not be as fast as a hard coded method sequential reading of a MemoryStream or BinaryStream.
21 | /// However the advantage of using this class to load file structures and data is that this allows flexibility since we can modify/restructure the
22 | /// class/struct properties at any time and it will still load with this method.
23 | ///
24 | /// Once the JSRF classes are fully mapped and finalized it might be better (because possibly faster to load) to code a method within the class that
25 | /// uses a stream reader and a hard coded sequence of the properties and type of values to read.
26 | ///
27 | /// TODO: maybe find a way to get the 'typeof' property and automatically convert as type, rather than getting the name as string and going through
28 | /// a bunch of switch statements... this probably slows things down a bit right now.
29 | ///
30 | /// byte array
31 | /// starting position
32 | /// Class/Struct to load byte array as
33 | ///
34 | public static Object binary_to_struct(byte[] bytes, int start_pos, Type objType)
35 | {
36 | // create instance of object from objType
37 | Object obj = Activator.CreateInstance(objType);
38 |
39 | int i = start_pos;
40 |
41 | foreach (PropertyInfo prop in obj.GetType().GetProperties())
42 | {
43 | Object value = new Object();
44 | value = prop.GetValue(obj, null);
45 | string t = prop.PropertyType.Name;
46 |
47 | //if (i > bytes.Length) { System.Windows.Forms.MessageBox.Show("binary_to_struct() : Index out of range."); return obj; }
48 |
49 | switch (t)
50 | {
51 | case "Int32":
52 | prop.SetValue(obj, BitConverter.ToInt32(bytes, i), null);
53 | i += 4;
54 | break;
55 | case "UInt32":
56 | prop.SetValue(obj, BitConverter.ToUInt32(bytes, i), null);
57 | i += 4;
58 | break;
59 |
60 | case "Int16":
61 | prop.SetValue(obj, BitConverter.ToInt16(bytes, i), null);
62 | i += 2;
63 | break;
64 | case "UInt16":
65 | prop.SetValue(obj, BitConverter.ToUInt16(bytes, i), null);
66 | i += 4;
67 | break;
68 |
69 | case "Single":
70 | prop.SetValue(obj, BitConverter.ToSingle(bytes, i), null);
71 | i += 4;
72 | break;
73 |
74 | case "float":
75 | prop.SetValue(obj, BitConverter.ToSingle(bytes, i), null);
76 | i += 4;
77 | break;
78 |
79 | case "Byte":
80 | prop.SetValue(obj, bytes[i], null);
81 | i += 1;
82 | break;
83 |
84 | case "Point3D":
85 | prop.SetValue(obj, brReadPoint3D(bytes, 3, i), null);
86 | i += 12;
87 | break;
88 |
89 | case "Vector3D":
90 | prop.SetValue(obj, brReadVector(bytes, 3, i), null);
91 | i += 12;
92 | break;
93 |
94 | case "Vector3":
95 | prop.SetValue(obj, brReadVector(bytes, 3, i), null);
96 | i += 12;
97 | break;
98 | case "Vector2":
99 | prop.SetValue(obj, brReadVector(bytes, 2, i), null);
100 | i += 8;
101 | break;
102 | case "Vector4":
103 | prop.SetValue(obj, brReadVector(bytes, 4, i), null);
104 | i += 16;
105 | break;
106 |
107 | case "color":
108 | prop.SetValue(obj, brReadColor(bytes, i), null);
109 | i += 4;
110 | break;
111 |
112 | case "String":
113 | int length = prop.GetValue(obj, null).ToString().Length;
114 | if(bytes.Length == 0)
115 | {
116 | break;
117 | }
118 | prop.SetValue(obj, Encoding.UTF8.GetString(bytes, i, length).Trim('\0'), null);
119 | i += length;
120 | break;
121 | }
122 | }
123 |
124 | return obj;
125 | }
126 |
127 |
128 |
129 | ///
130 | /// read byte array as as floats and returns as a Point3D
131 | ///
132 | /// byte array
133 | /// vector type
134 | /// position
135 | ///
136 | public static object brReadPoint3D(byte[] bytes, int vNum, int i)
137 | {
138 | if (vNum == 3)
139 | {
140 | Point3D tmpvector = new Point3D(0, 0, 0);
141 | tmpvector.X = BitConverter.ToSingle(bytes, i);
142 | tmpvector.Y = BitConverter.ToSingle(bytes, i + 4);
143 | tmpvector.Z = BitConverter.ToSingle(bytes, i + 8);
144 |
145 | return tmpvector;
146 | }
147 | else
148 | {
149 | Point3D tmpvector = new Point3D(0, 0, 0);
150 | return tmpvector;
151 | }
152 | }
153 |
154 |
155 | ///
156 | /// read byte array as as floats and returns as a Vector3D
157 | ///
158 | /// byte array
159 | /// position
160 | ///
161 | public static Vector3D brReadVector3D(byte[] bytes, int i)
162 | {
163 | return new Vector3D(BitConverter.ToSingle(bytes, i), BitConverter.ToSingle(bytes, i + 4), BitConverter.ToSingle(bytes, i + 8));
164 | }
165 |
166 | ///
167 | /// read byte array as series floats and returns as a VectorT
168 | ///
169 | /// byte array
170 | /// type of Vector
171 | /// position
172 | ///
173 | public static object brReadVector(byte[] bytes, int vNum, int i)
174 | {
175 | if (vNum == 3)
176 | {
177 | Vector3 tmpvector = new Vector3(0,0,0);
178 | tmpvector.X = BitConverter.ToSingle(bytes, i);
179 | tmpvector.Y = BitConverter.ToSingle(bytes, i + 4);
180 | tmpvector.Z = BitConverter.ToSingle(bytes, i + 8);
181 |
182 | return tmpvector;
183 | }
184 | else if (vNum == 4)
185 | {
186 | Vector4 tmpvector = new Vector4();
187 | tmpvector.X = BitConverter.ToSingle(bytes, i);
188 | tmpvector.Y = BitConverter.ToSingle(bytes, i + 4);
189 | tmpvector.Z = BitConverter.ToSingle(bytes, i + 8);
190 | tmpvector.W = BitConverter.ToSingle(bytes, i + 12);
191 |
192 | return tmpvector;
193 | }
194 | else if (vNum == 2)
195 | {
196 |
197 | Vector2 tmpvector = new Vector2();
198 | tmpvector.X = BitConverter.ToSingle(bytes, i);
199 | tmpvector.Y = BitConverter.ToSingle(bytes, i + 4);
200 |
201 | return tmpvector;
202 | }
203 | else
204 | {
205 |
206 | return new Vector3(0,0,0);
207 | }
208 | }
209 |
210 |
211 | public static DataFormats.JSRF.MDLB.color brReadColor(byte[] bytes, int i)
212 | {
213 | return new DataFormats.JSRF.MDLB.color(bytes[i], bytes[i+1], bytes[i+2], bytes[i+3]);
214 | }
215 |
216 | }
217 | }
218 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/mission_dat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using JSRF_ModTool.Vector;
6 | using JSRF_ModTool.Functions;
7 |
8 | namespace JSRF_ModTool.DataFormats.JSRF
9 | {
10 | class Mission_dat
11 | {
12 | private string debug_data_export_dir = @"C:\Users\Mike\Desktop\JSRF\research\Mission_dat\";
13 |
14 | // contains list of 3D models
15 | // which are grafftis pre-calculated projection planes, the mesh of a plane projected onto the Stage visual model, slightly offset over the surface of the stage visual mesh
16 | // these meshes pick up *some* topology from the stage visual mesh and seem to be cut into vertical rectangular slices divided into the graffiti circle spray parts
17 | public List models { get; set; }
18 | private string filename;
19 |
20 | // read and extract mission.dat graffiti projection meshes (in .obj) and their position + rotation matrix (in .xyz)
21 | public Mission_dat(string filepath)
22 | {
23 | List transform_lines = new List();
24 | filename = System.IO.Path.GetFileNameWithoutExtension(filepath);
25 | this.models = new List();
26 |
27 | byte[] data = Parsing.FileToByteArray(filepath, 0);
28 |
29 | int i = 0;
30 | int count = 0;
31 | model mdl;
32 | while (i < data.Length)
33 | {
34 | transform_lines = new List();
35 |
36 | // if file is empty (if it starts with: FFFFFFFF 000000000000000000000000)
37 | if (BitConverter.ToInt32(data, i) == -1)
38 | {
39 | break;
40 | }
41 | mdl = new model();
42 | // load binary to class
43 | mdl = (model)(Parsing.binary_to_struct(data, i, typeof(model)));
44 |
45 | //List verts_str_list = new List();
46 | int vert_startoff = i + 272;
47 | // load vertices to list
48 | for (int v = vert_startoff; v < vert_startoff + (mdl._248_vertex_count * mdl._256_vertex_def_size); v+= mdl._256_vertex_def_size)
49 | {
50 | mdl.vertices.Add((Vector3)(Parsing.binary_to_struct(data, v + 4, typeof(Vector3))));
51 | //verts_str_list.Add(mdl.vertices[mdl.vertices.Count - 1].X + " " + mdl.vertices[mdl.vertices.Count - 1].Y + " " + mdl.vertices[mdl.vertices.Count - 1].Z);
52 | }
53 |
54 | //System.IO.File.WriteAllLines(@"C:\Users\Mike\Desktop\JSRF\research\Mission_dat\vertices.txt", verts_str_list);
55 |
56 | int tri_startoff = i + 96 + mdl._260_triangle_buffer_startoff;
57 |
58 | // load triangle indices to list
59 | for (int t = tri_startoff; t < (tri_startoff + mdl._264_triangle_count * 2) ; t +=2)
60 | {
61 | mdl.triangles.Add(BitConverter.ToInt16(data, t));
62 | }
63 |
64 | this.models.Add(mdl);
65 |
66 | i += mdl._04_total_size;
67 | transform_lines.Add(mdl.position.X + " " + mdl.position.Y + " " + mdl.position.Z);
68 | transform_lines.Add(mdl.matrix_a1.X + " " + mdl.matrix_a1.Y + " " + mdl.matrix_a1.Z);
69 | transform_lines.Add(mdl.matrix_a2.X + " " + mdl.matrix_a2.Y + " " + mdl.matrix_a2.Z);
70 | transform_lines.Add(mdl.matrix_a3.X + " " + mdl.matrix_a3.Y + " " + mdl.matrix_a3.Z);
71 |
72 | // mesh's matrix 3 transform data export
73 | System.IO.File.WriteAllLines(debug_data_export_dir + filename + "\\" + filename + "_" + count + ".xyz", transform_lines);
74 | count++;
75 | }
76 | // mesh data export
77 | export_models(debug_data_export_dir);
78 | }
79 |
80 | public void export_models(string directory)
81 | {
82 | List obj;
83 | for (int i = 0; i < models.Count; i++)
84 | {
85 | model mdl = models[i];
86 | obj = new List();
87 |
88 | obj.Add("o " + filename + "__" + i);
89 |
90 | for (int v = 0; v < mdl.vertices.Count; v++)
91 | {
92 | obj.Add("v " + mdl.vertices[v].X + " " + mdl.vertices[v].Y + " " + mdl.vertices[v].Z);
93 | }
94 |
95 |
96 | for (int t = 0; t < mdl.triangles.Count -2; t+=3)
97 | {
98 | obj.Add("f " + (int)(mdl.triangles[t] + 1) + " " + (int)(mdl.triangles[t + 1] + 1) + " " + (int)(mdl.triangles[t + 2] + 1));
99 | }
100 |
101 | //System.IO.Directory.CreateDirectory(directory + filename + "\\" + filename);
102 | System.IO.File.WriteAllLines(directory + filename + "\\" + filename + "_" + i + ".obj", obj);
103 | }
104 | }
105 |
106 | public class model
107 | {
108 | public Int32 _00_ID { get; set; }
109 | public Int32 _04_total_size { get; set; } // size of whole block of data header + vertex/index buffers
110 | public Int32 _08_count { get; set; }
111 | public Int32 _12_unk { get; set; }
112 |
113 | public Vector3 matrix_a1 { get; set; }
114 | public float _unk_float_va1 { get; set; }
115 | public Vector3 matrix_a2 { get; set; }
116 | public float _unk_float_va2 { get; set; }
117 | public Vector3 matrix_a3 { get; set; }
118 | public float _unk_float_va3 { get; set; }
119 | public Vector3 position { get; set; }
120 | public float _unk_float_pos { get; set; }
121 |
122 | public Int32 _080_unk { get; set; }
123 | public Int32 _084_unk { get; set; } // set to 1
124 | public Int32 _088_unk { get; set; }
125 | public Int32 _092_unk { get; set; }
126 |
127 | public Int32 _096_unk { get; set; } // set to 148
128 | public Int32 _100_unk { get; set; } // set to 128
129 | public Int32 _104_unk { get; set; }
130 | public Int32 _108_unk { get; set; }
131 |
132 | public Int32 _112_unk { get; set; } // unk might be two int16 the second giving a count or size? or an int32 ID
133 | public Vector3 _116_unk { get; set; }
134 |
135 | //public byte[] padding { get; set; }
136 |
137 | /// padding
138 |
139 | public Int32 _99_a { get; set; } // = padding
140 | public Int32 _999_b { get; set; } // = padding
141 | public Int32 _999_c { get; set; } // = padding
142 | public Int32 _999_d { get; set; } // = padding
143 |
144 | public Int32 _99_ab { get; set; } // = padding
145 | public Int32 _999_bb { get; set; } // = padding
146 | public Int32 _999_cb { get; set; } // = padding
147 | public Int32 _999_db { get; set; } // = padding
148 |
149 | public Int32 _99_ac { get; set; } // = padding
150 | public Int32 _999_cc { get; set; } // = padding
151 | public Int32 _999_ccg { get; set; } // = padding
152 | public Int32 _999_dc { get; set; } // = padding
153 |
154 | public Int32 _99_ad { get; set; } // = padding
155 | public Int32 _999_bd { get; set; } // = padding
156 | public Int32 _999_cd { get; set; } // = padding
157 | public Int32 _999_dd { get; set; } // = padding
158 |
159 | public Int32 _99_ae { get; set; } // = padding
160 | public Int32 _999_be { get; set; } // = padding
161 | public Int32 _999_ce { get; set; } // = padding
162 | public Int32 _999_de { get; set; } // = padding
163 |
164 | public Int32 _99_af { get; set; } // = padding
165 | public Int32 _999_bf { get; set; } // = padding
166 | public Int32 _999_cf { get; set; } // = padding
167 | public Int32 _999_df { get; set; } // = padding
168 |
169 |
170 |
171 |
172 |
173 | public Int32 _224_flag{ get; set; } // = 0xFFFFFFFF
174 | public Int32 _228_unk { get; set; }
175 | public Int32 _232_unk { get; set; }
176 | public Int32 _236_unk { get; set; }
177 |
178 | // vertex / triangles buffers headers / info
179 | public Int32 _240_unk { get; set; }
180 | public Int32 _244_unk { get; set; } // 180
181 | public Int32 _248_vertex_count { get; set; }
182 | public Int32 _252_unk { get; set; }
183 |
184 | public Int32 _256_vertex_def_size { get; set; } // often 32
185 | public Int32 _260_triangle_buffer_startoff { get; set; } // add + 128 to get real pos
186 | public Int32 _264_triangle_count{ get; set; } // multiply by 2 to get real bytes size
187 | public Int32 _268_unk { get; set; }
188 |
189 |
190 | public List vertices { get; set; }
191 | public List triangles { get; set; }
192 |
193 | public model()
194 | {
195 | vertices = new List();
196 | triangles = new List();
197 | // this.padding = new byte[96];
198 | }
199 |
200 | }
201 |
202 |
203 | }
204 | }
205 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Stage_Data_Metrics.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 |
5 | namespace JSRF_ModTool.DataFormats.JSRF
6 | {
7 | internal class Stage_Data_Metrics
8 | {
9 | public List stages_info { get; set; }
10 |
11 | public int average_models_count_per_stage { get; set; }
12 | public int average_triangles_count_per_stage { get; set; }
13 | public int average_textures_count_per_stage { get; set; }
14 |
15 | public int max_models_count_per_stage { get; set; }
16 | public int max_triangles_count_per_stage { get; set; }
17 | public int max_textures_count_per_stage { get; set; }
18 |
19 | public string max_models_count_stage_number { get; set; }
20 | public string max_triangles_count_stage_number { get; set; }
21 | public string max_textures_count_stage_number { get; set; }
22 |
23 |
24 | ///
25 | /// Loads \Stage\StgXX_YY.dat files given the first (YY = 00) StgXX_YY.dat and loads all other YY.dat (StgXX_01 StgXX_02 StgXX_03 etc) files
26 | /// and for each file gets the statistics (triangles count, textures count etc)
27 | /// as well as calculating the total sum of these stats, per file, and for all the files of the Stage and the total average for each Stage
28 | ///
29 | public Stage_Data_Metrics(string stages_dir)
30 | {
31 | stages_info = new List();
32 |
33 |
34 | int f_pos = 0;
35 | stages_info = new List();
36 | // for every file in Stage directory (and subdirectories)
37 | foreach (string file in Directory.EnumerateFiles(stages_dir, "*.dat", SearchOption.AllDirectories))
38 | {
39 | string filepath = Path.GetDirectoryName(file) + "\\";
40 | string filename = Path.GetFileNameWithoutExtension(file);
41 |
42 | // skip files that are not StgXX_00 (we only pick the first StgXX_YY.dat file part (_00))
43 | if (!filename.ToLower().Contains("stg") || !filename.Contains("_00"))
44 | {
45 | continue;
46 | }
47 |
48 | #region for each YY file part of StgXX_YY
49 |
50 | string stage_num = filename.Split('_')[0];
51 |
52 | stages_info.Add(new stage_info(stage_num));
53 |
54 |
55 | // for each stage part [i] ( StgXX_00 to StgXX_08)
56 | for (int i = 0; i < 9; i++)
57 | {
58 | stages_info[stages_info.Count - 1].total_stage_file_parts += 1;
59 |
60 | Int32 stage_part_num = Int32.Parse(filename.Split('_')[1]);
61 | string stg_part_filepath = filepath + stage_num + "_0" + i + ".dat";
62 |
63 | // if StageXX_YY.dat file part doesn't exist, break loop so we skip to the next StgXX_00.dat
64 | if (!File.Exists(stg_part_filepath))
65 | {
66 | break;
67 | }
68 |
69 | // load file
70 | File_Containers jsrf_file = new File_Containers(stg_part_filepath);
71 |
72 | // if file structure is not of container type "indexed" skip to next file
73 | if (jsrf_file.type != File_Containers.container_types.indexed) { continue; }
74 |
75 | stages_info[f_pos].stage_parts.Add(new Stage_part_file());
76 |
77 | // for each item contained
78 | for (int j = 0; j < jsrf_file.INDX_root.items.Count; j++)
79 | {
80 | File_Containers.item item = jsrf_file.INDX_root.items[j];
81 |
82 | // if it's a stage model
83 | if (item.type == File_Containers.item_data_type.Stage_Model)
84 | {
85 | stages_info[f_pos].stage_parts[i].items.Add(new Stage_part_file.Info(new Stage_Model(item.data)));
86 | stages_info[f_pos].total_triangles_count += stages_info[f_pos].stage_parts[i].items[stages_info[f_pos].stage_parts[i].items.Count - 1].triangle_count;
87 | stages_info[f_pos].total_models_count++;
88 | } // Texture
89 | else if (item.type == File_Containers.item_data_type.Texture)
90 | {
91 | stages_info[f_pos].stage_parts[i].items.Add(new Stage_part_file.Info());
92 | stages_info[f_pos].stage_parts[i].items[stages_info[f_pos].stage_parts[i].items.Count - 1].texture = true;
93 | stages_info[f_pos].total_textures_count++;
94 | } // MDLB
95 | else if (item.type == File_Containers.item_data_type.Stage_MDLB)
96 | {
97 | stages_info[f_pos].stage_parts[i].items.Add(new Stage_part_file.Info());
98 | stages_info[f_pos].stage_parts[i].items[stages_info[f_pos].stage_parts[i].items.Count - 1].MDLB = true;
99 | }
100 | }
101 |
102 | }
103 | stages_info[stages_info.Count - 1].total_stage_file_parts--;
104 | f_pos++;
105 |
106 | #endregion
107 | }
108 |
109 |
110 | int count = 0;
111 | // for each stage, get total stats and add it to the global stats
112 | for (int i = 0; i < stages_info.Count; i++)
113 | {
114 | if(stages_info[i].total_models_count > max_models_count_per_stage)
115 | {
116 | max_models_count_per_stage = stages_info[i].total_models_count;
117 | max_models_count_stage_number = stages_info[i].stage_number;
118 | }
119 |
120 | if (stages_info[i].total_triangles_count > max_triangles_count_per_stage)
121 | {
122 | max_triangles_count_per_stage = stages_info[i].total_triangles_count;
123 | max_triangles_count_stage_number = stages_info[i].stage_number;
124 | }
125 |
126 | if (stages_info[i].total_textures_count > max_textures_count_per_stage)
127 | {
128 | max_textures_count_per_stage = stages_info[i].total_textures_count;
129 | max_textures_count_stage_number = stages_info[i].stage_number;
130 | }
131 |
132 |
133 | average_models_count_per_stage += stages_info[i].total_models_count;
134 | average_triangles_count_per_stage += stages_info[i].total_triangles_count;
135 | average_textures_count_per_stage += stages_info[i].total_textures_count;
136 |
137 |
138 | count++;
139 | }
140 |
141 | // divide to get average stats
142 | average_models_count_per_stage /= count;
143 | average_triangles_count_per_stage /= count;
144 | average_textures_count_per_stage /= count;
145 | }
146 |
147 |
148 |
149 | public class Stage_part_file
150 | {
151 | public int models_count { get; set; }
152 | public int triangles_count { get; set; }
153 | public int textures_count { get; set; }
154 |
155 | public List items { get; set; } = new List();
156 |
157 | public Stage_part_file()
158 | {
159 | items = new List();
160 | }
161 |
162 | public Stage_part_file(Stage_Model lmdl)
163 | {
164 | items = new List();
165 | items.Add(new Info(lmdl));
166 | }
167 |
168 | public class Info
169 | {
170 | public int triangle_count { get; set; }
171 | public int textures_count { get; set; }
172 | // public int materials_count { get; set; } // no need, for stage models, materials_count = texture_count
173 | public bool texture { get; set; }
174 | public bool MDLB { get; set; }
175 |
176 | public Info()
177 | {
178 | }
179 |
180 | public Info(Stage_Model lmdl)
181 | {
182 | this.triangle_count = lmdl.triangles_list.Count;
183 | this.textures_count = lmdl.texture_ids.Count;
184 | // this.materials_count = lmdl.materials_groups.Count;
185 | }
186 | }
187 | }
188 |
189 | public class stage_info
190 | {
191 | public string stage_number { get; set; }
192 |
193 | public int total_models_count { get; set; }
194 | public int total_triangles_count { get; set; }
195 | public int total_textures_count { get; set; }
196 | //public int total_materials_count { get; set; } // no need, for stage models, materials_count = texture_count
197 |
198 | public int total_stage_file_parts { get; set; } // how many _YY.dat there is for a given StgXX_ stage files
199 |
200 | public List stage_parts { get; set; }
201 |
202 | public stage_info(string _stage_number)
203 | {
204 | this.stage_parts = new List();
205 | this.stage_number = _stage_number;
206 | }
207 | }
208 |
209 | }
210 | }
211 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/Vector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 |
6 | namespace JSRF_ModTool.Vector
7 | {
8 | public class Vector2
9 | {
10 | public float X { get; set; }
11 | public float Y { get; set; }
12 |
13 | public Vector2()
14 | {
15 | }
16 |
17 |
18 | // TODO test and if not needed, remove float.Parse() since setVals() already converts string to single
19 | public Vector2(string x, string y)
20 | {
21 | setVals(x, y);
22 | }
23 |
24 |
25 | public Vector2(float x, float y)
26 | {
27 | setVals(x, y);
28 | }
29 |
30 | private void setVals(object x, object y)
31 | {
32 | if (x is string) { X = Convert.ToSingle(x.ToString().Replace(",", ",")); }
33 | if (y is string) { Y = Convert.ToSingle(y.ToString().Replace(",", ",")); }
34 |
35 | if ((x is float) || (x is Single) || (x is int)) { X = Convert.ToSingle(x); }
36 | if ((y is float) || (y is Single) || (y is int)) { Y = Convert.ToSingle(y); }
37 | }
38 | }
39 |
40 | public class Vector3
41 | {
42 | public float X { get; set; }
43 | public float Y { get; set; }
44 | public float Z { get; set; }
45 |
46 | public Vector3()
47 | {
48 | }
49 |
50 | public void round(int digits)
51 | {
52 | this.X = (float)Math.Round(this.X, digits, MidpointRounding.AwayFromZero);
53 | this.Y = (float)Math.Round(this.Y, digits, MidpointRounding.AwayFromZero);
54 | this.Z = (float)Math.Round(this.Z, digits, MidpointRounding.AwayFromZero);
55 | }
56 |
57 |
58 | // as string
59 | public Vector3(string x, string y, string z)
60 | {
61 | setVals(float.Parse(x, CultureInfo.CreateSpecificCulture("en-US")), float.Parse(y, CultureInfo.CreateSpecificCulture("en-US")), float.Parse(z, CultureInfo.CreateSpecificCulture("en-US")));
62 | }
63 |
64 |
65 | // as float
66 | public Vector3(float x, float y, float z)
67 | {
68 | setVals(x, y, z);
69 | }
70 |
71 | // Vector3 substraction
72 | public static Vector3 operator -(Vector3 a, Vector3 b)
73 | {
74 | return new Vector3(b.X - a.X, b.Y - a.Y, b.Z - a.Z);
75 | }
76 | /*
77 | // Vector3 addition
78 | public static Vector3 operator +(Vector3 a, Vector3 b)
79 | {
80 | return new Vector3(b.X + a.X, b.Y + a.Y, b.Z + a.Z);
81 | }
82 | */
83 |
84 | // Vector3 division by float
85 | public static Vector3 operator /(Vector3 a, float d)
86 | {
87 | return new Vector3(a.X / d, a.Y / d, a.Z / d);
88 | }
89 |
90 | // Vector3 multiplication by float
91 | public static Vector3 operator *(Vector3 a, float d)
92 | {
93 | return new Vector3(a.X * d, a.Y * d, a.Z * d);
94 | }
95 |
96 | public override string ToString()
97 | {
98 | return this.X.ToString() + " " + this.Y.ToString() + " " + this.Z.ToString();
99 | }
100 |
101 |
102 | ///
103 | /// converts float to string, also truncate the float precision and use dot instead of comma(with CultureInfo)
104 | ///
105 | //public List Vector_to_StringList(int float_precision, bool to_radians)
106 | //{
107 | // List v = new List();
108 |
109 | // if (!to_radians)
110 | // {
111 | // v.Add(this.X.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
112 | // v.Add(this.Y.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
113 | // v.Add(this.Z.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
114 | // }
115 | // else
116 | // {
117 | // float x = (float)(Math.PI / 180) * this.X;
118 | // float y = (float)(Math.PI / 180) * this.Y;
119 | // float z = (float)(Math.PI / 180) * this.Z;
120 | // v.Add(x.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
121 | // v.Add(y.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
122 | // v.Add(z.ToString("N" + float_precision.ToString(), CultureInfo.CreateSpecificCulture("en-US")));
123 | // }
124 |
125 | // return v;
126 | //}
127 |
128 | private void setVals(object x, object y, object z)
129 | {
130 | if (x is string) { X = Convert.ToSingle(x.ToString().Replace(",", ",")); }
131 | if (y is string) { Y = Convert.ToSingle(y.ToString().Replace(",", ",")); }
132 | if (z is string) { Z = Convert.ToSingle(z.ToString().Replace(",", ",")); }
133 |
134 | //if (x is string) { X = Convert.ToSingle(x.ToString().Replace('.', ',')); }
135 | //if (y is string) { Y = Convert.ToSingle(y.ToString().Replace('.', ',')); }
136 | //if (z is string) { Z = Convert.ToSingle(z.ToString().Replace('.', ',')); }
137 |
138 | if ((x is float) || (x is Single) || (x is int)) { X = Convert.ToSingle(x); }
139 | if ((y is float) || (y is Single) || (y is int)) { Y = Convert.ToSingle(y); }
140 | if ((z is float) || (z is Single) || (z is int)) { Z = Convert.ToSingle(z); }
141 | }
142 |
143 | public byte[] Serialize()
144 | {
145 | List b = new List();
146 | b.Add(BitConverter.GetBytes(this.X)); b.Add(BitConverter.GetBytes(this.Y)); b.Add(BitConverter.GetBytes(this.Z));
147 | return b.SelectMany(byteArr => byteArr).ToArray();
148 | }
149 | }
150 |
151 | public class Vector4
152 | {
153 | public float X { get; set; }
154 | public float Y { get; set; }
155 | public float Z { get; set; }
156 | public float W { get; set; }
157 | }
158 |
159 | // class used to calculate bounding box for a list of points
160 | // points are fed through add_point()
161 | public class bounds
162 | {
163 | // min max to calculate the bounding box
164 | public float Xmin { get; set; } = float.PositiveInfinity;
165 | public float Ymin { get; set; } = float.PositiveInfinity;
166 | public float Zmin { get; set; } = float.PositiveInfinity;
167 | public float Xmax { get; set; } = float.NegativeInfinity;
168 | public float Ymax { get; set; } = float.NegativeInfinity;
169 | public float Zmax { get; set; } = float.NegativeInfinity;
170 |
171 | private int point_count { get; set; } // count points added, to calculate the center of thee mesh by dividing the sum of XYZ's components
172 |
173 | private Vector3 mesh_center = new Vector3();
174 |
175 | // center of the mesh
176 | public Vector3 center
177 | {
178 | get
179 | {
180 | if (mesh_center != null)
181 | {
182 | return mesh_center / point_count; //new Vector3(mesh_center.X / point_count, mesh_center.Y / point_count, mesh_center.Z / point_count);
183 | } else
184 | {
185 | return new Vector3(0f, 0f, 0f);
186 | }
187 |
188 | }
189 | set { }
190 | }
191 |
192 | public bounds()
193 | {
194 | this.center = new Vector3();
195 | }
196 |
197 | // returns calculated bounding box based on axes min/max
198 | public bbox bounding_box
199 | {
200 | get { return new bbox(new Vector3(Xmin, Ymin, Zmin), new Vector3(Xmax, Ymax, Zmax)); }
201 | }
202 |
203 | // given a point position add/sub min/max values
204 | // to get the bounds of a list of points
205 | public void add_point(Vector3 pnt)
206 | {
207 | Xmin = pnt.X < Xmin ? Xmin = pnt.X : Xmin;
208 | Ymin = pnt.Y < Ymin ? Ymin = pnt.Y : Ymin;
209 | Zmin = pnt.Z < Zmin ? Zmin = pnt.Z : Zmin;
210 | Xmax = pnt.X > Xmax ? Xmax = pnt.X : Xmax;
211 | Ymax = pnt.Y > Ymax ? Ymax = pnt.Y : Ymax;
212 | Zmax = pnt.Z > Zmax ? Zmax = pnt.Z : Zmax;
213 |
214 | mesh_center = new Vector3(mesh_center.X + pnt.X, mesh_center.Y + pnt.Y, mesh_center.Z + pnt.Z);
215 | point_count++;
216 | }
217 |
218 | // calculate the average/global bounding box from multiple bounding boxes summed up with this method
219 | // sets bounds based on the min/max A/B of a bounding box
220 | // pass multiple bounding boxes's A and B points and keeps the min/max (A B) values
221 | public void add_AB(Vector3 A, Vector3 B)
222 | {
223 | Xmin = A.X < Xmin ? Xmin = A.X : Xmin;
224 | Ymin = A.Y < Ymin ? Ymin = A.Y : Ymin;
225 | Zmin = A.Z < Zmin ? Zmin = A.Z : Zmin;
226 | Xmax = B.X > Xmax ? Xmax = B.X : Xmax;
227 | Ymax = B.Y > Ymax ? Ymax = B.Y : Ymax;
228 | Zmax = B.Z > Zmax ? Zmax = B.Z : Zmax;
229 | }
230 |
231 | // bounding box
232 | public class bbox
233 | {
234 | public Vector3 A { get; set; } = new Vector3();
235 | public Vector3 B { get; set; } = new Vector3();
236 |
237 | public bbox(Vector3 A, Vector3 B)
238 | {
239 | this.A = A;
240 | this.B = B;
241 | }
242 | }
243 | }
244 | }
245 |
246 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/Stage_Bin/block_01.cs:
--------------------------------------------------------------------------------
1 | using JSRF_ModTool.Functions;
2 | using JSRF_ModTool.Vector;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Text;
7 |
8 | namespace JSRF_ModTool.DataFormats.JSRF.Stage_Bin
9 | {
10 | public class block_01
11 | {
12 | // header
13 | public Int32 unk_id { get; set; }
14 | // 8192 bytes list of [8 bytes blocks] of item count + start offset (1024 items slots)
15 | public List items { get; set; }
16 |
17 |
18 | public block_01(byte[] data)
19 | {
20 | unk_id = BitConverter.ToInt32(data, 0);
21 | items = new List();
22 |
23 | for (int i = 4; i < 8196; i += 8) // 1024 items max
24 | {
25 | items.Add(new item_header(data, BitConverter.ToInt32(data, i), BitConverter.ToInt32(data, i + 4)));
26 | //items[this.items.Count - 1].items_size = items[this.items.Count - 1].items_count * 4;
27 | }
28 | }
29 |
30 | ///
31 | /// item_header is a list of [ [item count] and [start offset] ]
32 | /// each item_header
33 | ///
34 | public class item_header
35 | {
36 | ///
37 | /// file structure:
38 | /// [int32] item count
39 | /// [int32] start offset
40 |
41 | public Int32 start_offset { get; set; }
42 | public Int32 items_count { get; set; } // doesn't seen to match the item size/count between this.start_offset and next.item_header.start_offset
43 | // total items size = items_count * 4
44 |
45 | // offsets of grind_path objects
46 | //public List grind_path_headers_offsets_List { get; set; }
47 | public List grind_path_header_List { get; set; }
48 |
49 | public item_header(byte[] data, Int32 _start_offset, Int32 _items_count)
50 | {
51 | this.start_offset = _start_offset;
52 | this.items_count = _items_count;
53 | grind_path_header_List = new List();
54 |
55 | if(this.items_count == 0)
56 | {
57 | return;
58 | }
59 |
60 | // for each grind_path_header pointer
61 | for (int i = 0; i < this.items_count; i++)
62 | {
63 | // load binary data to grind_path_header class intance
64 | block_01.item_header.grind_path_header grind_path_head = (block_01.item_header.grind_path_header)(Parsing.binary_to_struct(data, BitConverter.ToInt32(data, this.start_offset + i * 4), typeof(block_01.item_header.grind_path_header)));
65 | grind_path_head.grind_path_points = new List();
66 | // read each grind path point and add it to grind_path_head.grind_path_points[] list
67 | for (int p = 0; p < grind_path_head.grind_points_count; p++)
68 | {
69 | // read from binary and Vector3 position and Vector3 normal
70 | grind_path_header.grind_path_point point = new grind_path_header.grind_path_point((Vector3)Parsing.binary_to_struct(data, grind_path_head.grind_points_list_start_offset + p * 24, typeof(Vector3)), (Vector3)Parsing.binary_to_struct(data, grind_path_head.grind_points_list_start_offset + p * 24 + 12, typeof(Vector3)));
71 |
72 | grind_path_head.grind_path_points.Add(point);
73 | }
74 |
75 | // add grind_path_header to list
76 | grind_path_header_List.Add(grind_path_head);
77 | }
78 | }
79 |
80 |
81 | public class grind_path_header
82 | {
83 | public Int32 grind_points_list_start_offset { get; set; }
84 | public Int32 grind_points_count { get; set; }
85 | public Int16 flag_A { get; set; }
86 | public Int16 flag_B { get; set; }
87 | public Vector3 bbox_A { get; set; } // bounding box point A
88 | public Vector3 bbox_B { get; set; } // bounding box point B
89 |
90 | public List grind_path_points { get; set; }
91 |
92 | public class grind_path_point
93 | {
94 | public Vector3 position { get; set; } // point position
95 | public Vector3 normal { get; set; } // point orientation
96 |
97 | public grind_path_point(Vector3 _pos, Vector3 _norm)
98 | {
99 | this.position = _pos;
100 | this.normal = _norm;
101 | }
102 | }
103 | }
104 | }
105 |
106 | public void export_data_struct_info(string filepath)
107 | {
108 | List lines = new List();
109 | int empty_space_counter = 0;
110 | int offset = 0;
111 | for (int i = 0; i < items.Count; i++)
112 | {
113 | if (items[i].items_count > 0)
114 | {
115 | if(empty_space_counter > 0)
116 | {
117 | lines.Add("");
118 | lines.Add("+" + empty_space_counter + " bytes of empty slots");
119 | lines.Add("");
120 | empty_space_counter = 0;
121 | }
122 |
123 |
124 | int size = 0;
125 | if (i + 1 < items.Count)
126 | {
127 | size = items[i + 1].start_offset - items[i].start_offset;
128 | }
129 | if (size == 0)
130 | {
131 | lines.Add(items[i].start_offset + " " + items[i].items_count);
132 | }
133 | else
134 | {
135 | lines.Add(items[i].start_offset + " " + items[i].items_count + " " + size);
136 | }
137 | } else {
138 | empty_space_counter += 8;
139 | }
140 | offset += 8;
141 | }
142 |
143 | System.IO.File.WriteAllLines(filepath, lines);
144 | }
145 |
146 |
147 | public void export_grind_path_data(string filepath)
148 | {
149 | List lines = new List();
150 |
151 | int item_count = 0;
152 | int grind_path_item_count = 0;
153 |
154 | List grind_points_list_offset = new List();
155 |
156 | foreach (var item in items)
157 | {
158 | if (item.items_count == 0) { continue; }
159 | //lines.Add("Grind Path Group [" + item_count + "]");
160 | // create model object
161 | foreach (var grind_path_item in item.grind_path_header_List)
162 | {
163 | // if grind points list has already been exported, skip
164 | if (grind_points_list_offset.Contains(grind_path_item.grind_points_list_start_offset))
165 | {
166 | continue;
167 | }
168 |
169 | grind_points_list_offset.Add(grind_path_item.grind_points_list_start_offset);
170 |
171 | lines.Add("[" + item_count + ":" + grind_path_item_count + ":" + grind_path_item.flag_A + " " + grind_path_item.flag_B + "]"); //Grind Path SubGroup
172 |
173 | // creatre point
174 | foreach (var points in grind_path_item.grind_path_points)
175 | {
176 | lines.Add(points.position.X + " " + points.position.Y + " " + points.position.Z + " " + points.normal.X + " " + points.normal.Y + " " + points.normal.Z);
177 | }
178 | grind_path_item_count++;
179 |
180 | lines.Add("end");
181 | }
182 | grind_path_item_count = 0;
183 | item_count++;
184 | }
185 | if (!System.IO.Directory.Exists(Path.GetDirectoryName(filepath)))
186 | System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filepath));
187 |
188 | System.IO.File.WriteAllLines(filepath, lines);
189 |
190 | }
191 |
192 | public void export_grind_path_data_blender(string filepath)
193 | {
194 | List lines = new List();
195 |
196 | int item_count = 0;
197 | int grind_path_item_count = 0;
198 |
199 | List grind_points_list_offset = new List();
200 | int line_point_index = 0;
201 | foreach (var item in items)
202 | {
203 | if (item.items_count > 0)
204 | {
205 | //lines.Add("Grind Path Group [" + item_count + "]");
206 | // create model object
207 | // for (int i = 0; i < length; i++)
208 | //foreach (var grind_path_item in item.grind_path_header_List)
209 | for (int f = 0; f < item.grind_path_header_List.Count; f++)
210 | {
211 | item_header.grind_path_header grind_path_item = item.grind_path_header_List[f];
212 |
213 | // if grind points list has already been exported, skip
214 | if (grind_points_list_offset.Contains(grind_path_item.grind_points_list_start_offset))
215 | {
216 | continue;
217 | }
218 |
219 | grind_points_list_offset.Add(grind_path_item.grind_points_list_start_offset);
220 |
221 | lines.Add("o gp_" + item_count + "_" + grind_path_item_count); //Grind Path SubGroup
222 | lines.Add("");
223 | // creatre point
224 | foreach (var points in grind_path_item.grind_path_points)
225 | {
226 | decimal px = Decimal.Parse(points.position.X.ToString(), System.Globalization.NumberStyles.Any);
227 | decimal py = Decimal.Parse(points.position.Y.ToString(), System.Globalization.NumberStyles.Any);
228 | decimal pz = Decimal.Parse(points.position.Z.ToString(), System.Globalization.NumberStyles.Any);
229 |
230 | lines.Add("v " + px + " " + py + " " + pz);
231 | }
232 |
233 |
234 |
235 | for (int i = 0; i < grind_path_item.grind_path_points.Count; i += 2)
236 | {
237 | lines.Add("l " + (line_point_index + i + 1) + " " + (line_point_index + i + 2));
238 |
239 | if (i < grind_path_item.grind_path_points.Count - 2)
240 | {
241 | lines.Add("l " + (line_point_index + i + 2) + " " + (line_point_index + i + 3));
242 | }
243 |
244 | // if last line
245 | if (i == grind_path_item.grind_path_points.Count - 1)
246 | {
247 | lines[lines.Count - 1] = "l " + (line_point_index + i) + " " + (line_point_index + i + 1);
248 | }
249 | }
250 | line_point_index += grind_path_item.grind_path_points.Count;
251 |
252 | lines.Add("");
253 | grind_path_item_count++;
254 | }
255 | }
256 |
257 | item_count++;
258 | }
259 |
260 | System.IO.File.WriteAllLines(filepath, lines);
261 | }
262 | }
263 | }
264 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/MDLB_Import/UserControls/Material_Inspector.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace JSRF_ModTool.MDLB_Import
2 | {
3 | partial class Material_Inspector
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.txtb_hb = new System.Windows.Forms.TextBox();
32 | this.label4 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.cb_material_id = new System.Windows.Forms.ComboBox();
35 | this.label3 = new System.Windows.Forms.Label();
36 | this.txtb_unk_id2 = new System.Windows.Forms.TextBox();
37 | this.btn_remove = new System.Windows.Forms.Button();
38 | this.lab_id = new System.Windows.Forms.Label();
39 | this.panel1 = new System.Windows.Forms.Panel();
40 | this.panel2 = new System.Windows.Forms.Panel();
41 | this.panel3 = new System.Windows.Forms.Panel();
42 | this.panel4 = new System.Windows.Forms.Panel();
43 | this.txtb_unk_id1 = new System.Windows.Forms.TextBox();
44 | this.label1 = new System.Windows.Forms.Label();
45 | this.color_0 = new JSRF_ModTool.MDLB_Import.Color();
46 | this.panel1.SuspendLayout();
47 | this.SuspendLayout();
48 | //
49 | // txtb_hb
50 | //
51 | this.txtb_hb.Location = new System.Drawing.Point(526, 50);
52 | this.txtb_hb.Name = "txtb_hb";
53 | this.txtb_hb.Size = new System.Drawing.Size(73, 20);
54 | this.txtb_hb.TabIndex = 3;
55 | this.txtb_hb.Text = "0";
56 | this.txtb_hb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
57 | this.txtb_hb.TextChanged += new System.EventHandler(this.txtb_hb_TextChanged);
58 | this.txtb_hb.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_hb_KeyPress);
59 | //
60 | // label4
61 | //
62 | this.label4.AutoSize = true;
63 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
64 | this.label4.ForeColor = System.Drawing.Color.Black;
65 | this.label4.Location = new System.Drawing.Point(533, 34);
66 | this.label4.Name = "label4";
67 | this.label4.Size = new System.Drawing.Size(50, 13);
68 | this.label4.TabIndex = 1;
69 | this.label4.Text = "Unk ID 3";
70 | //
71 | // label2
72 | //
73 | this.label2.AutoSize = true;
74 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
75 | this.label2.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
76 | this.label2.Location = new System.Drawing.Point(241, 33);
77 | this.label2.Name = "label2";
78 | this.label2.Size = new System.Drawing.Size(52, 13);
79 | this.label2.TabIndex = 1;
80 | this.label2.Text = "Material";
81 | //
82 | // cb_material_id
83 | //
84 | this.cb_material_id.BackColor = System.Drawing.SystemColors.Control;
85 | this.cb_material_id.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
86 | this.cb_material_id.Location = new System.Drawing.Point(215, 49);
87 | this.cb_material_id.Name = "cb_material_id";
88 | this.cb_material_id.Size = new System.Drawing.Size(121, 21);
89 | this.cb_material_id.Sorted = true;
90 | this.cb_material_id.TabIndex = 1;
91 | //
92 | // label3
93 | //
94 | this.label3.AutoSize = true;
95 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
96 | this.label3.ForeColor = System.Drawing.Color.Black;
97 | this.label3.Location = new System.Drawing.Point(451, 34);
98 | this.label3.Name = "label3";
99 | this.label3.Size = new System.Drawing.Size(50, 13);
100 | this.label3.TabIndex = 1;
101 | this.label3.Text = "Unk ID 2";
102 | //
103 | // txtb_unk_id2
104 | //
105 | this.txtb_unk_id2.Location = new System.Drawing.Point(444, 50);
106 | this.txtb_unk_id2.Name = "txtb_unk_id2";
107 | this.txtb_unk_id2.Size = new System.Drawing.Size(73, 20);
108 | this.txtb_unk_id2.TabIndex = 2;
109 | this.txtb_unk_id2.Text = "0";
110 | this.txtb_unk_id2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
111 | this.txtb_unk_id2.TextChanged += new System.EventHandler(this.txtb_hb_TextChanged);
112 | this.txtb_unk_id2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_hb_KeyPress);
113 | //
114 | // btn_remove
115 | //
116 | this.btn_remove.Location = new System.Drawing.Point(590, 1);
117 | this.btn_remove.Name = "btn_remove";
118 | this.btn_remove.Size = new System.Drawing.Size(19, 22);
119 | this.btn_remove.TabIndex = 4;
120 | this.btn_remove.Text = "x";
121 | this.btn_remove.TextAlign = System.Drawing.ContentAlignment.TopCenter;
122 | this.btn_remove.UseVisualStyleBackColor = true;
123 | this.btn_remove.Click += new System.EventHandler(this.btn_remove_Click);
124 | //
125 | // lab_id
126 | //
127 | this.lab_id.AutoSize = true;
128 | this.lab_id.BackColor = System.Drawing.SystemColors.ControlDark;
129 | this.lab_id.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
130 | this.lab_id.ForeColor = System.Drawing.Color.White;
131 | this.lab_id.Location = new System.Drawing.Point(3, 3);
132 | this.lab_id.Name = "lab_id";
133 | this.lab_id.Size = new System.Drawing.Size(23, 15);
134 | this.lab_id.TabIndex = 5;
135 | this.lab_id.Text = "[0]";
136 | //
137 | // panel1
138 | //
139 | this.panel1.BackColor = System.Drawing.SystemColors.ControlDark;
140 | this.panel1.Controls.Add(this.lab_id);
141 | this.panel1.Controls.Add(this.btn_remove);
142 | this.panel1.Location = new System.Drawing.Point(0, -1);
143 | this.panel1.Name = "panel1";
144 | this.panel1.Size = new System.Drawing.Size(611, 23);
145 | this.panel1.TabIndex = 6;
146 | //
147 | // panel2
148 | //
149 | this.panel2.BackColor = System.Drawing.SystemColors.ControlDark;
150 | this.panel2.Location = new System.Drawing.Point(0, 83);
151 | this.panel2.Name = "panel2";
152 | this.panel2.Size = new System.Drawing.Size(611, 2);
153 | this.panel2.TabIndex = 7;
154 | //
155 | // panel3
156 | //
157 | this.panel3.BackColor = System.Drawing.SystemColors.ControlDark;
158 | this.panel3.Location = new System.Drawing.Point(608, 21);
159 | this.panel3.Name = "panel3";
160 | this.panel3.Size = new System.Drawing.Size(2, 64);
161 | this.panel3.TabIndex = 8;
162 | //
163 | // panel4
164 | //
165 | this.panel4.BackColor = System.Drawing.SystemColors.ControlDark;
166 | this.panel4.Location = new System.Drawing.Point(0, 21);
167 | this.panel4.Name = "panel4";
168 | this.panel4.Size = new System.Drawing.Size(2, 64);
169 | this.panel4.TabIndex = 9;
170 | //
171 | // txtb_unk_id1
172 | //
173 | this.txtb_unk_id1.Location = new System.Drawing.Point(363, 50);
174 | this.txtb_unk_id1.Name = "txtb_unk_id1";
175 | this.txtb_unk_id1.Size = new System.Drawing.Size(73, 20);
176 | this.txtb_unk_id1.TabIndex = 11;
177 | this.txtb_unk_id1.Text = "0";
178 | this.txtb_unk_id1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
179 | this.txtb_unk_id1.TextChanged += new System.EventHandler(this.txtb_hb_TextChanged);
180 | this.txtb_unk_id1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtb_hb_KeyPress);
181 | //
182 | // label1
183 | //
184 | this.label1.AutoSize = true;
185 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
186 | this.label1.ForeColor = System.Drawing.Color.Black;
187 | this.label1.Location = new System.Drawing.Point(374, 34);
188 | this.label1.Name = "label1";
189 | this.label1.Size = new System.Drawing.Size(50, 13);
190 | this.label1.TabIndex = 10;
191 | this.label1.Text = "Unk ID 1";
192 | //
193 | // color_0
194 | //
195 | this.color_0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
196 | this.color_0.Location = new System.Drawing.Point(12, 28);
197 | this.color_0.Name = "color_0";
198 | this.color_0.Size = new System.Drawing.Size(166, 47);
199 | this.color_0.TabIndex = 0;
200 | //
201 | // Material_Inspector
202 | //
203 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
204 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
205 | this.Controls.Add(this.txtb_unk_id1);
206 | this.Controls.Add(this.label1);
207 | this.Controls.Add(this.panel4);
208 | this.Controls.Add(this.panel3);
209 | this.Controls.Add(this.panel2);
210 | this.Controls.Add(this.panel1);
211 | this.Controls.Add(this.cb_material_id);
212 | this.Controls.Add(this.label2);
213 | this.Controls.Add(this.txtb_unk_id2);
214 | this.Controls.Add(this.label3);
215 | this.Controls.Add(this.txtb_hb);
216 | this.Controls.Add(this.label4);
217 | this.Controls.Add(this.color_0);
218 | this.Name = "Material_Inspector";
219 | this.Size = new System.Drawing.Size(610, 85);
220 | this.Load += new System.EventHandler(this.MaterialProperties_Load);
221 | this.panel1.ResumeLayout(false);
222 | this.panel1.PerformLayout();
223 | this.ResumeLayout(false);
224 | this.PerformLayout();
225 |
226 | }
227 |
228 | #endregion
229 |
230 | private Color color_0;
231 | private System.Windows.Forms.Label label4;
232 | private System.Windows.Forms.Label label2;
233 | private System.Windows.Forms.Label label3;
234 | private System.Windows.Forms.Button btn_remove;
235 | private System.Windows.Forms.Label lab_id;
236 | private System.Windows.Forms.Panel panel1;
237 | public System.Windows.Forms.ComboBox cb_material_id;
238 | public System.Windows.Forms.TextBox txtb_unk_id2;
239 | public System.Windows.Forms.TextBox txtb_hb;
240 | private System.Windows.Forms.Panel panel2;
241 | private System.Windows.Forms.Panel panel3;
242 | private System.Windows.Forms.Panel panel4;
243 | public System.Windows.Forms.TextBox txtb_unk_id1;
244 | private System.Windows.Forms.Label label1;
245 | }
246 | }
247 |
--------------------------------------------------------------------------------
/JSRF_Tool_2/DataFormats/JSRF/mission_bin.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace JSRF_ModTool.DataFormats.JSRF
7 | {
8 | class Mission_bin
9 | {
10 | // 544 bytes
11 | public struct mission_header
12 | {
13 | // main header seems to be 544 bytes
14 | public Int32 unk_00_stage_id { get; set; } // //
15 | public Int32 unk_04 { get; set; } //
16 | public Int32 unk_08 { get; set; } //
17 | public Int32 unk_12 { get; set; } //
18 | public Int32 unk_16 { get; set; } //
19 | public Int32 unk_20 { get; set; } //
20 | public Int32 unk_24 { get; set; } //
21 | public Int32 unk_28 { get; set; } //
22 | public Int32 unk_32 { get; set; } //
23 | public Int32 unk_36 { get; set; } //
24 | public Int32 unk_40 { get; set; } //
25 | public Int32 unk_44 { get; set; } //
26 | public Int32 unk_48 { get; set; } //
27 |
28 |
29 |
30 | // values after commenr are data from (mssn0101.bin) //
31 |
32 | // block block size 32
33 | public Int32 unk_52_block_offset { get; set; } // 544 (mssn0101.bin)
34 | public Int32 unk_56_block_count { get; set; } // 33
35 |
36 |
37 | // unk size (player spawn point? stage enter position?? )
38 | // position where the player comes-in the stage
39 | // i.e. if you come from 99th, you'll spawn on the garage but rolling in from the highway into the garage
40 | public Int32 unk_60_block_offset { get; set; } // 1600
41 | public Int32 unk_64_block_count { get; set; } // 15
42 |
43 |
44 | // block size 8
45 | // seems to give an offset + count
46 | // structure: int (offset) int (count)
47 | // which point to blocks of 12 bytes (int(0) int(count) int(offset))
48 | public Int32 unk_68_block_offset { get; set; } // 19932
49 | public Int32 unk_72_block_count { get; set; } // 3
50 |
51 | public Int32 unk_76_block_offset { get; set; } //
52 | public Int32 unk_80_block_count { get; set; } //
53 |
54 | public Int32 unk_84_offset { get; set; } //
55 | public Int32 unk_88_count { get; set; } //
56 |
57 | public Int32 unk_92_offset { get; set; } //
58 | public Int32 unk_96_count { get; set; } //
59 |
60 |
61 | // stage exit bounds (at start)
62 | // position of things like spray cans (int (item_id) vector3(position))
63 | //(item_id 0 = yellow can 1 = blue can 2 = health can 3 = green can 4= multiplayer bonus
64 |
65 | // 1232
66 | public Int32 unk_100_offset { get; set; } // 19956
67 | public Int32 unk_104_count { get; set; } // 5
68 |
69 | public Int32 unk_108_offset { get; set; } //
70 | public Int32 unk_112_count { get; set; } //
71 |
72 | public Int32 unk_116_offset { get; set; } //
73 | public Int32 unk_120_count { get; set; } //
74 |
75 | public Int32 unk_124_offset { get; set; } //
76 | public Int32 unk_128_count { get; set; } //
77 |
78 |
79 | //confirmed StgObj placements //
80 | //total block size 296 (for mission_0101 - garage tutorial)
81 | //structure; int? int?(count? or id?) vector3(position) int(offset?) int(? or int16 + int16) int vector3(scale)
82 | public Int32 unk_132_offset { get; set; } // 21188
83 | public Int32 unk_136_count { get; set; } // 1
84 |
85 |
86 |
87 | // characters script (kinda)
88 | // give position, rotation and character model
89 | // its like a sequence of how the character models will be placed
90 | // as it looks like some are repeated
91 | // collision blocks to patch out holes?
92 | // block size 476
93 | //structure (int int (these two define the character model ID) int (unk) vector3 vector3 vector3 vector3 vector3(character position)
94 | public Int32 unk_140_offset { get; set; } // 21484
95 | public Int32 unk_144_count { get; set; } // 2
96 |
97 |
98 |
99 | public Int32 unk_148_offset { get; set; } //
100 | public Int32 unk_152_count { get; set; } //
101 |
102 | public Int32 unk_156_offset { get; set; } //
103 | public Int32 unk_160_count { get; set; } //
104 |
105 | // block size 368
106 | // dialogue camera data?? (camera animations when you get close and talk to a character?)
107 | // dialogue triggers? (nulling float data to 0 made dialogues no longer appear)
108 | public Int32 unk_164_offset { get; set; } // 22436
109 | public Int32 unk_168_count { get; set; } // 13
110 |
111 | public Int32 unk_172_offset { get; set; } //
112 | public Int32 unk_176_count { get; set; } //
113 |
114 | public Int32 unk_180_offset { get; set; } //
115 | public Int32 unk_184_count { get; set; } //
116 |
117 | public Int32 unk_188_offset { get; set; } //
118 | public Int32 unk_192_count { get; set; } //
119 |
120 | // block size 160 (stage switching triggers)
121 | // vectors 3 define bounding box or trigger area
122 | // some seem to be repeated, or near the same vector 3
123 | //(like 2 or 3 points in the same location for each diagonal of the box)
124 | // there's also an int to define which stage to switch to
125 | // one point position which may define at which point it loads the next stage or pushes the player back
126 | // some other smaller floats
127 | public Int32 unk_196_offset { get; set; } // 27220
128 | public Int32 unk_200_count { get; set; } // 5
129 |
130 | public Int32 unk_204_offset { get; set; } //
131 | public Int32 unk_208_count { get; set; } //
132 |
133 | // block size 204 (stage switching triggers and other triggers?)
134 | // 6- vectors 3 define bounding box or trigger area
135 | public Int32 unk_212_offset { get; set; } // 28020
136 | public Int32 unk_216_count { get; set; } // 23
137 |
138 | public Int32 unk_220_offset { get; set; } //
139 | public Int32 unk_224_count { get; set; } //
140 |
141 | public Int32 unk_228_offset { get; set; } //
142 | public Int32 unk_232_count { get; set; } //
143 |
144 | // block size 76 (??levsl switch position, there's a vector 3 that's a point right where the stage switching happens)
145 | // (stage bounding box?)
146 | // structure as follows
147 | // int (id? maybe points to other blocks for tirgger?) vector3 (position)
148 | // int (id? maybe points to other blocks for tirgger?) vector3 (position)
149 | // int (id? maybe points to other blocks for tirgger?) vector3 (position)
150 | // int (id? maybe points to other blocks for tirgger?) vector3 (position)
151 | // vector3 (??)
152 | public Int32 unk_236_offset { get; set; } // 32712
153 | public Int32 unk_240_count { get; set; } // 4
154 |
155 | // block size 48 (npc location? roboy in garage?)
156 | //(points to a bounding box coordinates? so maybe if its outside of it, it gets removed ingame)
157 | public Int32 unk_244_offset { get; set; } // 33016
158 | public Int32 unk_248_count { get; set; } // 5
159 |
160 | public Int32 unk_252_offset { get; set; } //
161 | public Int32 unk_256_count { get; set; } //
162 |
163 | public Int32 unk_260_offset { get; set; } //
164 | public Int32 unk_264_count { get; set; } //
165 |
166 | public Int32 unk_268_offset { get; set; } //
167 | public Int32 unk_272_count { get; set; } //
168 |
169 | public Int32 unk_276_offset { get; set; } //
170 | public Int32 unk_280_count { get; set; } //
171 |
172 | public Int32 unk_284_offset { get; set; } //
173 | public Int32 unk_288_count { get; set; } //
174 |
175 | public Int32 unk_292_offset { get; set; } //
176 | public Int32 unk_296_count { get; set; } //
177 |
178 | public Int32 unk_300_offset { get; set; } //
179 | public Int32 unk_304_count { get; set; } //
180 |
181 | public Int32 unk_308_offset { get; set; } //
182 | public Int32 unk_312_count { get; set; } //
183 |
184 | public Int32 unk_316_offset { get; set; } //
185 | public Int32 unk_320_count { get; set; } //
186 |
187 | public Int32 unk_324_offset { get; set; } //
188 | public Int32 unk_328_count { get; set; } //
189 |
190 | public Int32 unk_332_offset { get; set; } //
191 | public Int32 unk_336_count { get; set; } //
192 |
193 | public Int32 unk_340_offset { get; set; } //
194 | public Int32 unk_344_count { get; set; } //
195 |
196 | public Int32 unk_348_offset { get; set; } //
197 | public Int32 unk_352_count { get; set; } //
198 |
199 | public Int32 unk_356_offset { get; set; } //
200 | public Int32 unk_360_count { get; set; } //
201 |
202 | public Int32 unk_364_offset { get; set; } //
203 | public Int32 unk_368_count { get; set; } //
204 |
205 | // block size 84 2268 (dialogue data? points to dialogue header??)
206 | public Int32 unk_372_offset { get; set; } // 33256
207 | public Int32 unk_376_count { get; set; } // 27
208 |
209 | // block size 84 (dialogue data? points to dialogue header??) ( another language?)
210 | public Int32 unk_380_offset { get; set; } // 35524
211 | public Int32 unk_384_count { get; set; } // 23
212 |
213 | // block size 84 (dialogue data? points to dialogue header??) ( another language?)
214 | public Int32 unk_388_offset { get; set; } // 37456
215 | public Int32 unk_392_count { get; set; } // 56
216 |
217 | // block size 84 (dialogue data? points to dialogue header??) ( another language?)
218 | public Int32 unk_396_offset { get; set; } // 42160
219 | public Int32 unk_400_count { get; set; } // 14
220 |
221 | // block size 68
222 | public Int32 unk_404_offset { get; set; } // 43336
223 | public Int32 unk_408_count { get; set; } // 4
224 |
225 | public Int32 unk_412_offset { get; set; } //
226 | public Int32 unk_416_count { get; set; } //
227 |
228 | public Int32 unk_420_offset { get; set; } //
229 | public Int32 unk_424_count { get; set; } //
230 |
231 | public Int32 unk_428_offset { get; set; } //
232 | public Int32 unk_432_count { get; set; } //
233 |
234 | public Int32 unk_436_offset { get; set; } //
235 | public Int32 unk_440_count { get; set; } //
236 |
237 | public Int32 unk_444_offset { get; set; } //
238 | public Int32 unk_448_count { get; set; } //
239 |
240 | public Int32 unk_452_offset { get; set; } //
241 | public Int32 unk_456_count { get; set; } //
242 |
243 | public Int32 unk_460_offset { get; set; } //
244 | public Int32 unk_464_count { get; set; } //
245 |
246 | public Int32 unk_468_offset { get; set; } //
247 | public Int32 unk_472_count { get; set; } //
248 |
249 | public Int32 unk_476_offset { get; set; } //
250 | public Int32 unk_480_count { get; set; } //
251 |
252 | public Int32 unk_484_offset { get; set; } //
253 | public Int32 unk_488_count { get; set; } //
254 |
255 | public Int32 unk_492_offset { get; set; } //
256 | public Int32 unk_496_count { get; set; } //
257 |
258 | public Int32 unk_500_offset { get; set; } //
259 | public Int32 unk_504_count { get; set; } //
260 |
261 | public Int32 unk_508_offset { get; set; } //
262 | public Int32 unk_512_count { get; set; } //
263 |
264 | public Int32 unk_516_offset { get; set; } //
265 | public Int32 unk_520_count { get; set; } //
266 |
267 | public Int32 unk_524_offset { get; set; } //
268 | public Int32 unk_528_count { get; set; } //
269 |
270 | public Int32 unk_532_offset { get; set; } //
271 | public Int32 unk_536_count { get; set; } //
272 |
273 | public Int32 unk_540_offset { get; set; } //
274 | public Int32 unk_544_count { get; set; } //
275 |
276 |
277 |
278 | }
279 |
280 | }
281 | }
282 |
--------------------------------------------------------------------------------