static bool tdfxFillTriangle2D( void *drv, void *dev, DFBTriangle *tri ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; tdfx_waitfifo( tdrv, tdev, 7 ); dfb_sort_triangle( tri ); voodoo2D->srcXY = ((tri->y1 & 0x1FFF) << 16) | (tri->x1 & 0x1FFF); voodoo2D->command = 8 | (1 << 8) | (0xCC << 24); if (tri->x2 < tri->x3) { voodoo2D->launchArea[0] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); voodoo2D->launchArea[1] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); voodoo2D->launchArea[2] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); } else { voodoo2D->launchArea[0] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); voodoo2D->launchArea[1] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); voodoo2D->launchArea[2] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); } return true; }
static bool tdfxFillTriangle3D( void *drv, void *dev, DFBTriangle *tri ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo3D *voodoo3D = tdrv->voodoo3D; tdfx_waitfifo( tdrv, tdev, 7 ); dfb_sort_triangle( tri ); voodoo3D->vertexAx = S12_4(tri->x1); voodoo3D->vertexAy = S12_4(tri->y1); voodoo3D->vertexBx = S12_4(tri->x2); voodoo3D->vertexBy = S12_4(tri->y2); voodoo3D->vertexCx = S12_4(tri->x3); voodoo3D->vertexCy = S12_4(tri->y3); voodoo3D->triangleCMD = (1 << 31); voodoo3D->triangleCMD = 0; return true; }
static bool i810FillTriangle( void *drv, void *dev, DFBTriangle *tri) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; bool err = true; dfb_sort_triangle(tri); if (tri->y3 - tri->y1 > 0) err = i810fill_tri(tri, i810drv, i810dev); return err; }