Permalink
Browse files

integration of multi touch bug fixes

GitHub #17: Added invariant culture to the parsing of int and float
values requested by Evgeniy Rojkov.
Pull 12: Added fix for multitouch problems from moswald.
Added a setup project to install the framework as a binary with source.
  • Loading branch information...
totallyevil committed Aug 5, 2012
1 parent 06c2208 commit e0b395dc40c513eb69f8beece7b2f147a12898b6
View
@@ -23,6 +23,9 @@ cocos2d-x for xna 0.1.2 Aug.03 2012
CCApplication: Added support for non-480x800 display layouts.
CCTransitionCrossFade: Removed init of the fade layer with a background color.
CCDirector: Added a call to game.exit() when the director is ended when the scene stack is zero.
+ GitHub #17: Added invariant culture to the parsing of int and float values requested by Evgeniy Rojkov.
+ Pull 12: Added fix for multitouch problems from moswald.
+ Added a setup project to install the framework as a binary with source.
cocos2d-x for xna 0.1.1 Apr.20 2012
View
@@ -64,10 +64,10 @@ public static CCRect CCRectFromString(string pszContent)
break;
}
- float x = float.Parse(pointInfo[0]);
- float y = float.Parse(pointInfo[1]);
- float width = float.Parse(sizeInfo[0]);
- float height = float.Parse(sizeInfo[1]);
+ float x = ccUtils.ccParseFloat(pointInfo[0]);
+ float y = ccUtils.ccParseFloat(pointInfo[1]);
+ float width = ccUtils.ccParseFloat(sizeInfo[0]);
+ float height = ccUtils.ccParseFloat(sizeInfo[1]);
result = new CCRect(x, y, width, height);
} while (false);
@@ -84,8 +84,8 @@ public static CCPoint CCPointFromString(string pszContent)
List<string> strs = new List<string>();
if (!splitWithForm(pszContent, strs)) break;
- float x = float.Parse(strs[0]);
- float y = float.Parse(strs[1]);
+ float x = ccUtils.ccParseFloat(strs[0]);
+ float y = ccUtils.ccParseFloat(strs[1]);
ret = new CCPoint(x, y);
} while (false);
@@ -102,8 +102,8 @@ public static CCSize CCSizeFromString(string pszContent)
List<string> strs = new List<string>();
if (!splitWithForm(pszContent, strs)) break;
- float width = float.Parse(strs[0]);
- float height = float.Parse(strs[1]);
+ float width = ccUtils.ccParseFloat(strs[0]);
+ float height = ccUtils.ccParseFloat(strs[1]);
ret = new CCSize(width, height);
} while (false);
@@ -199,50 +199,50 @@ private void parseCharacterDefinition(string line, ccBMFontDef characterDefiniti
int index = line.IndexOf("id=");
int index2 = line.IndexOf(' ', index);
string value = line.Substring(index, index2 - index);
- characterDefinition.charID = int.Parse(value.Replace("id=", ""));
+ characterDefinition.charID = ccUtils.ccParseInt(value.Replace("id=", ""));
//CCAssert(characterDefinition->charID < kCCBMFontMaxChars, "BitmpaFontAtlas: CharID bigger than supported");
// Character x
index = line.IndexOf("x=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.rect.origin.x = float.Parse(value.Replace("x=", ""));
+ characterDefinition.rect.origin.x = ccUtils.ccParseFloat(value.Replace("x=", ""));
// Character y
index = line.IndexOf("y=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.rect.origin.y = float.Parse(value.Replace("y=", ""));
+ characterDefinition.rect.origin.y = ccUtils.ccParseFloat(value.Replace("y=", ""));
// Character width
index = line.IndexOf("width=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.rect.size.width = float.Parse(value.Replace("width=", ""));
+ characterDefinition.rect.size.width = ccUtils.ccParseFloat(value.Replace("width=", ""));
// Character height
index = line.IndexOf("height=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.rect.size.height = float.Parse(value.Replace("height=", ""));
+ characterDefinition.rect.size.height = ccUtils.ccParseFloat(value.Replace("height=", ""));
// Character xoffset
index = line.IndexOf("xoffset=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.xOffset = int.Parse(value.Replace("xoffset=", ""));
+ characterDefinition.xOffset = ccUtils.ccParseInt(value.Replace("xoffset=", ""));
// Character yoffset
index = line.IndexOf("yoffset=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.yOffset = int.Parse(value.Replace("yoffset=", ""));
+ characterDefinition.yOffset = ccUtils.ccParseInt(value.Replace("yoffset=", ""));
// Character xadvance
index = line.IndexOf("xadvance=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- characterDefinition.xAdvance = int.Parse(value.Replace("xadvance=", ""));
+ characterDefinition.xAdvance = ccUtils.ccParseInt(value.Replace("xadvance=", ""));
}
// info face
@@ -261,10 +261,10 @@ private void parseInfoArguments(string line)
value = value.Replace("padding=", "");
string[] temp = value.Split(',');
- m_tPadding.top = int.Parse(temp[0]);
- m_tPadding.right = int.Parse(temp[1]);
- m_tPadding.bottom = int.Parse(temp[2]);
- m_tPadding.left = int.Parse(temp[3]);
+ m_tPadding.top = ccUtils.ccParseInt(temp[0]);
+ m_tPadding.right = ccUtils.ccParseInt(temp[1]);
+ m_tPadding.bottom = ccUtils.ccParseInt(temp[2]);
+ m_tPadding.left = ccUtils.ccParseInt(temp[3]);
//CCLOG("cocos2d: padding: %d,%d,%d,%d", m_tPadding.left, m_tPadding.top, m_tPadding.right, m_tPadding.bottom);
}
@@ -281,7 +281,7 @@ private void parseCommonArguments(string line)
int index = line.IndexOf("lineHeight=");
int index2 = line.IndexOf(' ', index);
string value = line.Substring(index, index2 - index);
- m_uCommonHeight = int.Parse(value.Replace("lineHeight=", ""));
+ m_uCommonHeight = ccUtils.ccParseInt(value.Replace("lineHeight=", ""));
// scaleW. sanity check
index = line.IndexOf("scaleW=") + "scaleW=".Length;
@@ -359,21 +359,21 @@ private void parseKerningEntry(string line)
int index = line.IndexOf("first=");
int index2 = line.IndexOf(' ', index);
string value = line.Substring(index, index2 - index);
- first = int.Parse(value.Replace("first=", ""));
+ first = ccUtils.ccParseInt(value.Replace("first=", ""));
// second
int second;
index = line.IndexOf("second=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index, index2 - index);
- second = int.Parse(value.Replace("second=", ""));
+ second = ccUtils.ccParseInt(value.Replace("second=", ""));
// amount
int amount;
index = line.IndexOf("amount=");
index2 = line.IndexOf(' ', index);
value = line.Substring(index);
- amount = int.Parse(value.Replace("amount=", ""));
+ amount = ccUtils.ccParseInt(value.Replace("amount=", ""));
tKerningHashElement element = new tKerningHashElement();
element.amount = amount;
Oops, something went wrong.

0 comments on commit e0b395d

Please sign in to comment.