From 044ec65e22e2048bb15d20eb20644501b10be7a3 Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Wed, 14 Jul 2021 15:21:29 +0200 Subject: [PATCH] Fix pad, slightly better jump, respawn actor when falling from level --- include/defines.h | 16 +- include/physics.h | 4 +- levels/level0.c | 1831 ++++++++++++++++++++++----------------------- levels/level1.c | 4 +- src/main.c | 136 ++-- src/physics.c | 61 +- src/psx.c | 14 + 7 files changed, 1065 insertions(+), 1001 deletions(-) diff --git a/include/defines.h b/include/defines.h index dce3185..7c974b8 100644 --- a/include/defines.h +++ b/include/defines.h @@ -1,5 +1,5 @@ #define VMODE 0 // 0 == NTSC, 1 == PAL -#define VSYNC 0 +#define VSYNC 1 #define SCREENXRES 320 #define SCREENYRES 240 #define CENTERX SCREENXRES/2 @@ -74,11 +74,17 @@ asm(\ #define PadRight ( 1 << 5 ) #define PadDown ( 1 << 6 ) #define PadLeft ( 1 << 7 ) + +#define Tri ( 1 << 12 ) +#define Circ ( 1 << 13 ) +#define Cross ( 1 << 14 ) +#define Squar ( 1 << 15 ) +// Joysticks #define PadR3 ( 1 << 2 ) #define PadL3 ( 1 << 1 ) // Triggers applied on PADR -#define PadShldL1 ( 1 << 2 ) -#define PadShldL2 ( 1 ) -#define PadShldR1 ( 1 << 3 ) -#define PadShldR2 ( 1 << 1 ) +#define PadShldL1 ( 1 << 10 ) +#define PadShldL2 ( 1 << 8) +#define PadShldR1 ( 1 << 11 ) +#define PadShldR2 ( 1 << 9 ) diff --git a/include/physics.h b/include/physics.h index ead7e40..3ca5365 100644 --- a/include/physics.h +++ b/include/physics.h @@ -4,6 +4,7 @@ #include #include #include "../include/defines.h" +#include "../include/math.h" #include "../include/macros.h" #include "../custom_types.h" @@ -15,4 +16,5 @@ void checkBodyCol(BODY * one, BODY * two); void applyAngMom(LEVEL curLvl ); void ResolveCollision( BODY * one, BODY * two ); VECTOR angularMom(BODY body); -void applyAcceleration(BODY * actor); +void applyAcceleration(BODY * actor, int dt); +u_int jump(BODY * actor, int dt); diff --git a/levels/level0.c b/levels/level0.c index 709a8d1..6b96668 100644 --- a/levels/level0.c +++ b/levels/level0.c @@ -5,979 +5,979 @@ CVECTOR level0_BGc = { 135, 232, 230, 0 }; VECTOR level0_BKc = { 174, 174, 174, 0 }; CAMPOS level0_camPos_Camera = { - { -770,459,623 }, - { 301,531,0 } + { -770,459,623 }, + { 301,531,0 } }; CAMPATH level0_camPath = { - 0, - 0, - 0 + 0, + 0, + 0 }; MATRIX level0_lgtmat = { - -2486, 3254, -22, - 0,0,0, - 0,0,0, + -2486, 3254, -22, + 0,0,0, + 0,0,0, - }; + }; MATRIX level0_cmat = { - 4096,0,0, - 4096,0,0, - 4096,0,0 - }; + 4096,0,0, + 4096,0,0, + 4096,0,0 + }; SVECTOR level0_modelCube_mesh[] = { - { -32,32,32 }, - { 32,32,32 }, - { 32,32,-33 }, - { -33,32,-32 }, - { -32,-32,33 }, - { 33,-32,32 }, - { 32,-32,-33 }, - { -33,-32,-32 } + { -32,32,32 }, + { 32,32,32 }, + { 32,32,-33 }, + { -33,32,-32 }, + { -32,-32,33 }, + { 33,-32,32 }, + { 32,-32,-33 }, + { -33,-32,-32 } }; SVECTOR level0_modelCube_normal[] = { - 2365,-2365,-2365, 0, - -2365,-2365,-2365, 0, - -2365,-2365,2365, 0, - 2365,-2365,2365, 0, - 2365,2365,-2365, 0, - -2365,2365,-2365, 0, - -2365,2365,2365, 0, - 2365,2365,2365, 0 + 2365,-2365,-2365, 0, + -2365,-2365,-2365, 0, + -2365,-2365,2365, 0, + 2365,-2365,2365, 0, + 2365,2365,-2365, 0, + -2365,2365,-2365, 0, + -2365,2365,2365, 0, + 2365,2365,2365, 0 }; CVECTOR level0_modelCube_color[] = { - 255,236,0, 0, - 255,237,0, 0, - 255,237,0, 0, - 255,235,0, 0, - 255,8,0, 0, - 255,2,0, 0, - 255,6,2, 0, - 254,3,0, 0, - 229,0,255, 0, - 229,0,255, 0, - 232,21,232, 0, - 229,0,255, 0, - 0,12,255, 0, - 5,16,250, 0, - 2,13,253, 0, - 0,12,255, 0, - 0,255,26, 0, - 4,251,25, 0, - 0,255,26, 0, - 0,255,26, 0, - 0,248,255, 0, - 0,248,255, 0, - 0,248,255, 0, - 0,248,255, 0 + 255,236,0, 0, + 255,237,0, 0, + 255,237,0, 0, + 255,235,0, 0, + 255,8,0, 0, + 255,2,0, 0, + 255,6,2, 0, + 254,3,0, 0, + 229,0,255, 0, + 229,0,255, 0, + 232,21,232, 0, + 229,0,255, 0, + 0,12,255, 0, + 5,16,250, 0, + 2,13,253, 0, + 0,12,255, 0, + 0,255,26, 0, + 4,251,25, 0, + 0,255,26, 0, + 0,255,26, 0, + 0,248,255, 0, + 0,248,255, 0, + 0,248,255, 0, + 0,248,255, 0 }; PRIM level0_modelCube_index[] = { - 0,1,2,3,8, - 4,7,6,5,8, - 0,4,5,1,8, - 1,5,6,2,8, - 2,6,7,3,8, - 4,0,3,7,8 + 0,1,2,3,8, + 4,7,6,5,8, + 0,4,5,1,8, + 1,5,6,2,8, + 2,6,7,3,8, + 4,0,3,7,8 }; BODY level0_modelCube_body = { - {0, 0, 0, 0}, - 0,-236,23, 0, - 0,-1024,0, 0, - 1, - ONE/1, - -33,-32,-33, 0, - 33,32,33, 0, - 0, - }; + {0, 0, 0, 0}, + 0,-236,23, 0, + 0,-1024,0, 0, + 1, + ONE/1, + -33,-32,-33, 0, + 33,32,33, 0, + 0, + }; TMESH level0_modelCube = { - level0_modelCube_mesh, - level0_modelCube_normal, - 0, - level0_modelCube_color, - 6 + level0_modelCube_mesh, + level0_modelCube_normal, + 0, + level0_modelCube_color, + 6 }; MESH level0_meshCube = { - 24, - &level0_modelCube, - level0_modelCube_index, - 0, - 0, - {0}, - {0,-236,23, 0}, - {0,-1024,0, 0}, - 1, // isProp - 1, // isRigidBody - 0, // isStaticBody - 0, // isRound - 0, // isPrism - 0, // isAnim - 1, // isActor - 0, // isLevel - 0, // isBG - 0,// isSprite - 0, - 0, - &level0_modelCube_body, - 0, - &level0_nodePlane, - 0, + 24, + &level0_modelCube, + level0_modelCube_index, + 0, + 0, + {0}, + {0,-236,23, 0}, + {0,-1024,0, 0}, + 1, // isProp + 1, // isRigidBody + 0, // isStaticBody + 0, // isRound + 0, // isPrism + 0, // isAnim + 1, // isActor + 0, // isLevel + 0, // isBG + 0,// isSprite + 0, + 0, + &level0_modelCube_body, + 0, + &level0_nodePlane, + 0, }; SVECTOR level0_modelPlane_mesh[] = { - { -520,0,-520 }, - { 520,0,-520 }, - { -520,0,520 }, - { 520,0,520 }, - { -520,0,312 }, - { -520,0,104 }, - { -520,0,-104 }, - { -520,0,-312 }, - { -312,0,-520 }, - { -104,0,-520 }, - { 104,0,-520 }, - { 312,0,-520 }, - { 520,0,-312 }, - { 520,0,-104 }, - { 520,0,104 }, - { 520,0,312 }, - { 312,0,520 }, - { 104,0,520 }, - { -104,0,520 }, - { -312,0,520 }, - { -312,0,-312 }, - { -312,0,-104 }, - { -312,0,104 }, - { -312,0,312 }, - { -104,0,-312 }, - { -104,0,-104 }, - { -104,0,104 }, - { -104,0,312 }, - { 104,0,-312 }, - { 104,0,-104 }, - { 104,0,104 }, - { 104,0,312 }, - { 312,0,-312 }, - { 312,0,-104 }, - { 312,0,104 }, - { 312,0,312 }, - { -520,0,-416 }, - { 416,0,-520 }, - { 520,0,416 }, - { -416,0,520 }, - { -520,0,416 }, - { -520,0,208 }, - { -520,0,0 }, - { -520,0,-208 }, - { -416,0,-520 }, - { -208,0,-520 }, - { 0,0,-520 }, - { 208,0,-520 }, - { 520,0,-416 }, - { 520,0,-208 }, - { 520,0,0 }, - { 520,0,208 }, - { 416,0,520 }, - { 208,0,520 }, - { 0,0,520 }, - { -208,0,520 }, - { -312,0,416 }, - { -312,0,-416 }, - { -312,0,-208 }, - { -312,0,0 }, - { -312,0,208 }, - { -104,0,416 }, - { -104,0,-416 }, - { -104,0,-208 }, - { -104,0,0 }, - { -104,0,208 }, - { 104,0,416 }, - { 104,0,-416 }, - { 104,0,-208 }, - { 104,0,0 }, - { 104,0,208 }, - { 312,0,416 }, - { 312,0,-416 }, - { 312,0,-208 }, - { 312,0,0 }, - { 312,0,208 }, - { -416,0,-312 }, - { -416,0,-104 }, - { -416,0,104 }, - { -416,0,312 }, - { -208,0,-312 }, - { -208,0,-104 }, - { -208,0,104 }, - { -208,0,312 }, - { 0,0,-312 }, - { 0,0,-104 }, - { 0,0,104 }, - { 0,0,312 }, - { 208,0,-312 }, - { 208,0,-104 }, - { 208,0,104 }, - { 208,0,312 }, - { 416,0,-312 }, - { 416,0,-104 }, - { 416,0,104 }, - { 416,0,312 }, - { 416,0,208 }, - { 416,0,0 }, - { 416,0,-208 }, - { 416,0,-416 }, - { 208,0,208 }, - { 208,0,0 }, - { 208,0,-208 }, - { 208,0,-416 }, - { 0,0,208 }, - { 0,0,0 }, - { 0,0,-208 }, - { 0,0,-416 }, - { -208,0,208 }, - { -208,0,0 }, - { -208,0,-208 }, - { -208,0,-416 }, - { -416,0,208 }, - { -416,0,0 }, - { -416,0,-208 }, - { -416,0,-416 }, - { 208,0,416 }, - { 0,0,416 }, - { -208,0,416 }, - { -416,0,416 }, - { 416,0,416 } + { -520,0,-520 }, + { 520,0,-520 }, + { -520,0,520 }, + { 520,0,520 }, + { -520,0,312 }, + { -520,0,104 }, + { -520,0,-104 }, + { -520,0,-312 }, + { -312,0,-520 }, + { -104,0,-520 }, + { 104,0,-520 }, + { 312,0,-520 }, + { 520,0,-312 }, + { 520,0,-104 }, + { 520,0,104 }, + { 520,0,312 }, + { 312,0,520 }, + { 104,0,520 }, + { -104,0,520 }, + { -312,0,520 }, + { -312,0,-312 }, + { -312,0,-104 }, + { -312,0,104 }, + { -312,0,312 }, + { -104,0,-312 }, + { -104,0,-104 }, + { -104,0,104 }, + { -104,0,312 }, + { 104,0,-312 }, + { 104,0,-104 }, + { 104,0,104 }, + { 104,0,312 }, + { 312,0,-312 }, + { 312,0,-104 }, + { 312,0,104 }, + { 312,0,312 }, + { -520,0,-416 }, + { 416,0,-520 }, + { 520,0,416 }, + { -416,0,520 }, + { -520,0,416 }, + { -520,0,208 }, + { -520,0,0 }, + { -520,0,-208 }, + { -416,0,-520 }, + { -208,0,-520 }, + { 0,0,-520 }, + { 208,0,-520 }, + { 520,0,-416 }, + { 520,0,-208 }, + { 520,0,0 }, + { 520,0,208 }, + { 416,0,520 }, + { 208,0,520 }, + { 0,0,520 }, + { -208,0,520 }, + { -312,0,416 }, + { -312,0,-416 }, + { -312,0,-208 }, + { -312,0,0 }, + { -312,0,208 }, + { -104,0,416 }, + { -104,0,-416 }, + { -104,0,-208 }, + { -104,0,0 }, + { -104,0,208 }, + { 104,0,416 }, + { 104,0,-416 }, + { 104,0,-208 }, + { 104,0,0 }, + { 104,0,208 }, + { 312,0,416 }, + { 312,0,-416 }, + { 312,0,-208 }, + { 312,0,0 }, + { 312,0,208 }, + { -416,0,-312 }, + { -416,0,-104 }, + { -416,0,104 }, + { -416,0,312 }, + { -208,0,-312 }, + { -208,0,-104 }, + { -208,0,104 }, + { -208,0,312 }, + { 0,0,-312 }, + { 0,0,-104 }, + { 0,0,104 }, + { 0,0,312 }, + { 208,0,-312 }, + { 208,0,-104 }, + { 208,0,104 }, + { 208,0,312 }, + { 416,0,-312 }, + { 416,0,-104 }, + { 416,0,104 }, + { 416,0,312 }, + { 416,0,208 }, + { 416,0,0 }, + { 416,0,-208 }, + { 416,0,-416 }, + { 208,0,208 }, + { 208,0,0 }, + { 208,0,-208 }, + { 208,0,-416 }, + { 0,0,208 }, + { 0,0,0 }, + { 0,0,-208 }, + { 0,0,-416 }, + { -208,0,208 }, + { -208,0,0 }, + { -208,0,-208 }, + { -208,0,-416 }, + { -416,0,208 }, + { -416,0,0 }, + { -416,0,-208 }, + { -416,0,-416 }, + { 208,0,416 }, + { 0,0,416 }, + { -208,0,416 }, + { -416,0,416 }, + { 416,0,416 } }; SVECTOR level0_modelPlane_normal[] = { - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0, - 0,4096,0, 0 + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0, + 0,4096,0, 0 }; CVECTOR level0_modelPlane_color[] = { - 0,8,255, 0, - 0,8,255, 0, - 243,255,0, 0, - 240,252,3, 0, - 0,8,255, 0, - 0,8,255, 0, - 243,255,0, 0, - 240,252,3, 0, - 0,14,255, 0, - 0,9,255, 0, - 225,236,19, 0, - 243,255,0, 0, - 0,8,255, 0, - 0,8,255, 0, - 226,238,18, 0, - 225,237,19, 0, - 0,10,255, 0, - 0,8,255, 0, - 223,235,20, 0, - 243,255,0, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 251,1,14, 0, - 250,0,14, 0, - 76,6,181, 0, - 78,6,181, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,13,255, 0, - 0,8,255, 0, - 251,1,13, 0, - 251,1,13, 0, - 75,5,182, 0, - 77,5,180, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,12,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,16,255, 0, - 254,0,11, 0, - 254,0,11, 0, - 0,8,255, 0, - 4,9,251, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,12,255, 0, - 0,8,255, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,9,255, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,9,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,9,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,8,255, 0, - 0,12,255, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,27,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,9,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 254,0,11, 0, - 255,0,10, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,10, 0, - 254,0,11, 0, - 0,8,255, 0, - 0,8,255, 0, - 255,0,10, 0, - 255,0,10, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,10,255, 0, - 0,8,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 75,5,182, 0, - 4,9,251, 0, - 255,0,227, 0, - 255,0,227, 0, - 4,9,251, 0, - 0,8,255, 0, - 255,0,227, 0, - 255,0,227, 0, - 251,1,13, 0, - 254,0,11, 0, - 4,9,251, 0, - 75,5,182, 0, - 0,13,255, 0, - 0,16,255, 0, - 254,0,11, 0, - 251,1,13, 0, - 0,16,255, 0, - 0,8,255, 0, - 254,0,11, 0, - 254,0,11, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,16,255, 0, - 0,13,255, 0, - 0,31,255, 0, - 0,31,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,31,255, 0, - 0,10,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,12,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 76,6,181, 0, - 77,5,180, 0, - 255,0,227, 0, - 255,0,227, 0, - 77,5,180, 0, - 75,5,182, 0, - 255,0,227, 0, - 255,0,227, 0, - 250,0,14, 0, - 251,1,13, 0, - 77,5,180, 0, - 76,6,181, 0, - 0,8,255, 0, - 0,8,255, 0, - 251,1,13, 0, - 250,0,14, 0, - 0,8,255, 0, - 0,13,255, 0, - 251,1,13, 0, - 251,1,13, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,12,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,12,255, 0, - 0,31,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,255,6, 0, - 0,255,6, 0, - 255,0,227, 0, - 255,0,227, 0, - 0,8,255, 0, - 0,8,255, 0, - 74,5,184, 0, - 78,6,181, 0, - 255,0,227, 0, - 255,0,227, 0, - 78,6,181, 0, - 76,6,181, 0, - 255,0,227, 0, - 255,0,227, 0, - 238,1,26, 0, - 251,1,14, 0, - 78,6,181, 0, - 74,5,184, 0, - 0,8,255, 0, - 0,8,255, 0, - 251,1,14, 0, - 238,1,26, 0, - 0,8,255, 0, - 0,8,255, 0, - 250,0,14, 0, - 251,1,14, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,25,255, 0, - 0,17,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,17,255, 0, - 0,9,255, 0, - 0,255,248, 0, - 0,255,248, 0, - 0,8,255, 0, - 0,10,255, 0, - 243,255,0, 0, - 226,238,18, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,10,255, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,10,255, 0, - 0,9,255, 0, - 0,8,255, 0, - 225,237,19, 0, - 225,236,19, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,14,255, 0, - 243,255,0, 0, - 243,255,0, 0, - 0,8,255, 0, - 0,12,255, 0, - 0,14,255, 0, - 0,8,255, 0, - 0,12,255, 0, - 0,8,255, 0, - 0,9,255, 0, - 0,14,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 240,252,3, 0, - 243,255,0, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 240,252,3, 0, - 223,235,20, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0, - 0,8,255, 0 + 0,8,255, 0, + 0,8,255, 0, + 243,255,0, 0, + 240,252,3, 0, + 0,8,255, 0, + 0,8,255, 0, + 243,255,0, 0, + 240,252,3, 0, + 0,14,255, 0, + 0,9,255, 0, + 225,236,19, 0, + 243,255,0, 0, + 0,8,255, 0, + 0,8,255, 0, + 226,238,18, 0, + 225,237,19, 0, + 0,10,255, 0, + 0,8,255, 0, + 223,235,20, 0, + 243,255,0, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 251,1,14, 0, + 250,0,14, 0, + 76,6,181, 0, + 78,6,181, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,13,255, 0, + 0,8,255, 0, + 251,1,13, 0, + 251,1,13, 0, + 75,5,182, 0, + 77,5,180, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,12,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,16,255, 0, + 254,0,11, 0, + 254,0,11, 0, + 0,8,255, 0, + 4,9,251, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,12,255, 0, + 0,8,255, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,9,255, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,9,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,9,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,8,255, 0, + 0,12,255, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,27,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,9,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 254,0,11, 0, + 255,0,10, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,10, 0, + 254,0,11, 0, + 0,8,255, 0, + 0,8,255, 0, + 255,0,10, 0, + 255,0,10, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,10,255, 0, + 0,8,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 75,5,182, 0, + 4,9,251, 0, + 255,0,227, 0, + 255,0,227, 0, + 4,9,251, 0, + 0,8,255, 0, + 255,0,227, 0, + 255,0,227, 0, + 251,1,13, 0, + 254,0,11, 0, + 4,9,251, 0, + 75,5,182, 0, + 0,13,255, 0, + 0,16,255, 0, + 254,0,11, 0, + 251,1,13, 0, + 0,16,255, 0, + 0,8,255, 0, + 254,0,11, 0, + 254,0,11, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,16,255, 0, + 0,13,255, 0, + 0,31,255, 0, + 0,31,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,31,255, 0, + 0,10,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,12,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 76,6,181, 0, + 77,5,180, 0, + 255,0,227, 0, + 255,0,227, 0, + 77,5,180, 0, + 75,5,182, 0, + 255,0,227, 0, + 255,0,227, 0, + 250,0,14, 0, + 251,1,13, 0, + 77,5,180, 0, + 76,6,181, 0, + 0,8,255, 0, + 0,8,255, 0, + 251,1,13, 0, + 250,0,14, 0, + 0,8,255, 0, + 0,13,255, 0, + 251,1,13, 0, + 251,1,13, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,12,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,12,255, 0, + 0,31,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,255,6, 0, + 0,255,6, 0, + 255,0,227, 0, + 255,0,227, 0, + 0,8,255, 0, + 0,8,255, 0, + 74,5,184, 0, + 78,6,181, 0, + 255,0,227, 0, + 255,0,227, 0, + 78,6,181, 0, + 76,6,181, 0, + 255,0,227, 0, + 255,0,227, 0, + 238,1,26, 0, + 251,1,14, 0, + 78,6,181, 0, + 74,5,184, 0, + 0,8,255, 0, + 0,8,255, 0, + 251,1,14, 0, + 238,1,26, 0, + 0,8,255, 0, + 0,8,255, 0, + 250,0,14, 0, + 251,1,14, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,25,255, 0, + 0,17,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,17,255, 0, + 0,9,255, 0, + 0,255,248, 0, + 0,255,248, 0, + 0,8,255, 0, + 0,10,255, 0, + 243,255,0, 0, + 226,238,18, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,10,255, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,10,255, 0, + 0,9,255, 0, + 0,8,255, 0, + 225,237,19, 0, + 225,236,19, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,14,255, 0, + 243,255,0, 0, + 243,255,0, 0, + 0,8,255, 0, + 0,12,255, 0, + 0,14,255, 0, + 0,8,255, 0, + 0,12,255, 0, + 0,8,255, 0, + 0,9,255, 0, + 0,14,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 240,252,3, 0, + 243,255,0, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 240,252,3, 0, + 223,235,20, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0, + 0,8,255, 0 }; PRIM level0_modelPlane_index[] = { - 120,38,3,52,8, - 119,56,19,39,8, - 118,61,18,55,8, - 117,66,17,54,8, - 116,71,16,53,8, - 115,57,20,76,8, - 114,58,21,77,8, - 113,59,22,78,8, - 112,60,23,79,8, - 111,62,24,80,8, - 110,63,25,81,8, - 109,64,26,82,8, - 108,65,27,83,8, - 107,67,28,84,8, - 106,68,29,85,8, - 105,69,30,86,8, - 104,70,31,87,8, - 103,72,32,88,8, - 102,73,33,89,8, - 101,74,34,90,8, - 100,75,35,91,8, - 99,48,12,92,8, - 98,49,13,93,8, - 97,50,14,94,8, - 96,51,15,95,8, - 75,96,95,35,8, - 34,94,96,75,8, - 94,14,51,96,8, - 74,97,94,34,8, - 33,93,97,74,8, - 93,13,50,97,8, - 73,98,93,33,8, - 32,92,98,73,8, - 92,12,49,98,8, - 72,99,92,32,8, - 11,37,99,72,8, - 37,1,48,99,8, - 70,100,91,31,8, - 30,90,100,70,8, - 90,34,75,100,8, - 69,101,90,30,8, - 29,89,101,69,8, - 89,33,74,101,8, - 68,102,89,29,8, - 28,88,102,68,8, - 88,32,73,102,8, - 67,103,88,28,8, - 10,47,103,67,8, - 47,11,72,103,8, - 65,104,87,27,8, - 26,86,104,65,8, - 86,30,70,104,8, - 64,105,86,26,8, - 25,85,105,64,8, - 85,29,69,105,8, - 63,106,85,25,8, - 24,84,106,63,8, - 84,28,68,106,8, - 62,107,84,24,8, - 9,46,107,62,8, - 46,10,67,107,8, - 60,108,83,23,8, - 22,82,108,60,8, - 82,26,65,108,8, - 59,109,82,22,8, - 21,81,109,59,8, - 81,25,64,109,8, - 58,110,81,21,8, - 20,80,110,58,8, - 80,24,63,110,8, - 57,111,80,20,8, - 8,45,111,57,8, - 45,9,62,111,8, - 41,112,79,4,8, - 5,78,112,41,8, - 78,22,60,112,8, - 42,113,78,5,8, - 6,77,113,42,8, - 77,21,59,113,8, - 43,114,77,6,8, - 7,76,114,43,8, - 76,20,58,114,8, - 36,115,76,7,8, - 0,44,115,36,8, - 44,8,57,115,8, - 66,116,53,17,8, - 31,91,116,66,8, - 91,35,71,116,8, - 61,117,54,18,8, - 27,87,117,61,8, - 87,31,66,117,8, - 56,118,55,19,8, - 23,83,118,56,8, - 83,27,61,118,8, - 40,119,39,2,8, - 4,79,119,40,8, - 79,23,56,119,8, - 71,120,52,16,8, - 35,95,120,71,8, - 95,15,38,120,8 + 120,38,3,52,8, + 119,56,19,39,8, + 118,61,18,55,8, + 117,66,17,54,8, + 116,71,16,53,8, + 115,57,20,76,8, + 114,58,21,77,8, + 113,59,22,78,8, + 112,60,23,79,8, + 111,62,24,80,8, + 110,63,25,81,8, + 109,64,26,82,8, + 108,65,27,83,8, + 107,67,28,84,8, + 106,68,29,85,8, + 105,69,30,86,8, + 104,70,31,87,8, + 103,72,32,88,8, + 102,73,33,89,8, + 101,74,34,90,8, + 100,75,35,91,8, + 99,48,12,92,8, + 98,49,13,93,8, + 97,50,14,94,8, + 96,51,15,95,8, + 75,96,95,35,8, + 34,94,96,75,8, + 94,14,51,96,8, + 74,97,94,34,8, + 33,93,97,74,8, + 93,13,50,97,8, + 73,98,93,33,8, + 32,92,98,73,8, + 92,12,49,98,8, + 72,99,92,32,8, + 11,37,99,72,8, + 37,1,48,99,8, + 70,100,91,31,8, + 30,90,100,70,8, + 90,34,75,100,8, + 69,101,90,30,8, + 29,89,101,69,8, + 89,33,74,101,8, + 68,102,89,29,8, + 28,88,102,68,8, + 88,32,73,102,8, + 67,103,88,28,8, + 10,47,103,67,8, + 47,11,72,103,8, + 65,104,87,27,8, + 26,86,104,65,8, + 86,30,70,104,8, + 64,105,86,26,8, + 25,85,105,64,8, + 85,29,69,105,8, + 63,106,85,25,8, + 24,84,106,63,8, + 84,28,68,106,8, + 62,107,84,24,8, + 9,46,107,62,8, + 46,10,67,107,8, + 60,108,83,23,8, + 22,82,108,60,8, + 82,26,65,108,8, + 59,109,82,22,8, + 21,81,109,59,8, + 81,25,64,109,8, + 58,110,81,21,8, + 20,80,110,58,8, + 80,24,63,110,8, + 57,111,80,20,8, + 8,45,111,57,8, + 45,9,62,111,8, + 41,112,79,4,8, + 5,78,112,41,8, + 78,22,60,112,8, + 42,113,78,5,8, + 6,77,113,42,8, + 77,21,59,113,8, + 43,114,77,6,8, + 7,76,114,43,8, + 76,20,58,114,8, + 36,115,76,7,8, + 0,44,115,36,8, + 44,8,57,115,8, + 66,116,53,17,8, + 31,91,116,66,8, + 91,35,71,116,8, + 61,117,54,18,8, + 27,87,117,61,8, + 87,31,66,117,8, + 56,118,55,19,8, + 23,83,118,56,8, + 83,27,61,118,8, + 40,119,39,2,8, + 4,79,119,40,8, + 79,23,56,119,8, + 71,120,52,16,8, + 35,95,120,71,8, + 95,15,38,120,8 }; BODY level0_modelPlane_body = { - {0, 0, 0, 0}, - 0,0,0, 0, - 0,0,0, 0, - 1, - ONE/1, - -520,0,-520, 0, - 520,0,520, 0, - 0, - }; + {0, 0, 0, 0}, + 0,0,0, 0, + 0,0,0, 0, + 100, + ONE/100, + -520,0,-520, 0, + 520,0,520, 0, + 0, + }; TMESH level0_modelPlane = { - level0_modelPlane_mesh, - level0_modelPlane_normal, - 0, - level0_modelPlane_color, - 100 + level0_modelPlane_mesh, + level0_modelPlane_normal, + 0, + level0_modelPlane_color, + 100 }; MESH level0_meshPlane = { - 400, - &level0_modelPlane, - level0_modelPlane_index, - 0, - 0, - {0}, - {0,0,0, 0}, - {0,0,0, 0}, - 0, // isProp - 0, // isRigidBody - 0, // isStaticBody - 0, // isRound - 0, // isPrism - 0, // isAnim - 0, // isActor - 1, // isLevel - 0, // isBG - 0,// isSprite - 0, - 0, - &level0_modelPlane_body, - 0, - 0, - 0, + 400, + &level0_modelPlane, + level0_modelPlane_index, + 0, + 0, + {0}, + {0,0,0, 0}, + {0,0,0, 0}, + 0, // isProp + 0, // isRigidBody + 0, // isStaticBody + 0, // isRound + 0, // isPrism + 0, // isAnim + 0, // isActor + 1, // isLevel + 0, // isBG + 0,// isSprite + 0, + 0, + &level0_modelPlane_body, + 0, + 0, + 0, }; MESH * level0_meshes[2] = { - &level0_meshCube, - &level0_meshPlane + &level0_meshCube, + &level0_meshPlane }; int level0_meshes_length = 2; CAMANGLE level0_camAngle_Camera = { - &level0_camPos_Camera, - 0, - 0, - { 0 }, - { 0 }, - 0, - 0 + &level0_camPos_Camera, + 0, + 0, + { 0 }, + { 0 }, + 0, + 0 }; CAMANGLE * level0_camAngles[0] = { }; SIBLINGS level0_nodePlane_siblings = { - 0, - { - 0 - } + 0, + { + 0 + } }; CHILDREN level0_nodePlane_objects = { - 0, - { - 0 - } + 0, + { + 0 + } }; CHILDREN level0_nodePlane_rigidbodies = { - 1, - { - &level0_meshCube - } + 1, + { + &level0_meshCube + } }; NODE level0_nodePlane = { - &level0_meshPlane, - &level0_nodePlane_siblings, - &level0_nodePlane_objects, - &level0_nodePlane_rigidbodies + &level0_meshPlane, + &level0_nodePlane_siblings, + &level0_nodePlane_objects, + &level0_nodePlane_rigidbodies }; MESH * level0_actorPtr = &level0_meshCube; @@ -989,18 +989,17 @@ CAMANGLE * level0_camPtr = &level0_camAngle_Camera; NODE * level0_curNode = &level0_nodePlane; LEVEL level0 = { - &level0_BGc, - &level0_BKc, - &level0_cmat, - &level0_lgtmat, - (MESH **)&level0_meshes, - &level0_meshes_length, - &level0_meshCube, - &level0_meshPlane, - &level0_meshCube, - &level0_camAngle_Camera, - &level0_camPath, - (CAMANGLE **)&level0_camAngles, - &level0_nodePlane, + &level0_BGc, + &level0_BKc, + &level0_cmat, + &level0_lgtmat, + (MESH **)&level0_meshes, + &level0_meshes_length, + &level0_meshCube, + &level0_meshPlane, + &level0_meshCube, + &level0_camAngle_Camera, + &level0_camPath, + (CAMANGLE **)&level0_camAngles, + &level0_nodePlane, }; - diff --git a/levels/level1.c b/levels/level1.c index 697d84b..f0a2743 100644 --- a/levels/level1.c +++ b/levels/level1.c @@ -9539,8 +9539,8 @@ BODY level1_modelSphere_body = { {0, 0, 0, 0}, 333,-129,-298, 0, 0,0,0, 0, - 2, - ONE/2, + 10, + ONE/10, -25,-24,-24, 0, 24,24,25, 0, 2048, diff --git a/src/main.c b/src/main.c index 5ddbf66..40dc89c 100644 --- a/src/main.c +++ b/src/main.c @@ -83,12 +83,7 @@ VECTOR fVecActor = {0,0,0,0}; u_long triCount = 0; LEVEL curLvl = {0}; LEVEL * loadLvl; -// Callback variables -u_short lastPad; -int lerpValues[4096 >> 7]; -short cursor = 0; -short angleCamTimer = 0; -short forceApplied = 0; +VECTOR lvlStartPos = {0}; // Callback function is used for pads void callback(); // variable FPS @@ -158,8 +153,11 @@ int main() { for (int k = 0; k < *curLvl.meshes_length; k++){ triCount += curLvl.meshes[k]->tmesh->len; } + // Save actor starting pos + copyVector(&lvlStartPos, &curLvl.actorPtr->body->position); // Set camera starting pos setCameraPos(&camera, &curLvl.camPtr->campos->pos, &curLvl.camPtr->campos->rot); + // Find curCamAngle if using pre-calculated BGs if (camMode == 2) { if (curLvl.camPtr->tim_data){ @@ -210,7 +208,7 @@ int main() { if (time % timediv == 0){ atime ++; } - // Spatial partitioning + // Spatial partitioning if (curLvl.curNode){ for ( int msh = 0; msh < curLvl.curNode->siblings->index; msh ++ ) { // Actor @@ -233,7 +231,7 @@ int main() { // if(time%1 == 0){ for ( int k = 0; k < *curLvl.meshes_length; k ++ ) { if ( curLvl.meshes[k]->isRigidBody == 1 ) { - applyAcceleration( curLvl.meshes[k]->body); + applyAcceleration( curLvl.meshes[k]->body, dt); // Get col between actor and level if ( curLvl.meshes[k]->isActor ){ checkBodyCol( curLvl.meshes[k]->body , curLvl.levelPtr->body ); @@ -268,6 +266,10 @@ int main() { ClearOTagR(otdisc[db], OT2LEN); // Clear Secondary OT ClearOTagR(ot[db], OTLEN); + + if(curLvl.actorPtr->pos.vy >= 200){ + copyVector(&curLvl.actorPtr->body->position, &lvlStartPos ); + } // Set camera according to mode setCameraMode(&curLvl, &camera, &posToActor, &angle, &angleCam, curCamAngle, camMode, &lerping); // Render scene @@ -297,8 +299,8 @@ int main() { // Add secondary OT to main OT AddPrims(otdisc[db], ot[db] + OTLEN - 1, ot[db]); - FntPrint("\nTime : %d\n", time); - FntPrint("#Tri : %d\n", triCount); + //~ FntPrint("\nTime : %d\n", time); + FntPrint("#Tri : %d\n", triCount); FntPrint("#RCnt : %d %d\n", oldTime, dt); FntFlush(-1); display( &disp[db], &draw[db], otdisc[db], primbuff[db], &nextpri, &db); @@ -310,12 +312,13 @@ void callback() { read_controller( &theControllers[0], &controllers[0].pad[0], 0 ); // Read controllers // Pad 2 read_controller( &theControllers[1], &controllers[1].pad[0], 1 ); - u_char PADL = ~theControllers[0].button1; - u_char PADR = ~theControllers[0].button2; - //~ static u_short lastPad; - //~ static int lerpValues[4096 >> 7]; - //~ static short cursor = 0; - //~ static short angleCamTimer = 0; + + u_short PAD = ~*((u_short*)(&theControllers[0].button1)); + + static u_short lastPad; + static int lerpValues[4096 >> 7]; + static short cursor = 0; + static short angleCamTimer = 0; //~ static short forceApplied = 0; int div = 32; @@ -327,13 +330,16 @@ void callback() { if( timer ) { timer--; } + if (!timer){ + curLvl.actorPtr->body->gForce.vy = 0; + } if( cursor ) { cursor--; } if (angleCam.vy > 2048 || angleCam.vy < -2048) { angleCam.vy = 0; } - if ( PADR & PadShldR1 && !timer ) { + if ( PAD & PadShldR1 && !timer ) { if (!curLvl.camPtr->tim_data){ if(camMode < 5){ camMode ++; @@ -354,59 +360,59 @@ void callback() { LoadTexture(curLvl.camPtr->tim_data, curLvl.camPtr->BGtim); } } - lastPad = PADR; + lastPad = PAD; timer = 10; } - //~ if ( !(PADR & PadShldR1) && lastPad & PadShldR1 ) { + //~ if ( !(PAD & PadShldR1) && lastPad & PadShldR1 ) { //pressed = 0; //~ } - if ( PADR & PadShldL2 ) { + if ( PAD & PadShldL2 ) { dc_lgtangp->vy += 32; } - if ( PADR & PadShldL1 ) { + if ( PAD & PadShldL1 ) { dc_lgtangp->vz += 32; } - if ( PADR & PadUp && !timer ){ + if ( PAD & Tri && !timer ){ if (curLvl.actorPtr->isPrism){ curLvl.actorPtr->isPrism = 0; } else { curLvl.actorPtr->isPrism = 1; } timer = 10; - lastPad = PADR; + lastPad = PAD; } - if ( PADR & PadDown && !timer ){ - if (curLvl.actorPtr->body->gForce.vy >= 0 && curLvl.actorPtr->body->position.vy >= curLvl.actorPtr->body->min.vy ){ - forceApplied -= 150; + if ( PAD & Cross && !timer ){ + if (curLvl.actorPtr->body->gForce.vy == 0 && (curLvl.actorPtr->body->position.vy - curLvl.actorPtr->body->min.vy) == curLvl.levelPtr->body->min.vy ){ + // Use delta to find jump force + curLvl.actorPtr->body->gForce.vy = - ((200/((ONE/(dt<1?1:dt))<1?1:(ONE/(dt<1?1:dt))))*14); } - cursor = div - 15; - timer = 30; - lastPad = PADR; + //~ cursor = div - 15; + timer = 10; + lastPad = PAD; } - if ( !(PADR & PadDown) && lastPad & PadDown ) { - //~ lastPad = pad; + if ( !(PAD & Cross) && lastPad & Cross ) { + //~ curLvl.actorPtr->body->gForce.vy = 0; + lastPad = PAD; } - if ( PADR & PadLeft && !timer ) { + if ( PAD & PadLeft && !timer ) { if (curLvl.actorPtr->anim->interpolate){ curLvl.actorPtr->anim->interpolate = 0; } else { curLvl.actorPtr->anim->interpolate = 1; } timer = 10; - lastPad = PADR; + lastPad = PAD; } if (theControllers[0].type == 0x73){ // Analog stick L up if ( theControllers[0].analog3 >= 0 && theControllers[0].analog3 < (128 - DS_DZ/2)) { - curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * (128 - theControllers[0].analog3 ) >> 14 ; - curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * (128 - theControllers[0].analog3 ) >> 14 ; - lastPad = PADL; + curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * (128 - theControllers[0].analog3 ) >> 13 ; + curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * (128 - theControllers[0].analog3 ) >> 13 ; } // Analog stick L down if ( theControllers[0].analog3 > (128 + DS_DZ/2) && theControllers[0].analog3 <= 255 ) { - curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * ( theControllers[0].analog3 - 128 ) >> 14 ; - curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * ( theControllers[0].analog3 - 128 ) >> 14 ; - lastPad = PADL; + curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * ( theControllers[0].analog3 - 128 ) >> 13 ; + curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * ( theControllers[0].analog3 - 128 ) >> 13 ; } // Analog stick L dead zone if ( theControllers[0].analog3 > (128 - DS_DZ/2) && theControllers[0].analog3 < (128 + DS_DZ/2) ) { @@ -415,42 +421,42 @@ void callback() { } // Analog stick L left if ( theControllers[0].analog2 >= 0 && theControllers[0].analog2 < (128 - DS_DZ/2) ) { - curLvl.actorPtr->rot.vy -= ( 64 * ( 128 - theControllers[0].analog2 ) ) >> 7 ; + curLvl.actorPtr->rot.vy -= ( 64 * ( 128 - theControllers[0].analog2 ) ) >> 8 ; } // Analog stick L right if ( theControllers[0].analog2 > (128 + DS_DZ/2) && theControllers[0].analog2 <= 255 ) { - curLvl.actorPtr->rot.vy += ( 64 * ( theControllers[0].analog2 - 128 ) ) >> 7 ; + curLvl.actorPtr->rot.vy += ( 64 * ( theControllers[0].analog2 - 128 ) ) >> 8 ; } } - if ( PADL & PadUp ) { - curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 7 ; - curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 7; - lastPad = PADL; + if ( PAD & PadUp ) { + curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 6 ; + curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 6; + lastPad = PAD; } - if ( !(PADL & PadUp) && lastPad & PadUp) { + if ( !(PAD & PadUp) && lastPad & PadUp) { curLvl.actorPtr->body->gForce.vz = 0; curLvl.actorPtr->body->gForce.vx = 0; - lastPad = PADL; + lastPad = PAD; } - if ( PADL & PadDown ) { - curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 7 ; - curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 7 ; - lastPad = PADL; + if ( PAD & PadDown ) { + curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 6 ; + curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 6 ; + lastPad = PAD; } - if ( !( PADL & PadDown ) && lastPad & PadDown) { + if ( !( PAD & PadDown ) && lastPad & PadDown) { curLvl.actorPtr->body->gForce.vz = 0; curLvl.actorPtr->body->gForce.vx = 0; - lastPad = PADL; + lastPad = PAD; } - if ( PADL & PadLeft ) { + if ( PAD & PadLeft ) { curLvl.actorPtr->rot.vy -= 64; - lastPad = PADL; + lastPad = PAD; } - if ( PADL & PadRight ) { + if ( PAD & PadRight ) { curLvl.actorPtr->rot.vy += 64; - lastPad = PADL; + lastPad = PAD; } - if ( PADL & PadSelect && !timer ) { + if ( PAD & PadSelect && !timer ) { //~ if (!levelHasChanged){ #ifndef USECD printf("load:%p:%08x:%s", &load_all_overlays_here, &level, overlayFile); @@ -462,24 +468,24 @@ void callback() { #endif //~ } timer = 30; - lastPad = PADL; + lastPad = PAD; } if( theControllers[0].type == 0x73 && camMode == 0){ // Cam control - horizontal if ( theControllers[0].analog0 >= 0 && theControllers[0].analog0 < (128 - DS_DZ/2) ) { - angleCam.vy += ( 16 * ( 128 - theControllers[0].analog0 ) ) >> 7 ; + angleCam.vy += ( 16 * ( 128 - theControllers[0].analog0 ) ) >> 8 ; angleCamTimer = 120; } if ( theControllers[0].analog0 > (128 + DS_DZ/2) && theControllers[0].analog0 <= 255 ) { - angleCam.vy -= ( 16 * ( theControllers[0].analog0 - 128 ) ) >> 7 ; + angleCam.vy -= ( 16 * ( theControllers[0].analog0 - 128 ) ) >> 8 ; angleCamTimer = 120; } if ( theControllers[0].analog0 >= 0 && theControllers[0].analog0 < (128 - DS_DZ/2) ) { - angleCam.vy += ( 16 * ( 128 - theControllers[0].analog0 ) ) >> 7 ; + angleCam.vy += ( 16 * ( 128 - theControllers[0].analog0 ) ) >> 8 ; angleCamTimer = 120; } if ( theControllers[0].analog0 > (128 + DS_DZ/2) && theControllers[0].analog0 <= 255) { - angleCam.vy -= ( 16 * ( theControllers[0].analog0 - 128 ) ) >> 7 ; + angleCam.vy -= ( 16 * ( theControllers[0].analog0 - 128 ) ) >> 8 ; angleCamTimer = 120; } // Timer to lerp cam back behind actor @@ -500,5 +506,7 @@ void callback() { //~ theControllers[0].analog2, // L3 hor : left : 0 7F right: 7F FF : dz 69 81 68 - 8E //~ theControllers[0].analog3 ); // L3 vert : up : 0 7F down : 7F FF : dz 74 8D if ( cursor ) { - curLvl.actorPtr->body->position.vy = lerpValues[cursor];} + //~ curLvl.actorPtr->body->gForce.vy = 0; + //~ curLvl.actorPtr->body->position.vy = lerpValues[cursor]; + } }; diff --git a/src/physics.c b/src/physics.c index 93eabb9..33acec0 100644 --- a/src/physics.c +++ b/src/physics.c @@ -107,10 +107,12 @@ VECTOR getExtCollision(BODY one, BODY two){ void checkBodyCol(BODY * one, BODY * two){ VECTOR colInt, colExt; colInt = getIntCollision( *one , *two ); - colExt = getExtCollision( *one , *two ); + //~ colExt = getExtCollision( *one , *two ); if ( colInt.vy ) { if ( !colInt.vx && !colInt.vz ) { one->position.vy = one->min.vy; + one->velocity.vy = 0; + two->velocity.vy = 0; } } }; @@ -126,19 +128,40 @@ void applyAngMom(LEVEL curLvl ){ } } }; -void applyAcceleration(BODY * actor){ - //~ short dt = VSync(-1) - oldTime ; - short dt = 1; - //~ if (dt < 1) { dt = 1; } +//~ void applyAcceleration(BODY * actor, int dt){ + //~ dt = 1; + //~ VECTOR acceleration = {actor->invMass * actor->gForce.vx , (actor->invMass * actor->gForce.vy) + (GRAVITY * ONE), actor->invMass * actor->gForce.vz}; + //FntPrint("acc: %d %d %d\n", acceleration.vx, acceleration.vy, acceleration.vz ); + //~ actor->velocity.vx += (acceleration.vx * dt) >> 12; + //~ actor->velocity.vy += (acceleration.vy * dt) >> 12; + //~ actor->velocity.vz += (acceleration.vz * dt) >> 12; + //FntPrint("acc: %d %d %d\n", acceleration.vx / ONE, acceleration.vy / ONE, acceleration.vz / ONE ); + //~ actor->position.vx += (actor->velocity.vx * dt); + //~ actor->position.vy += (actor->velocity.vy * dt); + //~ actor->position.vz += (actor->velocity.vz * dt); + //FntPrint("vel: %d %d %d\n", actor->velocity.vx, actor->velocity.vy, actor->velocity.vz ); +//~ }; + +void applyAcceleration(BODY * actor, int dt){ + // Make sure no div by 0 occurs + if (dt < 1) { dt = 1; } + int dtfx = ONE/dt; + if (dtfx < 1) { dtfx = 1; } VECTOR acceleration = {actor->invMass * actor->gForce.vx , (actor->invMass * actor->gForce.vy) + (GRAVITY * ONE), actor->invMass * actor->gForce.vz}; - //~ FntPrint("acc: %d %d %d\n", acceleration.vx, acceleration.vy, acceleration.vz ); - actor->velocity.vx += (acceleration.vx * dt) >> 12; - actor->velocity.vy += (acceleration.vy * dt) >> 12; - actor->velocity.vz += (acceleration.vz * dt) >> 12; - //~ FntPrint("acc: %d %d %d\n", acceleration.vx / ONE, acceleration.vy / ONE, acceleration.vz / ONE ); - actor->position.vx += (actor->velocity.vx * dt); - actor->position.vy += (actor->velocity.vy * dt); - actor->position.vz += (actor->velocity.vz * dt); + //~ FntPrint("acc: %d %d %d %d\n", acceleration.vx, acceleration.vy, acceleration.vz , delta); + //~ actor->velocity.vx += (acceleration.vx * dt) >> 12; + //~ actor->velocity.vy += (acceleration.vy * dt) >> 12; + //~ actor->velocity.vz += (acceleration.vz * dt) >> 12; + actor->velocity.vx += (acceleration.vx / dtfx) / 256; + actor->velocity.vy += (acceleration.vy / dtfx) / 256; + actor->velocity.vz += (acceleration.vz / dtfx) / 256; + //~ FntPrint("acc: %d %d %d\n", (acceleration.vx / (ONE/dt)) , (acceleration.vy / (ONE/dt)), (acceleration.vz / (ONE/dt)) ); + //~ actor->position.vx += (actor->velocity.vx * dt); + //~ actor->position.vy += (actor->velocity.vy * dt); + //~ actor->position.vz += (actor->velocity.vz * dt); + actor->position.vx += (actor->velocity.vx ); + actor->position.vy += (actor->velocity.vy ); + actor->position.vz += (actor->velocity.vz ); //~ FntPrint("vel: %d %d %d\n", actor->velocity.vx, actor->velocity.vy, actor->velocity.vz ); }; //~ // https://gamedevelopment.tutsplus.com/tutorials/how-to-create-a-custom-2d-physics-engine-the-basics-and-impulse-resolution--gamedev-6331 @@ -193,3 +216,15 @@ VECTOR angularMom(BODY body){ //~ FntPrint("v: %d, r:%d, w:%d\n", body.velocity.vz * r, r * r, w.vz); return w; }; +u_int jump(BODY * actor, int dt){ + // https://medium.com/@brazmogu/physics-for-game-dev-a-platformer-physics-cheatsheet-f34b09064558 + // y = -0.5gt² + v't + // vt = sqrt( (vel.vx)² + (vel.vz)² + (vel.vy - 9,81t)² ) + //~ long long velocity = patan(actor->velocity.vx, actor->velocity.vy); + //~ int y = (GRAVITY/2 * dt) + (velocity * dt ); + u_int vt = psqrt( (actor->velocity.vx * actor->velocity.vx) + + (actor->velocity.vz * actor->velocity.vz) + + ( (actor->velocity.vy - (GRAVITY * dt)) * (actor->velocity.vy - (GRAVITY * dt)) ) + ); + return vt; +}; diff --git a/src/psx.c b/src/psx.c index 78de208..62fc198 100644 --- a/src/psx.c +++ b/src/psx.c @@ -101,6 +101,8 @@ void LvlPtrSet(LEVEL * curLevel, LEVEL * level){ curLevel->camPath = level->camPath; curLevel->camAngles = level->camAngles; curLevel->curNode = level->curNode; // Blank + + //~ curLevel->actorPtr->body = level->actorPtr->body; // Move these to drawPoly() //~ curLevel->meshPlan = level->meshPlan; //~ FntPrint("%x %x", curLevel->meshes, level->meshes); @@ -130,6 +132,18 @@ void SwitchLevel( LEVEL * curLevel, LEVEL * loadLevel ){ SVECTOR lgtang = {0,0,0,0}; // Light environment setDCLightEnv(curLevel->cmat, curLevel->lgtmat, &lgtang); + // Reset physics + // TODO : put in a function + copyVector(&curLevel->actorPtr->body->position, &loadLevel->actorPtr->body->position ); + copyVector(&curLevel->actorPtr->pos, &curLevel->actorPtr->body->position); + copyVector(&curLevel->propPtr->body->position, &loadLevel->propPtr->body->position ); + copyVector(&curLevel->propPtr->pos, &curLevel->propPtr->body->position); + applyVector( &curLevel->actorPtr->body->position, 0, 100, 0, -=); + applyVector( &curLevel->actorPtr->body->velocity, 0, 0, 0, =); + applyVector( &curLevel->actorPtr->body->gForce, 0, 0, 0, =); + applyVector( &curLevel->propPtr->body->position, 0, 100, 0, -=); + applyVector( &curLevel->propPtr->body->velocity, 0, 0, 0, =); + applyVector( &curLevel->propPtr->body->gForce, 0, 0, 0, =); }; void LoadTexture(u_long * tim, TIM_IMAGE * tparam){ // This part is from Lameguy64's tutorial series : lameguy64.net/svn/pstutorials/chapter1/3-textures.html login/pw: annoyingmous OpenTIM(tim); // Open the tim binary data, feed it the address of the data in memory