Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
UltimateZoneBuilder
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
Alam Ed Arias
UltimateZoneBuilder
Commits
ddeeadf5
Commit
ddeeadf5
authored
12 years ago
by
MaxED
Browse files
Options
Downloads
Patches
Plain Diff
Added linedef direction preview to Draw Geometry mode
parent
566edbc0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs
+10
-0
10 additions, 0 deletions
Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs
with
10 additions
and
0 deletions
Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs
+
10
−
0
View file @
ddeeadf5
...
...
@@ -165,6 +165,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render line
renderer
.
RenderLine
(
lastp
.
pos
,
points
[
i
].
pos
,
LINE_THICKNESS
,
color
,
true
);
RenderLinedefDirectionIndicator
(
lastp
.
pos
,
points
[
i
].
pos
,
color
);
//mxd
lastp
=
points
[
i
];
}
...
...
@@ -174,6 +175,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render line to cursor
renderer
.
RenderLine
(
lastp
.
pos
,
curp
.
pos
,
LINE_THICKNESS
,
color
,
true
);
RenderLinedefDirectionIndicator
(
lastp
.
pos
,
curp
.
pos
,
color
);
//mxd
// Render vertices
for
(
int
i
=
0
;
i
<
points
.
Count
;
i
++)
...
...
@@ -204,6 +206,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Done
renderer
.
Present
();
}
//mxd
protected
void
RenderLinedefDirectionIndicator
(
Vector2D
start
,
Vector2D
end
,
PixelColor
color
)
{
Vector2D
delta
=
end
-
start
;
Vector2D
middlePoint
=
new
Vector2D
(
start
.
x
+
delta
.
x
/
2
,
start
.
y
+
delta
.
y
/
2
);
Vector2D
scaledPerpendicular
=
delta
.
GetPerpendicular
().
GetNormal
().
GetScaled
(
18f
/
renderer
.
Scale
);
renderer
.
RenderLine
(
middlePoint
,
new
Vector2D
(
middlePoint
.
x
-
scaledPerpendicular
.
x
,
middlePoint
.
y
-
scaledPerpendicular
.
y
),
LINE_THICKNESS
,
color
,
true
);
}
// This returns the aligned and snapped draw position
public
static
DrawnVertex
GetCurrentPosition
(
Vector2D
mousemappos
,
bool
snaptonearest
,
bool
snaptogrid
,
IRenderer2D
renderer
,
List
<
DrawnVertex
>
points
)
...
...
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