Jump to content
  • Advertisement
Sign in to follow this  
Maverick Programmer

Saving bitmaps under another extension

This topic is 4252 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Most of you already know that you can save your midi under another extension: title.mid -> title.mus After doing this, your midi loader can still play it: Music.play("title.mus"); My question is this: Can you also do the same thing with bitmaps? If you can save it under another extension, will the bitmap loader (Assuming you have used NeHe's OpenGL game structure) still load it like the midi player so it can still play its midis? I hope you understand my question, and alongside that, I hope this Topic is in the right forums. Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Hi,

Can't say I've tried it, but you could modify the loader, to strip the last 4 chars (the period and the extension)

"./aFolder/myBitmap.PCN" --- becomes --- "./aFolder/myBitmap"

And just apply .BMP to your file name before you do anything with it. ;-)

"./aFolder/myBitmap" --- becomes --- "./aFolder/myBitmap.BMP"

Share this post


Link to post
Share on other sites
The extension doesn't matter. You find out what type of file it is by examining the header-like part of any file. Filename extensions are mostly for human convinience, it doesn't really mean anything. The bitmap will still contain the same data under the new extension.

The bitmap loader might check the extension, and then return false if it doesn't have bitmap attached to it... or it might try to append .bmp to the file name, if it's missing, just hand edit that part out.

Share this post


Link to post
Share on other sites
Of course, the only real reason to change the extension of the file is if you plan to change the format at some stage. Otherwise it just acts as a hindrance, as you can't open the file in Photoshop by just double-clicking it anymore.

If you're trying to implement this as a method to stop people from stealing your work, you might as well not bother. People will figure it out quick smart (Renaming files is normally the first method a lot of people try), and there's really no point in protecting your assets unless you have a legally binding contract that says you must.

So the basic rule is: Don't change the extensions, it'll just bring you more hassle in the long run, trust me. ;)

Share this post


Link to post
Share on other sites
Thanks for answering my question. It has helped. So, how can you protect your bitmaps? I dont want to add EVERYTHING in my resources or it will pile up. Also, fortuanately, no one on my forums has figured out to rename files yet.

Thanks,
~PCN

Share this post


Link to post
Share on other sites
Hi,

This can difficult to do. This is by no means a solution, but you should be thinking along the lines of:

Circumventing ANY screen capture program in the final release. This includes the print screen button. Don't want to stop this of course when you are taken screen shots of your latest and greatest release to show off ;).

Encrypt image resources using some kind of cyper. These will then need to be decrypted as they are loaded into your game/demo.

MAMEman.

Share this post


Link to post
Share on other sites
Quote:
Original post by mameman
Hi,

This can difficult to do. This is by no means a solution, but you should be thinking along the lines of:

Circumventing ANY screen capture program in the final release. This includes the print screen button. Don't want to stop this of course when you are taken screen shots of your latest and greatest release to show off ;).

Encrypt image resources using some kind of cyper. These will then need to be decrypted as they are loaded into your game/demo.

MAMEman.


If resources are worth stealing, then the almost fool-proof method is the equivalent of analog hole - it's always possible to intercept calls to graphics hardware and store that.

Simply put, there is no way to prevent people from using it. What it comes down to is how desirable your art is, will anyone want to steal it in the first place.

- Removing filename/header - the data stream remains intact, as soon as it's identified, it can be reconstructed
- Using proprietary encoding/cypher - it comes down to implementation, at some point your code will need to unpack it into memory, usually into some form of bitmap, this call can be intercepted
- Actively preventing screen capture - you cannot prevent someone capturing data sent to hardware (see Fraps)

- Music - just record the audio, if you have digital output, even better, but analog quality sent to speakers is good enough.

Whichever method you choose, don't let it hurt your code. If whatever protection you use requires you to change your existing game code, then it's almost certainly not worth it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!