~ubuntu-branches/ubuntu/raring/powermanga/raring

« back to all changes in this revision

Viewing changes to src/sprites_string.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Gonéri Le Bouder, Cyril Brulebois, Barry deFreese
  • Date: 2008-03-19 21:32:41 UTC
  • mfrom: (1.2.4 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080319213241-sn6w3z75uppm22eq
Tags: 0.90-dfsg-1
[ Gonéri Le Bouder ]
* add desktop file, thanks Adrien Cunin (Closes: #402168)
 - powermanga.xpm moved in /usr/share/pixmaps
* call dh_desktop to run update-desktop-database

[ Cyril Brulebois ]
* Added XS-Vcs-Svn and XS-Vcs-Browser fields in the control file.

[ Barry deFreese ]
* Bump debhelper build-dep version to match compat
* Fix substvar source:Version
* Make distclean not ignore errors
* Add watch file
* Add Homepage field in control
* Remove XS- from VCS fields in control
* New Upstream Release (Closes: #447415)
  + Should now be dfsg free
  + Adds joystick support (Closes: #442322)
  + STILL NOT SURE ABOUT tlk.fnt
* Revert patches except fixing scoredir path and copyright for manpage
* Remove deprecated Encoding tag from desktop file
* Remove file extension from icon tag in desktop file
* Replace evil 'pwd' with $(CURDIR)
* Removing config.log config.status in clean target
* Convert copyright to UTF-8.
* Remove order/ dir from upstream tarball.
* Remove empty dirs from powermanga package.
* Bump Standards Version to 3.7.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** 
 
2
 * @file sprites_string.h 
 
3
 * @brief Handle the strings fonts of sprites 
 
4
 * @created 2006-12-19 
 
5
 * @date 2007-08-19
 
6
 * @author Bruno Ethvignot 
 
7
 */
 
8
/* 
 
9
 * copyright (c) 1998-2007 TLK Games all rights reserved
 
10
 * $Id: sprites_string.h,v 1.31 2007/08/19 19:21:15 gurumeditation Exp $
 
11
 *
 
12
 * Powermanga is free software; you can redistribute it and/or modify
 
13
 * it under the terms of the GNU General Public License as published by
 
14
 * the Free Software Foundation; either version 3 of the License, or
 
15
 * (at your option) any later version.
 
16
 *
 
17
 * Powermanga is distributed in the hope that it will be useful, but
 
18
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
20
 * GNU General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU General Public License
 
23
 * along with this program; if not, write to the Free Software
 
24
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
25
 * MA  02110-1301, USA.
 
26
 */
 
27
#ifndef __SPRITES_STRING_
 
28
#define __SPRITES_STRING__
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C"
 
32
{
 
33
#endif
 
34
 
 
35
#define FONTS_MAX_OF_IMAGES 16
 
36
#define MAX_ANGLE 127
 
37
 
 
38
  typedef enum
 
39
  {
 
40
    IJOY_LEFT = 1,
 
41
    IJOY_RIGHT,
 
42
    IJOY_TOP,
 
43
    IJOY_DOWN,
 
44
    IJOY_FIRE,
 
45
    IJOY_OPT
 
46
  }
 
47
  JOYCODE_ENUM;
 
48
 
 
49
  typedef enum
 
50
  {
 
51
    FONT_GAME,
 
52
    FONT_BIG,
 
53
    FONT_SCROLL,
 
54
    FONT_SCORE
 
55
  }
 
56
  FONTS_TYPEOF;
 
57
 
 
58
  typedef enum
 
59
  {
 
60
    FONT_DRAW_OFFSCREEN,
 
61
    FONT_DRAW_TOP_PANEL
 
62
  }
 
63
  FONTS_WITCH_OFFSCREEN;
 
64
 
 
65
  typedef struct sprite_char_struct
 
66
  {
 
67
    /** If TRUE char is displayed */
 
68
    bool is_display;
 
69
    Uint32 coord_x;
 
70
    Uint32 coord_y;
 
71
    Uint32 center_x;
 
72
    Uint32 center_y;
 
73
    /** If TRUE char is animated */
 
74
    bool is_anim;
 
75
    /** Number of sprite images of the animation */
 
76
    Uint32 num_of_images;
 
77
    Uint32 current_char;
 
78
    Uint32 current_image;
 
79
    /** Delay before next image: speed of the animation */
 
80
    Uint32 anim_speed;
 
81
    Uint32 anim_speed_inc;
 
82
    Uint32 anim_speed_count;
 
83
    /** Type of font used: FONT_GAME, FONT_BIG or FONT_SCROLL */
 
84
    Uint32 type_of_font;
 
85
    /* Width and height of a font in pixels */
 
86
    Uint32 font_size;
 
87
    /** Indicate in which screen the chars must be drawed */
 
88
    Uint32 which_offscreen;
 
89
    Uint32 xmax;
 
90
    Uint32 ymax;
 
91
    Uint32 xmin;
 
92
    Uint32 ymin;
 
93
    Sint32 radius_x;
 
94
    Sint32 radius_y;
 
95
    Sint32 angle;
 
96
    Sint32 angle_inc;
 
97
  }
 
98
  sprite_char_struct;
 
99
 
 
100
/**
 
101
 * Data structure for string of chars sprites
 
102
 */
 
103
  typedef struct sprite_string_struct
 
104
  {
 
105
    /** Current number of the chars */
 
106
    Uint32 num_of_chars;
 
107
    /** Maximum number of the chars */
 
108
    Uint32 max_of_chars;
 
109
    /** Indicate in which screen the chars must be drawed */
 
110
    Uint32 which_offscreen;
 
111
    /** X and y coordinates of the string */
 
112
    float coord_x;
 
113
    float coord_y;
 
114
    float offset_x;
 
115
    float offset_y;
 
116
    bool is_move;
 
117
    /** At least a character was animated */
 
118
    bool at_least_one_char_changed;
 
119
    /** No character was animated */
 
120
    bool none_char_animated;
 
121
    /** Space in pixel between 2 chars */
 
122
    Uint32 space;
 
123
    /** Delay before process next char */
 
124
    Sint32 delay_next_char;
 
125
    Sint32 delay_next_char_count;
 
126
    Sint32 delay_add_to_last;
 
127
    /** Index of the next char to be animated */
 
128
    Uint32 current_char;
 
129
    Uint32 center_x;
 
130
    Uint32 center_y;
 
131
    Sint32 angle;
 
132
    Sint32 angle_increment;
 
133
    Sint32 radius_x;
 
134
    Sint32 radius_y;
 
135
    /** ASCII string */
 
136
    char *string;
 
137
    /** True if the string was allocated */
 
138
    bool is_string_allocated;
 
139
    sprite_char_struct *sprites_chars;
 
140
    Sint32 cursor_pos;
 
141
    Uint32 cursor_status;
 
142
  } sprite_string_struct;
 
143
 
 
144
  bool sprites_string_once_init (void);
 
145
  void sprites_string_free (void);
 
146
  sprite_string_struct *sprites_string_new (const char *const string,
 
147
                                            Uint32 more_chars, Uint32 type,
 
148
                                            float coordx, float coordy);
 
149
  sprite_string_struct *sprites_string_create (char *string, Uint32 size,
 
150
                                               Uint32 type, float coordx,
 
151
                                               float coordy);
 
152
  void sprites_string_delete (sprite_string_struct * sprite_str);
 
153
  void sprite_char_initialize (sprite_char_struct * sprite_char, char code,
 
154
                               Sint32 xcoord, Sint32 ycoord, Uint32 type);
 
155
  void sprite_set_char (sprite_char_struct * sprite_char, char code);
 
156
  void sprite_char_init_rotate (sprite_char_struct * sprite_char,
 
157
                                Uint32 angle, Sint32 angle_inc,
 
158
                                Uint32 radius_x, Uint32 radius_y);
 
159
  bool sprite_char_anim (sprite_char_struct * sprite_char, bool restart);
 
160
  bool sprite_char_rotate (sprite_char_struct * sprite_char, Sint32 decx,
 
161
                           Sint32 decy, Sint32 min);
 
162
  bool sprite_char_rotate_enlarge (sprite_char_struct * sprite_char,
 
163
                                   Sint32 incx, Sint32 incy, Sint32 max_x,
 
164
                                   Sint32 max_y);
 
165
 
 
166
  bool sprite_string_set_char (sprite_string_struct * sprite_str, char *str);
 
167
  void sprite_chars_to_image (sprite_string_struct * sprite_str);
 
168
 
 
169
  void sprite_string_init_rotation (sprite_string_struct * sprite_str,
 
170
                                    Uint32 angle, Uint32 angle_increment,
 
171
                                    Uint32 radius_x, Uint32 radius_y);
 
172
  void sprite_string_set_center (sprite_string_struct * sprite_str,
 
173
                                 Sint32 centerx, Sint32 centery);
 
174
  void sprite_string_centerx (sprite_string_struct * sprite_str, float coordy,
 
175
                              Uint32 offsetx);
 
176
  void sprite_string_center (sprite_string_struct * sprite_str);
 
177
  bool sprites_string_rotation_dec (sprite_string_struct * sprite_str,
 
178
                                    Uint32 dec_x, Uint32 dec_y,
 
179
                                    Sint32 min_pos);
 
180
  bool sprites_string_rotation_inc (sprite_string_struct * sprite_str,
 
181
                                    Uint32 inc_x, Uint32 inc_y,
 
182
                                    Sint32 xmax_pos, Sint32 ymax_pos);
 
183
  void sprite_string_coords (sprite_string_struct * sprite_str);
 
184
  void sprite_string_init_anim (sprite_string_struct * sprite_str,
 
185
                                Uint32 anim_speed_inc, Uint32 anim_speed,
 
186
                                bool is_anim, Uint32 anim_speed_count);
 
187
  void sprite_string_restart_anim (sprite_string_struct * sprite_str);
 
188
  void sprite_string_set_anim (sprite_string_struct * sprite_str);
 
189
  Sint32 sprite_string_anim (sprite_string_struct * sprite_str, bool restart);
 
190
  bool sprite_string_anim_one (sprite_string_struct * sprite_str);
 
191
  void sprite_string_draw (sprite_string_struct * sprite_str);
 
192
 
 
193
  Sint32 sprites_string_input (sprite_string_struct * sprite_str);
 
194
  void sprites_string_input_code (sprite_string_struct * sprite_str,
 
195
                                  Sint32 keycode);
 
196
  void sprites_string_set_joy (Uint32 code);
 
197
  void sprites_string_clr_joy (Uint32 code);
 
198
  void sprites_string_key_down (Uint32 code, Uint32 sym);
 
199
  void sprites_string_key_up (Uint32 code, Uint32 sym);
 
200
  void sprites_string_set_cursor_pos (sprite_string_struct * sprite_str,
 
201
                                      Sint32 cursor_pos);
 
202
 
 
203
#ifdef __cplusplus
 
204
}
 
205
#endif
 
206
 
 
207
#endif