Ejemplo n.º 1
0
//
// D_ArbitrateNetStart
//
void D_ArbitrateNetStart (void)
{
    int		i;
    boolean	gotinfo[MAXNETNODES];
	
    autostart = true;
    memset (gotinfo,0,sizeof(gotinfo));
	
    if (doomcom->consoleplayer)
    {
	// listen for setup info from key player
	printf ("listening for network start info...\n");
	while (1)
	{
	    CheckAbort ();
	    if (!HGetPacket ())
		continue;
	    if (netbuffer->checksum & NCMD_SETUP)
	    {
		if (netbuffer->player != VERSION)
		    I_Error ("Different DOOM versions cannot play a net game!");
		startskill = netbuffer->retransmitfrom & 15;
		deathmatch = (netbuffer->retransmitfrom & 0xc0) >> 6;
		nomonsters = (netbuffer->retransmitfrom & 0x20) > 0;
		respawnparm = (netbuffer->retransmitfrom & 0x10) > 0;
		startmap = netbuffer->starttic & 0x3f;
		startepisode = netbuffer->starttic >> 6;
		return;
	    }
	}
    }
void
avtSIMODataTreeIterator::Execute(avtDataTree_p inDT, avtDataTree_p &outDT)
{
    CheckAbort();

    if (*inDT == NULL)
    {
        return;
    }

    int nc = inDT->GetNChildren();

    if (nc <= 0 && !inDT->HasData())
    {
        return;
    }

    if (nc == 0)
    {
        SIMOWorkItem *work = new SIMOWorkItem;
        work->This  = this;
        work->inDT  = inDT;
        work->outDT = outDT;
 
        if( *outDT )
        {
            // Schedule the work to be done.
            avtExecutionManagerScheduleWork(ExecuteDataTreeOnThread, (void *)work);
        }
        else
        {
            // There is only one dataset to process, so do it now.
            outDT = new avtDataTree();
            work->outDT = outDT;
            ExecuteDataTreeOnThread(work);
        }
    }
    else
    {
        //
        // there is more than one input dataset to process
        // and we need an output datatree for each
        //
        avtDataTree_p *localOutDT = new avtDataTree_p[nc];
        for (int j = 0; j < nc; j++)
        {
            if (inDT->ChildIsPresent(j))
            {
                localOutDT[j].SetReference( new avtDataTree );
                Execute(inDT->GetChild(j), localOutDT[j]);
            }
            else
            {
                localOutDT[j] = NULL;
            }
        }
        outDT = new avtDataTree(nc, localOutDT);
        delete [] localOutDT;
    }
}
Ejemplo n.º 3
0
static void 
CompositeArea(XParms xp, Parms p, int64_t reps, Picture src, Picture dst)
{
    int i, size;
    XSegment *sa, *sb;
    XSegment *sa2, *sb2;
    

    size = p->special;
    sa = segsa;
    sb = segsb;
    sa2 = segsa2 ? segsa2 : segsa;
    sb2 = segsb2 ? segsb2 : segsb;
    for (i = 0; i < reps; i++) {
	XRenderComposite (xp->d, xp->func,
			  src, None, dst,
			  sa2->x1, sa2->y1, 0, 0, sa->x2, sa->y2, size, size);
	XRenderComposite (xp->d, xp->func,
			  src, None, dst,
			  sa2->x2, sa2->y2, 0, 0, sa->x1, sa->y1, size, size);
	XRenderComposite (xp->d, xp->func,
			  src, None, dst,
			  sb2->x2, sb2->y2, 0, 0, sb->x1, sb->y1, size, size);
	XRenderComposite (xp->d, xp->func,
			  src, None, dst,
			  sb2->x1, sb2->y1, 0, 0, sb->x2, sb->y2, size, size);
	CheckAbort ();
	sa++; sb++;
	sa2++; sb2++;
    }
}
DFUEngine::Result DFURequestsCOM::AutomaticActiveBCSP(bool link)
{
	DFUEngine::Result result = DFUEngine::fail_com_connect;

	// Try all of the available baud rates
	for (BaudRateList *pos = impl_->baud;
	     !result && pos; pos = pos->next)
	{
		// Check for an abort request
		result = CheckAbort();
		if (!result) return result;

		// Attempt a connection at this baud rate
		int baudRate = pos->baud;
		Progress(link ? DFUEngine::transport_bcsp_active_le : DFUEngine::transport_bcsp_no_le, baudRate);
		result = impl_->transport.ConnectBCSP(impl_->port, baudRate, link, false, impl_->com);
		if (result)
		{
			result = TestPrivateChannel();
			if (!result)
			{
				// Try tunnelling if appropriate
				if (result.GetCode() == DFUEngine::fail_com_timeout_tx)
				{
					// Give a more sensible error if failed
					result = DFUEngine::fail_com_connect;
				}
				else if ((impl_->protocol == protocol_unknown)
					     || (impl_->protocol == protocol_bcsp_tunnel))
				{
					// Try again with tunnelling
		            result = impl_->transport.ConnectBCSP(impl_->port, baudRate, link, true, impl_->com);
                    if ( result )
                        result = TestPrivateChannel();

					// Store the protocol if successful
					if (result) impl_->protocol = protocol_bcsp_tunnel;
				}
			}

		}

		// Store the baud rate and link establishment if successful
		if (result)
		{
			FreeBaudRateList(impl_->baud);
			impl_->baud = new BaudRateList;
			impl_->baud->next = 0;
			impl_->baud->baud = baudRate;
			impl_->sync = link ? sync_passive : sync_disabled;
		}
	}

	// Return the result
	return result;
}
Ejemplo n.º 5
0
void 
DoNoOp(XParms xp, Parms p, int64_t reps)
{
    int     i;

    for (i = 0; i != reps; i++) {
	XNoOp(xp->d);
	CheckAbort ();
    }
}
void
avtDataObjectSource::UpdateProgress(int current, int total, const char *typ,
                                    const char *descr)
{
    CheckAbort();
    if (progressCallback != NULL)
    {
        progressCallback(progressCallbackArgs, typ, descr, current, total);
    }
}
Ejemplo n.º 7
0
bool PluginBase::checkAbort( bool doAbort /*= false*/)
{
	bool abort = CheckAbort( this );

	if( abort && doAbort )
	{
		throw XMP_Error( kXMPErr_UserAbort, "User abort" );
	}

	return abort;
}
Ejemplo n.º 8
0
void 
DoCircWindows(XParms xp, Parms p, int reps)
{
    int     i, j;

    for (i = 0; i != reps; i++)
    {
	for (j = 0; j != p->objects; j++)
	    XCirculateSubwindows (xp->d, xp->w, RaiseLowest);
	CheckAbort ();
    }
}
Ejemplo n.º 9
0
void 
DoGetAtom(XParms xp, Parms p, int64_t reps)
{
    char    *atom;
    int     i;

    for (i = 0; i != reps; i++) {
	atom = XGetAtomName (xp->d, 1);
 	XFree(atom); /* fix XBUG 6480 */
	CheckAbort ();
    }
}
Ejemplo n.º 10
0
void 
DoQueryPointer(XParms xp, Parms p, int64_t reps)
{
    int     i;
    Window  w;
    int     x;
    unsigned int m;

    for (i = 0; i != reps; i++) {
	XQueryPointer (xp->d, xp->w, &w, &w, &x, &x, &x, &x, &m);
	CheckAbort ();
    }
}
Ejemplo n.º 11
0
Archivo: do_dots.c Proyecto: aosm/X11
void 
DoDots(XParms xp, Parms p, int reps)
{
    int     i;

    for (i = 0; i != reps; i++) {
        XDrawPoints(xp->d, xp->w, pgc, points, p->objects, CoordModeOrigin);
        if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}
Ejemplo n.º 12
0
long AtMegaBus::Write(int addr, UBYTE const *data, long length)
{
	long len;

	if (addr || write_page_size <= 1)
	{	//EEprom of flash without page write
		len = At90sBus::Write(addr, data, length);		//Use standard routine
	}
	else
	{	//Flash Eprom with page write
		for (addr = 0, len = 0; len < length; addr += write_page_size, data += write_page_size, len += write_page_size)
		{
			//check for FF's page to skip blank pages
			if ( !CheckBlankPage(data, write_page_size) )
				WriteProgPage(addr, data, write_page_size);

			if ( CheckAbort(len * 100 / length) )
				break;
		}
		CheckAbort(100);
	}

	return len;
}
Ejemplo n.º 13
0
void 
DoTriangles(XParms xp, Parms p, int reps)
{
    int     i, j;
    XPoint  *curPoint;

    for (i = 0; i != reps; i++) {
        XPolyTriangle (xp->d, xp->w, pgc, points, p->objects, Convex, 
			 CoordModeOrigin);
        if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}
Ejemplo n.º 14
0
void 
DoMoveTree(XParms xp, Parms p, int reps)
{
    int     i;

    for (i = 0; i != reps; i++) {
	x_offset += 1;
	y_offset += 3;
	if (y_offset + ymax > HEIGHT)
	    y_offset = 0;
	if (x_offset + xmax > WIDTH)
	    x_offset = 0;
	XMoveWindow(xp->d, cover, x_offset, y_offset);
	CheckAbort ();
    }
}
Ejemplo n.º 15
0
void 
DoResizeWindows(XParms xp, Parms p, int reps)
{
    int     i, j, delta2;

    for (i = 0; i != reps; i++) {
	delta1 = -delta1;
	delta2 = delta1;
	for (j = 0; j != p->objects; j++) {
	    delta2 = -delta2;
	    XResizeWindow(xp->d, children[j],
		CHILDSIZE+delta2, CHILDSIZE-delta2);
	}
	CheckAbort ();
    }
}
Ejemplo n.º 16
0
SegmentMerger::SegmentMerger(IndexWriter* writer, const char* name, MergePolicy::OneMerge* merge){
//Func - Constructor
//Pre  - dir holds a valid reference to a Directory
//       name != NULL
//Post - Instance has been created

  CND_PRECONDITION(name != NULL, "name is NULL");

  this->init();
  this->directory		   = writer->getDirectory();
  this->segment        = name;
  if (merge != NULL)
    this->checkAbort = _CLNEW CheckAbort(merge, directory);
  this->termIndexInterval= writer->getTermIndexInterval();
  this->mergedDocs = 0;
  this->maxSkipLevels = 0;
}
Ejemplo n.º 17
0
Archivo: do_arcs.c Proyecto: aosm/X11
void 
DoFilledArcs(XParms xp, Parms p, int reps)
{
    int i;

    for (i = 0; i != reps; i++) {
        XFillArcs(xp->d, xp->w, pgc, arcs, p->objects);
        if (pgc == xp->ddbggc)
            pgc = xp->ddfggc;
        else if(pgc == xp->ddfggc)
            pgc = xp->ddbggc;
        else if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}
Ejemplo n.º 18
0
void 
DoSegments(XParms xp, Parms p, int reps)
{
    int i;

    for (i = 0; i != reps; i++) {
        XDrawSegments(xp->d, xp->w, pgc, segments, p->objects);
        if (pgc == xp->ddbggc)
            pgc = xp->ddfggc;
        else if(pgc == xp->ddfggc)
            pgc = xp->ddbggc;
        else if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}
Ejemplo n.º 19
0
static void 
CopyArea(XParms xp, Parms p, int reps, Drawable src, Drawable dst)
{
    int i, size;
    XSegment *sa, *sb;

    size = p->special;
    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
	XCopyArea(xp->d, src, dst, xp->fggc,
	    sa->x1, sa->y1, size, size, sa->x2, sa->y2);
	XCopyArea(xp->d, src, dst, xp->fggc,
	    sa->x2, sa->y2, size, size, sa->x1, sa->y1);
	XCopyArea(xp->d, src, dst, xp->fggc,
	    sb->x2, sb->y2, size, size, sb->x1, sb->y1);
	XCopyArea(xp->d, src, dst, xp->fggc,
	    sb->x1, sb->y1, size, size, sb->x2, sb->y2);
	CheckAbort ();
    }
}
Ejemplo n.º 20
0
void
DoShmPutImage(XParms xp, Parms p, int reps)
{
    int i, size;
    XSegment *sa, *sb;

    size = p->special;
    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
	XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
	    sa->x1, sa->y1, sa->x2, sa->y2, size, size, False);
	XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
	    sa->x2, sa->y2, sa->x1, sa->y1, size, size, False);
	XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
	    sb->x2, sb->y2, sb->x2, sb->y2, size, size, False);
	XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
	    sb->x1, sb->y1, sb->x2, sb->y2, size, size, False);
	CheckAbort ();
    }
}
Ejemplo n.º 21
0
void 
DoGetProperty(XParms xp, Parms p, int64_t reps)
{
    int     i;
    int     actual_format;
    unsigned long actual_length, bytes_remaining;
    unsigned char *prop;
    
    Atom actual_type;

    for (i = 0; i != reps; i++) {
	XGetWindowProperty (
		xp->d, xp->w, XA_PK_TEMP, 0, 4,
		False, AnyPropertyType, &actual_type, &actual_format,
		&actual_length, &bytes_remaining, &prop);
	CheckAbort ();
	XFree(prop);
    }
}
Ejemplo n.º 22
0
void 
DoCopyPlane(XParms xp, Parms p, int reps)
{
    int		i, size;
    XSegment    *sa, *sb;

    size = p->special;
    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
	XCopyPlane(xp->d, pix, xp->w, xp->fggc,
	    sa->x1, sa->y1, size, size, sa->x2, sa->y2, 1);
	XCopyPlane(xp->d, pix, xp->w, xp->fggc,
	    sa->x2, sa->y2, size, size, sa->x1, sa->y1, 1);
	XCopyPlane(xp->d, pix, xp->w, xp->fggc,
	    sb->x2, sb->y2, size, size, sb->x1, sb->y1, 1);
	XCopyPlane(xp->d, pix, xp->w, xp->fggc,
	    sb->x1, sb->y1, size, size, sb->x2, sb->y2, 1);
	CheckAbort ();
    }
}
Ejemplo n.º 23
0
void 
DoMoveWindows(XParms xp, Parms p, int reps)
{
    int     i, j;

    for (i = 0; i != reps; i++) {
	x_offset += 1;
	y_offset += 3;
	if (y_offset + ymax > HEIGHT)
	    y_offset = 0;
	if (x_offset + xmax > WIDTH)
	    x_offset = 0;
	for (j = 0; j != p->objects; j++) {
	    XMoveWindow(xp->d, children[j],
	    positions[j].x + x_offset, positions[j].y + y_offset);
	}
	CheckAbort ();
    }
}
Ejemplo n.º 24
0
void
DoShmGetImage(XParms xp, Parms p, int reps)
{
    int i, size;
    XSegment *sa, *sb;

    size = p->special;

    shm_image.width = size;
    shm_image.height = size;

    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
	/* compute offsets into image data? */
	XShmGetImage(xp->d, xp->w, &shm_image, sa->x1, sa->y1, xp->planemask);
	XShmGetImage(xp->d, xp->w, &shm_image, sa->x2, sa->y2, xp->planemask);
	XShmGetImage(xp->d, xp->w, &shm_image, sb->x2, sb->y2, xp->planemask);
	XShmGetImage(xp->d, xp->w, &shm_image, sb->x1, sb->y1, xp->planemask);
	CheckAbort ();
    }
}
Ejemplo n.º 25
0
Archivo: do_traps.c Proyecto: aosm/X11
void 
DoTrapezoids(XParms xp, Parms p, int reps)
{
    int     i, j;
    XPoint  *curPoint;

    for (i = 0; i != reps; i++) {
        curPoint = points;
        for (j = 0; j != p->objects; j++) {
            XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Convex, 
			 CoordModeOrigin);
            curPoint += NUM_POINTS;
	}
        if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}
DFUEngine::Result DFURequestsCOM::AutomaticH4()
{
	DFUEngine::Result result = DFUEngine::fail_com_connect;

	// Try all of the available baud rates
	for (BaudRateList *pos = impl_->baud;
	     !result && pos; pos = pos->next)
	{
		// Check for an abort request
		result = CheckAbort();
		if (!result) return result;

		// Attempt a connection at this baud rate
		int baudRate = pos->baud;
		Progress(DFUEngine::transport_h4, baudRate);
		result = impl_->transport.ConnectH4(impl_->port, baudRate, impl_->com);
		if (result)
		{
			result = TestPrivateChannel();
			if (!result) result = impl_->transport.HCIReset();
			if ((result.GetCode() == DFUEngine::fail_com_timeout_rx)
				|| (result.GetCode() == DFUEngine::fail_com_fail))
			{
				result = DFUEngine::fail_com_connect;
			}
		}

		// Store the baud rate and protocol if successful
		if (result)
		{
			FreeBaudRateList(impl_->baud);
			impl_->baud = new BaudRateList;
			impl_->baud->next = NULL;
			impl_->baud->baud = baudRate;
			impl_->protocol = protocol_h4;
		}
	}

	// Return the result
	return result;
}
Ejemplo n.º 27
0
Archivo: do_traps.c Proyecto: aosm/X11
void 
DoFixedTrapezoids(XParms xp, Parms p, int reps)
{
    int		i;
    Picture	white, black, src, dst;

    white = XftDrawSrcPicture (aadraw, &aawhite);
    black = XftDrawSrcPicture (aadraw, &aablack);
    dst = XftDrawPicture (aadraw);

    src = black;
    for (i = 0; i != reps; i++) {
	XRenderCompositeTrapezoids (xp->d, PictOpOver, src, dst, maskFormat,
				    0, 0, traps, p->objects);
        if (src == black)
	    src = white;
        else
            src = black;
	CheckAbort ();
    }
}
Ejemplo n.º 28
0
void 
DoGetImage(XParms xp, Parms p, int reps)
{
    int i, size;
    XSegment *sa, *sb;
    int format;

    size = p->special;
    format = (p->font == NULL) ? ZPixmap : XYPixmap;
    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
	XDestroyImage(image);
	image = XGetImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
	    xp->planemask, format);
	if (image) XDestroyImage(image);
	image = XGetImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
	    xp->planemask, format);
	if (image) XDestroyImage(image);
	image = XGetImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
	    xp->planemask, format);
	if (image) XDestroyImage(image);
	image = XGetImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
	    xp->planemask, format);
/*

One might expect XGetSubImage to be slightly faster than XGetImage.  Go look
at the code in Xlib.  MIT X11R3 ran approximately 30 times slower for a 500x500
rectangle.

	(void) XGetSubImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
	    xp->planemask, ZPixmap, image, sa->x2, sa->y2);
	(void) XGetSubImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
	    xp->planemask, ZPixmap, image, sa->x1, sa->y1);
	(void) XGetSubImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
	    xp->planemask, ZPixmap, image, sb->x2, sb->y2);
	(void) XGetSubImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
	    xp->planemask, ZPixmap, image, sb->x2, sb->y2);
*/
	CheckAbort ();
    }
}
Ejemplo n.º 29
0
void 
DoScroll(XParms xp, Parms p, int reps)
{
    int i, size, x, y, xorg, yorg, delta;

    size = p->special;
    xorg = 0;   yorg = 0;
    x    = 0;   y    = 0;
    if (xp->version == VERSION1_2) {
	delta = 1;
    } else {
	/* Version 1.2 only scrolled up by 1 scanline, which made hardware
	   using page-mode access to VRAM look better on paper than it would
	   perform in a more realistic scroll.  So we've changed to scroll by
	   the height of the 6x13 fonts. */
	delta = 13;
    }

    for (i = 0; i != reps; i++) {
	XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta,
	    size, size, x, y);
	y += size;
	if (y + size + delta > HEIGHT) {
	    yorg += delta;
	    if (yorg >= size || yorg + size + delta > HEIGHT) {
		yorg = 0;
		xorg++;
		if (xorg >= size || xorg + size > WIDTH) {
		    xorg = 0;
		}
	    }
	    y = yorg;
	    x += size;
	    if (x + size > WIDTH) {
		x = xorg;
	    }
	}
	CheckAbort ();
    }
}
Ejemplo n.º 30
0
void 
DoGeneralPoly(XParms xp, Parms p, int reps)
{
    int     i, j;
    int	    nsides;
    int	    mode;
    XPoint  *curPoint;

    nsides = (long) p->font;
    mode = (long) p->bfont;
    for (i = 0; i != reps; i++) {
        curPoint = points;
        for (j = 0; j != p->objects; j++) {
            XFillPolygon(xp->d, xp->w, pgc, curPoint, nsides, mode, 
			 CoordModeOrigin);
            curPoint += nsides;
	  }
        if (pgc == xp->bggc)
            pgc = xp->fggc;
        else
            pgc = xp->bggc;
	CheckAbort ();
    }
}