#include "3d.h"





void main(int argc,char *argv[]) {
struct newobj *DemoObject;
int zmod=50;
int n;
if (argc!=2) {
printf("Don't do that. Use DEMO file-to-watch\n");
return;
}
ordscreen();			/*Set up the screenmode and load the standard*/
				/*palette.*/
DemoObject=loadobj(argv[1]);    /*Load the Object*/
if (DemoObject==NULL) {
textscreen();                             /*Return to dos if anything goes*/
printf("File %s doesn't exist\n",argv[1]);/*wrong. Restore screen mode*/
return;
}
for (n=0;n!=200;n++) {
//DemoObject->pos.z+=zmod;
if ((DemoObject->pos.z+=zmod)>4000)/*Move object in Z-direction*/
zmod=-50;
if (DemoObject->pos.z<800)
zmod=50;
DemoObject->rot.y+=10; /*Rotate the object*/
DemoObject->rot.z+=5;
rotobj(DemoObject);    /*Do the rotation*/
DrawObject(DemoObject);/*Add DemoObject to the Drawlist*/
DrawThemAll();         /*Draw everything*/
flippage();            /*And show on the screen by page-flipping*/
}
textscreen();
printf("Thanks you for trying this program\n");
}

