+Release Version 3.1.1 [?? ??? ????]
+-----------------------------------
+
Release Version 3.1.0 [07 JUN 2004]
-----------------------------------
- fixed obvious bug with wrong "Murphy" graphics (when digging etc.)
+2004-06-11
+ * fixed bug with wrong door state after trying to quickload empty tape
+
+2004-06-07
+ * version number set to 3.1.1
+
+2004-06-07
+ * version 3.1.0 released
+
2004-06-07
* fixed bug with crash when writing user levelinfo.conf the first time
-#define COMPILE_DATE_STRING "[2004-06-07 01:56]"
+#define COMPILE_DATE_STRING "[2004-06-11 03:48]"
else
{
CloseDoor(DOOR_CLOSE_1);
- BlitBitmap(bitmap_db_door, bitmap_db_door,
- DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE,DYSIZE,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
- OpenDoor(DOOR_OPEN_1);
+ OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
}
}
/* EXPERIMENTAL STUFF */
#define USE_NEW_AMOEBA_CODE FALSE
+/* EXPERIMENTAL STUFF */
+#define USE_NEW_MOVEMENT FALSE
+
/* for DigField() */
#define DF_NO_PUSH 0
#define DF_DIG 1
CheckCollision[x][y] = 0;
+#if 0
+ if (IS_PLAYER(x, y + 1))
+ printf("::: we ARE now killing the player [%d]\n", FrameCounter);
+#endif
+
Impact(x, y);
}
else if (IS_FREE(x, y + 1) && element == EL_SPRING && level.use_spring_bug)
else if (element == EL_PENGUIN)
TestIfFriendTouchesBadThing(newx, newy);
+#if USE_NEW_MOVEMENT
+#if 0
+ if (CAN_FALL(element) && direction == MV_DOWN &&
+ (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) &&
+ IS_PLAYER(x, newy + 1))
+ printf("::: we would now kill the player [%d]\n", FrameCounter);
+#endif
+
+ /* give the player one last chance (one more frame) to move away */
+ if (CAN_FALL(element) && direction == MV_DOWN &&
+ (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) &&
+ !IS_PLAYER(x, newy + 1))
+ Impact(x, newy);
+#else
if (CAN_FALL(element) && direction == MV_DOWN &&
(newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)))
Impact(x, newy);
+#endif
#if 1
if (pushed_by_player)
#else
#if 1
+
+#if 0
+ printf("::: %d <= %d < %d ?\n", player->move_delay, FrameCounter,
+ player->move_delay + player->move_delay_value);
+#endif
+
if (!FrameReached(&player->move_delay, player->move_delay_value))
+ {
+#if 0
+ printf("::: can NOT move\n");
+#endif
+
return FALSE;
+ }
#else
if (!FrameReached(&player->move_delay, player->move_delay_value) &&
!(tape.playing && tape.file_version < FILE_VERSION_2_0))
return FALSE;
#endif
+#endif
+
+#if 0
+ printf("::: COULD move now\n");
#endif
/* store if player is automatically moved to next field */
if (moved & MF_MOVING)
{
+#if 0
+ printf("::: REALLY moves now\n");
+#endif
+
if (old_jx != jx && old_jy == jy)
player->MovDir = (old_jx < jx ? MV_RIGHT : MV_LEFT);
else if (old_jx == jx && old_jy != jy)
player->last_move_dir = MV_NO_MOVING;
*/
player->is_moving = FALSE;
+
+#if USE_NEW_MOVEMENT
+ /* player is ALLOWED to move, but CANNOT move (something blocks his way) */
+ /* ensure that the player is also allowed to move in the next frame */
+ /* (currently, the player is forced to wait eight frames before he can try
+ again!!!) */
+
+ player->move_delay = -1; /* allow direct movement in the next frame */
+#endif
}
if (game.engine_version < VERSION_IDENT(3,0,7,0))
player->actual_frame_counter = FrameCounter;
player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
+#if USE_NEW_MOVEMENT
+ if (player->block_last_field &&
+ Feld[last_jx][last_jy] == EL_EMPTY)
+ Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
+#else
if (Feld[last_jx][last_jy] == EL_EMPTY)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
+#endif
#if 0
DrawPlayer(player);
#define PROGRAM_VERSION_MAJOR 3
#define PROGRAM_VERSION_MINOR 1
-#define PROGRAM_VERSION_PATCH 0
-#define PROGRAM_VERSION_BUILD 5
+#define PROGRAM_VERSION_PATCH 1
+#define PROGRAM_VERSION_BUILD 0
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"
void TapeQuickLoad()
{
+ char *filename = getTapeFilename(level_nr);
+
+ if (!fileExists(filename))
+ {
+ Request("No tape for this level !", REQ_CONFIRM);
+
+ return;
+ }
+
if (tape.recording && !Request("Stop recording and load tape ?",
REQ_ASK | REQ_STAY_CLOSED))
{
- BlitBitmap(bitmap_db_door, bitmap_db_door,
- DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
- OpenDoor(DOOR_OPEN_1);
+ OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
return;
}
tape.quick_resume = TRUE;
}
- else
- Request("No tape for this level !", REQ_CONFIRM);
+ else /* this should not happen (basically checked above) */
+ {
+ int reopen_door = (game_status == GAME_MODE_PLAYING ? REQ_REOPEN : 0);
+
+ Request("No tape for this level !", REQ_CONFIRM | reopen_door);
+ }
}
}
/* pause network game while waiting for request to answer */
if (options.network &&
game_status == GAME_MODE_PLAYING &&
- req_state & REQUEST_WAIT_FOR)
+ req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_PausePlaying();
#endif
UnmapAllGadgets();
- CloseDoor(DOOR_CLOSE_1);
+ if (old_door_state & DOOR_OPEN_1)
+ {
+ CloseDoor(DOOR_CLOSE_1);
- /* save old door content */
- BlitBitmap(bitmap_db_door, bitmap_db_door,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
- DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1);
+ /* save old door content */
+ BlitBitmap(bitmap_db_door, bitmap_db_door,
+ DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
+ DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1);
+ }
SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1);
ClearEventQueue();
#endif
- if (!(req_state & REQUEST_WAIT_FOR))
+ if (!(req_state & REQUEST_WAIT_FOR_INPUT))
{
SetDrawBackgroundMask(REDRAW_FIELD);
{
CloseDoor(DOOR_CLOSE_1);
- if (!(req_state & REQ_STAY_CLOSED) && (old_door_state & DOOR_OPEN_1))
- {
- BlitBitmap(bitmap_db_door, bitmap_db_door,
- DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
- OpenDoor(DOOR_OPEN_1);
- }
+ if (((old_door_state & DOOR_OPEN_1) && !(req_state & REQ_STAY_CLOSED)) ||
+ (req_state & REQ_REOPEN))
+ OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
}
RemapAllGadgets();
/* continue network game after request */
if (options.network &&
game_status == GAME_MODE_PLAYING &&
- req_state & REQUEST_WAIT_FOR)
+ req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_ContinuePlaying();
#endif
unsigned int OpenDoor(unsigned int door_state)
{
- unsigned int new_door_state;
-
if (door_state & DOOR_COPY_BACK)
{
- BlitBitmap(bitmap_db_door, bitmap_db_door,
- DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE + VYSIZE,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
+ if (door_state & DOOR_OPEN_1)
+ BlitBitmap(bitmap_db_door, bitmap_db_door,
+ DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
+ DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
+
+ if (door_state & DOOR_OPEN_2)
+ BlitBitmap(bitmap_db_door, bitmap_db_door,
+ DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY2, VXSIZE, VYSIZE,
+ DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY2);
+
door_state &= ~DOOR_COPY_BACK;
}
- new_door_state = MoveDoor(door_state);
-
- return(new_door_state);
+ return MoveDoor(door_state);
}
unsigned int CloseDoor(unsigned int door_state)
{
- unsigned int new_door_state;
+ unsigned int old_door_state = GetDoorState();
- BlitBitmap(backbuffer, bitmap_db_door,
- DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
- BlitBitmap(backbuffer, bitmap_db_door,
- VX, VY, VXSIZE, VYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY2);
+ if (!(door_state & DOOR_NO_COPY_BACK))
+ {
+ if (old_door_state & DOOR_OPEN_1)
+ BlitBitmap(backbuffer, bitmap_db_door,
+ DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
- new_door_state = MoveDoor(door_state);
+ if (old_door_state & DOOR_OPEN_2)
+ BlitBitmap(backbuffer, bitmap_db_door,
+ VX, VY, VXSIZE, VYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY2);
+
+ door_state &= ~DOOR_NO_COPY_BACK;
+ }
- return(new_door_state);
+ return MoveDoor(door_state);
}
unsigned int GetDoorState()
{
BlitBitmap(bitmap_db_door, drawto,
DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1 + i / 2,
- DXSIZE,DYSIZE - i / 2, DX, DY);
+ DXSIZE, DYSIZE - i / 2, DX, DY);
ClearRectangle(drawto, DX, DY + DYSIZE - i / 2, DXSIZE, i / 2);
}
#define DOOR_ACTION_2 (DOOR_OPEN_2 | DOOR_CLOSE_2)
#define DOOR_ACTION (DOOR_ACTION_1 | DOOR_ACTION_2)
#define DOOR_COPY_BACK (1 << 4)
-#define DOOR_NO_DELAY (1 << 5)
-#define DOOR_GET_STATE (1 << 6)
-#define DOOR_SET_STATE (1 << 7)
+#define DOOR_NO_COPY_BACK (1 << 5)
+#define DOOR_NO_DELAY (1 << 6)
+#define DOOR_GET_STATE (1 << 7)
+#define DOOR_SET_STATE (1 << 8)
/* for Request */
#define REQ_ASK (1 << 0)
-#define REQ_OPEN (1 << 1)
-#define REQ_CLOSE (1 << 2)
-#define REQ_CONFIRM (1 << 3)
+#define REQ_CONFIRM (1 << 1)
+#define REQ_PLAYER (1 << 2)
+#define REQ_STAY_OPEN (1 << 3)
#define REQ_STAY_CLOSED (1 << 4)
-#define REQ_STAY_OPEN (1 << 5)
-#define REQ_PLAYER (1 << 6)
+#define REQ_REOPEN (1 << 5)
-#define REQUEST_WAIT_FOR (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
+#define REQUEST_WAIT_FOR_INPUT (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
void DumpTile(int, int);