#include "stdafx.h" #include "SkinResource.h" cSkinProgressBarResource::cSkinProgressBarResource() { mColor = RGB( 255, 255, 255 ); mBackColor = RGB( 64, 64, 64 ); } cSkinProgressBarResource::~cSkinProgressBarResource() { } bool cSkinProgressBarResource::Load( cParser& parser ) { if( parser.ExpectTokenString( "{" ) == false ) { return false; } cString keyword; while( true ) { if( parser.ParseString( &keyword ) == false ) { return false; } if( keyword == "image" ) { /// À̹ÌÁö ·Îµù cString fileName; parser.ParseString( &fileName ); if( LoadImage( &mBitmap, &mWidth, &mHeight, fileName ) == false ) { return false; } } else if( keyword == "pos" ) { /// À§Ä¡ ÆÄ½Ì int x = parser.ParseInt(); int y = parser.ParseInt(); mRect.left = x; mRect.top = y; mRect.right = x + mWidth; mRect.bottom = y + mHeight; } else if( keyword == "size" ) { /// Å©±â ÆÄ½Ì mWidth = parser.ParseInt(); mHeight = parser.ParseInt(); mRect.right = mRect.left + mWidth; mRect.bottom = mRect.top + mHeight; } else if( keyword == "color" ) { /// »ö»ó ÆÄ½Ì int r = parser.ParseInt(); int g = parser.ParseInt(); int b = parser.ParseInt(); mColor = RGB( r, g, b ); } else if( keyword == "backcolor" ) { /// ¹è°æ »ö»ó ÆÄ½Ì int r = parser.ParseInt(); int g = parser.ParseInt(); int b = parser.ParseInt(); mBackColor = RGB( r, g, b ); } else if( keyword == "}" ) { /// ºí·Ï Å»Ãâ ^^ break; } else { return false; } } return true; }