astyle
This commit is contained in:
parent
fa099338bb
commit
99ae022d55
@ -2121,7 +2121,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
|||||||
return NULL;
|
return NULL;
|
||||||
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
|
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
|
||||||
return NULL;
|
return NULL;
|
||||||
if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66){
|
if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) {
|
||||||
new_format = 1;
|
new_format = 1;
|
||||||
}
|
}
|
||||||
if(c[4]>SAVE_VERSION)
|
if(c[4]>SAVE_VERSION)
|
||||||
|
12
interface.c
12
interface.c
@ -2162,7 +2162,7 @@ int search_ui(pixel *vid_buf)
|
|||||||
fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255);
|
fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255);
|
||||||
info_box(vid_buf, "Loading...");
|
info_box(vid_buf, "Loading...");
|
||||||
|
|
||||||
if(search_dates[mp]){
|
if(search_dates[mp]) {
|
||||||
uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71);
|
uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71);
|
||||||
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
|
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
|
||||||
strcaturl(uri, search_ids[mp]);
|
strcaturl(uri, search_ids[mp]);
|
||||||
@ -2384,18 +2384,18 @@ int search_ui(pixel *vid_buf)
|
|||||||
thlen = 4;
|
thlen = 4;
|
||||||
}
|
}
|
||||||
thumb_cache_add(img_id[i], thumb, thlen);
|
thumb_cache_add(img_id[i], thumb, thlen);
|
||||||
for(pos=0; pos<GRID_X*GRID_Y; pos++){
|
for(pos=0; pos<GRID_X*GRID_Y; pos++) {
|
||||||
if(search_dates[pos]){
|
if(search_dates[pos]) {
|
||||||
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
|
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
|
||||||
strcpy(id_d_temp, search_ids[pos]);
|
strcpy(id_d_temp, search_ids[pos]);
|
||||||
strappend(id_d_temp, "_");
|
strappend(id_d_temp, "_");
|
||||||
strappend(id_d_temp, search_dates[pos]);
|
strappend(id_d_temp, search_dates[pos]);
|
||||||
//img_id[i] = mystrdup(id_d_temp);
|
//img_id[i] = mystrdup(id_d_temp);
|
||||||
if(id_d_temp && !strcmp(id_d_temp, img_id[i])){
|
if(id_d_temp && !strcmp(id_d_temp, img_id[i])) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])){
|
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2424,7 +2424,7 @@ int search_ui(pixel *vid_buf)
|
|||||||
}
|
}
|
||||||
if(pos<GRID_X*GRID_Y)
|
if(pos<GRID_X*GRID_Y)
|
||||||
{
|
{
|
||||||
if(search_dates[pos]){
|
if(search_dates[pos]) {
|
||||||
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
|
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
|
||||||
uri = malloc(strlen(search_ids[pos])*3+strlen(search_dates[pos])*3+strlen(SERVER)+71);
|
uri = malloc(strlen(search_ids[pos])*3+strlen(search_dates[pos])*3+strlen(SERVER)+71);
|
||||||
strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID=");
|
strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID=");
|
||||||
|
10
main.c
10
main.c
@ -393,7 +393,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
|||||||
return 1;
|
return 1;
|
||||||
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
|
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
|
||||||
return 1;
|
return 1;
|
||||||
if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50){
|
if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50) {
|
||||||
new_format = 1;
|
new_format = 1;
|
||||||
}
|
}
|
||||||
if(c[4]>SAVE_VERSION)
|
if(c[4]>SAVE_VERSION)
|
||||||
@ -600,7 +600,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
|||||||
if(i <= NPART)
|
if(i <= NPART)
|
||||||
{
|
{
|
||||||
if(ver>=42) {
|
if(ver>=42) {
|
||||||
if(new_format){
|
if(new_format) {
|
||||||
ttv = (d[p++])<<8;
|
ttv = (d[p++])<<8;
|
||||||
ttv |= (d[p++]);
|
ttv |= (d[p++]);
|
||||||
parts[i-1].temp = ttv;
|
parts[i-1].temp = ttv;
|
||||||
@ -614,7 +614,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
p++;
|
p++;
|
||||||
if(new_format){
|
if(new_format) {
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1253,7 +1253,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
set_cmode(6);
|
set_cmode(6);
|
||||||
}
|
}
|
||||||
if(sdl_key==SDLK_LEFTBRACKET){
|
if(sdl_key==SDLK_LEFTBRACKET) {
|
||||||
if(sdl_zoom_trig==1)
|
if(sdl_zoom_trig==1)
|
||||||
{
|
{
|
||||||
ZSIZE -= 1;
|
ZSIZE -= 1;
|
||||||
@ -1275,7 +1275,7 @@ int main(int argc, char *argv[])
|
|||||||
bs = 0;
|
bs = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(sdl_key==SDLK_RIGHTBRACKET){
|
if(sdl_key==SDLK_RIGHTBRACKET) {
|
||||||
if(sdl_zoom_trig==1)
|
if(sdl_zoom_trig==1)
|
||||||
{
|
{
|
||||||
ZSIZE += 1;
|
ZSIZE += 1;
|
||||||
|
6
powder.c
6
powder.c
@ -937,12 +937,12 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
}
|
}
|
||||||
else if(t==PT_COAL)
|
else if(t==PT_COAL)
|
||||||
{
|
{
|
||||||
if(parts[i].life<=0){
|
if(parts[i].life<=0) {
|
||||||
t = PT_NONE;
|
t = PT_NONE;
|
||||||
kill_part(i);
|
kill_part(i);
|
||||||
create_part(-1, x, y, PT_FIRE);
|
create_part(-1, x, y, PT_FIRE);
|
||||||
goto killed;
|
goto killed;
|
||||||
} else if(parts[i].life < 100){
|
} else if(parts[i].life < 100) {
|
||||||
parts[i].life--;
|
parts[i].life--;
|
||||||
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE);
|
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE);
|
||||||
}
|
}
|
||||||
@ -957,7 +957,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
continue;
|
continue;
|
||||||
if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
|
if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
|
||||||
{
|
{
|
||||||
if(parts[i].life>100){
|
if(parts[i].life>100) {
|
||||||
parts[i].life = 99;
|
parts[i].life = 99;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user