# HG changeset patch # User Thibaut Girka # Date 1312292713 -7200 # Node ID 0a7e6e3d5327055c1f677cff9d7884004a2b4883 # Parent b1bec4b5ccf317a3c1d19346d124d99ea9775f39 Improve anm and std documentation. diff --git a/06/anm.xml b/06/anm.xml --- a/06/anm.xml +++ b/06/anm.xml @@ -164,8 +164,9 @@ 23 - set_origin - Apply transformations to the center of the quad, instead of its bottom-left corner. + set_bottom_left_as_origin + Set the sprite's bottom-left corner as its origin (otherwise, the sprite's origin is its center). + This parameter effectively translates the sprite by (width / 2., height / 2., 0.) once every other sprite operation has been executed. diff --git a/06/std.xhtml b/06/std.xhtml --- a/06/std.xhtml +++ b/06/std.xhtml @@ -11,11 +11,11 @@

Header

 typedef struct {
-    uint16_t nb_objects; //TODO
-    uint16_t nb_faces; //TODO
-    uint32_t faces_offset; //TODO
-    uint32_t messages_offset; //TODO
-    uint32_t unknown; //TODO: always 0
+    uint16_t nb_objects; // Number of background objects contained in the file
+    uint16_t nb_faces; // Number of faces/quads for the aforementioned objects
+    uint32_t faces_offset;
+    uint32_t script_offset;
+    uint32_t unknown; // Always 0
     char stage_name[128]; // Name of the stage in SHIFT_JIS
     char song1_name[128]; // Name of the first song in SHIFT_JIS
     char song2_name[128]; // Name of the second song in SHIFT_JIS
@@ -50,13 +50,13 @@ typedef struct {
     float x; // x coordinate of the bottom-left corner of the quad
     float y; // y coordinate of the bottom-left corner of the quad
     float z; // z coordinate of the bottom-left corner of the quad
-    float width; // If 0, defaults to 32.0f
-    float height; // If 0, defaults to 32.0f
+    float width; // If not 0, override the sprite's width (else, use anm info)
+    float height; // If not 0, override the sprite's height (else, use anm info)
 } thstd_object_t;
 
 struct object {
     struct object_header header;
-    struct object_quad quads[]; // Stop when quads.unknown1 == 0x0004ff
+    struct object_quad quads[]; // Stop when quads.unknown == 0x0004ff
 };
 
@@ -77,42 +77,65 @@ typedef struct { float x; float y; float z; -} thstd_face_t; +} thstd_object_instance_t; // ends with 16 \xFF

Third Section

-

This section is responsible for camera movement, color effects, and such things.

+

This section is responsible for camera movement, fog effects, and such things.

 typedef struct {
     uint32_t frame_num;
-    uint16_t type; // 1=colormsg
-    uint16_t unknown; //TODO: Probably the size of the message, always 0x0c, ignored by the game
+    uint16_t type;
+    uint16_t size; // always 0x0c, ignored by the game
     uint32_t arg1;
     float arg2;
     float arg3;
-} thstd_message_t;
+} thstd_instr_t;
+
 
 typedef struct {
     uint8_t b;
     uint8_t g;
     uint8_t r;
-    uint8_t unknown1; // Seems useless. padding?
+    uint8_t unknown; //TODO: Seems useless. padding? Alpha?
 } color_t;
 
-typedef struct {
+
+typedef struct { // .type == 1
     color_t color;
-    float opacity_gradient_start; //TODO
-    float opacity_gradient_stop; //TODO
-} thstd_colormsg_t;
+    float fog_start;
+    float fog_end;
+} thstd_fog_instr_t;
 
-typedef struct {
+
+typedef struct { // type == 0
     float x;
     float y;
     float z;
-} thstd_cameramsg_t;
+} thstd_viewpos_instr_t;
+
+
+typedef struct { // type == 2
+    uint32_t unknown_x; //TODO
+    uint32_t center_dy; // y delta between the camera position and its view center
+    float dz; // z coordinate of the camera, divided by -835.979370
+} thstd_viewpos2_instr_t;
+
+
+typedef struct { // type == 3
+    uint32_t duration; // Duration of the interpolation, in frames
+    uint32_t unused[2];
+} thstd_start_interpolating_viewpos_instr_t;
+
+
+typedef struct { // type == 4
+    uint32_t duration; // Duration of the interpolation, in frames
+    uint32_t unused[2];
+} thstd_start_interpolating_fog_instr_t;
+
 // ends with 20 \xFF