// --- Option Explicit
// --- Option Compare Text
+#if 0
+
long SetParent(long hWndChild, long hWndNewParent);
long SetWindowLong(long hWnd, long nIndex, long dwNewLong);
long GetWindowLong(long hWnd, long nIndex);
+#if 0
long GetTempPath(long nBufferLength, char *lpBuffer);
+#endif
long GetWindowText(long hWnd, char *lpString, long cch);
+#endif
+
+#if 0
+
#define GWL_STYLE ((-16))
#define WS_CHILD (0x40000000)
#define WS_POPUP (0x80000000)
+#endif
+
// [UNCOMMENTED] Dim StretchWidth2&
char *MpxBmp;
#endif
+void DrawFrameIfNeeded()
+{
+ DrawFrame(0);
+
+ /* !!! CHECK THIS !!! */
+#if 1
+ if (! menBorder.Checked)
+ DrawFrame(1);
+#endif
+}
+
void DisplayLevel()
{
int X, Y;
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
DrawFrame(0);
-#if 0
+ /* !!! CHECK THIS !!! */
+#if 1
if (! menBorder.Checked)
DrawFrame(1);
#endif
PauseMode = 0;
// BaseWidth = 16
- menBorder_Click();
+#if 1
+ if (0)
+ menBorder_Click();
+#endif
Loaded = True;
#endif
+#if 1
+
+static void DrawFrame(int Delta)
+{
+ int i, LX, tY, RX, BY;
+
+ LX = -1 + Delta;
+ tY = -1 + Delta;
+ RX = FieldWidth - Delta;
+ BY = FieldHeight - Delta;
+ DrawImage(LX, tY, imgFrameCorner);
+ DrawImage(LX, BY, imgFrameCorner);
+ DrawImage(RX, tY, imgFrameCorner);
+ DrawImage(RX, BY, imgFrameCorner);
+ for (i = LX + 1; i <= RX - 1; i++)
+ {
+ DrawImage(i, tY, imgFrameHorizontal);
+ DrawImage(i, BY, imgFrameHorizontal);
+ }
+
+ for (i = tY + 1; i <= BY - 1; i++)
+ {
+ DrawImage(LX, i, imgFrameVertical);
+ DrawImage(RX, i, imgFrameVertical);
+ }
+}
+
+#else
+
static void DrawFrame(int Delta)
{
int i, LX, tY, RX, BY;
}
}
+#endif
+
static void RestoreFrame()
{
int i, LX, tY, RX, BY;
UpdateDeltaT();
#endif
+#if 1
+#endif
+
#if 0
printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n");
#endif
#endif
}
+#if 0
static void SetScrollEdges()
+#else
+void SetScrollEdges()
+#endif
{
#if 0
printf("::: MainForm.c: SetScrollEdges() ... [%ld, %ld, %ld, %ld] [%f, %d] [%d, %d, %d, %d]\n",
tsi = GetSI(X, Y);
Tmp = LowByte(PlayField16[tsi]);
- if (40 < Tmp)
+ if (Tmp > 40)
Tmp = 0;
if (Tmp == fiRAM || Tmp == fiHardWare)
if (EditFlag)
{
- if (fiOrangeDisk < Tmp && Tmp < fiSnikSnak)
+ if (Tmp > fiOrangeDisk && Tmp < fiSnikSnak)
Tmp = DisPlayField[tsi];
}
+#if 1
+ if (Tmp >= 0 && Tmp <= 40)
+ {
+ subCopyImageToScreen(tsi, fiGraphic[Tmp]);
+
+#if 1
+ if (Tmp != fiSpace && Tmp != fiSnikSnak && Tmp != fiElectron)
+ GfxGraphic[X][Y] = fiGraphic[Tmp];
+#endif
+ }
+#else
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp);
+#endif
}
void DrawFieldAnimated(int X, int Y)
switch (Tmp)
{
case fiSnikSnak:
+#if 1
+ subCopyImageToScreen(tsi, aniSpace);
+#else
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, fiSpace);
+#endif
break;
case fiElectron:
+#if 1
+ subCopyImageToScreen(tsi, aniSpace);
+#else
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, fiSpace);
+#endif
break;
default:
- if (40 < Tmp)
+ if (Tmp > 40)
Tmp = 0;
if (Tmp == fiRAM || Tmp == fiHardWare)
if (EditFlag)
{
- if (fiOrangeDisk < Tmp && Tmp < fiSnikSnak)
+ if (Tmp > fiOrangeDisk && Tmp < fiSnikSnak)
Tmp = DisPlayField[tsi];
}
#if 0
- printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n",
- X, Y, Tmp);
+ if (TEST_flag)
+ printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n",
+ X, Y, Tmp);
#endif
+#if 1
+ if (Tmp >= 0 && Tmp <= 40)
+ {
+ subCopyImageToScreen(tsi, fiGraphic[Tmp]);
+
+#if 1
+ if (Tmp != fiSpace && Tmp != fiSnikSnak && Tmp != fiElectron)
+ GfxGraphic[X][Y] = fiGraphic[Tmp];
+#endif
+ }
+#else
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp);
+#endif
+
break;
}
}
+#if 1
+
+void DrawImage(int X, int Y, int graphic)
+{
+ StretchedSprites.BltImg(StretchWidth * X, StretchWidth * Y, graphic, 0);
+}
+
+#else
+
void DrawSprite(int X, int Y, int SpritePos)
{
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, SpritePos);
}
+#endif
+
#if 0
void InvalidateRect(long XMin, long YMin, long XMax, long YMax)