Copy3DEngine/include/C3D/game.h
2024-10-22 12:27:16 +02:00

66 lines
915 B
C

// Voir README.md pour license précise, par Fcalva 2023-2024 et est sous GPLv3
// See README.md for the exact licensing, by ...
#pragma once
#include "utils.h"
typedef struct {
V2d pos;
Rect coll;
int tex;
} Sprite;
typedef struct {
int w, h;
uint8_t *dat;
int spritec;
Sprite sprites[SINDEX_S/2];
} RcMap;
//Extension of Sprite, keep all first items common
typedef struct {
V2d pos;
Rect coll;
int tex;
V2d dir;
V2d plane;
} RcActor;
typedef struct {
uint8_t exit;
} RcFlags;
typedef struct {
RcActor player;
int logic_time;
RcMap *current_map;
RcFlags flags;
} RcGame;
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);