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
a4e4fdbd
Commit
a4e4fdbd
authored
1 year ago
by
sphere
Browse files
Options
Downloads
Plain Diff
Merge branch 'repeat-midtex' into texture-skewing
parents
3909f424
787dfe33
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
Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs
+45
-20
45 additions, 20 deletions
...ce/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs
with
45 additions
and
20 deletions
Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs
+
45
−
20
View file @
a4e4fdbd
...
...
@@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
#
region
==================
Variables
private
bool
repeatmidtex
;
private
int
repetitions
;
private
Plane
topclipplane
;
private
Plane
bottomclipplane
;
...
...
@@ -46,6 +47,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
#
region
==================
Properties
private
bool
RepeatIndefinitely
{
get
{
return
repeatmidtex
&&
repetitions
==
1
;
}
}
#
endregion
#
region
==================
Constructor
/
Setup
...
...
@@ -210,34 +213,56 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Determine if we should repeat the middle texture. In UDMF this is done with a flag, in Hexen with
// a argument to the 121:Line_SetIdentification. See https://www.zdoom.org/w/index.php?title=Line_SetIdentification
if
(
General
.
Map
.
UDMF
)
{
repeatmidtex
=
Sidedef
.
IsFlagSet
(
"wrapmidtex"
)
||
Sidedef
.
Line
.
IsFlagSet
(
"wrapmidtex"
);
//mxd
repetitions
=
repeatmidtex
?
Sidedef
.
Fields
.
GetValue
(
"repeatcnt"
,
0
)
+
1
:
1
;
}
else
if
(
General
.
Map
.
HEXEN
)
{
repeatmidtex
=
Sidedef
.
Line
.
Action
==
121
&&
(
Sidedef
.
Line
.
Args
[
1
]
&
16
)
==
16
;
repetitions
=
1
;
}
else
{
repeatmidtex
=
false
;
repetitions
=
1
;
}
if
(!
repeatmidtex
)
{
// First determine the visible portion of the texture
double
textop
;
// First determine the visible portion of the texture
double
textop
,
texbottom
;
if
(!
RepeatIndefinitely
)
{
// Determine top portion height
if
(
Sidedef
.
Line
.
IsFlagSet
(
General
.
Map
.
Config
.
PegMidtextureFlag
))
textop
=
geobottom
+
tof
.
y
+
Math
.
Abs
(
tsz
.
y
);
textop
=
geobottom
+
tof
.
y
+
repetitions
*
Math
.
Abs
(
tsz
.
y
);
else
textop
=
geotop
+
tof
.
y
;
// Calculate bottom portion height
double
texbottom
=
textop
-
Math
.
Abs
(
tsz
.
y
);
texbottom
=
textop
-
repetitions
*
Math
.
Abs
(
tsz
.
y
);
}
else
{
if
(
Sidedef
.
Line
.
IsFlagSet
(
General
.
Map
.
Config
.
PegMidtextureFlag
))
{
textop
=
geotop
;
texbottom
=
geobottom
+
tof
.
y
;
}
else
{
textop
=
geotop
+
tof
.
y
;
texbottom
=
geobottom
;
}
}
// Create crop planes (we also need these for intersection testing)
topclipplane
=
new
Plane
(
new
Vector3D
(
0
,
0
,
-
1
),
textop
);
bottomclipplane
=
new
Plane
(
new
Vector3D
(
0
,
0
,
1
),
-
texbottom
);
// Create crop planes (we also need these for intersection testing)
topclipplane
=
new
Plane
(
new
Vector3D
(
0
,
0
,
-
1
),
textop
);
bottomclipplane
=
new
Plane
(
new
Vector3D
(
0
,
0
,
1
),
-
texbottom
);
// Crop polygon by these heights
CropPoly
(
ref
poly
,
topclipplane
,
true
);
CropPoly
(
ref
poly
,
bottomclipplane
,
true
);
}
// Crop polygon by these heights
CropPoly
(
ref
poly
,
topclipplane
,
true
);
CropPoly
(
ref
poly
,
bottomclipplane
,
true
);
//mxd. In(G)ZDoom, middle sidedef parts are not clipped by extrafloors of any type...
List
<
WallPolygon
>
polygons
=
new
List
<
WallPolygon
>
{
poly
};
...
...
@@ -282,13 +307,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This performs a fast test in object picking
public
override
bool
PickFastReject
(
Vector3D
from
,
Vector3D
to
,
Vector3D
dir
)
{
if
(!
r
epeat
midtex
)
{
// When the texture is not repeated, leave when outside crop planes
//
if(!
R
epeat
Indefinitely
)
//
{
// When the texture is not repeated
indefinitely
, leave when outside crop planes
if
((
pickintersect
.
z
<
bottomclipplane
.
GetZ
(
pickintersect
))
||
(
pickintersect
.
z
>
topclipplane
.
GetZ
(
pickintersect
)))
return
false
;
}
//
}
return
base
.
PickFastReject
(
from
,
to
,
dir
);
}
...
...
@@ -316,7 +341,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
%
imageWidth
);
int
oy
;
if
(
r
epeat
midtex
)
/*
if (
R
epeat
Indefinitely
)
{
bool pegbottom = Sidedef.Line.IsFlagSet(General.Map.Config.PegMidtextureFlag);
double zoffset = (pegbottom ? Sidedef.Sector.FloorHeight : Sidedef.Sector.CeilHeight);
...
...
@@ -325,10 +350,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
% imageHeight);
}
else
{
{
*/
double
zoffset
=
bottomclipplane
.
GetZ
(
pickintersect
);
oy
=
(
int
)
Math
.
Ceiling
(((
pickintersect
.
z
-
zoffset
)
*
UniFields
.
GetFloat
(
Sidedef
.
Fields
,
"scaley_mid"
,
1.0f
)
/
texscale
.
y
)
%
imageHeight
);
}
//
}
// Make sure offsets are inside of texture dimensions...
if
(
ox
<
0
)
ox
+=
imageWidth
;
...
...
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