- Width = mSpriteWidth * mXSpriteCount;
-
- return Width;
-}
-
-int DDSpriteBuffer_Get_Height()
-{
- int Height;
-
- Height = mSpriteHeight * mYSpriteCount;
-
- return Height;
-}
-
-boolean DDSpriteBuffer_CreateFromFile(char *Path, long xSprites, long ySprites)
-{
- boolean CreateFromFile;
-
- DDSURFACEDESC2 SD;
-
- {
- SD.lFlags = DDSD_CAPS; // Or DDSD_WIDTH Or DDSD_HEIGHT
- SD.ddsCaps.lCaps = DDSCAPS_VIDEOMEMORY; // DDSCAPS_SYSTEMMEMORY 'DDSCAPS_OFFSCREENPLAIN
- }
-
- // --- 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:
- CreateFromFile = False;
-
- return CreateFromFile;
-}
-
-boolean DDSpriteBuffer_CreateAtSize(long Width, long Height, long xSprites, long ySprites)
-{
- boolean CreateAtSize;
-
- DDSURFACEDESC2 SD;
-
- {
- SD.lFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
- SD.ddsCaps.lCaps = DDSCAPS_VIDEOMEMORY;
- // SD.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
- SD.LWidth = Width;
- SD.LHeight = Height;
- }
-
- // --- On Error GoTo CreateAtSizeEH
- Buffer = DDraw.CreateSurface(SD);
- // --- On Error GoTo 0
-
- mSpriteWidth = Width / xSprites;
- mSpriteHeight = Height / ySprites;
- mXSpriteCount = xSprites;
- mYSpriteCount = ySprites;
- CreateAtSize = True;
- return CreateAtSize;
-
- // CreateAtSizeEH:
- CreateAtSize = False;
-
- return CreateAtSize;
-}
-
-void DDSpriteBuffer_Cls(int BackColor)
-{
- RECT EmptyRect;
-
- Buffer.BltColorFill(EmptyRect, 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