From 05bea6a707b1e13350f4f1d0f7d19141a69731f0 Mon Sep 17 00:00:00 2001 From: natural-law Date: Mon, 11 Oct 2010 07:28:58 +0000 Subject: [PATCH] issue #182 --- cocos2dx-uphone.sln | 3 + .../platform/uphone/CCXUIImage_uphone.cpp | 129 +++++++++++++++- cocos2dx/platform/uphone/CCXUIImage_uphone.h | 28 ++++ template/AppDelegate.cpp | 9 ++ template/HelloWorldScene.cpp | 8 +- template/Res/cocosTemplate_Res.ENU.tr3 | 10 +- template/Res/cocosTemplate_Res.ENU.tr3.tts | 2 +- template/Res/cocosTemplate_Res.TR3 | 10 +- template/Res/cocosTemplate_Res.h | 4 +- template/Res/cocostemplate_res_c.h | 141 ++++++++++++++++++ template/Res/cocostemplate_res_def.h | 2 + template/Res/cocostemplate_res_h.h | 4 + template/Resource.h | 18 +++ template/cocosTemplate.vcproj | 14 +- template/main.cpp | 4 +- 15 files changed, 371 insertions(+), 15 deletions(-) create mode 100644 template/Resource.h diff --git a/cocos2dx-uphone.sln b/cocos2dx-uphone.sln index 380039fe0d..e1df646c05 100644 --- a/cocos2dx-uphone.sln +++ b/cocos2dx-uphone.sln @@ -27,6 +27,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestAudioEngine", "TestAudi EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cocosTemplate", "template\cocosTemplate.vcproj", "{A2338E7B-155B-4A3B-AB4B-518ECDD26564}" + ProjectSection(ProjectDependencies) = postProject + {6AC43F51-A036-4653-B910-BDDC346D15E7} = {6AC43F51-A036-4653-B910-BDDC346D15E7} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/cocos2dx/platform/uphone/CCXUIImage_uphone.cpp b/cocos2dx/platform/uphone/CCXUIImage_uphone.cpp index 9cc8f9a56f..182e500830 100644 --- a/cocos2dx/platform/uphone/CCXUIImage_uphone.cpp +++ b/cocos2dx/platform/uphone/CCXUIImage_uphone.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCXUIImage_uphone.h" - -#include +#include "CCXFileUtils.h" +#include "TG3.h" #include "png.h" #include "CCXBitmapDC.h" @@ -52,6 +52,8 @@ typedef struct int offset; }tImageSource; +static ResourceImageMap s_ImgMap; +static ResourceHandle s_HRes; // because we do not want to include "png.h" in CCXUIImage_uphone.h, so we implement // the function as a static function @@ -133,7 +135,26 @@ bool UIImage::initWithContentsOfFile(const string &strPath, tImageFormat imageTy bRet = false; break; } - + + if (!bRet) + { + // attempt load image from the ResourceImageMap when can't find the image file. + ResourceImageMap::iterator iter; + iter = s_ImgMap.find(strPath); + + do + { + CCX_BREAK_IF(iter == s_ImgMap.end()); + + const TBitmap* pBmp = s_HRes.LoadConstBitmap(iter->second); + + CCX_BREAK_IF(!pBmp); + + initWithBitmap(pBmp); + bRet = true; + } while (0); + } + return bRet; } @@ -152,6 +173,32 @@ bool UIImage::isAlphaPixelFormat(void) return m_imageInfo.hasAlpha; } +void UIImage::setResourceEntry(const AppResourceEntry* pResEntry) +{ + if (pResEntry) + { + s_HRes.setResourceEntry(pResEntry); + } +} + +void UIImage::setImageMap(const std::string keys[], const int values[], int nCount) +{ + // first, clear the map before + if (!s_ImgMap.empty()) + { + s_ImgMap.clear(); + } + + // second, insert the pairs + for (int i = 0; i < nCount; ++i) + { + std::string key = CCFileUtils::fullPathFromRelativePath((keys[i]).c_str()); + Int32 nResID = values[i]; + + s_ImgMap.insert(ResourceImageMap::value_type(key, nResID)); + } +} + // now, uphone only support premultiplied data // so, we only return true bool UIImage::isPremultipliedAlpha(void) @@ -411,4 +458,80 @@ bool UIImage::initWithBuffer(int tx, int ty, unsigned char *pBuffer) return false; } +bool UIImage::initWithBitmap(const TBitmap* pBmp) +{ + bool bRet = false; + + do + { + CCX_BREAK_IF(! pBmp); + +// TBitmap* pBitmap = pBmp->DupBitmapTo32(); + + // init imageinfo + INT32 nWidth = pBmp->GetWidth(); + INT32 nHeight = pBmp->GetHeight(); + CCX_BREAK_IF(nWidth <= 0 || nHeight <= 0); + + INT32 nLen = pBmp->GetRowBytes() * nHeight; + m_imageInfo.data = new unsigned char [nLen]; + CCX_BREAK_IF(! m_imageInfo.data); + memcpy(m_imageInfo.data, pBmp->GetDataPtr(), nLen); + + m_imageInfo.height = nHeight; + m_imageInfo.width = nWidth; + m_imageInfo.hasAlpha = true; + // uphone only support isPremultipliedAlpha + m_imageInfo.isPremultipliedAlpha = true; + m_imageInfo.bitsPerComponent = pBmp->GetDepth() / 4; + + bRet = true; + } while (0); + + return bRet; +} + +////////////////////////////////////////////////// +// +// ResourceHandle +// +////////////////////////////////////////////////// +ResourceHandle::ResourceHandle() +:m_pResLib(NULL) +{ +} + +ResourceHandle::~ResourceHandle() +{ + release(); +} + +void ResourceHandle::release() +{ + if (m_pResLib) + { + delete m_pResLib; + m_pResLib = NULL; + } +} + +void ResourceHandle::setResourceEntry(const AppResourceEntry* pResEntry) +{ + release(); + + m_pResLib = new TResourceLib(pResEntry); +} + +const TBitmap* ResourceHandle::LoadConstBitmap(Int32 nResID) +{ + const TBitmap* pResult = NULL; + + if (m_pResLib) + { + pResult = m_pResLib->LoadConstBitmap(nResID); + } + + return pResult; +} + }//namespace cocos2d diff --git a/cocos2dx/platform/uphone/CCXUIImage_uphone.h b/cocos2dx/platform/uphone/CCXUIImage_uphone.h index 94384fc549..61dfc7bdd7 100644 --- a/cocos2dx/platform/uphone/CCXUIImage_uphone.h +++ b/cocos2dx/platform/uphone/CCXUIImage_uphone.h @@ -25,10 +25,15 @@ THE SOFTWARE. #ifndef __PLATFORM_UPHONE_UIIMAGE_H__ #define __PLATFORM_UPHONE_UIIMAGE_H__ +#include #include #include "ccxCommon.h" #include "CCRenderTexture.h" +class TBitmap; +class TResourceLib; +struct AppResourceEntry; + namespace cocos2d { class CCXBitmapDC; @@ -42,6 +47,22 @@ typedef struct bool isPremultipliedAlpha; unsigned char *data; } tImageInfo; + +typedef std::map ResourceImageMap; + +class ResourceHandle +{ +public: + ResourceHandle(); + ~ResourceHandle(); + + void setResourceEntry(const AppResourceEntry* pResEntry); + void release(); + const TBitmap* LoadConstBitmap(int nResID); + +private: + TResourceLib* m_pResLib; +}; /// @endcond /** @@ -73,6 +94,7 @@ public: bool initWithData(unsigned char *pBuffer, int nLength); /// @cond + bool initWithBitmap(const TBitmap* pBmp); bool initWithBuffer(int tx, int ty, unsigned char *pBuffer); bool save(const std::string &strFileName, int nFormat); /// @endcond @@ -95,6 +117,12 @@ public: /** get the image data */ unsigned char* getData(void); + /** set the Resource Entry */ + static void setResourceEntry(const AppResourceEntry* pResEntry); + + /** set the map between UIImage key and ResID */ + static void setImageMap(const std::string keys[], const int values[], int nCount); + private: bool loadPng(const char* strFileName); bool loadPngFromStream(unsigned char *data, int nLength); diff --git a/template/AppDelegate.cpp b/template/AppDelegate.cpp index b237e7f7ff..49075310e3 100644 --- a/template/AppDelegate.cpp +++ b/template/AppDelegate.cpp @@ -8,9 +8,12 @@ #include "AppDelegate.h" #include "HelloWorldScene.h" +#include "Resource.h" using namespace cocos2d; +extern const AppResourceEntry cocosTemplateResourceEntry; + // the works are the same as NSObject::applicationDidFinishLaunching of cocos2d-iphone bool AppDelegate::initCocos2d() { @@ -24,6 +27,12 @@ bool AppDelegate::initCocos2d() // turn on display FPS pDirector->setDisplayFPS(true); + // set the ResourceEntry + UIImage::setResourceEntry(&cocosTemplateResourceEntry); + + // set the map between names and ResIDs + UIImage::setImageMap(ResourceNames, nResIDs, sizeof(nResIDs) / sizeof(Int32)); + // create a scene. it's an autorelease object CCScene *pScene = HelloWorld::scene(); diff --git a/template/HelloWorldScene.cpp b/template/HelloWorldScene.cpp index b2f1d83dcf..79cd8f1592 100644 --- a/template/HelloWorldScene.cpp +++ b/template/HelloWorldScene.cpp @@ -1,10 +1,8 @@ #include "HelloWorldScene.h" +#include "Resource.h" using namespace cocos2d; -#define PATH_CLOSE_NORMAL "/NEWPLUS/TDA_DATA/UserData/CloseNormal.png" -#define PATH_CLOSE_SELECTED "/NEWPLUS/TDA_DATA/UserData/CloseSelected.png" - CCScene* HelloWorld::scene() { // 'scene' is an autorelease object @@ -36,8 +34,8 @@ bool HelloWorld::init() // add a "close" icon to exit the progress. it's an autorelease object CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage( - PATH_CLOSE_NORMAL, - PATH_CLOSE_SELECTED, + (ResourceNames[0]).c_str(), + (ResourceNames[1]).c_str(), this, menu_selector(HelloWorld::menuCloseCallback) ); pCloseItem->setPosition( ccp(CCDirector::getSharedDirector()->getWinSize().width - 20, 20) ); diff --git a/template/Res/cocosTemplate_Res.ENU.tr3 b/template/Res/cocosTemplate_Res.ENU.tr3 index f7fe7c4bae..e26adb169b 100644 --- a/template/Res/cocosTemplate_Res.ENU.tr3 +++ b/template/Res/cocosTemplate_Res.ENU.tr3 @@ -1,6 +1,6 @@ // Original file name: cocosTemplate_Res.ENU.tr3 -// Generated by TOPS Builder 1.2.3.235 Date:2010-09-29 +// Generated by TOPS Builder 1.2.3.235 Date:2010-10-9 //$VERSION 60004 @@ -56,6 +56,14 @@ END IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029 // 文件夹: Root(All) BEGIN + BITMAP ID CloseNormal NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF + FileName $002E$002E$005C$0069$006D$0067$005C$0043$006C$006F$0073$0065$004E$006F$0072$006D$0061$006C$002E$0070$006E$0067 + //..\img\CloseNormal.png + + BITMAP ID CloseSelected NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF + FileName $002E$002E$005C$0069$006D$0067$005C$0043$006C$006F$0073$0065$0053$0065$006C$0065$0063$0074$0065$0064$002E$0070$006E$0067 + //..\img\CloseSelected.png + END // raw data diff --git a/template/Res/cocosTemplate_Res.ENU.tr3.tts b/template/Res/cocosTemplate_Res.ENU.tr3.tts index 6ce5cad02f..c35f29b1b8 100644 --- a/template/Res/cocosTemplate_Res.ENU.tr3.tts +++ b/template/Res/cocosTemplate_Res.ENU.tr3.tts @@ -4,6 +4,6 @@ // update the controls' trnaslation status. // Original file name: cocosTemplate_Res.ENU.tr3.tts -// Generated by TOPS Builder 1.2.3.235 Date:2010-09-29 +// Generated by TOPS Builder 1.2.3.235 Date:2010-10-9 diff --git a/template/Res/cocosTemplate_Res.TR3 b/template/Res/cocosTemplate_Res.TR3 index fbcfb40209..a37e1fea55 100644 --- a/template/Res/cocosTemplate_Res.TR3 +++ b/template/Res/cocosTemplate_Res.TR3 @@ -1,6 +1,6 @@ // Original file name: cocosTemplate_Res.TR3 -// Generated by TOPS Builder 1.2.3.235 Date:2010-09-29 +// Generated by TOPS Builder 1.2.3.235 Date:2010-10-9 #include "cocosTemplate_Res.h" @@ -58,6 +58,14 @@ END IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029 // 文件夹: Root(All) BEGIN + BITMAP ID CloseNormal NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF + FileName $002E$002E$005C$0069$006D$0067$005C$0043$006C$006F$0073$0065$004E$006F$0072$006D$0061$006C$002E$0070$006E$0067 + //..\img\CloseNormal.png + + BITMAP ID CloseSelected NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF + FileName $002E$002E$005C$0069$006D$0067$005C$0043$006C$006F$0073$0065$0053$0065$006C$0065$0063$0074$0065$0064$002E$0070$006E$0067 + //..\img\CloseSelected.png + END // raw data diff --git a/template/Res/cocosTemplate_Res.h b/template/Res/cocosTemplate_Res.h index ace99c0d92..5806e456ae 100644 --- a/template/Res/cocosTemplate_Res.h +++ b/template/Res/cocosTemplate_Res.h @@ -1,5 +1,7 @@ // Original file name: cocosTemplate_Res.h -// Generated by TOPS Builder 1.2.3.235 Date:2010-09-29 +// Generated by TOPS Builder 1.2.3.235 Date:2010-10-9 #define ResFolder1001 1001 #define Form1002 1002 +#define CloseNormal 1003 +#define CloseSelected 1004 diff --git a/template/Res/cocostemplate_res_c.h b/template/Res/cocostemplate_res_c.h index f1420cdade..738097cfef 100644 --- a/template/Res/cocostemplate_res_c.h +++ b/template/Res/cocostemplate_res_c.h @@ -114,10 +114,149 @@ const ResWindowType COCOST_Form1002 = 0, // 旋转参考表子项个数 NULL // 界面旋转参考表(空) };//窗体COCOST_Form1002资源数据常量结束 +const UInt32 COCOST_Bitmap_CloseNormal_bmp_data[]= +{ + //Bmp Datas,位图数据(2311字节,原图:32x32,4096字节,压缩成56%): + 0x00000001, 0x00000907, 0x00000000, 0x00000000, + // data length : 2311 + //|00000000 |00000001 |00000002 |00000003 |00000004 |00000005 |00000006 |00000007 |00000008 |00000009 |00000010 |00000011 |00000012 |00000013 |00000014 |00000015 + /*00000000*/0x474E5089,0x0A1A0A0D,0x0D000000,0x52444849,0x20000000,0x20000000,0x00000608,0x7A7A7300,0x080000F4,0x414449CE,0x9D855854,0x5C6C7996,0x3FC71DC5,0x3ADEF333,0x1276B23E,0x42773827, + /*00000001*/0x2E43620E,0x81443404,0x1090DA12,0xA545085B,0x2B6AB47F,0x23AA0095,0x0AAB5142,0xA0F4B4A9,0xA8504095,0xB5542A48,0xA954011C,0x91314889,0x1608155A,0x89094A49,0x71397383,0x7884EC2E, + /*00000002*/0xEDAF5DED,0x7BDF77B5,0x1FE98EF3,0xA4E33EBB,0xBEED23B4,0xFD9BD5D9,0xDFDFBF7C,0xE2ADEFCC,0x8A9A631A,0x7B37582D,0x38E366D1,0xDBF43BB2,0xC8EF75AF,0xC5642251,0x3DE6EBBA,0x67B2313C, + /*00000003*/0x96B90475,0xD46EBB2F,0xCA721528,0xF1BE1BB3,0xD689E4CF,0x4FE3D770,0x58825A9E,0x09D665FA,0xB0DF0F10,0xFE2FA5FC,0x78F82875,0x9BA96BFB,0xFD362B8B,0x37E7F05F,0xE06F737E,0x8E38C67A, + /*00000004*/0x8698C631,0x56DD7E27,0xDFF1588D,0x5E2C8FE0,0xF5A7BDB6,0x3A1DC982,0xBB5B7462,0x33B1DE69,0xFE28BCB7,0x5700FFC0,0xFF5B9E53,0x71DF5EC0,0x369DD04D,0xE35696B9,0x7C60BD9E,0x7FBB37CF, + /*00000005*/0x0D7B54F4,0xE0D5E562,0xBA5C2F0F,0xCA7CD93D,0x37EE35F4,0xADFA9F17,0x73F4F4B9,0x71C8E066,0xED99E073,0xC6A11557,0xEEB17FC2,0xBD8F9DFE,0xC8AD63BD,0xBB27E00E,0xD84F8131,0x4E94403F, + /*00000006*/0x7BBEF8B3,0xC4E667CB,0xF707E3C6,0x31212637,0xC179BE12,0xF97EDB8D,0xA2FA8EC6,0xF7FA2EEE,0x0C898C7D,0xDE92EB91,0x6F2A37F5,0xDD57B6AA,0x91DD7374,0x3B5B0783,0xB8E4EF43,0x9A854A02, + /*00000007*/0xF7DDD4F2,0xD76C7CED,0x2E656B6B,0x83764E8B,0x11ED18D6,0xA6613E79,0xCDD5289F,0xE5F5DAC2,0xE362B2B3,0x371FC3C9,0x40212126,0xB35F9E6C,0xFF97C9ED,0x97DC5F58,0xA7C9F726,0x84C42098, + /*00000008*/0x8FBA4121,0x38C3C1EC,0x75330F07,0x2DF66DF5,0x3BAA6F0B,0x28D9FCD6,0xFE106A11,0x3B75B5F3,0x95F5FEB7,0xF075D2B5,0xDF1852BB,0xE31A78C7,0x2EABF979,0x98A64888,0xF2EEFEBF,0xC6E10379, + /*00000009*/0x3EC7E3E6,0xE2CE77B9,0xE17C9FC7,0xB925ADC5,0x33536E0C,0xC2F30826,0xE4E71F7D,0x1E9E8269,0x8FA21844,0x8AD2671E,0xB9CAF6A5,0x9F4EEA8B,0x11DAD53E,0x2A8845E4,0xD8FC5B15,0xB0FE7B9A, + /*00000010*/0xFE7F2FF5,0xF8F8159A,0x020869DD,0xDA84D68C,0x3C30A42F,0x11171C8F,0xA6ABA18B,0x9FDFFE73,0xCCE75385,0x09A37154,0x84C69D4E,0x401F9121,0x7577E210,0x0A3A6D91,0x101080C6,0x88C76086, + /*00000011*/0x574B5EEE,0xB77CED22,0xC94DF5E1,0x6D43FF50,0xCB60BE98,0xF0BFB64F,0x49D4F8FD,0xAF3B97F8,0xA379EE74,0x4C2485E7,0x69E4C932,0xEE95A593,0x1DBCFA26,0xA4850413,0x969D22F2,0x839CA256, + /*00000012*/0xB59F3290,0x88FBE094,0x2D88974B,0x3A67645C,0xACFBAFBB,0x454BB53F,0xD7AE679E,0xAB798EE2,0x1D2C9B6F,0x08739307,0x6BDAC1BD,0xC10F4F22,0x6872A1C3,0xD4472E4C,0xF5F4C495,0xB0C1F911, + /*00000013*/0xB74420D0,0x744E817F,0x3DA8D422,0xEC82908E,0x59B22AD4,0x47AD6BCD,0xEE06740E,0x750A9509,0x87A389DB,0x7B75671A,0xDD5733B5,0x075CAE5A,0xDA4438E3,0x51F01183,0xA89AB849,0x9AD18690, + /*00000014*/0xEA841748,0x17A7B080,0x88E7DCF7,0x4F87E8C1,0x15A5BD0A,0xD9E22864,0xFBBD1F23,0x17BD2E49,0x5200ACB8,0xD8F275D0,0x6959C6E1,0xF96AB6AF,0x39E572B2,0xB9477390,0x43857C1F,0x2242E9DF, + /*00000015*/0xC8E7D0DE,0xB7CF7075,0xA2233911,0xC653C02F,0x5E2BE322,0xF0D4DF3C,0x07B53661,0x191C0738,0x890928CA,0x8DCD2DD3,0xC6DED3B3,0xCA4B25CA,0xEB82ED6D,0x05B9DDE5,0x5D861E90,0xD1F68A91, + /*00000016*/0xD3083B97,0x0635083D,0x2FBF43EE,0xB5B3A978,0xB52E6F61,0xEC00B807,0x22A8F403,0x7AD12125,0xDCE344F6,0xCA71B84C,0xB6E5C5E2,0x0CE721AF,0x2F707DD7,0x47718D68,0x13ED11EC,0x13F1A774, + /*00000017*/0x0BD8F99D,0x1D200BD1,0x6481B24A,0xC37CFA5B,0x8FF0C307,0x27457D00,0xE671141C,0xC2E34B42,0xA530D99C,0xE585497A,0xF371C164,0x238E11D0,0xB447B0AF,0xA3F4CC26,0x47C3123B,0x281F00AE, + /*00000018*/0x923FA32E,0x675DF7E6,0x7B3F7DDE,0x015C7C25,0x38905D00,0xFEC2F176,0xF0DCE6BB,0x49CA8ABD,0x6349E996,0xF3C89F3C,0x20AF9BF2,0x931AD220,0x5D13F073,0x0B2007E0,0xB018CE9B,0x3369C22C, + /*00000019*/0xE3F9D3F8,0x89321A07,0x638B8037,0x0AF200E1,0xB8BD5E7A,0xB7F66AB3,0xB14D54A7,0xD09FA64D,0x171C8971,0xD7187AE3,0x682E78C5,0x904BAE0D,0xFE0446EA,0x1003BAA8,0xB8692845,0x458CDA7D, + /*00000020*/0x009A8553,0x3E163FBC,0xC402026E,0xBF5C660F,0x1E77CB6D,0x094CB47C,0x883A3A61,0xCE9E0FB4,0x80209237,0x1AF84020,0x6845EE93,0x5214B48D,0x8594A449,0x2288080A,0xAD30EB84,0xE5B2BAF2, + /*00000021*/0x85E964B2,0x2EC6CEBE,0x0535E74C,0x33F51008,0x647B6FE6,0x4BEAB7D3,0xBE5C248B,0x6835A44C,0xC016111F,0x7DF08041,0xF083264C,0x805DA47D,0x0294890B,0x8457F321,0xA51AF840,0xE34ACA5D, + /*00000022*/0xD2AC4B15,0xA9FD73BA,0x624C2EC6,0x4402015C,0xDB79F4FD,0x7F70DC1E,0x0C69697D,0x79124C91,0x986F1F3A,0x30C32E77,0x007FBCEF,0x11A80411,0x85C247CE,0x69C28890,0x1D884190,0x58A914F8, + /*00000023*/0x8AE2C6FC,0xA30373DA,0xF841A845,0xB6F3E996,0xBDD7783D,0x3125A5F5,0x911F5F54,0x79D7C1A7,0xE0161068,0xC8B3643E,0x2DB2C428,0x444725A4,0x214B879F,0x2005EEF3,0x26100604,0x4C44C8A2, + /*00000024*/0xD2F8B150,0x67B549D2,0xE2A12446,0x543E5552,0xCD99EF35,0xA5BF5D5F,0x958634B8,0x1EBA12CB,0x2EC7CFC2,0xE973BCC2,0x872E446B,0x0B6CA0C4,0x8A4A24A9,0xA4295C3C,0x9D07C3CA,0x8161770F, + /*00000025*/0x0C610631,0x56286131,0xC52DF8B1,0x1D3F6A93,0x8BD7BD48,0x97F752E9,0x75B23D57,0x159FDAF5,0x9CA29797,0x69EBBE5C,0x1875AF9D,0xE900C322,0x45D70879,0xDB65814A,0x4A512528,0x889C4D60, + /*00000026*/0x85110292,0x4210A548,0x72140414,0x13077A1D,0x18620019,0x78A2EC2A,0x766DCC17,0x0EADBB32,0xA5F5B5E3,0x62B1FD53,0x3B9E227B,0x8844C704,0x82E7FF30,0x165A4030,0xAEF2AD96,0x59AE4085, + /*00000027*/0x86BAAC43,0x6087B7A0,0x4C9007EF,0x110ADA11,0x3002F60C,0x418C60C6,0x4914431A,0x80621044,0xE3D04209,0x5F3016BB,0xCB4E79B5,0xE9E4EE85,0x7DD976D5,0x78D96DB6,0x235AF705,0x4511171C, + /*00000028*/0xB2C29658,0x2812942D,0xAFB71129,0xF9C49742,0xDE9E6FE9,0x6CBA3B67,0x4A6B1DEE,0x74892A64,0x60148C5D,0x0A00020A,0x3F063022,0xBC50C434,0xF4D1DBDE,0x9BE76F56,0x00525C11,0x72DBBE6D, + /*00000029*/0x75BBA7A6,0x5D595175,0x385B08CC,0x90F3C20E,0x856CA042,0x294A14B2,0xD5449294,0xD8C48435,0x0D0BD2F2,0xDEDA266F,0x78E5AF7C,0xB581ADE3,0xB2D972A2,0x97D32B72,0xC180A23F,0x06306440, + /*00000030*/0x1FBE0C88,0x1D824762,0x2F4D1DBD,0x1CBD2EA6,0x2D028E60,0xDDB0C743,0xCD9E4EF7,0x51AEB6F4,0x1F94EA13,0xB0AD96D8,0x52958046,0x1267D304,0xDF478286,0x7761B57A,0x700F624F,0x6AECC1D1, + /*00000031*/0xC3FA7F3A,0x95D5885B,0xB7139ECC,0x0C222C9D,0x88258331,0xB00BDA0C,0x3D1D88FC,0x1BBF4D1D,0xEE033786,0xEED446A8,0xB9CF277B,0x8B3BD6D9,0x4262EBCB,0x559156D8,0x97E25E88,0x11D4244E, + /*00000032*/0x3BFBFC3F,0x76F76F0D,0x84B07C8D,0xBE6CE829,0x0571AE78,0xF1A5B545,0xFA1DB88A,0x8C886308,0x961E3B41,0xFA6AF3E3,0xADB8F84A,0x4EF7CDB8,0xEB4ED59E,0x3AF1C51D,0x8EDB08CB,0x8C08E8D9, + /*00000033*/0x83E3F013,0xEEDE1AFB,0x54FB8E4B,0xB1C484EB,0x95C6C5C4,0xC13B5622,0x402DB8A8,0xF5911ABB,0xB97D2578,0x17D4F9E9,0xE063FB2F,0x96771CD7,0xB4381FC4,0x6CE766E0,0xAE732ACD,0x14D99566, + /*00000034*/0x78077CAF,0x103AF808,0x65BADABB,0x33DCAE42,0x54FDA6A7,0x79F32ACD,0x44F32AF5,0x3643ACE5,0x2BE021E2,0xF7B184C0,0x627F2B8B,0x15175478,0x6CA7B86F,0x6761FD52,0x2E7F67A0,0x3F380073, + /*00000035*/0x6378F9D6,0xAE96B4B1,0xABF55C9B,0xBC277684,0x1DDEE993,0x8AB99A60,0x280A6BF3,0x0160228C,0x802D0160,0x40D625FF,0x85D5BCBE,0xE0F1D9F9,0xCA01FF00,0x27E69763,0x0020B19B,0x49000000, + /*00000036*/0xAE444E45,0x00826042, +}; +const BitmapType COCOST_Bitmap_CloseNormal= +{ + 32,32, //imWidth,imHeight + 128, //imRowBytes + 0, //imAlign + 32 //imBits + ,BITMAP_FLAGS_COMPRESSED// imFlags + ,0// imReserve + ,0,NULL// imMemSize,imMemPtr + ,(UInt8 *)COCOST_Bitmap_CloseNormal_bmp_data// imDataP + ,NULL// imColorTableP + ,0x0 //imTransparencyColor +}; +const ResTBitmapStructType COCOST_TBitmapStruct_CloseNormal= +{ + (BitmapType *) &COCOST_Bitmap_CloseNormal,//m_pBmp +}; + +const UInt32 COCOST_Bitmap_CloseSelected_bmp_data[]= +{ + //Bmp Datas,位图数据(3187字节,原图:40x40,6400字节,压缩成49%): + 0x00000001, 0x00000C73, 0x00000000, 0x00000000, + // data length : 3187 + //|00000000 |00000001 |00000002 |00000003 |00000004 |00000005 |00000006 |00000007 |00000008 |00000009 |00000010 |00000011 |00000012 |00000013 |00000014 |00000015 + /*00000000*/0x474E5089,0x0A1A0A0D,0x0D000000,0x52444849,0x28000000,0x28000000,0x00000608,0xB8FE8C00,0x0C00006D,0x4144493A,0x9D855854,0x5C706B97,0xFFC779E5,0xBD9EFBEF,0x6E8C9648,0x38596496, + /*00000001*/0xEF85B1B6,0xAFA9AE31,0x0C625F04,0x0F949048,0x8E864D2D,0x27535299,0xC9DB42FD,0x2850E934,0x4B4E99B4,0x921D32D3,0x99729D02,0x9C14D3B6,0x35A71C8C,0x8368610E,0x18C4E0C1,0x95E2B659, + /*00000002*/0xAD2B4915,0x5776962E,0xBCB9DBDE,0xCE1FA797,0x25AED5D9,0xE667911B,0xF67B3D9D,0xFFFA7E5C,0x1F79E79F,0x96202C09,0x83CAF0F0,0xA0FE2BAD,0x57658996,0x00CC42BD,0x5DF72166,0xD542AB1F, + /*00000003*/0x7CB40FDB,0x20A751EE,0x7C5E4D29,0x0588F721,0xF6FD605C,0x1F4F75F2,0x1C9FC6FD,0xBCDF555E,0xFCE7BC6D,0x81E90495,0x2F570ACF,0xFFBF65AC,0xF37FDDF9,0xFE3FAFD5,0x0AA4B75B,0x0F8E2F6B, + /*00000004*/0x93205FBF,0xA9CFACFE,0x47580E08,0x257E6E57,0xC5483FDD,0xDFF4F538,0xD664EF4F,0xC704CFA1,0xF677DB45,0x4EC6783D,0xE5C990CE,0xE966CBC8,0xEE1FFBC5,0x6DD6646D,0x059C36BF,0x62BA3E16, + /*00000005*/0xBEA92BD3,0xE444442B,0xBBC8248E,0x8886453A,0xBFC9FBFE,0x5661EF4D,0x84E082E7,0xBBBBFB68,0x4D9D3FEE,0xF7BE524C,0xC3FD8D12,0xE67B2977,0x92A6152C,0x2FBEFCF4,0x0A7C34F7,0x0B16BCE4, + /*00000006*/0xC57C7AC0,0xFDBF97E6,0xFAE1F756,0x4770158E,0x86DB2012,0x290164CE,0x4F79D1D1,0x748BD5B4,0xEFFF4FC6,0xFF4C3885,0x20DE1E8D,0xBB93FB44,0x63E1FDEE,0x83B8BDAF,0xE6614F4F,0xB930DBE4, + /*00000007*/0x57CBEC3C,0x6C11A3C0,0x4B6752F8,0xEEAFCF63,0xF0D8F9F9,0xC93205DB,0x605A0105,0xDD6EC7E1,0xFD7FCFF0,0xD68F63E3,0x770D5BAF,0xB6C60478,0x5240A901,0x0066A542,0xAE9AC1C7,0x3766D183, + /*00000008*/0xE67239D4,0xF3233D67,0x45C2DE40,0x1FB6B7EB,0x4BF0F378,0xA45DB4FF,0xFDBCC892,0x0171C82E,0x90630063,0xA81DEB79,0x7FAC196B,0x86A6E1E4,0x67BDE1BE,0x1D27E3C7,0x029B9998,0xB23AC00A, + /*00000009*/0xCF4BE37C,0x47AFFF1E,0x06DDD71B,0x64047867,0x4129203B,0x1E79049E,0x3A741520,0x58DB630D,0xE881DF7D,0x40F43752,0x7BF7A3E2,0x59B130E3,0x3FF6ACE5,0xB1FF73BF,0x6E7F9E47,0x85266867, + /*00000010*/0x069DFFFC,0x19482EB9,0xB6305290,0x1EB9FC8D,0x823E67D8,0xC741A9A8,0x6E681F97,0xE2FF181E,0x731357C7,0x72012C94,0xEB723AC0,0xE99F9786,0xA6E1FEFE,0x86701D8D,0x0DB64046,0xF3802A52, + /*00000011*/0x9184A417,0x02992A0A,0xEE2B071C,0x62591BD9,0x7FC73A87,0x1C4F41F1,0xAC275FD4,0xBD6E6FB6,0x9E57D8FB,0x708EF6FB,0xFDFB032E,0x0BAE410F,0x25230528,0x81DC0C60,0x09A37821,0xF5E0C630, + /*00000012*/0xB458845E,0x1D0EAB08,0x9F1A5E6C,0xA9F3F83E,0xACBB49C4,0x6B6045BA,0x0DF6B1E4,0xC6F53D2F,0x369B87EB,0x3C3781AC,0x1F1C720A,0xE5CACA4E,0x0A909FF9,0xC984993A,0xFEDCF8DB,0x9B36D13D, + /*00000013*/0xF9713FDD,0x1BABEA4A,0x77EA7CEF,0x4F72799F,0x778590A4,0xD72017F6,0xDFED2903,0x264C34A7,0x2FD2FB0B,0x09815241,0xC7400601,0x11A2C1FA,0x777BBADC,0xF4F1D2D3,0x89C9F3BE,0x5264D89F, + /*00000014*/0x445AC000,0xEB577578,0xF99E27CA,0xAD7DBFFE,0x90EDD379,0xEB907189,0x920528C2,0x0CB20CAA,0x279BF8B6,0x340B9E41,0x6C6BC034,0x18C5F4C2,0x515ADB6A,0x4B981D25,0x049E307D,0x05480569, + /*00000015*/0x06401523,0xEE0C5F76,0xB2CC1C50,0x06347D66,0xBEDA0444,0x3B5B4E1D,0x1FA3F67E,0x76337EF7,0x53013F66,0xF2D350E2,0xFA391DAF,0x3DD64787,0x17955F74,0xB94395F7,0x1E5652AD,0xBE577F97, + /*00000016*/0x034A942A,0xAEA83333,0x9C9E0C5B,0x020E0D06,0xA39E0C9E,0xAD012900,0x7093A721,0x06057E06,0x0B363006,0x001818C8,0x5302323E,0xD6E68353,0xFD33E6F6,0xED49237D,0x0A46B59D,0xE77D2BD9, + /*00000017*/0xC6FD8C2E,0xC03D4CF4,0x559BD700,0x48CA502D,0x5F21CA59,0x65EFE2C9,0xA00BE6CA,0x4A1F09F1,0x8C33D2E9,0x30568054,0x383B84AE,0x700D280C,0x309DA73E,0x16A6B200,0x97235705,0xBDAD214C, + /*00000018*/0xC55A0045,0xC6C42C94,0x2D2EFBFA,0xDB3BA6BB,0xE6AB6E77,0x7C85034A,0x2919DE45,0x96FA4F01,0x57A4A7CD,0xE3FC5E06,0xD683AECA,0x20C746F0,0xCD82AF27,0x2F044707,0xEB548552,0x0CE93832, + /*00000019*/0xF7E3F1FE,0xD97AF78E,0xC2B20073,0xF48C7A00,0xD9FCE260,0xD4B34B0B,0xCD8EF4B5,0xD8056851,0x06F6FCF6,0x9B9FD7B0,0x30A954BB,0x7835CCF4,0x510023C3,0x3800B5A5,0x61088E08,0x641D516A, + /*00000020*/0x2FE780A6,0x4EFE3D9F,0x0004FA61,0xA94F4017,0xAE61C4CD,0xD7385D8C,0xAEA592D3,0xA36B0D96,0xC770294C,0xBCF56DF1,0x012BD600,0xA403CF1B,0x4AEAABE7,0xAF2AF490,0x5D739E2B,0x187183B8, + /*00000021*/0x1EA399C7,0xC7136007,0x1DA0B698,0x7B461785,0x9F9A7FBB,0x0D0011FE,0xF10003E0,0x871D468A,0xFBEC9FE9,0x0E6B42E4,0x6E6B4D9D,0xC0AD728B,0xB16E775D,0x79C4F594,0xB968A90B,0xE312F052, + /*00000022*/0x373333D0,0x3CC60380,0x7BE06806,0x6FDDFDD3,0xC00670FB,0x15FD0069,0xF21CBA8D,0x85E2EC6A,0xD6759B76,0xE5115CAD,0x2EB840DA,0xE0CAF48C,0x4E6B53AE,0xD2807AAE,0xD434A990,0x52A954E4, + /*00000023*/0xE0820B67,0x09718618,0x5EF8E270,0x1978E86A,0xB8457BDC,0x4A4B0179,0x67B2FC0E,0x35756BB9,0xE51D59AE,0x050AC064,0x1A9637BF,0x20D16CF5,0xC78A6738,0x7364C14A,0xFC26C6F0,0x8E1CB7BD, + /*00000024*/0x30B09E08,0x0530614D,0xD435377C,0x753F2A7D,0x6EE57AE2,0x4C84580A,0x5DEE5E0D,0xF543AD21,0x0B56D76B,0x850A05CF,0x794E161B,0x1B05346F,0xA024F8DE,0x10516554,0xD70B2C81,0x4AE11AEA, + /*00000025*/0x8C985EAD,0x3F2B789D,0xCE7E027D,0xA9F72855,0x04300080,0x1B1A9B13,0x7EBBDA9B,0xEAAA97D3,0x24C90316,0xF9B32A8C,0x8BF1C2BA,0x9D5E4242,0x9CCED902,0xA088C77E,0x8681ABAB,0x95C1F825, + /*00000026*/0x33FE4FDE,0xF0AFFE33,0xE51CE05B,0x29B7318A,0xC22DC595,0x656FBD6A,0x3755EFC7,0x1CD90036,0x7BF9E78C,0x2DC8116B,0xDDFCF77E,0x54E82A42,0x603B640A,0x463BFB82,0xAE001059,0xB1C59835, + /*00000027*/0xCAD979AB,0xA37456E5,0x2005BC05,0xCDC02F36,0xACB46C14,0xDF57A7F6,0xC3D0EC71,0xCA27B3BF,0x044B1809,0xC72BE739,0x4ACC0682,0xBB5CC14B,0x706C1406,0x0E73838B,0x631839C6,0x199B4560, + /*00000028*/0xCC0A5303,0x2D34D468,0x8B666E89,0x9B5F8D36,0x374A3D3C,0x05E77A1E,0xDB5617AC,0x72D9AE5F,0x0F43DF6C,0x18B2A8ED,0xE4047C58,0xFA523079,0x87CAD02F,0x1AD01A53,0x6C986B5C,0x706DB016, + /*00000029*/0x0339C021,0xF85C1CE3,0x95E72E7B,0x0BB72F7B,0x5DA83060,0x18D91B54,0x9D35DC5A,0x7430BA9D,0x8039C803,0xF6D596F5,0x6F4DAAD4,0xFEF7BDEC,0x00B0D19D,0x540F189F,0x002A6053,0x1AA4A633, + /*00000030*/0xCF941AD7,0x2E038E01,0x6738E57C,0x7A81C5BE,0x28AF82FE,0xE100C018,0x104460B8,0x1EDE8AC2,0xE54CEBAD,0xA443BD52,0x015D58E7,0xED5968D8,0xF4DCAECF,0xDEEEBBC3,0x0D1A23BF,0x83A72441, + /*00000031*/0xD6055849,0xC0A53018,0xD6991503,0xB800BE40,0x7C270FAE,0x1839CE38,0x803C60E3,0x82C8292B,0xA14D5F0F,0x5822083C,0x6B6BA2C4,0x2C85E69B,0xD109D601,0x4D8AECFA,0xB9DAEE6F,0xD4557B67, + /*00000032*/0x05972842,0x98282E79,0xE0519846,0x0369834A,0x2882BE46,0x07A4C014,0x2E087161,0x45641566,0xC64059D0,0x1A73AE18,0x06458044,0xF0610182,0xA6DAFAE8,0xAA5CE9CE,0x65748867,0xACB26EA3, + /*00000033*/0xE56AFF5B,0x77BB63E6,0x8919DAEE,0xB63B0858,0x8252B15F,0x8B525D29,0x064E0569,0x5F20495C,0x221A5700,0x1944C024,0xBDBEE71C,0x2C944025,0x96073046,0x4221B6D7,0x093B7E08,0xD6374783, + /*00000034*/0x9920792E,0x060EF64B,0xE175B24A,0xB47CDFEA,0x8793D575,0x575770BE,0xC8421C28,0x1176FC73,0x18DC80CC,0xA3702230,0xF4A4E57D,0x2E03252D,0x9C579F84,0x5D5F1981,0x02120E70,0xE2990204, + /*00000035*/0xC0DAD032,0x1A318218,0x528C135A,0x2B40DAD0,0x0604320D,0x638035C0,0x4EB46618,0x67B4657F,0x3EE8DE77,0xFEA6A3BE,0x97CBADDE,0x21C2B2EF,0xE4014E58,0x9E7ABE7A,0x1528C3E7,0xC7304A7C, + /*00000036*/0x1C1B1C01,0xE0596104,0x02584382,0xAEAB0402,0x1DEDD60E,0x42B696B0,0x04210670,0x21595144,0x2D9EEA82,0x5071D2A2,0xC220044C,0xB4233081,0xEBF54285,0x0187D522,0x30E18484,0xCB1D10ED, + /*00000037*/0x22AFD717,0x6B02C063,0xAFBA638B,0x1C73068C,0xA87D2930,0x0842C5E0,0xDBC06458,0x7C1FC0DA,0x5BADD110,0x003A3A61,0xBA9881C7,0x67ACD15A,0x43382F73,0x9F933E65,0x22009290,0xF6518C86, + /*00000038*/0x4FC4E9CB,0x6213326D,0x8BF17A52,0x773399B9,0x6340E6B8,0xD212ED4D,0xBE7A4C06,0x7980C672,0x301DB012,0x32ADC1A3,0x343940B8,0x0F070337,0x883FD0A2,0xF6799EE7,0xF9332DDC,0xDC2FE6DA, + /*00000039*/0x40EB8615,0xEDA552A4,0x0A22028E,0xF910C3AA,0xAA00737B,0x8311018C,0x627DDA4B,0x90FAF622,0x30063F74,0x63200029,0x2674EA74,0x66BD7275,0xAAAB9BFB,0x0869485B,0xF1C70125,0x07C18DF3, + /*00000040*/0x7166DA2A,0x43400C58,0x3BB6E43D,0xC41E5DE1,0xD0BE2F13,0xA3D32FFD,0xF977BCAF,0x1776F0D2,0xD8EFEB1B,0xC2EB8512,0xE2FC65CA,0xC22C8728,0x1952B005,0xD0780318,0x62251FDE,0xE6E27EAF, + /*00000041*/0x0A3005DF,0x336A5620,0x0FE9D239,0xDB53A933,0x20D3DD60,0x285D26AC,0xE7ED6840,0x611B5949,0x0C62C382,0xEF0B5B54,0x8350F5F6,0xFFE3F823,0x07FBAD78,0x0013E9D9,0xBFF48A58,0x7CB81F9F, + /*00000042*/0x756D6EFA,0x8EAF5685,0x9C21290A,0xCFA02CC2,0x081117E6,0xCF182A52,0x7EED25C0,0x5AFFD13D,0x0027DC19,0x3A8D1572,0x267D2647,0x2D93F337,0x09BFB422,0x08013356,0x08628247,0x60CE2D00, + /*00000043*/0x96705522,0x4C49832E,0x1C4F4FE0,0x532C7E3B,0x4F0D3231,0x891FE992,0x88DC5C0F,0xB9B46770,0xF4A5C225,0xA5BE311D,0x82220444,0x47682AE7,0x1DE521C2,0x7ABFF44D,0xCB80A9DE,0x62EA3456, + /*00000044*/0x9E4E8D64,0x67FE67CE,0x81CD556B,0x0C803C25,0xE0A28287,0xBD82C230,0x4A9816A8,0x9EEF1BE3,0x33337EEA,0x80074C77,0x78B13201,0xF3E7B862,0x5C2BAABC,0x5AE5135D,0x6300C422,0x6780080C, + /*00000045*/0x1779907B,0xE3EED1AE,0x0257FE89,0xDC3944B8,0x900080BC,0x51F33327,0xB6CEF321,0x362FDAEA,0x4444D130,0x30C34708,0x870C1404,0x67F0E4C8,0x7EE83EE7,0xCE6E12A3,0xA6443A3E,0xE899313F, + /*00000046*/0xE9AE12DD,0xD0A234B4,0x6025960A,0x9CC85C17,0xF728DB0D,0xB5EC44F1,0x729EB832,0x02021BB8,0xF257C640,0xCD6896E4,0x5A2626BE,0x6D70D694,0xF87B6109,0xE385FF56,0x3BCDCA65,0x90631709, + /*00000047*/0x9A912C4C,0x5912DDEC,0x647219DC,0x550D2954,0xE568E070,0x5EC4491D,0x5B1E78FD,0x00080417,0x1FD3A339,0xB6A73214,0x5DECD554,0x502D42C6,0x36317F1A,0x9F86FDD0,0x0FFEF373,0xD1A42F31, + /*00000048*/0x74CCD1B1,0xFADA96CF,0xAA0CEB7B,0x8E154AD3,0xFD795D8E,0x5C00E0D3,0x20DEF237,0xAE358CC2,0x3C3D548D,0xB8E2F5A3,0x78012774,0x085C3E00,0x5AB4795C,0x43CBF5E1,0x3C064791,0x6AD49F3B, + /*00000049*/0xCDC8C000,0x580C16E0,0xB4014B16,0xD6089800,0x801613AF,0xE3BBC1D5,0xBB37F200,0x3501FFF8,0x37399B81,0x005FDF78,0x49000000,0xAE444E45,0x00826042, +}; +const BitmapType COCOST_Bitmap_CloseSelected= +{ + 40,40, //imWidth,imHeight + 160, //imRowBytes + 0, //imAlign + 32 //imBits + ,BITMAP_FLAGS_COMPRESSED// imFlags + ,0// imReserve + ,0,NULL// imMemSize,imMemPtr + ,(UInt8 *)COCOST_Bitmap_CloseSelected_bmp_data// imDataP + ,NULL// imColorTableP + ,0x0 //imTransparencyColor +}; +const ResTBitmapStructType COCOST_TBitmapStruct_CloseSelected= +{ + (BitmapType *) &COCOST_Bitmap_CloseSelected,//m_pBmp +}; + const ResourceLangRegisterEntry COCOST_CHS_Resource[] = { {kProjectRscType,0,(void*)&COCOST_project,sizeof(COCOST_project)} ,{kWindowRscType,COCOST_ID_Form1002,(void*)&COCOST_Form1002,sizeof(COCOST_Form1002)} + ,{kTBitmapRscType,COCOST_ID_BITMAP_CloseNormal,(void*)&COCOST_TBitmapStruct_CloseNormal,sizeof(COCOST_TBitmapStruct_CloseNormal)} + ,{kTBitmapRscType,COCOST_ID_BITMAP_CloseSelected,(void*)&COCOST_TBitmapStruct_CloseSelected,sizeof(COCOST_TBitmapStruct_CloseSelected)} }; const ResourceLangRegisterEntry2 COCOST_CHS_ResourceEntry = @@ -227,6 +366,8 @@ const ResourceLangRegisterEntry COCOST_ENU_Resource[] = { {kProjectRscType,0,(void*)&COCOST_ENU_project,sizeof(COCOST_ENU_project)} ,{kWindowRscType,COCOST_ID_Form1002,(void*)&COCOST_ENU_Form1002,sizeof(COCOST_ENU_Form1002)} + ,{kTBitmapRscType,COCOST_ID_BITMAP_CloseNormal,(void*)&COCOST_TBitmapStruct_CloseNormal,sizeof(COCOST_TBitmapStruct_CloseNormal)} + ,{kTBitmapRscType,COCOST_ID_BITMAP_CloseSelected,(void*)&COCOST_TBitmapStruct_CloseSelected,sizeof(COCOST_TBitmapStruct_CloseSelected)} }; const ResourceLangRegisterEntry2 COCOST_ENU_ResourceEntry = diff --git a/template/Res/cocostemplate_res_def.h b/template/Res/cocostemplate_res_def.h index e637f69b3a..499372a28e 100644 --- a/template/Res/cocostemplate_res_def.h +++ b/template/Res/cocostemplate_res_def.h @@ -18,4 +18,6 @@ #define COCOST_ID_Form1002 1073742826 /*"Main"*/ +#define COCOST_ID_BITMAP_CloseNormal 1073742827 +#define COCOST_ID_BITMAP_CloseSelected 1073742828 #endif diff --git a/template/Res/cocostemplate_res_h.h b/template/Res/cocostemplate_res_h.h index a8134d767a..17ec20281f 100644 --- a/template/Res/cocostemplate_res_h.h +++ b/template/Res/cocostemplate_res_h.h @@ -19,5 +19,9 @@ #include "ResTypes.h" #include "cocostemplate_res_def.h" +//----------------资源声明(外部可直接使用)------------- +extern const BitmapType COCOST_Bitmap_CloseNormal; +extern const BitmapType COCOST_Bitmap_CloseSelected; + #endif diff --git a/template/Resource.h b/template/Resource.h new file mode 100644 index 0000000000..73a88a9de2 --- /dev/null +++ b/template/Resource.h @@ -0,0 +1,18 @@ +#ifndef _RESOURCE_H_ +#define _RESOURCE_H_ + +#include "cocostemplate_res_def.h" + +const std::string ResourceNames[] = +{ + "CloseNormal", + "CloseSelected", +}; + +const Int32 nResIDs[] = +{ + COCOST_ID_BITMAP_CloseNormal, + COCOST_ID_BITMAP_CloseSelected, +}; + +#endif diff --git a/template/cocosTemplate.vcproj b/template/cocosTemplate.vcproj index f2ea9b13ef..c4a8576434 100644 --- a/template/cocosTemplate.vcproj +++ b/template/cocosTemplate.vcproj @@ -63,7 +63,7 @@ /> + + + + + + diff --git a/template/main.cpp b/template/main.cpp index 574dea1b16..821355afcb 100644 --- a/template/main.cpp +++ b/template/main.cpp @@ -12,7 +12,7 @@ const ResourceRegisterEntry ResRegList_cocosTemplate[] = TG_RESOURCE_DEFINE }; -const AppResourceEntry cocosTemplateResourceEntry = +extern const AppResourceEntry cocosTemplateResourceEntry = { (ResourceRegisterEntry*)ResRegList_cocosTemplate, // res list in this app sizeof(ResRegList_cocosTemplate) / sizeof(ResourceRegisterEntry), //number of item in res @@ -23,7 +23,7 @@ const AppResourceEntry cocosTemplateResourceEntry = Int32 TG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam) { AppDelegate app; - // app.WM_SetResourceEntry(&cocosTemplateResourceEntry); + app.WM_SetResourceEntry(&cocosTemplateResourceEntry); app.Run(); return 1;