-// Box
-
-#define BANNER_TEXT "reflex"
-#define QUALITY 80
-#define ID_FONT 2000
-#define ID_BANNER 2001
-#define ID_HIGHLIGHT 2002
-#define ID_BUTTON 2003
-#define ID_BITMAP 2004
-#define ID_SHAPE 2005
-
-#define a 200
-int sX[] = { a,-a, a,-a, a,-a, a,-a};
-int sY[] = { a, a,-a,-a, a, a,-a,-a};
-int sZ[] = { a, a, a, a,-a,-a,-a,-a};
-#undef a
-
-int dX[8];
-int dY[8];
-
-int sin_[512],cos_[512];
-
-void calcTables()
-{ int i;
- double d;
- for (i=0;i<512;i++)
- { d = ((double)i)/128*3.14159;
- sin_[i] = (int)(sin(d)*256);
- cos_[i] = (int)(cos(d)*256);
- }
-}
-
-void ShapeSquare(LPTAG t,LPSHAPE s,int p1,int p2,int p3,int p4,int dx,int dy)
-{
- // Hidden-Line-Check
- if (((dX[p2]-dX[p1])*(dY[p3]-dY[p1])-(dX[p3]-dX[p1])*(dY[p2]-dY[p1]))<0) return;
-
- ShapeSetMove(t,s,dX[p1]+dx,dY[p1]+dy);
- ShapeSetLine(t,s,dX[p2]-dX[p1],dY[p2]-dY[p1]);
- ShapeSetLine(t,s,dX[p3]-dX[p2],dY[p3]-dY[p2]);
- ShapeSetLine(t,s,dX[p4]-dX[p3],dY[p4]-dY[p3]);
- ShapeSetLine(t,s,dX[p1]-dX[p4],dY[p1]-dY[p4]);
-}
-
-
-void mapBox(int xw,int yw,int zw)
-{ int i;
- int x1,y1,z1,x2,y2,z2,x3,y3,z3;
- int y,x,z;
-
- xw &= 255;
- yw &= 255;
- zw &= 255;
-
- for (i=0;i<8;i++)
- { x = sX[i];
- y = sY[i];
- z = sZ[i];
-
- y1 = ( y*cos_[xw]- z*sin_[xw])>>8;
- z1 = ( y*sin_[xw]+ z*cos_[xw])>>8;
- x1 = x;
-
- x2 = (x1*cos_[yw]+z1*sin_[yw])>>8;
- y2 = y1;
-
- x3 = (x2*cos_[zw]-y2*sin_[zw])>>8;
- y3 = (x2*sin_[zw]+y2*cos_[zw])>>8;
- z3 = (z1*cos_[yw]-x1*sin_[yw])>>8;
-
- dX[i] = x3*4000/(z3+950);
- dY[i] = y3*4000/(z3+950);
-
- }
-}
-
-
-#define S64 long long
-SFIXED SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2)
-{ S64 a;
- a = (S64)a1*(S64)b1+(S64)a2*(S64)b2;
- return (SFIXED)(a>>16);
-}
-SFIXED QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
-{ S64 z = zaehler<<16;
- S64 a = z/(S64)nenner;
- return (SFIXED)a;
-}
-#undef S64
-
-LPMATRIX MatrixJoin(LPMATRIX d,LPMATRIX s1,LPMATRIX s2)
-{
- if (!d) return NULL;
- if (!s1) return (s2)?(LPMATRIX)memcpy(d,s2,sizeof(MATRIX)):NULL;
- if (!s2) return (LPMATRIX)memcpy(d,s1,sizeof(MATRIX));
-
- d->tx = s1->tx + s2->tx;
- d->ty = s1->ty + s2->ty;
-
- d->sx = SP(s1->sx,s1->r1,s2->sx,s2->r0);
- d->sy = SP(s1->r0,s1->sy,s2->r1,s2->sy);
- d->r0 = SP(s1->r0,s1->sy,s2->sx,s2->r0);
- d->r1 = SP(s1->sx,s1->r1,s2->r1,s2->sy);