avoid c99 extensions
This commit is contained in:
parent
4fc1f5f949
commit
ec41125f3b
1 changed files with 15 additions and 4 deletions
|
|
@ -12,13 +12,25 @@ typedef struct Vert{
|
||||||
|
|
||||||
int nocubes;
|
int nocubes;
|
||||||
int ncolor;
|
int ncolor;
|
||||||
Quaternion q;
|
Quaternion q = {1.,0.,0.,0.};
|
||||||
Image *image;
|
Image *image;
|
||||||
Image *bg;
|
Image *bg;
|
||||||
Image *color[256];
|
Image *color[256];
|
||||||
Rectangle viewrect;
|
Rectangle viewrect;
|
||||||
int prevsel;
|
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
|
int
|
||||||
cmp(Vert *a, Vert *b)
|
cmp(Vert *a, Vert *b)
|
||||||
{
|
{
|
||||||
|
|
@ -62,8 +74,8 @@ colorspace(RGB *cmap, Vert *v)
|
||||||
view = pushmat(0);
|
view = pushmat(0);
|
||||||
viewport(view, viewrect, 1.);
|
viewport(view, viewrect, 1.);
|
||||||
persp(view, 30., 3., 7.);
|
persp(view, 30., 3., 7.);
|
||||||
look(view, (Point3){0., 0., -5., 1.}, (Point3){0., 0., 0., 1.},
|
look(view, p3(0., 0., -5., 1.), p3(0., 0., 0., 1.),
|
||||||
(Point3){0., 1., 0., 1.});
|
p3(0., 1., 0., 1.));
|
||||||
qrot(view, q);
|
qrot(view, q);
|
||||||
for(i=0;i!=ncolor;i++)
|
for(i=0;i!=ncolor;i++)
|
||||||
v[i].screen = xformpointd(v[i].world, 0, view);
|
v[i].screen = xformpointd(v[i].world, 0, view);
|
||||||
|
|
@ -184,7 +196,6 @@ void main(int argc, char **argv){
|
||||||
}else
|
}else
|
||||||
bg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, bgcol);
|
bg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, bgcol);
|
||||||
|
|
||||||
q=(Quaternion){1.,0.,0.,0.};
|
|
||||||
einit(Emouse);
|
einit(Emouse);
|
||||||
eresized(0);
|
eresized(0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue