|
|
@ -27,7 +27,7 @@ |
|
|
|
|
|
|
|
|
#define OTLEN 256 |
|
|
#define OTLEN 256 |
|
|
|
|
|
|
|
|
#define SCREENWIDTH 320 |
|
|
|
|
|
|
|
|
#define SCREENWIDTH 512 |
|
|
#define SCREENHEIGHT 240 |
|
|
#define SCREENHEIGHT 240 |
|
|
|
|
|
|
|
|
#define NUMVERTEXNORMALS 162 |
|
|
#define NUMVERTEXNORMALS 162 |
|
|
@ -78,8 +78,8 @@ typedef struct |
|
|
ps1texture_t front, back; |
|
|
ps1texture_t front, back; |
|
|
} ps1skin_t; |
|
|
} ps1skin_t; |
|
|
|
|
|
|
|
|
ps1mdl_t playerModel = { .position = { -128, 320, 400 }, .rotation = { 0 } }; |
|
|
|
|
|
ps1mdl_t shamblerModel = { .position = { 128, 320, 400 }, .rotation = { 0 } }; |
|
|
|
|
|
|
|
|
ps1mdl_t playerModel = { .position = { -200, 320, 400 }, .rotation = { 0 } }; |
|
|
|
|
|
ps1mdl_t shamblerModel = { .position = { 200, 320, 400 }, .rotation = { 0 } }; |
|
|
ps1skin_t playerSkin, shamblerSkin; |
|
|
ps1skin_t playerSkin, shamblerSkin; |
|
|
|
|
|
|
|
|
MATRIX color_mtx = { |
|
|
MATRIX color_mtx = { |
|
|
@ -94,6 +94,9 @@ MATRIX light_mtx = { |
|
|
0, 0, 0 |
|
|
0, 0, 0 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Scale X coordinates to correct the aspect ratio for the chosen resolution |
|
|
|
|
|
VECTOR cam_scale = { SCREENWIDTH * ONE / 320 , ONE, ONE }; |
|
|
|
|
|
|
|
|
void loadModel(const u_long* data, ps1mdl_t *mdl) |
|
|
void loadModel(const u_long* data, ps1mdl_t *mdl) |
|
|
{ |
|
|
{ |
|
|
const char *bytes = (const char*)data; |
|
|
const char *bytes = (const char*)data; |
|
|
@ -188,7 +191,7 @@ void init(void) |
|
|
|
|
|
|
|
|
InitGeom(); |
|
|
InitGeom(); |
|
|
gte_SetGeomOffset(SCREENWIDTH >> 1, SCREENHEIGHT >> 1); |
|
|
gte_SetGeomOffset(SCREENWIDTH >> 1, SCREENHEIGHT >> 1); |
|
|
gte_SetGeomScreen(SCREENWIDTH >> 1); // Screen depth for FOV control |
|
|
|
|
|
|
|
|
gte_SetGeomScreen(180); // Screen depth for FOV control. Essentially the Z position of the vanishing point. |
|
|
|
|
|
|
|
|
// Set texture page for the entire drawing environment. Nice in some cases perhaps, but not what we need. |
|
|
// Set texture page for the entire drawing environment. Nice in some cases perhaps, but not what we need. |
|
|
//draw[0].tpage = getTPage(playerFrontTex.mode & 0x3, 0, playerFrontTex.prect->x, playerFrontTex.prect->y); |
|
|
//draw[0].tpage = getTPage(playerFrontTex.mode & 0x3, 0, playerFrontTex.prect->x, playerFrontTex.prect->y); |
|
|
@ -358,6 +361,7 @@ void drawModel(ps1mdl_t *model, ps1skin_t *skin, int xOffset, int frameCounter) |
|
|
|
|
|
|
|
|
MATRIX mtx, lmtx; |
|
|
MATRIX mtx, lmtx; |
|
|
RotMatrix(&model->rotation, &mtx); |
|
|
RotMatrix(&model->rotation, &mtx); |
|
|
|
|
|
ScaleMatrixL(&mtx, &cam_scale); // Aspect ratio correction |
|
|
TransMatrix(&mtx, &model->position); |
|
|
TransMatrix(&mtx, &model->position); |
|
|
MulMatrix0(&light_mtx, &mtx, &lmtx); |
|
|
MulMatrix0(&light_mtx, &mtx, &lmtx); |
|
|
|
|
|
|
|
|
|