16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 07:39:19 +02:00

Merge branch 'tmj-dev' into lua

This commit is contained in:
milek7
2017-10-31 14:01:53 +01:00
26 changed files with 745 additions and 249 deletions

View File

@@ -9,6 +9,37 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "vertex.h"
#include "sn_utils.h"
void
world_vertex::serialize( std::ostream &s ) const {
sn_utils::ls_float64( s, position.x );
sn_utils::ls_float64( s, position.y );
sn_utils::ls_float64( s, position.z );
sn_utils::ls_float32( s, normal.x );
sn_utils::ls_float32( s, normal.y );
sn_utils::ls_float32( s, normal.z );
sn_utils::ls_float32( s, texture.x );
sn_utils::ls_float32( s, texture.y );
}
void
world_vertex::deserialize( std::istream &s ) {
position.x = sn_utils::ld_float64( s );
position.y = sn_utils::ld_float64( s );
position.z = sn_utils::ld_float64( s );
normal.x = sn_utils::ld_float32( s );
normal.y = sn_utils::ld_float32( s );
normal.z = sn_utils::ld_float32( s );
texture.x = sn_utils::ld_float32( s );
texture.y = sn_utils::ld_float32( s );
}
template <>
world_vertex &