diff options
Diffstat (limited to 'src/utility.h')
-rw-r--r-- | src/utility.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utility.h b/src/utility.h index fd2881cff..785ff167c 100644 --- a/src/utility.h +++ b/src/utility.h @@ -36,6 +36,9 @@ with this program; if not, write to the Free Software Foundation, Inc., extern const v3s16 g_26dirs[26]; +// 26th is (0,0,0) +extern const v3s16 g_27dirs[27]; + inline void writeU32(u8 *data, u32 i) { data[0] = ((i>>24)&0xff); @@ -666,6 +669,14 @@ inline s32 stoi(std::string s) return atoi(s.c_str()); } +inline float stof(std::string s) +{ + float f; + std::istringstream ss(s); + ss>>f; + return f; +} + inline std::string itos(s32 i) { std::ostringstream o; |