X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=1358ab0278fe819540ac5c5d8593c1b25f54b691;hb=148d0ad7e7ac1a97eb50de7ecbb642f36c877311;hp=baa31b5eba85d59401d2168d57fd11814148398a;hpb=1533b136c6f8d0656cc45ca4c204104ef3d75249;p=rocksndiamonds.git diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index baa31b5e..1358ab02 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -1007,7 +1007,7 @@ void DisplayLevel() { int X, Y; -#if 1 +#if 0 printf("::: MainForm.c: DisplayLevel(): %d, %d, %d\n", Loaded, LevelLoaded, bPlaying); #endif @@ -1031,7 +1031,7 @@ void DisplayLevel() if (bPlaying) { -#if 1 +#if 0 printf("::: MainForm.c: DisplayLevel(): [%ld, %ld, %ld, %ld] [%d, %d]...\n", DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY, FieldWidth, FieldHeight); @@ -1604,7 +1604,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 +2022,7 @@ static void UpdateDeltaT() if (! bPlaying) return; - DeltaT = (DemoFlag != 0 ? DeltaTDemo : DeltaTDemo); + DeltaT = (DemoFlag != 0 ? DeltaTDemo : DeltaTPlay); if (DeltaT < 0) { Stage.Blt(); @@ -2087,7 +2087,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 +2164,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 +2391,7 @@ static void menSoundFX_Click() { { menSoundFX.Checked = ! menSoundFX.Checked; - FXOnFlag = (menSoundFX.Checked ? -1 : -1); + FXOnFlag = (menSoundFX.Checked ? -1 : 0); } } @@ -2461,13 +2461,13 @@ void menPlay_Click() UpdateDeltaT(); #endif -#if 1 +#if 0 printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n"); #endif subFetchAndInitLevelB(); -#if 1 +#if 0 printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): done\n"); #endif @@ -2525,18 +2525,56 @@ void menPlay_Click() #if 0 -static void menPlayDemo_Click() +// static void menPlayDemo_Click() +void menPlayDemo_Click() { DemoFlag = 1; RecordDemoFlag = 0; + +#if 0 lblStatus = "Demo Playback"; +#endif + menPlay_Click(); + +#if 1 + return; +#endif + +#if 0 if (LevelStatus != 1) lblStatus = "Demo Failed"; +#endif DemoFlag = 0; } +#else + +// static void menPlayDemo_Click() +void menPlayDemo_Click() +{ + DemoFlag = 1; + RecordDemoFlag = 0; + +#if 0 + lblStatus = "Demo Playback"; +#endif + + menPlay_Click(); + +#if 0 + if (LevelStatus != 1) + lblStatus = "Demo Failed"; +#endif + + DemoFlag = 0; +} + +#endif + +#if 0 + static void menRec_Click() { Trace("MainForm", "--> menRec_Click()"); @@ -2717,7 +2755,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; @@ -2725,8 +2763,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); } } @@ -2964,13 +3002,13 @@ static void ReStretch(float NewStretch) long BW2, LW, LH, i; #endif -#if 1 +#if 0 printf("::: MainForm.c: ReStretch(): %d, %d\n", Loaded, LevelLoaded); #endif if (! Loaded) { -#if 1 +#if 0 printf("::: NewStretch == %f\n", NewStretch); #endif @@ -3027,7 +3065,7 @@ static void ReStretch(float NewStretch) if (Loaded && LevelLoaded) { -#if 1 +#if 0 printf("::: MainForm.c: ReStretch(): ...\n"); #endif @@ -3038,7 +3076,7 @@ static void ReStretch(float NewStretch) subCalculateScreenScrollPos(); -#if 1 +#if 0 printf("::: MainForm.c: ReStretch(): %d, %d\n", ScreenScrollXPos, ScreenScrollYPos); #endif @@ -3056,7 +3094,7 @@ static void ReStretch(float NewStretch) static void SetScrollEdges() { -#if 1 +#if 0 printf("::: MainForm.c: SetScrollEdges() ... [%ld, %ld, %ld, %ld] [%f, %d] [%d, %d, %d, %d]\n", DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY, Stretch, BaseWidth, @@ -3065,15 +3103,10 @@ static void SetScrollEdges() ScrollMinX = (int)(DisplayMinX - 0.5) * Stretch * BaseWidth; ScrollMinY = (int)(DisplayMinY - 0.5) * Stretch * BaseWidth; -#if 1 - ScrollMaxX = (int)(DisplayMaxX + 1.5) * Stretch * BaseWidth; - ScrollMaxY = (int)(DisplayMaxY + 1.5) * Stretch * BaseWidth; -#else ScrollMaxX = (int)(DisplayMaxX + 1.5) * Stretch * BaseWidth - picPane.Width; ScrollMaxY = (int)(DisplayMaxY + 1.5) * Stretch * BaseWidth - picPane.Height; -#endif -#if 1 +#if 0 printf("::: MainForm.c: SetScrollEdges() done [%d, %d, %d, %d]\n", ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY); #endif @@ -3165,7 +3198,7 @@ void DrawFieldNoAnimated(int X, int Y) #if 0 printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n", - X, Y, StretchWidth); + X, Y, Tmp); #endif StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp); @@ -3233,7 +3266,7 @@ static void picViewPort_Resize() SetScrollEdges(); -#if 1 +#if 0 printf("::: MainForm.c: picViewPort_Resize(): %d, %d\n", ScrollX, ScrollY); #endif @@ -3311,8 +3344,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; } @@ -3375,7 +3408,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)); @@ -3403,7 +3436,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;