On 3 October 2013 21:16, Lasse Rasinen <lrasinen(a)iki.fi> wrote:
According to debugging output, Artemis Spaceship Bridge Simulator 2.0 calls LockRect twice on the same texture (for whatever reason) and crashes.
http://bugs.winehq.org/show_bug.cgi?id=34271
This change prevents the locked_rect being overwritten with garbage in that case, and the game no longer crashes.
I think this patch makes sense, but could you please add a test case as well? Ideally we'd also have similar tests for other resources (i.e., textures, volumes, vertex buffers, index buffers) and D3D versions (ddraw, d3d8), but that's not a strict requirement.
+ if (hr == WINED3D_OK) { + locked_rect->Pitch = map_desc.row_pitch; + locked_rect->pBits = map_desc.data; + }
Minor style issue, this should be: if (SUCCEEDED(hr)) { ... }