Linux patches

Kali

25-11-2007 23:20:43

I've had quite a few issues building this on my system, problems fall into a few categories.

- forward declaration was used while a class declaration was required. If you use member functions or inherit from a class then a forward declaration is no longer sufficiënt, apparantly not all compilers are as strict.

- A few dos line endings.

- OGRE_PLATFORM was undeclared on my system allthough ogre was installed/QuickGui example worked. I worked around it by checking if OGRE_PLATFORM exists first, this shouldn't break anything but I'm uncertain if this is even a QuickGUI error, or my ogre, don't know where QuickGUI gets OGRE_PLATFORM.

- The Skinset and texture editor seemed inconsistent with the api, so I fixed a few of those error to make it to compile, but you're probably working on that yourself so you should probably ignore that

Index: QuickGUI/include/QuickGUIExportDLL.h
===================================================================
--- QuickGUI/include/QuickGUIExportDLL.h (revision 260)
+++ QuickGUI/include/QuickGUIExportDLL.h (working copy)
@@ -2,14 +2,18 @@
#define QUICKGUIEXPORTDLL_H

#ifndef _QuickGUIExport
- #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined ( __MINGW32__ )
- # if defined( QUICKGUI_EXPORTS )
- # define _QuickGUIExport __declspec( dllexport )
- # else
- # define _QuickGUIExport __declspec( dllimport )
- # endif
+ #if defined(OGRE_PLATFORM)
+ #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined ( __MINGW32__ )
+ # if defined( QUICKGUI_EXPORTS )
+ # define _QuickGUIExport __declspec( dllexport )
+ # else
+ # define _QuickGUIExport __declspec( dllimport )
+ # endif
+ #else
+ # define _QuickGUIExport
+ #endif
#else
- # define _QuickGUIExport
+ #define _QuickGUIExport
#endif
#endif

Index: QuickGUI/include/QuickGUISkinSet.h
===================================================================
--- QuickGUI/include/QuickGUISkinSet.h (revision 260)
+++ QuickGUI/include/QuickGUISkinSet.h (working copy)
@@ -36,6 +36,9 @@
IMAGE_TYPE_BMP
};
public:
+ // Delete this SkinSet
+ ~SkinSet();
+
/*
* Adds a texture name to the list of textures that will be included in the
* SkinSet texture.
@@ -131,8 +134,6 @@
private:
// Generate a new SkinSet using the skin's image files.
SkinSet(const Ogre::String& skinName, ImageType t, const Ogre::String &resourceGroup);
- // Delete this SkinSet
- ~SkinSet();

void _determineExtension(ImageType t);
void buildMaterial();
Index: QuickGUI/include/QuickGUICheckBox.h
===================================================================
--- QuickGUI/include/QuickGUICheckBox.h (revision 260)
+++ QuickGUI/include/QuickGUICheckBox.h (working copy)
@@ -17,7 +17,7 @@
*/
template<typename T> void addOnCheckChangedEventHandler(void (T::*function)(const EventArgs&), T* obj)
{
- mOnSelectUserEventHandlers.push_back(new MemberFunctionPointer<T>(function,obj));
+ mOnCheckChangedUserEventHandlers.push_back(new MemberFunctionPointer<T>(function,obj));
}
void addOnCheckChangedEventHandler(MemberFunctionSlot* function);

Index: QuickGUI/src/QuickGUIPanel.cpp
===================================================================
--- QuickGUI/src/QuickGUIPanel.cpp (revision 260)
+++ QuickGUI/src/QuickGUIPanel.cpp (working copy)
@@ -3,6 +3,7 @@
#include "QuickGUIManager.h"
#include "QuickGUIPanel.h"
#include "QuickGUISheet.h"
+#include "QuickGUITextArea.h"

#ifdef WIN32
// Turn off warnings generated by using 'this' in base member initializer list.
Index: QuickGUI/src/CMakeLists.txt
===================================================================
--- QuickGUI/src/CMakeLists.txt (revision 260)
+++ QuickGUI/src/CMakeLists.txt (working copy)
@@ -37,6 +37,8 @@
QuickGUIVerticalTrackBar.cpp
QuickGUIWidget.cpp
QuickGUIWindow.cpp
+ QuickGUITextHelper.cpp
+ QuickGUICheckBox.cpp
)

INCLUDE_DIRECTORIES (../include ${OGRE_INCLUDEDIR})
Index: QuickGUI/src/QuickGUIConsole.cpp
===================================================================
--- QuickGUI/src/QuickGUIConsole.cpp (revision 260)
+++ QuickGUI/src/QuickGUIConsole.cpp (working copy)
@@ -1,6 +1,7 @@
#include "QuickGUIPrecompiledHeaders.h"

#include "QuickGUIConsole.h"
+#include "QuickGUIManager.h"

namespace QuickGUI
{
Index: QuickGUI/src/QuickGUIImage.cpp
===================================================================
--- QuickGUI/src/QuickGUIImage.cpp (revision 260)
+++ QuickGUI/src/QuickGUIImage.cpp (working copy)
@@ -1,6 +1,7 @@
#include "QuickGUIPrecompiledHeaders.h"

#include "QuickGUIImage.h"
+#include "QuickGUIUtility.h"

namespace QuickGUI
{
Index: QuickGUI/src/QuickGUIWidget.cpp
===================================================================
--- QuickGUI/src/QuickGUIWidget.cpp (revision 260)
+++ QuickGUI/src/QuickGUIWidget.cpp (working copy)
@@ -6,6 +6,7 @@
#include "QuickGUIWindow.h"
#include "QuickGUISheet.h"
#include "QuickGUIBorder.h"
+#include "QuickGUITextArea.h"

namespace QuickGUI
{
Index: QuickGUI/src/QuickGUITextHelper.cpp
===================================================================
--- QuickGUI/src/QuickGUITextHelper.cpp (revision 260)
+++ QuickGUI/src/QuickGUITextHelper.cpp (working copy)
@@ -29,7 +29,7 @@
if(mFont.isNull())
throw Ogre::Exception( Ogre::Exception::ERR_ITEM_NOT_FOUND, "Font has not been set, cannot get font texture!","Text::getFontTexturePtr" );

- return mFontTexture;
+ return (Ogre::FontPtr)mFontTexture;
}

Ogre::Real TextHelper::getFontTextureHeight()
Index: QuickGUI/src/QuickGUINStateButton.cpp
===================================================================
--- QuickGUI/src/QuickGUINStateButton.cpp (revision 260)
+++ QuickGUI/src/QuickGUINStateButton.cpp (working copy)
@@ -1,6 +1,7 @@
#include "QuickGUIPrecompiledHeaders.h"

#include "QuickGUINStateButton.h"
+#include "QuickGUIUtility.h"

namespace QuickGUI
{
Index: QuickGUISheetEditor/include/QuickGUISheetEditorUI.h
===================================================================
--- QuickGUISheetEditor/include/QuickGUISheetEditorUI.h (revision 260)
+++ QuickGUISheetEditor/include/QuickGUISheetEditorUI.h (working copy)
@@ -1,9 +1,9 @@
#ifndef QuickGUISheetEditorUI_H
#define QuickGUISheetEditorUI_H
-
-#include "QuickGUI.h"^M
+
+#include "QuickGUI.h"
#include "ExampleFrameListener.h"
-
+
class QuickGUISheetEditorUI : public ExampleFrameListener, public OIS::KeyListener, public OIS::MouseListener
{
private:
@@ -51,4 +51,4 @@
bool keyReleased( const OIS::KeyEvent &arg );
};

-#endif //QuickGUISheetEditorUI
+#endif //QuickGUISheetEditorUI
Index: QuickGUISheetEditor/include/QuickGUISheetEditorApp.h
===================================================================
--- QuickGUISheetEditor/include/QuickGUISheetEditorApp.h (revision 260)
+++ QuickGUISheetEditor/include/QuickGUISheetEditorApp.h (working copy)
@@ -1,9 +1,9 @@
#ifndef QuickGUISheetEditorApp_H
#define QuickGUISheetEditorApp_H
-
-#include "QuickGUI.h"^M
+
+#include "QuickGUI.h"
#include "ExampleApplication.h"
-
+
class QuickGUISheetEditorApp : public ExampleApplication
{
public:
@@ -22,4 +22,4 @@
};


-#endif //QuickGUISheetEditorApp
+#endif //QuickGUISheetEditorApp
Index: QuickGUISheetEditor/src/QuickGUISheetEditorUI.cpp
===================================================================
--- QuickGUISheetEditor/src/QuickGUISheetEditorUI.cpp (revision 260)
+++ QuickGUISheetEditor/src/QuickGUISheetEditorUI.cpp (working copy)
@@ -1,5 +1,5 @@
#include "QuickGUISheetEditorUI.h"
-
+#include "QuickGUISkinSet.h"
using namespace Ogre;


@@ -19,7 +19,7 @@
mGUIManager = new QuickGUI::GUIManager(mCamera->getViewport());
mGUIManager->setSceneManager(mCamera->getSceneManager());

- QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", "quickgui");
+ QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", QuickGUI::SkinSet::IMAGE_TYPE_PNG, "quickgui");

mSheet = mGUIManager->getDefaultSheet();
mSheet->setFont("micross.12",true);
@@ -85,8 +85,7 @@
}
// skin part list.
{
- mWidgetListWindow = mSheet->createWindow();
- mWidgetListWindow->setName("SubTexture List");
+ mWidgetListWindow = mSheet->createWindow("SubTexture List");
mWidgetListWindow->setDimensions(Rect(0, 60, 255, mWindow->getHeight() - 60));
mWidgetListWindow->allowScrolling(true);

@@ -122,7 +121,7 @@
sheetImage->setDimensions(textureWidgetSize);

// TODO : RTT GUIMANAGER, CREATE RTT SHEET,
- sheetImage->setTexture(mRTTSheetTexture->getName(), false);
+ sheetImage->setTexture(mRTTSheetTexture->getName());

QuickGUI::Window *aWindow;
size_t iTexCount = 0;
@@ -131,7 +130,7 @@
it != widgetList->end();
++it)
{
- aWindow = mSheet->createWindow();
+ aWindow = mSheet->createWindow((*it)->getInstanceName());
const Rect dim((*it)->getDimensions());
Rect RelativeDim (
dim.x * textureWidgetSize.width + xPos, dim.y*textureWidgetSize.height + yPos,
@@ -139,8 +138,6 @@
aWindow->hideTitlebar();
aWindow->setDimensions(RelativeDim);

- aWindow->setName((*it)->getInstanceName());
-
aWindow->addEventHandler(
QuickGUI::Widget::EVENT_MOUSE_BUTTON_DOWN,
&QuickGUISheetEditorUI::handleSelect,this);
Index: QuickGUIDemo/include/ExampleApplication.h
===================================================================
--- QuickGUIDemo/include/ExampleApplication.h (revision 260)
+++ QuickGUIDemo/include/ExampleApplication.h (working copy)
@@ -25,6 +25,7 @@
#include "Ogre.h"
#include "OgreConfigFile.h"
#include "ExampleFrameListener.h"
+#include "config.h"

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#include <CoreFoundation/CoreFoundation.h>
Index: QuickGUISkinSetEditor/src/QuickGUISkinSetEditorUI.cpp
===================================================================
--- QuickGUISkinSetEditor/src/QuickGUISkinSetEditorUI.cpp (revision 260)
+++ QuickGUISkinSetEditor/src/QuickGUISkinSetEditorUI.cpp (working copy)
@@ -20,7 +20,7 @@
mGUIManager = new QuickGUI::GUIManager(mCamera->getViewport());
mGUIManager->setSceneManager(mCamera->getSceneManager());

- QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", "quickgui");
+ QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", QuickGUI::SkinSet::IMAGE_TYPE_PNG, "quickgui");

mSheet = mGUIManager->getDefaultSheet();
mSheet->setFont("micross.12",true);
@@ -86,8 +86,7 @@
}
// skin part list.
{
- mSkinTextureListWindow = mSheet->createWindow();
- mSkinTextureListWindow->setName("SubTexture List");
+ mSkinTextureListWindow = mSheet->createWindow("SubTexture List");
mSkinTextureListWindow->setDimensions(Rect(0, 60, 255, mWindow->getHeight() - 60));
mSkinTextureListWindow->allowScrolling(true);

@@ -99,7 +98,7 @@
void QuickGUISkinSetEditorUI::loadSkin(const String &name)
{
delete mSkinset;
- QuickGUI::SkinSetManager::getSingleton().loadSkin(name, ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
+ QuickGUI::SkinSetManager::getSingleton().loadSkin(name , QuickGUI::SkinSet::IMAGE_TYPE_PNG, ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
mSkinset = QuickGUI::SkinSetManager::getSingleton().getSkinSet(name);

mSkinsetTexture = Ogre::TextureManager::getSingleton().getByName(mSkinset->getTextureName());
@@ -155,7 +154,7 @@

QuickGUI::Image* skinImage = mSheet->createImage();
skinImage->setDimensions(textureWidgetSize);
- skinImage->setTexture(mSkinsetTexture->getName(), false);
+ skinImage->setTexture(mSkinsetTexture->getName());

QuickGUI::Window *aWindow;
size_t iTexCount = 0;
@@ -164,7 +163,7 @@
it != texNames.end();
++it)
{
- aWindow = mSheet->createWindow();
+ aWindow = mSheet->createWindow(*it);
const Vector4 dim(mSkinset->getTextureCoordinates(*it));
Rect RelativeDim (
dim.x * textureWidgetSize.width + xPos, dim.y*textureWidgetSize.height + yPos,
@@ -172,8 +171,6 @@
aWindow->hideTitlebar();
aWindow->setDimensions(RelativeDim);

- aWindow->setName(*it);
-
aWindow->addEventHandler(
QuickGUI::Widget::EVENT_MOUSE_BUTTON_DOWN,
&QuickGUISkinSetEditorUI::handleSelect,this);

kungfoomasta

26-11-2007 01:11:55

Sorry for the noob question, but how to you convert this into a *.patch file? I tried copying into notepad and word, and changing extension from .txt to .patch, but when I try to apply the patch it says:

The line "Index: " was not found!
Either this is not a diff file or the diff is empty.


I'm using TortoiseSVN on winXP 32 bit.

As for the editors, I have yet to look through them and see what needs to be done, what you see has been contributed by Tuan. :)

libolt

26-11-2007 04:57:41

I had trouble applying the patch to my source tree on Linux as well. However I went ahead and manually patched the files with Kali's changes. I was actually in the process of making everything work again myself. :) Glad I came across this topic.

I have gone ahead and committed the changes as revision 261. Please test and let me know if any problems crop up. I am going to try building on win32 now and possibly Mac OS later.

Mike

kungfoomasta

26-11-2007 05:23:24

Thanks libolt for applying the patch! And thanks Kali for the patch! I updated to 261 and was able to compile and run without any problems. (I haven't read all the changes of the patch :wink: )

Kali

26-11-2007 12:15:37

What I did is create the patch file with the command 'svn diff > difffile' which gives me a standard diff file against the latest checkout. It is the standard way of generating a patch as far as I know. I can't tell why it doesn't seem to be compatible, it should be a simple diff file.

Btw, if I wanted to apply the patch myself on a new checkout or after reverting the changes, I'd just use the standard unix patch command like this 'patch -p0 < difffile'.

Anyway revision 262 works for me.

Kali

26-11-2007 13:05:30

Ok, now that it compiles, I've tested it and there are some problems.

First setUseBorders(0) doesn't seem to remove borders. Then the console is worse than ever.

1) Every line has it's own background pick which is not what you want for a console really
2) If you fill the box and the scrollbar appears it does not automatically scroll down
3) When you fill the box, the last element will scroll down past the boundaries of the box.
4) When you reach 30 all elements will be shown outside the box.
5) when you scroll down and type a letter after the 30th element all elements will show up above the box..
6) Allthough elements are removed from the console at a certain point, the scroll bar keeps shrinking.

Because pictures say more than words.
1+2+3) http://studwww.ugent.be/~kverdonc/1.png
4) http://studwww.ugent.be/~kverdonc/2.png
5) http://studwww.ugent.be/~kverdonc/3.png

kungfoomasta

26-11-2007 18:28:04

Whats the white image behind the ProgressBar?

I will look into all of the issues you have mentioned. I'll fix anything I can repro tonight, and anything I can't, we'll have to figure out what the problem is so I can fix it.

Kali

26-11-2007 20:39:38

I don't know, I thought the lifebar was a work in progress. I tried adding one to my application and the white area was green there for some reason, also when the lifebar decreases it gets somewhat distorted,

http://studwww.ugent.be/~kverdonc/5.png

And maybe it would be usefull to give console a base class that allows adding text but doesn't have an input field. I imagine that many people could use a widget where they can send some information without nescessarily following your input path. I know you can hide the input field but the background is still showing and it still takes in space that way.

kungfoomasta

26-11-2007 20:48:52

Its amazing the differences we see in the same application. :lol:

What video card do you have, and do you have access to another machine to test this on? I usually run in OpenGL also, but I don't get a lot of problems that are visible in your screenshots. :? Hopefully we can get these artifacts resolved.

Kali

26-11-2007 21:10:57

Ok, to be complete.

This is on Debian(lenny), Ogre 1.4.3, g++ (GCC) 4.2.3 20071014, OpenGL mode with an Nvidia GForce 4 ti 4200.

Don't really have another system here to try it on, maybe someone else with similar issues could shed some more light.

kungfoomasta

26-11-2007 21:30:04

The progress bar does a lot of blitting and pixel manipulation, I wonder if that could be part of the problem, in combination with your older generation card. I'd be interested in knowing if your same setup with a newer card would yeild better results, but its not really something that can easily be done, I'm sure if you could upgrade your card you would. :) Libolt is getting QuickGUI setup on his box, maybe we can see if he gets similar output.

kungfoomasta

27-11-2007 06:48:13

Revision 264 has fixes for issues 1. and 6. I can repro issue 2, and will fix it tomorrow. Sorry I didn't get around to fixing them all today.

Thanks for your patience and bug reports. :)

Kali

27-11-2007 19:07:58

Back on the console. Entering a word that is too long to fit a line, by means of the addText call still brings the client to a halt.

kungfoomasta

27-11-2007 19:11:06

Thanks, will look into it.

kungfoomasta

28-11-2007 05:06:38

The following code does not cause any problems in the demo for me:


QuickGUI::Console* console = mSheet->createConsole();
console->setPosition(350,150);
console->setMaxLines(20);
console->addText("abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz");


I fixed the scrolling issue, its in SVN.

kungfoomasta

28-11-2007 05:25:31

Aside from not being able to repro your crash with the addText function, I only know of one last problem that needs investigation.

In the demo, if you set the max to 15 lines and enter 16 commands and scroll to the top, you will see the text looks offset. Similarly, if you set the max to 20 lines and enter 21 lines and scroll up, you will the text looks misaligned. Took me a while, but I figured out the cause, it has to do with text getting rendered when off the screen. If you move the console to the bottom of the screen, the top text won't get misaligned unless you have quite a few lines of text. Sorry for my bad explanation, its late..

Kali

28-11-2007 17:59:42

Ah found the error. In console of QuickGUIDemo try to type something short then a space, then a word that doesn't fit the line, not even when you cut it off at the space. Now you will end up in an endless loop. It detects it is too long, call _getLine to cut it, _getLine will always cut it at the space and it still won't fit.

But appart from the two things mentioned the console seems fine now. The misterious placement of text seems to have been fixed somewhere along the way.

If you have the time, these are some things I think could improve quickgui but can't really be considered bugs

I would like to use the console without the input bar but even when hidden, it still shows, as you have an empty background where the text doesn't scroll and no scroll bar appears.

Hiding borders deosn't seem functional any more on a lot of Widgets.

TextArea has a background now. It should either be removed or better fit the text it contains when you use auto-sizing and preferably with a little offset for the text so it doesn't stick to the left border.

kungfoomasta

28-11-2007 18:49:24

Yah, console is in a fairly decent state for the most part. I'll check the issue with the long text tonight.

I would like to use the console without the input bar but even when hidden, it still shows, as you have an empty background where the text doesn't scroll and no scroll bar appears.

If I understand, you want the ability to hide just the InputBox Skin, but want it functional, right? I recently added in the ability to hide a widgets skin via Widget::hide/showSkin, but in the case of a complex compositionali widget like the Console, it should be the skin itself that dictates whether the input box has a visible appearance. I'll look into this, I will probably add a skin component such as "qgui.console.inputbox.png". If this texture does not exist, it will not be drawn on the screen. So in your case, you could have a "kali" skin, where you wouldn't have a texture for the inputbox, and it should give you the look you want.

Hiding borders deosn't seem functional any more on a lot of Widgets.

I'll check this out, I haven't really done a whole lot in terms of adding/removing borders during execution, I either use them or I don't. :wink:

TextArea has a background now. It should either be removed or better fit the text it contains when you use auto-sizing and preferably with a little offset for the text so it doesn't stick to the left border.

TextArea is non-functional at the moment, it's just stubbed out code, waiting for me to work on it at some point. Basically its the same as a "LabelArea" widget. Are you referring to text being too close to the left border, or is there a bigger problem? (clarification needed)

Thanks for the input.

Kali

28-11-2007 20:54:25

Well with borders not hiding I didn't mean anything dynamic, just that setUseBorders(0) doesn't hide borders any more as it did before.

And I'm sorry I was talking about LabelArea, I just got the two mixed up.

Well this screenshot pretty much shows what the problem is. Notice the border around the Textbox bellow that didn't use to be there, the console input part that is over that lower Textbox and the strange background for the LabelAreas in the menu.

http://studwww.ugent.be/~kverdonc/6.png

kungfoomasta

28-11-2007 21:43:37

Notice the border around the Textbox bellow that didn't use to be there, the console input part that is over that lower Textbox and the strange background for the LabelAreas in the menu.

I'm not sure I understand what is wrong with the borders. For the console, I can see that the "List" portion of the console appears darker, I can fix this by giving it a distinct skin component, ie ".console.list". I can also make sure LabelArea has the same behavior. If you want to hide the entire skin of the widget, you can call Widget::hideSkin, or in your case myLabelArea->hideSkin();

I like your screenshot. 8)

Kali

29-11-2007 10:21:42

Well the problem with the border is that the textbar on the bottom of the screen clearly has a border while I explicitly use setUseBorders(0). It didn't have a border in revision 258.

kungfoomasta

29-11-2007 17:34:00

Thanks for the clarification. I had to take a break last night, but tonight I should apply remaining fixes and start looking at a new rendering design. (meaning no more quick fixes for a few days or more)

kungfoomasta

30-11-2007 03:10:19

Fixed the bug in addText.
Fixed the hard to describe bug I posted above. Basically the text dimensions weren't calculated right, when text was off screen.

Hopefully now the console is more useable. :)

Didn't get around to the skin component additions, will do that after the render portion.