Use lvl1 as default

This commit is contained in:
ABelliqueux 2021-06-23 19:38:16 +02:00
parent 379504c40e
commit c11e2b3011
2 changed files with 87 additions and 84 deletions

View File

@ -16,65 +16,66 @@ struct NODE;
struct QUAD; struct QUAD;
typedef struct BODY { typedef struct BODY {
VECTOR gForce; VECTOR gForce;
VECTOR position; VECTOR position;
SVECTOR velocity; SVECTOR velocity;
int mass; int mass;
int invMass; int invMass;
VECTOR min; VECTOR min;
VECTOR max; VECTOR max;
int restitution; int restitution;
} BODY; } BODY;
typedef struct VANIM { typedef struct VANIM {
int nframes; // number of frames e.g 20 int nframes; // number of frames e.g 20
int nvert; // number of vertices e.g 21 int nvert; // number of vertices e.g 21
int cursor; // anim cursor int cursor; // anim cursor
int lerpCursor; // anim cursor int lerpCursor; // anim cursor
int dir; // playback direction (1 or -1) int dir; // playback direction (1 or -1)
int interpolate; // use lerp to interpolate keyframes int interpolate; // use lerp to interpolate keyframes
SVECTOR data[]; // vertex pos as SVECTORs e.g 20 * 21 SVECTORS SVECTOR data[]; // vertex pos as SVECTORs e.g 20 * 21 SVECTORS
} VANIM; } VANIM;
typedef struct PRIM { typedef struct PRIM {
VECTOR order; VECTOR order;
int code; // Same as POL3/POL4 codes : Code (F3 = 1, FT3 = 2, G3 = 3, int code; // Same as POL3/POL4 codes : Code (F3 = 1, FT3 = 2, G3 = 3,
// GT3 = 4) Code (F4 = 5, FT4 = 6, G4 = 7, GT4 = 8) // GT3 = 4) Code (F4 = 5, FT4 = 6, G4 = 7, GT4 = 8)
} PRIM; } PRIM;
typedef struct MESH { typedef struct MESH {
TMESH * tmesh; TMESH * tmesh;
PRIM * index; PRIM * index;
TIM_IMAGE * tim; TIM_IMAGE * tim;
unsigned long * tim_data; unsigned long * tim_data;
MATRIX mat; MATRIX mat;
VECTOR pos; VECTOR pos;
SVECTOR rot; SVECTOR rot;
short isRigidBody; short isRigidBody;
short isStaticBody; short isStaticBody;
short isPrism; short isPrism;
short isAnim; short isAnim;
short isActor; short isActor;
short isLevel; short isLevel;
short isBG; short isBG;
short isSprite; short isSprite;
long p; long p;
long OTz; long OTz;
BODY * body; BODY * body;
VANIM * anim; VANIM * anim;
struct NODE * node; struct NODE * node;
VECTOR pos2D; VECTOR pos2D;
} MESH; } MESH;
typedef struct QUAD { typedef struct QUAD {
VECTOR v0, v1; VECTOR v0, v1;
VECTOR v2, v3; VECTOR v2, v3;
} QUAD; } QUAD;
typedef struct CAMPOS { typedef struct CAMPOS {
VECTOR pos; VECTOR pos;
SVECTOR rot; SVECTOR rot;
} CAMPOS; } CAMPOS;
// Blender cam ~= PSX cam with these settings : // Blender cam ~= PSX cam with these settings :
// NTSC - 320x240, PAL 320x256, pixel ratio 1:1, // NTSC - 320x240, PAL 320x256, pixel ratio 1:1,
@ -83,48 +84,48 @@ typedef struct CAMPOS {
// Lower values mean wider angle // Lower values mean wider angle
typedef struct CAMANGLE { typedef struct CAMANGLE {
CAMPOS * campos; CAMPOS * campos;
TIM_IMAGE * BGtim; TIM_IMAGE * BGtim;
unsigned long * tim_data; unsigned long * tim_data;
QUAD bw, fw; QUAD bw, fw;
int index; int index;
MESH * objects[]; MESH * objects[];
} CAMANGLE; } CAMANGLE;
typedef struct CAMPATH { typedef struct CAMPATH {
short len, cursor, pos; short len, cursor, pos;
VECTOR points[]; VECTOR points[];
} CAMPATH; } CAMPATH;
typedef struct SIBLINGS { typedef struct SIBLINGS {
int index; int index;
struct NODE * list[]; struct NODE * list[];
} SIBLINGS ; } SIBLINGS ;
typedef struct CHILDREN { typedef struct CHILDREN {
int index; int index;
MESH * list[]; MESH * list[];
} CHILDREN ; } CHILDREN ;
typedef struct NODE { typedef struct NODE {
MESH * plane; MESH * plane;
SIBLINGS * siblings; SIBLINGS * siblings;
CHILDREN * objects; CHILDREN * objects;
CHILDREN * rigidbodies; CHILDREN * rigidbodies;
} NODE; } NODE;
typedef struct LEVEL { typedef struct LEVEL {
CVECTOR * BGc; CVECTOR * BGc;
MATRIX * cmat; MATRIX * cmat;
MATRIX * lgtmat; MATRIX * lgtmat;
MESH ** meshes; MESH ** meshes;
int * meshes_length; int * meshes_length;
MESH * actorPtr; MESH * actorPtr;
MESH * levelPtr; MESH * levelPtr;
MESH * propPtr; MESH * propPtr;
CAMANGLE * camPtr; CAMANGLE * camPtr;
CAMPATH * camPath; CAMPATH * camPath;
CAMANGLE ** camAngles; CAMANGLE ** camAngles;
NODE * curNode; NODE * curNode;
MESH * meshPlan; // This one is temporary MESH * meshPlan; // This one is temporary
} LEVEL; } LEVEL;

View File

@ -36,7 +36,9 @@ u_long overlaySize = 0;
#include "../levels/level0.h" #include "../levels/level0.h"
#include "../levels/level1.h" #include "../levels/level1.h"
volatile u_char level = 0; //FIXME : Refresh BGc, lightmatrix on ovly upload...
volatile u_char level = 1;
// level 1 : 8003F05C -2147225508 // level 1 : 8003F05C -2147225508
// level 0 : 800AF744 -2146764988 // level 0 : 800AF744 -2146764988
// 80010000 -2147418112 -> -2147483648 // 80010000 -2147418112 -> -2147483648