Alright, I almost figured this out. I narrowed down where the problem probably is. And I''m using old DX7.
for (int rowcount = 0; rowcount < rows; rowcount++)
{
for (int columncount = 0; columncount < columns; columncount++)
{
//tile number
tilenum=columncount+rowcount*columns;
//texture coordinates
//we must skip one pixel so colomn/row count is doubled when adding
recSearch.left = (TileDim * columncount) + columncount;
recSearch.top = (TileDim * rowcount) + rowcount;
recSearch.right = (TileDim * (columncount+1)) + columncount;
recSearch.bottom = (TileDim * (rowcount+1)) + rowcount;
This is my for my regions, which I actually don''t use in their RECT form. The image is 65x65. TileDim = 65 (height AND width of the image, and yes, it is 65x65).
DDSD_Clear(&ddsd);
ptiSpriteList[tilenum].lpddsSprite->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
//grab pitch and surface pointer
lPitch=ddsd.lPitch/sizeof(WORD);
pSurface=(WORD*)ddsd.lpSurface;
//loop through pixels
for(x=recSearch.left;x<(recSearch.left + TileDim -1);x++)
{
for(y=recSearch.top;y<(recSearch.top + TileDim -1);y++)
{
This is the actual alpha blending loop. I know some figure is off somewhere. But for the life of me I can''t figure out what.
Oh, and the surface that is being written to is 64x64 (has to be divisable by 32). However recSearch.left (0) to recSearch.left + TileDim -1 (64) should be ok...
First I tried without an alpha mask in the texture. Then it displayed almost nothing. Then I tried with an alpha mask. The program actually displayed everything BUT the transparent colour.
Can anyone lend a hand? Please?
--gmx