Gamestudio Links
Zorro Links
Newest Posts
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
New Zorro version 3.11
by jcl. 07/21/26 13:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Ayumi, 1 invisible), 1,648 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
When does a bitmap really has an alpha channel? #389616
12/16/11 11:30
12/16/11 11:30
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

I encountered, that when I load a 24bit TGA from file, that A8 returns as format 8888, while bytespp is = 3; this is, I guess, because of the conversion for being used with DirectX or so... right?

Well, because I am writing some functions for saving BMAP*'s to file, I came up with this solution:

Code:
BOOL bUseAlpha = (((format == 8888) || (format == 1555) || (format == 4444)) && (b->bytespp == 4));



So, whenever I get a format that possibly implicates an alpha channel, I also require the (original) bytespp field to be = 4.

Is this correct for all loaded images from file and all procedurally generated images?

Last edited by HeelX; 12/16/11 11:30.
Re: When does a bitmap really has an alpha channel? [Re: HeelX] #389626
12/16/11 13:24
12/16/11 13:24
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
DirectX loads all images in the format that is used by the 3D hardware. So there is no fixed rule which format you get. It depends on your hardware.

I don't think that there is a 3D card that would support the 888 format, so a 24 bit image is most likely loaded in 8888 format, even when the image contains no alpha channel.

Re: When does a bitmap really has an alpha channel? [Re: jcl] #389628
12/16/11 13:28
12/16/11 13:28
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thanks for the answer... I found out, that DirectX stores BMP and PCX images as 888, though.


Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1