From: | |
Date: | 21 Feb 2001 at 01:51:41 |
Subject: | Re: Again clipping graphics output |
Czesc Serge!
Dnia 20-Feb-01, Serge Tumanyan napisa�:
> Here are some parts. This is the init procedure.
> === Cut ===
> static struct Layer * PrepareLayer(struct Layer_Info * LI,
> ULONG XSize,ULONG YSize)
> { struct Layer * Result=NULL;
> struct BitMap * RPBitMap;
>
> if(!(RPBitMap=AllocBitMap(XSize,YSize,8UL,0,NULL)))
> return(NULL);
> if(LI=NewLayerInfo())
Why you're passing LayerInfo pointer to PrepareLayer() function if you're
creating new one? It doesn't make sense...
> if(Result=CreateUpfrontLayer(LI,RPBitMap,0,0,
> XSize-1,YSize-1,LAYERSMART,NNULL))
> { SetDrMd(Result->rp,JAM1);
> return(Result);
> }
> return(NULL);
> }
> === Cut ===
> Then I use the returned result in rendering calls. Something like:
> Move(Layer->rp,x1,y1); And then dispose it.
I'm assuming that your code for disposing layers looks like:
void CleanupLayer( struct Layer *layer )
{
struct BitMap *bitmap;
struct Layer_Info *layerinfo;
if( layer )
{
bitmap = layer->rp->BitMap;
layerinfo = layer->LayerInfo;
WaitBlit();
DeleteLayer( NULL, layer );
FreeBitMap( bitmap );
DisposeLayerInfo( layerinfo );
}
}
It should work... Maybe bug is inside your rendering functions... Please send
attached executable to your betatesters and ask them is everything ok (no
"jerky" pointers etc.)
> I have a good book, concerning this topic, but I don't want to do
> it by hand.
So you know that it's quite easy and it's faster than layers.library...
Regards!
Przemyslaw 'SENSEI' Gruchala
code/gfx2d/gfx3d/webmaster
Amiga 1200
Apollo 1240/33 MHz, 18 MB RAM, BTC 33.6 bps
HDD 3.2 GB, HDD 520 MB, CD x12
------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://us.click.yahoo.com/kWP7PD/pYNCAA/4ihDAA/d8AVlB/TM
---------------------------------------------------------------------_->
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/