Jump to content

  • Log In with Google      Sign In   
  • Create Account

HELP!!! Photoshop killing my bitmaps!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Gollum   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2000 - 05:51 AM

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

Sponsor:

#2 Graylien   Members   -  Reputation: 160

Like
Likes
Like

Posted 10 January 2000 - 06:13 AM

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.

#3 Gollum   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2000 - 09:27 AM

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


#4 Mezz   Members   -  Reputation: 570

Like
Likes
Like

Posted 10 January 2000 - 09:40 AM

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

#5 Atavist   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2000 - 09:44 AM

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

#6 mason   Members   -  Reputation: 128

Like
Likes
Like

Posted 10 January 2000 - 09:52 AM

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

#7 GunnarSteinn   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2000 - 10:02 AM

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

#8 evaclear   Members   -  Reputation: 162

Like
Likes
Like

Posted 10 January 2000 - 03:28 PM

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.

#9 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 11 January 2000 - 04:40 PM

to mezz did you add the line
#define INITGUID
to your project ?

#10 acw83   Members   -  Reputation: 174

Like
Likes
Like

Posted 12 January 2000 - 10:11 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS