예제 #1
0
파일: 3d-clip.c 프로젝트: argasek/morphine
static __regargs void ClipEdge(Point3D *o, Point3D *s, Point3D *e, UWORD plane)
{
  WORD dx = e->x - s->x;
  WORD dy = e->y - s->y;
  WORD dz = e->z - s->z;

#if 0
  if (plane & PF_LEFT) {
    WORD n = s->z - s->x;
    WORD d = dx - dz;

    o->x = e->x + div16(dx * n, d);
    o->y = e->y + div16(dy * n, d);
    o->z = e->z + div16(dz * n, d);
  } else if (plane & PF_RIGHT) {
  } else if (plane & PF_TOP) {
  } else if (plane & PF_BOTTOM) {
  }
#endif
  if (plane & PF_NEAR) {
    WORD n = ClipFrustum.near - s->z;

    o->x = s->x + div16(dx * n, dz);
    o->y = s->y + div16(dy * n, dz);
    o->z = ClipFrustum.near;
  } else if (plane & PF_FAR) {
    WORD n = ClipFrustum.far - s->z;

    o->x = s->x + div16(dx * n, dz);
    o->y = s->y + div16(dy * n, dz);
    o->z = ClipFrustum.far;
  }
}
예제 #2
0
static inline BOOL ReadTrack(APTR data, LONG offset) {
  FloppyTrackRead(div16(offset, TD_TRACK));
  FloppyTrackDecode(data);
  return TRUE;
}
int main(int argc,char* argv[]){
	int x = atoi(argv[1]);
	printf("%d\n",div16(x));
}