Pointer to Bitmap

Advanced game related topics
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Schlowski.

Hello again,

I began to write my own pixel-perfect collision detection (and then I saw Freds anouncement ). But as I make this for my own, pure fun, I want to continue my work.

My problem is that I don't have any idea how I get access to the real bitmap in a sprite, so for the moment I made my own 'collision masks' which are raw 8bit per pixel data streams.

But it would be nicer to use the loaded sprites so I don't have to make a mask for every sprite I use.

Has anyone (Fred ) an idea how to get a pointer to the sprite bitmap?

For the interested, I make the brutal force approach, allocating memory in size of the screen and putting bytes in for every set pixel in my masks and querying these bytes for collision detection. Echa sprite gets his own id in the range from 1 to 255, so I can directly determine with which sprite my object collides.

This seemed to me the right approach for detection collisions between hundreds of blocks and tons of balls (right, I'm writing on a breakout-clone, simple but addicting) opposed to checking every ball with every block which can grow to a large number of compares...

Björg
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Hi Schlowski,
maybe you can get a hint on:

http://www.12move.de/home/frankabbing/

this guy is doing a great job with his free ProSpeed.dll (written in asm - over 130 functions)

He has a documentation for his dll and maybe there are also some useful ideas in it.
Or mail him your question (you can do it in german ) I'm sure he is willing to share his experience how to do such a thing.
Hope this helps a bit.


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Schlowski.

Hi Franco,

thanks for this, I will try it!

Schlowski (aka Björg)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.


Just wait a little bit, v3.0 will bring this ability, thanks the forthcoming Danilo COM/DirectX DLL support ! Yep, all ActiveX and DX power will be available directly under PB with ease :)

Bye,

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Schlowski.

Just wait a little bit, v3.0 will bring this ability, thanks the forthcoming Danilo COM/DirectX DLL support ! Yep, all ActiveX and DX power will be available directly under PB with ease :)

Bye,

Fred - AlphaSND
Yeah!!
But now the waiting time gets harder and harder
Post Reply