1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
20 /* for SetDrawtoField */
21 #define DRAW_BUFFERED 1
22 #define DRAW_BACKBUFFER 2
24 /* for DrawElementShifted */
26 #define CUT_ABOVE (1 << 0)
27 #define CUT_BELOW (1 << 1)
28 #define CUT_LEFT (1 << 2)
29 #define CUT_RIGHT (1 << 3)
31 /* for masking functions */
36 #define DOOR_OPEN_1 (1 << 0)
37 #define DOOR_OPEN_2 (1 << 1)
38 #define DOOR_CLOSE_1 (1 << 2)
39 #define DOOR_CLOSE_2 (1 << 3)
40 #define DOOR_OPEN_ALL (DOOR_OPEN_1 | DOOR_OPEN_2)
41 #define DOOR_CLOSE_ALL (DOOR_CLOSE_1 | DOOR_CLOSE_2)
42 #define DOOR_ACTION_1 (DOOR_OPEN_1 | DOOR_CLOSE_1)
43 #define DOOR_ACTION_2 (DOOR_OPEN_2 | DOOR_CLOSE_2)
44 #define DOOR_ACTION (DOOR_ACTION_1 | DOOR_ACTION_2)
45 #define DOOR_COPY_BACK (1 << 4)
46 #define DOOR_NO_COPY_BACK (1 << 5)
47 #define DOOR_NO_DELAY (1 << 6)
48 #define DOOR_FORCE_REDRAW (1 << 7)
49 #define DOOR_GET_STATE (1 << 8)
50 #define DOOR_SET_STATE (1 << 9)
53 #define REQ_ASK (1 << 0)
54 #define REQ_CONFIRM (1 << 1)
55 #define REQ_PLAYER (1 << 2)
56 #define REQ_STAY_OPEN (1 << 3)
57 #define REQ_STAY_CLOSED (1 << 4)
58 #define REQ_REOPEN (1 << 5)
60 #define REQUEST_WAIT_FOR_INPUT (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
62 void DumpTile(int, int);
64 void DrawMaskedBorder_FIELD();
65 void DrawMaskedBorder_DOOR_1();
66 void DrawMaskedBorder_DOOR_2();
67 void DrawMaskedBorder_DOOR_3();
68 void DrawMaskedBorder_ALL();
69 void DrawMaskedBorder(int);
71 void SetDrawtoField(int);
72 void RedrawPlayfield(boolean, int, int, int, int);
77 void FadeSetEnterMenu();
78 void FadeSetLeaveMenu();
79 void FadeSetEnterScreen();
80 void FadeSetNextScreen();
81 void FadeSetLeaveScreen();
82 void FadeSetFromType(int);
83 void FadeSetDisabled();
84 void FadeSkipNextFadeIn();
85 void FadeSkipNextFadeOut();
88 void SetWindowBackgroundImageIfDefined(int);
89 void SetMainBackgroundImageIfDefined(int);
90 void SetDoorBackgroundImageIfDefined(int);
91 void SetWindowBackgroundImage(int);
92 void SetMainBackgroundImage(int);
93 void SetDoorBackgroundImage(int);
94 void SetPanelBackground();
95 void DrawBackground(int, int, int, int);
96 void DrawBackgroundForFont(int, int, int, int, int);
97 void DrawBackgroundForGraphic(int, int, int, int, int);
99 void MarkTileDirty(int, int);
100 void SetBorderElement();
101 void FloodFillLevel(int, int, int, short[MAX_LEV_FIELDX][MAX_LEV_FIELDY],
104 void SetRandomAnimationValue(int, int);
105 int getGraphicAnimationFrame(int, int);
106 void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int, int);
107 void DrawGraphicAnimation(int, int, int);
108 void DrawLevelGraphicAnimation(int, int, int);
109 void DrawLevelElementAnimation(int, int, int);
110 void DrawLevelGraphicAnimationIfNeeded(int, int, int);
111 void DrawLevelElementAnimationIfNeeded(int, int, int);
113 void DrawAllPlayers(void);
114 void DrawPlayerField(int, int);
115 void DrawPlayer(struct PlayerInfo *);
117 void getSizedGraphicSource(int, int, int, Bitmap **, int *, int *);
118 void getMiniGraphicSource(int, Bitmap **, int *, int *);
119 void getGraphicSourceExt(int, int, Bitmap **, int *, int *, boolean);
120 void getGraphicSource(int, int, Bitmap **, int *, int *);
121 void DrawGraphic(int, int, int, int);
122 void DrawGraphicExt(DrawBuffer *, int, int, int, int);
123 void DrawGraphicThruMask(int, int, int, int);
124 void DrawGraphicThruMaskExt(DrawBuffer *, int, int, int, int);
126 void DrawSizedGraphic(int, int, int, int, int);
127 void DrawSizedGraphicExt(DrawBuffer *, int, int, int, int, int);
128 void DrawMiniGraphic(int, int, int);
129 void DrawMiniGraphicExt(DrawBuffer *, int, int, int);
131 void DrawScreenElementExt(int, int, int, int, int, int, int);
132 void DrawLevelElementExt(int, int, int, int, int, int, int);
133 void DrawScreenElementShifted(int, int, int, int, int, int);
134 void DrawLevelElementShifted(int, int, int, int, int, int);
135 void DrawScreenElementThruMask(int, int, int);
136 void DrawLevelElementThruMask(int, int, int);
137 void DrawLevelFieldThruMask(int, int);
138 void DrawLevelFieldCrumbledSand(int, int);
139 void DrawLevelFieldCrumbledSandDigging(int, int, int, int);
140 void DrawLevelFieldCrumbledSandNeighbours(int, int);
141 void DrawScreenElement(int, int, int);
142 void DrawLevelElement(int, int, int);
143 void DrawScreenField(int, int);
144 void DrawLevelField(int, int);
146 void DrawMiniElement(int, int, int);
147 void DrawMiniElementOrWall(int, int, int, int);
151 void DrawLevel(void);
152 void DrawMiniLevel(int, int, int, int);
153 void DrawPreviewLevel(boolean);
155 void WaitForEventToContinue();
156 boolean Request(char *, unsigned int);
157 unsigned int OpenDoor(unsigned int);
158 unsigned int CloseDoor(unsigned int);
159 unsigned int GetDoorState(void);
160 unsigned int SetDoorState(unsigned int);
161 unsigned int MoveDoor(unsigned int);
163 void DrawSpecialEditorDoor();
164 void UndrawSpecialEditorDoor();
166 void CreateToolButtons();
167 void FreeToolButtons();
169 int map_element_RND_to_EM(int);
170 int map_element_EM_to_RND(int);
171 int map_direction_RND_to_EM(int);
172 int map_direction_EM_to_RND(int);
174 void map_android_clone_elements_RND_to_EM(struct LevelInfo *);
175 void map_android_clone_elements_EM_to_RND(struct LevelInfo *);
177 int get_next_element(int);
178 int el_act_dir2img(int, int, int);
179 int el_act2img(int, int);
180 int el_dir2img(int, int);
185 int el2panelimg(int);
186 int font2baseimg(int);
188 int getBeltNrFromBeltElement(int);
189 int getBeltNrFromBeltActiveElement(int);
190 int getBeltNrFromBeltSwitchElement(int);
191 int getBeltDirNrFromBeltElement(int);
192 int getBeltDirNrFromBeltSwitchElement(int);
193 int getBeltDirFromBeltElement(int);
194 int getBeltDirFromBeltSwitchElement(int);
195 int getBeltElementFromBeltNrAndBeltDirNr(int, int);
196 int getBeltElementFromBeltNrAndBeltDir(int, int);
197 int getBeltSwitchElementFromBeltNrAndBeltDirNr(int, int);
198 int getBeltSwitchElementFromBeltNrAndBeltDir(int, int);
200 unsigned int InitRND(long);
201 void InitGraphicInfo_EM(void);
203 void PlayMenuSoundExt(int);
204 void PlayMenuSound();
205 void PlayMenuSoundStereo(int, int);
206 void PlayMenuSoundIfLoopExt(int);
207 void PlayMenuSoundIfLoop();
208 void PlayMenuMusicExt(int);
209 void PlayMenuMusic();
210 void PlaySoundActivating();
211 void PlaySoundSelecting();
213 void ToggleFullscreenIfNeeded();