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

« back to all changes in this revision

Viewing changes to src/tools.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 tools.h
 
3
 * @brief handle memory allocation and file access
 
4
 * @created 1999-08-17
 
5
 * @date 2007-08-31
 
6
 */
 
7
/*
 
8
 * copyright (c) 1998-2007 TLK Games all rights reserved
 
9
 * $Id: tools.h,v 1.17 2007/08/31 20:46:43 gurumeditation Exp $
 
10
 *
 
11
 * Powermanga is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 3 of the License, or
 
14
 * (at your option) any later version.
 
15
 *
 
16
 * Powermanga is distributed in the hope that it will be useful, but
 
17
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
19
 * GNU General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
24
 * MA  02110-1301, USA.
 
25
 */
 
26
#ifndef __TOOLS__
 
27
#define __TOOLS__
 
28
 
 
29
#ifdef __cplusplus
 
30
extern "C"
 
31
{
 
32
#endif
 
33
 
 
34
#ifdef WIN32
 
35
#include <stdio.h>
 
36
#include <stdlib.h>
 
37
#include <string.h>
 
38
#include <fcntl.h>
 
39
#include <sys/stat.h>
 
40
#include <sys/types.h>
 
41
#include <io.h>
 
42
#include <math.h>
 
43
#else
 
44
#include <stdio.h>
 
45
#include <string.h>
 
46
#include <math.h>
 
47
#include <stdlib.h>
 
48
#include <fcntl.h>
 
49
#include <sys/stat.h>
 
50
#include <sys/time.h>
 
51
#include <sys/utsname.h>
 
52
#include <pthread.h>
 
53
#include <unistd.h>
 
54
#include <sys/types.h>
 
55
#endif
 
56
#define VERBOSE
 
57
#define TRUE                   1
 
58
#define FALSE                  0
 
59
 
 
60
  /** Data structure of a graphic image */
 
61
  typedef struct
 
62
  {
 
63
    /** Image width */
 
64
    Uint32 width;
 
65
    /** Image height */
 
66
    Uint32 height;
 
67
    /** Number of bits per pixels */
 
68
    Uint32 depth;
 
69
    /** Size of the bitmap graphic in bytes */
 
70
    Uint32 size;
 
71
    /** Pointer to the image data */
 
72
    char *pixel;
 
73
    /** Palette of colors */
 
74
    unsigned char palette[768];
 
75
  } bitmap_desc;
 
76
 
 
77
  bool memory_init (Uint32 numofzones);
 
78
  char *memory_allocation (Uint32 size);
 
79
  void free_memory (char *addr);
 
80
  void memory_releases_all (Sint32 verbose);
 
81
  bitmap_desc *load_pcx (char *);
 
82
  Sint16 little_endian_to_short (Sint16 * addr);
 
83
  Sint32 little_endian_to_int (Sint32 * addr);
 
84
  void int_to_little_endian (Sint32 value, Sint32 * addr);
 
85
  void convert32bits_2bigendian (unsigned char *memory);
 
86
  void integer_to_ascii (Sint32 value, Uint32 padding, char *str);
 
87
  char *locate_data_file (const char *const name);
 
88
  char *load_file (const char *const filename);
 
89
  char *loadfile_with_lang (const char *const filename, Uint32 * const fsize);
 
90
  char *loadfile_num (const char *const filename, Sint32 num);
 
91
  char *loadfile (const char *const filename, Uint32 * const size);
 
92
  char* load_absolute_file (const char *const filename, Uint32 * const fsize);
 
93
  bool loadfile_into_buffer (const char *const filename, char *const buffer);
 
94
  void fps_init (void);
 
95
  void fps_print (void);
 
96
  Sint32 wait_next_frame (Sint32 delay, Sint32 max);
 
97
  Sint32 get_time_difference (void);
 
98
  Sint16 sign (float);
 
99
  float calc_target_angle (Sint16 pxs, Sint16 pys, Sint16 pxd, Sint16 pyd);
 
100
  float get_new_angle (float old_angle, float new_angle, float agilite);
 
101
 
 
102
  char* string_duplicate(register const char* str);
 
103
  bool alloc_precalulate_sinus (void);
 
104
  void free_precalulate_sinus (void);
 
105
  extern float *precalc_sin;
 
106
  extern float *precalc_cos;
 
107
  extern float *precalc_sin128;
 
108
  extern float *precalc_cos128;
 
109
 
 
110
  extern float depix[13][32];
 
111
  extern float depiy[13][32];
 
112
  extern Uint32 mem_numof_zones;
 
113
  extern Uint32 mem_total_size;
 
114
 
 
115
#ifdef __cplusplus
 
116
}
 
117
#endif
 
118
 
 
119
#endif