浏览代码

battle bug fix

Wei Mingzhi 10 年之前
父节点
当前提交
c9d172a5eb
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      battle.c

+ 7 - 1
battle.c

@@ -600,7 +600,9 @@ PAL_LoadBattleBackground(
    {
    {
       TerminateOnError("PAL_LoadBattleBackground(): failed to create surface!");
       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
    // Load the picture
    //
    //
@@ -1349,6 +1351,10 @@ PAL_StartBattle(
       TerminateOnError("PAL_StartBattle(): creating surface for scene buffer failed!");
       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();
    PAL_UpdateEquipments();
 
 
    g_Battle.iExpGained = 0;
    g_Battle.iExpGained = 0;