- correct HUD constants based on screen height

This commit is contained in:
InspirationByte 2022-01-30 11:48:02 +03:00
parent e33c979a9a
commit a0ed9a8b82
4 changed files with 39 additions and 42 deletions

View File

@ -284,7 +284,7 @@ void DrawInGameCutscene(void)
tile->w = 1200; tile->w = 1200;
#endif #endif
tile->y0 = draw_mode.height - BlackBorderHeight; tile->y0 = SCREEN_H - BlackBorderHeight;
tile->h = BlackBorderHeight; tile->h = BlackBorderHeight;
addPrim(current->ot, tile); addPrim(current->ot, tile);

View File

@ -696,9 +696,13 @@ void DrawBigCompass(VECTOR *root, int angle)
// [D] [T] // [D] [T]
void CopIndicator(int xpos, int strength) void CopIndicator(int xpos, int strength)
{ {
int startH, endH;
int str2; int str2;
POLY_F3 *poly; POLY_F3 *poly;
startH = SCREEN_H;
endH = SCREEN_H - 30;
if (strength > 255) if (strength > 255)
strength = 255; strength = 255;
@ -714,11 +718,11 @@ void CopIndicator(int xpos, int strength)
poly->g0 = str2; poly->g0 = str2;
poly->b0 = str2; poly->b0 = str2;
poly->x0 = xpos - 12; poly->x0 = xpos - 12;
poly->y0 = 256; poly->y0 = startH;
poly->x1 = xpos; poly->x1 = xpos;
poly->y1 = 226; poly->y1 = endH;
poly->x2 = xpos + 12; poly->x2 = xpos + 12;
poly->y2 = 256; poly->y2 = startH;
addPrim(current->ot + 1, poly); addPrim(current->ot + 1, poly);
current->primptr += sizeof(POLY_F3); current->primptr += sizeof(POLY_F3);
@ -737,10 +741,10 @@ void CopIndicator(int xpos, int strength)
poly->b0 = str2; poly->b0 = str2;
poly->x0 = xpos - 12; poly->x0 = xpos - 12;
poly->y0 = 256; poly->y0 = startH;
poly->y1 = 226; poly->y1 = endH;
poly->x2 = xpos + 12; poly->x2 = xpos + 12;
poly->y2 = 256; poly->y2 = startH;
poly->x1 = xpos; poly->x1 = xpos;
addPrim(current->ot + 1, poly); addPrim(current->ot + 1, poly);
@ -904,14 +908,13 @@ void InitMultiplayerMap(void)
// [D] [T] // [D] [T]
void InitOverheadMap(void) void InitOverheadMap(void)
{ {
int d; int c, d;
int c;
int tpage; int tpage;
if (NumPlayers > 1) if (NumPlayers > 1)
gMapYOffset = 96; gMapYOffset = (SCREEN_H - MAP_SIZE_H) / 2 - 2;// 96;
else else
gMapYOffset = draw_mode.height - MAP_SIZE_H - 15; //181; gMapYOffset = SCREEN_H - MAP_SIZE_H - 15; //181;
if (gMultiplayerLevels) if (gMultiplayerLevels)
{ {
@ -991,17 +994,15 @@ void DrawMultiplayerMap(void)
int i; int i;
u_char g; u_char g;
u_char r; u_char r;
int yPos; int xPos, yPos;
VECTOR target; VECTOR target;
int px, py; int px, py;
map_x_offset = 0; map_x_offset = 0;
map_z_offset = 0; map_z_offset = 0;
if (NumPlayers == 1) xPos = gMapXOffset;
yPos = gMapYOffset; yPos = gMapYOffset;
else
yPos = 96;
DrawMultiplayerTargets(); DrawMultiplayerTargets();
@ -1019,7 +1020,7 @@ void DrawMultiplayerMap(void)
WorldToMultiplayerMap(&target, &target); WorldToMultiplayerMap(&target, &target);
target.vx += gMapXOffset; target.vx += xPos;
target.vz += yPos; target.vz += yPos;
DrawPlayerDot(&target, -pl->dir, r, g, 0, 0x8); DrawPlayerDot(&target, -pl->dir, r, g, 0, 0x8);
@ -1035,12 +1036,12 @@ void DrawMultiplayerMap(void)
setPolyFT4(poly); setPolyFT4(poly);
setSemiTrans(poly, 1); setSemiTrans(poly, 1);
poly->x0 = gMapXOffset; poly->x0 = xPos;
poly->y0 = yPos; poly->y0 = yPos;
poly->x1 = gMapXOffset + MAP_SIZE_W; poly->x1 = xPos + MAP_SIZE_W;
poly->y1 = yPos; poly->y1 = yPos;
poly->x2 = gMapXOffset; poly->x2 = xPos;
poly->x3 = gMapXOffset + MAP_SIZE_W; poly->x3 = xPos + MAP_SIZE_W;
poly->y2 = yPos + 64; poly->y2 = yPos + 64;
poly->y3 = yPos + 64; poly->y3 = yPos + 64;

View File

@ -718,15 +718,6 @@ void UpdatePadData(void)
#endif #endif
} }
#define SCREEN_FB 512
#define SCREEN_FB_H 256
#ifdef PAL_VERSION
#define SCREEN_H 256
#else
#define SCREEN_H 240
#endif`
// [D] [T] // [D] [T]
void SetupDrawBuffers(void) void SetupDrawBuffers(void)
{ {
@ -810,7 +801,7 @@ void SetupDrawBufferData(int num_players)
if (toggle) if (toggle)
{ {
otpt = (u_long*)_OT2; otpt = (u_long*)_OT2;
primpt = (u_char*)_primTab2; // _primTab1 + 0x1E000 primpt = (u_char*)_primTab2; // _primTab1 + PRIMTAB_SIZE
} }
else else
{ {

View File

@ -112,13 +112,26 @@ struct DB
DISPENV disp; DISPENV disp;
}; };
extern DRAW_MODE draw_mode_pal;
extern DRAW_MODE draw_mode_ntsc;
extern DB MPBuff[2][2]; extern DB MPBuff[2][2];
extern DB* last; extern DB* last;
extern DB* current; extern DB* current;
extern DRAW_MODE draw_mode_pal;
extern DRAW_MODE draw_mode_ntsc;
#define SCREEN_FB 512
#define SCREEN_FB_H 256
#ifdef PAL_VERSION
#define SCREEN_H 256
#define draw_mode draw_mode_pal
#define video_mode MODE_PAL
#else
#define SCREEN_H 240
#define draw_mode draw_mode_ntsc
#define video_mode MODE_NTSC
#endif // PAL
// ordering table size // ordering table size
#ifdef PSX #ifdef PSX
#define OTSIZE 0x1080 #define OTSIZE 0x1080
@ -140,14 +153,6 @@ extern DB* current;
extern int citystart[8]; extern int citystart[8];
extern XYPAIR citylumps[8][4]; extern XYPAIR citylumps[8][4];
#ifdef PAL_VERSION
#define draw_mode draw_mode_pal
#define video_mode MODE_PAL
#else
#define draw_mode draw_mode_ntsc
#define video_mode MODE_NTSC
#endif // PAL
#define CDSECTOR_SIZE 2048 #define CDSECTOR_SIZE 2048
extern void ClearMem(char *mem, int size); // 0x0007F3E8 extern void ClearMem(char *mem, int size); // 0x0007F3E8