projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0905202
)
changed function interface
author
Holger Schemel
<info@artsoft.org>
Tue, 18 Feb 2020 17:02:33 +0000
(18:02 +0100)
committer
Holger Schemel
<info@artsoft.org>
Tue, 19 May 2020 16:19:58 +0000
(18:19 +0200)
src/game_em/graphics.c
patch
|
blob
|
history
diff --git
a/src/game_em/graphics.c
b/src/game_em/graphics.c
index 972e0d94678ca5af2253a897a52cf30d88d7c3b9..ac219b86feca0669c0d5dffbcf0b836b574c655f 100644
(file)
--- a/
src/game_em/graphics.c
+++ b/
src/game_em/graphics.c
@@
-369,16
+369,16
@@
static void animscreen(void)
* handles transparency and movement
*/
* handles transparency and movement
*/
-static void blitplayer(
struct PLAYER *ply
)
+static void blitplayer(
int nr
)
{
int x1, y1, x2, y2;
{
int x1, y1, x2, y2;
- if (!ply
->
alive)
+ if (!ply
[nr].
alive)
return;
/* x1/y1 are left/top and x2/y2 are right/down part of the player movement */
return;
/* x1/y1 are left/top and x2/y2 are right/down part of the player movement */
- x1 = ((7 - frame) * ply
->oldx + (1 + frame) * ply->
x) * TILEX / 8;
- y1 = ((7 - frame) * ply
->oldy + (1 + frame) * ply->
y) * TILEY / 8;
+ x1 = ((7 - frame) * ply
[nr].oldx + (1 + frame) * ply[nr].
x) * TILEX / 8;
+ y1 = ((7 - frame) * ply
[nr].oldy + (1 + frame) * ply[nr].
y) * TILEY / 8;
x2 = x1 + TILEX - 1;
y2 = y1 + TILEY - 1;
x2 = x1 + TILEX - 1;
y2 = y1 + TILEY - 1;
@@
-386,10
+386,10
@@
static void blitplayer(struct PLAYER *ply)
(int)(y2 - screen_y) < ((MAX_BUF_YSIZE - 1) * TILEY - 1))
{
/* some casts to "int" are needed because of negative calculation values */
(int)(y2 - screen_y) < ((MAX_BUF_YSIZE - 1) * TILEY - 1))
{
/* some casts to "int" are needed because of negative calculation values */
- int dx = (int)ply
->x - (int)ply->
oldx;
- int dy = (int)ply
->y - (int)ply->
oldy;
- int old_x = (int)ply
->
oldx + (int)frame * dx / 8;
- int old_y = (int)ply
->
oldy + (int)frame * dy / 8;
+ int dx = (int)ply
[nr].x - (int)ply[nr].
oldx;
+ int dy = (int)ply
[nr].y - (int)ply[nr].
oldy;
+ int old_x = (int)ply
[nr].
oldx + (int)frame * dx / 8;
+ int old_y = (int)ply
[nr].
oldy + (int)frame * dy / 8;
int new_x = old_x + SIGN(dx);
int new_y = old_y + SIGN(dy);
int old_sx = old_x % MAX_BUF_XSIZE;
int new_x = old_x + SIGN(dx);
int new_y = old_y + SIGN(dy);
int old_sx = old_x % MAX_BUF_XSIZE;
@@
-408,7
+408,7
@@
static void blitplayer(struct PLAYER *ply)
DrawLevelFieldCrumbled_EM(new_x, new_y, new_sx, new_sy, new_crm, FALSE);
/* draw the player (masked) over the element he is just digging away */
DrawLevelFieldCrumbled_EM(new_x, new_y, new_sx, new_sy, new_crm, FALSE);
/* draw the player (masked) over the element he is just digging away */
- DrawLevelPlayer_EM(x1, y1, ply
->num, ply->
anim, TRUE);
+ DrawLevelPlayer_EM(x1, y1, ply
[nr].num, ply[nr].
anim, TRUE);
/* draw the field the player is moving from (masked over the player) */
DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
/* draw the field the player is moving from (masked over the player) */
DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
@@
-416,7
+416,7
@@
static void blitplayer(struct PLAYER *ply)
else
{
/* draw the player under the element which is on the same field */
else
{
/* draw the player under the element which is on the same field */
- DrawLevelPlayer_EM(x1, y1, ply
->num, ply->
anim, FALSE);
+ DrawLevelPlayer_EM(x1, y1, ply
[nr].num, ply[nr].
anim, FALSE);
/* draw the field the player is moving from (masked over the player) */
DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
/* draw the field the player is moving from (masked over the player) */
DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
@@
-677,7
+677,7
@@
void RedrawPlayfield_EM(boolean force_redraw)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
- blitplayer(
&ply[i]
);
+ blitplayer(
i
);
BlitScreenToBitmap_EM(backbuffer);
BackToFront_EM();
BlitScreenToBitmap_EM(backbuffer);
BackToFront_EM();
@@
-689,7
+689,7
@@
void RedrawPlayfield_EM(boolean force_redraw)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
- blitplayer(
&ply[i]
);
+ blitplayer(
i
);
BlitScreenToBitmap_EM(backbuffer);
BackToFront_EM();
BlitScreenToBitmap_EM(backbuffer);
BackToFront_EM();
@@
-783,5
+783,5
@@
void RedrawPlayfield_EM(boolean force_redraw)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
animscreen();
for (i = 0; i < MAX_PLAYERS; i++)
- blitplayer(
&ply[i]
);
+ blitplayer(
i
);
}
}