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
e7fcc08d
Commit
e7fcc08d
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Fix minetestmapper.py
parent
520b4702
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
util/minetestmapper.py
+12
-2
12 additions, 2 deletions
util/minetestmapper.py
with
12 additions
and
2 deletions
util/minetestmapper.py
+
12
−
2
View file @
e7fcc08d
...
...
@@ -88,9 +88,19 @@ def int_to_hex4(i):
def
getBlockAsInteger
(
p
):
return
p
[
2
]
*
16777216
+
p
[
1
]
*
4096
+
p
[
0
]
def
getIntegerAsBlock
(
i
):
return
i
%
4096
,
int
(
i
/
4096
)
%
4096
,
int
(
i
/
16777216
)
%
4096
def
unsignedToSigned
(
i
,
max_positive
):
if
i
<
max_positive
:
return
i
else
:
return
i
-
2
*
max_positive
def
getIntegerAsBlock
(
i
):
x
=
unsignedToSigned
(
i
%
4096
,
2048
)
i
=
int
((
i
-
x
)
/
4096
)
y
=
unsignedToSigned
(
i
%
4096
,
2048
)
i
=
int
((
i
-
y
)
/
4096
)
z
=
unsignedToSigned
(
i
%
4096
,
2048
)
return
x
,
y
,
z
def
limit
(
i
,
l
,
h
):
if
(
i
>
h
):
...
...
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