-#define COMPILE_DATE_STRING "2009-07-21 12:41"
+#define COMPILE_DATE_STRING "2009-07-22 00:34"
if (NoDisplayFlag)
return;
-
+#if 0
// --- On Error GoTo BltEH
DirectX.GetWindowRect(mhWnd, DR);
// --- On Error GoTo 0
+#endif
{
tX = (DR.right - DR.left) / Stretch;
// DR.top = DR.top - Stretch * (mScrollY + mDestYOff)
// End If
}
+
+#if 1
+#if 0
+ printf("::: DDScrollBuffer.c: DDScrollBuffer_Blt(): blit from %d, %d [%ld, %ld] [%ld, %ld]\n",
+ SR.left, SR.top, mScrollX, mScrollY, mDestXOff, mDestYOff);
+#endif
+
+ BlitBitmap(screenBitmap, window,
+ SR.left, SR.top,
+ SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY);
+
+ return;
+#endif
+
// DDraw.WaitForVerticalBlank DDWAITVB_BLOCKBEGIN, 0
if (IS_NOTHING(&Buffer, sizeof(Buffer)))
return;
mScrollY = Y;
ScrollX = mScrollX;
ScrollY = mScrollY;
+
+#if 1
+ printf("::: DDScrollBuffer.c: DDScrollBuffer_ScrollTo(): mScroll: %ld, %ld [%d, %d]\n",
+ mScrollX, mScrollY, X, Y);
+#endif
}
void DDScrollBuffer_ScrollTowards(int X, int Y, double Step)
mScrollY = mScrollY + dY * r;
ScrollX = mScrollX;
ScrollY = mScrollY;
+
+#if 1
+ printf("::: DDScrollBuffer.c: DDScrollBuffer_ScrollTowards(): mScroll: %ld, %ld\n",
+ mScrollX, mScrollY);
+#endif
}
void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS)
long oldX, oldY, maxD;
static boolean AlreadyRunning = False;
-#if 1
- printf("::: 1: DDScrollBuffer.c: DDScrollBuffer_SoftScrollTo: X,Y == %d, %d [%f]\n", X, Y, Stretch);
-#endif
-
if (NoDisplayFlag)
return;
if (StepCount == 0)
StepCount = 1;
-#if 1
- printf("::: 2: DDScrollBuffer.c: DDScrollBuffer_SoftScrollTo: %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;
SoftScrollEH:
AlreadyRunning = False;
+
+#if 1
+ printf("::: DDScrollBuffer.c: DDScrollBuffer_SoftScrollTo(): mScroll: %ld, %ld\n",
+ mScrollX, mScrollY);
+#endif
}
long Tmp;
#endif
+#if 0
+ printf("::: DDSpriteBuffer.c: Blt(): %d, %d\n", pX, pY);
+#endif
+
if (NoDisplayFlag)
return;
SR.bottom = SR.top + mSpriteHeight;
}
+#if 0
+ printf("::: DDSpriteBuffer.c: Blt(): %d, %d\n", DR.left, DR.top);
+#endif
+
#if 1
BlitBitmap(sp_objects, screenBitmap,
SR.left, SR.top,
{
long oldX, oldY;
+#if 1
+ printf("::: Display.c: ScrollTo(): %d, %d\n", X, Y);
+#endif
+
if (NoDisplayFlag)
return;
{
long oldX, oldY;
-#if 1
- printf("::: 1: Display.c: SoftScrollTo: X,Y == %d, %d\n", X, Y);
- printf("::: %d, %d, %d, %d [%ld]\n",
- ScrollMinX, ScrollMaxX,
- ScrollMinY, ScrollMaxY,
- ScrollDelta);
-#endif
-
if (NoDisplayFlag)
return;
// ScrollX = X
// ScrollY = Y
-#if 1
- printf("::: 2: Display.c: SoftScrollTo: X,Y == %d, %d\n", X, Y);
-#endif
-
Stage.SoftScrollTo(X, Y, TimeMS, FPS);
}
static void ReStretch(float NewStretch);
static void picPane_Paint();
static void picViewPort_Resize();
+static void menBorder_Click();
#else
int X, Y;
#if 1
- printf("::: MainForm.c: DisplayLevel: %d, %d, %d\n",
+ printf("::: MainForm.c: DisplayLevel(): %d, %d, %d\n",
Loaded, LevelLoaded, bPlaying);
#endif
if (bPlaying)
{
#if 1
- printf("::: MainForm.c: DisplayLevel: [%ld, %ld, %ld, %ld]...\n",
- DisplayMinY, DisplayMaxY, DisplayMinX, DisplayMaxX);
+ printf("::: MainForm.c: DisplayLevel(): [%ld, %ld, %ld, %ld] [%d, %d]...\n",
+ DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY,
+ FieldWidth, FieldHeight);
#endif
for (Y = DisplayMinY; Y <= DisplayMaxY; Y++)
EditFlag = False;
EditMode = edMove;
// FMark = New MarkerObject; // (handle this later, if needed)
+
InitGlobals();
#if 0
PauseMode = 0;
// BaseWidth = 16
-#if 0
menBorder_Click();
-#endif
Loaded = True;
-#if 1
-
ReStretch(Stretch);
-#endif
-
#if 0
LoadKeyIndicators();
}
}
+#endif
+
static void menBorder_Click()
{
if (menBorder.Checked)
DisplayMinY = 1;
DisplayMaxY = FieldHeight - 2;
DisplayHeight = FieldHeight;
+
if (Loaded && LevelLoaded)
DrawFrame(1);
DisplayMinY = 0;
DisplayMaxY = FieldHeight - 1;
DisplayHeight = FieldHeight + 2;
+
if (Loaded && LevelLoaded)
RestoreFrame();
}
// DisplayLevel True
}
-#endif
-
void SetDisplayRegion()
{
-#if 1
- if (0)
-#else
if (! menBorder.Checked)
-#endif
{
DisplayMinX = 1;
DisplayMaxX = FieldWidth - 2;
#endif
LastFrame = 0;
+
#if 0
LastTick = T.TickNow();
#endif
#if 0
-
fpsTim.Enabled = True;
-
#endif
// DimPrimary 100
bPlaying = True;
#if 0
-
UpdateDeltaT();
+#endif
+#if 1
+ printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n");
#endif
subFetchAndInitLevelB();
#if 1
- ReStretch(Stretch);
+ printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): done\n");
#endif
+ ReStretch(Stretch);
+
// Trace "MainForm", "CountDown 1"
CountDown(2, (0 == DemoFlag));
// Trace "MainForm", "Call GoPlay"
#endif
#if 1
- printf("::: MainForm.c: ReStretch: %d, %d\n", Loaded, LevelLoaded);
+ printf("::: MainForm.c: ReStretch(): %d, %d\n", Loaded, LevelLoaded);
#endif
if (! Loaded)
if (Loaded && LevelLoaded)
{
+#if 1
+ printf("::: MainForm.c: ReStretch(): ...\n");
+#endif
+
SetDisplayRegion();
picViewPort_Resize();
DisplayLevel();
}
subCalculateScreenScrollPos();
+
+#if 1
+ printf("::: MainForm.c: ReStretch(): %d, %d\n", ScreenScrollXPos, ScreenScrollYPos);
+#endif
+
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
+
Stage.Blt();
+
picPane_Paint();
}
static void SetScrollEdges()
{
#if 1
- printf("::: SetScrollEdges ... [%ld, %ld, %ld, %ld] [%f, %d] [%d, %d, %d, %d]\n",
+ printf("::: MainForm.c: SetScrollEdges() ... [%ld, %ld, %ld, %ld] [%f, %d] [%d, %d, %d, %d]\n",
DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY,
Stretch, BaseWidth,
ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY);
#endif
#if 1
- printf("::: SetScrollEdges done [%d, %d, %d, %d]\n",
+ printf("::: MainForm.c: SetScrollEdges() done [%d, %d, %d, %d]\n",
ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY);
#endif
}
Tmp = DisPlayField[tsi];
}
+#if 0
+ printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n",
+ X, Y, StretchWidth);
+#endif
+
StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp);
break;
}
#endif
SetScrollEdges();
+
+#if 1
+ printf("::: MainForm.c: picViewPort_Resize(): %d, %d\n", ScrollX, ScrollY);
+#endif
+
ScrollTo(ScrollX, ScrollY);
+
// SizeTim.Interval = 1
}
ax = MainForm.picPane.Width / 2;
Ay = MainForm.picPane.Height / 2;
}
+
ScreenScrollXPos = Stretch * (MurphyScreenXPos + 8) - ax;
ScreenScrollYPos = Stretch * (MurphyScreenYPos + 8) - Ay;
+#if 0
+ printf("::: MainGameLoop.c: subCalculateScreenScrollPos(): %d, %d [%d, %d] -> %d, %d\n",
+ MainForm.picPane.Width, MainForm.picPane.Height,
+ MurphyScreenXPos, MurphyScreenYPos,
+ ScreenScrollXPos, ScreenScrollYPos);
+#endif
+
return subCalculateScreenScrollPos;
}
-
Bitmap *screenBitmap;
-
+#if 0
static void BlitScreenToBitmap_SP__Stage_Blt()
{
BlitScreenToBitmap_SP(window);
}
+#endif
static void init_struct_functions()
{
+#if 1
+ Stage.Blt = &DDScrollBuffer_Blt;
+#else
Stage.Blt = &BlitScreenToBitmap_SP__Stage_Blt;
+#endif
Stage.ScrollTo = &DDScrollBuffer_ScrollTo;
Stage.ScrollTowards = &DDScrollBuffer_ScrollTowards;
StretchedSprites.BltEx = &DDSpriteBuffer_BltEx;
}
+static void init_global_values()
+{
+ menBorder.Checked = True * 0;
+ menPanel.Checked = True;
+ menAutoScroll.Checked = True;
+
+ MainForm.picPane.Width = picPane.Width = 1935;
+ MainForm.picPane.Height = picPane.Height = 1635;
+}
+
void sp_open_all()
{
init_struct_functions();
+ init_global_values();
Form_Load();
SetBitmaps_SP(&sp_objects);
+#if 1
+ screenBitmap = CreateBitmap(60 * TILEX, 24 * TILEY,
+ DEFAULT_DEPTH);
+#else
screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
DEFAULT_DEPTH);
+#endif
DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16);
}
void BlitScreenToBitmap_SP(Bitmap *target_bitmap)
{
- BlitBitmap(screenBitmap, target_bitmap, 0, 0,
+ BlitBitmap(screenBitmap, target_bitmap, 15 * 32, 7 * 32,
SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY);
}
boolean Checked;
} menBorderObject;
+typedef struct
+{
+ boolean Checked;
+} menPanelObject;
+
+typedef struct
+{
+ boolean Checked;
+} menAutoScrollObject;
+
#endif /* VB_TYPES_H */
lblFrameCountObject lblFrameCount;
cmbFileObject cmbFile;
shpProgressObject shpProgress;
+menBorderObject menBorder;
+menPanelObject menPanel;
+menAutoScrollObject menAutoScroll;
+
+MainForm_picPane picPane;
extern shpProgressObject shpProgress;
extern lblFrameCountObject lblFrameCount;
extern menBorderObject menBorder;
+extern menPanelObject menPanel;
+extern menAutoScrollObject menAutoScroll;
+
+extern MainForm_picPane picPane;
extern int hWnd;