Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Crashes on Window Size Misconfiguration #168

Open
MatthewMilideo opened this issue Jun 26, 2021 · 2 comments
Open

Game Crashes on Window Size Misconfiguration #168

MatthewMilideo opened this issue Jun 26, 2021 · 2 comments

Comments

@MatthewMilideo
Copy link

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;
			}
		}
@meekee7
Copy link
Contributor

meekee7 commented Jun 27, 2021

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
Copy link
Contributor

meekee7 commented Aug 29, 2021

Adressed in PR #173.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants