Browse Source

Various bug fix

1. sfx index fix from palxex
2. Force list mode for FileOpenPicker [WinRT]
3. Try make the magic sound from negative to postive
louyihua 8 years ago
parent
commit
d14db7fa8d
4 changed files with 12 additions and 1 deletions
  1. 1 1
      fight.c
  2. 9 0
      global.c
  3. 1 0
      script.c
  4. 1 0
      winrt/SDLPal.Common/MainPage.xaml.cpp

+ 1 - 1
fight.c

@@ -3615,7 +3615,7 @@ PAL_BattlePlayerPerformAction(
 
          g_Battle.rgPlayer[wPlayerIndex].iColorShift = 6;
          g_Battle.rgPlayer[wPlayerIndex].wCurrentFrame = 5;
-         SOUND_Play(157);
+         SOUND_Play(29);
          PAL_BattleDelay(5, 0, TRUE);
 
          g_Battle.rgPlayer[wPlayerIndex].wCurrentFrame = 6;

+ 9 - 0
global.c

@@ -464,6 +464,15 @@ PAL_ReadGlobalGameData(
    PAL_MKFReadChunk((LPBYTE)(p->rgLevelUpExp), sizeof(p->rgLevelUpExp),
       14, gpGlobals->f.fpDATA);
    DO_BYTESWAP(p->rgLevelUpExp, sizeof(p->rgLevelUpExp));
+
+   // FIX: Enemy magic sound may be negative
+   for (int i = 0; i < p->nEnemy; i++)
+   {
+	   if (p->lprgEnemy[i].wMagicSound >= 32768)
+	   {
+		   p->lprgEnemy[i].wMagicSound = -(short)p->lprgEnemy[i].wMagicSound;
+	   }
+   }
 }
 
 static VOID

+ 1 - 0
script.c

@@ -2894,6 +2894,7 @@ PAL_InterpretInstruction(
 
          g_Battle.rgEnemy[wEventObjectID].iColorShift = 0;
 
+		 SOUND_Play(47);
          PAL_BattleBackupScene();
          PAL_LoadBattleSprites();
          PAL_BattleMakeScene();

+ 1 - 0
winrt/SDLPal.Common/MainPage.xaml.cpp

@@ -213,6 +213,7 @@ void SDLPal::MainPage::btnBrowseFile_Click(Platform::Object^ sender, Windows::UI
 {
 	auto picker = ref new Windows::Storage::Pickers::FileOpenPicker();
 	picker->FileTypeFilter->Append("*");
+	picker->ViewMode = Windows::Storage::Pickers::PickerViewMode::List;
 #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
 	picker->PickSingleFileAndContinue();
 #else