diff options
| author | Jacob1 <jfu614@gmail.com> | 2012-03-15 01:03:00 (GMT) |
|---|---|---|
| committer | Jacob1 <jfu614@gmail.com> | 2012-03-15 01:03:00 (GMT) |
| commit | 51c8dfcef4b3c44826fe16b12b6b825daaea1efe (patch) | |
| tree | fd69209c96373d80b30cd54a86cc71a3bf33e5f1 /src | |
| parent | a27d97124cb985c5e064547e55b401bbb7ec01a1 (diff) | |
| download | powder-51c8dfcef4b3c44826fe16b12b6b825daaea1efe.zip powder-51c8dfcef4b3c44826fe16b12b6b825daaea1efe.tar.gz | |
ngrav/amb. heat quickoptions, amb. heat drawn in heat display when on, fix render_ui position
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 19 | ||||
| -rw-r--r-- | src/interface.c | 15 | ||||
| -rw-r--r-- | src/main.c | 2 |
3 files changed, 27 insertions, 9 deletions
diff --git a/src/graphics.c b/src/graphics.c index 080cb2a..cf5a760 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1314,14 +1314,19 @@ void draw_air(pixel *vid) clamp_flt(pv[y][x], 0.0f, 8.0f),//pressure adds green clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue } - else if (display_mode & DISPLAY_AIRH) + else if ((display_mode & DISPLAY_AIRH)) { - float ttemp = hv[y][x]+(-MIN_TEMP); - int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3); - c = PIXRGB((int)((unsigned char)color_data[caddress]*0.7f), (int)((unsigned char)color_data[caddress+1]*0.7f), (int)((unsigned char)color_data[caddress+2]*0.7f)); - //c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red - // clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green - // clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue + if (aheat_enable) + { + float ttemp = hv[y][x]+(-MIN_TEMP); + int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3); + c = PIXRGB((int)((unsigned char)color_data[caddress]*0.7f), (int)((unsigned char)color_data[caddress+1]*0.7f), (int)((unsigned char)color_data[caddress+2]*0.7f)); + //c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red + // clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green + // clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue + } + else + c = PIXRGB(0,0,0); } else if (display_mode & DISPLAY_AIRC) { diff --git a/src/interface.c b/src/interface.c index 4badd0c..eede146 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2621,7 +2621,15 @@ void quickoptions_menu(pixel *vid_buf, int b, int bq, int x, int y) quickoptions_tooltip_y = (i*16)+5; if(b && !bq) { - *(quickmenu[i].variable) = !(*(quickmenu[i].variable)); + if (!strcmp(quickmenu[i].name,"Newtonian gravity")) + { + if(!ngrav_enable) + start_grav_async(); + else + stop_grav_async(); + } + else + *(quickmenu[i].variable) = !(*(quickmenu[i].variable)); } } } @@ -2886,6 +2894,11 @@ void set_cmode(int cm) // sets to given view mode { colour_mode = COLOUR_HEAT; strcpy(itc_msg, "Heat Display"); + free(display_modes); + display_modes = calloc(2, sizeof(unsigned int)); + display_mode |= DISPLAY_AIRH; + display_modes[0] = DISPLAY_AIRH; + display_modes[1] = 0; } else if (cmode==CM_FANCY) { @@ -2227,7 +2227,7 @@ int main(int argc, char *argv[]) } if (x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { - render_ui(vid_buf, XRES+BARSIZE-(510-491), YRES+(MENUSIZE-19), 3); + render_ui(vid_buf, XRES+BARSIZE-(510-491), YRES-2, 3); } if (x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq) sys_pause = !sys_pause; |
