123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- #ifndef ERUTA_H
- #define ERUTA_H
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- #include <stdarg.h>
- #include <allegro5/allegro.h>
- #include <allegro5/allegro_font.h>
- #include <allegro5/allegro_ttf.h>
- #include <allegro5/allegro_image.h>
- #include <allegro5/allegro_primitives.h>
- #include <allegro5/allegro_audio.h>
- #include <allegro5/allegro_acodec.h>
- #include "bevec.h"
- #define SCREEN_W 640
- #define SCREEN_H 480
- #define BIT_ISFLAG(NUM, FLAG) ((NUM) & (FLAG))
- #define BIT_ISBIT(NUM, BIT) BIT_ISFLAG(NUM, (1 << BIT))
- #define BIT_SETFLAG(NUM, FLAG) ((NUM) | (FLAG))
- #define BIT_UNFLAG(NUM, FLAG) ((NUM) & (~(FLAG)))
- #define BIT_SETBIT(NUM, BIT) BIT_SETFLAG(NUM, (1 << BIT))
- #define BIT_UNBIT(NUM, BIT) BIT_UNFLAG(NUM, (1 << BIT))
- #define CLAMP_MAX(SET, VALUE, MAX) do { \
- int value___ = (VALUE), max___ = (MAX); \
- (SET) = ((value___ > max___ ) ? (max___) : (value___)); \
- } while(0)
- #ifndef TRUE
- #define TRUE (!0)
- #endif
- #ifndef FALSE
- #define FALSE (0)
- #endif
- #ifndef BOOL
- #define BOOL int
- #endif
- #ifndef STR
- #define STR ALLEGRO_USTR
- #endif
- typedef BeVec Point;
- typedef ALLEGRO_PATH Path;
- typedef ALLEGRO_EVENT Event;
- #define point(X, Y) bevec(X, Y);
- const char * fifi_path_cstr(Path * path);
- int fifi_path_exists(Path * path);
- #define PATH_CSTR(PATH) (fifi_path_cstr(PATH))
- #define PATH_EXISTS(PATH) (fifi_path_exists(PATH))
- #define VA_MAP_START(TYPE, LAST) \
- va_list args___; \
- TYPE result___; \
- va_start(args___, LAST)
- #define VA_MAP_ARGS args___
- #define VA_MAP_RESULT(VALUE) do { \
- result___ = (VALUE); \
- } while (0)
-
- #define VA_MAP_END() \
- va_end(args___); \
- return result___
- struct Program_;
- typedef struct Program_ Program;
- enum ProgramMode_ {
-
- ProgramModeQuit = -2,
- ProgramModeNone = -1,
- ProgramModeIntro = 0,
- ProgramModeStart = 1,
- ProgramModePlay = 2,
- ProgramModeMenu = 3,
- ProgramModeEdit = 4,
- ProgramModeRes1 = 5,
- ProgramModeRes2 = 6,
- ProgramModeRes3 = 7,
- ProgramModeLast = 8,
- };
- typedef enum ProgramMode_ ProgramMode;
- enum Eres_ {
- ERES_OK = 0,
- ERES_NULL = -1,
- ERES_NOMEM = -2,
- ERES_NOFILE = -3,
- };
- typedef int ERES;
- #endif
|