diff options
author | rsc <devnull@localhost> | 2005-01-19 16:48:25 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-19 16:48:25 +0000 |
commit | ec41125f3b5e0e8d46516fa5ba5b684a3a88a880 (patch) | |
tree | 64d3259d55fe5ae9df5d926f8a728a7d1e6c8971 /src/cmd/draw | |
parent | 4fc1f5f949d9a8f33b948c3339c798b6bad2270f (diff) | |
download | plan9port-ec41125f3b5e0e8d46516fa5ba5b684a3a88a880.tar.gz plan9port-ec41125f3b5e0e8d46516fa5ba5b684a3a88a880.tar.bz2 plan9port-ec41125f3b5e0e8d46516fa5ba5b684a3a88a880.zip |
avoid c99 extensions
Diffstat (limited to 'src/cmd/draw')
-rw-r--r-- | src/cmd/draw/cmapcube.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/cmd/draw/cmapcube.c b/src/cmd/draw/cmapcube.c index a7f4d928..3d0e14e8 100644 --- a/src/cmd/draw/cmapcube.c +++ b/src/cmd/draw/cmapcube.c @@ -12,13 +12,25 @@ typedef struct Vert{ int nocubes; int ncolor; -Quaternion q; +Quaternion q = {1.,0.,0.,0.}; Image *image; Image *bg; Image *color[256]; Rectangle viewrect; int prevsel; +Point3 +p3(double x, double y, double z, double w) +{ + Point3 p; + + p.x = x; + p.y = y; + p.z = z; + p.w = w; + return p; +} + int cmp(Vert *a, Vert *b) { @@ -62,8 +74,8 @@ colorspace(RGB *cmap, Vert *v) view = pushmat(0); viewport(view, viewrect, 1.); persp(view, 30., 3., 7.); - look(view, (Point3){0., 0., -5., 1.}, (Point3){0., 0., 0., 1.}, - (Point3){0., 1., 0., 1.}); + look(view, p3(0., 0., -5., 1.), p3(0., 0., 0., 1.), + p3(0., 1., 0., 1.)); qrot(view, q); for(i=0;i!=ncolor;i++) v[i].screen = xformpointd(v[i].world, 0, view); @@ -184,7 +196,6 @@ void main(int argc, char **argv){ }else bg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, bgcol); - q=(Quaternion){1.,0.,0.,0.}; einit(Emouse); eresized(0); |