fix: optimization: PVS-Studio warning V813

Passing large objects by const reference avoids unnecessary copying and enhances efficiency.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-02 05:35:55 +03:00
committed by Pugemon
parent 5b325ac2bc
commit 2c1103307f
42 changed files with 173 additions and 144 deletions
+8 -6
View File
@@ -31,8 +31,8 @@ class Batch2D : public Flushable {
);
void vertex(
glm::vec2 point,
glm::vec2 uvpoint,
const glm::vec2& point,
const glm::vec2& uvpoint,
float r, float g, float b, float a
);
@@ -44,11 +44,13 @@ public:
void texture(Texture* texture);
void untexture();
void setRegion(UVRegion region);
void sprite(float x, float y, float w, float h, const UVRegion& region, glm::vec4 tint);
void sprite(float x, float y, float w, float h, int atlasRes, int index, glm::vec4 tint);
void sprite(float x, float y, float w, float h, const UVRegion& region,
const glm::vec4& tint);
void sprite(float x, float y, float w, float h, int atlasRes, int index,
const glm::vec4& tint);
void point(float x, float y, float r, float g, float b, float a);
inline void setColor(glm::vec4 color) {
inline void setColor(const glm::vec4& color) {
this->color = color;
}
inline glm::vec4 getColor() const {
@@ -69,7 +71,7 @@ public:
float ox, float oy,
float angle, UVRegion region,
bool flippedX, bool flippedY,
glm::vec4 tint
const glm::vec4& tint
);
void rect(float x, float y, float w, float h);