1 #ifndef GAME_SP_EXPORT_H
2 #define GAME_SP_EXPORT_H
4 /* ========================================================================= */
5 /* functions and definitions exported from game_sp to main program */
6 /* ========================================================================= */
8 /* ------------------------------------------------------------------------- */
9 /* constant definitions */
10 /* ------------------------------------------------------------------------- */
12 #define SP_MAX_PLAYFIELD_WIDTH MAX_PLAYFIELD_WIDTH
13 #define SP_MAX_PLAYFIELD_HEIGHT MAX_PLAYFIELD_HEIGHT
15 #define SP_NUM_LEVELS_PER_PACKAGE 111
17 #define SP_PLAYFIELD_WIDTH 60
18 #define SP_PLAYFIELD_HEIGHT 24
19 #define SP_LEVEL_NAME_LEN 23
20 #define SP_MAX_SPECIAL_PORTS 10
22 #define SP_HEADER_SIZE 96
23 #define SP_PLAYFIELD_SIZE (SP_PLAYFIELD_WIDTH * \
25 #define SP_LEVEL_SIZE (SP_HEADER_SIZE + SP_PLAYFIELD_SIZE)
27 #define SP_FRAMES_PER_SECOND 35
28 #define SP_MAX_TAPE_LEN 64010 /* (see "spfix63.doc") */
31 /* ------------------------------------------------------------------------- */
32 /* data structure definitions */
33 /* ------------------------------------------------------------------------- */
35 #ifndef HAS_SpecialPortType
39 short PortLocation; // = 2*(x+(y*60)) /* big endian format */
41 int PortLocation; // = 2*(x+(y*60))
43 byte Gravity; // 1 = turn on, anything else (0) = turn off
44 byte FreezeZonks; // 2 = turn on, anything else (0) = turn off (1=off!)
45 byte FreezeEnemies; // 1 = turn on, anything else (0) = turn off
48 #define HAS_SpecialPortType
51 #ifndef HAS_LevelInfoType
55 byte InitialGravity; // 1=on, anything else (0) = off
56 byte Version; // SpeedFixVersion XOR &H20
58 byte InitialFreezeZonks; // 2=on, anything else (0) = off. (1=off too!)
61 // Number of Infotrons needed. 0 means that Supaplex will count the total
62 // amount of Infotrons in the level, and use the low byte of that number.
63 // (A multiple of 256 Infotrons will then result in 0-to-eat, etc.!)
64 byte SpecialPortCount; // Maximum 10 allowed!
65 SpecialPortType SpecialPort[10];
66 byte SpeedByte; // = Speed XOR Highbyte(RandomSeed)
67 byte CheckSumByte; // = CheckSum XOR SpeedByte
69 short DemoRandomSeed; /* little endian format */
74 #define HAS_LevelInfoType
89 boolean is_available; /* structure contains valid demo */
91 int level_nr; /* number of corresponding level */
93 int length; /* number of demo entries */
94 byte data[SP_MAX_TAPE_LEN]; /* array of demo entries */
103 byte playfield[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
105 struct DemoInfo_SP demo;
108 struct GraphicInfo_SP
112 int src_offset_x, src_offset_y;
113 int dst_offset_x, dst_offset_y;
116 Bitmap *crumbled_bitmap;
117 int crumbled_src_x, crumbled_src_y;
118 int crumbled_border_size;
120 boolean has_crumbled_graphics;
121 boolean preserve_background;
123 int unique_identifier; /* used to identify needed screen updates */
126 struct EngineSnapshotInfo_SP
128 struct GameInfo_SP game_sp;
132 /* ------------------------------------------------------------------------- */
133 /* exported functions */
134 /* ------------------------------------------------------------------------- */
136 extern struct GlobalInfo_SP global_sp_info;
137 extern struct GameInfo_SP game_sp_info;
138 extern struct LevelInfo_SP native_sp_level;
139 extern struct GraphicInfo_SP graphic_info_sp_object[TILE_MAX][8];
140 extern struct GraphicInfo_SP graphic_info_sp_player[MAX_PLAYERS][SPR_MAX][8];
141 extern struct EngineSnapshotInfo_SP engine_snapshot_sp;
143 extern void sp_open_all();
144 extern void sp_close_all();
146 extern void InitGameEngine_SP();
147 extern void GameActions_SP(byte *, boolean);
149 extern unsigned int InitEngineRandom_SP(long);
151 extern void setLevelInfoToDefaults_SP();
152 extern void copyInternalEngineVars_SP();
153 extern boolean LoadNativeLevel_SP(char *, int);
155 extern void BackToFront_SP(void);
156 extern void BlitScreenToBitmap_SP(Bitmap *);
157 extern void RedrawPlayfield_SP(boolean);
158 extern void DrawGameDoorValues_SP();
160 extern void LoadEngineSnapshotValues_SP();
161 extern void SaveEngineSnapshotValues_SP();
163 extern int map_key_RND_to_SP(int);
164 extern int map_key_SP_to_RND(int);
166 #endif /* GAME_SP_EXPORT_H */