aboutsummaryrefslogtreecommitdiff
path: root/src/games/tetris/Tetromino.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/games/tetris/Tetromino.cpp')
-rw-r--r--src/games/tetris/Tetromino.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/games/tetris/Tetromino.cpp b/src/games/tetris/Tetromino.cpp
index a77fa57..94343c0 100644
--- a/src/games/tetris/Tetromino.cpp
+++ b/src/games/tetris/Tetromino.cpp
@@ -1,6 +1,8 @@
#include <games/tetris/Tetromino.hpp>
+#include <renderer/Renderer.hpp>
+
#include <random>
-#include <stdlib.h>
+#include <cstdlib>
// layout of a left_aligned_bitmap: xxxx000000000000
// layout of a board_bitmap is 111xxxxxxxxxx111
@@ -119,7 +121,7 @@ bool Tetromino::MaybeMoveDown() {
return false;
}
-void Tetromino::Draw(RenderGroup &render_group) const {
+void Tetromino::Draw() const {
float world_width = 4.0f;
float world_height = 3.0f;
float tetromino_size_with_border = world_height / 20.0f;
@@ -132,7 +134,7 @@ void Tetromino::Draw(RenderGroup &render_group) const {
y0 * tetromino_size_with_border
};
- Tetromino::Draw(m_Id, m_Ori, world_pos, 1.0f, render_group);
+ Tetromino::Draw(m_Id, m_Ori, world_pos, 1.0f);
}
bool Tetromino::IsCollisionWithBoard(TetrominoId id, BoardPos pos, int32_t ori, uint16_t *board_bitmap) {
@@ -175,7 +177,7 @@ Color Tetromino::GetColor(TetrominoId id) {
return color;
}
-void Tetromino::Draw(TetrominoId id, int32_t ori, V2F32 pos, float scale, RenderGroup &render_group) {
+void Tetromino::Draw(TetrominoId id, int32_t ori, V2F32 pos, float scale) {
int32_t id_ = static_cast<int32_t>(id);
float world_height = 3.0f;
@@ -209,7 +211,7 @@ void Tetromino::Draw(TetrominoId id, int32_t ori, V2F32 pos, float scale, Render
Color color = GetColor(id);
- render_group.PushRectangle(world_rect, world_pos.z, color);
+ g_renderer.PushRectangle(world_rect, world_pos.z, color);
}
}
}