coastline 0.0.4
Loading...
Searching...
No Matches
trackskidmarks.h File Reference
#include "common/vecmath.h"
#include "common/vehiclefwd.h"
Include dependency graph for trackskidmarks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SdlSkidMarkState
 Ring endpoints for each skid trail in one active engine runtime. More...

Macros

#define SKID_MARK_TRACK_COUNT   32
 The number of entries of g_anSkidMarkHead and g_anSkidMarkTail.
#define SKID_MARK_SEGMENT_COUNT   500
 The number of segments in each trail's ring.

Typedefs

typedef struct SdlSkidMarkState SdlSkidMarkState
 Ring endpoints for each skid trail in one active engine runtime.

Functions

SdlSkidMarkState * GetSdlSkidMarkState (void)
void DrawTrackShadows (Vehicle *vehicles)
 Append vehicle shadows and skid trails to the deferred display list.
void RecordFrameSkidMarks (Vehicle *vehicles)
 Lay the skid marks of the wheels of the vehicles of a drawn frame, as DrawTrackShadows() lays them when skid marks are chosen.
void VisitSkidMarkQuads (void(*visit)(unsigned slot, unsigned long long revision, const Vec3f *oldRight, const Vec3f *newRight, const Vec3f *oldLeft, const Vec3f *newLeft, void *context), void *context, const unsigned char *mask, int *vertices)
 Visit the quads of the skid marks in the order DrawTrackShadows() draws them, each the right and the left corner of the older segment and of the newer one.

Macro Definition Documentation

◆ SKID_MARK_TRACK_COUNT

#define SKID_MARK_TRACK_COUNT   32

The number of entries of g_anSkidMarkHead and g_anSkidMarkTail.

◆ SKID_MARK_SEGMENT_COUNT

#define SKID_MARK_SEGMENT_COUNT   500

The number of segments in each trail's ring.

Typedef Documentation

◆ SdlSkidMarkState

typedef struct SdlSkidMarkState SdlSkidMarkState

Ring endpoints for each skid trail in one active engine runtime.

Function Documentation

◆ GetSdlSkidMarkState()

SdlSkidMarkState * GetSdlSkidMarkState ( void )
Returns
Skid trail endpoints for the active engine runtime.

◆ DrawTrackShadows()

void DrawTrackShadows ( Vehicle * vehicles)

Append vehicle shadows and skid trails to the deferred display list.

◆ RecordFrameSkidMarks()

void RecordFrameSkidMarks ( Vehicle * vehicles)

Lay the skid marks of the wheels of the vehicles of a drawn frame, as DrawTrackShadows() lays them when skid marks are chosen.

Parameters
vehiclesThe vehicles the frame draws.

◆ VisitSkidMarkQuads()

void VisitSkidMarkQuads ( void(* visit )(unsigned slot, unsigned long long revision, const Vec3f *oldRight, const Vec3f *newRight, const Vec3f *oldLeft, const Vec3f *newLeft, void *context),
void * context,
const unsigned char * mask,
int * vertices )

Visit the quads of the skid marks in the order DrawTrackShadows() draws them, each the right and the left corner of the older segment and of the newer one.

A quad is visited when the top bit of the byte of the visibility mask of the instance under either of its segments is clear, the instance in view and not near the eighth vehicle, until the quads fill the pool of the vertices of the quads of the track every view of the frame draws from.

Parameters
visitCalled with a stable ring slot, packed endpoint revisions, four corners, and context.
contextPassed to each call.
maskFor each instance of the track, its byte of g_abInstanceVisibilityMask.
verticesThe vertices of the pool the frame has taken, advanced by 4 for each quad.