-#define COMPILE_DATE_STRING "2009-07-19 23:53"
+#define COMPILE_DATE_STRING "2009-07-20 23:25"
{
switch (L)
{
+#if 0
case DDERR_GENERIC:
Debug.Assert(False);
break;
case DDERR_SURFACEBUSY:
Debug.Assert(False);
break;
+#endif
case DDERR_SURFACELOST:
DDraw.RestoreAllSurfaces();
// ClipToWindow 0
break;
+#if 0
case DDERR_UNSUPPORTED:
Debug.Assert(False);
break;
default:
Debug.Assert(False);
break;
+#endif
}
}
void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS)
{
double dx, dY;
+#if 0
TickCountObject Tick;
+#endif
long dT, StepCount;
double T, tStep;
long oldX, oldY, maxD;
- boolean AlreadyRunning;
+ static boolean AlreadyRunning = False;
+
+#if 1
+ printf("::: 3: X,Y == %d, %d [%f]\n", X, Y, Stretch);
+#endif
if (NoDisplayFlag)
return;
if (StepCount == 0)
StepCount = 1;
+#if 1
+ printf("::: MARK 1: %f, %d, %ld, %ld [%d, %d, %ld, %ld]\n",
+ tStep, FPS, TimeMS, maxD,
+ X, Y, mScrollX, mScrollY);
+#endif
+
dT = 1000 / FPS;
tStep = (double)1 / StepCount;
oldX = mScrollX;
goto SoftScrollEH;
// If Claim Then Exit For
+
+#if 0
Tick.DelayMS(dT, False);
+#endif
+
mScrollX = oldX + T * dx;
mScrollY = oldY + T * dY;
ScrollX = mScrollX;
// Blt();
}
+#if 1
+ printf("::: MARK 2\n");
+#endif
+
if (UserDragFlag)
goto SoftScrollEH;
+#if 0
Tick.DelayMS(dT, False);
+#endif
+
mScrollX = X;
mScrollY = Y;
ScrollX = mScrollX;
if (NoDisplayFlag || ! LevelLoaded)
return subDisplayLevel;
-#if 0
+#if 1
+ DisplayLevel();
+#else
MainForm.DisplayLevel();
#endif
Y = Min(Y, ScrollMaxY);
// ScrollX = X
// ScrollY = Y
+
+#if 1
+ DDScrollBuffer_ScrollTo(X, Y);
+#else
Stage.ScrollTo(X, Y);
+#endif
}
void ScrollTowards(int X, int Y)
Y = Min(Y, ScrollMaxY);
// ScrollX = X
// ScrollY = Y
+
+#if 1
+ DDScrollBuffer_ScrollTowards(X, Y, 2 * Stretch);
+#else
Stage.ScrollTowards(X, Y, 2 * Stretch);
+#endif
}
void SoftScrollTo(int X, int Y, long TimeMS, int FPS)
{
long oldX, oldY;
+#if 1
+ printf("::: 1: X,Y == %d, %d (1)\n", X, Y);
+#endif
+
if (NoDisplayFlag)
return;
Y = Min(Y, ScrollMaxY);
// ScrollX = X
// ScrollY = Y
+
+#if 1
+ printf("::: 2: X,Y == %d, %d\n", X, Y);
+#endif
+
+#if 1
+ DDScrollBuffer_SoftScrollTo(X, Y, TimeMS, FPS);
+#else
Stage.SoftScrollTo(X, Y, TimeMS, FPS);
+#endif
}
#include "global.h"
+#if 1
+
+#define ZoomFactor (2)
+
+#define BaseWidth (ZoomFactor * 16)
+#define StretchWidth (ZoomFactor * 16)
+#define StretchWidth2 (StretchWidth / 2)
+#define TwoPixels (ZoomFactor * 2)
+
+#else
+
#define BaseWidth (16)
#define StretchWidth (16)
#define StretchWidth2 (StretchWidth / 2)
#define TwoPixels (2)
-#define aniExplosionInfo (111)
-#define aniMurphySleepLeft (71)
-#define aniMurphySleepRight (68)
-#define aniMurphyTouchDown (47)
-#define aniMurphyTouchLeft (95)
-#define aniMurphyTouchRight (94)
-#define aniMurphyTouchUp (46)
+
+#endif
+
+#define aniExplosionInfo (111)
+#define aniMurphySleepLeft (71)
+#define aniMurphySleepRight (68)
+#define aniMurphyTouchDown (47)
+#define aniMurphyTouchLeft (95)
+#define aniMurphyTouchRight (94)
+#define aniMurphyTouchUp (46)
#define aniMurphyYawn (56)
#define aniPushLeft (45)
#define aniPushRight (44)
#define aniPushUpDown (79)
-#define aniSnikSnakDown (167)
-#define aniSnikSnakLeft (239)
-#define aniSnikSnakRight (247)
+#define aniSnikSnakDown (167)
+#define aniSnikSnakLeft (239)
+#define aniSnikSnakRight (247)
#define aniSnikSnakUp (159)
-#define fiBase (2)
-#define fiBug (25)
+
+#define fiBase (2)
+#define fiBug (25)
#define fiElectron (24)
-#define fiExit (7)
+#define fiExit (7)
#define fiExplosion (0x1F)
#define fiHWFirst (28)
#define fiHWLast (37)
#define fiInfotron (4)
#define fiMurphy (3)
#define fiOrangeDisk (8)
-#define fiPortAllDirections (23)
+#define fiPortAllDirections (23)
#define fiPortDown (10)
#define fiPortLeft (11)
-#define fiPortLeftAndRight (22)
+#define fiPortLeftAndRight (22)
#define fiPortRight (9)
#define fiPortUp (12)
-#define fiPortUpAndDown (21)
-#define fiRAM (5)
+#define fiPortUpAndDown (21)
+#define fiRAM (5)
#define fiRAMBottom (39)
#define fiRAMLeft (26)
#define fiRAMRight (27)
#define fiTerminal (19)
#define fiWallSpace (40)
#define fiYellowDisk (18)
-#define fiZonk (1)
+#define fiZonk (1)
+
#define keyDown (3)
#define keyLeft (2)
#define keyNone (0)
#define keySpaceLeft (6)
#define keySpaceRight (8)
#define keySpaceUp (5)
-#define keyUp (1)
+#define keyUp (1)
+
#define posFrameCorner (55)
-#define posFrameHorizontal (111)
-#define posFrameVertical (110)
+#define posFrameHorizontal (111)
+#define posFrameVertical (110)
extern int GetSI(int X, int Y);
extern int GetStretchX(int si);
MurphyScreenYPos = MurphyScreenYPos / Stretch;
subCalculateScreenScrollPos(); // calculate screen start addrs
+
+ printf("::: InitGameConditions.c: ScreenScroll{X,Y}Pos %d, %d\n",
+ ScreenScrollXPos, ScreenScrollYPos);
+
if (AutoScrollFlag)
{
if (bPlaying)
{
int subProcessKeyboardInput;
- int LastKey;
+ static int LastKey = 0;
// On Error GoTo NoKeyboardAccessEH
// Call DKeyboard.Acquire
{
int X, Y;
+#if 1
+ printf("::: DisplayLevel (%d, %d, %d)\n", Loaded, LevelLoaded, bPlaying);
+#endif
+
if (! Loaded)
return;
if (! LevelLoaded)
return;
-#if 0
+#if 1
SetDisplayRegion();
#endif
if (bPlaying)
{
+#if 1
+ printf("::: DisplayLevel [%ld, %ld, %ld, %ld]...\n",
+ DisplayMinY, DisplayMaxY, DisplayMinX, DisplayMaxX);
+#endif
+
for (Y = DisplayMinY; Y <= DisplayMaxY; Y++)
{
for (X = DisplayMinX; X <= DisplayMaxX; X++)
{
+#if 0
+ printf("::: DrawFieldNoAnimated(%d, %d)\n", X, Y);
+#endif
DrawFieldNoAnimated(X, Y);
}
}
{
for (X = DisplayMinX; X <= DisplayMaxX; X++)
{
+#if 0
+ printf("::: DrawFieldAnimated(%d, %d)\n", X, Y);
+#endif
DrawFieldAnimated(X, Y);
}
}
{
for (X = DisplayMinX; X <= DisplayMaxX; X++)
{
+#if 0
+ printf("::: DrawField(%d, %d)\n", X, Y);
+#endif
DrawField(X, Y);
}
}
long InfoCount;
boolean Oldflag;
int Msg;
- long LastIndex;
- boolean bBlock;
+ static long LastIndex = 0;
+ static boolean bBlock = False;
if (bBlock)
return;
picPane_KeyUp(KeyCode, Shift);
}
-static void Form_Load()
+#endif
+
+void Form_Load()
{
#if 0
picViewPort.ScaleMode = vbPixels;
+#endif
+
PauseMode = 0;
// BaseWidth = 16
+
+#if 0
menBorder_Click();
+#endif
+
Loaded = True;
+
+#if 0
+
ReStretch(Stretch);
LoadKeyIndicators();
- Show;
+ Show();
FillFileList(CurPath);
if (s.Read("ShowSplash", True))
#endif
}
+#if 0
+
static void FillLevelList(char *Path, int LevelIndex)
{
long FNum, LevLen, i, iMax;
}
}
-#if 0
-
static void RestoreFrame()
{
int i, LX, tY, RX, BY;
}
}
+#if 0
+
static void Form_Unload(int Cancel)
{
EndFlag = True;
static void fpsTim_Timer()
{
currency TickDiff;
- int count5;
+ static int count5 = 0;
count5 = count5 + 1;
if (4 < count5)
// DisplayLevel True
}
+#endif
+
void SetDisplayRegion()
{
+#if 1
+ if (0)
+#else
if (! menBorder.Checked)
+#endif
{
DisplayMinX = 1;
DisplayMaxX = FieldWidth - 2;
DisplayMinY = 1;
DisplayMaxY = FieldHeight - 2;
DisplayHeight = FieldHeight;
+
if (LevelLoaded)
DrawFrame(1);
DisplayMinY = 0;
DisplayMaxY = FieldHeight - 1;
DisplayHeight = FieldHeight + 2;
+
if (LevelLoaded)
RestoreFrame();
}
}
+#if 0
+
static void menCopy_Click()
{
FMark.Copy;
void Let_PanelVisible(boolean NewVal)
{
- boolean HidePanel;
+ static boolean HidePanel = False;
if (HidePanel != NewVal)
return;
static void menPause_Click()
{
- StdPicture OldPic;
- char *OldText;
+ static StdPicture OldPic;
+ static char *OldText = 0;
PauseMode = (PauseMode != 0 ? 0 : 0);
if (PauseMode != 0)
int FNum;
char *LogPath, *OutStr, *ReRecPath, *SPPath;
boolean bEqual;
- boolean QuitFlag;
+ static boolean QuitFlag = False;
if (cmdPlayAll.STRING_IS_LIKE(Caption, "Play) All Demos")
{
// static void menPlay_Click()
void menPlay_Click()
{
-
#if 0
boolean OldEditFlag;
if (! Loaded)
{
+#if 1
+ printf("::: NewStretch == %d\n", NewStretch);
+#endif
+
Stretch = NewStretch;
return;
}
int i;
boolean Tmp;
long Col;
- boolean LastState[5 + 1];
+ static boolean LastState[5 + 1];
// For i = 1 To 5
// State(i) = False
extern void menPlaySpeed_Click(int Index);
extern void menStop_Click();
extern void menPlay_Click();
+extern void Form_Load();
#endif /* MAINFORM_H */
int tDeltaX, tDeltaY, tPos, Tmp;
// Variables that hold information about the animation sequence
- int *dx; // an array of image positions in moving.mpx, finalized with -1
- int dx2; // an additional image position of a second sprite, for instance: yellow disk if pushed
- int MurphyDX, MurphyDY; // murphys move steps
- int SeqPos; // index into dx()
- int ClearPos; // Position to clear before blitting sprites, none=-1
- int dxPos; // field-position to draw dx(SeqPos)
- int dx2Step; // position of dx2 relative to dx-position
+ static int *dx = 0; // an array of image positions in moving.mpx, finalized with -1
+ static int dx2 = 0; // an additional image position of a second sprite, for instance: yellow disk if pushed
+ static int MurphyDX = 0, MurphyDY = 0; // murphys move steps
+ static int SeqPos = 0; // index into dx()
+ static int ClearPos = 0; // Position to clear before blitting sprites, none=-1
+ static int dxPos = 0; // field-position to draw dx(SeqPos)
+ static int dx2Step = 0; // position of dx2 relative to dx-position
ax = PlayField16[si];
al = LowByte(ax);
void sp_open_all()
{
+#if 1
+ printf("::: sp_open_all ...\n");
+#endif
+
+ Form_Load();
+
SetBitmaps_SP(&sp_objects);
screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16);
Stage.Blt = &BlitScreenToBitmap_SP__Stage_Blt;
+
+#if 1
+ printf("::: sp_open_all done\n");
+#endif
}
void sp_close_all()
byte LData[59 + 1][23 + 1];
LevelInfoType LInfo;
+#if 1
+float Stretch = 1; // , StretchWidth%, TwoPixels!
+#else
float Stretch; // , StretchWidth%, TwoPixels!
+#endif
int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY;
int ScrollX, ScrollY;