Subversion Repositories Games.Carmageddon

Rev

Rev 18 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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