Progress bar
Moderator: Forum Moderators
Progress bar
When browsing the forum I saw there was a thread on showing something earlier during startup and since I was curious about how Wesnoth worked I looked a bit deeper on it. The following patch when applied shows a simple big progress bar during startup. I also think applying something like this during campaign loading would be desireable since slow machines like mine take ages to do that (actually about slightly less than minute).
edit: Removed the patch as it is now outdated
edit: Removed the patch as it is now outdated
Last edited by Kvasir on March 19th, 2006, 6:17 pm, edited 2 times in total.
Ok, I just looked at your patch on patches. wesnoth.org and yes, it's a step in the right directions.... here are a couple of steps to help
1) better granularity would be nice
2) a line telling what the game is doing would be nice
3) display.cpp seems a good place to put your stuff so it's ok
I didn't commit it because you said in your p.w.o comment that you wanted to work on it some more... so just tell me when you're ready here and it will go in.
thx
Boucman
1) better granularity would be nice
2) a line telling what the game is doing would be nice
3) display.cpp seems a good place to put your stuff so it's ok
I didn't commit it because you said in your p.w.o comment that you wanted to work on it some more... so just tell me when you're ready here and it will go in.
thx
Boucman
Fight key loggers: write some perl using vim
When reading or verifying the cache it recursively calls an _internal function with as far as I could see no easy way to find out how many times the function will be called. For now I just use a magic number that has been set after logging the amount of function calls and it works fine but that number obviously requires updating after each data set update. So my question is if there is a way to find out how many times the code is going to call this function inside the code?
-
- Retired Developer
- Posts: 1086
- Joined: September 16th, 2005, 5:44 am
- Location: Hamburg, Germany
Hmm, shouldn't a static variable inside of that function do this job?Kvasir wrote:When reading or verifying the cache it recursively calls an _internal function with as far as I could see no easy way to find out how many times the function will be called. For now I just use a magic number that has been set after logging the amount of function calls and it works fine but that number obviously requires updating after each data set update. So my question is if there is a way to find out how many times the code is going to call this function inside the code?
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
You could store store the value in the highest level of the cache. Than when you are loading the cache, you could use that information. But, as far as determining how deep the rabbit hole goes the first time, you got have to take the red pill.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
The current version which is on patches.wesnoth.org introduces better granularity during startup. The total percentage to game config loading is fixed which means progress is too slow when there is no cache. It doesn't bother me but if people find it important I can change it.
I also didn't include a logo and the strings are hardcoded in the executable. If there are good ideas about on stuff to add here feel free to propose it.
I also changed the structure, everything is now in two seperate files, I did this mainly to speed up rebuilding (display.hpp is used in many files) but I guess it may also make it easier for others to adapt the code.
The recursive thing was already counted by static variables, the final count is written out on stderr and I manually copied these over as the magic number constants in the code.
I also didn't include a logo and the strings are hardcoded in the executable. If there are good ideas about on stuff to add here feel free to propose it.
I also changed the structure, everything is now in two seperate files, I did this mainly to speed up rebuilding (display.hpp is used in many files) but I guess it may also make it easier for others to adapt the code.
The recursive thing was already counted by static variables, the final count is written out on stderr and I manually copied these over as the magic number constants in the code.
-
- Retired Developer
- Posts: 1086
- Joined: September 16th, 2005, 5:44 am
- Location: Hamburg, Germany
Unless i am not mistaken, there is a problem with the patch. binary_wml now has a dependency to loadscreen and this one directly or indirectly needs all the other stuff within wesnoth.
On the other hand, wesnothd (the server app) builds with binary_wml and therefore also "inherits" all those dependencies. This should be fixed or it will become a pain to build wesnothd.
On the other hand, wesnothd (the server app) builds with binary_wml and therefore also "inherits" all those dependencies. This should be fixed or it will become a pain to build wesnothd.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
agreed.Yogi Bear wrote:Unless i am not mistaken, there is a problem with the patch. binary_wml now has a dependency to loadscreen and this one directly or indirectly needs all the other stuff within wesnoth.
On the other hand, wesnothd (the server app) builds with binary_wml and therefore also "inherits" all those dependencies. This should be fixed or it will become a pain to build wesnothd.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358