mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-17 17:41:57 +00:00
better crosshair
This commit is contained in:
parent
f7c1727959
commit
b022ebe912
1 changed files with 26 additions and 11 deletions
37
src/am_map.c
37
src/am_map.c
|
@ -62,7 +62,7 @@ static const UINT8 NOCLIMBYELLOWS = (11*16);
|
||||||
#define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS
|
#define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS
|
||||||
#define THINGCOLORS GREENS
|
#define THINGCOLORS GREENS
|
||||||
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
|
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
|
||||||
#define XHAIRCOLORS GRAYS
|
#define XHAIRCOLORS DWHITE
|
||||||
|
|
||||||
// controls
|
// controls
|
||||||
#define AM_PANUPKEY KEY_UPARROW
|
#define AM_PANUPKEY KEY_UPARROW
|
||||||
|
@ -137,16 +137,14 @@ static const mline_t player_arrow[] = {
|
||||||
#undef R
|
#undef R
|
||||||
#define NUMPLYRLINES (sizeof (player_arrow)/sizeof (mline_t))
|
#define NUMPLYRLINES (sizeof (player_arrow)/sizeof (mline_t))
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define R (FRACUNIT)
|
#define R (FRACUNIT)
|
||||||
static mline_t triangle_guy[] = {
|
static const mline_t cross_mark[] =
|
||||||
{ { (fixed_t)-.867f*R, (fixed_t)-.5f*R }, { (fixed_t) .867f*R, (fixed_t)-.5f*R } },
|
{
|
||||||
{ { (fixed_t) .867f*R, (fixed_t)-.5f*R }, { (fixed_t) 0, (fixed_t) R } },
|
{ { -R, 0 }, { R, 0} },
|
||||||
{ { (fixed_t) 0, (fixed_t) R }, { (fixed_t)-.867f*R, (fixed_t)-.5f*R } }
|
{ { 0, -R }, { 0, R } },
|
||||||
};
|
};
|
||||||
#undef R
|
#undef R
|
||||||
#define NUMTRIANGLEGUYLINES (sizeof (triangle_guy)/sizeof (mline_t))
|
#define NUMCROSSMARKLINES (sizeof(cross_mark)/sizeof(mline_t))
|
||||||
#endif
|
|
||||||
|
|
||||||
#define R (FRACUNIT)
|
#define R (FRACUNIT)
|
||||||
static const mline_t thintriangle_guy[] = {
|
static const mline_t thintriangle_guy[] = {
|
||||||
|
@ -1074,13 +1072,30 @@ static inline void AM_drawThings(UINT8 colors)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draws the crosshair, actually just a dot in software mode.
|
/** Draws the crosshair.
|
||||||
*
|
*
|
||||||
* \param color Color for the crosshair.
|
* \param color Color for the crosshair.
|
||||||
*/
|
*/
|
||||||
static inline void AM_drawCrosshair(UINT8 color)
|
static inline void AM_drawCrosshair(UINT8 color)
|
||||||
{
|
{
|
||||||
V_DrawFill(f_w/2 + f_x, f_h/2 + f_y, 1, 1, color|V_NOSCALESTART);
|
const fixed_t scale = 4<<FRACBITS;
|
||||||
|
size_t i;
|
||||||
|
fline_t fl;
|
||||||
|
|
||||||
|
for (i = 0; i < NUMCROSSMARKLINES; i++)
|
||||||
|
{
|
||||||
|
fl.a.x = FixedMul(cross_mark[i].a.x, scale) >> FRACBITS;
|
||||||
|
fl.a.y = FixedMul(cross_mark[i].a.y, scale) >> FRACBITS;
|
||||||
|
fl.b.x = FixedMul(cross_mark[i].b.x, scale) >> FRACBITS;
|
||||||
|
fl.b.y = FixedMul(cross_mark[i].b.y, scale) >> FRACBITS;
|
||||||
|
|
||||||
|
fl.a.x += f_x + (f_w / 2);
|
||||||
|
fl.a.y += f_y + (f_h / 2);
|
||||||
|
fl.b.x += f_x + (f_w / 2);
|
||||||
|
fl.b.y += f_y + (f_h / 2);
|
||||||
|
|
||||||
|
AM_drawFline(&fl, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draws the automap.
|
/** Draws the automap.
|
||||||
|
@ -1096,5 +1111,5 @@ void AM_Drawer(void)
|
||||||
AM_drawPlayers();
|
AM_drawPlayers();
|
||||||
AM_drawThings(THINGCOLORS);
|
AM_drawThings(THINGCOLORS);
|
||||||
|
|
||||||
AM_drawCrosshair(XHAIRCOLORS);
|
if (!followplayer) AM_drawCrosshair(XHAIRCOLORS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue