Pink Petal Games

Game Discussion => General Discussion & Download => Topic started by: WonderDog on May 07, 2010, 03:25:07 AM

Title: Building in VS 2010
Post by: WonderDog on May 07, 2010, 03:25:07 AM
Here is a quick patch to allow you to build in VS2010 if you want.

There is a ambiguous operator overload with the new iostream support for open method.  I had to typecast all the open(dirpath ...) to string

Its probably not the correct way to do it but it works ;D
Title: Re: Building in VS 2010
Post by: Dagoth on May 07, 2010, 05:31:03 AM
It doesn't work in VC2008 that way, it needs conversion to char (wchar_t, more precisely) and fails to compile.

If you add .c_str() to the end, like string(DirPath() << "blah").c_str(), does that still work in VC2010?
Title: Re: Building in VS 2010
Post by: DocClox on May 07, 2010, 12:03:39 PM
Might be easier to add an open() method to DirPath and have it return an iostream&

That way if we need to start writing #ifdev VS_WHATEVER bits, we can at least centralise them
Title: Re: Building in VS 2010
Post by: necno on May 07, 2010, 05:30:32 PM
Thats interesting, i use VC2008 and don't have that problem :D
Title: Re: Building in VS 2010
Post by: delta224 on May 07, 2010, 07:16:40 PM
The issue with VS 2010 is that microsoft overloaded fstream.open to take a string argument and a c string agrument. The proper way of dealing with this is to drop the string type coersion in dirpath.
 
On the note of VS 2010, you can take the repurposed auto keyword and the lambda keyword from my cold dead hands.
Title: Re: Building in VS 2010
Post by: necno on May 08, 2010, 12:16:59 AM
I just looked at auto keywords and yes they seem useful... but at the same time I probably won't use them :)
Title: Re: Building in VS 2010
Post by: DocClox on May 08, 2010, 02:10:43 AM
By all means drop the string cast operator.  It's one of those things that would have worked well when I first learned C++, but it's pretty much useless now.

An iostream& open() method is probably still a good idea.
Title: Re: Building in VS 2010
Post by: Dagoth on May 10, 2010, 02:45:43 AM
Sounds good to me, if a bit beyond my capabilities thus far. Any of you feel like going ahead and setting that up?