projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
92a9de4
)
prepared some tool functions for the following commit
author
Holger Schemel
<info@artsoft.org>
Tue, 12 Feb 2019 23:36:20 +0000
(
00:36
+0100)
committer
Holger Schemel
<info@artsoft.org>
Tue, 12 Feb 2019 23:36:20 +0000
(
00:36
+0100)
src/tools.c
patch
|
blob
|
history
src/tools.h
patch
|
blob
|
history
diff --git
a/src/tools.c
b/src/tools.c
index 187fb00c70a4bed5324972bf034bf742e55d89d7..47c4b4f8536a52c4a6d10a51bdcc95a6e62cb4a4 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-208,10
+208,10
@@
int correctLevelPosY_EM(int ly)
return ly;
}
return ly;
}
-
static int getFieldbufferOffsetX_RND(void
)
+
int getFieldbufferOffsetX_RND(int dir, int pos
)
{
int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0);
{
int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0);
- int dx = (
ScreenMovDir & (MV_LEFT | MV_RIGHT) ? ScreenGfxP
os : 0);
+ int dx = (
dir & MV_HORIZONTAL ? p
os : 0);
int dx_var = dx * TILESIZE_VAR / TILESIZE;
int fx = FX;
int dx_var = dx * TILESIZE_VAR / TILESIZE;
int fx = FX;
@@
-241,10
+241,10
@@
static int getFieldbufferOffsetX_RND(void)
return fx;
}
return fx;
}
-
static int getFieldbufferOffsetY_RND(void
)
+
int getFieldbufferOffsetY_RND(int dir, int pos
)
{
int full_lev_fieldy = lev_fieldy + (BorderElement != EL_EMPTY ? 2 : 0);
{
int full_lev_fieldy = lev_fieldy + (BorderElement != EL_EMPTY ? 2 : 0);
- int dy = (
ScreenMovDir & (MV_UP | MV_DOWN) ? ScreenGfxP
os : 0);
+ int dy = (
dir & MV_VERTICAL ? p
os : 0);
int dy_var = dy * TILESIZE_VAR / TILESIZE;
int fy = FY;
int dy_var = dy * TILESIZE_VAR / TILESIZE;
int fy = FY;
@@
-276,7
+276,7
@@
static int getFieldbufferOffsetY_RND(void)
static int getLevelFromScreenX_RND(int sx)
{
static int getLevelFromScreenX_RND(int sx)
{
- int fx = getFieldbufferOffsetX_RND();
+ int fx = getFieldbufferOffsetX_RND(
ScreenMovDir, ScreenGfxPos
);
int dx = fx - FX;
int px = sx - SX;
int lx = LEVELX((px + dx) / TILESIZE_VAR);
int dx = fx - FX;
int px = sx - SX;
int lx = LEVELX((px + dx) / TILESIZE_VAR);
@@
-286,7
+286,7
@@
static int getLevelFromScreenX_RND(int sx)
static int getLevelFromScreenY_RND(int sy)
{
static int getLevelFromScreenY_RND(int sy)
{
- int fy = getFieldbufferOffsetY_RND();
+ int fy = getFieldbufferOffsetY_RND(
ScreenMovDir, ScreenGfxPos
);
int dy = fy - FY;
int py = sy - SY;
int ly = LEVELY((py + dy) / TILESIZE_VAR);
int dy = fy - FY;
int py = sy - SY;
int ly = LEVELY((py + dy) / TILESIZE_VAR);
@@
-691,12
+691,17
@@
void DrawTileCursor(int draw_target)
dst_x, dst_y);
}
dst_x, dst_y);
}
+void BlitScreenToBitmapExt_RND(Bitmap *target_bitmap, int fx, int fy)
+{
+ BlitBitmap(drawto_field, target_bitmap, fx, fy, SXSIZE, SYSIZE, SX, SY);
+}
+
void BlitScreenToBitmap_RND(Bitmap *target_bitmap)
{
void BlitScreenToBitmap_RND(Bitmap *target_bitmap)
{
- int fx = getFieldbufferOffsetX_RND();
- int fy = getFieldbufferOffsetY_RND();
+ int fx = getFieldbufferOffsetX_RND(
ScreenMovDir, ScreenGfxPos
);
+ int fy = getFieldbufferOffsetY_RND(
ScreenMovDir, ScreenGfxPos
);
- Blit
Bitmap(drawto_field, target_bitmap, fx, fy, SXSIZE, SYSIZE, SX, SY
);
+ Blit
ScreenToBitmapExt_RND(target_bitmap, fx, fy
);
}
void BlitScreenToBitmap(Bitmap *target_bitmap)
}
void BlitScreenToBitmap(Bitmap *target_bitmap)
diff --git
a/src/tools.h
b/src/tools.h
index 9f144ca297b9867c4e542ae24e9960ebfaeae414..84bd6a38eeed9f47327c5e3da1afd75225a86c78 100644
(file)
--- a/
src/tools.h
+++ b/
src/tools.h
@@
-66,6
+66,9
@@
#define REQUEST_WAIT_FOR_INPUT (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
#define REQUEST_WAIT_FOR_INPUT (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
+int getFieldbufferOffsetX_RND(int, int);
+int getFieldbufferOffsetY_RND(int, int);
+
int correctLevelPosX_EM(int);
int correctLevelPosY_EM(int);
int correctLevelPosX_EM(int);
int correctLevelPosY_EM(int);
@@
-86,6
+89,7
@@
void DrawTileCursor(int);
void SetDrawtoField(int);
void RedrawPlayfield(void);
void SetDrawtoField(int);
void RedrawPlayfield(void);
+void BlitScreenToBitmapExt_RND(Bitmap *, int, int);
void BlitScreenToBitmap_RND(Bitmap *);
void BlitScreenToBitmap(Bitmap *);
void BackToFront(void);
void BlitScreenToBitmap_RND(Bitmap *);
void BlitScreenToBitmap(Bitmap *);
void BackToFront(void);