Resource Provider

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
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Wed Sep 08, 2004 02:26

I thought I'd start a thread about the resource provider that I'm working on to let people know the progress. I've just finished my first pass of the code and have .scheme files loading using OGRE's resource management system. There's still plenty to do before I can submit this as a patch though.

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

Resource Provider

Postby CrazyEddie » Wed Sep 08, 2004 08:25

Great to hear that you're making good progress with this. Whenever you have the patch ready that cool with me; I'm just grateful that you're taking the time to do this :D

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sun Sep 26, 2004 18:04

Just to give everyone an update, I am still working on this project but have been busy with work & family commitments recently. I'll post again when I've made more progress.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Mon Oct 25, 2004 02:44

OK as of tonight I have hammered out the last of my resource loading issues (namely loading xsd files from memory). I have now got my local copy of CEGUI to load all of its resources from the OGRE resource manager via a sub-classed CEGUI resource provider.

I still have a few things to do before this is complete:
1) Write a default resource loader which will act in the way CEGUI currently loads files (half complete).
2) Refactor texture loading in the ogre renderer to use the CEGUI resource provider.

I'm sure there are others I just can't remember them right now.

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

Resource Provider

Postby CrazyEddie » Mon Oct 25, 2004 08:24

This is going to be great :D

Thanks for the progress update.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Wed Oct 27, 2004 01:31

CE a quick question.

Because of the way the resource provider deals with loading data I've had to modify the font, imageset, scheme etc classes to take an InputSource instead of a filename. Since each of the respective managers control the creation of each of these objects do I need to keep the load by filename option? I'd rather remove it if it's not going be used anymore, but if you know of a need for it thats fine too :)

User avatar
PeterNewman
Just popping in
Just popping in
Posts: 13
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby PeterNewman » Wed Oct 27, 2004 03:28

So a side effect of this will be that CEGUI will have a standard replacable resource provider? This will help me no end.

Good work _mental_, and CE too!

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

Resource Provider

Postby CrazyEddie » Wed Oct 27, 2004 09:14

@_mental_:
I don't really have any objection to removing the old methods, though there may be others who still wish to use them. If they're not harming anything, leave them in for now.

Having said that I may go back and remove them myself at some stage later on, but for now I'd like to minimise any further uproar. What you could do is add a documentation note to say that the old methods are depreciated, and that the new system should be preferred.

CE.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Thu Oct 28, 2004 01:13

@PeterNewman: Yep. The idea is that you could create your own sub-class if you so wished.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sun Nov 28, 2004 19:20

hmm... now that this project is 95% finished I think I'm going to have to re-think parts of the design. At the moment the resource provider relies on using Xerces memory buffers which work perfecly when combined with the OGRE resource system, but I'm having a bitch of a time using them with the default resource provider.

The default resource provider is quite simple as it literally just loads a file into an Xerces memory buffer, but something seems to be going wrong when creating the buffer as I'm continually getting unexpected EOF errors. It occurs to me that I shouldn't really be loading file myself as Xerces deals with that internally without any issue.

So back to the drawing board.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Mon Nov 29, 2004 04:52

Ok I think I have my design issues sorted. Hopefully I can finish this all up tomorrow.

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

Resource Provider

Postby CrazyEddie » Mon Nov 29, 2004 10:02

Cool. I'm looking forward to this as I'd like to test this out and get it in before packaging up the first downloadable release for the system in the very near future.

CE.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Tue Nov 30, 2004 04:23

Ok make that tomorrow.. there's just not enough hours in the day sometimes.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sat Dec 04, 2004 20:19

CE,
Could you review the following files for the resource provider and let me know what you think.

http://sourceforge.net/tracker/index.ph ... tid=605424

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

Resource Provider

Postby CrazyEddie » Sat Dec 04, 2004 21:41

Everything looks okay generally, save for a couple of memory leaks...

In DefaultResourceProvider::loadRawDataContainer, if the exception path is taken 'buffer' is left allocated.

The other one is for DataContainer in general, the object referred to (mData) is never released.

I think the most obvious thing to do is add a free() or release() method which can be called from the destructor, though due to the delete/delete[] difference between the two specialisations, I think possibly the best approach is have 'delete' as a default, but provide a specialisation for the unsigned char version to use delete[].

We may also want to consider calling this 'free' method to release any previous object/buffer when setData is called, though this would not strictly be required depending upon the expected use of DataContainer (i.e. it's mainly an internal thing).

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests