Project

General

Profile

Revision 331

split files

View differences:

proj/libs/classes/include/classes.h
1
#ifndef CLASSES_H_INCLUDED
2
#define CLASSES_H_INCLUDED
3

  
4
/**
5
 * @defgroup    classes classes
6
 * @brief Classes module
7
 *
8
 * Provides useful and general classes.
9
 */
10

  
11
#include "list.h"
12
#include "queue.h"
13

  
14
#endif //CLASSES_H_INCLUDED
0 15

  
proj/libs/classes/include/list.h
3 3

  
4 4
/**
5 5
 * @defgroup    list_t    list_t
6
 * @ingroup classes
6 7
 * @brief List module
7 8
 *
8 9
 * Can be used like a C++ std::list.
proj/libs/classes/include/queue.h
3 3

  
4 4
/**
5 5
 * @defgroup    queue_t queue_t
6
 * @ingroup classes
6 7
 * @brief Queue module
7 8
 *
8 9
 * Can be used like a C++ std::queue.
......
11 12
 * @{
12 13
 */
13 14

  
14

  
15 15
struct queue;
16 16
typedef struct queue queue_t;
17 17

  
proj/libs/graph/include/basic_sprite.h
1
#ifndef BASIC_SPRITE_H_INCLUDED
2
#define BASIC_SPRITE_H_INCLUDED
3

  
4
/**
5
 * @defgroup basic_sprite_t basic_sprite_t
6
 * @ingroup graph
7
 * @brief Basic sprite module.
8
 *
9
 * A basic sprite allows to represent an image file.
10
 *
11
 * @{
12
 */
13
struct basic_sprite;
14
typedef struct basic_sprite basic_sprite_t;
15

  
16
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
17
void            (basic_sprite_dtor)(basic_sprite_t *p);
18
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
19
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
20
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
21
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
22
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
23

  
24
/**
25
 * @}
26
 */
27

  
28
#endif //BASIC_SPRITE_H_INCLUDED
0 29

  
proj/libs/graph/include/graph.h
1 1
#ifndef GRAPH_H_INCLUDED
2 2
#define GRAPH_H_INCLUDED
3 3

  
4
/**
5
 * @defgroup    graph   graph
6
 * @brief Graph module.
7
 *
8
 * Provides functions, classes and methods for graphic drawing.
9
 *
10
 * @{
11
 */
12

  
4 13
// Graphics modes
5 14
#define INDEXED_1024_768        0x105
6 15
#define DIRECT_640_480_888      0x110
......
19 28
// Alpha
20 29
#define ALPHA_THRESHOLD     0x7F
21 30

  
22
/// MACROS
31
// MACROS
23 32
#define GET_ALP(n)          (0xFF & ((n) >> 24))
24 33
#define GET_RED(n)          (0xFF & ((n) >> 16))
25 34
#define GET_GRE(n)          (0xFF & ((n) >>  8))
......
31 40
#define SET_BLU(n)          (((n)&0xFF)      )
32 41
#define SET_RGB(r,g,b)      (SET_RED(r) | SET_GRE(g) | SET_BLU(b))
33 42

  
34
/// PUBLIC GET
43
// PUBLIC GET
35 44
uint16_t   (graph_get_XRes)         (void);
36 45
uint16_t   (graph_get_YRes)         (void);
37 46
uint16_t   (graph_get_bytes_pixel)  (void);
38 47

  
39
/// INIT
48
// INIT
40 49
int (graph_init)(uint16_t mode);
41 50

  
42
/// CLEANUP
51
// CLEANUP
43 52
int (graph_cleanup)(void);
44 53

  
45
/// PIXEL DRAWING
54
// PIXEL DRAWING
46 55
int (graph_set_pixel)             (uint16_t x, uint16_t y, uint32_t color);
47 56
void (graph_set_pixel_pos)         (unsigned pos          , uint32_t color);
48 57

  
49
/// SCREEN
58
// SCREEN
50 59
int (graph_clear_screen)(void);
51 60

  
52
/// DRAW
61
// DRAW
53 62
int (graph_draw)(void);
54 63

  
55
/// SPRITE ================================
56
struct basic_sprite;
57
typedef struct basic_sprite basic_sprite_t;
58

  
59
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
60
void            (basic_sprite_dtor)(basic_sprite_t *p);
61
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
62
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
63
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
64
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
65
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
66

  
67
struct sprite;
68
typedef struct sprite sprite_t;
69

  
70
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
71
/*
72
 * /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
73
 * constructor arguments, since it is assumed the same basic_sprite may be used to
74
 * draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
75
 * @param   p   Pointer to sprite_t to be destructed
64
/**
65
 * @}
76 66
 */
77
void      (sprite_dtor)(sprite_t *p);
78 67

  
79
void (sprite_set_pos)   (sprite_t *p, int16_t x, int16_t y);
80
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
81
void (sprite_set_angle) (sprite_t *p, double angle);
82
void (sprite_set_scale) (sprite_t *p, double scale);
83

  
84
int16_t  (sprite_get_x)(const sprite_t *p);
85
int16_t  (sprite_get_y)(const sprite_t *p);
86
double   (sprite_get_angle)(const sprite_t *p);
87
uint16_t (sprite_get_w)(const sprite_t *p);
88
uint16_t (sprite_get_h)(const sprite_t *p);
89

  
90
void (sprite_draw)(const sprite_t *p);
91

  
92 68
#endif /* end of include guard: GRAPH_H_INCLUDED */
proj/libs/graph/include/sprite.h
1
#ifndef SPRITE_H_INCLUDED
2
#define SPRITE_H_INCLUDED
3

  
4
/**
5
 * @defgroup sprite_t sprite_t
6
 * @ingroup graph
7
 * @brief Sprite module.
8
 *
9
 * A sprite allows to draw a basic_sprite_t, while also providing some transformations for that basic_sprite_t.
10
 *
11
 * @{
12
 */
13

  
14
struct sprite;
15
typedef struct sprite sprite_t;
16

  
17
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
18
/*
19
 * /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
20
 * constructor arguments, since it is assumed the same basic_sprite may be used to
21
 * draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
22
 * @param   p   Pointer to sprite_t to be destructed
23
 */
24
void      (sprite_dtor)(sprite_t *p);
25

  
26
void (sprite_set_pos)   (sprite_t *p, int16_t x, int16_t y);
27
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
28
void (sprite_set_angle) (sprite_t *p, double angle);
29
void (sprite_set_scale) (sprite_t *p, double scale);
30

  
31
int16_t  (sprite_get_x)(const sprite_t *p);
32
int16_t  (sprite_get_y)(const sprite_t *p);
33
double   (sprite_get_angle)(const sprite_t *p);
34
uint16_t (sprite_get_w)(const sprite_t *p);
35
uint16_t (sprite_get_h)(const sprite_t *p);
36

  
37
void (sprite_draw)(const sprite_t *p);
38

  
39
/**
40
 * @}
41
 */
42

  
43
#endif //SPRITE_H_INCLUDED
0 44

  

Also available in: Unified diff