-#define COMPILE_DATE_STRING "2010-04-18 20:47"
+#define COMPILE_DATE_STRING "2010-04-19 01:09"
FadeOut(REDRAW_FIELD);
#endif
+#if 1
+ /* needed if different viewport properties defined for editor */
+ ChangeViewportPropertiesIfNeeded();
+#endif
+
OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY);
#if DEBUG
BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
DOOR_GFX_PAGEX6, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
+#if 0
+ printf("::: %d, %d / %d, %d\n", VX, VY, EX, EY);
+#endif
+
/* draw bigger door */
DrawSpecialEditorDoor();
BackToFront(); /* force redraw of undrawn special door */
+#if 0
DrawCompleteVideoDisplay();
+#endif
level_editor_test_game = TRUE;
{
viewport.playfield[i] = viewport.playfield[GFX_SPECIAL_ARG_DEFAULT];
viewport.door_1[i] = viewport.door_1[GFX_SPECIAL_ARG_DEFAULT];
- viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT];
+ if (i != GFX_SPECIAL_ARG_EDITOR) /* editor value already initialized */
+ viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT];
}
}
ChangeViewportPropertiesIfNeeded();
#endif
+#if 1
+ DrawCompleteVideoDisplay();
+#endif
+
InitGameEngine();
InitGameControlValues();
px += game_sp.scroll_xoffset;
py += game_sp.scroll_yoffset;
+#if 1
+ if (ExplosionShakeMurphy != 0)
+ {
+ printf("::: ExplosionShakeMurphy\n");
+
+ px += TILEX / 2 - GetSimpleRandom(TILEX + 1);
+ py += TILEY / 2 - GetSimpleRandom(TILEX + 1);
+ }
+#endif
+
BlitBitmap(bitmap_db_field_sp, target_bitmap, px, py, sxsize, sysize, sx, sy);
}
int ScreenScrollXPos, ScreenScrollYPos;
-int ExplosionShake;
+int ExplosionShake, ExplosionShakeMurphy;
boolean NoDisplayFlag;
long DisplayMinX, DisplayMaxX;
extern int ScreenScrollXPos, ScreenScrollYPos;
-extern int ExplosionShake;
+extern int ExplosionShake, ExplosionShakeMurphy;
extern boolean NoDisplayFlag;
extern long DisplayMinX, DisplayMaxX;
if (bl == 8)
{
PlayField16[si] = 0;
- ExplosionShake = 0; // nothing explodes
+ ExplosionShake = 0; // nothing explodes
+ // ExplosionShakeMurphy = 0; // nothing explodes
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
if (bl == 0x89)
{
PlayField16[si] = fiInfotron;
- MovLowByte(&ExplosionShake, 0); // nothing explodes
+ MovLowByte(&ExplosionShake, 0); // nothing explodes
+ // MovLowByte(&ExplosionShakeMurphy, 0); // nothing explodes
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniInfotron;
if (ax == fiHardWare)
return;
- ExplosionShake = 1; // something explodes
+ ExplosionShake = 1; // something explodes
+
if (ax == fiMurphy)
{
#if 1
#endif
KillMurphyFlag = 1;
+
+#if 1
+ ExplosionShakeMurphy = 30; // Murphy explodes
+#endif
}
if (ax == fiElectron)
YawnSleepCounter = 0; // Wake up sleeping Murphy
ExplosionShake = 0; // Force explosion flag off
+ ExplosionShakeMurphy = 0; // Force explosion flag off
TerminalMaxCycles = 0x7F;
YellowDisksExploded = 0;
RX = FieldWidth - Delta;
BY = FieldHeight - Delta;
- DrawImage(LX, tY, imgFrameCorner);
- DrawImage(LX, BY, imgFrameCorner);
- DrawImage(RX, tY, imgFrameCorner);
- DrawImage(RX, BY, imgFrameCorner);
+ DrawImage(LX, tY, (Delta > 0 ? imgFrameCorner : aniSpace));
+ DrawImage(LX, BY, (Delta > 0 ? imgFrameCorner : aniSpace));
+ DrawImage(RX, tY, (Delta > 0 ? imgFrameCorner : aniSpace));
+ DrawImage(RX, BY, (Delta > 0 ? imgFrameCorner : aniSpace));
for (i = LX + 1; i <= RX - 1; i++)
{
- DrawImage(i, tY, imgFrameHorizontal);
- DrawImage(i, BY, imgFrameHorizontal);
+ DrawImage(i, tY, (Delta > 0 ? imgFrameHorizontal : aniSpace));
+ DrawImage(i, BY, (Delta > 0 ? imgFrameHorizontal : aniSpace));
}
for (i = tY + 1; i <= BY - 1; i++)
{
- DrawImage(LX, i, imgFrameVertical);
- DrawImage(RX, i, imgFrameVertical);
+ DrawImage(LX, i, (Delta > 0 ? imgFrameVertical : aniSpace));
+ DrawImage(RX, i, (Delta > 0 ? imgFrameVertical : aniSpace));
+ }
+
+ if (Delta > 0)
+ {
+ // ...
+ // ClearRectangle(bitmap_db_field_sp,
}
}
TimerVar = TimerVar + 1;
+#if 1
+ if (ExplosionShakeMurphy > 0)
+ ExplosionShakeMurphy--;
+#endif
+
#if 1
if (ExitToMenuFlag == 1)
{
FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
LevelMax = (FieldWidth * FieldHeight) - 1;
- FileMax = FieldMax + native_sp_level.demo.length;
+ /* (add one byte for the level number stored as first byte of demo data) */
+ FileMax = FieldMax + native_sp_level.demo.length + 1;
PlayField8 = REDIM_1D(sizeof(byte), 0, FileMax);
DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax);
PlayField8[FieldMax + 1] = native_sp_level.demo.level_nr;
for (i = 0; i < native_sp_level.demo.length; i++)
- PlayField8[FieldMax + i + 2] = native_sp_level.demo.data[i];
+ PlayField8[FieldMax + 2 + i] = native_sp_level.demo.data[i];
}
AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax - 2 * FieldWidth);
game_sp.scroll_xoffset = (EVEN(SCR_FIELDX) ? TILEX / 2 : 0);
game_sp.scroll_yoffset = (EVEN(SCR_FIELDY) ? TILEY / 2 : 0);
+#if 1
+ if (native_sp_level.width <= SCR_FIELDX)
+ game_sp.scroll_xoffset = TILEX / 2;
+ if (native_sp_level.height <= SCR_FIELDY)
+ game_sp.scroll_yoffset = TILEY / 2;
+#endif
+
for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++)
{
for (y = 0; y < SP_MAX_PLAYFIELD_HEIGHT; y++)
FadeSetEnterScreen();
-#if 1
+#if 0
/* needed if different viewport properties defined for editor */
ChangeViewportPropertiesIfNeeded();
#endif
void DrawCompleteVideoDisplay()
{
+#if 0
+ printf("::: %d, %d / %d, %d [%d] [%d, %d] [%d/%d]\n",
+ VX, VY, EX, EY, game_status, gfx.vx, gfx.vy,
+ tape.date, tape.length);
+#endif
+
BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
DOOR_GFX_PAGEX3, DOOR_GFX_PAGEY2,
gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy);
gfx.vx + VIDEO_CONTROL_XPOS, gfx.vy + VIDEO_CONTROL_YPOS);
DrawVideoDisplay(VIDEO_ALL_OFF, 0);
+
+#if 1
+ if (tape.recording)
+ {
+ DrawVideoDisplay(VIDEO_STATE_REC_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+
+ if (tape.pausing)
+ DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, 0);
+ }
+ else if (tape.playing)
+ {
+ DrawVideoDisplay(VIDEO_STATE_PLAY_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+
+ if (tape.pausing)
+ DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, 0);
+ }
+ else if (tape.date && tape.length)
+ {
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+ }
+#else
if (tape.date && tape.length)
{
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
}
+#endif
BlitBitmap(drawto, bitmap_db_door, gfx.vx, gfx.vy, gfx.vxsize, gfx.vysize,
DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY2);
{
int i;
- tape.length = 0;
tape.counter = 0;
+ tape.length = 0;
+ tape.length_seconds = 0;
if (leveldir_current)
setString(&tape.level_identifier, leveldir_current->identifier);
DrawVideoDisplay(VIDEO_STATE_REC_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+
MapTapeWarpButton();
SetDrawDeactivationMask(REDRAW_NONE);
DrawVideoDisplay(VIDEO_STATE_PLAY_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+
MapTapeWarpButton();
SetDrawDeactivationMask(REDRAW_NONE);
int new_scr_fieldx = (vp_playfield->width - 2 * border_size) / TILESIZE;
int new_scr_fieldy = (vp_playfield->height - 2 * border_size) / TILESIZE;
+#if 0
+ /* !!! TEST ONLY !!! */
+ // InitGfxBuffers();
+ return;
+#endif
+
if (viewport.window.width != WIN_XSIZE ||
viewport.window.height != WIN_YSIZE)
{
InitToons();
}
}
+
+#if 0
+ printf("::: %d, %d / %d, %d [%d]\n", VX, VY, EX, EY, game_status);
+#endif
}