37 lines
746 B
C
37 lines
746 B
C
#ifndef _WORLD_H_
|
||
#define _WORLD_H_
|
||
|
||
struct event {
|
||
int type;
|
||
int key;
|
||
int height;
|
||
int width;
|
||
int time_ms;
|
||
int mouse_x;
|
||
int mouse_y;
|
||
int mouse_left;
|
||
int mouse_right;
|
||
int mouse_middle;
|
||
int alt_key;
|
||
};
|
||
|
||
#define EVENT_KEY 1
|
||
#define EVENT_MOUSE 2
|
||
#define EVENT_RESIZE 3
|
||
#define EVENT_ESC 4
|
||
#define EVENT_TIMEOUT 5
|
||
#define EVENT_START 6
|
||
|
||
#define COLOR_COUNT 8
|
||
|
||
void clear_screen();
|
||
void set_cell(int c, int x, int y);
|
||
void set_message(const char* msg, int x, int y);
|
||
void set_color_cell(int c, int x, int y, short f, short b);
|
||
void game_speed(int v);
|
||
void abort_game(const char* m);
|
||
int world_run(void* (*init_game)(), int (*world_event)(struct event*, void*)); // ← ВОТ ЭТА СТРОЧКА
|
||
|
||
#endif
|
||
|