projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed player animation when snapping for BD engine
[rocksndiamonds.git]
/
src
/
game_sp
/
MainForm.c
diff --git
a/src/game_sp/MainForm.c
b/src/game_sp/MainForm.c
index c54bf63d21a3dbfd774b58b12ccd38dda746d2ce..96d71a9653be859b519e6919c4506ea432bef886 100644
(file)
--- a/
src/game_sp/MainForm.c
+++ b/
src/game_sp/MainForm.c
@@
-6,24
+6,22
@@
static void DrawFrame(int Delta);
static void DrawFrame(int Delta);
-static void ReStretch();
+static void ReStretch(
void
);
void DrawField(int X, int Y);
void DrawFieldAnimated(int X, int Y);
void DrawFieldNoAnimated(int X, int Y);
void DrawField(int X, int Y);
void DrawFieldAnimated(int X, int Y);
void DrawFieldNoAnimated(int X, int Y);
-void DrawFrameIfNeeded()
+void DrawFrameIfNeeded(
void
)
{
DrawFrame(0);
{
DrawFrame(0);
- /* !!! CHECK THIS !!! */
-#if 1
+ // !!! CHECK THIS !!!
if (! menBorder)
DrawFrame(1);
if (! menBorder)
DrawFrame(1);
-#endif
}
}
-void DisplayLevel()
+void DisplayLevel(
void
)
{
int X, Y;
{
int X, Y;
@@
-31,16
+29,9
@@
void DisplayLevel()
return;
ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
return;
ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
-#if 1
ClearRectangle(bitmap_db_field_sp, 0, 0, FXSIZE, FYSIZE);
ClearRectangle(bitmap_db_field_sp, 0, 0, FXSIZE, FYSIZE);
-#else
- ClearRectangle(bitmap_db_field_sp, 0, 0,
- MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY);
-#endif
-#if 1
SetDisplayRegion();
SetDisplayRegion();
-#endif
DrawFrameIfNeeded();
DrawFrameIfNeeded();
@@
-62,7
+53,7
@@
void DisplayLevel()
}
}
}
}
-void Form_Load()
+void Form_Load(
void
)
{
InitGlobals();
{
InitGlobals();
@@
-102,7
+93,7
@@
static void DrawFrame(int Delta)
}
}
}
}
-static void RestoreFrame()
+static void RestoreFrame(
void
)
{
int i, LX, tY, RX, BY;
{
int i, LX, tY, RX, BY;
@@
-124,7
+115,7
@@
static void RestoreFrame()
}
}
}
}
-void SetDisplayRegion()
+void SetDisplayRegion(
void
)
{
if (! menBorder)
{
{
if (! menBorder)
{
@@
-148,7
+139,7
@@
void SetDisplayRegion()
}
}
}
}
-void menPlay_Click()
+void menPlay_Click(
void
)
{
bPlaying = True;
{
bPlaying = True;
@@
-157,17
+148,9
@@
void menPlay_Click()
ReStretch();
subMainGameLoop_Init();
ReStretch();
subMainGameLoop_Init();
-
-#if 1
- return;
-#endif
-
- bPlaying = False;
-
- subFetchAndInitLevel();
}
}
-static void ReStretch()
+static void ReStretch(
void
)
{
if (LevelLoaded)
{
{
if (LevelLoaded)
{
@@
-185,34
+168,28
@@
static void ReStretch()
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
}
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
}
-void SetScrollEdges()
+void SetScrollEdges(
void
)
{
int border1_offset = (menBorder ? 1 : 2);
int border2_offset = (menBorder ? 0 : TILESIZE / 2);
{
int border1_offset = (menBorder ? 1 : 2);
int border2_offset = (menBorder ? 0 : TILESIZE / 2);
- /
* scroll correction for border frame (1 tile) or border element (2 tiles) */
+ /
/ scroll correction for border frame (1 tile) or border element (2 tiles)
ScrollMinX = 0;
ScrollMinY = 0;
ScrollMinX = 0;
ScrollMinY = 0;
- ScrollMaxX = (DisplayMaxX + border1_offset
) * TILEX - SXSIZE
;
- ScrollMaxY = (DisplayMaxY + border1_offset
) * TILEY - SYSIZE
;
+ ScrollMaxX = (DisplayMaxX + border1_offset
- SCR_FIELDX) * TILEX
;
+ ScrollMaxY = (DisplayMaxY + border1_offset
- SCR_FIELDY) * TILEY
;
- /
* scroll correction for border element (half tile on left and right side) */
+ /
/ scroll correction for border element (half tile on left and right side)
ScrollMinX += border2_offset;
ScrollMinY += border2_offset;
ScrollMaxX -= border2_offset;
ScrollMaxY -= border2_offset;
ScrollMinX += border2_offset;
ScrollMinY += border2_offset;
ScrollMaxX -= border2_offset;
ScrollMaxY -= border2_offset;
- /
* scroll correction for even number of visible tiles (half tile shifted) */
+ /
/ scroll correction for even number of visible tiles (half tile shifted)
ScrollMinX -= game_sp.scroll_xoffset;
ScrollMaxX -= game_sp.scroll_xoffset;
ScrollMinY -= game_sp.scroll_yoffset;
ScrollMaxY -= game_sp.scroll_yoffset;
ScrollMinX -= game_sp.scroll_xoffset;
ScrollMaxX -= game_sp.scroll_xoffset;
ScrollMinY -= game_sp.scroll_yoffset;
ScrollMaxY -= game_sp.scroll_yoffset;
-
-#if 0
- printf("::: (%ld, %ld), (%ld, %ld) -> (%d, %d), (%d, %d)\n",
- DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY,
- ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY);
-#endif
}
void DrawField(int X, int Y)
}
void DrawField(int X, int Y)
@@
-273,25
+250,7
@@
void DrawFieldNoAnimated(int X, int Y)
break;
default:
break;
default:
-#if 1
DrawField(X, Y);
DrawField(X, Y);
-#else
- if (Tmp < fiFirst || Tmp > fiLast)
- Tmp = fiSpace;
-
- if (Tmp == fiRAM ||
- Tmp == fiHardWare ||
- Tmp == fiBug ||
- Tmp == fiWallSpace)
- Tmp = DisPlayField[tsi];
-
- subCopyImageToScreen(tsi, fiGraphic[Tmp]);
-
- if (Tmp != fiSpace &&
- Tmp != fiSnikSnak &&
- Tmp != fiElectron)
- GfxGraphic[X][Y] = fiGraphic[Tmp];
-#endif
break;
}
}
break;
}
}