PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

DrawMask generating INVALIDRECT error with GapiDraw.Net

I have run into a challenge using the DrawMask function to add masks to my GapiMaskSurface. The game I am working on is tile based and certain tiles that affect sprite movement are drawn to the GapiMaskSurface using DrawMask. I can call DrawMask 7 times. On the 8th time, a INVALIDRECT error is generated.

The code is as follows:
Code:

rectCellRect = new GDRect (
iRelativeLeft,
iRelativeTop,
iRelativeLeft + gsCellGraphic.Width,
iRelativeTop + gsCellGraphic.Height);

maskSurface.DrawMask (
ref rectCellRect,
m_GameMap [iRow, iColumn, iLayer].m_Tile.iMaskID);


I am using Visual Studio .NET and GapiDrawNet version 3.0 Beta3. Any suggestions on what may be the problem would be greatly appreciated.

Cheers,
Joe
I am having the same issue if I use the point version of DrawMask as well:
Code:

maskSurface.DrawMask (
iRelativeLeft,
iRelativeTop,
iMaskID);

The specific error is

An unhandled exception of type 'System.Exception' occurred in GapiDrawNet.dll

Additional information: Error C86600E0: INVALIDRECT: One or more GDRects are invalid.


Any thoughts?

Cheers,
Joe
Can you create a simple app that demonstrates the problem, and send it to me at sean@intuitex.com. I'll take a look.