🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11485

Re: FastGraphics on Non-Intuition RastPort

#11485
From: Chuck McManis
Date: Thu, 16 Feb 1989 20:54
57 lines
2225 bytes
I forgot to mention how you would make the bitmap structure with 
preinitialized data, I do it like this :

/* Data definitions for a "gunsight" type graphic */
struct BitMap	bm;
/*
 * This must be in CHIP memory, if you don't have the chip
 * keyword then compile it separately with a switch to force it
 * there. 
 */
chip UWORD ImageStuff[15] = {
	0xf01e, 		/* XXXX       XXXX */
	0x8002, 		/* X             X */
	0x8002, 		/* X             X */
	0x8002, 		/* X             X */
	0x0100, 		/*        X        */
	0x0100,			/*        X        */
	0x0100,                 /*        X        */
	0x0fe0,			/*     XXXXXXX     */
	0x0100, 		/*        X        */
	0x0100,			/*        X        */
	0x0100,                 /*        X        */
	0x8002, 		/* X             X */
	0x8002, 		/* X             X */
	0x8002, 		/* X             X */
	0xf01e	 		/* XXXX       XXXX */
	};


/* meanwhile in the code somewhere */

	InitBitMap(&bm, 15, 15, N);
	/* N is the depth of your RastPort */
	bm.Planes[0] = (PLANEPTR) ImageStuff;
	for (i = 1; i < N; i++) {
		bm.Planes[i] = (PLANEPTR) AllocRaster(15,15);
		if (!(bm.Planes[i])) 
			ProcessError(NOMEMORY);
	}

	/* ... Later that same day ... */
	/*  BltBitMapRastPort
            (srcbm,srcx,srcy,destrp,destX,destY,sizeX,sizeY,minterm);
		set the minterm to reflect the draw mode 
	*/ 

	MINTERM = MyRPort->minterms[0]; /* Use the rastports current mode */
	BltBitMapRastPort(&bm, 0, 0, MyRPort, X, Y, 15, 15, MINTERM);

	
	..etc remember to free up the image planes allocated above before
	exiting.


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
Technical Details
Message-ID: <90129@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!amdcad!sun!pepper!cmcmanis
References: <841@wpi.wpi.edu> <90124@sun.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!amdcad!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga.tech
Subject: Re: FastGraphics on Non-Intuition RastPort
Message-ID: <90129@sun.uucp>
Date: 16 Feb 89 20:54:04 GMT
References: <841@wpi.wpi.edu> <90124@sun.uucp>
Sender: news@sun.uucp
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Organization: Sun Microsystems, Mountain View
Lines: 57