X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDSpriteBuffer.c;h=e7412265cfde796c41926c6280793321eef035cd;hb=29ea60b3d59414875c3bbc59e64f62d2e236ef2a;hp=1384a38fa78949e15deed57355b9699b6dc7c80f;hpb=5ba7f2d9a3f07f342afdf215a3307d5487cb6d43;p=rocksndiamonds.git diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 1384a38f..e7412265 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -15,11 +15,11 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY); // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "DDSpriteBuffer"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "DDSpriteBuffer"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; // --- Option Explicit // needs reference to: DirectX7 for Visual Basic Type Library @@ -106,18 +106,27 @@ boolean DDSpriteBuffer_CreateFromFile(char *Path, long xSprites, long ySprites) } // --- On Error GoTo CreateFromFileEH +#if 1 + SD.LWidth = 16 * TILEX; + SD.LHeight = 16 * TILEY; +#else Buffer = DDraw.CreateSurfaceFromFile(Path, SD); +#endif // --- On Error GoTo 0 +#if 0 Buffer.GetSurfaceDesc(SD); +#endif + mSpriteWidth = SD.LWidth / xSprites; mSpriteHeight = SD.LHeight / ySprites; mXSpriteCount = xSprites; mYSpriteCount = ySprites; + CreateFromFile = True; return CreateFromFile; -CreateFromFileEH: + // CreateFromFileEH: CreateFromFile = False; return CreateFromFile; @@ -148,7 +157,7 @@ boolean DDSpriteBuffer_CreateAtSize(long Width, long Height, long xSprites, long CreateAtSize = True; return CreateAtSize; -CreateAtSizeEH: + // CreateAtSizeEH: CreateAtSize = False; return CreateAtSize; @@ -164,7 +173,13 @@ void DDSpriteBuffer_Cls(int BackColor) static void Blt(int pX, int pY, int SpriteX, int SpriteY) { RECT DR, SR; +#if 0 long Tmp; +#endif + +#if 0 + printf("::: DDSpriteBuffer.c: Blt(): %d, %d\n", pX, pY); +#endif if (NoDisplayFlag) return; @@ -181,7 +196,26 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) SR.right = SR.left + mSpriteWidth; SR.bottom = SR.top + mSpriteHeight; } - Tmp = mDest_Blt(DR, Buffer, SR, DDBLT_WAIT); + +#if 0 + printf("::: DDSpriteBuffer.c: Blt(): %d, %d\n", DR.left, DR.top); +#endif + +#if 0 + if (pX == 0 * StretchWidth && pY == 0 * StretchWidth) + printf("::: TEST: drawing topleft corner ...\n"); + if (pX == 59 * StretchWidth && pY == 23 * StretchWidth) + printf("::: TEST: drawing bottomright corner ...\n"); +#endif + +#if 1 + BlitBitmap(sp_objects, screenBitmap, + SR.left, SR.top, + mSpriteWidth, mSpriteHeight, + DR.left, DR.top); +#else + Tmp = mDest.Blt(DR, &Buffer, SR, DDBLT_WAIT); +#endif } void DDSpriteBuffer_BltEx(int pX, int pY, int SpritePos) @@ -225,8 +259,12 @@ void DDSpriteBuffer_BltEx(int pX, int pY, int SpritePos) // End If // End Function +#if 0 + static void Class_Initialize() { mDestXOff = 0; mDestYOff = 0; } + +#endif