Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
b022ebe9
Commit
b022ebe9
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
better crosshair
parent
f7c17279
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/am_map.c
+26
-11
26 additions, 11 deletions
src/am_map.c
with
26 additions
and
11 deletions
src/am_map.c
+
26
−
11
View file @
b022ebe9
...
...
@@ -62,7 +62,7 @@ static const UINT8 NOCLIMBYELLOWS = (11*16);
#define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS
#define THINGCOLORS GREENS
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
#define XHAIRCOLORS
GRAYS
#define XHAIRCOLORS
DWHITE
// controls
#define AM_PANUPKEY KEY_UPARROW
...
...
@@ -137,16 +137,14 @@ static const mline_t player_arrow[] = {
#undef R
#define NUMPLYRLINES (sizeof (player_arrow)/sizeof (mline_t))
#if 0
#define R (FRACUNIT)
static mline_t
triangle_guy
[] =
{
{ { (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
} },
{ {
(fixed_t) 0, (fixed_t) R }, { (fixed_t)-.867f*R, (fixed_t)-.5f*
R } }
static
const
mline_t
cross_mark
[]
=
{
{
{
-
R
,
0
},
{
R
,
0
}
},
{
{
0
,
-
R
},
{
0
,
R
}
}
,
};
#undef R
#define NUMTRIANGLEGUYLINES (sizeof (triangle_guy)/sizeof (mline_t))
#endif
#define NUMCROSSMARKLINES (sizeof(cross_mark)/sizeof(mline_t))
#define R (FRACUNIT)
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.
*/
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.
...
...
@@ -1096,5 +1111,5 @@ void AM_Drawer(void)
AM_drawPlayers
();
AM_drawThings
(
THINGCOLORS
);
AM_drawCrosshair
(
XHAIRCOLORS
);
if
(
!
followplayer
)
AM_drawCrosshair
(
XHAIRCOLORS
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment