Copy3DEngine/include/C3D/game.h

49 lines
715 B
C
Raw Permalink Normal View History

2024-10-05 00:56:13 +02:00
// Voir README.md pour license précise, par Fcalva 2023-2024 et est sous GPLv3
2024-10-09 16:43:10 +02:00
// See README.md for the exact licensing, by ...
2024-10-05 00:56:13 +02:00
#ifndef game__h
#define game__h
#include "utils.h"
#include "map.h"
typedef struct {
V2d pos;
V2d dir;
V2d plane;
} RcActor;
2024-10-09 16:43:10 +02:00
typedef struct {
uint8_t exit;
} RcFlags;
2024-10-05 00:56:13 +02:00
typedef struct {
RcActor player;
2024-10-09 16:43:10 +02:00
int logic_time;
2024-10-05 00:56:13 +02:00
uint8_t *current_map;
2024-10-09 16:43:10 +02:00
RcFlags flags;
2024-10-05 00:56:13 +02:00
} RcGame;
2024-10-09 16:43:10 +02:00
typedef int (RcLogicFunc)(RcGame *);
//Returns non-zero on failure (likely max hook count was reached)
int add_logic_hook(RcLogicFunc *func);
//Retruns non-zero on failure
int remove_logic_hook(RcLogicFunc *func);
void clear_logic_hooks();
void do_logic(RcGame *game, int delta);
2024-10-05 00:56:13 +02:00
#endif