The Daily Click ::. Forums ::. Klik Coding Help ::. Accessing binary data
 

Post Reply  Post Oekaki 
 

Posted By Message

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
31st May, 2009 at 15:35:27 -

I've added a couple of bitmap images (textblitter fonts) under the binary data in the Elements List in MMF2, but how do I access them or any binary data file? And are they included in a compiled executable?

Or is that not what the binary data bit is for?

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
31st May, 2009 at 19:19:48 -

good question. ive wondered this too.

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
31st May, 2009 at 20:05:38 -

I've wondered twice but I've never properly asked
Been messing around with it all day. So it turns out if you add a binary file that yes, it gets added to the .exe but it's just accessing that file thats proving problematic now. I've read the MMF readme and had a play around with location functions myself but I just can't get access.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
31st May, 2009 at 20:34:43 -

Suppose you added "D:\font.bmp" to the binary data list. First you have to extract the binary data e.g.:
+Start of frame
-Extract binary file "D:\font.bmp" (it's under Special Conditions - Binary Files)
(the game extracts it to a temporary folder)

Then you're able to use it as an external file. To get the pathname of the extracted external file you use BinFileTempName$()
e.g.:
+Start of frame
-Load image BinFileTempName$("D:\font.bmp")

That's it.

 
This space is for rent

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
31st May, 2009 at 20:40:42 -

Image
Ultra hardcore super thanks Works like a treat!

And I assume once I'm done loading the binary files I just release them? (going off MMF2's help file)

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
31st May, 2009 at 21:04:14 -

amazing < /b>

 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
31st May, 2009 at 22:44:34 -


Originally Posted by Dr. James

Ultra hardcore super thanks Works like a treat!
And I assume once I'm done loading the binary files I just release them? (going off MMF2's help file)


No problem. I kept an eye on the CT forums during updates, because I really wanted that feature too.

I suppose you should release them after loading. Dunno really, but I'm pretty sure the files are deleted too after closing your app.

 
This space is for rent

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
31st May, 2009 at 22:54:26 -

They are, when I was testing around with it before I found the temp folder it made. As soon as its closed all contents are removed. I guess it depends if you want people prying around in your files.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49567

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
1st June, 2009 at 04:53:24 -

I don't know if this is a problem anymore, but you need to make sure that you compile your app as a compressed exe, otherwise the data isn't included.

I haven't tested it in a while so this may be fixed now.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click