mirror of https://github.com/axmolengine/axmol.git
commit
a0b19db670
|
@ -212,7 +212,7 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture
|
|||
|
||||
void SpriteFrameCache::addSpriteFramesWithFileContent(const std::string& plist_content, Texture2D *texture)
|
||||
{
|
||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.c_str(), plist_content.size());
|
||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.c_str(), static_cast<int>(plist_content.size()));
|
||||
addSpriteFramesWithDictionary(dict, texture);
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const std::string& plist)
|
|||
|
||||
void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plist_content)
|
||||
{
|
||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.data(), plist_content.size());
|
||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.data(), static_cast<int>(plist_content.size()));
|
||||
if (dict.empty())
|
||||
{
|
||||
CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFileContent: create dict by fail.");
|
||||
|
|
|
@ -159,8 +159,8 @@ void ActionManagerEx::releaseActions()
|
|||
for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++)
|
||||
{
|
||||
cocos2d::Vector<ActionObject*> objList = iter->second;
|
||||
int listCount = objList.size();
|
||||
for (int i = 0; i < listCount; i++) {
|
||||
ssize_t listCount = objList.size();
|
||||
for (ssize_t i = 0; i < listCount; i++) {
|
||||
ActionObject* action = objList.at(i);
|
||||
if (action != nullptr) {
|
||||
action->stop();
|
||||
|
|
|
@ -781,7 +781,7 @@ void WidgetPropertiesReader0250::setPropsForCheckBoxFromJsonDictionary(Widget*wi
|
|||
{
|
||||
checkBox->loadTextures(backGroundFileName_tp, backGroundSelectedFileName_tp, frontCrossFileName_tp,backGroundDisabledFileName_tp,frontCrossDisabledFileName_tp);
|
||||
}
|
||||
checkBox->setSelectedState(DICTOOL->getBooleanValue_json(options, "selectedState"));
|
||||
checkBox->setSelected(DICTOOL->getBooleanValue_json(options, "selectedState"));
|
||||
setColorPropsForWidgetFromJsonDictionary(widget,options);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,8 @@ void Primitive::draw()
|
|||
{
|
||||
GLenum type = (_indices->getType() == IndexBuffer::IndexType::INDEX_TYPE_SHORT_16) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indices->getVBO());
|
||||
glDrawElements((GLenum)_type, _count, type, (GLvoid*)(_start * _indices->getSizePerIndex()));
|
||||
size_t offet = _start * _indices->getSizePerIndex();
|
||||
glDrawElements((GLenum)_type, _count, type, (GLvoid*)offet);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -124,8 +124,9 @@ void VertexData::use()
|
|||
{
|
||||
//glEnableVertexAttribArray((GLint)element.second._stream._semantic);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, element.second._buffer->getVBO());
|
||||
size_t offet = element.second._stream._offset;
|
||||
glVertexAttribPointer(GLint(element.second._stream._semantic),element.second._stream._size,
|
||||
element.second._stream._type,element.second._stream._normalize, element.second._buffer->getSizePerVertex(), (GLvoid*)element.second._stream._offset);
|
||||
element.second._stream._type,element.second._stream._normalize, element.second._buffer->getSizePerVertex(), (GLvoid*)offet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ bool CheckBox::init(const std::string& backGround,
|
|||
break;
|
||||
}
|
||||
|
||||
setSelectedState(false);
|
||||
setSelected(false);
|
||||
loadTextures(backGround, backGroundSeleted, cross, backGroundDisabled, frontCrossDisabled,texType);
|
||||
} while (0);
|
||||
return ret;
|
||||
|
@ -128,7 +128,7 @@ bool CheckBox::init()
|
|||
{
|
||||
if (Widget::init())
|
||||
{
|
||||
setSelectedState(false);
|
||||
setSelected(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -300,12 +300,12 @@ void CheckBox::releaseUpEvent()
|
|||
Widget::releaseUpEvent();
|
||||
|
||||
if (_isSelected){
|
||||
setSelectedState(false);
|
||||
setSelected(false);
|
||||
unSelectedEvent();
|
||||
}
|
||||
else
|
||||
{
|
||||
setSelectedState(true);
|
||||
setSelected(true);
|
||||
selectedEvent();
|
||||
}
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ void CheckBox::copySpecialProperties(Widget *widget)
|
|||
loadTextureFrontCross(checkBox->_frontCrossFileName, checkBox->_frontCrossTexType);
|
||||
loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName, checkBox->_backGroundDisabledTexType);
|
||||
loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName, checkBox->_frontCrossDisabledTexType);
|
||||
setSelectedState(checkBox->_isSelected);
|
||||
setSelected(checkBox->_isSelected);
|
||||
_checkBoxEventListener = checkBox->_checkBoxEventListener;
|
||||
_checkBoxEventSelector = checkBox->_checkBoxEventSelector;
|
||||
_checkBoxEventCallback = checkBox->_checkBoxEventCallback;
|
||||
|
|
|
@ -125,7 +125,7 @@ void DrawLine3D::onDraw(const Mat4 &transform, uint32_t flags)
|
|||
|
||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B), &(_buffer[0].colors));
|
||||
glDrawArrays(GL_LINES, 0, _buffer.size());
|
||||
glDrawArrays(GL_LINES, 0, static_cast<int>(_buffer.size()));
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue