Resources seem to be messed up

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

OffbeatPatriot
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 29, 2008 05:16

Resources seem to be messed up

Postby OffbeatPatriot » Sat Feb 07, 2009 04:12

I posted a thread for help yesterday and now I'm making another, hopefully I don't become a pest.

I brushed off an old project of mine, since I last worked on it I have erased and reinstalled my Ubuntu partition that I am running it in. The project is a game, when it starts you have the option to change the settings which brings up a window, right now it's just a window with a combo box of resolutions in it. this is what it looks like in CELayoutEditor:
Image

This is how it looks when I bring it up in the game
Image
You may also notice what looks like an out of place right scroll button in the upper right corner, that should be my mouse pointer.

I"ve tried the CEGUI/OGRE tutorial in the OGRE wiki and CEGUI worked fine there[/img]

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Resources seem to be messed up

Postby CrazyEddie » Sat Feb 07, 2009 09:39

OffbeatPatriot wrote:I posted a thread for help yesterday and now I'm making another, hopefully I don't become a pest.

There's much competition for the highly sought after 'pest' label; you have a way to go yet ;)

With regards to the issue, my first thought is that it looks like what you get when using an image that has non power of two dimensions. Though if you're using a standard non-modified TaharezLook.tga then it should not be that (please confirm that, though!). Having just double-checked the texture file, it actually now looks like the image is getting flipped vertically, which I can't explain at the moment, other than it being an issue caused during loading - do you know / can you tell us which lib is doing the loading (such as FreeImage, DevIL or whatever) and it's version (my Ogre is rusty, so apologies if the answer to that is obvious).

CE.

OffbeatPatriot
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 29, 2008 05:16

Postby OffbeatPatriot » Sun Feb 08, 2009 06:12

I thought I was using SILLY but I found this line in config.log

#define CEGUI_DEFAULT_IMAGE_CODEC FreeImageImageCodec

so FreeImage.

And the tga file should be an unmodified one, I copied the contents of /usr/local/shared/CEGUI/ into the datafiles I used just in case and got the same results.

Edit:

I've recompiled with SILLY as my default image codec and everything works.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Feb 08, 2009 08:49

Ah, I thought you were using Ogre for rendering, sorry :)

This means that there are some potential issues in the FreeImage codec that I should probably look at.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Feb 09, 2009 10:48

tga images are a pest because of their pixel flipping options ...
For example the flip bits generated by GIMP when exporting a tga image don't seem to correspond to the ones stated in the truevision reference. At least that's what I experienced ...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Feb 10, 2009 09:32

Hmm, so in effect we would probably benefit from moving away from tga and over to png for all our files?

CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Tue Feb 10, 2009 12:50

I think so.

The only advantage you have with the tga files was to have at least one file format that a lot of drawing programs can export to (not always correctly) without any external library.
That's the only reason I would keep it (or replace it by bmp files that don't have the flipping).

But I'd say you have enough more important things to do at the moment, and your taharezlook file has the correct tga format :)

That would be a thing to do in a free day when there's nothing else to do.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Wed Feb 11, 2009 17:48

CrazyEddie wrote:Hmm, so in effect we would probably benefit from moving away from tga and over to png for all our files?

I think I have the trick:
in CEGUITGAImageCodec.cpp, there is this code:

Code: Select all

   // Now we move the file pointer to the pixel data
   buffer += length + 1;

For me, it's at line 180-181. Instead of just skipping that byte, you could read some information out of this. Namely:

Code: Select all

    bool bFlipHoriz = (buffer[0] & 16) == 16;
    bool bFlipVert  = !((buffer[0] & 32) == 32);
    buffer += length + 1;

And then flip the image accordingly. For me that works with your tga file and tga files I export from the gimp, this also seems to correspond to the tga reference for tga version 2 files.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 13, 2009 09:24

Cool, thanks for the info. I'll see about doing something about it sometime soon (I added a mantis note, so I don't forget ;) ).

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests