Resource Group Names

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
xavier
Just popping in
Just popping in
Posts: 4
Joined: Sun Oct 16, 2005 20:47

Resource Group Names

Postby xavier » Sun Oct 16, 2005 22:10

This may concern only OgreGUIRenderer.

I discovered that the resourceGroup params that are passed in the constructors to classes such as CEGUI::Font and CEGUI::ImageSet etc. are not actually used. This presents a problem when putting CEGUI resources into alternate groups, because if the same groupname is not specified (overridden) in the description file elements, an error occurs trying to find the resource. I have fixed this by storing the resourceGroup in a private d_defaultResourceGroup member (at least in the classes that affected my current project; there may be others) and detecting a zero-length ResourceGroup attribute in the SAX handlers and using the default one instead.

First, is this the proper way to deal with this? (I have no interest in qualifying the XML data with resource group information, as that leads to a maintenance nightmare across projects).

Second, if this is correct, I would be happy to provide a patch for this fix.

User avatar
xavier
Just popping in
Just popping in
Posts: 4
Joined: Sun Oct 16, 2005 20:47

Re: Resource Group Names

Postby xavier » Mon Dec 26, 2005 18:29

I noticed this post got a lot of looks but no replies. I updated to CVS HEAD last night and found it it wasn't addressed, so I put together a HIGHLY EXPERIMENTAL patch posted on SF ( 1390728 ).

Basically it just enables the XML handlers to use the default resource group passed to the classes that have them, such as Scheme and Imageset. If the default resource group attribute is not supplied in XML, the code can use the group assigned in code...if there is one. If that is not assigned either, then it defaults back to normal behavior, namely using the globally defined default group name (General).

This is provided as, no warranties, blah blah. Sensible precautions apply of course: back up your stuff first, etc. It works for me, but I only changed files that either were _xmlHandler or their obvious counterparts. Only the maintainers would know if this is actually complete or correct.

User avatar
MandM
Just popping in
Just popping in
Posts: 13
Joined: Mon Nov 21, 2005 11:17
Location: Egypt
Contact:

Re: Resource Group Names

Postby MandM » Mon Dec 26, 2005 18:43

I find nothing wrong with the resource group system of cegui. I'm using OgreCEGUIRenderer too, you only need to modify the xml file (be it layout, imageset or scheme) to specify which resource group you're using.

<imageset filename="bla bla" ....... ResourceGroup="MyDifferentResourceGroup" />

User avatar
xavier
Just popping in
Just popping in
Posts: 4
Joined: Sun Oct 16, 2005 20:47

Re: Resource Group Names

Postby xavier » Mon Dec 26, 2005 18:47

MandM wrote:
I find nothing wrong with the resource group system of cegui. I'm using OgreCEGUIRenderer too, you only need to modify the xml file (be it layout, imageset or scheme) to specify which resource group you're using.

<imageset filename="bla bla" ....... ResourceGroup="MyDifferentResourceGroup" />


That's fine...if

(a) you are creating your GUI in XML and not in code, and
(b) your GUI is specific to a single application

If you want to reuse your GUI in another project that has a different naming scheme, you end up maintaining multiple sets of the same thing...which can become a maintenance nightmare after a while, especially with a complicated GUI.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Resource Group Names

Postby lindquist » Mon Jan 09, 2006 01:53

Sorry for the delay. I've looked at your patch and this actually seems like a useful addition. but...

There is one thing. This patch avoids possible redundant resourcegroup specifications, but it could complicate thing for people who intentionally specify a resource group when loading the scheme file itself (for example), but want empty resource groups for the "component" files that the scheme loads.

I will note this idea and discuss it with CE when he returns (which should be within reasonable time). For now this is a breaking change, and thus not suitable for at least the 0.4 brances.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests