/[gzz]/gzz/gfx/libtexture/irregu.texture
ViewVC logotype

Diff of /gzz/gfx/libtexture/irregu.texture

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by jvk, Wed Nov 13 15:58:38 2002 UTC revision 1.18 by jvk, Thu Nov 14 10:48:51 2002 UTC
# Line 24  float filter(float *data, int w, int h, Line 24  float filter(float *data, int w, int h,
24          data[(ix1 + w * iy1) * c] * fx * fy;          data[(ix1 + w * iy1) * c] * fx * fy;
25  }  }
26    
27    void tr(char *s, char a, char b) {
28        while ((s = strchr(s, a)) != 0) *s = b;
29    }
30    
31  void GENERATE(TextureParam *params, int width, int height, int depth, int components, float *data) {  void GENERATE(TextureParam *params, int width, int height, int depth, int components, float *data) {
32      FPARAM(bias, 0);      FPARAM(bias, 0);
33      FPARAM(scale, 1);      FPARAM(scale, 1);
# Line 57  void GENERATE(TextureParam *params, int Line 61  void GENERATE(TextureParam *params, int
61      float xstep = 1.0 / width;      float xstep = 1.0 / width;
62      float ystep = 1.0 / height;      float ystep = 1.0 / height;
63    
64        const char *texture = params->getString("texture", "sawnoise");
65        char *texparams = strdup(params->getString("params",
66                "bias,0.5,scale,0.15,freq,1,df,2,scale2,0.25,freq2,10,df2,.5"));
67    
68        tr(texparams, ',', ' ');
69    
70      {      {
71          char s[1000];          char s[1000];
72          sprintf(s, "gfx/libtexture/%s %d %d %d %d %s",          sprintf(s, "gfx/libtexture/%s.bin %d %d %d %d %s",
73                  params->getString("texture", "sawnoise.bin"),                  texture,
74                  width, height, depth, 4,                  width, height, depth, 4,
75                  params->getString("params", "bias 0.5 scale 0.15 freq 1 df 2 scale2 0.25 freq2 10 df2 .5"));                      texparams);    
76          fprintf(stderr, "popen: %s", s);          fprintf(stderr, "popen: %s", s);
77                    
78          // XXX SECURITY          // XXX SECURITY

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26