JurassicParkTrespasser icon indicating copy to clipboard operation
JurassicParkTrespasser copied to clipboard

Game Crashes on Window Size Misconfiguration

Open MatthewMilideo opened this issue 3 years ago • 2 comments

Bug Steps

  1. Did a fresh Install of Trespasser.
  2. Grabbed the repo and created a solution via CMAKE. (I had to grab a newer version of CMAKE because the one provided would not run on my system, but I don't think that's related.)
  3. Ran the game in debug mode and it defaulted to software rendering.
  4. Switched the driver to hardware rendering
  5. ****** The driver selection window did not detect possible screen resolutions, the dropdown was empty.
  6. Relaunch the game and it crashes
  7. The direct draw call ** below fails because the backbufferddsd height and width are initialized to zero, and this causes a null pointer exception later in the code.
  8. I resolved by manually editing the width and height in my OpenTrespasser config. I am not sure where to make changes to fix that config, but I figure this is helpful.

Lines 1929 to 1948 in RasterVid.cpp

{
			CDDSize<DDSURFACEDESC2> backbufferddsd;
			backbufferddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
			backbufferddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;

			backbufferddsd.dwWidth = i_width;
			backbufferddsd.dwHeight = i_height;

			if (force16Bit)
				Set16BitPixelFormat(backbufferddsd);
			
			**hres = DirectDraw::pdd4->CreateSurface(&backbufferddsd, &pddsDraw4, NULL);**
			if (FAILED(hres))
			{
				PrintD3D2("Buffer creation failed %x\n", hres);
				AlwaysAssert(0);
				return false;
			}
		}

MatthewMilideo avatar Jun 26 '21 21:06 MatthewMilideo

The issue can be reproduced. So far the video driver settings window has not been given much thought and testing. Choosing a screen resolution does not work either (none are listed). Manually editing the OpenTrespasser.ini for your desired video settings is recommended at this stage.

meekee7 avatar Jun 27 '21 17:06 meekee7

Adressed in PR #173.

meekee7 avatar Aug 29 '21 13:08 meekee7