~ubuntu-branches/debian/stretch/assaultcube-data/stretch

« back to all changes in this revision

Viewing changes to source/src/model.h

  • Committer: Bazaar Package Importer
  • Author(s): Gonéri Le Bouder, Ansgar Burchardt, Gonéri Le Bouder
  • Date: 2010-04-02 23:37:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100402233755-kf74fxwlu634o6vg
Tags: 1.0.4+repack1-1
[ Ansgar Burchardt ]
* debian/control: fix typo in short description

[ Gonéri Le Bouder ]
* Upgrade to 1.0.4
* bump standards-version to 3.8.4
* Add Depends: ${misc:Depends} just to avoid a lintian warning
* Add a debian/source/format file for the same reason

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
enum { ANIM_IDLE = 0, ANIM_RUN, ANIM_ATTACK, ANIM_PAIN, ANIM_JUMP, ANIM_LAND, ANIM_FLIPOFF, ANIM_SALUTE, ANIM_TAUNT, ANIM_WAVE, ANIM_POINT, ANIM_CROUCH_IDLE, ANIM_CROUCH_WALK, ANIM_CROUCH_ATTACK, ANIM_CROUCH_PAIN, ANIM_CROUCH_DEATH, ANIM_DEATH, ANIM_LYING_DEAD, ANIM_FLAG, ANIM_GUN_IDLE, ANIM_GUN_SHOOT, ANIM_GUN_RELOAD, ANIM_GUN_THROW, ANIM_MAPMODEL, ANIM_TRIGGER, ANIM_DECAY, ANIM_ALL, NUMANIMS };
 
2
 
 
3
#define ANIM_INDEX       0xFF
 
4
#define ANIM_LOOP        (1<<8)
 
5
#define ANIM_START       (1<<9)
 
6
#define ANIM_END         (1<<10)
 
7
#define ANIM_REVERSE     (1<<11)
 
8
#define ANIM_NOINTERP    (1<<12)
 
9
#define ANIM_MIRROR      (1<<13)
 
10
#define ANIM_NOSKIN      (1<<14)
 
11
#define ANIM_TRANSLUCENT (1<<15)
 
12
#define ANIM_PARTICLE    (1<<16)
 
13
#define ANIM_DYNALLOC    (1<<17)
 
14
 
 
15
struct animstate                                // used for animation blending of animated characters
 
16
{
 
17
    int anim, frame, range, basetime;
 
18
    float speed;
 
19
    animstate() { reset(); }
 
20
    void reset() { anim = frame = range = basetime = 0; speed = 100.0f; };
 
21
 
 
22
    bool operator==(const animstate &o) const { return frame==o.frame && range==o.range && basetime==o.basetime && speed==o.speed; }
 
23
    bool operator!=(const animstate &o) const { return frame!=o.frame || range!=o.range || basetime!=o.basetime || speed!=o.speed; }
 
24
};
 
25
 
 
26
enum { MDL_MD2 = 1, MDL_MD3 };
 
27
 
 
28
struct model;
 
29
struct modelattach
 
30
{
 
31
    const char *tag, *name;
 
32
    vec *pos;
 
33
    model *m;
 
34
 
 
35
    modelattach() : tag(NULL), name(NULL), pos(NULL), m(NULL) {}
 
36
    modelattach(const char *tag, const char *name) : tag(tag), name(name), pos(NULL), m(NULL) {}
 
37
    modelattach(const char *tag, vec *pos) : tag(tag), name(NULL), pos(pos), m(NULL) {}
 
38
};
 
39
 
 
40
struct dynent;
 
41
 
 
42
struct model
 
43
{
 
44
    bool cullface, vertexlight;
 
45
    float alphatest, translucency, scale, radius, shadowdist;
 
46
    vec translate;
 
47
    int cachelimit, batch;
 
48
 
 
49
    model() : cullface(true), vertexlight(false), alphatest(0.9f), translucency(0.25f), scale(1), radius(0), shadowdist(0), translate(0, 0, 0), cachelimit(8), batch(-1) {}
 
50
    virtual ~model() {}
 
51
 
 
52
    virtual bool load() = 0;
 
53
    virtual char *name() = 0;
 
54
    virtual int type() = 0;
 
55
 
 
56
    virtual void cleanup() = 0;
 
57
 
 
58
    virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0;
 
59
    virtual void setskin(int tex = 0) = 0;
 
60
 
 
61
    virtual void genshadows(float height, float rad) {}
 
62
    virtual void rendershadow(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, modelattach *a = NULL) {}
 
63
    virtual bool hasshadows() { return false; }
 
64
 
 
65
    virtual void startrender() {}
 
66
    virtual void endrender() {}
 
67
};
 
68
 
 
69
struct mapmodelinfo { int rad, h, zoff; string name; model *m; };
 
70