1 /*------------------------------------------------------------------.
2 | Copyright 2001  Alexandre Duret-Lutz <duret_g@epita.fr>           |
3 |                                                                   |
4 | This file is part of Heroes.                                      |
5 |                                                                   |
6 | Heroes is free software; you can redistribute it and/or modify it |
7 | under the terms of the GNU General Public License version 2 as    |
8 | published by the Free Software Foundation.                        |
9 |                                                                   |
10 | Heroes is distributed in the hope that it will be useful, but     |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of        |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU |
13 | General Public License for more details.                          |
14 |                                                                   |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software       |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          |
18 | 02111-1307 USA                                                    |
19 `------------------------------------------------------------------*/
20 
21 #include "system.h"
22 #include "lvl_priv.h"
23 
24 const char *
lvl_sound_track(const a_level * lvl)25 lvl_sound_track (const a_level *lvl)
26 {
27   return lvl->private->sound_track_alias;
28 }
29 
30 const char *
lvl_tile_sprite_map_basename(const a_level * lvl)31 lvl_tile_sprite_map_basename (const a_level *lvl)
32 {
33   return lvl->private->tile_sprite_map_basename;
34 }
35 
36 void
lvl_start_position(const a_level * lvl,unsigned int player,a_square_corrd_pair * coord,a_dir * dir)37 lvl_start_position (const a_level *lvl, unsigned int player,
38 		    a_square_corrd_pair *coord, a_dir *dir)
39 {
40   if (coord)
41     *coord = lvl->private->start_pos[player];
42   if (dir)
43     *dir = lvl->private->start_dir[player];
44 }
45 
46 a_tile_type
lvl_tile_type(const a_level * lvl,a_tile_index tile)47 lvl_tile_type (const a_level *lvl, a_tile_index tile)
48 {
49   return lvl->private->tile[tile].type;
50 }
51 
52 unsigned int
lvl_tile_sprite_offset(const a_level * lvl,a_tile_index tile)53 lvl_tile_sprite_offset (const a_level *lvl, a_tile_index tile)
54 {
55   return lvl->private->tile[tile].sprite_offset;
56 }
57 
58 unsigned int
lvl_tile_sprite_overlay_offset(const a_level * lvl,a_tile_index tile)59 lvl_tile_sprite_overlay_offset (const a_level *lvl, a_tile_index tile)
60 {
61   return lvl->private->tile[tile].sprite_overlay_offset;
62 }
63 
64 void
lvl_animation_info(const a_level * lvl,a_tile_index tile,unsigned int * frame_count,unsigned int * delay,an_anim_kind * kind)65 lvl_animation_info (const a_level *lvl, a_tile_index tile,
66 		    unsigned int *frame_count, unsigned int *delay,
67 		    an_anim_kind *kind)
68 {
69   *kind = lvl->private->tile[tile].anim;
70   *frame_count = lvl->private->tile[tile].frame_count;
71   *delay = lvl->private->tile[tile].frame_delay;
72 }
73