Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [d56be134d2]:

To Artifact [57df01a3fa]:


676
677
678
679
680
681
682


















683
684
685
686
687
688
689
      }
      while(sz>0 && x<128) {
        x=fgetc(fp);
        fgetc(fp);
        sz-=2;
      }
      break;


















    default:
      fprintf(stderr,"Unrecognized command in dependent picture (%d)\n",c);
      goto done;
  }
  if(sz<-1) fprintf(stderr,"Lump size of dependent picture is too short\n");
  done: sqlite3_finalize(st);
}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
      }
      while(sz>0 && x<128) {
        x=fgetc(fp);
        fgetc(fp);
        sz-=2;
      }
      break;
    case 16: // Hue/shade
      fread(buf,1,2,fp);
      c=(Sint8)buf[1];
      sz-=2;
      SDL_LockSurface(picts);
      p=picts->pixels+((img&15)+picts->pitch*(img>>4))*picture_size;
      for(y=0;y<picture_size;y++) {
        for(x=0;x<picture_size;x++) {
          if(p[x] && p[x]<=225) {
            i=(p[x]-1)%15+c;
            p[x]=15*(((p[x]-1)/15+buf[0])%15)+1;
            if(i<0) p[x]=1; else if(i>14) p[x]=15; else p[x]+=i;
          }
        }
        p+=picts->pitch;
      }
      SDL_UnlockSurface(picts);
      break;
    default:
      fprintf(stderr,"Unrecognized command in dependent picture (%d)\n",c);
      goto done;
  }
  if(sz<-1) fprintf(stderr,"Lump size of dependent picture is too short\n");
  done: sqlite3_finalize(st);
}