diasurgical / devilution

Diablo devolved - magic behind the 1996 computer game
Other
8.79k stars 920 forks source link

[MSVC][permissive-] devilution failed to build with /permissive- on MSVC #2269

Closed QuellaZhang closed 2 years ago

QuellaZhang commented 2 years ago

Hi All,

The MSVC team recently added devilution as part of RWC testing. And we found some errors when building devilution with '/permissive-'. Could you please help look at this issue? Thanks in advance.

Repro steps:

  1. open VS2022 x86 Tools command
  2. git clone https://github.com/diasurgical/devilution F:\gitP\diasurgical\devilution
  3. set CL=/permissive-
  4. cd F:\gitP\diasurgical\devilution
  5. msbuild /maxcpucount:1 /p:Platform=x86 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.18362.0 Diablo.sln /t:Rebuild

Build log:build (3).log

Error info: f:\gitp\diasurgical\devilution\diabloui_temp_data.cpp(83): error C2440: 'initializing': cannot convert from 'const char [7]' to 'char ' f:\gitp\diasurgical\devilution\diabloui\copyprot.cpp(13): error C2664: 'BOOL SDlgDialogBoxParam(HINSTANCE,char ,int,WNDPROC,int)': cannot convert argument 2 from 'const char [16]' to 'char ' f:\gitp\diasurgical\devilution\diabloui\cr8game.cpp(70): error C2664: 'BOOL SDlgDialogBoxParam(HINSTANCE,char ,int,WNDPROC,int)': cannot convert argument 2 from 'const char [19]' to 'char ' f:\gitp\diasurgical\devilution\diabloui\cr8game.cpp(201): error C2664: 'BOOL local_LoadArtWithPal(HWND,int,char ,int,int,const char *,BYTE ,DWORD ,BOOL)': cannot convert argument 3 from 'const char [7]' to 'char ' f:\gitp\diasurgical\devilution\diabloui\creadung.cpp(119): error C2664: 'BOOL local_LoadArtWithPal(HWND,int,char ,int,int,const char ,BYTE ,DWORD ,BOOL)': cannot convert argument 3 from 'const char [6]' to 'char ' f:\gitp\diasurgical\devilution\diabloui\creadung.cpp(259): error C2664: 'BOOL SDlgDialogBoxParam(HINSTANCE,char ,int,WNDPROC,int)': cannot convert argument 2 from 'const char [15]' to 'char '

AJenbo commented 2 years ago

Thanks, but you might want to use https://github.com/diasurgical/devilutionX instead as that is the one that is actively being maintained for compatibility with modern compilers and operating systems.

If you decide to stick with the plain old Devilution then please be aware that DiabloUI is not functional and only there as a stub to help understand the rough structure of the DLL. As such only issues with the exe will be looked into, as that is the only part we build.

P.s. the bugs we have reported regarding the MSVC compiler were related to DevilutionX and not Devilution, in case that's relevant.

QuellaZhang commented 2 years ago

Thanks for the heads up, it seems like a more active repo would be a better fit for us. We will switch to DevilutionX. Close this issue.

galaxyhaxz commented 2 years ago

Cool you've added the diablo project to MSVC (:

All the build errors you are getting are related to the DiabloUI. This portion of the code is pretty raw and unfinished, no one (including me) ever bothered to clean it up. So it's essentially crap spat out from the decompiler. It was easier to just reimplement on our own lol.

The actual base code should compile just fine, the project provides a working SLN for VS2017 iirc.

sskras commented 2 years ago

@galaxyhaxz commented 3 hours ago

All the build errors you are getting are related to the DiabloUI. This portion of the code is pretty raw and unfinished, no one (including me) ever bothered to clean it up.

I still have the idea of putting it on my table one day. I would like to have the diabloui.dll as much original. Just for the sake of mathematical completeness of the project and to build stricter test cases for Wine project (and the bug report circa 2004):

DirectDraw games only showing black screen

galaxyhaxz commented 2 years ago

Yeah, the DDraw bug is nasty, I posted a WINE hack for it way back in like 2014 when I was still in high school lol.

I would like to have the diabloui.dll as much original

Well, message me on Discord or email and I can help you with that ;)