Make Ref parameters references wherever possible in TiledWallData.

This commit is contained in:
Relintai 2021-08-17 01:15:20 +02:00
parent acf1af1e77
commit b311a2656c
2 changed files with 8 additions and 8 deletions

View File

@ -56,12 +56,12 @@ Ref<Texture> TiledWallData::get_texture(const int index) const {
return _textures.get(index);
}
void TiledWallData::set_texture(const int index, const Ref<Texture> texture) {
void TiledWallData::set_texture(const int index, const Ref<Texture> &texture) {
ERR_FAIL_INDEX(index, _textures.size());
_textures.set(index, texture);
}
void TiledWallData::add_texture(const Ref<Texture> texture) {
void TiledWallData::add_texture(const Ref<Texture> &texture) {
_textures.push_back(texture);
}
void TiledWallData::remove_texture(const int index) {
@ -100,12 +100,12 @@ Ref<Texture> TiledWallData::get_flavour_texture(const int index) const {
return _flavour_textures.get(index);
}
void TiledWallData::set_flavour_texture(const int index, const Ref<Texture> texture) {
void TiledWallData::set_flavour_texture(const int index, const Ref<Texture> &texture) {
ERR_FAIL_INDEX(index, _flavour_textures.size());
_flavour_textures.set(index, texture);
}
void TiledWallData::add_flavour_texture(const Ref<Texture> texture) {
void TiledWallData::add_flavour_texture(const Ref<Texture> &texture) {
_flavour_textures.push_back(texture);
}
void TiledWallData::remove_flavour_texture(const int index) {

View File

@ -61,8 +61,8 @@ public:
//textures
Ref<Texture> get_texture(const int index) const;
void set_texture(const int index, const Ref<Texture> texture);
void add_texture(const Ref<Texture> texture);
void set_texture(const int index, const Ref<Texture> &texture);
void add_texture(const Ref<Texture> &texture);
void remove_texture(const int index);
int get_texture_count() const;
@ -72,8 +72,8 @@ public:
//flavour_textures
Ref<Texture> get_flavour_texture(const int index) const;
void set_flavour_texture(const int index, const Ref<Texture> texture);
void add_flavour_texture(const Ref<Texture> texture);
void set_flavour_texture(const int index, const Ref<Texture> &texture);
void add_flavour_texture(const Ref<Texture> &texture);
void remove_flavour_texture(const int index);
int get_flavour_texture_count() const;