From 372867de674b4694233318d3e909912090179f60 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 11 Mar 2024 15:13:26 +0300 Subject: [PATCH] Removed some useless files --- res/modules/document.lua | 0 src/graphics/Batch2D.cpp | 18 ------------------ src/graphics/Batch2D.h | 2 -- src/graphics/Sprite.cpp | 17 ----------------- src/graphics/Sprite.h | 29 ----------------------------- 5 files changed, 66 deletions(-) delete mode 100644 res/modules/document.lua delete mode 100644 src/graphics/Sprite.cpp delete mode 100644 src/graphics/Sprite.h diff --git a/res/modules/document.lua b/res/modules/document.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/src/graphics/Batch2D.cpp b/src/graphics/Batch2D.cpp index 76a8ad31..90d4ee64 100644 --- a/src/graphics/Batch2D.cpp +++ b/src/graphics/Batch2D.cpp @@ -1,7 +1,6 @@ #include "Batch2D.h" #include "Mesh.h" #include "Texture.h" -#include "Sprite.h" #include @@ -284,23 +283,6 @@ void Batch2D::rect( vertex(v1, glm::vec2(0, 0), r2,g2,b2,1.0f); } -void Batch2D::sprite(Sprite* sprite) { - glm::vec2 position = sprite->position; - glm::vec2 size = sprite->size; - glm::vec2 origin = sprite->origin; - texture(sprite->texture); - rect( - position.x, position.y, - size.x, size.y, - origin.x, origin.y, - sprite->angle, - sprite->region, - sprite->flippedX, - sprite->flippedY, - sprite->color - ); -} - void Batch2D::sprite(float x, float y, float w, float h, const UVRegion& region, glm::vec4 tint){ rect(x, y, w, h, region.u1, region.v1, region.u2-region.u1, region.v2-region.v1, tint.r, tint.g, tint.b, tint.a); } diff --git a/src/graphics/Batch2D.h b/src/graphics/Batch2D.h index 7f83e258..eefde67c 100644 --- a/src/graphics/Batch2D.h +++ b/src/graphics/Batch2D.h @@ -9,7 +9,6 @@ class Mesh; class Texture; -class Sprite; class Batch2D { float* buffer; @@ -40,7 +39,6 @@ public: void texture(Texture* texture); void untexture(); void sprite(float x, float y, float w, float h, const UVRegion& region, glm::vec4 tint); - void sprite(Sprite* sprite); void sprite(float x, float y, float w, float h, int atlasRes, int index, glm::vec4 tint); void point(float x, float y, float r, float g, float b, float a); diff --git a/src/graphics/Sprite.cpp b/src/graphics/Sprite.cpp deleted file mode 100644 index 3b0ca50f..00000000 --- a/src/graphics/Sprite.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Sprite.h" - -#include "Texture.h" - -Sprite::Sprite(glm::vec2 position, glm::vec2 size, Texture* texture) - : position(position), - size(size), - origin(0.5f, 0.5f), - color(1.0f, 1.0f, 1.0f, 1.0f), - angle(0.0f), - texture(texture), - region() { -} - -Sprite::~Sprite() { -} - diff --git a/src/graphics/Sprite.h b/src/graphics/Sprite.h deleted file mode 100644 index 5d10038e..00000000 --- a/src/graphics/Sprite.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef SRC_GRAPHICS_SPRITE_H_ -#define SRC_GRAPHICS_SPRITE_H_ - -#include -#include "UVRegion.h" - -class Texture; - -class Sprite { -public: - glm::vec2 position; - glm::vec2 size; - glm::vec2 origin; - glm::vec4 color; - float angle; - bool flippedX = false; - bool flippedY = false; - Texture* texture; - UVRegion region; - - Sprite(glm::vec2 position, glm::vec2 size, Texture* texture); - virtual ~Sprite(); - - void setTexture(Texture* texture) { - this->texture = texture; - } -}; - -#endif /* SRC_GRAPHICS_SPRITE_H_ */