diff --git a/includes/powder.h b/includes/powder.h index 86b0967cd..f86f6c10b 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -836,7 +836,7 @@ static wall_type wtypes[] = {PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, "Gravity wall"}, }; -#define CHANNELS ((int)(MAX_TEMP-73.15f)/100+2) +#define CHANNELS ((int)(MAX_TEMP-73)/100+2) particle portalp[CHANNELS][8][80]; const particle emptyparticle; int wireless[CHANNELS][2]; diff --git a/src/console.c b/src/console.c index 3fbcfb6c4..e4551d071 100644 --- a/src/console.c +++ b/src/console.c @@ -1,5 +1,6 @@ #include #include +#include char pyready=1; char pygood=1; diff --git a/src/elements/neut.c b/src/elements/neut.c index 20d46180e..0d12a6ddc 100644 --- a/src/elements/neut.c +++ b/src/elements/neut.c @@ -1,11 +1,7 @@ #include -#if defined(WIN32) && !defined(__GNUC__) -_inline int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t) -#else -inline int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t)//testing a new deut create part -#endif +int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t)//testing a new deut create part { int i, c; n = (n/50); diff --git a/src/elements/soap.c b/src/elements/soap.c index 4ed10ac51..e130e3521 100644 --- a/src/elements/soap.c +++ b/src/elements/soap.c @@ -186,13 +186,13 @@ int update_SOAP(UPDATE_FUNC_ARGS) if ((r&0xFF) == PT_OIL) { + float ax, ay; + parts[i].vy -= 0.1f; parts[i].vy *= 0.5f; parts[i].vx *= 0.5f; - float ax, ay; - ax = (parts[i].vx + parts[r>>8].vx)/2; ay = (parts[i].vy + parts[r>>8].vy)/2; diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 8b1940638..01990f628 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -86,7 +86,7 @@ int update_STKM(UPDATE_FUNC_ARGS) { //Go left r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(player[0])&0x01) == 0x01 && ((r&0xFF>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(player[0])&0x01) == 0x01 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) { if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID && (r&0xFF) != PT_LNTG)) @@ -125,7 +125,7 @@ int update_STKM(UPDATE_FUNC_ARGS) { //Go right r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(player[0])&0x02) == 0x02 && ((r&0xFF>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(player[0])&0x02) == 0x02 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) { if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID && (r&0xFF) != PT_LNTG)) diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c index 32f86195e..a2731a645 100644 --- a/src/elements/stkm2.c +++ b/src/elements/stkm2.c @@ -86,10 +86,10 @@ int update_STKM2(UPDATE_FUNC_ARGS) { //Go left r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(player2[0])&0x01) == 0x01 && ((r&0xFF>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(player2[0])&0x01) == 0x01 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) { - if (r>=PT_NUM || ptypes[r&0xFF].state != ST_LIQUID - && (r&0xFF) != PT_LNTG) + if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID + && (r&0xFF) != PT_LNTG)) { if (pmap[(int)(player2[8]-1)][(int)(player2[7])]) { @@ -125,7 +125,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) { //Go right r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(player2[0])&0x02) == 0x02 && ((r&0xFF>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(player2[0])&0x02) == 0x02 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) { if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID && (r&0xFF) != PT_LNTG)) diff --git a/src/graphics.c b/src/graphics.c index 669086a3f..8d060887a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -172,8 +172,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) { fx = ((float)x)*((float)sw)/((float)rw); fy = ((float)y)*((float)sh)/((float)rh); - fxc = modf(fx, &intp); - fyc = modf(fy, &intp); + fxc = modff(fx, &intp); + fyc = modff(fy, &intp); fxceil = (int)ceil(fx); fyceil = (int)ceil(fy); if (fxceil>=sw) fxceil = sw-1; @@ -212,8 +212,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) { fx = ((float)x)*((float)sw)/((float)rw); fy = ((float)y)*((float)sh)/((float)rh); - fxc = modf(fx, &intp); - fyc = modf(fy, &intp); + fxc = modff(fx, &intp); + fyc = modff(fy, &intp); fxceil = (int)ceil(fx); fyceil = (int)ceil(fy); if (fxceil>=sw) fxceil = sw-1; diff --git a/src/interface.c b/src/interface.c index b26fbaebb..62c196e3b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1628,31 +1628,11 @@ int save_name_ui(pixel *vid_buf) ui_edit_process(mx, my, b, &ed2); ui_checkbox_process(mx, my, b, bq, &cb); - if (b && !bq && ((mx>=x0+9 && mx=y0+22 && my=x0+9 && mx=y0+22 && my=x0 && mx=y0+74+YRES/4 && mytitle) free(info->title); + if (info->name) free(info->name); + if (info->author) free(info->author); + if (info->date) free(info->date); + if (info->description) free(info->description); + if (info->tags) free(info->tags); + for (i=0;i<6;i++) + { + if (info->comments[i]) free(info->comments[i]); + if (info->commentauthors[i]) free(info->commentauthors[i]); + } memset(info, 0, sizeof(save_info)); if (!info_data || !*info_data) diff --git a/src/main.c b/src/main.c index 5a22208b0..ea32d3ab8 100644 --- a/src/main.c +++ b/src/main.c @@ -1378,7 +1378,7 @@ int set_scale(int scale, int kiosk){ return 1; } -void update_grav_async() +void* update_grav_async(void* unused) { int done = 0; int thread_done = 0; @@ -2044,7 +2044,7 @@ int main(int argc, char *argv[]) free(load_data); } } - if (sdl_key=='s' && (sdl_mod & (KMOD_CTRL)) || (sdl_key=='s' && !isplayer2)) + if (sdl_key=='s' && ((sdl_mod & (KMOD_CTRL)) || !isplayer2)) { if (it > 50) it = 50; @@ -2178,7 +2178,7 @@ int main(int argc, char *argv[]) bsy = 0; } } - if (sdl_key=='d'&&(sdl_mod & (KMOD_CTRL)) || (sdl_key=='d' && !isplayer2)) + if (sdl_key=='d' && ((sdl_mod & (KMOD_CTRL)) || !isplayer2)) DEBUG_MODE = !DEBUG_MODE; if (sdl_key=='i') { diff --git a/src/misc.c b/src/misc.c index 2c84baf97..cf0bd7c8c 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "misc.h" #include "defines.h" #include "interface.h"