This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CCDrawNode::drawRect(const CCRect &rect, float radius,const ccColor3B &color){ | |
ccColor4F color4 = ccc4FFromccc3B(color); | |
CCPoint pA = rect.origin; | |
CCPoint pB = ccp(rect.origin.x+rect.size.width,rect.origin.y); | |
CCPoint pC = ccp(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height);; | |
CCPoint pD = ccp(rect.origin.x,rect.origin.y+rect.size.height); | |
drawSegment(pA,pB,radius,color4); | |
drawSegment(pD,pC,radius,color4); | |
drawSegment(pA,pD,radius,color4); | |
drawSegment(pB,pC,radius,color4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string="[email protected];[email protected];[email protected]" | |
str1=${string%%;*} | |
str3=${string##*;} | |
temp=${string#$str1;} | |
str2=${temp#;$str3} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef int32_t LONG; | |
const unsigned char* pData[4]; | |
int pReadIndex = 0; | |
//unsafe | |
LONG *p_long = reinterpret_cast< LONG (&)[4] >( pData[pReadIndex] ); | |
//safe | |
LONG aLong = reinterpret_cast<LONG>(pData[pReadIndex++]) | | |
reinterpret_cast<LONG>(pData[pReadIndex++]) << 8 | | |
reinterpret_cast<LONG>(pData[pReadIndex++]) << 16 | |