OpenXcom Forum

Contributions => Programming => Topic started by: luciderous on August 01, 2010, 09:51:09 am

Title: Window popup animation
Post by: luciderous on August 01, 2010, 09:51:09 am
Something has been bugging me for quite a long time recently and I really didn't get what was exactly the reason. Finally, I've found the culprit - it was the window popup animation lag. I've double-checked it with the original X-Com and it was totally missing there - the windows popped up instantly!
Looking deeper into "Window.cpp" I noticed, that such a behavior seems to have been intended, while it definitely should have not. Thus I decided to make a small hack-fix. Of course, it may render some other code in the same file unnecessary, but is to SupSuper to decide.
Title: Re: Window popup animation
Post by: michal on August 01, 2010, 12:08:41 pm
IMHO you should post such patches in "contributions" forum.
Title: Re: Window popup animation
Post by: SupSuper on August 02, 2010, 01:48:08 am
Actually the window popup animation was present in the original X-Com. Every window that plays a sound when it pops up has this animation. The reason you see it "pop up instantly" in the original is because the animation is CPU-dependant, so on modern computers the animation will always play at full speed (much like stuff like the Geoscape and Battlescape scrolling are hyper-fast on modern computers). You will only see it on the DOS version running it on a properly slowed-down-emulator, or on the Windows version (example here (https://www.youtube.com/watch?v=S3Y1JsFxwzU#t=1m12s)) which was better calibrated (specially with UFO Extender), or even the PSX version.

If this is annoying to you though, I will look into adding an option in the future to disable it.
Title: Re: Window popup animation
Post by: Eeyoocah5Moh on August 02, 2010, 01:48:43 am
Image attached. Ufopaedia window popup both horizontally and vertically. Slow down game in dosbox and you will see it.
Title: Re: Window popup animation
Post by: Eeyoocah5Moh on August 02, 2010, 01:53:07 am
If this is annoying to you though, I will look into adding an option in the future to disable it.

Adding option for each thing is not good at all. Maybe just make the popup a little faster? Current speed is the same as Windows version? If not, then maybe just tweak it a little?
Title: Re: Window popup animation
Post by: SupSuper on August 02, 2010, 06:43:02 am
If this is annoying to you though, I will look into adding an option in the future to disable it.

Adding option for each thing is not good at all. Maybe just make the popup a little faster? Current speed is the same as Windows version? If not, then maybe just tweak it a little?
The current window popup takes around 0.13s, any faster and it'd be gone. I imagine it's faster than the Windows version, there's no real accurate way to find out so I just went with what feels right. Plus technically you don't need to wait for the popup because the controls pop up instantly (unlike in X-Com, because I'm lazy and sloppy sometimes :P).

As for options, well as long as each thing is as simple as a line of code, I'm fine with that. Even if each thing is just a nag, I'm fine with that too. I won't take care of it post-haste, but I like to show I'm not ignoring it either. After all, that's kind of the point of this thing. That's why mods like UFO Extender are so popular, because they take care of all the options and nags that the fanbase has always wanted.
Title: Re: Window popup animation
Post by: luciderous on August 02, 2010, 08:14:47 am
Plus technically you don't need to wait for the popup because the controls pop up instantly (unlike in X-Com, because I'm lazy and sloppy sometimes :P).
That's exactly what was nagging me! ::)
I can perfectly live with the popup animation, but right now the text appears before the box does and it feels rather awkward. Perhaps syncing them will do the trick  :)
Title: Re: Window popup animation
Post by: SupSuper on August 02, 2010, 10:19:07 pm
Curses, foiled again! :P Now it's no longer a single-line fix.
Title: Re: Window popup animation
Post by: pmprog on August 03, 2010, 12:27:00 pm
Sure there is.

Code: [Select]
if( currentSize == destinationsize )
   AddControls()

 :D
Title: Re: Window popup animation
Post by: SupSuper on August 04, 2010, 12:59:41 am
Sure there is.

Code: [Select]
if( currentSize == destinationsize )
   AddControls()

 :D

Damn, if only programming was that easy, I could've been done months ago!

Code: [Select]
int main(int argc, const char* argv[])
{
Xcom();
}

:D
Title: Re: Window popup animation
Post by: pmprog on August 04, 2010, 09:03:16 am
Joking aside, it is pretty much that easy.

What I would do is

Edit: Would you like me to create a "demo" patch?
Title: Re: Window popup animation
Post by: SupSuper on August 05, 2010, 03:44:39 am
I appreciate the idea but it's been fixed for a while (well, since Tuesday anyways) if you missed it. :P I also found some other bugs that might've been nagging users worldwide in the process, so in the end it was win-win!
Title: Re: Window popup animation
Post by: pmprog on August 05, 2010, 09:03:21 am
Yip, I missed it, not done much programming outside of work lately  :(
I'll have to update my SVN and take a look