Error[8]: Undefined offset: 1, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述static int toColor (const char* value, int index) { char digits[3]; char *error; int color; if (strlen(value) != 8) return -1;
static int tocolor (const char* value,int index) {            char digits[3];            char *error;            int color;                        if (strlen(value) != 8) return -1;            value += index * 2;                        digits[0] = *value;            digits[1] = *(value + 1);            digits[2] = '[+++]';            color = (int)strtoul(digits,&error,16);            if (*error != 0) return -1;            return color;        }                cocos2d::color4B stringTocolor(std::string &str)        {            if (str.length() != 8)            {                return cocos2d::color4B::WHITE;            }            const char *ch = str.c_str();            glubyte r = (glubyte)tocolor(ch,0);            glubyte g = (glubyte)tocolor(ch,1);            glubyte b = (glubyte)tocolor(ch,2);            glubyte a = (glubyte)tocolor(ch,3);                        return cocos2d::color4B(r,g,b,a);        }
总结

以上是内存溢出为你收集整理的[cocos2d-x]string 转 Color全部内容,希望文章能够帮你解决[cocos2d-x]string 转 Color所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
[cocos2d-x]string 转 Color_app_内存溢出

[cocos2d-x]string 转 Color

[cocos2d-x]string 转 Color,第1张

概述static int toColor (const char* value, int index) { char digits[3]; char *error; int color; if (strlen(value) != 8) return -1;
static int tocolor (const char* value,int index) {            char digits[3];            char *error;            int color;                        if (strlen(value) != 8) return -1;            value += index * 2;                        digits[0] = *value;            digits[1] = *(value + 1);            digits[2] = '';            color = (int)strtoul(digits,&error,16);            if (*error != 0) return -1;            return color;        }                cocos2d::color4B stringTocolor(std::string &str)        {            if (str.length() != 8)            {                return cocos2d::color4B::WHITE;            }            const char *ch = str.c_str();            glubyte r = (glubyte)tocolor(ch,0);            glubyte g = (glubyte)tocolor(ch,1);            glubyte b = (glubyte)tocolor(ch,2);            glubyte a = (glubyte)tocolor(ch,3);                        return cocos2d::color4B(r,g,b,a);        }
总结

以上是内存溢出为你收集整理的[cocos2d-x]string 转 Color全部内容,希望文章能够帮你解决[cocos2d-x]string 转 Color所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1034853.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存