Browse Source

battle bug fix

Wei Mingzhi 9 years ago
parent
commit
c9d172a5eb
1 changed files with 7 additions and 1 deletions
  1. 7 1
      battle.c

+ 7 - 1
battle.c

@@ -600,7 +600,9 @@ PAL_LoadBattleBackground(
    {
       TerminateOnError("PAL_LoadBattleBackground(): failed to create surface!");
    }
-
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+   SDL_SetSurfacePalette(g_Battle.lpBackground, gpScreen->format->palette);
+#endif
    //
    // Load the picture
    //
@@ -1349,6 +1351,10 @@ PAL_StartBattle(
       TerminateOnError("PAL_StartBattle(): creating surface for scene buffer failed!");
    }
 
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+   SDL_SetSurfacePalette(g_Battle.lpSceneBuf, gpScreen->format->palette);
+#endif
+
    PAL_UpdateEquipments();
 
    g_Battle.iExpGained = 0;