ssf giving me a error?

mrkotfw

Mid Boss
Heres my code.
Code:
#include "sgl.h"

POINT point_PLANE1[] = {

    POStoFIXED(-15.0, -15.0, -15.0), // x 1

    POStoFIXED(-15.0, -15.0, 15.0), // x 2

    POStoFIXED(-15.0, 15.0, -15.0), // x 3

    POStoFIXED(-15.0, 15.0, 15.0), // x 4

    POStoFIXED( 15.0, -15.0, -15.0), // x 5

    POStoFIXED( 15.0, -15.0, 15.0) // x 6

	};

POLYGON polygon_PLANE1[] = {

	NORMAL(0.0,0.0,-1.0),VERTICES(0,1,2,3),	// x 1 front

	NORMAL(0.0,0.0,1.0),VERTICES(4,5,6,7),	// x 2 back

	NORMAL(-1.0,0.0,0.0),VERTICES(1,2,6,7),	// x 3 right side

	NORMAL(1.0,0.0,0.0),VERTICES(0,3,5,4),	// x 4 left side

	NORMAL(0.0,-1.0,0.0),VERTICES(3,2,5,6),	// x 5 bottom

	NORMAL(0.0,1.0,0.0),VERTICES(0,1,4,7)	// x 6 top

	};

ATTR attribute_PLANE1[] = {

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(0,8,14),No_Gouraud,MESHoff,sprPolygon,UseLight),	// x 1 front

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(31,0,0),No_Gouraud,MESHoff,sprPolygon,UseLight), // x 2 back

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(0,8,14),No_Gouraud,MESHoff,sprPolygon,UseLight), // x 3 right side

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(31,0,0),No_Gouraud,MESHoff,sprPolygon,UseLight),	// x 4 left side

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(0,8,14),No_Gouraud,MESHoff,sprPolygon,UseLight),	// x 5 bottom

    ATTRIBUTE(Dual_Plane,SORT_CEN,No_Texture,C_RGB(31,0,0),No_Gouraud,MESHoff,sprPolygon,UseLight)	// x 6 top

	};

PDATA PD_PLANE1 = {

    point_PLANE1,sizeof(point_PLANE1)/sizeof(POINT),

    polygon_PLANE1,sizeof(polygon_PLANE1)/sizeof(POLYGON),

    attribute_PLANE1

	};

	void ss_main() {

	static ANGLE ang[XYZ];

	static FIXED pos[XYZ];

	static FIXED light[XYZ];

	ang[X]=DEGtoANG(30.0);

	ang[Y]=DEGtoANG(45.0);

	ang[Z]=DEGtoANG( 0.0);

	pos[X]=toFIXED( 0.0);

	pos[Y]=toFIXED( 0.0);

	pos[Z]=toFIXED(190.0);

	slInitSystem(TV_320x224,NULL,1);

	// slSetLanguage(SMPC_ESPANOL);

	slCurColor(16);

	slPrint("sample demo hecho por: israel jacques",slLocate(9,2));

	while(1) {

 slPushUnitMatrix();

 {

 	slRotX(DEGtoANG(15.0));

 	slRotY(DEGtoANG(15.0));

 	slRotZ(DEGtoANG(15.0));

 	slCalcPoint(toFIXED(0.0),toFIXED(0.0),toFIXED(1.0),light);

 }

 	slPopMatrix();

 	slLight(light);

 }

 slPushMatrix();

 {

 	slTranslate(ang[X],ang[Y],ang[Z]);

 	slRotX(ang[X]);

 	slRotY(ang[Y]);

 	slRotZ(ang[Z]);

 	slPutPolygon(&PD_PLANE1);

 }

 	slLight(light);

 	ang[X]+=DEGtoANG(2.0);

 	ang[Y]+=DEGtoANG(2.0);

 	ang[Z]+=DEGtoANG(2.0);

 	slZoomR(2,2);

 	ang[X]-=DEGtoANG(3.0);

 	ang[Y]-=DEGtoANG(3.0);

 	ang[Z]-=DEGtoANG(3.0);

  slPopMatrix();

  slSynch();

 	}

it compiles good, but then ssf runs it, then gives me a error. does anyone know why?
 
Yeah... the 3D abilities of SSF are very bad, so it provably is of no use for polygon display. Use Satourne ou GiriGiri, since they carry a slight more advanced VDP emulation.
 
in SGL :

Code:
void slZoomR(FIXED scaleX, FIXED scaleY);

You should try to modify the slZoomR line in your code:

Code:
...

ang[Y]+=DEGtoANG(2.0);

ang[Z]+=DEGtoANG(2.0);

slZoomR(toFIXED(2.0),toFIXED(2,0));

ang[X]-=DEGtoANG(3.0);

ang[Y]-=DEGtoANG(3.0);

...

I hope this will help (might not, though. However, you should pay attention to these conversions)
 
Top