projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981112-1
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 033c75be1efafb6ed6f743b956d9ab2eb5773e59..a2b46c8604fd3b8ac0fed0743e0a96dde455701e 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-33,7
+33,7
@@
extern boolean wait_for_vsync;
void SetDrawtoField(int mode)
{
void SetDrawtoField(int mode)
{
- if (mode == DRAW_BUFFERED && setup.soft_scrolling
_on
)
+ if (mode == DRAW_BUFFERED && setup.soft_scrolling)
{
FX = TILEX;
FY = TILEY;
{
FX = TILEX;
FY = TILEY;
@@
-64,17
+64,23
@@
void SetDrawtoField(int mode)
void BackToFront()
{
int x,y;
void BackToFront()
{
int x,y;
- Drawable buffer = (drawto_field
!= window ? drawto_field : backbuffer
);
+ Drawable buffer = (drawto_field
== window ? backbuffer : drawto_field
);
- if (setup.direct_draw
_on
&& game_status == PLAYING)
+ if (setup.direct_draw && game_status == PLAYING)
redraw_mask &= ~REDRAW_MAIN;
if (redraw_mask & REDRAW_TILES && redraw_tiles > REDRAWTILES_THRESHOLD)
redraw_mask |= REDRAW_FIELD;
redraw_mask &= ~REDRAW_MAIN;
if (redraw_mask & REDRAW_TILES && redraw_tiles > REDRAWTILES_THRESHOLD)
redraw_mask |= REDRAW_FIELD;
- if (redraw_mask & REDRAW_FIELD
|| ScreenGfxPos
)
+ if (redraw_mask & REDRAW_FIELD)
redraw_mask &= ~REDRAW_TILES;
redraw_mask &= ~REDRAW_TILES;
+ /*
+ if (redraw_mask & REDRAW_FIELD ||
+ (ScreenGfxPos && setup.soft_scrolling && game_status == PLAYING))
+ redraw_mask &= ~REDRAW_TILES;
+ */
+
if (!redraw_mask)
return;
if (!redraw_mask)
return;
@@
-107,7
+113,7
@@
void BackToFront()
{
int fx = FX, fy = FY;
{
int fx = FX, fy = FY;
- if (setup.soft_scrolling
_on
)
+ if (setup.soft_scrolling)
{
fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
{
fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
@@
-189,7
+195,7
@@
void FadeToFront()
/*
long fading_delay = 300;
/*
long fading_delay = 300;
- if (setup.fading
_on
&& (redraw_mask & REDRAW_FIELD))
+ if (setup.fading && (redraw_mask & REDRAW_FIELD))
{
*/
{
*/
@@
-257,7
+263,7
@@
void ClearWindow()
XFillRectangle(display,backbuffer,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
XFillRectangle(display,backbuffer,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
- if (setup.soft_scrolling
_on
&& game_status==PLAYING)
+ if (setup.soft_scrolling && game_status==PLAYING)
{
XFillRectangle(display,fieldbuffer,gc,
0,0, FXSIZE,FYSIZE);
{
XFillRectangle(display,fieldbuffer,gc,
0,0, FXSIZE,FYSIZE);
@@
-266,7
+272,7
@@
void ClearWindow()
else
SetDrawtoField(DRAW_BACKBUFFER);
else
SetDrawtoField(DRAW_BACKBUFFER);
- if (setup.direct_draw
_on
&& game_status==PLAYING)
+ if (setup.direct_draw && game_status==PLAYING)
{
XFillRectangle(display,window,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
{
XFillRectangle(display,window,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
@@
-357,11
+363,6
@@
void DrawPlayer(struct PlayerInfo *player)
int element = Feld[jx][jy];
int graphic, phase;
int element = Feld[jx][jy];
int graphic, phase;
- /*
- if (!player->active || player->gone || !IN_SCR_FIELD(sx,sy))
- return;
- */
-
if (!player->active || player->gone ||
!IN_SCR_FIELD(SCREENX(last_jx),SCREENY(last_jy)))
return;
if (!player->active || player->gone ||
!IN_SCR_FIELD(SCREENX(last_jx),SCREENY(last_jy)))
return;
@@
-410,7
+411,7
@@
void DrawPlayer(struct PlayerInfo *player)
if (!IN_SCR_FIELD(sx,sy))
return;
if (!IN_SCR_FIELD(sx,sy))
return;
- if (setup.direct_draw
_on
)
+ if (setup.direct_draw)
SetDrawtoField(DRAW_BUFFERED);
/* draw things behind the player, if needed */
SetDrawtoField(DRAW_BUFFERED);
/* draw things behind the player, if needed */
@@
-442,7
+443,7
@@
void DrawPlayer(struct PlayerInfo *player)
syy = player->GfxPos;
}
syy = player->GfxPos;
}
- if (!setup.soft_scrolling
_on
&& ScreenMovPos)
+ if (!setup.soft_scrolling && ScreenMovPos)
sxx = syy = 0;
DrawGraphicShiftedThruMask(sx,sy, sxx,syy, graphic, NO_CUTTING);
sxx = syy = 0;
DrawGraphicShiftedThruMask(sx,sy, sxx,syy, graphic, NO_CUTTING);
@@
-503,7
+504,7
@@
void DrawPlayer(struct PlayerInfo *player)
GFX_EXPLOSION + ((phase-1)/delay-1));
}
GFX_EXPLOSION + ((phase-1)/delay-1));
}
- if (setup.direct_draw
_on
)
+ if (setup.direct_draw)
{
int dest_x = SX + SCREENX(MIN(jx,last_jx))*TILEX;
int dest_y = SY + SCREENY(MIN(jy,last_jy))*TILEY;
{
int dest_x = SX + SCREENX(MIN(jx,last_jx))*TILEX;
int dest_y = SY + SCREENY(MIN(jy,last_jy))*TILEY;
@@
-1234,7
+1235,7
@@
void DrawLevel()
for(y=BY1; y<=BY2; y++)
DrawScreenField(x,y);
for(y=BY1; y<=BY2; y++)
DrawScreenField(x,y);
- if (setup.soft_scrolling
_on
)
+ if (setup.soft_scrolling)
XCopyArea(display,fieldbuffer,backbuffer,gc,
FX,FY, SXSIZE,SYSIZE,
SX,SY);
XCopyArea(display,fieldbuffer,backbuffer,gc,
FX,FY, SXSIZE,SYSIZE,
SX,SY);
@@
-1480,9
+1481,9
@@
boolean Request(char *text, unsigned int req_state)
break;
}
}
break;
}
}
- else if (JoystickButton() == JOY_BUTTON_NEW_PRESSED)
+ else if (
Any
JoystickButton() == JOY_BUTTON_NEW_PRESSED)
{
{
- int joy
=
Joystick();
+ int joy
= Any
Joystick();
if (joy & JOY_BUTTON_1)
result = 1;
if (joy & JOY_BUTTON_1)
result = 1;