add more NotePreset properties
This commit is contained in:
@@ -125,7 +125,7 @@ void Batch3D::sprite(
|
||||
float h,
|
||||
int atlasRes,
|
||||
int index,
|
||||
glm::vec4 tint
|
||||
const glm::vec4& tint
|
||||
) {
|
||||
float scale = 1.0f / static_cast<float>(atlasRes);
|
||||
float u = (index % atlasRes) * scale;
|
||||
@@ -288,3 +288,11 @@ void Batch3D::flushPoints() {
|
||||
mesh->draw(GL_POINTS);
|
||||
index = 0;
|
||||
}
|
||||
|
||||
void Batch3D::setColor(const glm::vec4& color) {
|
||||
tint = color;
|
||||
}
|
||||
|
||||
const glm::vec4& Batch3D::getColor() const {
|
||||
return tint;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class Batch3D : public Flushable {
|
||||
std::unique_ptr<Mesh> mesh;
|
||||
std::unique_ptr<Texture> blank;
|
||||
size_t index;
|
||||
glm::vec4 tint {1.0f};
|
||||
|
||||
const Texture* currentTexture;
|
||||
|
||||
@@ -65,7 +66,7 @@ public:
|
||||
float h,
|
||||
int atlasRes,
|
||||
int index,
|
||||
glm::vec4 tint
|
||||
const glm::vec4& tint
|
||||
);
|
||||
void xSprite(
|
||||
float w,
|
||||
@@ -91,4 +92,7 @@ public:
|
||||
void point(const glm::vec3& pos, const glm::vec4& tint);
|
||||
void flush() override;
|
||||
void flushPoints();
|
||||
|
||||
void setColor(const glm::vec4& color);
|
||||
const glm::vec4& getColor() const;
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ static inline void draw_glyph(
|
||||
0.5f,
|
||||
16,
|
||||
c,
|
||||
glm::vec4(1.0f)
|
||||
batch.getColor()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user