Skip to content
This repository
Browse code

more data structure defines and starting on code for exporting to .on…

…i files
  • Loading branch information...
commit 53f5da46f1a9a9c2839108fb149024e2e094f28c 1 parent 8342a1a
authored May 02, 2012

Showing 48 changed files with 620 additions and 80 deletions. Show diff stats Hide diff stats

  1. 3  Oni/Components/OniTag.cpp
  2. 4  Oni/Components/OniTag.h
  3. 26  Oni/Level/Level.cpp
  4. 8  Oni/Level/Level.h
  5. 4  Oni/Resources/Tags/ABNA.h
  6. 4  Oni/Resources/Tags/AGQC.h
  7. 4  Oni/Resources/Tags/AGQG.h
  8. 4  Oni/Resources/Tags/AGQR.h
  9. 4  Oni/Resources/Tags/AISA.h
  10. 4  Oni/Resources/Tags/AKAA.h
  11. 4  Oni/Resources/Tags/AKBA.h
  12. 5  Oni/Resources/Tags/AKBP.h
  13. 4  Oni/Resources/Tags/AKEV.h
  14. 4  Oni/Resources/Tags/AKOT.h
  15. 4  Oni/Resources/Tags/AKVA.h
  16. 4  Oni/Resources/Tags/BINA.h
  17. 4  Oni/Resources/Tags/CBPI.h
  18. 4  Oni/Resources/Tags/CBPM.h
  19. 5  Oni/Resources/Tags/CONS.h
  20. 4  Oni/Resources/Tags/CRSA.h
  21. 4  Oni/Resources/Tags/DOOR.h
  22. 4  Oni/Resources/Tags/DPge.h
  23. 4  Oni/Resources/Tags/ENVP.h
  24. 4  Oni/Resources/Tags/FILM.h
  25. 4  Oni/Resources/Tags/HPge.h
  26. 4  Oni/Resources/Tags/IGHH.h
  27. 4  Oni/Resources/Tags/IGPA.h
  28. 4  Oni/Resources/Tags/IGPG.h
  29. 4  Oni/Resources/Tags/IGSA.h
  30. 4  Oni/Resources/Tags/IGSt.h
  31. 4  Oni/Resources/Tags/IPge.h
  32. 4  Oni/Resources/Tags/Impt.h
  33. 4  Oni/Resources/Tags/Keyl.h
  34. 4  Oni/Resources/Tags/M3GA.h
  35. 4  Oni/Resources/Tags/M3GM.h
  36. 4  Oni/Resources/Tags/Mtrl.h
  37. 11  Oni/Resources/Tags/OBAN.cpp
  38. 63  Oni/Resources/Tags/OBAN.h
  39. 11  Oni/Resources/Tags/OBOA.cpp
  40. 67  Oni/Resources/Tags/OBOA.h
  41. 11  Oni/Resources/Tags/OFGA.cpp
  42. 32  Oni/Resources/Tags/OFGA.h
  43. 11  Oni/Resources/Tags/ONCC.cpp
  44. 212  Oni/Resources/Tags/ONCC.h
  45. 5  Oni/Resources/Tags/OniTM.h
  46. 68  Oni/Resources/Tags/Tags.h
  47. 24  OniLevelTool.xcodeproj/project.pbxproj
  48. 14  main.cpp
3  Oni/Components/OniTag.cpp
@@ -29,7 +29,4 @@ void OniTag::LoadFrom(OniInstanceStruct *data_struct, char *data_buffer, char *n
29 29
 		
30 30
 	this->instance_data = (char *)malloc(sizeof(char)*(data_struct->data_size+8));
31 31
 	memcpy(this->instance_data, &data_buffer[data_struct->data_offset-8],data_struct->data_size+8);
32  
-	
33  
-	
34  
-	
35 32
 }
4  Oni/Components/OniTag.h
@@ -11,6 +11,8 @@
11 11
 #include "OniInstance.h"
12 12
 #include "OniTemplate.h"
13 13
 
  14
+#include "Tags.h"
  15
+
14 16
 #ifndef _OniTag
15 17
 #define _OniTag
16 18
 class OniTag {
@@ -19,7 +21,7 @@ class OniTag {
19 21
 	char name[64];
20 22
 	int32_t flags;
21 23
 	char *instance_data;
22  
-		
  24
+	
23 25
 	OniTag();
24 26
 	~OniTag();
25 27
 	void LoadFrom(OniInstanceStruct *data_struct, char *data_buffer, char *name_buffer);
26  Oni/Level/Level.cpp
@@ -60,8 +60,34 @@ bool OniLevel::LoadPath(char *path) {
60 60
 		fread(this->names_table,sizeof(char)*this->header->names_size,1,file_);
61 61
 		
62 62
 		fclose(file_);
  63
+		
63 64
 		return true;
64 65
 	} else {
65 66
 		return false;
66 67
 	}
  68
+}
  69
+
  70
+void OniLevel::LoadTags() {
  71
+	if (!this->tags.empty()) {
  72
+		this->tags.clear();
  73
+	}
  74
+	for (int32_t i = 0; i < this->header->instance_count; i++) {
  75
+		OniTag *a_tag = new OniTag;
  76
+		a_tag->LoadFrom(&this->instance_descriptors[i], this->data_table, this->names_table);
  77
+		this->tags.push_back(a_tag);
  78
+	}
  79
+}
  80
+
  81
+void OniLevel::ExportTagToPath(OniTag *tag, char *path) {
  82
+	
  83
+}
  84
+
  85
+void OniLevel::ExportAllTags() {
  86
+	if (!this->tags.empty()) {
  87
+		for (int32_t i = 0; i < this->tags.size(); i++) {
  88
+			OniTag *a_tag = this->tags.at(i);
  89
+			//this->ExportTagToPath(a_tag, "some_path");
  90
+			delete a_tag;
  91
+		}
  92
+	}
67 93
 }
8  Oni/Level/Level.h
@@ -8,6 +8,7 @@
8 8
  */
9 9
 
10 10
 #include "headers.h"
  11
+#include "OniTag.h"
11 12
 
12 13
 #include "OniInstance.h"
13 14
 #include "OniName.h"
@@ -43,8 +44,13 @@ class OniLevel {
43 44
 	
44 45
 	char *data_table;
45 46
 	char *names_table;
46  
-		
  47
+	
  48
+	std::vector<OniTag *> tags;
  49
+	
47 50
 	OniLevel();
48 51
 	~OniLevel();
49 52
 	bool LoadPath(char *path);
  53
+	void LoadTags();
  54
+	void ExportTagToPath(OniTag *tag, char *path);
  55
+	void ExportAllTags();
50 56
 };
4  Oni/Resources/Tags/ABNA.h
@@ -23,10 +23,10 @@ struct ABNADataStruct {
23 23
 	int32_t back_index;
24 24
 };
25 25
 
26  
-#endif
27 26
 
28 27
 class ABNA : public OniTM {
29 28
 public:
30 29
 	ABNAHeaderStruct *head;
31 30
 	ABNADataStruct *data;
32  
-};
  31
+};
  32
+#endif
4  Oni/Resources/Tags/AGQC.h
@@ -25,10 +25,10 @@ struct AGQCDataStruct {
25 25
 	float pos_y;
26 26
 	float pos_z;
27 27
 };
28  
-#endif
29 28
 
30 29
 class AGQC : public OniTM {
31 30
 public:
32 31
 	AGQCHeaderStruct *head;
33 32
 	AGQCDataStruct *data;
34  
-};
  33
+};
  34
+#endif
4  Oni/Resources/Tags/AGQG.h
@@ -35,10 +35,10 @@ struct AGQGDataStruct {
35 35
 	int32_t flags;
36 36
 	int32_t object_id;
37 37
 };
38  
-#endif
39 38
 
40 39
 class AGQG : public OniTM {
41 40
 public:
42 41
 	AGQGHeaderStruct *head;
43 42
 	AGQGDataStruct *data;
44  
-};
  43
+};
  44
+#endif
4  Oni/Resources/Tags/AGQR.h
@@ -21,10 +21,10 @@ struct AGQRDataStruct {
21 21
 	char dead[2];
22 22
 };
23 23
 
24  
-#endif
25 24
 
26 25
 class AGQR : public OniTM {
27 26
 public:
28 27
 	AGQRHeaderStruct *head;
29 28
 	AGQRDataStruct *data;
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/AISA.h
@@ -50,10 +50,10 @@ struct AISADataStruct {
50 50
 	int8_t unused6;
51 51
 	int8_t unused7;
52 52
 };
53  
-#endif
54 53
 
55 54
 class AISA : public OniTM {
56 55
 public:
57 56
 	AISAHeaderStruct *head;
58 57
 	AISADataStruct *data;
59  
-};
  58
+};
  59
+#endif
4  Oni/Resources/Tags/AKAA.h
@@ -21,10 +21,10 @@ struct AKAADataStruct {
21 21
 	int32_t AGQG_id;
22 22
 	int32_t unused;
23 23
 };
24  
-#endif
25 24
 
26 25
 class AKAA : public OniTM {
27 26
 public:
28 27
 	AKAAHeaderStruct *head;
29 28
 	AKAADataStruct *data;	
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/AKBA.h
@@ -27,10 +27,10 @@ struct AKBADataStruct {
27 27
 	int32_t unused3;
28 28
 };
29 29
 
30  
-#endif
31 30
 
32 31
 class AKBA : public OniTM {
33 32
 public:
34 33
 	AKBAHeaderStruct *head;
35 34
 	AKBADataStruct *data;	
36  
-};
  35
+};
  36
+#endif
5  Oni/Resources/Tags/AKBP.h
@@ -22,10 +22,9 @@ struct AKBPDataStruct {
22 22
 	int32_t AKBP_front;
23 23
 };
24 24
 
25  
-#endif
26  
-
27 25
 class AKBP : public OniTM {
28 26
 public:
29 27
 	AKBPHeaderStruct *head;
30 28
 	AKBPDataStruct *data;	
31  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/AKEV.h
@@ -38,9 +38,9 @@ struct AKEVDataStruct {
38 38
 	char unused[24];
39 39
 	float ignored;
40 40
 };
41  
-#endif
42 41
 
43 42
 class AKEV : public OniTM {
44 43
 public:
45 44
 	AKEVDataStruct *data;
46  
-};
  45
+};
  46
+#endif
4  Oni/Resources/Tags/AKOT.h
@@ -19,9 +19,9 @@ struct AKOTDataStruct {
19 19
 	int32_t IDXA_link2;
20 20
 	char unused[4];
21 21
 };
22  
-#endif
23 22
 
24 23
 class AKOT : public OniTM {
25 24
 public:
26 25
 	AKOTDataStruct *data;	
27  
-};
  26
+};
  27
+#endif
4  Oni/Resources/Tags/AKVA.h
@@ -48,10 +48,10 @@ struct AKVADataStruct {
48 48
 	float slope_distance;
49 49
 	float slope_height;
50 50
 };
51  
-#endif
52 51
 
53 52
 class AKVA : public OniTM {
54 53
 public:
55 54
 	AKVAHeaderStruct *head;
56 55
 	AKVADataStruct *data;
57  
-};
  56
+};
  57
+#endif
4  Oni/Resources/Tags/BINA.h
@@ -16,9 +16,9 @@ struct BINAHeaderStruct {
16 16
 	int32_t data_offset;
17 17
 	char unused[16];
18 18
 };
19  
-#endif
20 19
 
21 20
 class BINA : public OniTM {
22 21
 public:
23 22
 	BINAHeaderStruct *head;
24  
-};
  23
+};
  24
+#endif
4  Oni/Resources/Tags/CBPI.h
@@ -30,9 +30,9 @@ struct CBPIDataStruct {
30 30
 	CBPIKillStruct killed[19];
31 31
 	char dead[20];
32 32
 };
33  
-#endif
34 33
 
35 34
 class CBPI : public OniTM {
36 35
 public:
37 36
 	CBPIDataStruct *data;
38  
-};
  37
+};
  38
+#endif
4  Oni/Resources/Tags/CBPM.h
@@ -19,9 +19,9 @@ struct CBPMDataStruct {
19 19
 	CBPMLinkStruct material[19];
20 20
 	char dead[12];
21 21
 };
22  
-#endif
23 22
 
24 23
 class CBPM : public OniTM {
25 24
 public:
26 25
 	CBPMDataStruct *data;
27  
-};
  26
+};
  27
+#endif
5  Oni/Resources/Tags/CONS.h
@@ -32,9 +32,8 @@ struct CONSDataStruct {
32 32
 	char dead[16];
33 33
 };
34 34
 
35  
-#endif
36  
-
37 35
 class CONS : public OniTM {
38 36
 public:
39 37
 	CONSDataStruct *data;
40  
-};
  38
+};
  39
+#endif
4  Oni/Resources/Tags/CRSA.h
@@ -50,10 +50,10 @@ struct CRSADataStruct {
50 50
 	CRSABoneMatrix bone[19];
51 51
 	CRSABoundingBox box;
52 52
 };
53  
-#endif
54 53
 
55 54
 class CRSA : public OniTM {
56 55
 public:
57 56
 	CRSAHeaderStruct *head;
58 57
 	CRSADataStruct *data;
59  
-};
  58
+};
  59
+#endif
4  Oni/Resources/Tags/DOOR.h
@@ -26,9 +26,9 @@ struct DOORDataStruct {
26 26
 	int32_t runtime2;
27 27
 	char dead[20];
28 28
 };
29  
-#endif
30 29
 
31 30
 class DOOR : public OniTM {
32 31
 public:
33 32
 	DOORDataStruct *data;
34  
-};
  33
+};
  34
+#endif
4  Oni/Resources/Tags/DPge.h
@@ -21,9 +21,9 @@ struct DPgeDataStruct {
21 21
 	int32_t IGPG_link;
22 22
 	char dead2[28];
23 23
 };
24  
-#endif
25 24
 
26 25
 class DPge : public OniTM {
27 26
 public:
28 27
 	DPgeDataStruct *data;
29  
-};
  28
+};
  29
+#endif
4  Oni/Resources/Tags/ENVP.h
@@ -45,10 +45,10 @@ struct ENVPDataStruct {
45 45
 	float y_scale;
46 46
 	int32_t runtime[10];
47 47
 };
48  
-#endif
49 48
 
50 49
 class ENVP : public OniTM {
51 50
 public:
52 51
 	ENVPHeaderStruct *head;
53 52
 	ENVPDataStruct *data;
54  
-};
  53
+};
  54
+#endif
4  Oni/Resources/Tags/FILM.h
@@ -35,10 +35,10 @@ struct FILMDataStruct {
35 35
 	int32_t ignored;
36 36
 };
37 37
 
38  
-#endif
39 38
 
40 39
 class FILM : public OniTM {
41 40
 public:
42 41
 	FILMHeaderStruct *head;
43 42
 	FILMDataStruct *data;
44  
-};
  43
+};
  44
+#endif
4  Oni/Resources/Tags/HPge.h
@@ -17,9 +17,9 @@ struct HPgeDataStruct {
17 17
 	int32_t IGPG_link;
18 18
 	char dead[16];
19 19
 };
20  
-#endif
21 20
 
22 21
 class HPge : public OniTM {
23 22
 public:
24 23
 	HPgeDataStruct *data;
25  
-};
  24
+};
  25
+#endif
4  Oni/Resources/Tags/IGHH.h
@@ -30,10 +30,10 @@ struct IGHHDataStruct {
30 30
 	int16_t px_top;
31 31
 };
32 32
 
33  
-#endif
34 33
 
35 34
 class IGHH : public OniTM {
36 35
 public:
37 36
 	IGHHHeaderStruct *head;
38 37
 	IGHHDataStruct *data;
39  
-};
  38
+};
  39
+#endif
4  Oni/Resources/Tags/IGPA.h
@@ -21,10 +21,10 @@ struct IPGADataStruct {
21 21
 	int32_t IGPG_link;
22 22
 };
23 23
 
24  
-#endif
25 24
 
26 25
 class IGPA : public OniTM {
27 26
 public:
28 27
 	IPGAHeaderStruct *head;
29 28
 	IPGADataStruct *data;
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/IGPG.h
@@ -25,9 +25,9 @@ struct IGPGDataStruct {
25 25
 	char unused[28];
26 26
 };
27 27
 
28  
-#endif
29 28
 
30 29
 class IGPG : public OniTM {
31 30
 public:
32 31
 	IGPGDataStruct *data;
33  
-};
  32
+};
  33
+#endif
4  Oni/Resources/Tags/IGSA.h
@@ -21,10 +21,10 @@ struct IGSADataStruct {
21 21
 	int32_t IGSt_link;
22 22
 };
23 23
 
24  
-#endif
25 24
 
26 25
 class IGSA : public OniTM {
27 26
 public:
28 27
 	IGSAHeaderStruct *head;
29 28
 	IGSADataStruct *data;
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/IGSt.h
@@ -22,9 +22,9 @@ struct IGStDataStruct {
22 22
 	char unused[8];
23 23
 };
24 24
 
25  
-#endif
26 25
 
27 26
 class IGSt : public OniTM {
28 27
 public:
29 28
 	IGStDataStruct *data;
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/IPge.h
@@ -18,9 +18,9 @@ struct IPgeDataStruct {
18 18
 	char dead[16];
19 19
 };
20 20
 
21  
-#endif
22 21
 
23 22
 class IPge : public OniTM {
24 23
 public:
25 24
 	IPgeDataStruct *data;
26  
-};
  25
+};
  26
+#endif
4  Oni/Resources/Tags/Impt.h
@@ -19,9 +19,9 @@ struct ImptDataStruct {
19 19
 	char dead[12];
20 20
 };
21 21
 
22  
-#endif
23 22
 
24 23
 class Impt : public OniTM {
25 24
 public:
26 25
 	ImptDataStruct *data;
27  
-};
  26
+};
  27
+#endif
4  Oni/Resources/Tags/Keyl.h
@@ -26,9 +26,9 @@ struct KeylDataStruct {
26 26
 	char dead[16];
27 27
 };
28 28
 
29  
-#endif
30 29
 
31 30
 class Keyl : public OniTM {
32 31
 public:
33 32
 	KeylDataStruct *data;
34  
-};
  33
+};
  34
+#endif
4  Oni/Resources/Tags/M3GA.h
@@ -21,10 +21,10 @@ struct M3GADataStruct {
21 21
 	int32_t M3GM_link;
22 22
 };
23 23
 
24  
-#endif
25 24
 
26 25
 class M3GA : public OniTM {
27 26
 public:
28 27
 	M3GAHeaderStruct *head;
29 28
 	M3GADataStruct *data;
30  
-};
  29
+};
  30
+#endif
4  Oni/Resources/Tags/M3GM.h
@@ -25,9 +25,9 @@ struct M3GMDataStruct {
25 25
 	char unused[20];
26 26
 };
27 27
 
28  
-#endif
29 28
 
30 29
 class M3GM : public OniTM {
31 30
 public:
32 31
 	M3GMDataStruct *data;
33  
-};
  32
+};
  33
+#endif
4  Oni/Resources/Tags/Mtrl.h
@@ -19,9 +19,9 @@ struct MtrlDataStruct {
19 19
 	char dead[12];
20 20
 };
21 21
 
22  
-#endif
23 22
 
24 23
 class Mtrl : public OniTM {
25 24
 public:
26 25
 	MtrlDataStruct *data;
27  
-};
  26
+};
  27
+#endif
11  Oni/Resources/Tags/OBAN.cpp
... ...
@@ -0,0 +1,11 @@
  1
+/*
  2
+ *  OBAN.cpp
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OBAN.h"
  11
+
63  Oni/Resources/Tags/OBAN.h
... ...
@@ -0,0 +1,63 @@
  1
+/*
  2
+ *  OBAN.h
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OniTM.h"
  11
+
  12
+#ifndef _OBAN
  13
+#define _OBAN
  14
+
  15
+struct OBANTransformMatrix {
  16
+	float a1;
  17
+	float a2;
  18
+	float a3;
  19
+	
  20
+	float b1;
  21
+	float b2;
  22
+	float b3;
  23
+	
  24
+	float c1;
  25
+	float c2;
  26
+	float c3;
  27
+	
  28
+	float d1;
  29
+	float d2;
  30
+	float d3;
  31
+};
  32
+
  33
+struct OBANHeaderStruct {
  34
+	char padding[12];
  35
+	int32_t flags;
  36
+	OBANTransformMatrix initial_pos;
  37
+	OBANTransformMatrix fixed_pos;
  38
+	int16_t frame_length;
  39
+	int16_t number_of_frames;
  40
+	int16_t stop_frame;
  41
+	
  42
+	int16_t array_size;
  43
+};
  44
+
  45
+struct OBANDataStruct {
  46
+	float rotation1;
  47
+	float rotation2;
  48
+	float rotation3;
  49
+	float rotation4;
  50
+	
  51
+	float v1;
  52
+	float v2;
  53
+	float v3;
  54
+	
  55
+	int32_t elapsed_frame;
  56
+};
  57
+
  58
+class OBAN : public OniTM {
  59
+public:
  60
+	OBANHeaderStruct *header;
  61
+	OBANDataStruct *data;
  62
+};
  63
+#endif
11  Oni/Resources/Tags/OBOA.cpp
... ...
@@ -0,0 +1,11 @@
  1
+/*
  2
+ *  OBOA.cpp
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OBOA.h"
  11
+
67  Oni/Resources/Tags/OBOA.h
... ...
@@ -0,0 +1,67 @@
  1
+/*
  2
+ *  OBOA.h
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OniTM.h"
  11
+
  12
+#ifndef _OBOA
  13
+#define _OBOA
  14
+
  15
+struct OBOAHeaderStruct {
  16
+	char unused[22];
  17
+	int16_t array_size;
  18
+};
  19
+
  20
+struct OBOADataStruct {
  21
+	int32_t M3GA_link;
  22
+	int32_t OBAN_link;
  23
+	int32_t ENVP_link;
  24
+	int32_t flags;
  25
+	int32_t unknown;
  26
+	int32_t door_id;
  27
+	int32_t physics_type;
  28
+	int32_t script_id;
  29
+	
  30
+	float initial_x;
  31
+	float initial_y;
  32
+	float initial_z;
  33
+	
  34
+	float rotation_x;
  35
+	float rotation_y;
  36
+	float rotation_z;
  37
+	float rotation_w;
  38
+	
  39
+	float scale;
  40
+	
  41
+	float m11;
  42
+	float m21;
  43
+	float m31;
  44
+	
  45
+	float m12;
  46
+	float m22;
  47
+	float m32;
  48
+	
  49
+	float m13;
  50
+	float m23;
  51
+	float m33;
  52
+	
  53
+	float m14;
  54
+	float m24;
  55
+	float m34;
  56
+	
  57
+	char object_name[64];
  58
+	char file_name[64];
  59
+};
  60
+
  61
+
  62
+class OBOA : public OniTM {
  63
+public:
  64
+	OBOAHeaderStruct *head;
  65
+	OBOADataStruct *data;
  66
+};
  67
+#endif
11  Oni/Resources/Tags/OFGA.cpp
... ...
@@ -0,0 +1,11 @@
  1
+/*
  2
+ *  OFGA.cpp
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OFGA.h"
  11
+
32  Oni/Resources/Tags/OFGA.h
... ...
@@ -0,0 +1,32 @@
  1
+/*
  2
+ *  OFGA.h
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OniTM.h"
  11
+
  12
+#ifndef _OFGA
  13
+#define _OFGA
  14
+
  15
+struct OFGAHeaderStruct {
  16
+	char unused[16];
  17
+	int32_t ENVP_link;
  18
+	int32_t array_size;
  19
+};
  20
+
  21
+struct OFGADataStruct {
  22
+	int32_t flags;
  23
+	int32_t M3GM_link;
  24
+	int32_t OBLS_link;
  25
+};
  26
+
  27
+class OFGA : public OniTM {
  28
+public:
  29
+	OFGAHeaderStruct *head;
  30
+	OFGADataStruct *data;
  31
+};
  32
+#endif
11  Oni/Resources/Tags/ONCC.cpp
... ...
@@ -0,0 +1,11 @@
  1
+/*
  2
+ *  ONCC.cpp
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "ONCC.h"
  11
+
212  Oni/Resources/Tags/ONCC.h
... ...
@@ -0,0 +1,212 @@
  1
+/*
  2
+ *  ONCC.h
  3
+ *  OniLevelTool
  4
+ *
  5
+ *  Created by Sam Marshall on 5/2/12.
  6
+ *  Copyright 2012 Sam Marshall. All rights reserved.
  7
+ *
  8
+ */
  9
+
  10
+#include "OniTM.h"
  11
+
  12
+#ifndef _ONCC
  13
+#define _ONCC
  14
+
  15
+struct ONCCShootingSkillsStruct {
  16
+	float recoil_compensation;
  17
+	float aiming_angle;
  18
+	float grouping_error;
  19
+	float grouping_decay;
  20
+	float inaccuracy_multiplier;
  21
+	uint16_t min_delay;
  22
+	uint16_t max_delay;
  23
+};
  24
+
  25
+struct ONCCImpactElementsStruct {
  26
+	char impact_name[128];
  27
+	int16_t runtime;
  28
+};
  29
+
  30
+struct ONCCDataStruct {
  31
+	float downward_velocity;
  32
+	float gravity_acceleration;
  33
+	float starting_velocity;
  34
+	float velocity_limit;
  35
+	float upward_acceleration;
  36
+	int16_t gravity_timer;
  37
+	int16_t jetpack_timer;
  38
+	float no_damage_fall;
  39
+	float damage_fall;
  40
+	
  41
+	// Shadow
  42
+	int32_t TXMP_link_shadow;
  43
+	float height_no_shadow;
  44
+	float diameter_decrease_shadow1;
  45
+	float diameter_decrease_shadow2;
  46
+	float diameter_decrease_shadow3;
  47
+	float diameter_decrease_shadow4;
  48
+	int16_t transparency_shadow1;
  49
+	int16_t transparency_shadow2;
  50
+	
  51
+	// Jump
  52
+	float distance_jump;
  53
+	int8_t height_jump;
  54
+	int8_t square_distance_jump;
  55
+	char unused_jump[2];
  56
+	
  57
+	// Cover
  58
+	float increment_ray;
  59
+	float max_ray;
  60
+	float angle_ray;
  61
+	float max_angle_ray;
  62
+	
  63
+	// Autofreeze
  64
+	float distance_xz;
  65
+	float distance_y;
  66
+	
  67
+	// Inventory
  68
+	int16_t hypo_regeneration;
  69
+	char unused_inventory[2];
  70
+	
  71
+	// LOD
  72
+	float LOD1;
  73
+	float LOD2;
  74
+	float LOD3;
  75
+	float LOD4;
  76
+	float LOD5;
  77
+	
  78
+	// Hurt Sound
  79
+	int16_t hurt_base_percentage;
  80
+	int16_t hurt_max_percentage;
  81
+	int16_t hurt_percentage_threshold;
  82
+	int16_t hurt_timer;
  83
+	int16_t hurt_min_timer;
  84
+	int16_t hurt_max_timer;
  85
+	int16_t hurt_max_light;
  86
+	int16_t hurt_max_medium;
  87
+	int16_t hurt_death_chance;
  88
+	int16_t hurt_volume_threshold;
  89
+	int16_t hurt_medium_threshold;
  90
+	int16_t hurt_heavy_threshold;
  91
+	int8_t hurt_runtime1;
  92
+	char unused_hurt[1];
  93
+	float sound_volume;
  94
+	char hurt_light_sound_name[32];
  95
+	char hurt_medium_sound_name[32];
  96
+	char hurt_heavy_sound_name[32];
  97
+	char death_sound_name[32];
  98
+	int32_t hurt_runtime2;
  99
+	int32_t hurt_runtime3;
  100
+	int32_t hurt_runtime4;
  101
+	int32_t hurt_runtime5;
  102
+	
  103
+	// AI
  104
+	int32_t AI_bitset;
  105
+	float AI_rotation_factor;
  106
+	int16_t AI_min_fallen_time;
  107
+	int16_t AI_max_fallen_time;
  108
+	uint32_t AI_frames;
  109
+	float min_firing_spread;
  110
+	float max_firing_spread;
  111
+	
  112
+	// AI Targeting
  113
+	float AI_target_prediction1;
  114
+	float AI_target_prediction2;
  115
+	float AI_target_prediction3;
  116
+	int32_t AI_target_frame_count1;
  117
+	int32_t AI_target_frame_count2;
  118
+	int32_t AI_target_frame_count3;
  119
+	int32_t AI_target_frame_count4;
  120
+	ONCCShootingSkillsStruct skills[13];
  121
+	
  122
+	int32_t unknown1;
  123
+	int32_t unknown2;
  124
+	int32_t unknown3;
  125
+	int32_t taunt_chance;
  126
+	int32_t go_for_gun_chance;
  127
+	int32_t running_pickup_chance;
  128
+	int16_t combat_profile_id;
  129
+	int16_t melee_profile_id;
  130
+	int8_t taunt_sound_probability;
  131
+	int8_t alert_sound_probability;
  132
+	int8_t startle_sound_probability;
  133
+	int8_t checkbody_sound_probability;
  134
+	int8_t pursue_sound_probability;
  135
+	int8_t cower_sound_probability;
  136
+	int8_t superpunch_sound_probability;
  137
+	int8_t superkick_sound_probability;
  138
+	int8_t super3_sound_probability;
  139
+	int8_t super4_sound_probability;
  140
+	int16_t padding1;
  141
+	char taunt_sound_name[32];
  142
+	char alert_sound_name[32];
  143
+	char startle_sound_name[32];
  144
+	char checkbody_sound_name[32];
  145
+	char pursue_sound_name[32];
  146
+	char cower_sound_name[32];
  147
+	char superpunch_sound_name[32];
  148
+	char superkick_sound_name[32];
  149
+	char super3_sound_name[32];
  150
+	char super4_sound_name[32];
  151
+	
  152
+	float central_distance;
  153
+	float peripheral_distance;
  154
+	float vertical_range;
  155
+	float central_range;
  156
+	float central_max;
  157
+	float peripheral_range;
  158
+	float peripheral_max;
  159
+	int32_t hostile_definite_timer;
  160
+	int32_t hostile_strong_timer;
  161
+	int32_t hostile_weak_timer;
  162
+	int32_t friendly_definite_timer;
  163
+	int32_t friendly_strong_timer;
  164
+	int32_t friendly_weak_timer;
  165
+	float earshot_radius;
  166
+	
  167
+	int32_t ONCV_link;
  168
+	int32_t ONCP_link;
  169
+	int32_t ONIA_link;
  170
+	int8_t runtime1;
  171
+	int8_t padding2;
  172
+	int8_t runtime2;
  173
+	char modifier[16];
  174
+	ONCCImpactElementsStruct impact[15];
  175
+	
  176
+	int16_t padding3;
  177
+	char special_death[64];
  178
+	int32_t runtime3;
  179
+	int32_t runtime4;
  180
+	int32_t TRBS_link;
  181
+	int32_t TRMA_link;
  182
+	int32_t CBPM_link;
  183
+	int32_t CBPI_link;
  184
+	int32_t fight_mode_timer;
  185
+	int32_t idle_animation_timer1;
  186
+	int32_t idle_animation_timer2;
  187
+	int32_t basic_health;
  188
+	int32_t feet_bits;
  189
+	float min_body_factor;
  190
+	float max_body_factor;
  191
+	
  192
+	float unknown4;
  193
+	float unknown5;
  194
+	float stun_timer;
  195
+	float unknown6;
  196
+	float unknown7;
  197
+	float unknown8;
  198
+	float unknown9;
  199
+	float shield_protect;
  200
+	int32_t TRAC_link;
  201
+	int32_t TRSC_link;
  202
+	int16_t AI_rof;
  203
+	int16_t death_to_deletion_frames;
  204
+	int32_t TRSC_flags;
  205
+	char dead[8];
  206
+};
  207
+
  208
+class ONCC : public OniTM {
  209
+public:
  210
+	ONCCDataStruct *data;
  211
+};
  212
+#endif
5  Oni/Resources/Tags/OniTM.h
@@ -15,12 +15,13 @@ struct OniTMStruct {
15 15
 	char res_id[4];
16 16
 	char level_id[4];
17 17
 };
18  
-#endif
19 18
 
20 19
 class OniTM {
21 20
 public:
22 21
 	char type[5];
23 22
 	OniTMStruct *header;
  23
+	
24 24
 	OniTM();
25 25
 	~OniTM();
26  
-};
  26
+};
  27
+#endif
68  Oni/Resources/Tags/Tags.h
@@ -41,4 +41,70 @@
41 41
 #include "Keyl.h"
42 42
 #include "M3GA.h"
43 43
 #include "M3GM.h"
44  
-#include "Mtrl.h"
  44
+#include "Mtrl.h"
  45
+#include "OBAN.h"
  46
+#include "OBOA.h"
  47
+#include "OFGA.h"
  48
+#include "ONCC.h"
  49
+/*#include "ONCP.h"
  50
+#include "ONCV.h"
  51
+#include "ONGS.h"
  52
+#include "ONIA.h"
  53
+#include "ONLD.h"
  54
+#include "ONLV.h"
  55
+#include "ONOA.h"
  56
+#include "ONSK.h"
  57
+#include "ONVL.h"
  58
+#include "ONWC.h"
  59
+#include "OPge.h"
  60
+#include "OSBD.h"
  61
+#include "OTIT.h"
  62
+#include "OTLF.h"
  63
+#include "PLEA.h"
  64
+#include "PNTA.h"
  65
+#include "PSpc.h"
  66
+#include "PSpL.h"
  67
+#include "PSUI.h"
  68
+#include "QTNA.h"
  69
+#include "SNDD.h"
  70
+#include "SUBT.h"
  71
+#include "TRAC.h"
  72
+#include "TRAM.h"
  73
+#include "TRAS.h"
  74
+#include "TRBS.h"
  75
+#include "TRCM.h"
  76
+#include "TRGA.h"
  77
+#include "TRGE.h"
  78
+#include "TRIA.h"
  79
+#include "TRIG.h"
  80
+#include "TRMA.h"
  81
+#include "TRSC.h"
  82
+#include "TRTA.h"
  83
+#include "TSFF.h"
  84
+#include "TSFL.h"
  85
+#include "TSFT.h"
  86
+#include "TSGA.h"
  87
+#include "TURR.h"
  88
+#include "TXAN.h"
  89
+#include "TXCA.h"
  90
+#include "TXMA.h"
  91
+#include "TXMB.h"
  92
+#include "TXMP.h"
  93
+#include "TxtC.h"
  94
+#include "VCRA.h"
  95
+#include "WMCL.h"
  96
+#include "WMDD.h"
  97
+#include "WMM_.h"
  98
+#include "WMMB.h"
  99
+#include "WPge.h"
  100
+
  101
+#include "AGDB.h"
  102
+#include "AITR.h"
  103
+#include "AKDA.h"
  104
+#include "OBDC.h"
  105
+#include "ONFA.h"
  106
+#include "ONMA.h"
  107
+#include "ONSA.h"
  108
+#include "ONTA.h"
  109
+#include "StNA.h"
  110
+#include "TStr.h"*/
24  OniLevelTool.xcodeproj/project.pbxproj
@@ -45,6 +45,10 @@
45 45
 		227B511B1550CBF80062C139 /* M3GA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B511A1550CBF80062C139 /* M3GA.cpp */; };
46 46
 		227B51211550CCA70062C139 /* M3GM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B51201550CCA70062C139 /* M3GM.cpp */; };
47 47
 		227B51271550CD3F0062C139 /* Mtrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B51261550CD3F0062C139 /* Mtrl.cpp */; };
  48
+		227B51541551702D0062C139 /* OBAN.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B51531551702D0062C139 /* OBAN.cpp */; };
  49
+		227B515B1551739A0062C139 /* OBOA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B515A1551739A0062C139 /* OBOA.cpp */; };
  50
+		227B515F155174B90062C139 /* OFGA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B515E155174B90062C139 /* OFGA.cpp */; };
  51
+		227B51631551754F0062C139 /* ONCC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 227B51621551754F0062C139 /* ONCC.cpp */; };
48 52
 		8DD76F650486A84900D96B5E /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.cpp */; settings = {ATTRIBUTES = (); }; };
49 53
 		8DD76F6A0486A84900D96B5E /* OniLevelTool.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E8B029090EE04C91782 /* OniLevelTool.1 */; };
50 54
 /* End PBXBuildFile section */
@@ -142,6 +146,14 @@
142 146
 		227B51201550CCA70062C139 /* M3GM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = M3GM.cpp; sourceTree = "<group>"; };
143 147
 		227B51251550CD3F0062C139 /* Mtrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mtrl.h; sourceTree = "<group>"; };
144 148
 		227B51261550CD3F0062C139 /* Mtrl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mtrl.cpp; sourceTree = "<group>"; };
  149
+		227B51521551702D0062C139 /* OBAN.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OBAN.h; sourceTree = "<group>"; };
  150
+		227B51531551702D0062C139 /* OBAN.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OBAN.cpp; sourceTree = "<group>"; };
  151
+		227B51591551739A0062C139 /* OBOA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OBOA.h; sourceTree = "<group>"; };
  152
+		227B515A1551739A0062C139 /* OBOA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OBOA.cpp; sourceTree = "<group>"; };
  153
+		227B515D155174B90062C139 /* OFGA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OFGA.h; sourceTree = "<group>"; };
  154
+		227B515E155174B90062C139 /* OFGA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OFGA.cpp; sourceTree = "<group>"; };
  155
+		227B51611551754F0062C139 /* ONCC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ONCC.h; sourceTree = "<group>"; };
  156
+		227B51621551754F0062C139 /* ONCC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ONCC.cpp; sourceTree = "<group>"; };
145 157
 		8DD76F6C0486A84900D96B5E /* OniLevelTool */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OniLevelTool; sourceTree = BUILT_PRODUCTS_DIR; };
146 158
 		C6859E8B029090EE04C91782 /* OniLevelTool.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = OniLevelTool.1; sourceTree = "<group>"; };
147 159
 /* End PBXFileReference section */
@@ -281,6 +293,14 @@
281 293
 				227B51201550CCA70062C139 /* M3GM.cpp */,
282 294
 				227B51251550CD3F0062C139 /* Mtrl.h */,
283 295
 				227B51261550CD3F0062C139 /* Mtrl.cpp */,
  296
+				227B51521551702D0062C139 /* OBAN.h */,
  297
+				227B51531551702D0062C139 /* OBAN.cpp */,
  298
+				227B51591551739A0062C139 /* OBOA.h */,
  299
+				227B515A1551739A0062C139 /* OBOA.cpp */,
  300
+				227B515D155174B90062C139 /* OFGA.h */,
  301
+				227B515E155174B90062C139 /* OFGA.cpp */,
  302
+				227B51611551754F0062C139 /* ONCC.h */,
  303
+				227B51621551754F0062C139 /* ONCC.cpp */,
284 304
 			);
285 305
 			name = Tags;
286 306
 			path = Oni/Resources/Tags;
@@ -383,6 +403,10 @@
383 403
 				227B511B1550CBF80062C139 /* M3GA.cpp in Sources */,
384 404
 				227B51211550CCA70062C139 /* M3GM.cpp in Sources */,
385 405
 				227B51271550CD3F0062C139 /* Mtrl.cpp in Sources */,
  406
+				227B51541551702D0062C139 /* OBAN.cpp in Sources */,
  407
+				227B515B1551739A0062C139 /* OBOA.cpp in Sources */,
  408
+				227B515F155174B90062C139 /* OFGA.cpp in Sources */,
  409
+				227B51631551754F0062C139 /* ONCC.cpp in Sources */,
386 410
 			);
387 411
 			runOnlyForDeploymentPostprocessing = 0;
388 412
 		};
14  main.cpp
@@ -13,12 +13,14 @@ int main (int argc, char * const argv[]) {
13 13
 		} else {
14 14
 			OniLevel *level = new OniLevel;
15 15
 			bool status = level->LoadPath(argv[1]);
16  
-			printf("Success: %s\n", status ? "Yes" : "No");
17  
-			
18  
-			for (int32_t i = 0; i < level->header->instance_count; i++) {
19  
-				OniTag *tag = new OniTag;
20  
-				tag->LoadFrom(&level->instance_descriptors[i], level->data_table, level->names_table);
21  
-				delete tag;
  16
+			printf("Load Success: %s\n", status ? "Yes" : "No");
  17
+			if (status) {
  18
+				level->LoadTags();
  19
+				for (int32_t i = 0; i < level->tags.size(); i++) {
  20
+					OniTag *tag = level->tags.at(i);
  21
+					std::cout << tag->type << " - " << tag->name << " - " << tag->flags << std::endl;
  22
+					delete tag;
  23