|
PatchworkOS
621ae6b
A non-POSIX operating system.
|
#include <errno.h>#include <libpatchwork/patchwork.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/proc.h>Go to the source code of this file.
Typedefs | |
| typedef block_t | piece_t[PIECE_HEIGHT][PIECE_WIDTH] |
Enumerations | |
| enum | block_t { BLOCK_INVAL , BLOCK_NONE , BLOCK_CYAN , BLOCK_BLUE , BLOCK_ORANGE , BLOCK_YELLOW , BLOCK_GREEN , BLOCK_PURPLE , BLOCK_RED , BLOCK_CLEARING , BLOCK_OUTLINE } |
| enum | piece_type_t { PIECE_NONE , PIECE_CYAN , PIECE_BLUE , PIECE_ORANGE , PIECE_YELLOW , PIECE_GREEN , PIECE_PURPLE , PIECE_RED } |
| #define FIELD_LEFT (FIELD_PADDING) |
| #define FIELD_TOP (FIELD_PADDING) |
| #define FIELD_RIGHT (FIELD_PADDING + BLOCK_SIZE * FIELD_WIDTH) |
| #define FIELD_BOTTOM (FIELD_PADDING + BLOCK_SIZE * FIELD_HEIGHT) |
| #define SIDE_PANEL_LEFT (FIELD_RIGHT + FIELD_PADDING) |
| #define SIDE_PANEL_RIGHT (SIDE_PANEL_LEFT + SIDE_PANEL_WIDTH - FIELD_PADDING) |
| #define SIDE_PANEL_BOTTOM (FIELD_BOTTOM) |
| #define WINDOW_WIDTH ((FIELD_WIDTH) * BLOCK_SIZE + FIELD_PADDING * 2 + SIDE_PANEL_WIDTH) |
| #define WINDOW_HEIGHT ((FIELD_HEIGHT) * BLOCK_SIZE + FIELD_PADDING * 2) |
| #define TICK_SPEED (CLOCKS_PER_SEC) |
| #define DROPPING_TICK_SPEED (CLOCKS_PER_SEC / 12) |
| #define CLEARING_LINES_TICK_SPEED (CLOCKS_PER_SEC / 15) |
| #define START_SCREEN_TICK_SPEED ((CLOCKS_PER_SEC / 4) * 3) |
| typedef block_t piece_t[PIECE_HEIGHT][PIECE_WIDTH] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct { ... } currentPiece |