Allow specifying ROM type in file load dialog
[lsnes.git] / src / emulation / sky / tile.hpp
blobf60ed504e8ddd4749b98faa6a1af0bc8c7d99949
1 #ifndef _skycore__tile__hpp__included__
2 #define _skycore__tile__hpp__included__
4 #include <cstdint>
6 namespace sky
8 struct tile
10 static const unsigned sticky = 2;
11 static const unsigned slippery = 8;
12 static const unsigned suppiles = 9;
13 static const unsigned boost = 10;
14 static const unsigned burning = 12;
15 tile() { _tile = 0; }
16 tile(uint16_t xtile) { _tile = xtile; }
17 unsigned lower_floor() { return _tile & 0xF; }
18 unsigned upper_floor() { return (_tile & 0xF0) >> 4; }
19 bool is_tunnel() { return ((_tile & 0x100) != 0) && ((_tile & 0xE00) <= 0x400); }
20 int apparent_height() throw();
21 bool has_lower_floor() throw() { return ((_tile & 0xF) != 0); }
22 bool is_colliding_floor(int16_t hchunk, int16_t vpos);
23 bool is_colliding(int16_t hchunk, int16_t vpos);
24 int16_t upper_level();
25 unsigned surface_type(int16_t vpos);
26 bool is_dangerous();
27 bool is_block() { return ((_tile & 0xF00) != 0); }
28 bool is_rblock() { return ((_tile & 0xE00) != 0); }
29 bool is_blank() { return (_tile == 0); /* Not masked! */ }
30 bool in_pipe(uint16_t hchunk, int16_t vpos);
31 uint16_t rawtile() { return _tile; }
32 private:
33 uint16_t _tile;
36 #endif