From f85ed10a525f0740eea98350f2cb0ed84db8530c Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 14 Jan 2009 08:06:09 +0000 Subject: [PATCH] use "%f" format for angles, prevents weird exponential stuff git-svn-id: svn://svn.icculus.org/netradiant/trunk@172 61c419a2-8eb2-4b30-bcec-8cead039b335 --- plugins/entity/angle.h | 2 +- plugins/entity/angles.h | 2 +- plugins/entity/origin.h | 2 +- plugins/entity/scale.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/entity/angle.h b/plugins/entity/angle.h index 08e8b90d..b5bc6d9a 100644 --- a/plugins/entity/angle.h +++ b/plugins/entity/angle.h @@ -58,7 +58,7 @@ inline void write_angle(float angle, Entity* entity) else { char value[64]; - sprintf(value, "%g", angle); + sprintf(value, "%f", angle); entity->setKeyValue("angle", value); } } diff --git a/plugins/entity/angles.h b/plugins/entity/angles.h index fbcb0457..dd446120 100644 --- a/plugins/entity/angles.h +++ b/plugins/entity/angles.h @@ -87,7 +87,7 @@ inline void write_angles(const Vector3& angles, Entity* entity) } else { - sprintf(value, "%g %g %g", angles[1], angles[2], angles[0]); + sprintf(value, "%f %f %f", angles[1], angles[2], angles[0]); entity->setKeyValue("angle", ""); entity->setKeyValue("angles", value); } diff --git a/plugins/entity/origin.h b/plugins/entity/origin.h index 75d4ee47..c6c3c515 100644 --- a/plugins/entity/origin.h +++ b/plugins/entity/origin.h @@ -44,7 +44,7 @@ inline void read_origin(Vector3& origin, const char* value) inline void write_origin(const Vector3& origin, Entity* entity, const char* key) { char value[64]; - sprintf(value, "%g %g %g", origin[0], origin[1], origin[2]); + sprintf(value, "%f %f %f", origin[0], origin[1], origin[2]); entity->setKeyValue(key, value); } diff --git a/plugins/entity/scale.h b/plugins/entity/scale.h index 54bfc932..82668040 100644 --- a/plugins/entity/scale.h +++ b/plugins/entity/scale.h @@ -68,13 +68,13 @@ inline void write_scale(const Vector3& scale, Entity* entity) if(scale[0] == scale[1] && scale[0] == scale[2]) { - sprintf(value, "%g", scale[0]); + sprintf(value, "%f", scale[0]); entity->setKeyValue("modelscale_vec", ""); entity->setKeyValue("modelscale", value); } else { - sprintf(value, "%g %g %g", scale[0], scale[1], scale[2]); + sprintf(value, "%f %f %f", scale[0], scale[1], scale[2]); entity->setKeyValue("modelscale", ""); entity->setKeyValue("modelscale_vec", value); } -- 2.39.2