From 354ddb3ed9c069b0b7527e0e3634ada511fada89 Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Sun, 8 Aug 2021 18:23:36 +0200 Subject: [PATCH] Add 'isWall' flag, TMD wip --- File-formats-structures.md | 48 ++++++++++++++++++++++++++++++++++++++ Flags.md | 7 ++++-- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/File-formats-structures.md b/File-formats-structures.md index 95741ce..02ba780 100644 --- a/File-formats-structures.md +++ b/File-formats-structures.md @@ -37,3 +37,51 @@ typedef struct TIM_FILE{ PIXEL pixel[]; } TIM_FILE; ``` + +### TMD + +**WIP** + +See http://psx.arthus.net/sdk/Psy-Q/DOCS/FileFormat47.pdf , p.71 + +```c +typedef struct TMD_HEADER { + u_long ID; // TMD file version - current is 0x00000041 + u_long flags; // LSB (FIXP) is either 0 or 1, all other bits are 0 + u_long nobj; // Number of objects in TMD +} TMD_HEADER; + +struct TMD_OBJECT { + u_long *vert_top; // Start address of a vertex - if FIXP is 1, absolute address, else, relative to object's block address + u_long n_vert; // Number of vertices + u_long *normal top; // Start address of a normal - if FIXP is 1, absolute address, else, relative to object's block address + u_long n_normal; // Number of normals + u_long *primitive top; // Start address of a primitive - if FIXP is 1, absolute address, else, relative to object's block address + u_long n_primitive; // Number of primitives + long scale; // Scaling factor - scale value is scale factor^2 . -1 is 1/2. +} TMD_OBJECT; + +struct TMD_PACKET { + u_short mode, flag; + u_short ilen; // data section length in words + u_short olen; // word length + u_long data; + } TMD_PACKET; +struct TMD_VERTEX { + short vx, vy, vz; + short pad; +} TMD_VERTEX; + +struct TMD_NORMAL { + short vx, vy, vz; // fixed point value with scale 1.0 == 4096 + short pad; +} TMD_NORMAL; + +typedef struct TMD_FILE { + TMD_HEADER header; + TMD_OBJECT objTable[]; // objTable has length TMD_HEADER.nobj + TMD_PACKET primitive[]; // primtive has length TM_PACKET.ilen + TMD_VERTEX vertex; + TMD_NORMAL normal; +} TMD_FILE; +``` diff --git a/Flags.md b/Flags.md index cba43f1..f6a2e59 100644 --- a/Flags.md +++ b/Flags.md @@ -2,10 +2,12 @@ **Remember this is WIP, so these might change !** -Flags are set in the 'Data' tab of the blender objects. +Flags are custom properties set in the 'Data' tab of the blender objects. ![Flags](https://wiki.arthus.net/assets/flags.jpg) +A [small blender addon](https://github.com/ABelliqueux/blender_io_export_psx_mesh/blob/main/copy_custom_prop.py) is provided that facilitates copying [flags](https://github.com/ABelliqueux/blender_io_export_psx_mesh/wiki/Flags) between several objects in your scene. + ## Objects flags ### Physics @@ -16,6 +18,7 @@ Flags are set in the 'Data' tab of the blender objects. isRound 0 boolean Object should roll when pushed. isStaticBody 0 boolean Object does not collide with actor. isLevel 0 boolean Designate the level planes. Used for BSP and collisions. +isWall 0 boolean Designate the level walls. Used for collisions. mass 1 integer Object's mass restitution 0 integer Object's restitution @@ -59,4 +62,4 @@ Flags are set in the 'Data' tab of the blender objects. -
FlagDefault valueValue typeDesc.
isPortal 0 boolean Is a portal object.
\ No newline at end of file +