eXpl0it3r / Schiffbruch

Schiffbruch is a mix of building, strategy and adventure and gets played with a two-dimensional view.
Other
74 stars 11 forks source link

DirectDraw init #3

Open FSMaxB opened 7 years ago

FSMaxB commented 7 years ago

Running Schiffbruch fails with the error DirectDraw Init FAILED: -2147467263.

Then there seems to be a null pointer dereference of lpDDSBack here

Build environment:

eXpl0it3r commented 7 years ago

It works fine on my (native) Windows 10 machine.

The number is the error code returned by either GetAttachedSurface or some other DirectDraw function. Unfortunately MSDN doesn't tell you what the actual values of these macros are, so I can't map your number to the error.

Since you're running things inside a VirtualBox, you may have to activate hardware acceleration or "2D support" or similar. Try to play around with some of the VirtualBox's graphics settings.

Odd that you report the crash at the linked location, because once you get the error, the window should be destroyed/closed and the game should stop working or rather never start working.

FSMaxB commented 7 years ago

The windows pops up inside of InitDDraw here.

Not sure how to get access to the error code since it is a void function.

FSMaxB commented 7 years ago

I'm currently setting up a native windows installation.

eXpl0it3r commented 7 years ago

The error messge gets generated here, maybe if you set a break point you can see what the code resolves to.

FSMaxB commented 7 years ago

Oh, I mistakingly thought this was a Microsoft function. Sure, I'll look into it further.

FSMaxB commented 7 years ago

It is the call to SetDisplayMode, the error is E_NOTIMPL Not implemented. The function SetDisplayMode is called with the proper parameters as it seems.

FSMaxB commented 7 years ago

Seems like I don't need any native windows after all. It's really strange but changing the resolution from 1280x720 to 1024x768 solved the problem and Schiffbruch runs fine (except there is no sound, but that doesn't really matter at the moment).

eXpl0it3r commented 7 years ago

Hmm there was a limitation as what resolution could be used. Given the SFML window with DirectDraw surface hack, it's a limitation we'll have to live with until things are properly ported to SFML.