X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=f44177c7f6bab040dac44d392e4e172ef449a597;hb=18863a5655e9e07d548e2d673e7f82336703c8fb;hp=4ac25f812e2f398b756d92b5e710197d940bb8f1;hpb=315fd934929b6f1dbb70a6ae3cda097cdbc7d9c0;p=rocksndiamonds.git diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 4ac25f81..f44177c7 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -1652,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; @@ -1677,6 +1706,8 @@ static void DrawFrame(int Delta) } } +#endif + static void RestoreFrame() { int i, LX, tY, RX, BY; @@ -2490,6 +2521,9 @@ void menPlay_Click() UpdateDeltaT(); #endif +#if 1 +#endif + #if 0 printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n"); #endif @@ -3128,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", @@ -3154,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) @@ -3165,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) @@ -3209,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) @@ -3228,7 +3286,7 @@ void DrawFieldNoAnimated(int X, int Y) if (EditFlag) { - if (fiOrangeDisk < Tmp && Tmp < fiSnikSnak) + if (Tmp > fiOrangeDisk && Tmp < fiSnikSnak) Tmp = DisPlayField[tsi]; } @@ -3238,16 +3296,40 @@ void DrawFieldNoAnimated(int X, int Y) 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)