diff options
| author | Juan Linietsky | 2014-04-28 21:56:43 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-04-28 21:56:43 -0300 |
| commit | 87f37bc5a305e6a68ef232be580350588e300fcc (patch) | |
| tree | 608af97f58c0dd7f2f6f86d973b072f7888bfca0 /scene/resources/texture.cpp | |
| parent | 7fadc2f93a18f2b5487fbcd6e90bcde781c53fec (diff) | |
| download | godot-87f37bc5a305e6a68ef232be580350588e300fcc.tar.gz godot-87f37bc5a305e6a68ef232be580350588e300fcc.tar.zst godot-87f37bc5a305e6a68ef232be580350588e300fcc.zip | |
-Added OpenSSL and HTTPS support
-Built-in version of the library for Windows, Android and iOS (other OSs use system one)
-Small fixes all around
Diffstat (limited to 'scene/resources/texture.cpp')
| -rw-r--r-- | scene/resources/texture.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index be3b921ba..baf6fa9d8 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -648,15 +648,31 @@ uint32_t LargeTexture::get_flags() const{ } -void LargeTexture::add_piece(const Point2& p_offset,const Ref<Texture>& p_texture) { +int LargeTexture::add_piece(const Point2& p_offset,const Ref<Texture>& p_texture) { - ERR_FAIL_COND(p_texture.is_null()); + ERR_FAIL_COND_V(p_texture.is_null(), -1); Piece p; p.offset=p_offset; p.texture=p_texture; pieces.push_back(p); + + return pieces.size() - 1; } +void LargeTexture::set_piece_offset(int p_idx, const Point2& p_offset) { + + ERR_FAIL_INDEX(p_idx, pieces.size()); + pieces[p_idx].offset = p_offset; +}; + +void LargeTexture::set_piece_texture(int p_idx, const Ref<Texture>& p_texture) { + + ERR_FAIL_INDEX(p_idx, pieces.size()); + pieces[p_idx].texture = p_texture; +}; + + + void LargeTexture::set_size(const Size2& p_size){ size=p_size; @@ -709,6 +725,8 @@ Ref<Texture> LargeTexture::get_piece_texture(int p_idx) const{ void LargeTexture::_bind_methods() { ObjectTypeDB::bind_method(_MD("add_piece","ofs","texture:Texture"),&LargeTexture::add_piece); + ObjectTypeDB::bind_method(_MD("set_piece_offset", "idx", "ofs"),&LargeTexture::set_piece_offset); + ObjectTypeDB::bind_method(_MD("set_piece_texture","idx", "texture:Texture"),&LargeTexture::set_piece_texture); ObjectTypeDB::bind_method(_MD("set_size","size"),&LargeTexture::set_size); ObjectTypeDB::bind_method(_MD("clear"),&LargeTexture::clear); |
