@@ -376,29 +376,23 @@ void DrawSmoke3DGPU(smoke3ddata *smoke3di){
376376 meshi = global_scase .meshescoll .meshinfo + smoke3di -> blocknumber ;
377377 if (meshvisptr [meshi - global_scase .meshescoll .meshinfo ]== 0 )return ;
378378
379- if (HRRPUV_index >= 0 ){
379+ if (HRRPUV_index >= 0 && smoke3di -> smokestate [ HRRPUV_index ]. index >= 0 ){
380380 firecolor = smoke3di -> smokestate [HRRPUV_index ].color ;
381381 }
382+ else if (TEMP_index >= 0 && smoke3di -> smokestate [TEMP_index ].index >= 0 ){
383+ firecolor = smoke3di -> smokestate [TEMP_index ].color ;
384+ }
382385 else {
383386 firecolor = NULL ;
384387 }
385388
386- {
387- smoke3ddata * sooti = NULL ;
388-
389- if (SOOT_index >=0 && smoke3di -> smokestate [SOOT_index ].index >=0 ){
390- sooti = global_scase .smoke3dcoll .smoke3dinfo + smoke3di -> smokestate [SOOT_index ].index ;
391- }
392- else {
393- sooti = NULL ;
394- }
395- if (sooti != NULL && sooti -> display == 1 ){
396- have_smoke_local = 1 ;
397- }
398- else {
399- have_smoke_local = 0 ;
400- }
389+ smoke3ddata * sooti = NULL ;
390+ have_smoke_local = 0 ;
391+ if (SOOT_index >= 0 && smoke3di -> smokestate [SOOT_index ].index >=0 ) {
392+ sooti = global_scase .smoke3dcoll .smoke3dinfo + smoke3di -> smokestate [SOOT_index ].index ;
393+ if (sooti != NULL && sooti -> display == 1 )have_smoke_local = 1 ;
401394 }
395+
402396 iblank_smoke3d = meshi -> iblank_smoke3d ;
403397
404398 // meshi->global_hrrpuv_cb_min
@@ -461,9 +455,15 @@ void DrawSmoke3DGPU(smoke3ddata *smoke3di){
461455 glUniform1f (GPU_emission_factor , emission_factor );
462456 glUniform1i (GPU_use_fire_alpha , use_fire_alpha );
463457 glUniform1i (GPU_have_smoke , have_smoke_local );
464- glUniform1i (GPU_smokecolormap , 0 );
465- glUniform1f (GPU_global_hrrpuv_max , global_scase .hrrpuv_max );
466- glUniform1f (GPU_global_hrrpuv_cb_min , global_hrrpuv_cb_min );
458+ glUniform1i (GPU_smokecolormap , 2 );
459+ if (smoke3di -> type == TEMP_index && TEMP_index >= 0 ) {
460+ glUniform1f (GPU_global_hrrpuv_max , global_scase .temp_max );
461+ glUniform1f (GPU_global_hrrpuv_cb_min , global_temp_cb_min );
462+ }
463+ else {
464+ glUniform1f (GPU_global_hrrpuv_max , global_scase .hrrpuv_max );
465+ glUniform1f (GPU_global_hrrpuv_cb_min , global_hrrpuv_cb_min );
466+ }
467467 glUniform1f (GPU_fire_alpha , smoke3di -> fire_alpha );
468468
469469 TransparentOn ();
@@ -3460,11 +3460,13 @@ void DrawSmoke3DColorMap(void){
34603460
34613461 glBegin (GL_QUADS );
34623462 for (i = 0 ; i < 255 ; i ++ ){
3463+ float * rgb ;
34633464
34643465 ybot = (float )i /255.0 ;
34653466 ytop = (float )(i + 1 )/255.0 ;
34663467
3467- glColor4fv (rgb_slicesmokecolormap_01 + 4 * i );
3468+ rgb = rgb_slicesmokecolormap_01 + 4 * i ;
3469+ glColor4fv (rgb );
34683470 glVertex3f (yleft , 0.0 , ybot );
34693471 glVertex3f (yright , 0.0 , ybot );
34703472 glVertex3f (yright , 0.0 , ytop );
0 commit comments