X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=731cd0fb00b72411086898528c6a2564af884a3a;hb=d45b35552f4ca1ada1266fb7e8b6968d878019a6;hp=a9dc22c5789dbf8cbaa4a74693cfd4feb05e4b54;hpb=df8f020b9c0aad57e1f2e790c771550232fb6ce8;p=rocksndiamonds.git diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index a9dc22c5..731cd0fb 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -674,16 +674,26 @@ void DrawFieldNoAnimated(int X, int Y); // --- 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; @@ -1642,6 +1652,35 @@ static void Form_Resize() #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; @@ -1667,6 +1706,8 @@ static void DrawFrame(int Delta) } } +#endif + static void RestoreFrame() { int i, LX, tY, RX, BY; @@ -2480,6 +2521,9 @@ void menPlay_Click() UpdateDeltaT(); #endif +#if 1 +#endif + #if 0 printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n"); #endif @@ -3118,7 +3162,11 @@ static void ReStretch(float NewStretch) #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", @@ -3144,7 +3192,7 @@ void DrawField(int X, int Y) tsi = GetSI(X, Y); Tmp = LowByte(PlayField16[tsi]); - if (40 < Tmp) + if (Tmp > 40) Tmp = 0; if (Tmp == fiRAM || Tmp == fiHardWare) @@ -3155,11 +3203,23 @@ void DrawField(int X, int Y) 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) @@ -3199,15 +3259,23 @@ void DrawFieldNoAnimated(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) @@ -3218,26 +3286,44 @@ void DrawFieldNoAnimated(int X, int Y) if (EditFlag) { - if (fiOrangeDisk < Tmp && Tmp < fiSnikSnak) + if (Tmp > fiOrangeDisk && Tmp < fiSnikSnak) Tmp = DisPlayField[tsi]; } -#if 0 - 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)