sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0);
#endif
+#if 0
+ {
+ static int mScrollX_tmp = -1;
+ static int mScrollY_tmp = -1;
+
+ if (mScrollX != mScrollX_tmp || mScrollY != mScrollY_tmp)
+ {
+ printf("::: %ld, %ld\n", mScrollX, mScrollY);
+
+ mScrollX_tmp = mScrollX;
+ mScrollY_tmp = mScrollY;
+ }
+ }
+#endif
+
+#if 0
+ {
+ static boolean x = 0;
+
+ if (x == 0)
+ {
+ printf("::: %d, %d (%d, %d) (%d, %d) [%ld, %ld] [%ld, %ld] \n",
+ sx, sy, xsize, ysize, full_xsize, full_ysize,
+ mScrollX, mScrollY, mScrollX_last, mScrollY_last);
+
+ x = 1;
+ }
+ }
+#endif
+
#if 1
if (!menBorder.Checked)
{
}
#endif
+#if 0
+ if (mScrollX >= 0 && mScrollX <= 16)
+ {
+ px -= mScrollX;
+ }
+#if 0
+ else if (mScrollX >= 352 && mScrollX <= 368)
+ {
+ px -= mScrollX;
+ }
+#endif
+ else if (mScrollX >= 16) // && mScrollX <= 352)
+ {
+ px -= TILEX / 2;
+ }
+#endif
+
+#if 0
+ /* !!! TEST ONLY !!! */
+ px = py = 0;
+ sx = sy = SX;
+#endif
+
BlitBitmap(screenBitmap, target_bitmap, px, py, sxsize, sysize, sx, sy);
}
#if 1
- int sx1 = mScrollX_last - 2 * TILEX;
- int sy1 = mScrollY_last - 2 * TILEY;
- int sx2 = mScrollX_last + SXSIZE + 1 * TILEX;
- int sy2 = mScrollY_last + SYSIZE + 1 * TILEY;
+ int scx = (mScrollX_last < 0 ? 0 : mScrollX_last);
+ int scy = (mScrollY_last < 0 ? 0 : mScrollY_last);
+ int sx1 = scx - 2 * TILEX;
+ int sy1 = scy - 2 * TILEY;
+ int sx2 = scx + SXSIZE + 1 * TILEX;
+ int sy2 = scy + SYSIZE + 1 * TILEY;
int sx = pX - sx1;
int sy = pY - sy1;
if (! LevelLoaded)
return;
+ ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
+ ClearRectangle(screenBitmap, 0, 0,
+ MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY);
+
#if 1
SetDisplayRegion();
#endif
#define SXSIZE (SCR_FIELDX * TILEX)
#define SYSIZE (SCR_FIELDY * TILEY)
+#define REAL_SX (SX - 2)
+#define REAL_SY (SY - 2)
+#define FULL_SXSIZE (2 + SXSIZE + 2)
+#define FULL_SYSIZE (2 + SYSIZE + 2)
+
/* ------------------------------------------------------------------------- */
/* data structure definitions */