@@ -780,13 +780,13 @@ void processPrim_Poly(int primType, sPrimitive* ptr, char** out)
780780 }
781781}
782782
783- void processPrim_Point (int primType, sPrimitive * ptr, char ** out)
783+ void processPrim_Point (primTypeEnum primType, sPrimitive * ptr, char ** out)
784784{
785785 primEntryStruct* pCurrentPrimEntry = &primTable[positionInPrimEntry];
786786
787787 ASSERT (positionInPrimEntry < NUM_MAX_PRIM_ENTRY);
788788
789- pCurrentPrimEntry->type = primTypeEnum_Point ;
789+ pCurrentPrimEntry->type = primType ;
790790 pCurrentPrimEntry->numOfVertices = 1 ;
791791 pCurrentPrimEntry->color = ptr->m_color ;
792792 pCurrentPrimEntry->material = ptr->m_material ;
@@ -849,53 +849,6 @@ void processPrim_Sphere(int primType, sPrimitive* ptr, char** out)
849849 }
850850}
851851
852- void processPrim_Point (int primType, char ** ptr, char ** out) // point
853- {
854- u8 pointColor;
855- u16 pointIndex;
856- float depth = 32000 .f ;
857- primEntryStruct* pCurrentPrimEntry = &primTable[positionInPrimEntry];
858-
859- (*ptr)++;
860- pointColor = **ptr;
861- (*ptr)++;
862- (*ptr)++;
863-
864- switch (primType)
865- {
866- case primTypeEnum_Point:
867- pCurrentPrimEntry->type = primTypeEnum_Point;
868- break ;
869- case primTypeEnum_BigPoint:
870- pCurrentPrimEntry->type = primTypeEnum_BigPoint;
871- break ;
872- case primTypeEnum_Zixel:
873- pCurrentPrimEntry->type = primTypeEnum_Zixel;
874- break ;
875- default :
876- assert (0 );
877- break ;
878- }
879- pCurrentPrimEntry->type = primTypeEnum_Point;
880- pCurrentPrimEntry->color = pointColor;
881-
882- pointIndex = *(u16 *)(*ptr);
883- (*ptr)+=2 ;
884-
885- ASSERT ((pointIndex%2 ) == 0 );
886-
887- pCurrentPrimEntry->vertices [0 ].X = renderPointList[pointIndex/2 ];
888- pCurrentPrimEntry->vertices [0 ].Y = renderPointList[(pointIndex/2 )+1 ];
889- depth = pCurrentPrimEntry->vertices [0 ].Z = renderPointList[(pointIndex/2 )+2 ];
890-
891- if (depth > 0 )
892- {
893- positionInPrimEntry++;
894- numOfPrimitiveToRender++;
895- ASSERT (positionInPrimEntry < NUM_MAX_PRIM_ENTRY);
896- }
897- }
898-
899852void primType5 (int primType, char ** ptr, char ** out) // draw out of hardClip
900853{
901854 printf (" ignoring prim type 5\n " );
@@ -961,29 +914,22 @@ void renderPoly(primEntryStruct* pEntry) // poly
961914
962915void renderZixel (primEntryStruct* pEntry) // point
963916{
964- float transformedSize;
965-
966- transformedSize = ((5 .f * (float )cameraFovX) / (float )(pEntry->vertices [0 ].Z +cameraPerspective));
917+ float pointSize = 20 .f ;
918+ float transformedSize = ((pointSize * (float )cameraFovX) / (float )(pEntry->vertices [0 ].Z +cameraPerspective));
967919
968920 osystem_drawPoint (pEntry->vertices [0 ].X ,pEntry->vertices [0 ].Y ,pEntry->vertices [0 ].Z ,pEntry->color ,transformedSize);
969921}
970922
971923void renderPoint (primEntryStruct* pEntry) // point
972924{
973- float transformedSize;
974-
975- transformedSize = ((1 .f * (float )cameraFovX) / (float )(pEntry->vertices [0 ].Z +cameraPerspective));
976-
977- osystem_drawPoint (pEntry->vertices [0 ].X ,pEntry->vertices [0 ].Y ,pEntry->vertices [0 ].Z ,pEntry->color , transformedSize);
925+ float pointSize = 0 .3f ; // TODO: better way to compute that?
926+ osystem_drawPoint (pEntry->vertices [0 ].X ,pEntry->vertices [0 ].Y ,pEntry->vertices [0 ].Z ,pEntry->color , pointSize);
978927}
979928
980929void renderBigPoint (primEntryStruct* pEntry) // point
981930{
982- float transformedSize;
983-
984- transformedSize = ((2 .f * (float )cameraFovX) / (float )(pEntry->vertices [0 ].Z +cameraPerspective));
985-
986- osystem_drawPoint (pEntry->vertices [0 ].X ,pEntry->vertices [0 ].Y ,pEntry->vertices [0 ].Z ,pEntry->color , transformedSize);
931+ float bigPointSize = 2 .f ; // TODO: better way to compute that?
932+ osystem_drawPoint (pEntry->vertices [0 ].X ,pEntry->vertices [0 ].Y ,pEntry->vertices [0 ].Z ,pEntry->color , bigPointSize);
987933}
988934
989935void renderSphere (primEntryStruct* pEntry) // sphere
@@ -1008,6 +954,8 @@ renderFunction renderFunctions[]={
1008954 renderPoly, // poly
1009955 renderPoint, // point
1010956 renderSphere, // sphere
957+ nullptr ,
958+ nullptr ,
1011959 renderBigPoint,
1012960 renderZixel,
1013961};
@@ -1093,7 +1041,7 @@ int AffObjet(int x,int y,int z,int alpha,int beta,int gamma,void* modelPtr)
10931041 for (i=0 ;i<numPrim;i++)
10941042 {
10951043 sPrimitive * pPrimitive = &pBody->m_primitives [i];
1096- u8 primType = pPrimitive->m_type ;
1044+ primTypeEnum primType = pPrimitive->m_type ;
10971045
10981046 switch (primType)
10991047 {
0 commit comments