HEAD/trunk gives runtime errors

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Liberator
Just popping in
Just popping in
Posts: 19
Joined: Mon Jun 25, 2007 13:16
Contact:

HEAD/trunk gives runtime errors

Postby Liberator » Sun Aug 12, 2007 10:34

Hi,

I was wondering whether the following is a known problem:
When using the HEAD revision of CEGUI I got got hit with problems I did not have while using 0.5. The reason I switched was because I need Tree widget support. Not only do I get the message shown below, if I try to add items to the Tree control the whole thing crashes with an access violation in a string object (CEGUIString.cpp line 670). It seems like the string object being accessed is invalid.
The 'there is no property FrameColours error' is one I get every time I resize the window which causes a stack unwind making everything very slow. Of course the error should not occur in the first place.


Code: Select all


-- snip --

[SYSTEM] [LVL 2] [CEGUI] Window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_decbtn__' of type 'TaharezLook/ImageButton' has been created.
[SYSTEM] [LVL 2] [CEGUI] Assigning the window renderer 'Falagard/Button' to the window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_decbtn__'
[SYSTEM] [LVL 2] [CEGUI] Assigning LookNFeel 'TaharezLook/ImageButton' to window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_decbtn__'.
[SYSTEM] [LVL 2] [CEGUI] Window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_thumb__' of type 'TaharezLook/VerticalScrollbarThumb' has been created.
[SYSTEM] [LVL 2] [CEGUI] Assigning the window renderer 'Falagard/Button' to the window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_thumb__'
[SYSTEM] [LVL 2] [CEGUI] Assigning LookNFeel 'TaharezLook/VerticalScrollbarThumb' to window 'CGUIEditor:WindowTree__auto_vscrollbar____auto_thumb__'.
[SYSTEM] [LVL 0] [CEGUI] Exception: There is no Property named 'SelectionBrushImage' available in the set.
[SYSTEM] [LVL 0] [CEGUI] Exception: There is no Property named 'NormalTextColour' available in the set.
[SYSTEM] [LVL 0] [CEGUI] Exception: There is no Property named 'SelectedTextColour' available in the set.
[SYSTEM] [LVL 0] [CEGUI] Exception: There is no Property named 'ActiveSelectionColour' available in the set.
[SYSTEM] [LVL 0] [CEGUI] Exception: There is no Property named
'InactiveSelectionColour' available in the set.

-- snip --




I have also tried the CEGUI samples and only a sub-set of them actually work. I compiled the samples to use OpenGL while my engine uses Ogre.
Last edited by Liberator on Sat Sep 08, 2007 23:24, edited 3 times in total.
Image
All that is necessary for the triumph of evil is that good men do nothing

Liberator
Just popping in
Just popping in
Posts: 19
Joined: Mon Jun 25, 2007 13:16
Contact:

Postby Liberator » Sun Aug 12, 2007 11:39

I just discovered the access violation occurs when I use the following code:

Code: Select all


-- snip --

                    CEGUI::TreeItem* parentEntry = m_windowList->findFirstItemWithText( parentWindow->getName() );
                    if ( NULL != parentEntry )
                    {
                        parentEntry->addItem( treeItem );
                    }

-- snip --



It seems that adding items to a parent entry in this manner causes the crash. If I comment out the parentEntry->addItem line it works fine.
Either the addItem code is bugged or findFirstItemWithText() can return a bogus pointer.

- EDIT:

I modified the addItem line as follows:
parentEntry->addItem( new CEGUI::TreeItem( "Test" ) );

This also crashes so findFirstItemWithText() returning a bogus pointer is not the cause. It now seems likely that simply adding children to an item in a Tree widget in the manner I described causes a crash.
Last edited by Liberator on Sat Sep 08, 2007 23:24, edited 1 time in total.
Image

All that is necessary for the triumph of evil is that good men do nothing

Liberator
Just popping in
Just popping in
Posts: 19
Joined: Mon Jun 25, 2007 13:16
Contact:

Postby Liberator » Sat Aug 18, 2007 13:03

Is anyone still working on CEGUI and reading this ?

Liberator
Just popping in
Just popping in
Posts: 19
Joined: Mon Jun 25, 2007 13:16
Contact:

fix

Postby Liberator » Wed Sep 05, 2007 19:40

In case anyone cares...


I had a couple of hours today to debug this and found that, after fixing missing member variable initializations, that the main problem was the commented out initialise() class in the Tree widget. I made a number of fixes and everything works now. If anyone is interested in the fixes gimme a shout. Not initializing member variables is something that really should be checked :cry:

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Thu Sep 06, 2007 14:59

Development is done in "spare" time, something which I haven't had any for too many months now. I'm sure the other devs are having the same problem.

Liberator
Just popping in
Just popping in
Posts: 19
Joined: Mon Jun 25, 2007 13:16
Contact:

Path file

Postby Liberator » Thu Sep 06, 2007 16:24

Here is the patch I made with SVN

Code: Select all

Index: trunk/include/CEGUIString.h
===================================================================
--- trunk/include/CEGUIString.h   (revision 1480)
+++ trunk/include/CEGUIString.h   (working copy)
@@ -4802,6 +4802,7 @@
       d_encodedbuff      = 0;
       d_encodedbufflen   = 0;
       d_encodeddatlen      = 0;
+      d_buffer            = 0;
       setlen(0);
    }
 
Index: trunk/include/CEGUIWindow.h
===================================================================
--- trunk/include/CEGUIWindow.h   (revision 1480)
+++ trunk/include/CEGUIWindow.h   (working copy)
@@ -1963,7 +1963,7 @@
     \note
         Once a look'n'feel has been assigned it is locked - as in cannot be changed.
     */
-    void setLookNFeel(const String& look);
+    virtual void setLookNFeel(const String& look);
 
     /*!
     \brief
Index: trunk/include/elements/CEGUITree.h
===================================================================
--- trunk/include/elements/CEGUITree.h   (revision 1480)
+++ trunk/include/elements/CEGUITree.h   (working copy)
@@ -442,6 +442,9 @@
    \exception   InvalidRequestException   thrown if \a item_index is out of range for the list box
    */
    void   setItemSelectState(size_t item_index, bool state);
+   
+   
+   virtual void setLookNFeel(const String& look);
 
 
    /*!
Index: trunk/src/elements/CEGUITree.cpp
===================================================================
--- trunk/src/elements/CEGUITree.cpp   (revision 1480)
+++ trunk/src/elements/CEGUITree.cpp   (working copy)
@@ -79,13 +79,14 @@
       d_itemTooltips(false),
       d_lastSelected(NULL),
       d_horzScrollbar(NULL),
-      d_vertScrollbar(NULL)
+      d_vertScrollbar(NULL),
+      openButtonImagery(NULL),
+      closeButtonImagery(NULL)
    {
       // add new events specific to list box.
       addTreeEvents();
 
       addTreeProperties();
-      // initialise();
    }
 
 
@@ -97,7 +98,13 @@
       resetList_impl();
    }
 
+    void Tree::setLookNFeel(const String& look)
+    {
+        Window::setLookNFeel( look );
+        initialise();
+    }
 
+
    /*************************************************************************
    Initialise the Window based object ready for use.
    *************************************************************************/
Last edited by Liberator on Sat Sep 08, 2007 23:25, edited 1 time in total.
Image

All that is necessary for the triumph of evil is that good men do nothing

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Thu Sep 06, 2007 21:54

Thanks! Appreciated :) I will give it a go this weekend.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Fri Sep 14, 2007 14:41

Applied and tested, thanks again! :)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests