IncludeBinary

Just starting out? Need help? Post your questions and find answers here.
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 Pupil.
Can I use the "labels" MyMapIndex: and MyMapData:
as pointers to the start of that information?
Yes, use address_index.l=?MyMapIndex and address_data.l=?MyMapData to get the address of your included data.
There are commands to do this part of my project, but I cannot seem to find any to directly access the binary data in memory other than the peek and poke commands.
I'm afraid that Peek, Poke and CopyMemory are the only availible commands(that i know of) to directly alter/read memory contents.
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.

You can use a pointer associated with a structure to access the data much easely. Say you have a map file with is a succession of strutured objects:

Structure MapObject
x.l
y.l
etc...
EndStructure

*MyPointer.MapObject = ?MapData
x = *MyPointer\x
y = *MyPointer\y
etc...
*MyPointer+SizeOf(MapObject) ; Got to the next 'object'



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 MrVainSCL.

Hi! Nice example! Is is possible to Decode() sound, sprites i.e. too on this way until we have standard Decode() commands? Thanks in advance :wink:

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
Post Reply