Skip to content

Commit

Permalink
Even further work on low detail automap
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 28, 2023
1 parent 1ddb6a3 commit 3024d61
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 16 deletions.
3 changes: 2 additions & 1 deletion releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* *DOOM Retro* is now built using v17.7.6 of [*Microsoft Visual Studio Community 2022*](https://visualstudio.microsoft.com/vs/community/).
* Minor changes have been made to text that is output to the console.
* Monsters now only become non-solid at the end of their death animation rather than the start.
* The automap is now shown in low detail when the `r_detail` CVAR is `low`.

![](https://github.com/bradharding/www.doomretro.com/raw/master/wiki/bigdivider.png)

Expand All @@ -19,7 +20,7 @@
* A bug is fixed whereby stairs rising up from the floor wouldn’t rise to their correct height in some instances.
* Changing the `vid_capfps` CVAR to `35` now caps the framerate at 35 FPS again.
* If the `vid_capfps` CVAR is `off` or greater than `60`, and the `vid_vsync` CVAR is `off`, the framerate is now capped at 60 FPS when on the title screen, in the menu, in the console, or the game is paused.
* The number of frames per second are now displayed in the menu when the `vid_showfps` CVAR is `on`.
* The frames per second are now displayed in the menu when the `vid_showfps` CVAR is `on`.
* Minor improvements have been made to determining when to lower the player’s view if the `r_liquid_lowerview` CVAR is `on`.
* A bug is fixed whereby entering `kill monsters` in the console could then affect splash damage to the player.

Expand Down
66 changes: 53 additions & 13 deletions src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static void (*putbigdot2)(unsigned int, unsigned int, const byte *);
static void PUTDOT(unsigned int x, unsigned int y, const byte *color);
static inline void PUTDOT2(unsigned int x, unsigned int y, const byte *color);
static void PUTBIGDOT(unsigned int x, unsigned int y, const byte *color);
static void PUTBIGDOT2(unsigned int x, unsigned int y, const byte *color);

static void AM_ActivateNewScale(void)
{
Expand Down Expand Up @@ -425,6 +426,22 @@ void AM_Stop(void)
D_FadeScreen(false);
}

void AM_InitPixelSize(void)
{
if (r_detail == r_detail_high)
{
putbigdot = &PUTDOT;
putbigdot2 = &PUTDOT2;
putbigwalldot = (scale_mtof >= USEBIGDOTS ? &PUTBIGDOT : &PUTDOT);
}
else
{
putbigdot = &PUTBIGDOT;
putbigdot2 = &PUTBIGDOT2;
putbigwalldot = &PUTBIGDOT;
}
}

void AM_Start(const bool mainwindow)
{
if (lastlevel != gamemap || lastepisode != gameepisode || !mainwindow)
Expand All @@ -439,19 +456,7 @@ void AM_Start(const bool mainwindow)
if (viewplayer)
viewplayer->automapopened++;

if (r_detail == r_detail_high)
{
putbigdot = &PUTDOT;
putbigdot2 = &PUTDOT2;
putbigwalldot = (scale_mtof >= USEBIGDOTS ? &PUTBIGDOT : &PUTDOT);
}
else
{
putbigdot = &PUTBIGDOT;
putbigdot2 = &PUTBIGDOT;
putbigwalldot = (scale_mtof >= USEBIGDOTS ? &PUTBIGDOT : &PUTDOT);
}

AM_InitPixelSize();
AM_InitVariables(mainwindow);
HU_ClearMessages();
D_FadeScreen(false);
Expand Down Expand Up @@ -1331,6 +1336,41 @@ static inline void PUTBIGDOT(unsigned int x, unsigned int y, const byte *color)
}
}

static inline void PUTBIGDOT2(unsigned int x, unsigned int y, const byte *color)
{
if (x < (unsigned int)MAPWIDTH)
{
byte *dot = mapscreen + y + x;
const bool attop = (y < MAPAREA);
const bool atbottom = (y < (unsigned int)MAPBOTTOM);

if (attop)
*dot = *color;

if (atbottom)
*(dot + MAPWIDTH) = *color;

if (x + 1 < (unsigned int)MAPWIDTH)
{
if (attop)
*(dot + 1) = *color;

if (atbottom)
*(dot + MAPWIDTH + 1) = *color;
}
}
else if (++x < (unsigned int)MAPWIDTH)
{
byte *dot = mapscreen + y + x;

if (y < MAPAREA)
*dot = *color;

if (y < (unsigned int)MAPBOTTOM)
*(dot + MAPWIDTH) = *color;
}
}

static inline void PUTTRANSLUCENTDOT(unsigned int x, unsigned int y, const byte *color)
{
if (x < (unsigned int)MAPWIDTH && y < MAPAREA)
Expand Down
1 change: 1 addition & 0 deletions src/am_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void AM_Ticker(void);
void AM_Drawer(void);
void AM_ClearFB(void);

void AM_InitPixelSize(void);
void AM_Start(const bool mainwindow);
void AM_ClearMarks(void);
void AM_ToggleFollowMode(const bool value);
Expand Down
2 changes: 1 addition & 1 deletion src/c_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -9560,7 +9560,7 @@ static void r_detail_cvar_func2(char *cmd, char *parms)
free(temp2);
}

AM_Start(automapactive);
AM_InitPixelSize();

free(temp1);

Expand Down
2 changes: 1 addition & 1 deletion src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,7 @@ static void M_ChangeDetail(int choice)
M_SaveCVARs();
STLib_Init();
R_InitColumnFunctions();
AM_Start(automapactive);
AM_InitPixelSize();
}

static void M_SizeDisplay(int choice)
Expand Down

0 comments on commit 3024d61

Please sign in to comment.