Crystal Space
Welcome, Guest. Please login or register.
April 19, 2014, 11:42:19 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7597 Members
Latest Member: Drukareczka1989
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Pixmaps with alphachannel
« previous next »
Pages: [1] Print
Author Topic: Pixmaps with alphachannel  (Read 2322 times)
Freetimecoder
Newbie
*
Posts: 31


View Profile Email
« on: November 01, 2007, 06:09:10 pm »

Hi,

I try to use pixmaps with an alpha channel.
But I don't know what I should do.
I tried different formats, such as gif, png, tga but CrystalSpace cannot load them.
And the alpha parameter of the Draw() function is not what I want to do.

Thanks for any help!
Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #1 on: November 01, 2007, 06:26:30 pm »

I tried different formats, such as gif, png, tga but CrystalSpace cannot load them.

CS supports all of them, and unless CS wasn't built completely, gif and tga support are always available - png needs an external dependency (libpng).

How are you loading + setting up the pixmaps?
Logged
Freetimecoder
Newbie
*
Posts: 31


View Profile Email
« Reply #2 on: November 02, 2007, 08:29:52 am »

Code:
buf = VFS->ReadFile ("/lib/SpaceInvaders/Feuerball_small.bmp");
ifile = imgldr->Load (buf, txtmgr->GetTextureFormat ());
Tmptxt = txtmgr->RegisterTexture (ifile, CS_TEXTURE_2D);

FireBallImage = new csSimplePixmap (Tmptxt);

That's the way I load them. All variables are declared before and this code works. But it does not, when I try to load tga png gif...

Greetings
Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #3 on: November 02, 2007, 08:48:27 am »

But it does not, when I try to load tga png gif...

Then check if the appropriate plugins were built.
Logged
Freetimecoder
Newbie
*
Posts: 31


View Profile Email
« Reply #4 on: November 02, 2007, 10:34:02 am »

Then check if the appropriate plugins were built.

Yes they were build.
I work withs MS VisualC++ and built CS with the winlibs package.

Greetings
Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #5 on: November 02, 2007, 10:39:24 am »

Then what error do you get when you try to load a gif/png/tga/... ?
Logged
Freetimecoder
Newbie
*
Posts: 31


View Profile Email
« Reply #6 on: November 02, 2007, 12:14:12 pm »

Thats the error:
Unhandlet exeption ati 0x025e17d8 (csbmpimg.dll) in CS_Alpha_Test.exe: 0xC0000005: Accessviolation when reading position 0x00000000.

Code:
csPtr<iImage> csBMPImageIO::Load (iDataBuffer* buf, int iFormat)
{
  ImageBMPFile* i = new ImageBMPFile (iFormat);
  if (i && !i->Load (buf->GetUint8(), buf->GetSize())) <---------- and it points to this line in bmpimage.cpp
  {
    delete i;
    return 0;
  }
  return csPtr<iImage> (i);
}
Logged
Freetimecoder
Newbie
*
Posts: 31


View Profile Email
« Reply #7 on: November 02, 2007, 01:39:11 pm »

oh.. I found the error.
The .zip file was damaged.
It works now, with all files.

Greetings and tanks for the help!
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.179 seconds with 15 queries.