Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
efd8dabd
Commit
efd8dabd
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Lava is now better visible inside water. (a crappy hack)
parent
e4f443a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/content_mapblock.cpp
+16
-12
16 additions, 12 deletions
src/content_mapblock.cpp
src/content_mapnode.cpp
+2
-0
2 additions, 0 deletions
src/content_mapnode.cpp
src/mapnode.h
+2
-0
2 additions, 0 deletions
src/mapnode.h
with
20 additions
and
12 deletions
src/content_mapblock.cpp
+
16
−
12
View file @
efd8dabd
...
...
@@ -448,12 +448,6 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
{
air_count
++
;
}
/*// Air is liquid level 0
else if(content == CONTENT_AIR)
{
cornerlevel += -0.5*BS;
valid_count++;
}*/
}
if
(
air_count
>=
2
)
cornerlevel
=
-
0.5
*
BS
;
...
...
@@ -490,17 +484,20 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
neighbor_flags
[
dir
]
&
neighborflag_top_is_same_liquid
)
continue
;
u8
neighbor_content
=
neighbor_contents
[
dir
];
content_t
neighbor_content
=
neighbor_contents
[
dir
];
// Don't draw face if neighbor is not air or liquid
if
(
neighbor_content
!=
CONTENT_AIR
&&
neighbor_content
!=
c_sourc
e
)
&&
content_liquid
(
neighbor_content
)
==
fals
e
)
continue
;
bool
neighbor_is_liquid
=
(
neighbor_content
==
c_source
);
bool
neighbor_is_same_liquid
=
(
neighbor_content
==
c_source
||
neighbor_content
==
c_flowing
);
// Don't draw any faces if neighbor is liquid and top is liquid
if
(
neighbor_is_liquid
==
true
&&
top_is_same_liquid
==
false
)
// Don't draw any faces if neighbor same is liquid and top is
// same liquid
if
(
neighbor_is_same_liquid
==
true
&&
top_is_same_liquid
==
false
)
continue
;
video
::
S3DVertex
vertices
[
4
]
=
...
...
@@ -541,7 +538,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
If neighbor is liquid, lower border of face is corner
liquid levels
*/
if
(
neighbor_is_liquid
)
if
(
neighbor_is_
same_
liquid
)
{
vertices
[
0
].
Pos
.
Y
=
corner_levels
[
side_corners
[
i
][
1
]];
vertices
[
1
].
Pos
.
Y
=
corner_levels
[
side_corners
[
i
][
0
]];
...
...
@@ -566,6 +563,13 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
vertices
[
j
].
Pos
.
rotateXZBy
(
90
);
if
(
dir
==
v3s16
(
1
,
0
,
-
0
))
vertices
[
j
].
Pos
.
rotateXZBy
(
-
90
);
// Do this to not cause glitches when two liquids are
// side-by-side
if
(
neighbor_is_same_liquid
==
false
){
vertices
[
j
].
Pos
.
X
*=
0.98
;
vertices
[
j
].
Pos
.
Z
*=
0.98
;
}
vertices
[
j
].
Pos
+=
intToFloat
(
p
+
blockpos_nodes
,
BS
);
}
...
...
This diff is collapsed.
Click to expand it.
src/content_mapnode.cpp
+
2
−
0
View file @
efd8dabd
...
...
@@ -370,6 +370,7 @@ void content_mapnode_init()
f
->
param_type
=
CPT_LIGHT
;
f
->
light_propagates
=
true
;
f
->
solidness
=
0
;
// Drawn separately, makes no faces
f
->
visual_solidness
=
1
;
f
->
walkable
=
false
;
f
->
pointable
=
false
;
f
->
diggable
=
false
;
...
...
@@ -449,6 +450,7 @@ void content_mapnode_init()
f
->
light_propagates
=
false
;
f
->
light_source
=
LIGHT_MAX
-
1
;
f
->
solidness
=
0
;
// Drawn separately, makes no faces
f
->
visual_solidness
=
2
;
f
->
walkable
=
false
;
f
->
pointable
=
false
;
f
->
diggable
=
false
;
...
...
This diff is collapsed.
Click to expand it.
src/mapnode.h
+
2
−
0
View file @
efd8dabd
...
...
@@ -121,6 +121,7 @@ struct ContentFeatures
bool
light_propagates
;
bool
sunlight_propagates
;
u8
solidness
;
// Used when choosing which face is drawn
u8
visual_solidness
;
// When solidness=0, this tells how it looks like
// This is used for collision detection.
// Also for general solidness queries.
bool
walkable
;
...
...
@@ -181,6 +182,7 @@ struct ContentFeatures
light_propagates
=
false
;
sunlight_propagates
=
false
;
solidness
=
2
;
visual_solidness
=
0
;
walkable
=
true
;
pointable
=
true
;
diggable
=
true
;
...
...
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