Loading bar not working

ruichaves

05-09-2007 16:12:49

Loading bar not working with version 0.9.6b....


i have updated to version 0.9.6b and now the loading bar is not setting the progress properly...

:?

any fix for this?

kungfoomasta

05-09-2007 16:36:15

I need a lot more detail other than "not working". As far as I know it is working in v0.9.6b, although I did find a bug with it a few days ago. Are you saying the demo Heal/Hurt buttons do not change the progress? What is the behavior you are seeing, and what is the behavior you expect?

ruichaves

05-09-2007 16:46:47

Well, i have this working well, with version 0.9.6.. i don't have change nothing!

what i see is when i setProgress( progress ) the loading bar will be set to 1, the loading bar is showned full at the begining..

the expected behaviour is that the loading bar growing at wich setProgress...

i don't have tryed the demo. i go to try and see if this happens..

kungfoomasta

05-09-2007 17:10:54

setProgress(0.5), setProgress(0.25), and setProgress(0.75) all show a full Bar?

ruichaves

05-09-2007 17:21:30

the inicialization:
loadingBar = mSheetLoading->createProgressBar(QuickGUI::Rect(0.0,0.80,1.0,0.078));
loadingBar->setTexture("lost.progressbar.png");
loadingBar->setProgress(0.0);


and then i put:

loadingBar->setProgress( 0.25);

other try was:

loadingBar->setProgress( 0.5);

kungfoomasta

05-09-2007 17:25:03

Can you post your "lost.progressbar.png" and "lost.progressbar.bar.png" files?

ruichaves

05-09-2007 17:27:25

i think i see your bug in progress bar constructor

ProgressBar::ProgressBar(const Ogre::String& name, const Rect& dimensions, GuiMetricsMode positionMode, GuiMetricsMode sizeMode, const Ogre::String& texture, RenderObjectGroup* group, Widget* ParentWidget) :
Widget(name,dimensions,positionMode,sizeMode,texture,group,ParentWidget),
mInitialPixelOffset(0),
mProgress(1.0),
mFillDirection(FILLS_NEGATIVE_TO_POSITIVE)
{


you have the mProgress initiated to 1.0... i think is this?!?

mProgress(1.0)

ruichaves

05-09-2007 17:32:49

My images of progress bar are:


lost.progressbar.bar.png



and lost.progressbar.png



Any idea how this can be fixed?

ruichaves

05-09-2007 23:01:57

how to fix this problem??

kungfoomasta

05-09-2007 23:26:58

I'll have to repro this when I get home, unless you can investigate this on your own.

Breakpoint at ProgressBar::setProgress, step into the code, and see why the resulting image is not being correctly created. Did you try the demo? Last I remember the ProgressBar was working there. Can you confirm?

ruichaves

06-09-2007 03:23:28

i think i found another bug:



this happens when i change the state, from single player for example when i have the loading bar to menu state, and again i go to single again..

i'm doing the clear() when i change state...

Other thing the texture are the same showned above...
lost.progressbar.bar.png
lost.progressbar.png

ruichaves

06-09-2007 04:00:48

I'll have to repro this when I get home, unless you can investigate this on your own.

Breakpoint at ProgressBar::setProgress, step into the code, and see why the resulting image is not being correctly created. Did you try the demo? Last I remember the ProgressBar was working there. Can you confirm?


I have tryed the demo and it works well...

then, in my aplication, i try to not set the texture
// loadingBar->setTexture("lost.progressbar.png");

and then it works!! it use your images!

so i think the problem is with the settexture, something related too!
could you recreate the problem with my images, and see the problem!

please report me if this happens!!!

ruichaves

06-09-2007 04:01:33

i think i found another bug:



this happens when i change the state, from single player for example when i have the loading bar to menu state, and again i go to single again..

i'm doing the clear() when i change state...

Other thing the texture are the same showned above...
lost.progressbar.bar.png
lost.progressbar.png


And i think this problem is related too...

ruichaves

06-09-2007 04:15:59

There's another thing, when i load using my images (but with the names of qgui...)...

Seems that the inicial position isn't be 0 but some value.. and when it's full, the load is showned well!!!





my code is this, to init the progress bar:

loadingBar = mSheetLoading->createProgressBar(QuickGUI::Rect(0.0,0.80,1.0,0.078));
// loadingBar->setTexture("lost.progressbar.png");
loadingBar->setInitialPixelOffset(0);
loadingBar->setProgress(0.0);

kungfoomasta

06-09-2007 06:34:27

I see it working on my end, but I am using SVN and not 0.9.6b.

modified right in the demo app:
lifeBar = mSheet->createProgressBar(Rect(0.4,0.55,0.2,0.03),"lost.progressbar.png");

I also see the slight misalignment of the bar over the background. Can you do 2 things:

1) Put a 1 pixel transparent border around the images. (modify both files)
2) Reduce the top and bottom of the Bar image, it completely covers the Background image, overlapping and covering the small green borders you made. (make top and bottom smaller in lost.progressbar.bar.png)

I think step 1 above should solve the problem.. if not I'll look into it tomorrow.

Also, I have made a TON of changes in SVN. The demo loads, but don't be surprised if I forgot to fix some things.. :P

Thanks for the bug you posted earlier in this thread, I went ahead and fixed that.

ruichaves

06-09-2007 16:51:14

Thanks in advance, i will try that tips...

other thing, i'm running out time, so i need a version stable

can you make a version with this fixes?? like 0.9.6c, i will be grateful

kungfoomasta

06-09-2007 17:11:14

Can you grab the code from SVN? I fix things as I run across them, and every day I make a lot of changes/fixes/etc to the library, so I can't really gaurantee a stable version of the library.. I would suggest getting familiar with tortoiseSVN and doing a checkout of the code tonight, after I finish cleaning up the Widget class, and remove all Singletons.

Hope that helps.

ruichaves

06-09-2007 17:57:11

1) Put a 1 pixel transparent border around the images. (modify both files)

I do this, but it don't work out.. still have the defect...


Can you grab the code from SVN? I fix things as I run across them, and every day I make a lot of changes/fixes/etc to the library, so I can't really gaurantee a stable version of the library..

Yes.. i have the code from svn, it's not working...
Have errors compiling the source of quickgui.. and the demo doesn't work too...
Ok, i will checkout from svn this night.
Tell me when you fix this things! then i get the code from svn!

thx in advance

kungfoomasta

06-09-2007 18:29:36

Sorry, but you're pushing me to the point of irritation. I've been doing everything for you since v0.9.0, its time you started putting in some effort. Instead of putting out your hand and asking for everything, why don't you see what you can do to make it *work*. All I hear is "It doesn't work." that tells me nothing. I'm sorry, but if it works on my end, and doesn't work on your end, and all you can tell me is that it "don't work", there isn't anything I can do. I know you know how to code and debug, why not spend some time seeing what is happening under the hood.

ruichaves

06-09-2007 20:30:29

:oops:

ruichaves

06-09-2007 21:27:57

COMPILLING QUICKGUI FROM SVN ............


------ Build started: Project: QuickGUI, Configuration: Debug Win32 ------
Compiling...
QuickGUIListItem.cpp
c:\quickguisvn\quickgui\src\quickguilistitem.cpp(83) : error C2082: redefinition of formal parameter 'args'
c:\quickguisvn\quickgui\src\quickguilistitem.cpp(84) : error C2664: 'QuickGUI::Widget::fireEvent' : cannot convert parameter 2 from 'const QuickGUI::EventArgs' to 'QuickGUI::EventArgs &'
Conversion loses qualifiers
Build log was saved at "file://c:\QuickguiSVN\QuickGUI\Debug\BuildLog.htm"
QuickGUI - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


This is what i talk about, when i said: "Yes.. i have the code from svn, it's not working...
Have errors compiling the source of quickgui.. and the demo doesn't work too... "

kungfoomasta

06-09-2007 21:33:30

I don't have access to my code, can you post lines 83 and 84? I made some quick changes this morning, I have a feeling that caused the problem. :oops:

If I remember right, the code probably looks something like:

WidgetEventArgs args(this);
fireEvent(..,args);

The problem is that the function already has a variable called args! Change this to something else, like tempArgs, that should solve the issue. I should have made sure the lib built correctly this morning, dumb mistake on my part. I will fix this up when I get home.

ruichaves

06-09-2007 21:37:04

THIS IS THE CODE

LINES 83, 84


bool ListItem::onLoseFocus(const EventArgs& args)
{
WidgetEventArgs args(this);
return fireEvent(EVENT_LOSE_FOCUS,args);
}


Because of it, i can't compile the lib, and can't run the demo from the SVN...

kungfoomasta

06-09-2007 21:47:02

Like I said. If you re-read my post I give you the solution... here it is, you need to replace the code with the following. Don't make any modifications, it must be exactly like this, or your computer will explode and zombies will take over your neighborhood (VERY IMPORTANT):


bool ListItem::onLoseFocus(const EventArgs& args)
{
WidgetEventArgs tempArgs(this);
return fireEvent(EVENT_LOSE_FOCUS,tempArgs);
}