mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 11:52:32 +01:00
- HUD overlays to support widescreen mapping (configurable)
This commit is contained in:
parent
d8bd8840f1
commit
cd1800de35
@ -5,7 +5,6 @@
|
||||
#include "STRINGS.H"
|
||||
#include "MISSION.H"
|
||||
#include "TEXTURE.H"
|
||||
#include "OVERMAP.H"
|
||||
#include "CAMERA.H"
|
||||
#include "SHADOW.H"
|
||||
#include "DEBRIS.H"
|
||||
@ -14,8 +13,8 @@
|
||||
#include "SKY.H"
|
||||
#include "PLAYERS.H"
|
||||
#include "MAIN.H"
|
||||
#include "MOTION_C.H"
|
||||
#include "CONVERT.H"
|
||||
|
||||
#include "CARS.H"
|
||||
|
||||
#include "INLINE_C.H"
|
||||
|
||||
|
@ -16,6 +16,10 @@
|
||||
#include "FELONY.H"
|
||||
#include "SCORES.H"
|
||||
|
||||
#ifndef PSX
|
||||
#include "EMULATOR.H"
|
||||
#endif
|
||||
|
||||
COLOUR_BAND felonyColour[3] =
|
||||
{
|
||||
{ { 0, 0, 255, 0 }, 0, 0 },
|
||||
@ -59,20 +63,26 @@ PERCENTAGE_BAR FelonyBar;
|
||||
PERCENTAGE_BAR ProxyBar;
|
||||
|
||||
int gDoOverlays = 1;
|
||||
|
||||
int gWidescreenHudAlignment = 0; // [A] custom widescreen alignment by PSX hack
|
||||
|
||||
#define PERCENTAGE_BAR_WIDTH 102
|
||||
#define PERCENTAGE_BAR_HEIGHT 10
|
||||
|
||||
const int gOverlayXPos = 16;
|
||||
const int gOverlayXOppPos = 208; // 320 - 16 - PERCENTAGE_BAR_WIDTH;
|
||||
|
||||
// [A]
|
||||
int gOverlayXPos = 16;
|
||||
int gOverlayXOppPos = 208;
|
||||
|
||||
// [D] [T]
|
||||
void InitOverlays(void)
|
||||
{
|
||||
gDoOverlays = 1;
|
||||
|
||||
// [A] init defaults
|
||||
gOverlayXPos = 16;
|
||||
gOverlayXOppPos = 208;
|
||||
gMapXOffset = 249;
|
||||
gMapYOffset = 181;
|
||||
|
||||
InitPercentageBar(&PlayerDamageBar, MaxPlayerDamage[0], playerDamageColour, "Damage");
|
||||
|
||||
PlayerDamageBar.xpos = gOverlayXPos;
|
||||
@ -162,6 +172,27 @@ void DisplayOverlays(void)
|
||||
if (!gDoOverlays)
|
||||
return;
|
||||
|
||||
#ifndef PSX
|
||||
if(gWidescreenHudAlignment)
|
||||
{
|
||||
// align to PSX-mapped screen coordinates
|
||||
RECT16 emuViewport;
|
||||
Emulator_GetPSXWidescreenMappedViewport(emuViewport);
|
||||
|
||||
// recalc pos
|
||||
gOverlayXPos = 16 + emuViewport.x;
|
||||
gOverlayXOppPos = emuViewport.w - 16 - PERCENTAGE_BAR_WIDTH;
|
||||
gMapXOffset = emuViewport.w - 16 - MAP_SIZE_W;
|
||||
|
||||
// set up
|
||||
PlayerDamageBar.xpos = gOverlayXPos;
|
||||
Player2DamageBar.xpos = gOverlayXPos;
|
||||
FelonyBar.xpos = gOverlayXPos;
|
||||
DamageBar.xpos = gOverlayXOppPos;
|
||||
ProxyBar.xpos = gOverlayXPos;
|
||||
}
|
||||
#endif
|
||||
|
||||
DrawPercentageBar(&PlayerDamageBar);
|
||||
DrawPercentageBar(&Player2DamageBar);
|
||||
DrawPercentageBar(&DamageBar);
|
||||
|
@ -7,6 +7,8 @@ extern PERCENTAGE_BAR DamageBar;
|
||||
extern PERCENTAGE_BAR FelonyBar;
|
||||
extern PERCENTAGE_BAR ProxyBar;
|
||||
|
||||
extern int gWidescreenHudAlignment;
|
||||
|
||||
extern char OverlayFlashValue;
|
||||
|
||||
extern void InitOverlays(); // 0x00014A58
|
||||
|
@ -274,9 +274,9 @@ MENU_ITEM MainPauseItems[] =
|
||||
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
||||
};
|
||||
|
||||
MENU_ITEM MultiplayerPauseItems[7] =
|
||||
MENU_ITEM MultiplayerPauseItems[] =
|
||||
{
|
||||
{ "Resume", 1u, 2u, NULL, MENU_QUIT_CONTINUE, NULL },
|
||||
{ "Continue", 1u, 2u, NULL, MENU_QUIT_CONTINUE, NULL },
|
||||
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
||||
{ "Sfx Volume", 13u, 2u, (pauseFunc)&SfxVolume, MENU_QUIT_NONE, NULL },
|
||||
{ "Music Volume", 21u, 2u, (pauseFunc)&MusicVolume, MENU_QUIT_NONE, NULL },
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <SDL_scancode.h>
|
||||
|
||||
#include "C/CUTSCENE.H"
|
||||
#include "C/OVERLAY.H"
|
||||
|
||||
|
||||
// eq engine console output
|
||||
@ -426,6 +427,8 @@ int main(int argc, char** argv)
|
||||
ini_sget(config, "game", "drawDistance", "%d", &gDrawDistance);
|
||||
ini_sget(config, "game", "freeCamera", "%d", &enableFreecamera);
|
||||
ini_sget(config, "game", "driver1music", "%d", &gDriver1Music);
|
||||
ini_sget(config, "game", "widescreenHUD", "%d", &gWidescreenHudAlignment);
|
||||
|
||||
|
||||
if (dataFolderStr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user