medfall

A super great game engine
Log | Files | Refs

commit a3a5ac310c06424cb52e5c52a53b2507702abd58
parent a5cbef0b759cd10929d4ed9678281f83624974e1
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat May 13 15:32:10 +0300

Add v2u32

Diffstat:
linear_algebra.h | 12++++++++++++
visitors/linear_algebra.h | 12++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/linear_algebra.h b/linear_algebra.h @@ -36,6 +36,18 @@ struct v2 { }; // AUTOVISITOR +struct v2u32 { + u32 x, y; + + v2u32() { } + + explicit v2u32( u32 a, u32 b ) { + x = a; + y = b; + } +}; + +// AUTOVISITOR struct v2s32 { s32 x, y; diff --git a/visitors/linear_algebra.h b/visitors/linear_algebra.h @@ -17,6 +17,18 @@ void visit( const v2 & obj, F f ) { } template< typename F > +void visit( v2u32 & obj, F f ) { + visit( obj.x, f ); + visit( obj.y, f ); +} + +template< typename F > +void visit( const v2u32 & obj, F f ) { + visit( obj.x, f ); + visit( obj.y, f ); +} + +template< typename F > void visit( v2s32 & obj, F f ) { visit( obj.x, f ); visit( obj.y, f );