diff options
Diffstat (limited to 'platform/nacl')
-rw-r--r-- | platform/nacl/audio_driver_nacl.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/audio_driver_nacl.h | 2 | ||||
-rw-r--r-- | platform/nacl/context_gl_nacl.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/context_gl_nacl.h | 2 | ||||
-rw-r--r-- | platform/nacl/geturl_handler.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/geturl_handler.h | 2 | ||||
-rw-r--r-- | platform/nacl/godot_module.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/godot_nacl.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/nacl_keycodes.h | 2 | ||||
-rw-r--r-- | platform/nacl/opengl_context.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/opengl_context.h | 2 | ||||
-rw-r--r-- | platform/nacl/os_nacl.cpp | 44 | ||||
-rw-r--r-- | platform/nacl/os_nacl.h | 6 | ||||
-rw-r--r-- | platform/nacl/pepper_main.cpp | 2 | ||||
-rw-r--r-- | platform/nacl/platform_config.h | 2 |
15 files changed, 55 insertions, 21 deletions
diff --git a/platform/nacl/audio_driver_nacl.cpp b/platform/nacl/audio_driver_nacl.cpp index 8f1861eee3..27197ad2b2 100644 --- a/platform/nacl/audio_driver_nacl.cpp +++ b/platform/nacl/audio_driver_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/audio_driver_nacl.h b/platform/nacl/audio_driver_nacl.h index 4a45d0bb4b..be5a4cba67 100644 --- a/platform/nacl/audio_driver_nacl.h +++ b/platform/nacl/audio_driver_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/context_gl_nacl.cpp b/platform/nacl/context_gl_nacl.cpp index 70cf01a16e..8ba3fe49d2 100644 --- a/platform/nacl/context_gl_nacl.cpp +++ b/platform/nacl/context_gl_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/context_gl_nacl.h b/platform/nacl/context_gl_nacl.h index a5cf7a728c..18da070e35 100644 --- a/platform/nacl/context_gl_nacl.h +++ b/platform/nacl/context_gl_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/geturl_handler.cpp b/platform/nacl/geturl_handler.cpp index 4873d691ce..40583891a9 100644 --- a/platform/nacl/geturl_handler.cpp +++ b/platform/nacl/geturl_handler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/geturl_handler.h b/platform/nacl/geturl_handler.h index 44086ae7c1..901210febd 100644 --- a/platform/nacl/geturl_handler.h +++ b/platform/nacl/geturl_handler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/godot_module.cpp b/platform/nacl/godot_module.cpp index b5a049d9bf..490edf62cd 100644 --- a/platform/nacl/godot_module.cpp +++ b/platform/nacl/godot_module.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/godot_nacl.cpp b/platform/nacl/godot_nacl.cpp index 753f4124f8..7302a0b5d5 100644 --- a/platform/nacl/godot_nacl.cpp +++ b/platform/nacl/godot_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/nacl_keycodes.h b/platform/nacl/nacl_keycodes.h index 1cbf379078..b8ff5874cf 100644 --- a/platform/nacl/nacl_keycodes.h +++ b/platform/nacl/nacl_keycodes.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/opengl_context.cpp b/platform/nacl/opengl_context.cpp index 8dafe959a3..285e8df9ce 100644 --- a/platform/nacl/opengl_context.cpp +++ b/platform/nacl/opengl_context.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/opengl_context.h b/platform/nacl/opengl_context.h index b0431f29bf..6c73873f4b 100644 --- a/platform/nacl/opengl_context.h +++ b/platform/nacl/opengl_context.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp index 65f66b0354..b282209d72 100644 --- a/platform/nacl/os_nacl.cpp +++ b/platform/nacl/os_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -240,10 +240,14 @@ MainLoop *OSNacl::get_main_loop() const { return main_loop; }; -OS::Date OSNacl::get_date() const { +OS::Date OSNacl::get_date(bool utc) const { time_t t=time(NULL); - struct tm *lt=localtime(&t); + struct tm *lt; + if (utc) + lt=gmtime(&t); + else + lt=localtime(&t); Date ret; ret.year=lt->tm_year; ret.month=(Month)lt->tm_mon; @@ -254,10 +258,14 @@ OS::Date OSNacl::get_date() const { return ret; }; -OS::Time OSNacl::get_time() const { +OS::Time OSNacl::get_time(bool utc) const { time_t t=time(NULL); - struct tm *lt=localtime(&t); + struct tm *lt; + if (utc) + lt=gmtime(&t); + else + lt=localtime(&t); Time ret; ret.hour=lt->tm_hour; ret.min=lt->tm_min; @@ -265,6 +273,32 @@ OS::Time OSNacl::get_time() const { return ret; }; +OS::TimeZoneInfo OS_Unix::get_time_zone_info() const { + time_t t = time(NULL); + struct tm *lt = localtime(&t); + char name[16]; + strftime(name, 16, "%Z", lt); + name[15] = 0; + TimeZoneInfo ret; + ret.name = name; + + char bias_buf[16]; + strftime(bias_buf, 16, "%z", lt); + int bias; + bias_buf[15] = 0; + sscanf(bias_buf, "%d", &bias); + + // convert from ISO 8601 (1 minute=1, 1 hour=100) to minutes + int hour = (int)bias / 100; + int minutes = bias % 100; + if (bias < 0) + ret.bias = hour * 60 - minutes; + else + ret.bias = hour * 60 + minutes; + + return ret; +}; + void OSNacl::delay_usec(uint32_t p_usec) const { //usleep(p_usec); diff --git a/platform/nacl/os_nacl.h b/platform/nacl/os_nacl.h index b8173ef61c..e033abb68d 100644 --- a/platform/nacl/os_nacl.h +++ b/platform/nacl/os_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,8 +137,8 @@ public: virtual MainLoop *get_main_loop() const; - virtual Date get_date() const; - virtual Time get_time() const; + virtual Date get_date(bool utc) const; + virtual Time get_time(bool utc) const; virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; diff --git a/platform/nacl/pepper_main.cpp b/platform/nacl/pepper_main.cpp index 6a1f4acbe7..406d84419b 100644 --- a/platform/nacl/pepper_main.cpp +++ b/platform/nacl/pepper_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/platform_config.h b/platform/nacl/platform_config.h index 38fc934ae4..1e7d066bb9 100644 --- a/platform/nacl/platform_config.h +++ b/platform/nacl/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ |