Fixes #5: 't' is now used in drawPoly()
This commit is contained in:
parent
d2f5a86ef0
commit
92d05f24a7
173
custom_types.h
173
custom_types.h
@ -16,66 +16,67 @@ 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;
|
int totalVerts;
|
||||||
PRIM * index;
|
TMESH * tmesh;
|
||||||
TIM_IMAGE * tim;
|
PRIM * index;
|
||||||
unsigned long * tim_data;
|
TIM_IMAGE * tim;
|
||||||
MATRIX mat;
|
unsigned long * tim_data;
|
||||||
VECTOR pos;
|
MATRIX mat;
|
||||||
SVECTOR rot;
|
VECTOR pos;
|
||||||
short isRigidBody;
|
SVECTOR rot;
|
||||||
short isStaticBody;
|
short isRigidBody;
|
||||||
short isRound;
|
short isStaticBody;
|
||||||
short isPrism;
|
short isRound;
|
||||||
short isAnim;
|
short isPrism;
|
||||||
short isActor;
|
short isAnim;
|
||||||
short isLevel;
|
short isActor;
|
||||||
short isBG;
|
short isLevel;
|
||||||
short isSprite;
|
short isBG;
|
||||||
long p;
|
short isSprite;
|
||||||
long OTz;
|
long p;
|
||||||
BODY * body;
|
long OTz;
|
||||||
VANIM * anim;
|
BODY * body;
|
||||||
struct NODE * node;
|
VANIM * anim;
|
||||||
VECTOR pos2D;
|
struct NODE * node;
|
||||||
} MESH;
|
VECTOR pos2D;
|
||||||
|
} 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 :
|
||||||
@ -85,49 +86,49 @@ 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;
|
||||||
VECTOR * BKc;
|
VECTOR * BKc;
|
||||||
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;
|
||||||
|
@ -8,13 +8,13 @@ void transformMesh(CAMERA * camera, MESH * meshes);
|
|||||||
void enlightMesh(LEVEL * curLvl, MESH * actorPtr, SVECTOR * lgtang);
|
void enlightMesh(LEVEL * curLvl, MESH * actorPtr, SVECTOR * lgtang);
|
||||||
void drawPoly(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw);
|
void drawPoly(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw);
|
||||||
// Tri drawing
|
// Tri drawing
|
||||||
|
long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i);
|
||||||
void set3VertexLerPos(MESH * mesh, long t);
|
void set3VertexLerPos(MESH * mesh, long t);
|
||||||
void set3Prism(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, int i);
|
void set3Prism(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, int i);
|
||||||
void set3Tex(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, long t, int i);
|
void set3Tex(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, long t, int i);
|
||||||
long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t, long * Flag);
|
long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t, long * Flag);
|
||||||
void drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw);
|
|
||||||
//Quad drawing
|
//Quad drawing
|
||||||
void drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw);
|
long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i);
|
||||||
void set4VertexLerPos(MESH * mesh, long t);
|
void set4VertexLerPos(MESH * mesh, long t);
|
||||||
void set4Prism(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, int i);
|
void set4Prism(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, int i);
|
||||||
void set4Tex(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, long t, int i);
|
void set4Tex(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, long t, int i);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "level0.h"
|
#include "level0.h"
|
||||||
|
|
||||||
CVECTOR level0_BGc = { 149, 218, 216, 0 };
|
CVECTOR level0_BGc = { 92, 218, 216, 0 };
|
||||||
|
|
||||||
VECTOR level0_BKc = { 0, 255, 255, 0 };
|
VECTOR level0_BKc = { 88, 4, 0, 0 };
|
||||||
|
|
||||||
CAMPOS level0_camPos_Camera = {
|
CAMPOS level0_camPos_Camera = {
|
||||||
{ -770,459,623 },
|
{ -770,459,623 },
|
||||||
@ -16,7 +16,7 @@ CAMPATH level0_camPath = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MATRIX level0_lgtmat = {
|
MATRIX level0_lgtmat = {
|
||||||
-1919, 3254, 1581,
|
-2486, 3254, -22,
|
||||||
0,0,0,
|
0,0,0,
|
||||||
0,0,0,
|
0,0,0,
|
||||||
|
|
||||||
@ -106,13 +106,14 @@ TMESH level0_modelCube = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level0_meshCube = {
|
MESH level0_meshCube = {
|
||||||
|
24,
|
||||||
&level0_modelCube,
|
&level0_modelCube,
|
||||||
level0_modelCube_index,
|
level0_modelCube_index,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
{0},
|
{0},
|
||||||
{0,-236,23, 0},
|
{0,-236,23, 0},
|
||||||
{0,-1024,0},
|
{0,-1024,0, 0},
|
||||||
1, // isRigidBody
|
1, // isRigidBody
|
||||||
0, // isStaticBody
|
0, // isStaticBody
|
||||||
0, // isRound
|
0, // isRound
|
||||||
@ -903,14 +904,95 @@ TMESH level0_modelPlane = {
|
|||||||
100
|
100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SVECTOR level0_modelPlan_mesh[] = {
|
||||||
|
{ -45,36,-3 },
|
||||||
|
{ 48,36,-3 },
|
||||||
|
{ -45,2,2 },
|
||||||
|
{ 48,2,2 }
|
||||||
|
};
|
||||||
|
|
||||||
|
SVECTOR level0_modelPlan_normal[] = {
|
||||||
|
0,638,4046, 0,
|
||||||
|
0,638,4046, 0,
|
||||||
|
0,638,4046, 0,
|
||||||
|
0,638,4046, 0
|
||||||
|
};
|
||||||
|
|
||||||
|
SVECTOR level0_modelPlan_uv[] = {
|
||||||
|
64,155, 0, 0,
|
||||||
|
129,155, 0, 0,
|
||||||
|
129,130, 0, 0,
|
||||||
|
64,130, 0, 0
|
||||||
|
};
|
||||||
|
|
||||||
|
CVECTOR level0_modelPlan_color[] = {
|
||||||
|
80, 80, 80, 0,
|
||||||
|
128, 128, 128, 0,
|
||||||
|
128, 128, 128, 0
|
||||||
|
};
|
||||||
|
|
||||||
|
PRIM level0_modelPlan_index[] = {
|
||||||
|
0,1,3,2,8
|
||||||
|
};
|
||||||
|
|
||||||
|
BODY level0_modelPlan_body = {
|
||||||
|
{0, 0, 0, 0},
|
||||||
|
-40,-40,194, 0,
|
||||||
|
0,0,0, 0,
|
||||||
|
1,
|
||||||
|
ONE/1,
|
||||||
|
-45,2,-3, 0,
|
||||||
|
48,36,2, 0,
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
|
TMESH level0_modelPlan = {
|
||||||
|
level0_modelPlan_mesh,
|
||||||
|
level0_modelPlan_normal,
|
||||||
|
level0_modelPlan_uv,
|
||||||
|
level0_modelPlan_color,
|
||||||
|
1
|
||||||
|
};
|
||||||
|
|
||||||
|
extern unsigned long _binary_TIM_home_tim_start[];
|
||||||
|
|
||||||
|
TIM_IMAGE level0_tim_home;
|
||||||
|
|
||||||
|
MESH level0_meshPlan = {
|
||||||
|
4,
|
||||||
|
&level0_modelPlan,
|
||||||
|
level0_modelPlan_index,
|
||||||
|
&level0_tim_home,
|
||||||
|
_binary_TIM_home_tim_start,
|
||||||
|
{0},
|
||||||
|
{-40,-40,194, 0},
|
||||||
|
{0,0,0},
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&level0_modelPlan_body,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
MESH level0_meshPlane = {
|
MESH level0_meshPlane = {
|
||||||
|
400,
|
||||||
&level0_modelPlane,
|
&level0_modelPlane,
|
||||||
level0_modelPlane_index,
|
level0_modelPlane_index,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
{0},
|
{0},
|
||||||
{0,0,0, 0},
|
{0,0,0, 0},
|
||||||
{0,0,0},
|
{0,0,0, 0},
|
||||||
0, // isRigidBody
|
0, // isRigidBody
|
||||||
0, // isStaticBody
|
0, // isStaticBody
|
||||||
0, // isRound
|
0, // isRound
|
||||||
@ -998,4 +1080,5 @@ LEVEL level0 = {
|
|||||||
&level0_camPath,
|
&level0_camPath,
|
||||||
(CAMANGLE **)&level0_camAngles,
|
(CAMANGLE **)&level0_camAngles,
|
||||||
&level0_nodePlane,
|
&level0_nodePlane,
|
||||||
|
&level0_meshPlan
|
||||||
};
|
};
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
extern LEVEL level0;
|
extern LEVEL level0;
|
||||||
|
|
||||||
extern CVECTOR level0_BGc;;
|
extern CVECTOR level0_BGc;
|
||||||
|
|
||||||
extern VECTOR level0_BKc;;
|
extern VECTOR level0_BKc;
|
||||||
|
|
||||||
extern CAMPOS level0_camPos_Camera;
|
extern CAMPOS level0_camPos_Camera;
|
||||||
|
|
||||||
@ -72,3 +72,16 @@ extern NODE * level0_curNode;
|
|||||||
|
|
||||||
extern NODE level0_nodePlane;
|
extern NODE level0_nodePlane;
|
||||||
|
|
||||||
|
extern SVECTOR level0_modelPlan_normal[];
|
||||||
|
|
||||||
|
extern SVECTOR level0_modelPlan_uv[];
|
||||||
|
|
||||||
|
extern CVECTOR level0_modelPlan_color[];
|
||||||
|
|
||||||
|
extern PRIM level0_modelPlan_index[];
|
||||||
|
|
||||||
|
extern BODY level0_modelPlan_body;
|
||||||
|
|
||||||
|
extern TMESH level0_modelPlan;
|
||||||
|
|
||||||
|
extern MESH level0_meshPlan;
|
||||||
|
@ -968,6 +968,7 @@ extern unsigned long _binary_TIM_cat_tim_length;
|
|||||||
TIM_IMAGE level1_tim_cat;
|
TIM_IMAGE level1_tim_cat;
|
||||||
|
|
||||||
MESH level1_meshCube = {
|
MESH level1_meshCube = {
|
||||||
|
324,
|
||||||
&level1_modelCube,
|
&level1_modelCube,
|
||||||
level1_modelCube_index,
|
level1_modelCube_index,
|
||||||
&level1_tim_cat,
|
&level1_tim_cat,
|
||||||
@ -1321,7 +1322,7 @@ VANIM level1_modelCylindre_anim = {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
0,
|
1,
|
||||||
{
|
{
|
||||||
//Frame 0
|
//Frame 0
|
||||||
{ 3,35,47 },
|
{ 3,35,47 },
|
||||||
@ -1811,6 +1812,7 @@ extern unsigned long _binary_TIM_home_tim_length;
|
|||||||
TIM_IMAGE level1_tim_home;
|
TIM_IMAGE level1_tim_home;
|
||||||
|
|
||||||
MESH level1_meshCylindre = {
|
MESH level1_meshCylindre = {
|
||||||
|
114,
|
||||||
&level1_modelCylindre,
|
&level1_modelCylindre,
|
||||||
level1_modelCylindre_index,
|
level1_modelCylindre_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -2278,6 +2280,7 @@ TMESH level1_modelgnd = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshgnd = {
|
MESH level1_meshgnd = {
|
||||||
|
144,
|
||||||
&level1_modelgnd,
|
&level1_modelgnd,
|
||||||
level1_modelgnd_index,
|
level1_modelgnd_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -2595,6 +2598,7 @@ TMESH level1_modelgnd_001 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshgnd_001 = {
|
MESH level1_meshgnd_001 = {
|
||||||
|
90,
|
||||||
&level1_modelgnd_001,
|
&level1_modelgnd_001,
|
||||||
level1_modelgnd_001_index,
|
level1_modelgnd_001_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -2912,6 +2916,7 @@ TMESH level1_modelgnd_003 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshgnd_003 = {
|
MESH level1_meshgnd_003 = {
|
||||||
|
90,
|
||||||
&level1_modelgnd_003,
|
&level1_modelgnd_003,
|
||||||
level1_modelgnd_003_index,
|
level1_modelgnd_003_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -3229,6 +3234,7 @@ TMESH level1_modelgnd_002 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshgnd_002 = {
|
MESH level1_meshgnd_002 = {
|
||||||
|
90,
|
||||||
&level1_modelgnd_002,
|
&level1_modelgnd_002,
|
||||||
level1_modelgnd_002_index,
|
level1_modelgnd_002_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -8840,6 +8846,7 @@ extern unsigned long _binary_TIM_lara_tim_length;
|
|||||||
TIM_IMAGE level1_tim_lara;
|
TIM_IMAGE level1_tim_lara;
|
||||||
|
|
||||||
MESH level1_meshLara = {
|
MESH level1_meshLara = {
|
||||||
|
2082,
|
||||||
&level1_modelLara,
|
&level1_modelLara,
|
||||||
level1_modelLara_index,
|
level1_modelLara_index,
|
||||||
&level1_tim_lara,
|
&level1_tim_lara,
|
||||||
@ -8999,6 +9006,7 @@ TMESH level1_modelobject = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshobject = {
|
MESH level1_meshobject = {
|
||||||
|
36,
|
||||||
&level1_modelobject,
|
&level1_modelobject,
|
||||||
level1_modelobject_index,
|
level1_modelobject_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -9074,6 +9082,7 @@ TMESH level1_modelPlan = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshPlan = {
|
MESH level1_meshPlan = {
|
||||||
|
4,
|
||||||
&level1_modelPlan,
|
&level1_modelPlan,
|
||||||
level1_modelPlan_index,
|
level1_modelPlan_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -9537,6 +9546,7 @@ TMESH level1_modelSphere = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshSphere = {
|
MESH level1_meshSphere = {
|
||||||
|
150,
|
||||||
&level1_modelSphere,
|
&level1_modelSphere,
|
||||||
level1_modelSphere_index,
|
level1_modelSphere_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -10000,6 +10010,7 @@ TMESH level1_modelSphere_001 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshSphere_001 = {
|
MESH level1_meshSphere_001 = {
|
||||||
|
150,
|
||||||
&level1_modelSphere_001,
|
&level1_modelSphere_001,
|
||||||
level1_modelSphere_001_index,
|
level1_modelSphere_001_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -10167,6 +10178,7 @@ TMESH level1_modelwall = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshwall = {
|
MESH level1_meshwall = {
|
||||||
|
36,
|
||||||
&level1_modelwall,
|
&level1_modelwall,
|
||||||
level1_modelwall_index,
|
level1_modelwall_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -10402,6 +10414,7 @@ TMESH level1_modelwall_001 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshwall_001 = {
|
MESH level1_meshwall_001 = {
|
||||||
|
60,
|
||||||
&level1_modelwall_001,
|
&level1_modelwall_001,
|
||||||
level1_modelwall_001_index,
|
level1_modelwall_001_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -10637,6 +10650,7 @@ TMESH level1_modelwall_002 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshwall_002 = {
|
MESH level1_meshwall_002 = {
|
||||||
|
60,
|
||||||
&level1_modelwall_002,
|
&level1_modelwall_002,
|
||||||
level1_modelwall_002_index,
|
level1_modelwall_002_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
@ -10804,6 +10818,7 @@ TMESH level1_modelwall_003 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MESH level1_meshwall_003 = {
|
MESH level1_meshwall_003 = {
|
||||||
|
36,
|
||||||
&level1_modelwall_003,
|
&level1_modelwall_003,
|
||||||
level1_modelwall_003_index,
|
level1_modelwall_003_index,
|
||||||
&level1_tim_home,
|
&level1_tim_home,
|
||||||
|
@ -28,13 +28,17 @@ void drawPoly(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpr
|
|||||||
long nclip, t = 0;
|
long nclip, t = 0;
|
||||||
// FIXME : t is not incremented, thus always 0. It works if the mesh only has tris or quads, but won't work with mixed meshes.
|
// FIXME : t is not incremented, thus always 0. It works if the mesh only has tris or quads, but won't work with mixed meshes.
|
||||||
// mesh is POLY_GT3 ( triangle )
|
// mesh is POLY_GT3 ( triangle )
|
||||||
if (mesh->index[0].code == 4) {
|
for (int i = 0; i < (mesh->totalVerts);) {
|
||||||
drawTri(mesh, Flag, atime, camMode, nextpri, ot, db, draw);
|
if (mesh->index[t].code == 4) {
|
||||||
|
t = drawTri(mesh, Flag, atime, camMode, nextpri, ot, db, draw, t, i);
|
||||||
|
i += 3;
|
||||||
|
}
|
||||||
|
// If mesh is quad
|
||||||
|
if (mesh->index[t].code == 8) {
|
||||||
|
t = drawQuad(mesh, Flag, atime, camMode, nextpri, ot, db, draw, t, i);
|
||||||
|
i += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If mesh is quad
|
|
||||||
if (mesh->index[0].code == 8) {
|
|
||||||
drawQuad(mesh, Flag, atime, camMode, nextpri, ot, db, draw);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
void set3VertexLerPos(MESH * mesh, long t){
|
void set3VertexLerPos(MESH * mesh, long t){
|
||||||
// Find and set 3 interpolated vertex value
|
// Find and set 3 interpolated vertex value
|
||||||
@ -279,11 +283,11 @@ void set4Subdiv(void){
|
|||||||
//~ }
|
//~ }
|
||||||
|
|
||||||
};
|
};
|
||||||
void drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw) {
|
long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) {
|
||||||
long nclip, t = 0;
|
long nclip = 0;
|
||||||
// If mesh is quad
|
// If mesh is quad
|
||||||
POLY_GT4 * poly4;
|
POLY_GT4 * poly4;
|
||||||
for (int i = 0; i < (mesh->tmesh->len * 4); i += 4) {
|
//~ for (int i = 0; i < (mesh->tmesh->len * 4); i += 4) {
|
||||||
// if mesh is not part of BG, draw them, else, discard
|
// if mesh is not part of BG, draw them, else, discard
|
||||||
if ( !(mesh->isBG) || *camMode != 2 ) {
|
if ( !(mesh->isBG) || *camMode != 2 ) {
|
||||||
poly4 = (POLY_GT4 *)*nextpri;
|
poly4 = (POLY_GT4 *)*nextpri;
|
||||||
@ -343,16 +347,17 @@ void drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpr
|
|||||||
}
|
}
|
||||||
*nextpri += sizeof( POLY_GT4 );
|
*nextpri += sizeof( POLY_GT4 );
|
||||||
}
|
}
|
||||||
t += 1;
|
t++;
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
}
|
//~ }
|
||||||
};
|
};
|
||||||
void drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw) {
|
long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) {
|
||||||
long nclip, t = 0;
|
long nclip = 0;
|
||||||
// mesh is POLY_GT3 ( triangle )
|
// mesh is POLY_GT3 ( triangle )
|
||||||
POLY_GT3 * poly;
|
POLY_GT3 * poly;
|
||||||
// len member == # vertices, but here it's # of triangle... So, for each tri * 3 vertices ...
|
// len member == # vertices, but here it's # of triangle... So, for each tri * 3 vertices ...
|
||||||
for ( int i = 0; i < (mesh->tmesh->len * 3); i += 3 ) {
|
//~ for ( int i = 0; i < (mesh->tmesh->len * 3); i += 3 ) {
|
||||||
// If mesh is not part of precalculated background, draw them, else, discard
|
// If mesh is not part of precalculated background, draw them, else, discard
|
||||||
if ( !( mesh->isBG ) || *camMode != 2) {
|
if ( !( mesh->isBG ) || *camMode != 2) {
|
||||||
poly = (POLY_GT3 *)*nextpri;
|
poly = (POLY_GT3 *)*nextpri;
|
||||||
@ -412,9 +417,10 @@ void drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri
|
|||||||
}
|
}
|
||||||
*nextpri += sizeof(POLY_GT3);
|
*nextpri += sizeof(POLY_GT3);
|
||||||
}
|
}
|
||||||
t+=1;
|
t++;
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
}
|
//~ }
|
||||||
};
|
};
|
||||||
void drawBG(CAMANGLE * camPtr, char ** nextpri, u_long * otdisc, char * db) {
|
void drawBG(CAMANGLE * camPtr, char ** nextpri, u_long * otdisc, char * db) {
|
||||||
// Draw BG image in two SPRT since max width == 256 px
|
// Draw BG image in two SPRT since max width == 256 px
|
||||||
|
@ -93,7 +93,7 @@ void LvlPtrSet(LEVEL * curLevel, LEVEL * level){
|
|||||||
curLevel->camAngles = level->camAngles;
|
curLevel->camAngles = level->camAngles;
|
||||||
curLevel->curNode = level->curNode; // Blank
|
curLevel->curNode = level->curNode; // Blank
|
||||||
// Move these to drawPoly()
|
// Move these to drawPoly()
|
||||||
curLevel->meshPlan = level->meshPlan;
|
//~ curLevel->meshPlan = level->meshPlan;
|
||||||
//~ FntPrint("%x %x", curLevel->meshes, level->meshes);
|
//~ FntPrint("%x %x", curLevel->meshes, level->meshes);
|
||||||
};
|
};
|
||||||
int LoadLevelCD(const char*const LevelName, u_long * LoadAddress){
|
int LoadLevelCD(const char*const LevelName, u_long * LoadAddress){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user