- Afegits comentaris

This commit is contained in:
2024-04-29 13:59:28 +02:00
parent ef2a89b620
commit 500975c4e0

View File

@@ -5,17 +5,19 @@
#include <string> #include <string>
// Flags que defineixen les capacitats de l'actor
#define FLAG_NONE 0 #define FLAG_NONE 0
#define FLAG_HERO 1 #define FLAG_HERO 1 // Es el heroi
#define FLAG_PUSHABLE 2 #define FLAG_PUSHABLE 2 // Es pot espentar
#define FLAG_REACTIVE 4 #define FLAG_REACTIVE 4 // Quan se li espenta, torna una espenta específica
#define FLAG_MOVING 8 #define FLAG_MOVING 8 // Es mou
#define FLAG_ANIMATED 16 #define FLAG_ANIMATED 16 // Te animació de frames
#define FLAG_ORIENTABLE 32 #define FLAG_ORIENTABLE 32 // S'orienta cap on va
#define FLAG_DEADLY 64 #define FLAG_DEADLY 64 // Fa pupa
#define FLAG_GRAVITY 128 #define FLAG_GRAVITY 128 // Li afecta la gravetat
#define FLAG_NOEDITOR 256 #define FLAG_NOEDITOR 256 // No es seleccionable a l'editor (son les portes)
// Direcció de espenta
#define PUSH_NONE 0 #define PUSH_NONE 0
#define PUSH_XP 1 #define PUSH_XP 1
#define PUSH_XN 2 #define PUSH_XN 2
@@ -24,54 +26,59 @@
#define PUSH_ZP 16 #define PUSH_ZP 16
#define PUSH_ZN 32 #define PUSH_ZN 32
#define MOV_NONE 0 // Tipus de moviment de l'actor
#define MOV_X 1 #define MOV_NONE 0 // Ningun
#define MOV_Y 2 #define MOV_X 1 // Es mou només en l'eix X i quan topeta en algo, torna per on venia
#define MOV_Z 3 #define MOV_Y 2 // Es mou només en l'eix Y i quan topeta en algo, torna per on venia
#define MOV_CW 4 #define MOV_Z 3 // Es mou només en l'eix Z i quan topeta en algo, torna per on venia
#define MOV_CCW 5 #define MOV_CW 4 // Es mou en sentit de les agulles del rellotge
#define MOV_RAND 6 #define MOV_CCW 5 // Es mou en sentit contrari a les agulles del rellotge
#define MOV_HUNT 7 #define MOV_RAND 6 // Es mou en direcció aleatòria
#define MOV_HUNT 7 // Persegueix al heroi
namespace actor namespace actor
{ {
struct actor_t struct actor_t
{ {
char name[16]; char name[16];
draw::surface *surface; draw::surface *surface;
char bmp[16]; char bmp[16];
SDL_Rect bmp_rect; SDL_Rect bmp_rect;
SDL_Point bmp_offset; SDL_Point bmp_offset;
vec3_t pos; vec3_t pos;
vec3_t size; vec3_t size;
uint8_t orient; uint8_t orient;
uint8_t anim_cycle; uint8_t anim_cycle;
uint8_t anim_frame; uint8_t anim_frame;
int anim_wait; int anim_wait;
uint8_t anim_wait_count; uint8_t anim_wait_count;
uint16_t flags; uint16_t flags;
uint8_t push; uint8_t push;
uint8_t react_mask; uint8_t react_mask;
uint8_t react_push; uint8_t react_push;
uint8_t movement; uint8_t movement;
uint8_t mov_push; uint8_t mov_push;
actor_t *below; actor_t *below;
actor_t *above; actor_t *above;
actor_t *prev; actor_t *prev;
actor_t *next; actor_t *next;
}; };
// Torna el primer actor de la llista
actor_t *getFirst(); actor_t *getFirst();
// Torna el actor seleccionat a l'editor
actor_t *getSelected(); actor_t *getSelected();
// Torna un nou actor
actor_t *create(std::string name, vec3_t p, vec3_t s, std::string bmp, SDL_Rect r, SDL_Point o); actor_t *create(std::string name, vec3_t p, vec3_t s, std::string bmp, SDL_Rect r, SDL_Point o);
void setDirty(actor_t *act, const bool force=false); void setDirty(actor_t *act, const bool force=false);