@@ -212,7 +212,7 @@ static void apply_blend_mode(state_stack *self, const GladGLContext *gl)
212212 }
213213}
214214
215- static void apply_stored_properties (const GladGLContext * gl , br_renderer * renderer , state_stack * state , uint32_t states , br_boolean * unlit ,
215+ static void apply_stored_properties (const GladGLContext * gl , br_renderer * renderer , state_stack * state , uint32_t states ,
216216 br_gl_main_data_model * model , GLuint tex_default )
217217{
218218 br_boolean depth_test = BR_FALSE ;
@@ -251,19 +251,22 @@ static void apply_stored_properties(const GladGLContext *gl, br_renderer *render
251251 }
252252 }
253253
254- * unlit = BR_FALSE ;
254+ model -> lighting = BR_FALSE ;
255+ model -> prelighting = BR_FALSE ;
256+
255257 if (states & MASK_STATE_SURFACE ) {
256258 if (state -> surface .colour_source == BRT_SURFACE ) {
257259 br_uint_32 colour = state -> surface .colour ;
258260 float r = BR_RED (colour ) / 255.0f ;
259261 float g = BR_GRN (colour ) / 255.0f ;
260262 float b = BR_BLU (colour ) / 255.0f ;
261263 BrVector4Set (& model -> surface_colour , r , g , b , state -> surface .opacity );
262- model -> use_vertex_colour = 0 ;
264+
265+ model -> colour_source = 1 ;
263266 } else {
264267 ASSERT (state -> surface .colour_source == BRT_GEOMETRY );
265268 BrVector4Set (& model -> surface_colour , 1.0f , 1.0f , 1.0f , state -> surface .opacity );
266- model -> use_vertex_colour = 1 ;
269+ model -> colour_source = 0 ;
267270 }
268271
269272 model -> ka = state -> surface .ka ;
@@ -301,7 +304,9 @@ static void apply_stored_properties(const GladGLContext *gl, br_renderer *render
301304 BrMatrix4Copy23 (& model -> map_transform , & state -> surface .map_transform );
302305
303306 depth_test = !state -> surface .force_front && !state -> surface .force_back ;
304- * unlit = !state -> surface .lighting || state -> surface .prelighting ;
307+
308+ model -> lighting = state -> surface .lighting ;
309+ model -> prelighting = state -> surface .prelighting ;
305310 }
306311
307312 {
@@ -390,10 +395,7 @@ static br_boolean apply_state(br_renderer *renderer, const GladGLContext *gl)
390395 /* NB: Flag is never set */
391396 // int model_lit = self->model->flags & V11MODF_LIT;
392397
393- unlit = BR_TRUE ;
394- apply_stored_properties (gl , renderer , renderer -> state .current , MASK_STATE_STORED | MASK_STATE_OUTPUT , & unlit , & model , ctx -> tex_white );
395-
396- model .unlit = (br_uint_32 )unlit ;
398+ apply_stored_properties (gl , renderer , renderer -> state .current , MASK_STATE_STORED | MASK_STATE_OUTPUT , & model , ctx -> tex_white );
397399
398400 return BufferRingGLPush (& renderer -> model_ring , & model , sizeof (model ));
399401}
0 commit comments