Skip to content

Commit

Permalink
Small cleanup in graphics code
Browse files Browse the repository at this point in the history
Remove commented out raylib calls and other small adjustments.
  • Loading branch information
meisekimiu committed Jun 7, 2024
1 parent cf20c0c commit ad73350
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/graphics/RenderState.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "RenderState.h"

namespace Adagio {
bool RenderState::operator<(const RenderState &other) {
bool RenderState::operator<(const RenderState &other) const {
return zIndex < other.zIndex;
}
}
2 changes: 1 addition & 1 deletion src/graphics/RenderState.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Adagio {

virtual void draw(GraphicsDevice *graphicsDevice) const = 0;

bool operator<(const RenderState &other);
bool operator<(const RenderState &other) const;

virtual ~RenderState() = default;
};
Expand Down
3 changes: 0 additions & 3 deletions src/graphics/SpriteBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ namespace Adagio {

void SpriteBatch::begin() {
graphicsDevice->begin();
// BeginDrawing();
renderingQueue.clear();
// ClearBackground(clearColor);
spritePool.begin();
textPool.begin();
}
Expand All @@ -24,7 +22,6 @@ namespace Adagio {
r->draw(graphicsDevice);
r->active = false;
}
// EndDrawing();
graphicsDevice->end();
}

Expand Down
1 change: 0 additions & 1 deletion src/graphics/SpriteState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace Adagio {
if (active && texture) {
graphicsDevice->drawTexture(*texture, source, destination, origin, rotation,
{tint.r, tint.g, tint.b, alpha});
// DrawTexturePro(*texture, source, destination, origin, rotation, {tint.r, tint.g, tint.b, alpha});
}
}

Expand Down
10 changes: 0 additions & 10 deletions src/graphics/TextState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
namespace Adagio {
void TextState::draw(GraphicsDevice *graphicsDevice) const {
graphicsDevice->drawText(*font, text, position, fontSize, spacing, tint);
// if (text) {
// if (font) {
// DrawTextEx(*font, text, position, fontSize, spacing, tint);
// return;
// }
// int x, y;
// x = static_cast<int>(position.x);
// y = static_cast<int>(position.y);
// DrawText(text, x, y, static_cast<int>(fontSize), tint);
// }
}

TextState::~TextState() = default;
Expand Down

0 comments on commit ad73350

Please sign in to comment.