This code is dumb

Daniel Eriksson

New Member
Yeah, I know im a nOOb... i have programmed (well, some programming, some cut and paste) a saturn program that should display a polygon. But when i try to compile it it says :

main.c:67: syntax error before '}'

Ive tried to debug this a long time now. Please help me. Here is the code :

Code:
#include "sgl.h"

POINT point_Model00[] = {

POStoFIXED(-50.0000,-50.0000,-50.0000),

POStoFIXED( 50.0000,-50.0000,-50.0000),

POStoFIXED( 50.0000, 50.0000,-50.0000),

POStoFIXED(-50.0000, 50.0000,-50.0000),

POStoFIXED(-50.0000,-50.0000, 50.0000),

POStoFIXED( 50.0000,-50.0000, 50.0000),

POStoFIXED( 50.0000, 50.0000, 50.0000),

POStoFIXED(-50.0000, 50.0000, 50.0000),

};

POLYGON polygon_Model00[] = {

NORMAL( 0.0000, 0.0000, -1.0000), VERTICES( 0, 1, 2, 3),

NORMAL( 1.0000, 0.0000, 0.0000), VERTICES( 1, 5, 6, 2),

NORMAL( 0.0000, 0.0000, 1.0000), VERTICES( 5, 4, 7, 6),

NORMAL( -1.0000, 0.0000, 0.0000), VERTICES( 4, 0, 3, 7),

NORMAL( 0.0000, -1.0000, 0.0000), VERTICES( 0, 4, 5, 1),

NORMAL( 0.0000, 1.0000, 0.0000), VERTICES( 2, 6, 7, 3),

};

ATTR attribute_Model00[] = {

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

ATTRIBUTE(Single_Plane, SORT_CEN, No_Texture, C_RGB( 0,31, 0), No_Gouraud, CL32KRGB|MESHoff, sprPolygon, UseLight),

};

XPDATA xpdata_Model00[] = {

point_Model00, sizeof(point_Model00)/sizeof(POINT),

polygon_Model00, sizeof(polygon_Model00)/sizeof(POLYGON),

attribute_Model00,

NULL,

};

OBJECT object_Model00[] = {

(PDATA*)xpdata_Model00,

TRANSLATION( 0.0000, 0.0000, 0.0000),

ROTATION( 0.0000, 0.0000, 0.0000),

SCALING( 1.0000, 1.0000, 1.0000),

NULL,

NULL,

};

void ss_main(void)

{

static ANGLE ang[XYZ];

static FIXED pos[XYZ];

static FIXED light[XYZ];

slInitSystem(TV_320x224, NULL, 1);

ang[X]=ang[Y]=DEGtoANG(30.0);

ang[Z]=DEGtoANG(60.0);

pos[X]=toFIXED(0.0);

pos[Y]=toFIXED(0.0);

pos[Z]=toFIXED(220.0);

light[X]=toFIXED(0.0);

light[Y]=light[Z]=toFIXED(-60.0);

}

}

slPrint("Saturn Demo Coding Contest June 2003", slLocate(1,1));

void sleepuntilbutton (Uint32 frames)

{

 while (frames > 0)

   {

   SlSynch();

   if (Smpc_Peripheral[0].data && PER_DGT_TX) return;

   frames--

   }

}
 

TakaIsSilly

New Member
Code:
void ss_main(void)

{

static ANGLE ang[XYZ];

static FIXED pos[XYZ];

static FIXED light[XYZ];

slInitSystem(TV_320x224, NULL, 1);

ang[X]=ang[Y]=DEGtoANG(30.0);

ang[Z]=DEGtoANG(60.0);

pos[X]=toFIXED(0.0);

pos[Y]=toFIXED(0.0);

pos[Z]=toFIXED(220.0);

light[X]=toFIXED(0.0);

light[Y]=light[Z]=toFIXED(-60.0);

// }  These tags are wrong here, delete them.

// }

slPrint("Saturn Demo Coding Contest June 2003", slLocate(1,1));

// You'll need some kind of loop here

 while(1){

 slSynch()

 }

}

void sleepuntilbutton (Uint32 frames)

{

 while (frames > 0)

  {

  SlSynch();

  if (Smpc_Peripheral[0].data && PER_DGT_TX) return;

  frames--

  }

}
 
Top