diff --git a/includes/air.h b/includes/air.h index 4b167a315..821d9fbb0 100644 --- a/includes/air.h +++ b/includes/air.h @@ -21,12 +21,16 @@ extern float cb_pv[YRES/CELL][XRES/CELL], cb_opv[YRES/CELL][XRES/CELL]; extern float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL]; +extern float hv[YRES/CELL][XRES/CELL], ohv[YRES/CELL][XRES/CELL]; // Ambient Heat + extern float kernel[9]; void make_kernel(void); +void update_airh(void); + void update_grav(void); void update_air(void); -#endif \ No newline at end of file +#endif diff --git a/includes/defines.h b/includes/defines.h index 953ef3ded..5a9de0d34 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -79,6 +79,7 @@ extern unsigned char ZSIZE; #define SQUARE_BRUSH 1 #define BRUSH_NUM 2 +//#define LUACONSOLE //#define PYCONSOLE //#define PYEXT //no longer needed @@ -126,6 +127,7 @@ extern int legacy_enable; extern int ngrav_enable; //Newtonian gravity extern int sound_enable; extern int kiosk_enable; +extern int aheat_enable; extern int decorations_enable; extern int sys_pause; diff --git a/src/air.c b/src/air.c index 76c6fee34..63eaa4908 100644 --- a/src/air.c +++ b/src/air.c @@ -23,6 +23,8 @@ float cb_pv[YRES/CELL][XRES/CELL], cb_opv[YRES/CELL][XRES/CELL]; float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL]; +float hv[YRES/CELL][XRES/CELL], ohv[YRES/CELL][XRES/CELL]; // For Ambient Heat + void make_kernel(void) //used for velocity { int i, j; @@ -38,6 +40,55 @@ void make_kernel(void) //used for velocity for (i=-1; i<2; i++) kernel[(i+1)+3*(j+1)] *= s; } +void update_airh(void) +{ + int x, y, i, j; + float dh, dp, f, tx, ty; + for (i=0; i0 && y+j0 && x+i(rand()%250)) { + if (aheat_enable) + { + if (hv[y/CELL][x/CELL] < parts[i].temp) + { + hv[y/CELL][x/CELL] = hv[y/CELL][x/CELL] + parts[i].temp*0.04; + parts[i].temp = parts[i].temp - hv[y/CELL][x/CELL]*0.04; + } + else + { + hv[y/CELL][x/CELL] = hv[y/CELL][x/CELL] - parts[i].temp*0.04; + parts[i].temp = parts[i].temp + hv[y/CELL][x/CELL]*0.04; + } + } for (j=0; j<8; j++) { surround_hconduct[j] = i;