| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file jj1bonuslevel.h |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par History: |
| 9 | * - 3rd February 2009: Created bonus.h |
| 10 | * - 1st August 2012: Renamed bonus.h to jj1bonuslevel.h |
| 11 | * |
| 12 | * @par Licence: |
| 13 | * Copyright (c) 2009-2017 AJ Thomson |
| 14 | * |
| 15 | * OpenJazz is distributed under the terms of |
| 16 | * the GNU General Public License, version 2.0 |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #ifndef _BONUS_H |
| 22 | #define _BONUS_Hcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:22:9`! |
| 23 | |
| 24 | #include "io/gfx/anim.h"cxx . . $ `<file>/src/io/gfx/anim.h`/ |
| 25 | #include "level/level.h"cxx . . $ `<file>/src/level/level.h`/ |
| 26 | |
| 27 | |
| 28 | // Constants |
| 29 | |
| 30 | // General |
| 31 | #define BLWcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:31:9`! 256 /* Bonus level width */ |
| 32 | #define BLHcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:32:9`! 256 /* Bonus level height */ |
| 33 | #define BANIMScxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:33:9`! 32 |
| 34 | #define BEVENTScxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:34:9`! 16 |
| 35 | #define BSOUNDScxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:35:9`! 16 |
| 36 | |
| 37 | #define T_BONUS_ENDcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:37:9`! 2000 |
| 38 | |
| 39 | |
| 40 | // Datatype |
| 41 | |
| 42 | /// JJ1 bonus level grid element |
| 43 | typedef structcxx . . $ $anonymous_type_1155ca566b20eb7d_0# { |
| 44 | |
| 45 | unsigned char tilecxx . . $ $anonymous_type_1155ca566b20eb7d_0#tile.; ///< Indexes the tile set |
| 46 | unsigned char eventcxx . . $ $anonymous_type_1155ca566b20eb7d_0#event.; ///< Event type |
| 47 | |
| 48 | } JJ1BonusLevelGridElementcxx . . $ JJ1BonusLevelGridElement#; |
| 49 | |
| 50 | /// JJ1 bonus level event type |
| 51 | typedef structcxx . . $ $anonymous_type_1155ca566b20eb7d_1# { |
| 52 | |
| 53 | unsigned char animcxx . . $ $anonymous_type_1155ca566b20eb7d_1#anim.; ///< Index of animation |
| 54 | unsigned char typecxx . . $ $anonymous_type_1155ca566b20eb7d_1#type.; ///< Type: time, gem, pole-bounce, exit, hand-bounce |
| 55 | unsigned char passablecxx . . $ $anonymous_type_1155ca566b20eb7d_1#passable.; ///< Whether Jazz bounces back |
| 56 | unsigned char usedcxx . . $ $anonymous_type_1155ca566b20eb7d_1#used.; ///< Whether this is a real event |
| 57 | SEcxx . . $ SE/::Typecxx . . $ SE/Type# soundcxx . . $ $anonymous_type_1155ca566b20eb7d_1#sound.; ///< The sound played on the appropriate trigger |
| 58 | |
| 59 | } JJ1BonusEventTypecxx . . $ JJ1BonusEventType#; |
| 60 | |
| 61 | // Classes |
| 62 | |
| 63 | class Fontcxx . . $ Font#; |
| 64 | |
| 65 | /// JJ1 bonus level |
| 66 | class JJ1BonusLevelcxx . . $ JJ1BonusLevel# : public Levelcxx . . $ Level# { |
| 67 | |
| 68 | private: |
| 69 | SDL_Surface* tileSetcxx . . $ JJ1BonusLevel#tileSet.; ///< Tile images |
| 70 | SDL_Surface* backgroundcxx . . $ JJ1BonusLevel#background.; ///< Background image |
| 71 | Fontcxx . . $ Font#* fontcxx . . $ JJ1BonusLevel#font.; ///< On-screen message font |
| 72 | Spritecxx . . $ Sprite#* spriteSetcxx . . $ JJ1BonusLevel#spriteSet.; ///< Sprite images |
| 73 | Animcxx . . $ Anim# animSetcxx . . $ JJ1BonusLevel#animSet.[BANIMScxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:33:9`!]; ///< Animations |
| 74 | JJ1BonusEventTypecxx . . $ JJ1BonusEventType# eventSetcxx . . $ JJ1BonusLevel#eventSet.[BEVENTScxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:34:9`!]; ///< Event types |
| 75 | JJ1BonusLevelGridElementcxx . . $ JJ1BonusLevelGridElement# gridcxx . . $ JJ1BonusLevel#grid.[BLHcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:32:9`!][BLWcxx . . $ `src/jj1/bonuslevel/jj1bonuslevel.h:31:9`!]; ///< Level grid |
| 76 | char maskcxx . . $ JJ1BonusLevel#mask.[60][64]; ///< Tile masks (at most 60 tiles, all with 8 * 8 masks) |
| 77 | fixedcxx . . $ fixed# directioncxx . . $ JJ1BonusLevel#direction.; ///< Player's direction |
| 78 | |
| 79 | JJ1BonusLevelcxx . . $ JJ1BonusLevel#JJ1BonusLevel(c1d1fbac23d453fe).(const JJ1BonusLevelcxx . . $ JJ1BonusLevel#&); // non construction-copyable |
| 80 | JJ1BonusLevelcxx . . $ JJ1BonusLevel#& operatorcxx . . $ JJ1BonusLevel#`operator=`(21910566687198d4).=(const JJ1BonusLevelcxx . . $ JJ1BonusLevel#&); // non copyable |
| 81 | |
| 82 | int loadSpritescxx . . $ JJ1BonusLevel#loadSprites(b126dc7c1de90089). (); |
| 83 | int loadTilescxx . . $ JJ1BonusLevel#loadTiles(1ef8e6ec083aabb9). (char* fileName); |
| 84 | bool isEventcxx . . $ JJ1BonusLevel#isEvent(cf9ef193275fa6d8). (fixedcxx . . $ fixed# x, fixedcxx . . $ fixed# y); |
| 85 | int stepcxx . . $ JJ1BonusLevel#step(b126dc7c1de90089). (); |
| 86 | void drawcxx . . $ JJ1BonusLevel#draw(49f6e7a06ebc5aa8). (); |
| 87 | |
| 88 | public: |
| 89 | JJ1BonusLevelcxx . . $ JJ1BonusLevel#JJ1BonusLevel(4b4d448ac49d7c5a). (Gamecxx . . $ Game#* owner, char* fileName, bool multi); |
| 90 | ~cxx . . $ JJ1BonusLevel#`~JJ1BonusLevel`(49f6e7a06ebc5aa8).JJ1BonusLevelcxx . . $ JJ1BonusLevel# () override; |
| 91 | |
| 92 | bool checkMaskcxx . . $ JJ1BonusLevel#checkMask(cf9ef193275fa6d8). (fixedcxx . . $ fixed# x, fixedcxx . . $ fixed# y); |
| 93 | void receivecxx . . $ JJ1BonusLevel#receive(f25546b61a629de7). (unsigned char* buffer) override; |
| 94 | int playcxx . . $ JJ1BonusLevel#play(b126dc7c1de90089). (); |
| 95 | |
| 96 | }; |
| 97 | |
| 98 | #endif |
| 99 |