From: Peter Sadrozinski Date: Fri, 19 Oct 2012 02:46:35 +0000 (-0400) Subject: Add SGGeod read and write to gzFile X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=47dec485e56c278014ef89bef9b173b88eae41dd;p=simgear.git Add SGGeod read and write to gzFile --- diff --git a/simgear/io/lowlevel.hxx b/simgear/io/lowlevel.hxx index bab26ab5..2367d0d4 100644 --- a/simgear/io/lowlevel.hxx +++ b/simgear/io/lowlevel.hxx @@ -110,6 +110,17 @@ inline void sgWriteMat4 ( gzFile fd, const SGMatrixf& var ) { sgWriteFloat ( fd, 16, (float *)var.data() ) ; } +inline void sgReadGeod ( gzFile fd, SGGeod& var ) { + double data[3]; + sgReadDouble ( fd, 3, data ); + var = SGGeod::fromDegM( data[0], data[1], data[2] ); +} +inline void sgWriteGeod ( gzFile fd, const SGGeod& var ) { + sgWriteDouble( fd, var.getLongitudeDeg() ); + sgWriteDouble( fd, var.getLatitudeDeg() ); + sgWriteDouble( fd, var.getElevationM() ); +} + void sgClearReadError(); void sgClearWriteError(); int sgReadError();