3
* @brief handle memory allocation and file access
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 $
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.
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.
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,
40
#include <sys/types.h>
51
#include <sys/utsname.h>
54
#include <sys/types.h>
60
/** Data structure of a graphic image */
67
/** Number of bits per pixels */
69
/** Size of the bitmap graphic in bytes */
71
/** Pointer to the image data */
73
/** Palette of colors */
74
unsigned char palette[768];
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);
95
void fps_print (void);
96
Sint32 wait_next_frame (Sint32 delay, Sint32 max);
97
Sint32 get_time_difference (void);
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);
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;
110
extern float depix[13][32];
111
extern float depiy[13][32];
112
extern Uint32 mem_numof_zones;
113
extern Uint32 mem_total_size;