Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CCBReader_v2.cpp in vcproj & vcxproj #903

Merged
merged 1 commit into from May 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions cocos2dx/extensions/CCBReader/CCBReader_v2.cpp
Expand Up @@ -34,19 +34,19 @@ USING_NS_CC_EXT;
int CCBReader::intValFromDict(CCDictionary* dict, const std::string key)
{
CCString* valueString = (CCString*) dict->objectForKey(key.c_str());
return valueString->intValue();
return valueString? valueString->intValue() : 0;
}

float CCBReader::floatValFromDict(CCDictionary* dict, const std::string key)
{
CCString* valueString = (CCString*) dict->objectForKey(key.c_str());
return valueString->floatValue();
return valueString? valueString->floatValue() : 0;
}

bool CCBReader::boolValFromDict(CCDictionary* dict, const std::string key)
{
CCString* valueString = (CCString*) dict->objectForKey(key.c_str());
return (bool) valueString->intValue();
return valueString? ((bool)(valueString->intValue())) : false;
}

CCPoint CCBReader::pointValFromDict(CCDictionary* dict, const std::string key)
Expand Down
20 changes: 20 additions & 0 deletions cocos2dx/proj.win32/cocos2d-win32.vcproj 100644 → 100755
Expand Up @@ -1231,6 +1231,26 @@
>
</File>
</Filter>
<Filter
Name="CCBReader"
>
<File
RelativePath="..\extensions\CCBReader\CCBCustomClass.cpp"
>
</File>
<File
RelativePath="..\extensions\CCBReader\CCBCustomClass.h"
>
</File>
<File
RelativePath="..\extensions\CCBReader\CCBReader.h"
>
</File>
<File
RelativePath="..\extensions\CCBReader\CCBReader_v2.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="kazmath"
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/proj.win32/cocos2d-win32.vcxproj 100644 → 100755
Expand Up @@ -161,7 +161,7 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\effects\CCGrabber.cpp" />
<ClCompile Include="..\effects\CCGrid.cpp" />
<ClCompile Include="..\extensions\CCBReader\CCBCustomClass.cpp" />
<ClCompile Include="..\extensions\CCBReader\CCBReader.cpp" />
<ClCompile Include="..\extensions\CCBReader\CCBReader_v2.cpp" />
<ClCompile Include="..\extensions\CCControlExtension\CCControl.cpp" />
<ClCompile Include="..\extensions\CCControlExtension\CCControlButton.cpp" />
<ClCompile Include="..\extensions\CCControlExtension\CCControlColourPicker.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters 100644 → 100755
Expand Up @@ -486,7 +486,7 @@
<ClCompile Include="..\extensions\CCBReader\CCBCustomClass.cpp">
<Filter>extensions\CCBReader</Filter>
</ClCompile>
<ClCompile Include="..\extensions\CCBReader\CCBReader.cpp">
<ClCompile Include="..\extensions\CCBReader\CCBReader_v2.cpp">
<Filter>extensions\CCBReader</Filter>
</ClCompile>
</ItemGroup>
Expand Down