From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3404F81E97 for ; Tue, 29 Nov 2016 03:41:17 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 29 Nov 2016 03:41:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,568,1473145200"; d="scan'208";a="906682779" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by orsmga003.jf.intel.com with ESMTP; 29 Nov 2016 03:41:15 -0800 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Tue, 29 Nov 2016 19:41:12 +0800 Message-Id: <1480419672-23664-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: fix the bug to add PaletteSize info into AutoGen X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 11:41:17 -0000 Fix the bug to add PaletteSize info into AutoGen.c when the flag UEFI_HII_RESOURCE_SECTION is set to FALSE. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/GenC.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index de6eb0e..63cfe04 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1693,14 +1693,15 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfGenCFlag, IdfGenBinBuffer): TempBuffer += Buffer elif File.Ext.upper() == '.BMP': 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))) TempBufferList = AscToHexList(TempBuffer) BufferStr = WriteLine(BufferStr, CreateArrayItem(TempBufferList, 16) + '\n') -- 2.6.1.windows.1