diff options
| author | Juan Linietsky | 2014-11-13 00:53:12 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-11-13 00:53:12 -0300 |
| commit | abbea4d945bbb1114570c3b6c7f649e01ca8ebb8 (patch) | |
| tree | d2b131b32705bbcf118efa72d5d9a21618c1227e /core/image.cpp | |
| parent | d02953c5963ca080d26500ea8250e0632a80b234 (diff) | |
| download | godot-abbea4d945bbb1114570c3b6c7f649e01ca8ebb8.tar.gz godot-abbea4d945bbb1114570c3b6c7f649e01ca8ebb8.tar.zst godot-abbea4d945bbb1114570c3b6c7f649e01ca8ebb8.zip | |
UDP Fixes
-=-=-=-=-
Curse the day I decided to port UDP code, as it ended up
being two nights of work. At least It's done now (I hope).
-Fixed UDP Support, API seems stable
-Added UDP Chat demo (chat that can lose your packets, heh)
-Added helpers to areas and bodies to get list of collided bodies and contained bodies.
-Sped up screen/viewport capture code.
-Added code to save an image as PNG
-Small fix so scripts register their singletons after modules did.
Diffstat (limited to '')
| -rw-r--r-- | core/image.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp index ae9fb0adc..17ee569b6 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -34,6 +34,7 @@ #include "print_string.h" #include <stdio.h> +SavePNGFunc Image::save_png_func = NULL; void Image::_put_pixel(int p_x,int p_y, const BColor& p_color, unsigned char *p_data) { @@ -1200,6 +1201,14 @@ Error Image::load(const String& p_path) { return ImageLoader::load_image(p_path, this); } +Error Image::save_png(const String& p_path) { + + if (save_png_func == NULL) + return ERR_UNAVAILABLE; + + return save_png_func(p_path, *this); +}; + bool Image::operator==(const Image& p_image) const { if (data.size() == 0 && p_image.data.size() == 0) |
