X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=f44177c7f6bab040dac44d392e4e172ef449a597;hb=18863a5655e9e07d548e2d673e7f82336703c8fb;hp=9ee82353ac76f8e22d6ce2e6d8c72eca30aa57ce;hpb=9f688962eb90591205c511c1ae9bf752d276d1f5;p=rocksndiamonds.git diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 9ee82353..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; @@ -3161,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) @@ -3172,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) @@ -3216,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) @@ -3235,7 +3286,7 @@ void DrawFieldNoAnimated(int X, int Y) if (EditFlag) { - if (fiOrangeDisk < Tmp && Tmp < fiSnikSnak) + if (Tmp > fiOrangeDisk && Tmp < fiSnikSnak) Tmp = DisPlayField[tsi]; } @@ -3245,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)