Subversion Repositories Games.Rick Dangerous

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * src/ents.h
  3.  *
  4.  * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). All rights reserved.
  5.  *
  6.  * The use and distribution terms for this software are contained in the file
  7.  * named README, which can be found in the root of this distribution. By
  8.  * using this software in any fashion, you are agreeing to be bound by the
  9.  * terms of this license.
  10.  *
  11.  * You must not remove this notice, or any other, from this software.
  12.  */
  13.  
  14. #ifndef _ENTS_H
  15. #define _ENTS_H
  16.  
  17. #include "system.h"
  18. #include "rects.h"
  19.  
  20. #define ENT_RICK ent_ents[1]
  21.  
  22. #define ENT_NBR_ENTDATA 0x4a
  23. #define ENT_NBR_SPRSEQ 0x88
  24. #define ENT_NBR_MVSTEP 0x310
  25.  
  26. #define ENT_ENTSNUM 0x0c
  27.  
  28. /*
  29.  * flags for ent_ents[e].n   ("yes" when set)
  30.  *
  31.  * ENT_LETHAL: is entity lethal?
  32.  */
  33. #define ENT_LETHAL 0x80
  34.  
  35. /*
  36.  * flags for ent_ents[e].flag   ("yes" when set)
  37.  *
  38.  * ENT_FLG_ONCE: should the entity run once only?
  39.  * ENT_FLG_STOPRICK: does the entity stops rick (and goes to slot zero)?
  40.  * ENT_FLG_LETHALR: is entity lethal when restarting?
  41.  * ENT_FLG_LETHALI: is entity initially lethal?
  42.  * ENT_FLG_TRIGBOMB: can entity be triggered by a bomb?
  43.  * ENT_FLG_TRIGBULLET: can entity be triggered by a bullet?
  44.  * ENT_FLG_TRIGSTOP: can entity be triggered by rick stop?
  45.  * ENT_FLG_TRIGRICK: can entity be triggered by rick?
  46.  */
  47. #define ENT_FLG_ONCE 0x01
  48. #define ENT_FLG_STOPRICK 0x02
  49. #define ENT_FLG_LETHALR 0x04
  50. #define ENT_FLG_LETHALI 0x08
  51. #define ENT_FLG_TRIGBOMB 0x10
  52. #define ENT_FLG_TRIGBULLET 0x20
  53. #define ENT_FLG_TRIGSTOP 0x40
  54. #define ENT_FLG_TRIGRICK 0x80
  55.  
  56. typedef struct
  57. {
  58.    U8 n;               /* b00 */
  59.    /*U8 b01;*/      /* b01 in ASM code but never used */
  60.    S16 x;             /* b02 - position */
  61.    S16 y;             /* w04 - position */
  62.    U8 sprite;       /* b08 - sprite number */
  63.    /*U16 w0C;*/    /* w0C in ASM code but never used */
  64.    U8 w;               /* b0E - width */
  65.    U8 h;               /* b10 - height */
  66.    U16 mark;         /* w12 - number of the mark that created the entity */
  67.    U8 flags;         /* b14 */
  68.    S16 trig_x;      /* b16 - position of trigger box */
  69.    S16 trig_y;      /* w18 - position of trigger box */
  70.    S16 xsave;       /* b1C */
  71.    S16 ysave;       /* w1E */
  72.    U16 sprbase;    /* w20 */
  73.    U16 step_no_i; /* w22 */
  74.    U16 step_no;    /* w24 */
  75.    S16 c1;            /* b26 */
  76.    S16 c2;            /* b28 */
  77.    U8 ylow;          /* b2A */
  78.    S16 offsy;       /* w2C */
  79.    U8 latency;      /* b2E */
  80.    U8 prev_n;       /* new */
  81.    S16 prev_x;      /* new */
  82.    S16 prev_y;      /* new */
  83.    U8 prev_s;       /* new */
  84.    U8 front;         /* new */
  85.    U8 trigsnd;      /* new */
  86. } ent_t;
  87.  
  88. typedef struct
  89. {
  90.    U8 w, h;
  91.    U16 spr, sni;
  92.    U8 trig_w, trig_h;
  93.    U8 snd;
  94. } entdata_t;
  95.  
  96. typedef struct
  97. {
  98.    U8 count;
  99.    S8 dx, dy;
  100. } mvstep_t;
  101.  
  102. extern ent_t ent_ents[ENT_ENTSNUM + 1];
  103. extern entdata_t ent_entdata[ENT_NBR_ENTDATA];
  104. extern rect_t *ent_rects;
  105. extern U8 ent_sprseq[ENT_NBR_SPRSEQ];
  106. extern mvstep_t ent_mvstep[ENT_NBR_MVSTEP];
  107.  
  108. extern void ent_reset (void);
  109. extern void ent_actvis (U8, U8);
  110. extern void ent_draw (void);
  111. extern void ent_clprev (void);
  112. extern void ent_action (void);
  113.  
  114. #endif
  115.