Subversion Repositories Games.Carmageddon

Rev

Rev 1 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef _PIPING_H_
  2. #define _PIPING_H_
  3.  
  4. #include "dr_types.h"
  5.  
  6. extern tU8* gPipe_buffer_start;
  7. extern int gDisable_sound;
  8. extern int gDisable_advance;
  9. extern int gMax_rewind_chunks;
  10. extern float gWall_severity;
  11. extern tPipe_reset_proc* gReset_procs[32];
  12. extern tPiped_registration_snapshot gRegistration_snapshots[5];
  13. extern tPipe_smudge_data* gSmudge_space;
  14. extern tU32 gOldest_time;
  15. extern int gCurrent_snapshot_registration_index;
  16. extern tPipe_chunk* gMr_chunky;
  17. extern tCar_spec* gCar_ptr;
  18. extern br_vector3 gZero_vector;
  19. extern tPipe_chunk_type gReentrancy_array[5];
  20. extern tU32 gLast_time;
  21. extern tPipe_model_geometry_data* gModel_geometry_space;
  22. extern tU32 gEnd_time;
  23. extern tU32 gTrigger_time;
  24. extern int gReentrancy_count;
  25. extern br_vector3 gCar_pos;
  26. extern br_vector3 gReference_pos;
  27. extern br_scalar gMax_distance;
  28. extern tU32 gLoop_abort_time;
  29. extern br_vector3 gWall_impact_point;
  30. extern tU8* gPipe_buffer_working_end;
  31. extern tU32 gYoungest_time;
  32. extern tU8* gPipe_buffer_phys_end;
  33. extern tU8* gLocal_buffer_record_ptr;
  34. extern tU8* gPipe_play_ptr;
  35. extern tU8* gEnd_of_session;
  36. extern tU8* gPipe_record_ptr;
  37. extern tU8* gPipe_buffer_oldest;
  38. extern tU32 gPipe_buffer_size;
  39. extern tU8* gLocal_buffer;
  40. extern tU32 gLocal_buffer_size;
  41.  
  42. void GetReducedPos(br_vector3* v, tReduced_pos* p);
  43.  
  44. void SaveReducedPos(tReduced_pos* p, br_vector3* v);
  45.  
  46. int PipeSearchForwards(void);
  47.  
  48. int IsActionReplayAvailable(void);
  49.  
  50. int SomeReplayLeft(void);
  51.  
  52. void DisablePipedSounds(void);
  53.  
  54. void EnablePipedSounds(void);
  55.  
  56. tU32 LengthOfSession(tPipe_session* pSession);
  57.  
  58. void StartPipingSession2(tPipe_chunk_type pThe_type, int pMunge_reentrancy);
  59.  
  60. void StartPipingSession(tPipe_chunk_type pThe_type);
  61.  
  62. void EndPipingSession2(int pMunge_reentrancy);
  63.  
  64. void EndPipingSession(void);
  65.  
  66. void AddDataToSession(int pSubject_index, void* pData, tU32 pData_length);
  67.  
  68. void AddModelGeometryToPipingSession(tU16 pCar_ID, int pModel_index, int pVertex_count, tChanged_vertex* pCoordinates);
  69.  
  70. void AddSmudgeToPipingSession(tU16 pCar_ID, int pModel_index, int pVertex_count, tSmudged_vertex* pCoordinates);
  71.  
  72. void AddPedestrianToPipingSession(int pPedestrian_index, br_matrix34* pTrans, tU8 pAction_index, tU8 pFrame_index, tS8 pHit_points, int pDone_initial, tU16 pParent_ID, float pSpin_period, br_scalar pJump_magnitude, br_vector3* pOffset);
  73.  
  74. void AddSparkToPipingSession(int pSpark_index, br_vector3* pPos, br_vector3* pV);
  75.  
  76. void AddShrapnelToPipingSession(int pShrapnel_index, br_vector3* pPos, tU16 pAge, br_material* pMaterial);
  77.  
  78. void AddScreenWobbleToPipingSession(int pWobble_x, int pWobble_y);
  79.  
  80. void AddGrooveStopToPipingSession(int pGroove_index, br_matrix34* pMatrix, int pPath_interrupt, int pObject_interrupt, float pPath_resumption, float pObject_resumption);
  81.  
  82. void AddNonCarToPipingSession(int pIndex, br_actor* pActor);
  83.  
  84. void AddSmokeToPipingSession(int pIndex, tU8 pType, br_vector3* pPos, br_scalar pRadius, br_scalar pStrength);
  85.  
  86. void AddSmokeColumnToPipingSession(int pIndex, tCar_spec* pCar, int pVertex, int pColour);
  87.  
  88. void AddFlameToPipingSession(int pIndex, int pFrame_count, br_scalar pScale_x, br_scalar pScale_y, br_scalar pOffset_x, br_scalar pOffset_z);
  89.  
  90. void AddSplashToPipingSession(tCollision_info* pCar);
  91.  
  92. void AddOilSpillToPipingSession(int pIndex, br_matrix34* pMat, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec* pCar, br_vector3* pOriginal_pos, br_pixelmap* pPixelmap);
  93.  
  94. void AddFrameFinishToPipingSession(tU32 pThe_time);
  95.  
  96. void AddCarToPipingSession(int pCar_ID, br_matrix34* pCar_mat, br_vector3* pCar_velocity, float pSpeedo_speed, float pLf_sus_position, float pRf_sus_position, float pLr_sus_position, float pRr_sus_position, float pSteering_angle, br_scalar pRevs, int pGear, int pFrame_coll_flag);
  97.  
  98. void AddSoundToPipingSession(tS3_outlet_ptr pOutlet, int pSound_index, tS3_volume pL_volume, tS3_volume pR_volume, tS3_pitch pPitch, br_vector3* pPos);
  99.  
  100. void AddDamageToPipingSession(int pCar_ID, tS8* pDifferences);
  101.  
  102. void AddSpecialToPipingSession(tSpecial_type pType);
  103.  
  104. void AddPedGibToPipingSession(int pIndex, br_matrix34* pTrans, int pSize, int pGib_index, int pPed_index);
  105.  
  106. void AddCarIncidentToPipingSession(float pSeverity, tCar_spec* pCar, br_vector3* pImpact_point);
  107.  
  108. void AddPedIncidentToPipingSession(int pPed_index, br_actor* pActor);
  109.  
  110. void AddWallIncidentToPipingSession(float pSeverity, br_vector3* pImpact_point);
  111.  
  112. void AddProxRayToPipingSession(int pRay_index, tCar_spec* pCar, tU16 pPed_index, tU32 pTime);
  113.  
  114. void AddSkidAdjustmentToPipingSession(int pSkid_num, br_matrix34* pMatrix, int pMaterial_index);
  115.  
  116. void PipeSingleModelGeometry(tU16 pCar_ID, int pModel_index, int pVertex_count, tChanged_vertex* pCoordinates);
  117.  
  118. void PipeSinglePedestrian(int pPedestrian_index, br_matrix34* pTrans, tU8 pAction_index, tU8 pFrame_index, tS8 pHit_points, int pDone_initial, tU16 pParent_ID, float pSpin_period, br_scalar pJump_magnitude, br_vector3* pOffset);
  119.  
  120. void PipeSingleCar(int pCar_ID, br_matrix34* pCar_mat, br_vector3* pCar_velocity, float pSpeedo_speed, float pLf_sus_position, float pRf_sus_position, float pLr_sus_position, float pRr_sus_position, float pSteering_angle, br_scalar pRevs, int pGear, int pFrame_coll_flag);
  121.  
  122. void PipeSingleSound(tS3_outlet_ptr pOutlet, int pSound_index, tS3_volume pL_volume, tS3_volume pR_volume, tS3_pitch pPitch, br_vector3* pPos);
  123.  
  124. void PipeSingleOilSpill(int pIndex, br_matrix34* pMat, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec* pCar, br_vector3* pOriginal_pos, br_pixelmap* pPixelmap);
  125.  
  126. void PipeSingleDamage(int pCar_ID, tS8* pDifferences);
  127.  
  128. void PipeSingleSpecial(tSpecial_type pType);
  129.  
  130. void PipeSinglePedGib(int pIndex, br_matrix34* pTrans, int pSize, int pGib_index, int pPed_index);
  131.  
  132. void PipeSingleCarIncident(float pSeverity, tCar_spec* pCar, br_vector3* pImpact_point);
  133.  
  134. void PipeSinglePedIncident(int pPed_index, br_actor* pActor);
  135.  
  136. void PipeSingleWallIncident(float pSeverity, br_vector3* pImpact_point);
  137.  
  138. void PipeSingleScreenShake(int pWobble_x, int pWobble_y);
  139.  
  140. void PipeSingleGrooveStop(int pGroove_index, br_matrix34* pMatrix, int pPath_interrupt, int pObject_interrupt, float pPath_resumption, float pObject_resumption);
  141.  
  142. void PipeFrameFinish(void);
  143.  
  144. void PipingFrameReset(void);
  145.  
  146. void PipeSingleSkidAdjustment(int pSkid_num, br_matrix34* pMatrix, int pMaterial_index);
  147.  
  148. void ResetPiping(void);
  149.  
  150. void InitialisePiping(void);
  151.  
  152. void DisposePiping(void);
  153.  
  154. void InitLastDamageArrayEtc(void);
  155.  
  156. void ResetCars(void);
  157.  
  158. void PipeCarPositions(void);
  159.  
  160. void ResetPipePlayToEnd(void);
  161.  
  162. void ResetPipePlayToStart(void);
  163.  
  164. tU8* GetPipePlayPtr(void);
  165.  
  166. void SetPipePlayPtr(tU8* pPtr);
  167.  
  168. void AdvanceChunkPtr(tPipe_chunk** pChunk, tChunk_subject_index pType);
  169.  
  170. void ApplyModelGeometry(tPipe_chunk** pChunk);
  171.  
  172. void DoSmudge(tPipe_chunk** pChunk, int pDir);
  173.  
  174. void ApplySmudge(tPipe_chunk** pChunk);
  175.  
  176. void ApplyPedestrian(tPipe_chunk** pChunk);
  177.  
  178. void ApplySpark(tPipe_chunk** pChunk);
  179.  
  180. void ApplyShrapnel(tPipe_chunk** pChunk);
  181.  
  182. void ApplyScreenWobble(tPipe_chunk** pChunk);
  183.  
  184. void ApplyGrooveStop(tPipe_chunk** pChunk);
  185.  
  186. void ApplyNonCar(tPipe_chunk** pChunk);
  187.  
  188. void ApplySmoke(tPipe_chunk** pChunk);
  189.  
  190. void ApplySmokeColumn(tPipe_chunk** pChunk);
  191.  
  192. void ApplyFlame(tPipe_chunk** pChunk);
  193.  
  194. void ApplySplash(tPipe_chunk** pChunk);
  195.  
  196. void ApplyOilSpill(tPipe_chunk** pChunk, tU32 pStop_time);
  197.  
  198. void ApplyFrameBoundary(tPipe_chunk** pChunk);
  199.  
  200. void ApplySound(tPipe_chunk** pChunk);
  201.  
  202. void ApplyCar(tPipe_chunk** pChunk);
  203.  
  204. void ApplyDamage(tPipe_chunk** pChunk);
  205.  
  206. void ApplySpecial(tPipe_chunk** pChunk);
  207.  
  208. void ApplyPedGib(tPipe_chunk** pChunk);
  209.  
  210. void ApplyProxRay(tPipe_chunk** pChunk);
  211.  
  212. void ApplySkidAdjustment(tPipe_chunk** pChunk);
  213.  
  214. int ApplyPipedSession(tU8** pPtr);
  215.  
  216. int MoveSessionPointerBackOne(tU8** pPtr);
  217.  
  218. int MoveSessionPointerForwardOne(tU8** pPtr);
  219.  
  220. tPipe_chunk* FindPreviousChunk(tU8* pPtr, tPipe_chunk_type pType, tChunk_subject_index pIndex);
  221.  
  222. void UndoModelGeometry(tPipe_chunk** pChunk);
  223.  
  224. void UndoSmudge(tPipe_chunk** pChunk);
  225.  
  226. void UndoPedestrian(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  227.  
  228. void UndoFrameBoundary(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  229.  
  230. void UndoCar(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  231.  
  232. void UndoSound(tPipe_chunk** pChunk);
  233.  
  234. void UndoDamage(tPipe_chunk** pChunk);
  235.  
  236. void UndoSpecial(tPipe_chunk** pChunk);
  237.  
  238. void UndoPedGib(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  239.  
  240. void UndoSpark(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  241.  
  242. void UndoShrapnel(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  243.  
  244. void UndoScreenWobble(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  245.  
  246. void UndoGrooveStop(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  247.  
  248. void UndoNonCar(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  249.  
  250. void UndoSmoke(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  251.  
  252. void UndoSmokeColumn(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  253.  
  254. void UndoFlame(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  255.  
  256. void UndoSplash(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  257.  
  258. void UndoOilSpill(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  259.  
  260. void UndoProxRay(tPipe_chunk** pChunk);
  261.  
  262. void UndoSkidAdjustment(tPipe_chunk** pChunk, tPipe_chunk* pPrev_chunk);
  263.  
  264. int UndoPipedSession(tU8** pPtr);
  265.  
  266. tU32 FindPrevFrameTime(tU8* pPtr);
  267.  
  268. void ScanBuffer(tU8** pPtr, tPipe_chunk_type pType, tU32 pDefault_time, int (*pCall_back)(tPipe_chunk*, int, tU32), int (*pTime_check)(tU32));
  269.  
  270. int CheckSound(tPipe_chunk* pChunk_ptr, int pChunk_count, tU32 pTime);
  271.  
  272. int SoundTimeout(tU32 pTime);
  273.  
  274. void ScanAndPlaySoundsToBe(tU8* pPtr, tU32 pOldest_time, tU32 pYoungest_time);
  275.  
  276. int CheckCar(tPipe_chunk* pChunk_ptr, int pChunk_count, tU32 pTime);
  277.  
  278. int CarTimeout(tU32 pTime);
  279.  
  280. void ScanCarsPositions(tCar_spec* pCar, br_vector3* pSource_pos, br_scalar pMax_distance_sqr, tU32 pOffset_time, tU32 pTime_period, br_vector3* pCar_pos, tU32* pTime_returned);
  281.  
  282. int CheckIncident(tPipe_chunk* pChunk_ptr, int pChunk_count, tU32 pTime);
  283.  
  284. int GetNextIncident(tU32 pOffset_time, tIncident_type* pIncident_type, float* pSeverity, tIncident_info* pInfo, tU32* pTime_away);
  285.  
  286. tU32 GetARStartTime(void);
  287.  
  288. #endif
  289.