medfall

A super great game engine
Log | Files | Refs

commit e04dee260b99690a8f6a4af0fa680fc1e80e5a2c
parent 7af60b23af2eae869cbf3ee702abed9ca962efce
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Apr 23 16:42:14 +0300

Add ggformat overloads for m2/m3/m4

Diffstat:
linear_algebra.h | 32+++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/linear_algebra.h b/linear_algebra.h @@ -793,11 +793,41 @@ inline void format( FormatBuffer * fb, const v4 & v, const FormatOpts & opts ) { format( fb, v.y, opts ); format( fb, ", " ); format( fb, v.z, opts ); - format( fb, ", w = " ); + format( fb, ", " ); format( fb, v.w, opts ); format( fb, ")" ); } +inline void format( FormatBuffer * fb, const m2 & m, const FormatOpts & opts ) { + format( fb, "m2(" ); + format( fb, m.row0(), opts ); + format( fb, ", " ); + format( fb, m.row1(), opts ); + format( fb, ")" ); +} + +inline void format( FormatBuffer * fb, const m3 & m, const FormatOpts & opts ) { + format( fb, "m3(" ); + format( fb, m.row0(), opts ); + format( fb, ", " ); + format( fb, m.row1(), opts ); + format( fb, ", " ); + format( fb, m.row2(), opts ); + format( fb, ")" ); +} + +inline void format( FormatBuffer * fb, const m4 & m, const FormatOpts & opts ) { + format( fb, "m4(" ); + format( fb, m.row0(), opts ); + format( fb, ", " ); + format( fb, m.row1(), opts ); + format( fb, ", " ); + format( fb, m.row2(), opts ); + format( fb, ", " ); + format( fb, m.row3(), opts ); + format( fb, ")" ); +} + /* * autogenerated visitor header */