@@ -61,11 +61,11 @@ typedef struct spawn2d_shape
6161//-------------------------------------------------------------------------------------------------------------------
6262typedef struct spawn2d_context
6363{
64- spawn2d_shape * shapes ;
64+ const spawn2d_shape * shapes ;
6565 uint32_t num_shapes ;
66- spawn2d_shape * exclusions ;
66+ const spawn2d_shape * exclusions ;
6767 uint32_t num_exclusions ;
68- float * ctrl_points ;
68+ const float * ctrl_points ;
6969 uint32_t num_ctrl_points ;
7070 float width ;
7171 uint32_t num_tries_max ;
@@ -109,23 +109,26 @@ uint32_t spawn2d_generate_in_shapes(spawn2d_context* ctx, float* points, uint32_
109109// Returns the actual number of points spawned
110110uint32_t spawn2d_generate_along_spline (spawn2d_context * ctx , float * points , uint32_t num_points );
111111
112+
113+
114+
112115//-------------------------------------------------------------------------------------------------------------------
113116// Internal helper functions (optional, not part of public API)
114117//-------------------------------------------------------------------------------------------------------------------
115118
116119//-------------------------------------------------------------------------------------------------------------------
117120// Returns the area of the shape
118- float spawn2d_compute_area (spawn2d_shape * shape );
121+ float spawn2d_compute_area (const spawn2d_shape * shape );
119122
120123//-------------------------------------------------------------------------------------------------------------------
121124// Returns true if the point is inside the shape
122- bool spawn2d_point_in (spawn2d_shape * shape , float x , float y );
125+ bool spawn2d_point_in (const spawn2d_shape * shape , float x , float y );
123126
124127//-------------------------------------------------------------------------------------------------------------------
125128// Uniform area sampling
126129// [seed] Random generator seed, cannot be zero, will be changed by this function
127130// [x, y] Pointer to point coordinates
128- void spawn2d_sample_area (spawn2d_shape * shape , uint32_t * seed , float * x , float * y );
131+ void spawn2d_sample_area (const spawn2d_shape * shape , uint32_t * seed , float * x , float * y );
129132
130133//-------------------------------------------------------------------------------------------------------------------
131134// Returns a random float in [0; 1[
0 commit comments