- RECT DR, SR;
-#if 0
- long Tmp;
-#endif
-
- int sx1 = mScrollX - TILEX;
- int sy1 = mScrollY - TILEY;
- int sx2 = mScrollX + SXSIZE + TILEX;
- int sy2 = mScrollY + SYSIZE + TILEY;
- int x1 = sx1 / TILEX;
- int y1 = sy1 / TILEY;
-#if 0
- int x2 = sx2 / TILEX;
- int y2 = sy2 / TILEY;
-#endif
-
- int sx = pX - x1 * TILEX;
- int sy = pY - y1 * TILEY;
-
-#if 0
- printf(":1: DDSpriteBuffer.c: Blt(): %d, %d [%ld, %ld]\n",
- pX, pY, mScrollX, mScrollY);
-#endif
-
- if (NoDisplayFlag)
- return;
-
-#if 1
- if (TEST_flag)
- {
- if (pX < sx1 || pX >= sx2 || pY < sy1 || pY >= sy2)
- printf("::: DDSpriteBuffer.c: Blt(): %d, %d [%d..%d, %d..%d] (%d, %d) [SKIPPED]\n",
- pX, pY, sx1, sx2, sy1, sy2, mScrollX, mScrollY);
- else
- printf("::: DDSpriteBuffer.c: Blt(): %d, %d [%d..%d, %d..%d] (%d, %d)\n",
- pX, pY, sx1, sx2, sy1, sy2, mScrollX, mScrollY);
- }
-#endif
-
- /* do not draw fields that are outside the visible screen area */
- if (pX < sx1 || pX >= sx2 || pY < sy1 || pY >= sy2)
- return;
-
-#if 0
- printf(":2: DDSpriteBuffer.c: Blt(): %d, %d [%ld, %ld]\n",
- pX, pY, mScrollX, mScrollY);
-#endif
-
- {
- DR.left = pX + mDestXOff;
- DR.top = pY + mDestYOff;
- DR.right = pX + mSpriteWidth + mDestXOff;
- DR.bottom = pY + mSpriteHeight + mDestYOff;
- }
- {
- SR.left = mSpriteWidth * (SpriteX - 1);
- SR.top = mSpriteHeight * (SpriteY - 1);
- SR.right = SR.left + mSpriteWidth;
- SR.bottom = SR.top + mSpriteHeight;
- }
-
-#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
-
-#if 1
- BlitBitmap(sp_objects, screenBitmap,
- SR.left, SR.top,
- mSpriteWidth, mSpriteHeight,
- sx, sy);
-#else
- BlitBitmap(sp_objects, screenBitmap,
- SR.left, SR.top,
- mSpriteWidth, mSpriteHeight,
- DR.left, DR.top);
-#endif
-
-#else
- Tmp = mDest.Blt(DR, &Buffer, SR, DDBLT_WAIT);
-#endif