Mercurial > touhou-doc
comparison 06/std.xhtml @ 1:b1bec4b5ccf3
Add anm and pbg3 file formats, and improve the std one.
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Tue, 02 Aug 2011 14:18:01 +0200 |
| parents | f82309a9465e |
| children | 0a7e6e3d5327 |
comparison
equal
deleted
inserted
replaced
| 0:f82309a9465e | 1:b1bec4b5ccf3 |
|---|---|
| 1 <?xml version="1.0" encoding="utf-8"?> | 1 <?xml version="1.0" encoding="utf-8"?> |
| 2 <?xml-stylesheet type="text/css" href="../style.css"?> | |
| 2 <!DOCTYPE html> | 3 <!DOCTYPE html> |
| 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> | 4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 <head> | 5 <head> |
| 5 <title>STD format</title> | 6 <title>STD format</title> |
| 6 </head> | 7 </head> |
| 7 <body> | 8 <body> |
| 8 <h1>STD format</h1> | 9 <h1>STD format</h1> |
| 9 <p>All integers are little endian, all number are hex.</p> | |
| 10 | 10 |
| 11 <h2>Header</h2> | 11 <h2>Header</h2> |
| 12 <pre> | 12 <pre> |
| 13 0 - 2 - | 13 typedef struct { |
| 14 2 - 2 - | 14 uint16_t nb_objects; //TODO |
| 15 4 - 4 - Size of something | 15 uint16_t nb_faces; //TODO |
| 16 8 - 2 - | 16 uint32_t faces_offset; //TODO |
| 17 a - 6 - Always zero | 17 uint32_t messages_offset; //TODO |
| 18 10 - 80 - Name of the stage | 18 uint32_t unknown; //TODO: always 0 |
| 19 90 - 80 - Name of the first song | 19 char stage_name[128]; // Name of the stage in SHIFT_JIS |
| 20 110 - 80 - Name of the second song | 20 char song1_name[128]; // Name of the first song in SHIFT_JIS |
| 21 190 - 80 - A string of only a single whitespace | 21 char song2_name[128]; // Name of the second song in SHIFT_JIS |
| 22 210 - 80 - A string of only a single whitespace | 22 char song3_name[128]; // ? A single blank if unused |
| 23 290 - 80 - path to the first song (as midi) | 23 char song4_name[128]; // ? A single blank if unused |
| 24 310 - 80 - path to the second song (as midi) | 24 char song1_path[128]; |
| 25 390 - 80 - A string of only a single whitespace | 25 char song2_path[128]; |
| 26 410 - 80 - A string of only a single whitespace | 26 char song3_path[128]; // ? A single blank if unused |
| 27 490 - ... - The real data</pre> | 27 char song4_path[128]; // ? A single blank if unused |
| 28 } thstd_header_t; | |
| 29 </pre> | |
| 28 | 30 |
| 29 <h2>Data</h2> | 31 <h2>First section</h2> |
| 30 <pre> | 32 <p>This section is responsible for creating objects from the stgxbg.anm file.</p> |
| 31 0 - ... - ... | 33 <pre> |
| 34 struct object_header { | |
| 35 uint16_t id; // Always equal to the object's number. Not used by the game. | |
| 36 uint16_t unknown1; //TODO | |
| 37 float unknown2; //TODO | |
| 38 uint32_t unknown3; //TODO | |
| 39 float unknown4; //TODO | |
| 40 float unknown5; //TODO | |
| 41 float unknown6; //TODO | |
| 42 float unknown7; //TODO | |
| 43 }; | |
| 44 | |
| 45 typedef struct { | |
| 46 uint16_t unknown; // 0 means a quad, 0xffff means the end. | |
| 47 uint16_t size; // 0x1c for a quad, 4 for the end marker. | |
| 48 uint16_t script_index; // Index of a script entry in the corresponding anm file | |
| 49 uint16_t _padding; // Unused, padding | |
| 50 float x; // x coordinate of the bottom-left corner of the quad | |
| 51 float y; // y coordinate of the bottom-left corner of the quad | |
| 52 float z; // z coordinate of the bottom-left corner of the quad | |
| 53 float width; // If 0, defaults to 32.0f | |
| 54 float height; // If 0, defaults to 32.0f | |
| 55 } thstd_object_t; | |
| 56 | |
| 57 struct object { | |
| 58 struct object_header header; | |
| 59 struct object_quad quads[]; // Stop when quads.unknown1 == 0x0004ff | |
| 60 }; | |
| 61 </pre> | |
| 62 | |
| 63 <p>The following description is symbolic.</p> | |
| 64 <pre> | |
| 65 struct section1 { | |
| 66 uint32_t offsets[]; // header.nb_objects offsets towards objects | |
| 67 };*/ | |
| 68 </pre> | |
| 69 | |
| 70 | |
| 71 <h2>Second section</h2> | |
| 72 <p>This section is responsible for placing objects from section 1 in the space.</p> | |
| 73 <pre> | |
| 74 typedef struct { | |
| 75 uint16_t object_id; // must not exceed header.nb_objects | |
| 76 uint16_t unknown1; // Always 256, doesn't seem to change anything | |
| 77 float x; | |
| 78 float y; | |
| 79 float z; | |
| 80 } thstd_face_t; | |
| 81 // ends with 16 \xFF | |
| 82 </pre> | |
| 83 | |
| 84 | |
| 85 | |
| 86 <h2>Third Section</h2> | |
| 87 <p>This section is responsible for camera movement, color effects, and such things.</p> | |
| 88 <pre> | |
| 89 typedef struct { | |
| 90 uint32_t frame_num; | |
| 91 uint16_t type; // 1=colormsg | |
| 92 uint16_t unknown; //TODO: Probably the size of the message, always 0x0c, ignored by the game | |
| 93 uint32_t arg1; | |
| 94 float arg2; | |
| 95 float arg3; | |
| 96 } thstd_message_t; | |
| 97 | |
| 98 typedef struct { | |
| 99 uint8_t b; | |
| 100 uint8_t g; | |
| 101 uint8_t r; | |
| 102 uint8_t unknown1; // Seems useless. padding? | |
| 103 } color_t; | |
| 104 | |
| 105 typedef struct { | |
| 106 color_t color; | |
| 107 float opacity_gradient_start; //TODO | |
| 108 float opacity_gradient_stop; //TODO | |
| 109 } thstd_colormsg_t; | |
| 110 | |
| 111 typedef struct { | |
| 112 float x; | |
| 113 float y; | |
| 114 float z; | |
| 115 } thstd_cameramsg_t; | |
| 116 // ends with 20 \xFF | |
| 117 </pre> | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 <pre> | |
| 126 typedef struct { | |
| 127 thstd_header_t header; | |
| 128 uint32_t* offsets; | |
| 129 list_t objects; | |
| 130 list_t faces; | |
| 131 list_t messages; | |
| 132 } PACK_ATTRIBUTE thstd_t; | |
| 32 </pre> | 133 </pre> |
| 33 </body> | 134 </body> |
| 34 </html> | 135 </html> |
