diff --git a/tiled_wall/tiled_wall_data.cpp b/tiled_wall/tiled_wall_data.cpp index 5912158..e1cd696 100644 --- a/tiled_wall/tiled_wall_data.cpp +++ b/tiled_wall/tiled_wall_data.cpp @@ -56,12 +56,12 @@ Ref TiledWallData::get_texture(const int index) const { return _textures.get(index); } -void TiledWallData::set_texture(const int index, const Ref texture) { +void TiledWallData::set_texture(const int index, const Ref &texture) { ERR_FAIL_INDEX(index, _textures.size()); _textures.set(index, texture); } -void TiledWallData::add_texture(const Ref texture) { +void TiledWallData::add_texture(const Ref &texture) { _textures.push_back(texture); } void TiledWallData::remove_texture(const int index) { @@ -100,12 +100,12 @@ Ref TiledWallData::get_flavour_texture(const int index) const { return _flavour_textures.get(index); } -void TiledWallData::set_flavour_texture(const int index, const Ref texture) { +void TiledWallData::set_flavour_texture(const int index, const Ref &texture) { ERR_FAIL_INDEX(index, _flavour_textures.size()); _flavour_textures.set(index, texture); } -void TiledWallData::add_flavour_texture(const Ref texture) { +void TiledWallData::add_flavour_texture(const Ref &texture) { _flavour_textures.push_back(texture); } void TiledWallData::remove_flavour_texture(const int index) { diff --git a/tiled_wall/tiled_wall_data.h b/tiled_wall/tiled_wall_data.h index 3589d85..0f49567 100644 --- a/tiled_wall/tiled_wall_data.h +++ b/tiled_wall/tiled_wall_data.h @@ -61,8 +61,8 @@ public: //textures Ref get_texture(const int index) const; - void set_texture(const int index, const Ref texture); - void add_texture(const Ref texture); + void set_texture(const int index, const Ref &texture); + void add_texture(const Ref &texture); void remove_texture(const int index); int get_texture_count() const; @@ -72,8 +72,8 @@ public: //flavour_textures Ref get_flavour_texture(const int index) const; - void set_flavour_texture(const int index, const Ref texture); - void add_flavour_texture(const Ref texture); + void set_flavour_texture(const int index, const Ref &texture); + void add_flavour_texture(const Ref &texture); void remove_flavour_texture(const int index); int get_flavour_texture_count() const;