This commit is contained in:
Felix Wallin 2010-09-18 09:52:14 +02:00
parent fa099338bb
commit 99ae022d55
5 changed files with 112 additions and 112 deletions

View File

@ -2121,7 +2121,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
return NULL;
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
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;
}
if(c[4]>SAVE_VERSION)

View File

@ -2162,7 +2162,7 @@ int search_ui(pixel *vid_buf)
fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255);
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);
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
strcaturl(uri, search_ids[mp]);
@ -2384,18 +2384,18 @@ int search_ui(pixel *vid_buf)
thlen = 4;
}
thumb_cache_add(img_id[i], thumb, thlen);
for(pos=0; pos<GRID_X*GRID_Y; pos++){
if(search_dates[pos]){
for(pos=0; pos<GRID_X*GRID_Y; pos++) {
if(search_dates[pos]) {
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
strcpy(id_d_temp, search_ids[pos]);
strappend(id_d_temp, "_");
strappend(id_d_temp, search_dates[pos]);
//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;
}
} else {
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])){
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])) {
break;
}
}
@ -2424,7 +2424,7 @@ int search_ui(pixel *vid_buf)
}
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);
uri = malloc(strlen(search_ids[pos])*3+strlen(search_dates[pos])*3+strlen(SERVER)+71);
strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID=");

10
main.c
View File

@ -393,7 +393,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
return 1;
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
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;
}
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(ver>=42) {
if(new_format){
if(new_format) {
ttv = (d[p++])<<8;
ttv |= (d[p++]);
parts[i-1].temp = ttv;
@ -614,7 +614,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
else
{
p++;
if(new_format){
if(new_format) {
p++;
}
}
@ -1253,7 +1253,7 @@ int main(int argc, char *argv[])
{
set_cmode(6);
}
if(sdl_key==SDLK_LEFTBRACKET){
if(sdl_key==SDLK_LEFTBRACKET) {
if(sdl_zoom_trig==1)
{
ZSIZE -= 1;
@ -1275,7 +1275,7 @@ int main(int argc, char *argv[])
bs = 0;
}
}
if(sdl_key==SDLK_RIGHTBRACKET){
if(sdl_key==SDLK_RIGHTBRACKET) {
if(sdl_zoom_trig==1)
{
ZSIZE += 1;

View File

@ -937,12 +937,12 @@ void update_particles_i(pixel *vid, int start, int inc)
}
else if(t==PT_COAL)
{
if(parts[i].life<=0){
if(parts[i].life<=0) {
t = PT_NONE;
kill_part(i);
create_part(-1, x, y, PT_FIRE);
goto killed;
} else if(parts[i].life < 100){
} else if(parts[i].life < 100) {
parts[i].life--;
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;
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;
}
}