PocketMatrix forums

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

BltFast() w/ GDBLTFAST_COLORFILL oddness

When using BltFast() w/ GDBLTFAST_COLORFILL a strange thing occurs when trying to draw a surface at a negative location (vertical or horizontal). It appears as if the surface to draw is being clipped to the proper size, but is then being drawn at a location equal to the absolute value of the desired location.

For example, if the color-filled surface is 100 pixels-tall, and I want to position it at vertical location negative-ten (-10), the surface will be clipped to a pixel height of 90, as it should be, but then get drawn at a vertical location of positive-ten (+10).

I'm using Win32, all surfaces are created in SYSTEM-MEMORY and a clipper is set for the back-surface.

DGuy
This sounds very very strange. Clipping should work as expected on BltFast, perhaps you are doing something weird with the variables?
Are you using the latest version?
This sounds very very strange. Clipping should work as expected on BltFast, perhaps you are doing something weird with the variables?

Have a look, maybe I'm fooing something up: :)

This is the code I'm using to set things up (NOTE: error checking has been removed, but all calls are succeeding):
Code:
CGapiDraw* pDraw = new CGapiDraw();
CGapiDisplay* pDisplay = new CGapiDisplay( pDraw );
pDisplay->OpenDisplay( GDDISPLAY_WINDOW, win_hwnd(), w, h, 0, 0, 0, 85 );
CGapiSurface* pBackBuffer = Display->GetBackBuffer();
pBackBuffer->SetClipper( NULL );
CGapiSurface* pSurface = new CGapiSurface( pDraw );
pSurface->CreateSurface( GDSURFACE_SYSTEMMEMORY, "JokerGirl_ckey.bmp" );

Here is the original image placed at the mouse cursor location (NOTE: the mouse coordinates at the upper-left of screen):
Image

Here is the image moved off-screen to a negative location (NOTE: the mouse button was pressed down and the mouse captured with SetCapture()):
Image

So far the images is being drawn using the following code with no keys pressed:
Code:
GDBLTFASTFX fx;
memset( &fx;, 0, sizeof(GDBLTFASTFX) );
DWORD flags = 0;
if( inp_keydown( KEY_1 ) ) {
flags |= GDBLTFAST_COLORFILL;
fx.dwFillColor = RGB(255,255,32);
}
pBackBuffer->BltFast( inp_mousex(), inp_mousey(), pSurface, NULL, flags, &fx; );


When '1' is pressed, below is the results (NOTE: the mouse cursor has not been moved. Also is does not matter if the mouse button is up or still-down):

Image

Do you see something, I'm not?

Thanks,
DGuy
And to answer you second question: Yes, I'm using the most recent evaluation version. Downloaded on Fri, 21 Oct 2005.

DGuy