Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _TILE_HPP
- #define _TILE_HPP
- #include <globals.hpp>
- struct Tile {
- kit::u16 id : 7;
- kit::u16 tileset : 1; //whether to use tileset a or b
- kit::u16 collide_a : 1; //'collide with top-left 12x12 section of tile?'
- kit::u16 collide_b : 1; //'collide with top-right 12x12 section of tile?'
- kit::u16 collide_c : 1; //'collide with bottom-left 12x12 section of tile?'
- kit::u16 collide_d : 1; //'collide with bottom-right 12x12 section of tile?'
- kit::u16 pass : 1; //allow passing through tile
- kit::u16 platform : 1; //allow falling through top side of tile conditionally
- kit::u16 _unused : 2;
- };
- struct Object;
- typedef void (*Object_TickCallback)(Object* obj_a);
- struct Object {
- kit::u32 type;
- kit::u32 _;
- Object_TickCallback funcUpdate;
- };
- //uncompressed scene data
- struct Scene { //64B
- //pat is memory::alloc'd, bmp is not
- kit::Bitmap* bmp_bg = nullptr; //bitmap for background layer
- Tile* pat_mg = nullptr; //pattern for midground (collision) layer
- Tile* pat_fg = nullptr; //pattern for foreground layer (skipped if nullptr)
- //(length of pat_<mg/fg> is [TILESIZ_X*TILESIZ_Y])
- //these two are memory::alloc'd too
- Object* objs = nullptr; //pointer to associated object array,
- Object* objs_original = nullptr; //and whatever its original state was
- kit::u16 objs_len = 0;
- kit::u16 edge_n; //scene id for north edge
- kit::u16 edge_s; //scene id for south edge
- kit::u16 edge_w; //scene id for west edge
- kit::u16 edge_e; //scene id for east edge
- kit::u16 music; //music id; 0 for no change, -1 (65535) to stop
- kit::u16 ambient_a; //ambient track id a; 0 for no change, -1 to stop
- kit::u16 ambient_b; //ambient track id b; 0 for no change, -1 to stop
- kit::u16 tileset_a; //1st associated tileset
- kit::u16 tileset_b; //2nd associated tileset
- bool visited_before; //used to reset object and npc properties between deaths
- bool stretch_bg; //'stretch the bg over the entire screen?' (repeats otherwise)
- kit::u8 _padding8[2];
- void drawBg();
- };
- #endif /* _TILE_HPP */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement