
[r1250] missing UnlockBuffers(), I think
Problem:
If using debug D3D runtime, and "Break on D3D9 error" set, Doom Builder may hang (if running in the debugger) or bring up the crash dialog (if running outside the debugger) when using brightness mode.
The expected behaviour is that Doom Builder does not produce any Direct3D errors when it is running.
Reproduction steps:
1. Using DirectX Control Panel, Direct3D 9 tab, ensure "Use Debug Version of Direct3D 9" and "Break on D3D9 Error" are both ticked.
2. Load Doom Builder 2 and create new map
3. Enter sector mode, and create new sector
4. Enter brightness mode, and right-click on sector
5. Observe behaviour that may cause loss of work
Fix:
In Sector.CreateSurfaces, there should be a General.Map.CRenderer2D.Surfaces.UnlockBuffers() after the call to UpdateSurfaces. Like so:
Code:
// Update entry
surfaceentry = General.Map.CRenderer2D.Surfaces.UpdateSurfaces(surfaceentry);
General.Map.CRenderer2D.Surfaces.UnlockBuffers();
This is around line 322 on r1250.
Other notes:
Break On Error interacts poorly with the debugger, as VS2005 doesn't support mixed-mode managed/native debugging. Nevertheless, you can see the D3D debug messages using DbgView (
http://technet.microsoft.com/en-us/sysi ... 96647.aspx), and when the thing babs itself you can use "Break All" to be taken to the managed call that caused the problem.
There is another error on startup:
[2540] Direct3D9: (WARN) :Vertexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe.
I didn't look into this. Presumably the severe performance penalty has not been observed in practice if nobody has mentioned it.