HELP!!! Photoshop killing my bitmaps!

Started by
8 comments, last by Gollum 24 years, 3 months ago
Ok, this is bizarre. I am an extreme newbie, and I am working my way through Lamothe''s latest Gurus book. I am up to example 7_10, which loads a bitmap to the screen (a picture of the starship Enterprise). After a couple of weeks of slogging through the book, I am very excited to be putting graphics of any sort on the screen. Imagine my frustration at being stuck now. I tried replacing the name of the bitmap (in 7_10.cpp) with one I had created, and compiled. Didn''t work. I tried a bunch of other things to narrow down the problem, until finally, I tried copying the precompiled executable and the bitmap from the CD to my local drive. I run it, it works fine. Then, I open the bitmap in Photoshop 4.0, save it under the SAME NAME without making ANY changes, and run the executable. It errors out. This is very frustrating. I made no changes to the code or the bitmap. I am assuming (from what little I know of how bitmap files are put together) that Photoshop encodes the bitmap in such a way that Lamothe''s code doesn''t work? But that would be absurd, b/c _everybody_ uses Photoshop. Any help would be greatly appreciated. It''s example 7_10 from Tricks of the Windows Game Programming Gurus. - Chris the distraught newbie
Advertisement
I''ve never used Photoshop or Lamothe''s book, but having said that the first thing I would check is if Photoshop is saving the file as a bitmap (as opposed to another, proprietary, format) and that the bitmap is being saved with the same colour depth as before (e.g. if it was an 8-bit palletized bitmap and you saved it as a 24-bit bmp, the code may realize this and produce an error). Anyhow, hopefully someone who uses the Lamothe book will see your post and help you out. Good luck.
------When thirsty for life, drink whisky. When thirsty for water, add ice.
Oh, yeah, let me be clear:

The file on the cd was bitmap8.bmp (all lowercase).

I opened it in Photoshop 4.0, and it imported its own palette. I then saved it, wihtout changing the name, as a .bmp file, in 8 bit Windows format, without checking the RLE compression box.

:-) Still doesn''t work tho. *sigh*

What do you folks use to create graphics?

-Chris
If your on chapter 7, maybe you could help me with chapter 6 - how do you get the DDURFACEDESC2 variable to register with VC++ - it picks up DDSURFACEDESC, as long as I don;t put the 2 on the end. This is fustrating me now, and I have included all the necessary headers and libraries and put them in the VC++ lookup directories.
Other than that - I can''t help you with your Photoshop problem, because I don''t own it. I''d suggest another test with something like Windows paint - you never know what Photoshop might be doing optimising things...

Cheers,

-Mezz
I use photoshop for my graphics, but I have heard that time to time photoshop fudges up the bmp format.

Try opening it with mspaint and resaving it, this fixes any problems that photoshop introduces.

If you still have the bug then it is something else
Maybe the example program can''t handle different width/height.

Atavist
Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
IIRC LaMothe''s code only handles bitmaps with dimensions that are powers of two...



Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
You can''t Photoshop files because Photoshop calculates bmp files sizes diffirent than t3dlib(i think that was the reason)
You could change the Load_Bitmap_File function or save the image in some other graphic program (like PSP) after you draw it in Photoshop
Yea photoshop adds a few extra bits onto the end of your bitmap files for some odd reason. It causes all hell to be raised when you try loading the bitmaps in your apps. The best way to fix this is to just load the photoshop bmp files into MS Paint, and then save them again.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.
to mezz did you add the line
#define INITGUID
to your project ?
In Lamothe''s old Window Game Programming you couldn''t load in a bitmap saved in RLE form. I am guessing Photoshop saves in guess what... RLE form. Use Paint Shop Pro and save in RGB form.

This topic is closed to new replies.

Advertisement