comparison 06/std.xhtml @ 2:0a7e6e3d5327

Improve anm and std documentation.
author Thibaut Girka <thib@sitedethib.com>
date Tue, 02 Aug 2011 15:45:13 +0200
parents b1bec4b5ccf3
children bd0f1253691d
comparison
equal deleted inserted replaced
1:b1bec4b5ccf3 2:0a7e6e3d5327
9 <h1>STD format</h1> 9 <h1>STD format</h1>
10 10
11 <h2>Header</h2> 11 <h2>Header</h2>
12 <pre> 12 <pre>
13 typedef struct { 13 typedef struct {
14 uint16_t nb_objects; //TODO 14 uint16_t nb_objects; // Number of background objects contained in the file
15 uint16_t nb_faces; //TODO 15 uint16_t nb_faces; // Number of faces/quads for the aforementioned objects
16 uint32_t faces_offset; //TODO 16 uint32_t faces_offset;
17 uint32_t messages_offset; //TODO 17 uint32_t script_offset;
18 uint32_t unknown; //TODO: always 0 18 uint32_t unknown; // Always 0
19 char stage_name[128]; // Name of the stage in SHIFT_JIS 19 char stage_name[128]; // Name of the stage in SHIFT_JIS
20 char song1_name[128]; // Name of the first song in SHIFT_JIS 20 char song1_name[128]; // Name of the first song in SHIFT_JIS
21 char song2_name[128]; // Name of the second song in SHIFT_JIS 21 char song2_name[128]; // Name of the second song in SHIFT_JIS
22 char song3_name[128]; // ? A single blank if unused 22 char song3_name[128]; // ? A single blank if unused
23 char song4_name[128]; // ? A single blank if unused 23 char song4_name[128]; // ? A single blank if unused
48 uint16_t script_index; // Index of a script entry in the corresponding anm file 48 uint16_t script_index; // Index of a script entry in the corresponding anm file
49 uint16_t _padding; // Unused, padding 49 uint16_t _padding; // Unused, padding
50 float x; // x coordinate of the bottom-left corner of the quad 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 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 52 float z; // z coordinate of the bottom-left corner of the quad
53 float width; // If 0, defaults to 32.0f 53 float width; // If not 0, override the sprite's width (else, use anm info)
54 float height; // If 0, defaults to 32.0f 54 float height; // If not 0, override the sprite's height (else, use anm info)
55 } thstd_object_t; 55 } thstd_object_t;
56 56
57 struct object { 57 struct object {
58 struct object_header header; 58 struct object_header header;
59 struct object_quad quads[]; // Stop when quads.unknown1 == 0x0004ff 59 struct object_quad quads[]; // Stop when quads.unknown == 0x0004ff
60 }; 60 };
61 </pre> 61 </pre>
62 62
63 <p>The following description is symbolic.</p> 63 <p>The following description is symbolic.</p>
64 <pre> 64 <pre>
75 uint16_t object_id; // must not exceed header.nb_objects 75 uint16_t object_id; // must not exceed header.nb_objects
76 uint16_t unknown1; // Always 256, doesn't seem to change anything 76 uint16_t unknown1; // Always 256, doesn't seem to change anything
77 float x; 77 float x;
78 float y; 78 float y;
79 float z; 79 float z;
80 } thstd_face_t; 80 } thstd_object_instance_t;
81 // ends with 16 \xFF 81 // ends with 16 \xFF
82 </pre> 82 </pre>
83 83
84 84
85 85
86 <h2>Third Section</h2> 86 <h2>Third Section</h2>
87 <p>This section is responsible for camera movement, color effects, and such things.</p> 87 <p>This section is responsible for camera movement, fog effects, and such things.</p>
88 <pre> 88 <pre>
89 typedef struct { 89 typedef struct {
90 uint32_t frame_num; 90 uint32_t frame_num;
91 uint16_t type; // 1=colormsg 91 uint16_t type;
92 uint16_t unknown; //TODO: Probably the size of the message, always 0x0c, ignored by the game 92 uint16_t size; // always 0x0c, ignored by the game
93 uint32_t arg1; 93 uint32_t arg1;
94 float arg2; 94 float arg2;
95 float arg3; 95 float arg3;
96 } thstd_message_t; 96 } thstd_instr_t;
97
97 98
98 typedef struct { 99 typedef struct {
99 uint8_t b; 100 uint8_t b;
100 uint8_t g; 101 uint8_t g;
101 uint8_t r; 102 uint8_t r;
102 uint8_t unknown1; // Seems useless. padding? 103 uint8_t unknown; //TODO: Seems useless. padding? Alpha?
103 } color_t; 104 } color_t;
104 105
105 typedef struct { 106
107 typedef struct { // .type == 1
106 color_t color; 108 color_t color;
107 float opacity_gradient_start; //TODO 109 float fog_start;
108 float opacity_gradient_stop; //TODO 110 float fog_end;
109 } thstd_colormsg_t; 111 } thstd_fog_instr_t;
110 112
111 typedef struct { 113
114 typedef struct { // type == 0
112 float x; 115 float x;
113 float y; 116 float y;
114 float z; 117 float z;
115 } thstd_cameramsg_t; 118 } thstd_viewpos_instr_t;
119
120
121 typedef struct { // type == 2
122 uint32_t unknown_x; //TODO
123 uint32_t center_dy; // y delta between the camera position and its view center
124 float dz; // z coordinate of the camera, divided by -835.979370
125 } thstd_viewpos2_instr_t;
126
127
128 typedef struct { // type == 3
129 uint32_t duration; // Duration of the interpolation, in frames
130 uint32_t unused[2];
131 } thstd_start_interpolating_viewpos_instr_t;
132
133
134 typedef struct { // type == 4
135 uint32_t duration; // Duration of the interpolation, in frames
136 uint32_t unused[2];
137 } thstd_start_interpolating_fog_instr_t;
138
116 // ends with 20 \xFF 139 // ends with 20 \xFF
117 </pre> 140 </pre>
118 141
119 142
120 143