Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » masked_blit(); problem

This thread is locked; no one can reply to it. rss feed Print
 1   2 
masked_blit(); problem
Evert
Member #794
November 2000
avatar

Quote:

Low self esteem, or do you just not like being called Mr.?

On the conterary on both parts. However, I felt the response in this case to be unjustly sarcastic.

Thomas Fjellstrom
Member #476
June 2000
avatar

I didn't think there was enough context to tell if it was sarcastic at all.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

gnolam
Member #2,030
March 2002
avatar

And for the last goddamn time, BMP IS NOT A WEB-APPROPRIATE IMAGE FORMAT.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Evert
Member #794
November 2000
avatar

Quote:

I didn't think there was enough context to tell if it was sarcastic at all.

I did. How would you take suddenly being called "Mr. Fjellstrom"?
Not that it matters much either way; the important things is that he posted the example program and got an answer to what was wrong with it.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

How would you take suddenly being called "Mr. Fjellstrom"?

I dunno, I don't think I'd think it was sarcasm right away. the tone in the rest of the message would tell me either way.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Evert
Member #794
November 2000
avatar

Well, the rest of the message was fine. The opening ticked me off a little. Meh, never mind.

EDIT: I should perhaps mention, the change that Kitty Cat pointed out does actually fix the problem.

Kris Asick
Member #1,424
July 2001

Kitty Cat's got it right. You can't call create_bitmap() until after you have selected a video mode, otherwise the colour depth of the bitmap might not match the colour depth of the screen.

If you want to, you can get around this using create_bitmap_ex() which allows you to specify the colour depth of any bitmap you create.

--- Kris Asick (Gemini)
--- http://www.pixelships.com

--- Kris Asick (Gemini)
--- http://www.pixelships.com

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

If you want to, you can get around this using create_bitmap_ex() which allows you to specify the colour depth of any bitmap you create.

That still might not do it. Allegro creates bitmaps in the same ordering (BGR RGB) as the card uses, and the default before a mode it set is BGR iirc, so if a card uses RGB, you'll have a BGR bitmap and a RGB screen.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Jon Ray
Member #5,340
December 2004
avatar

Thanks Kitty Cat and Evert for the suggestion (so hard feelings mate)!!!

Something so easy too.. got it to work.

kazzmir
Member #1,786
December 2001
avatar

I mentioned the solution in the first post. Oh wel :-p

Jon Ray
Member #5,340
December 2004
avatar

kazzmir,

Sorry.. I guess you can give the man an answer, but if he doesn't know the language, its pointless..

BAF
Member #2,981
December 2002
avatar

To build upon Thomas's reply regarding makecol before allegro_init(), it's also worth noting you may run into issues if you use makecol, load_bitmap, etc before setting the color depth and/or graphics mode.

William Labbett
Member #4,486
March 2004
avatar

Maybe it'd be worth mentioning that in the docs.

Thomas Fjellstrom
Member #476
June 2000
avatar

The Manual said:

Initialises the Allegro library. You must call either this or allegro_init() before doing anything other than using the Unicode routines. If you want to use a text mode other than UTF-8, you can set it with set_uformat() before you call this. The other functions that can be called before this one will be marked explicitly in the documentation, like set_config_file().

http://www.allegro.cc/manual/api/using-allegro/install_allegro

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

 1   2 


Go to: