Really useful software project management and source code hosting.    tell me more...
BROWSE: projects / users / groups
Public clone: git://codaset.com/crocidb/animallegro.git
star_disabled Dashboard Source Tickets Wiki Blog Network


Really Useful Social coding!

Codaset is an open system, so you can browse and search through all the open source projects, and check out what your friends are coding. Follow them, befriend them, and fork their code; quickly and easily.
Every single open source project you create is free, so come on and use Codaset at no cost. Your first private or semi-private project is also free. Read more about what it costs after that.
100644 884 b text/plain native file history
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *
 * AnimSprite - By CrociDB
 * http://crocidb.wordpress.com/
 *
 * Obrigado por usar ^^
 *
 */

#include <allegro.h>

#include <iostream>
#include <vector>

#include <State.h>

class AnimSprite
{
private:
    std::vector<BITMAP*> frames;
    int frame_atual;
    int delay;

    int time;

    std::vector<State*> states;
    int curr_state;

    int x, y;
public:
    AnimSprite();

    void run(BITMAP* bmp);

    void SetDelay(int sdelay);
    int GetDelay() const;

    void SetX(int sx);
    void SetY(int sy);
    void SetPosition(int sx, int sy);

    int GetX() const;
    int GetY() const;

    void AddFrame(const char* file);
    void AddFrame(BITMAP* bmp);

    int GetNumFrames() const;

    void AddState(State* st);
    void FitStates();

    void SetCurrentState(int st);
    int GetCurrentState() const;
};