Hi all,
I need to serialize DX9 commands to file.
It generally works quite well, but I encountered a case which I don't really understand,
and would really appreciate your help.
In a certain game (not mine, a commercial game), there is a LockRect() called on a surface.
The surface details are:
Format D3DFMT_A8R8G8B8 (21) _D3DFORMAT
Type D3DRTYPE_SURFACE (1) _D3DRESOURCETYPE
Usage 1 unsigned long
Pool D3DPOOL_DEFAULT (0) _D3DPOOL
MultiSampleType D3DMULTISAMPLE_NONE (0) _D3DMULTISAMPLE_TYPE
MultiSampleQuality 0 unsigned long
Width 1280 unsigned int
Height 720 unsigned int
However, when the LockRect() function returns, the returned pitch is 1024.
This kinda destroys all I understood about pitch :/
I thought that the pitch should be at least width * pixel_size, which in this case is (1280 * 4) = .5120, which is much higher than 1024 ...
Note:
1. As you can see, this is not a compressed format.
2. The lock flag contain only D3DLOCK_NOSYSLOCK.
Which AFAIK, apart from describing not doing a sys-lock, also means it's both read+write,
since there's no other flag.
3. The "RECT* pRect" argument in LockRect() is NULL.
Can you help me understand what is going on?
Thanks,
Yoel.