BaseTools: fix the bug to add PaletteSize info into AutoGen

Fix the bug to add PaletteSize info into AutoGen.c when the flag
UEFI_HII_RESOURCE_SECTION is set to FALSE.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu 2016-11-29 10:09:17 +08:00
parent 60a5378208
commit e148e6e962
1 changed files with 4 additions and 3 deletions

View File

@ -1695,10 +1695,11 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfGenCFlag, IdfGenBinBuffer):
TempBuffer, TempPalette = BmpImageDecoder(File, Buffer, PaletteIndex, FileObj.TransParent)
if len(TempPalette) > 1:
PaletteIndex += 1
PaletteBuffer += pack('H', len(TempPalette))
PaletteBuffer += TempPalette
NewPalette = pack('H', len(TempPalette))
NewPalette += TempPalette
PaletteBuffer += NewPalette
PaletteStr = WriteLine(PaletteStr, '// %s: %s: %s' % (DecToHexStr(PaletteIndex - 1, 4), ID, DecToHexStr(PaletteIndex - 1, 4)))
TempPaletteList = AscToHexList(TempPalette)
TempPaletteList = AscToHexList(NewPalette)
PaletteStr = WriteLine(PaletteStr, CreateArrayItem(TempPaletteList, 16) + '\n')
ImageBuffer += TempBuffer
BufferStr = WriteLine(BufferStr, '// %s: %s: %s' % (DecToHexStr(Index, 4), ID, DecToHexStr(Index, 4)))