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
e149d1ad
Commit
e149d1ad
authored
11 years ago
by
BlockMen
Browse files
Options
Downloads
Patches
Plain Diff
Fix write and read S32 vectors
parent
7cdbb805
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/util/serialize.h
+15
-2
15 additions, 2 deletions
src/util/serialize.h
with
15 additions
and
2 deletions
src/util/serialize.h
+
15
−
2
View file @
e149d1ad
...
...
@@ -166,14 +166,14 @@ inline v2s16 readV2S16(const u8 *data)
inline
void
writeV2S32
(
u8
*
data
,
v2s32
p
)
{
writeS32
(
&
data
[
0
],
p
.
X
);
writeS32
(
&
data
[
2
],
p
.
Y
);
writeS32
(
&
data
[
4
],
p
.
Y
);
}
inline
v2s32
readV2S32
(
const
u8
*
data
)
{
v2s32
p
;
p
.
X
=
readS32
(
&
data
[
0
]);
p
.
Y
=
readS32
(
&
data
[
2
]);
p
.
Y
=
readS32
(
&
data
[
4
]);
return
p
;
}
...
...
@@ -346,6 +346,19 @@ inline v2s16 readV2S16(std::istream &is)
return
readV2S16
((
u8
*
)
buf
);
}
inline
void
writeV2S32
(
std
::
ostream
&
os
,
v2s32
p
)
{
char
buf
[
8
]
=
{
0
};
writeV2S32
((
u8
*
)
buf
,
p
);
os
.
write
(
buf
,
8
);
}
inline
v2s32
readV2S32
(
std
::
istream
&
is
)
{
char
buf
[
8
]
=
{
0
};
is
.
read
(
buf
,
8
);
return
readV2S32
((
u8
*
)
buf
);
}
inline
void
writeV3S16
(
std
::
ostream
&
os
,
v3s16
p
)
{
char
buf
[
6
]
=
{
0
};
...
...
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