ok.. here is another weird problem Im getting. Im probably juts doing things wrong.
At the start of the program I loadimage('filename') into a Tpixmap.
I have a shield type which has an TImage field which I use LoadImage ( pixmap, DYNAMICIMAGE ) to populate it in the New() method.
When a shot hits the shield I then do a LockImage to a pixmap. I write some blank pixels then unlock it.
The problem is very odd. I hit the first shield a few times and all is as it should be.
Then when I move across and hit the next shield this shield now appears to contain all the damage from the first image plus the damage just inflicted.
As so on on all the shields.
Its as if the lockimage always locks the original image.
As a final resort I changed the code so instead of the loadimage(pixmap) for each shield type i used loadimage('filename') and now everything works perfectly.
Am I just doing it wrong or is this a bug of some sort ?
I just wanted to load the image once then use a copy of it for each shield.
Im sorry if the explanation is confusing. When I get some time I can try to reduce the code into a simple example.
At the start of the program I loadimage('filename') into a Tpixmap.
I have a shield type which has an TImage field which I use LoadImage ( pixmap, DYNAMICIMAGE ) to populate it in the New() method.
When a shot hits the shield I then do a LockImage to a pixmap. I write some blank pixels then unlock it.
The problem is very odd. I hit the first shield a few times and all is as it should be.
Then when I move across and hit the next shield this shield now appears to contain all the damage from the first image plus the damage just inflicted.
As so on on all the shields.
Its as if the lockimage always locks the original image.
As a final resort I changed the code so instead of the loadimage(pixmap) for each shield type i used loadimage('filename') and now everything works perfectly.
Am I just doing it wrong or is this a bug of some sort ?
I just wanted to load the image once then use a copy of it for each shield.
Im sorry if the explanation is confusing. When I get some time I can try to reduce the code into a simple example.