UFO:Alien Invasion

Development => Coding => Topic started by: bfett14 on September 09, 2009, 05:28:40 am

Title: Success: VS2008
Post by: bfett14 on September 09, 2009, 05:28:40 am
Just wanted to share excitement. Managed to compile in VS2008, the whole thing and it even
starts and sort of works. Can't go to ground mission though. Most buttons are off. No save/restore.
There were few challenges compiling code.
1. Some headers must be edited to remove unsupported things line _inline and _attribute_
2. Following libraries needed to be downloaded as source and re-compiled: SDL(3 target projects
    plus bunch of support code), Zlib and jpeg lib, painful to say the least.
3. Couple Mingw libs still needed because M$ did not have few functions.

First thing I wanna do (after it works a bit better) is to print current real time on screen somewhere 8-)

Title: Re: Success: VS2008
Post by: Mattn on September 09, 2009, 08:24:56 am
maybe you could share an archive with all the needed libs and also show us a patch?
Title: Re: Success: VS2008
Post by: criusmac on September 10, 2009, 12:56:29 am
I use vs 6 myself. I wonder if I'll be able to compile with your changes.
Title: Re: Success: VS2008
Post by: Duke on September 10, 2009, 04:09:46 pm
You won't, because MSVC 6 doesn't support IP v6.
Title: Re: Success: VS2008
Post by: bfett14 on September 14, 2009, 02:58:24 am
The latest pain in the butt was libintl. Existing dll does not work well with
latest MSVCRT libs and it took substantial efforts to compile the source.
Nevertheless, the game is loading and seems to work for the most part.
Needless to say the code is now mess  ;D
But hey, it's for fun, right? As for VC6, yes it was a solid product, but again
10 years have passed. Perhaps it's time move on.

Title: Re: Success: VS2008
Post by: Mattn on September 14, 2009, 09:04:30 am
please show us your patches...
Title: Re: Success: VS2008
Post by: Mattn on September 14, 2009, 09:05:22 am
ohh. and please also upload the warnings from vc when you compile the game. often different compilers reports different errors and warnings that might help to find some stupid code bugs.
Title: Re: Success: VS2008
Post by: bfett14 on September 18, 2009, 12:43:50 am
Well, the whole thing compiles and runs. But, I get only 10fps in geoscape and
even less in mission. Not playable. The official build on the same machine
runs fine. The weird thing is that, occasionally, I do see 50fps. That's debug
build. Manual timing says drawing menus seems to take most of the time.
Trying to re-build SDL. My guess is that something is wrong with thread locking
in SDL. Any ideas are welcome.
Title: Re: Success: VS2008
Post by: bfett14 on September 20, 2009, 11:28:56 pm
Never mind. Installing latest video driver mostly cured the problem.
Title: Re: Success: VS2008
Post by: bfett14 on September 29, 2009, 12:28:43 am
Now it completely compiles and runs. I had to re-build all but few
supporting libs. All dependencies on MinGW libs are gone.
Will share code and package as soon as find a suitable
place. Advice is welcome. Must mention it: it's not DEV code, it's
v2.2.1 production 8-)
Title: Re: Success: VS2008
Post by: Kildor on September 29, 2009, 03:35:37 am
> it's not DEV code, it's v2.2.1 production
what`s a useless work :-D
Title: Re: Success: VS2008
Post by: Mattn on September 29, 2009, 07:26:16 am
upload it to rapidshare or something like that. once i was able to download it from somewhere i can host it on my own if needed.
Title: Re: Success: VS2008
Post by: Duke on September 29, 2009, 11:53:53 am
@bfett14:
Now that you know what has to be done in order to compile with VS, do you plan to apply your knowledge to the 2.3 code ?
Title: Re: Success: VS2008
Post by: bfett14 on October 01, 2009, 11:08:02 pm
Yes. That's the idea. I've been out of touch with C/C++ for number of years now.
MS profiler turned out to be good. Found reason for very low combat frame rate.
Hint: runtime checks are costly.  ;D
Title: Re: Success: VS2008
Post by: Duke on October 01, 2009, 11:40:20 pm
Good to hear that :)
I've been working with M$VC 6 for many years, and I really miss several features in C::B :(
Title: Re: Success: VS2008
Post by: Mattn on October 02, 2009, 06:59:19 am
Found reason for very low combat frame rate.
Hint: runtime checks are costly.  ;D

Then please tell us... ;)
Title: Re: Success: VS2008
Post by: bfett14 on October 06, 2009, 02:42:03 am
One of the real-time checks would fill all local variables with 0xCCCCCCC.
R_DrawSurface has 256x256 array which would be re-filled on every one of
great many calls. Moment I turn off the check, the thing starts flying
even in debug mode.    ;D