Pink Petal Games
Game Discussion => General Discussion & Download => Topic started 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
-
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?
-
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
-
Thats interesting, i use VC2008 and don't have that problem :D
-
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.
-
I just looked at auto keywords and yes they seem useful... but at the same time I probably won't use them :)
-
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.
-
Sounds good to me, if a bit beyond my capabilities thus far. Any of you feel like going ahead and setting that up?