mirror of https://github.com/axmolengine/axmol.git
Fix typos in local variables (#16712)
This commit is contained in:
parent
a5fdc07fca
commit
5b8919829c
|
@ -1017,11 +1017,11 @@ bool Bundle3D::loadMaterialsJson(MaterialDatas& materialdatas)
|
||||||
materialData.id = material_val[ID].GetString();
|
materialData.id = material_val[ID].GetString();
|
||||||
if (material_val.HasMember(TEXTURES))
|
if (material_val.HasMember(TEXTURES))
|
||||||
{
|
{
|
||||||
const rapidjson::Value& testure_array = material_val[TEXTURES];
|
const rapidjson::Value& texture_array = material_val[TEXTURES];
|
||||||
for (rapidjson::SizeType j = 0; j < testure_array.Size(); j++)
|
for (rapidjson::SizeType j = 0; j < texture_array.Size(); j++)
|
||||||
{
|
{
|
||||||
NTextureData textureData;
|
NTextureData textureData;
|
||||||
const rapidjson::Value& texture_val = testure_array[j];
|
const rapidjson::Value& texture_val = texture_array[j];
|
||||||
std::string filename = texture_val[FILENAME].GetString();
|
std::string filename = texture_val[FILENAME].GetString();
|
||||||
textureData.filename = filename.empty() ? filename : _modelPath + filename;
|
textureData.filename = filename.empty() ? filename : _modelPath + filename;
|
||||||
textureData.type = parseGLTextureType(texture_val["type"].GetString());
|
textureData.type = parseGLTextureType(texture_val["type"].GetString());
|
||||||
|
|
|
@ -364,8 +364,8 @@ float Terrain::getHeight(float x, float z, Vec3 * normal) const
|
||||||
normal->normalize();
|
normal->normalize();
|
||||||
//(*normal) = (1-u)*(1-v)*getNormal(i,j)+ (1-u)*v*getNormal(i,j+1) + u*(1-v)*getNormal(i+1,j)+ u*v*getNormal(i+1,j+1);
|
//(*normal) = (1-u)*(1-v)*getNormal(i,j)+ (1-u)*v*getNormal(i,j+1) + u*(1-v)*getNormal(i+1,j)+ u*v*getNormal(i+1,j+1);
|
||||||
}
|
}
|
||||||
float reuslt = (1-u)*(1-v)*getImageHeight(i,j)*getScaleY() + (1-u)*v*getImageHeight(i,j+1)*getScaleY() + u*(1-v)*getImageHeight(i+1,j)*getScaleY() + u*v*getImageHeight(i+1,j+1)*getScaleY();
|
float result = (1-u)*(1-v)*getImageHeight(i,j)*getScaleY() + (1-u)*v*getImageHeight(i,j+1)*getScaleY() + u*(1-v)*getImageHeight(i+1,j)*getScaleY() + u*v*getImageHeight(i+1,j+1)*getScaleY();
|
||||||
return reuslt;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,8 +242,8 @@ void Director::setDefaultValues(void)
|
||||||
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);
|
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);
|
||||||
|
|
||||||
// PVR v2 has alpha premultiplied ?
|
// PVR v2 has alpha premultiplied ?
|
||||||
bool pvr_alpha_premultipled = conf->getValue("cocos2d.x.texture.pvrv2_has_alpha_premultiplied", Value(false)).asBool();
|
bool pvr_alpha_premultiplied = conf->getValue("cocos2d.x.texture.pvrv2_has_alpha_premultiplied", Value(false)).asBool();
|
||||||
Image::setPVRImagesHavePremultipliedAlpha(pvr_alpha_premultipled);
|
Image::setPVRImagesHavePremultipliedAlpha(pvr_alpha_premultiplied);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Director::setGLDefaultValues()
|
void Director::setGLDefaultValues()
|
||||||
|
|
|
@ -423,8 +423,8 @@ namespace cocos2d { namespace network {
|
||||||
if (statusCode >= 400)
|
if (statusCode >= 400)
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> buf; // just a placeholder
|
std::vector<unsigned char> buf; // just a placeholder
|
||||||
const char *orignalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding:NSUTF8StringEncoding];
|
const char *originalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding:NSUTF8StringEncoding];
|
||||||
std::string errorMessage = cocos2d::StringUtils::format("Downloader: Failed to download %s with status code (%d)", orignalURL, (int)statusCode);
|
std::string errorMessage = cocos2d::StringUtils::format("Downloader: Failed to download %s with status code (%d)", originalURL, (int)statusCode);
|
||||||
|
|
||||||
_outer->onTaskFinish(*[wrapper get],
|
_outer->onTaskFinish(*[wrapper get],
|
||||||
cocos2d::network::DownloadTask::ERROR_IMPL_INTERNAL,
|
cocos2d::network::DownloadTask::ERROR_IMPL_INTERNAL,
|
||||||
|
|
|
@ -2590,7 +2590,7 @@ cc.Texture2D.prototype.setTexParameters = function (texParams, magFilter, wrapS,
|
||||||
this._setTexParameters(minFilter, magFilter, wrapS, wrapT);
|
this._setTexParameters(minFilter, magFilter, wrapS, wrapT);
|
||||||
};
|
};
|
||||||
|
|
||||||
cc.Texture2D.prototype.handleLoadedTexture = function (premultipled) {};
|
cc.Texture2D.prototype.handleLoadedTexture = function (premultiplied) {};
|
||||||
|
|
||||||
//
|
//
|
||||||
// MenuItem setCallback support target
|
// MenuItem setCallback support target
|
||||||
|
|
|
@ -49,7 +49,7 @@ local function dump_value_(v)
|
||||||
return tostring(v)
|
return tostring(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
function dump(value, desciption, nesting)
|
function dump(value, description, nesting)
|
||||||
if type(nesting) ~= "number" then nesting = 3 end
|
if type(nesting) ~= "number" then nesting = 3 end
|
||||||
|
|
||||||
local lookupTable = {}
|
local lookupTable = {}
|
||||||
|
@ -58,22 +58,22 @@ function dump(value, desciption, nesting)
|
||||||
local traceback = string.split(debug.traceback("", 2), "\n")
|
local traceback = string.split(debug.traceback("", 2), "\n")
|
||||||
print("dump from: " .. string.trim(traceback[3]))
|
print("dump from: " .. string.trim(traceback[3]))
|
||||||
|
|
||||||
local function dump_(value, desciption, indent, nest, keylen)
|
local function dump_(value, description, indent, nest, keylen)
|
||||||
desciption = desciption or "<var>"
|
description = description or "<var>"
|
||||||
local spc = ""
|
local spc = ""
|
||||||
if type(keylen) == "number" then
|
if type(keylen) == "number" then
|
||||||
spc = string.rep(" ", keylen - string.len(dump_value_(desciption)))
|
spc = string.rep(" ", keylen - string.len(dump_value_(description)))
|
||||||
end
|
end
|
||||||
if type(value) ~= "table" then
|
if type(value) ~= "table" then
|
||||||
result[#result +1 ] = string.format("%s%s%s = %s", indent, dump_value_(desciption), spc, dump_value_(value))
|
result[#result +1 ] = string.format("%s%s%s = %s", indent, dump_value_(description), spc, dump_value_(value))
|
||||||
elseif lookupTable[tostring(value)] then
|
elseif lookupTable[tostring(value)] then
|
||||||
result[#result +1 ] = string.format("%s%s%s = *REF*", indent, dump_value_(desciption), spc)
|
result[#result +1 ] = string.format("%s%s%s = *REF*", indent, dump_value_(description), spc)
|
||||||
else
|
else
|
||||||
lookupTable[tostring(value)] = true
|
lookupTable[tostring(value)] = true
|
||||||
if nest > nesting then
|
if nest > nesting then
|
||||||
result[#result +1 ] = string.format("%s%s = *MAX NESTING*", indent, dump_value_(desciption))
|
result[#result +1 ] = string.format("%s%s = *MAX NESTING*", indent, dump_value_(description))
|
||||||
else
|
else
|
||||||
result[#result +1 ] = string.format("%s%s = {", indent, dump_value_(desciption))
|
result[#result +1 ] = string.format("%s%s = {", indent, dump_value_(description))
|
||||||
local indent2 = indent.." "
|
local indent2 = indent.." "
|
||||||
local keys = {}
|
local keys = {}
|
||||||
local keylen = 0
|
local keylen = 0
|
||||||
|
@ -99,7 +99,7 @@ function dump(value, desciption, nesting)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
dump_(value, desciption, "- ", 1)
|
dump_(value, description, "- ", 1)
|
||||||
|
|
||||||
for i, line in ipairs(result) do
|
for i, line in ipairs(result) do
|
||||||
print(line)
|
print(line)
|
||||||
|
|
Loading…
Reference in New Issue