zinnschlag/openmw — pull request #1086 by rainChu (2013-10-01 15:18:23+00:00)
Title: Fixing Issue 840, fixing compile issues on Windows/Visual Studio 2012

I hope this is good! If something's wrong with it, tell me what it is and I'll fix it up.

In addition to Issue 840, there are commits allowing it to compile on my machine, some of which were done when I was just setting up my environment. As all but one weren't described in detail on the forum or discussed with anyone there, I'll go into what I did and why, in detail, to make your job easier.

I'm a little bit unsure of adjusterwidget.cpp, please make sure I did the right thing there before you pull. However, what I believe was happening was this: native() returns a string native to the machine, which on mine was a L"unicode" string. It wouldn't concatenate with the regular multibyte string. Also, I believe that fromUtf8 expects only a multibyte string.

I had to add a WinMain to the launcher. It simply refused to build with main() by compiling it for SubSystem:Console, Qt disagreed with that (I don't know why it would though) and this seemed like the best way to avoid the problem in the future.

In worldimp.cpp, movePlayerRecord was being called before setUp(). setUp() will populate shared records from the existing static records, and movePlayerRecord will delete the player's shared record. This would cause a runtime failure on my machine the moment movePlayerRecord tried to look for a shared record where none existed. It was a choice between swapping them here or adding a check deeper in. I swapped them.