mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
remove the lookup table / binary-encoded logic.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include "../../io/colour/colour8.h"
|
||||
#include "../../util/types.h"
|
||||
@@ -25,14 +24,5 @@ enum {
|
||||
#define SHAPE_HEIGHT 4
|
||||
#define TETROMINO_COUNT 7
|
||||
|
||||
static inline u8 shape_get_row(u16 shape, u8 index) __attribute_deprecated_msg__("switching to a logic-based tetromino storage") {
|
||||
return shape >> (((SHAPE_HEIGHT - 1) - index) * SHAPE_WIDTH) & 0xF;
|
||||
}
|
||||
|
||||
static inline bool shape_is_set(u8 row, u8 index) __attribute_deprecated_msg__("switching to a logic-based tetromino storage") {
|
||||
return (row >> ((SHAPE_WIDTH - 1) - index) & 1) != 0;
|
||||
}
|
||||
|
||||
void shape_getblocks(u8 id, i8vec2* out);
|
||||
u16 shape_from_id(u8 id) __attribute_deprecated_msg__("switching to a logic-based tetromino storage");
|
||||
colour8 colour_from_id(u8 id);
|
||||
|
||||
Reference in New Issue
Block a user