Rev 1 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | #ifndef _GRAPHICS_H_ |
2 | #define _GRAPHICS_H_ |
||
3 | |||
4 | #include "dr_types.h" |
||
5 | |||
6 | extern int gPalette_munged; |
||
7 | extern int gColourValues[1]; |
||
8 | extern int gNext_transient; |
||
9 | extern int gCursor_x_offsets[8]; |
||
10 | extern int gCursor_y_offsets[8]; |
||
11 | extern int gCursor_gib_x_offsets[8]; |
||
12 | extern int gCursor_gib_y_offsets[8]; |
||
13 | extern int gCursor_giblet_sequence0[7]; |
||
14 | extern int gCursor_giblet_sequence1[5]; |
||
15 | extern int gCursor_giblet_sequence2[5]; |
||
16 | extern int gCursor_giblet_sequence3[5]; |
||
17 | extern int* gCursor_giblet_sequences[4]; |
||
18 | extern char* gFont_names[21]; |
||
19 | extern br_colour gRGB_colours[9]; |
||
20 | extern br_matrix34 gSheer_mat; |
||
21 | extern br_matrix34 gIdentity34; |
||
22 | extern tShadow_level gShadow_level; |
||
23 | extern br_scalar gShadow_hither_z_move; |
||
24 | extern br_scalar gShadow_hither_min_move; |
||
25 | extern int gArrows[2][4][60]; |
||
26 | extern float gMap_render_x; |
||
27 | extern float gMap_render_y; |
||
28 | extern float gMap_render_width; |
||
29 | extern float gMap_render_height; |
||
30 | extern int gMouse_started; |
||
31 | extern int gFaded_palette; |
||
32 | extern int gAR_fudge_headups; |
||
33 | extern br_pixelmap* gCurrent_splash; |
||
34 | extern br_pixelmap* gCurrent_conversion_table; |
||
35 | extern int gMap_colours[4]; |
||
36 | extern br_vector3 gShadow_points[8]; |
||
37 | extern tConcussion gConcussion; |
||
38 | extern tClip_details gShadow_clip_planes[8]; |
||
39 | extern br_actor* gLollipops[100]; |
||
40 | extern tWobble_spec gWobble_array[5]; |
||
41 | extern tSaved_table gSaved_shade_tables[100]; |
||
42 | extern tCursor_giblet gCursor_giblets[45]; |
||
43 | extern tTransient_bm gTransient_bitmaps[50]; |
||
44 | extern float gCosine_array[64]; |
||
45 | extern br_pixelmap* gCursors[8]; |
||
46 | extern br_pixelmap* gCursor_giblet_images[18]; |
||
47 | extern br_pixelmap* gEval_1; |
||
48 | extern br_pixelmap* gEval_2; |
||
49 | extern br_vector3 gShadow_light_z; |
||
50 | extern br_vector3 gShadow_light_x; |
||
51 | extern int gShadow_dim_amount; |
||
52 | extern int gNumber_of_lollipops; |
||
53 | extern br_vector3 gShadow_light_ray; |
||
54 | extern int gFancy_shadow; |
||
55 | extern br_model* gShadow_model; |
||
56 | extern br_actor* gShadow_actor; |
||
57 | extern int gShadow_clip_plane_count; |
||
58 | extern br_pixelmap* gPalette_conversion_table; |
||
59 | extern br_material* gShadow_material; |
||
60 | extern int gSaved_table_count; |
||
61 | extern int gCurrent_cursor_index; |
||
62 | extern int gPalette_index; |
||
63 | extern int gCursor_transient_index; |
||
64 | extern char* gScratch_pixels; |
||
65 | extern br_pixelmap* gScratch_palette; |
||
66 | extern int gLast_palette_change; |
||
67 | extern br_pixelmap* gOrig_render_palette; |
||
68 | extern br_pixelmap* gCurrent_palette; |
||
69 | extern br_pixelmap* gRender_palette; |
||
70 | extern float gCamera_to_horiz_angle; |
||
71 | extern int gColours[9]; |
||
72 | extern br_pixelmap* gFlic_palette; |
||
73 | extern tDR_font gFonts[21]; |
||
74 | extern char* gCurrent_palette_pixels; |
||
75 | extern int gWidth; |
||
76 | extern int gMap_render_height_i; |
||
77 | extern int gScreen_wobble_x; |
||
78 | extern int gScreen_wobble_y; |
||
79 | extern br_scalar gCurrent_ambience; |
||
80 | extern int gY_offset; |
||
81 | extern int gMap_render_width_i; |
||
82 | extern int gMouse_in_use; |
||
83 | extern int gHeight; |
||
84 | extern int gMouse_last_y_coord; |
||
85 | extern int gMouse_last_x_coord; |
||
86 | extern br_scalar gAmbient_adjustment; |
||
87 | extern int gMap_render_x_i; |
||
88 | extern int gX_offset; |
||
89 | extern int gMap_render_y_i; |
||
90 | extern int gMirror_on__graphics; // suffix added to avoid duplicate symbol |
||
91 | extern br_scalar gYon_squared; |
||
92 | |||
93 | void TurnOnPaletteConversion(void); |
||
94 | |||
95 | void TurnOffPaletteConversion(void); |
||
96 | |||
97 | void ResetLollipopQueue(void); |
||
98 | |||
99 | int AddToLollipopQueue(br_actor* pActor, int pIndex); |
||
100 | |||
101 | void RenderLollipops(void); |
||
102 | |||
103 | void DRDrawLine(br_pixelmap* pDestn, int pX1, int pY1, int pX2, int pY2, int pColour); |
||
104 | |||
105 | void DrawDigitAt(br_pixelmap* gImage, int pX, int pY, int pY_pitch, int pValue); |
||
106 | |||
107 | void DrawNumberAt(br_pixelmap* gImage, int pX, int pY, int pX_pitch, int pY_pitch, int pValue, int pDigit_count, int pLeading_zeroes); |
||
108 | |||
109 | void BuildColourTable(br_pixelmap* pPalette); |
||
110 | |||
111 | void ClearConcussion(void); |
||
112 | |||
113 | tS8* SkipLines(tS8* pSource, int pCount); |
||
114 | |||
115 | void CopyWords(char* pDst, char* pSrc, int pN); |
||
116 | |||
117 | void Copy8BitStripImageTo16Bit(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight); |
||
118 | |||
119 | void CopyStripImage(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pOffset_x, br_int_16 pDest_y, br_int_16 pOffset_y, tS8* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_uint_16 pWidth, br_uint_16 pHeight); |
||
120 | |||
121 | void SetBRenderScreenAndBuffers(int pX_offset, int pY_offset, int pWidth, int pHeight); |
||
122 | |||
123 | void SetIntegerMapRenders(void); |
||
124 | |||
125 | void AdjustRenderScreenSize(void); |
||
126 | |||
127 | void ScreenSmaller(void); |
||
128 | |||
129 | void ScreenLarger(void); |
||
130 | |||
131 | void DRSetPaletteEntries(br_pixelmap* pPalette, int pFirst_colour, int pCount); |
||
132 | |||
133 | void DRSetPalette3(br_pixelmap* pThe_palette, int pSet_current_palette); |
||
134 | |||
135 | void DRSetPalette2(br_pixelmap* pThe_palette, int pSet_current_palette); |
||
136 | |||
137 | void DRSetPalette(br_pixelmap* pThe_palette); |
||
138 | |||
139 | void InitializePalettes(void); |
||
140 | |||
141 | void SwitchToPalette(char* pPal_name); |
||
142 | |||
143 | void ClearEntireScreen(void); |
||
144 | |||
145 | void ClearWobbles(void); |
||
146 | |||
147 | void InitWobbleStuff(void); |
||
148 | |||
149 | void NewScreenWobble(double pAmplitude_x, double pAmplitude_y, double pPeriod); |
||
150 | |||
151 | void SetScreenWobble(int pWobble_x, int pWobble_y); |
||
152 | |||
153 | void ResetScreenWobble(void); |
||
154 | |||
155 | void CalculateWobblitude(tU32 pThe_time); |
||
156 | |||
157 | void CalculateConcussion(tU32 pThe_time); |
||
158 | |||
159 | void SufferFromConcussion(float pSeriousness); |
||
160 | |||
161 | void ProcessNonTrackActors(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_actor* pCamera, br_matrix34* pCamera_to_world, br_matrix34* pOld_camera_matrix); |
||
162 | |||
163 | int OppositeColour(int pColour); |
||
164 | |||
165 | void DrawMapBlip(tCar_spec* pCar, tU32 pTime, br_matrix34* pTrans, br_vector3* pPos, int pColour); |
||
166 | |||
167 | void DrawMapSmallBlip(tU32 pTime, br_vector3* pPos, int pColour); |
||
168 | |||
169 | void MungeClipPlane(br_vector3* pLight, tCar_spec* pCar, br_vector3* p1, br_vector3* p2, br_scalar pY_offset); |
||
170 | |||
171 | void TryThisEdge(tCar_spec* pCar, br_vector3* pLight, int pIndex_1, br_scalar pSign_1, int pIndex_2, br_scalar pSign_2, int pPoint_index_1, int pPoint_index_2, br_scalar pY_offset); |
||
172 | |||
173 | br_scalar DistanceFromPlane(br_vector3* pPos, br_scalar pA, br_scalar pB, br_scalar pC, br_scalar pD); |
||
174 | |||
175 | void DisableLights(void); |
||
176 | |||
177 | void EnableLights(void); |
||
178 | |||
179 | void ProcessShadow(tCar_spec* pCar, br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera, br_matrix34* pCamera_to_world_transform, br_scalar pDistance_factor); |
||
180 | |||
181 | void RenderShadows(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera, br_matrix34* pCamera_to_world_transform); |
||
182 | |||
183 | void FlashyMapCheckpoint(int pIndex, tU32 pTime); |
||
184 | |||
185 | int ConditionallyFillWithSky(br_pixelmap* pPixelmap); |
||
186 | |||
187 | void RenderAFrame(int pDepth_mask_on); |
||
188 | |||
189 | void InitPaletteAnimate(void); |
||
190 | |||
191 | void RevertPalette(void); |
||
192 | |||
193 | void MungePalette(void); |
||
194 | |||
195 | void ResetPalette(void); |
||
196 | |||
197 | void Darken(tU8* pPtr, unsigned int pDarken_amount); |
||
198 | |||
199 | void SetFadedPalette(int pDegree); |
||
200 | |||
201 | void FadePaletteDown(void); |
||
202 | |||
203 | void FadePaletteUp(void); |
||
204 | |||
205 | void KillSplashScreen(void); |
||
206 | |||
207 | void EnsureRenderPalette(void); |
||
208 | |||
209 | void SplashScreenWith(char* pPixmap_name); |
||
210 | |||
211 | void EnsurePaletteUp(void); |
||
212 | |||
213 | br_uint_32 AmbientificateMaterial(br_material* pMat, void* pArg); |
||
214 | |||
215 | void ChangeAmbience(br_scalar pDelta); |
||
216 | |||
217 | void InitAmbience(void); |
||
218 | |||
219 | void DRPixelmapRectangleMaskedCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight); |
||
220 | |||
221 | void DRMaskedStamp(br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource); |
||
222 | |||
223 | void DRPixelmapRectangleOnscreenCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight); |
||
224 | |||
225 | void DRPixelmapRectangleShearedCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight, tX1616 pShear); |
||
226 | |||
227 | void DRPixelmapRectangleVScaledCopy(br_pixelmap* pDest, br_int_16 pDest_x, br_int_16 pDest_y, br_pixelmap* pSource, br_int_16 pSource_x, br_int_16 pSource_y, br_int_16 pWidth, br_int_16 pHeight); |
||
228 | |||
229 | void InitTransientBitmaps(void); |
||
230 | |||
231 | int AllocateTransientBitmap(int pWidth, int pHeight, int pUser_data); |
||
232 | |||
233 | void DeallocateTransientBitmap(int pIndex); |
||
234 | |||
235 | void DeallocateAllTransientBitmaps(void); |
||
236 | |||
237 | void RemoveTransientBitmaps(int pGraphically_remove_them); |
||
238 | |||
239 | void SaveTransient(int pIndex, int pX_coord, int pY_coord); |
||
240 | |||
241 | void DrawCursorGiblet(tCursor_giblet* pGib); |
||
242 | |||
243 | void ProcessCursorGiblets(int pPeriod); |
||
244 | |||
245 | int NewCursorGiblet(int pX_coord, int pY_coord, float pX_speed, float pY_speed, tU32 pDrop_time); |
||
246 | |||
247 | int DoMouseCursor(void); |
||
248 | |||
249 | int AllocateCursorTransient(void); |
||
250 | |||
251 | void StartMouseCursor(void); |
||
252 | |||
253 | void EndMouseCursor(void); |
||
254 | |||
255 | void LoadFont(int pFont_ID); |
||
256 | |||
257 | void DisposeFont(int pFont_ID); |
||
258 | |||
259 | void InitDRFonts(void); |
||
260 | |||
261 | void DrawDropImage(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip, int pOffset); |
||
262 | |||
263 | void DropInImageFromTop(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip); |
||
264 | |||
265 | void DropOutImageThruBottom(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip); |
||
266 | |||
267 | void DropInImageFromBottom(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip); |
||
268 | |||
269 | void DropOutImageThruTop(br_pixelmap* pImage, int pLeft, int pTop, int pTop_clip, int pBottom_clip); |
||
270 | |||
271 | void DrawTellyLine(br_pixelmap* pImage, int pLeft, int pTop, int pPercentage); |
||
272 | |||
273 | void DrawTellyImage(br_pixelmap* pImage, int pLeft, int pTop, int pPercentage); |
||
274 | |||
275 | void TellyInImage(br_pixelmap* pImage, int pLeft, int pTop); |
||
276 | |||
277 | void TellyOutImage(br_pixelmap* pImage, int pLeft, int pTop); |
||
278 | |||
279 | void SetShadowLevel(tShadow_level pLevel); |
||
280 | |||
281 | tShadow_level GetShadowLevel(void); |
||
282 | |||
283 | void ToggleShadow(void); |
||
284 | |||
285 | void InitShadow(void); |
||
286 | |||
287 | br_uint_32 SaveShadeTable(br_pixelmap* pTable, void* pArg); |
||
288 | |||
289 | void SaveShadeTables(void); |
||
290 | |||
291 | void DisposeSavedShadeTables(void); |
||
292 | |||
293 | void ShadowMode(void); |
||
294 | |||
295 | int SwitchToRealResolution(void); |
||
296 | |||
297 | int SwitchToLoresMode(void); |
||
298 | |||
299 | void DRPixelmapDoubledCopy(br_pixelmap* pDestn, br_pixelmap* pSource, int pSource_width, int pSource_height, int pX_offset, int pY_offset); |
||
300 | |||
301 | #endif |