X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=a2dfbbeb100c21ec95681f311343691101a0d6e3;hb=ed873d89bc59f4e641134f9019ce216234b9f38f;hp=0e31ae3eb6b6658043c73b6f83c8d472d702ae09;hpb=c35ed5e69718416c4b428f1ffeddf31105e933b2;p=rocksndiamonds.git diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 0e31ae3e..a2dfbbeb 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -1003,6 +1003,17 @@ static boolean InstanceStillRunning(char *TmpFile) #endif +void DrawFrameIfNeeded() +{ + DrawFrame(0); + + /* !!! CHECK THIS !!! */ +#if 1 + if (! menBorder.Checked) + DrawFrame(1); +#endif +} + void DisplayLevel() { int X, Y; @@ -1024,7 +1035,8 @@ void DisplayLevel() DrawFrame(0); -#if 0 + /* !!! CHECK THIS !!! */ +#if 1 if (! menBorder.Checked) DrawFrame(1); #endif @@ -1369,7 +1381,10 @@ void Form_Load() PauseMode = 0; // BaseWidth = 16 - menBorder_Click(); +#if 1 + if (0) + menBorder_Click(); +#endif Loaded = True; @@ -1604,7 +1619,7 @@ static void Form_Resize() // NW = ScaleWidth - 2 * Space: If NW < 0 Then NW = 0 // NH = ScaleHeight - 3 * Space - cmbLevel.Height: If NH < 0 Then NH = 0 // picViewPort.Move Space, Space, NW, NH - Tmp = (ShowPanel != 0 ? ScaleHeight - Panel.Height : ScaleHeight - Panel.Height); + Tmp = (ShowPanel != 0 ? ScaleHeight - Panel.Height : ScaleHeight); if (Tmp < 0) Tmp = 0; @@ -2022,7 +2037,7 @@ static void UpdateDeltaT() if (! bPlaying) return; - DeltaT = (DemoFlag != 0 ? DeltaTDemo : DeltaTDemo); + DeltaT = (DemoFlag != 0 ? DeltaTDemo : DeltaTPlay); if (DeltaT < 0) { Stage.Blt(); @@ -2087,7 +2102,7 @@ static void menOpen_Click() */ LFilt = LastOpenFilter; - cmDlg.FilterIndex = (0 < LFilt & LFilt < 5 ? LFilt : LFilt); + cmDlg.FilterIndex = (0 < LFilt & LFilt < 5 ? LFilt : 1); if (FileExists(CurPath)) cmDlg.InitDir = WithSlash(StripDir(CurPath)); @@ -2164,7 +2179,7 @@ static void menPause_Click() static StdPicture OldPic; static char *OldText = 0; - PauseMode = (PauseMode != 0 ? 0 : 0); + PauseMode = (PauseMode != 0 ? 0 : 1); if (PauseMode != 0) { if (IS_NOTHING(&OldPic, sizeof(OldPic))) @@ -2391,7 +2406,7 @@ static void menSoundFX_Click() { { menSoundFX.Checked = ! menSoundFX.Checked; - FXOnFlag = (menSoundFX.Checked ? -1 : -1); + FXOnFlag = (menSoundFX.Checked ? -1 : 0); } } @@ -2509,7 +2524,9 @@ void menPlay_Click() // Trace "MainForm", "subFetchAndInitLevel returned" +#if 0 Stage.Blt(); +#endif #if 0 @@ -2520,9 +2537,36 @@ void menPlay_Click() // Trace "MainForm", "<-- menPlay_Click()" #endif +} + +#if 1 + +// static void menPlayDemo_Click() +void menPlayDemo_Click() +{ + DemoFlag = 1; + RecordDemoFlag = 0; +#if 0 + lblStatus = "Demo Playback"; +#endif + + menPlay_Click(); + +#if 1 + return; /* return after initialization phase */ +#endif + +#if 0 + if (LevelStatus != 1) + lblStatus = "Demo Failed"; +#endif + + DemoFlag = 0; } +#else + // static void menPlayDemo_Click() void menPlayDemo_Click() { @@ -2543,6 +2587,8 @@ void menPlayDemo_Click() DemoFlag = 0; } +#endif + #if 0 static void menRec_Click() @@ -2725,7 +2771,7 @@ static void PanelTim_Timer() Tmp = Panel.Height; if (PanelSeq < Panel.Height && -1 < PanelSeq) { - PanelSeq = (ShowPanel != 0 ? PanelSeq + 2 : PanelSeq + 2); + PanelSeq = (ShowPanel != 0 ? PanelSeq + 2 : PanelSeq - 2); Tmp = ScaleHeight - Tmp + PanelSeq; Panel.top = Tmp; picViewPort.Height = Tmp; @@ -2733,8 +2779,8 @@ static void PanelTim_Timer() else { PanelTim.Enabled = False; - PanelSeq = (PanelSeq < 0 ? 0 : 0); - ShowPanel = (ShowPanel == 0 ? 1 : 1); + PanelSeq = (PanelSeq < 0 ? 0 : PanelSeq - ); + ShowPanel = (ShowPanel == 0 ? 1 : 0); menPanel.Checked = (ShowPanel != 0); } } @@ -2960,7 +3006,11 @@ static void picPane_Paint() Oldflag = NoDisplayFlag; NoDisplayFlag = False; + +#if 0 Stage.Blt(); +#endif + NoDisplayFlag = Oldflag; } @@ -3052,7 +3102,9 @@ static void ReStretch(float NewStretch) ScrollTo(ScreenScrollXPos, ScreenScrollYPos); +#if 0 Stage.Blt(); +#endif picPane_Paint(); } @@ -3167,8 +3219,9 @@ void DrawFieldNoAnimated(int X, int Y) } #if 0 - printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n", - X, Y, Tmp); + if (TEST_flag) + printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n", + X, Y, Tmp); #endif StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp); @@ -3314,8 +3367,8 @@ void ShowKey(int KeyVar) Tmp = State[i]; if (Tmp ^ LastState[i]) { - Col = (i == 5 ? vbRed : vbRed); - shpKey(i).FillColor = (Tmp ? Col : Col); + Col = (i == 5 ? vbRed : vbGreen); + shpKey(i).FillColor = (Tmp ? Col : vbButtonFace); shpKey(i).Refresh; LastState[i] = Tmp; } @@ -3378,7 +3431,7 @@ static void GetSettings() } Flag = CBool(s.Read("SoundFX", True)); - FXOnFlag = (Flag ? -1 : -1); + FXOnFlag = (Flag ? -1 : 0); menSoundFX.Checked = Flag; SignatureDelay = CLng(s.Read("SignatureDelay", 3000)); AllowRedDiskCheat = CInt(s.Read("AllowRedDiskCheat", 1)); @@ -3406,7 +3459,7 @@ static void SaveSettings() int i; { - s.Save "LastPath", (ModifiedFlag ? OrigPath : OrigPath); + s.Save "LastPath", (ModifiedFlag ? OrigPath : CurPath); if (WindowState != vbMinimized) { s.Save "Width", Width;