Merge pull request #903 from walzer/gles20

add CCBReader_v2.cpp in vcproj & vcxproj
This commit is contained in:
Walzer 2012-05-21 02:58:59 -07:00
commit 9ee1b32c26
4 changed files with 25 additions and 5 deletions

View File

@ -34,19 +34,19 @@ USING_NS_CC_EXT;
int CCBReader::intValFromDict(CCDictionary* dict, const std::string key) int CCBReader::intValFromDict(CCDictionary* dict, const std::string key)
{ {
CCString* valueString = (CCString*) dict->objectForKey(key.c_str()); 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) float CCBReader::floatValFromDict(CCDictionary* dict, const std::string key)
{ {
CCString* valueString = (CCString*) dict->objectForKey(key.c_str()); 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) bool CCBReader::boolValFromDict(CCDictionary* dict, const std::string key)
{ {
CCString* valueString = (CCString*) dict->objectForKey(key.c_str()); 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) CCPoint CCBReader::pointValFromDict(CCDictionary* dict, const std::string key)

20
cocos2dx/proj.win32/cocos2d-win32.vcproj Normal file → Executable file
View File

@ -1231,6 +1231,26 @@
> >
</File> </File>
</Filter> </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>
<Filter <Filter
Name="kazmath" Name="kazmath"

2
cocos2dx/proj.win32/cocos2d-win32.vcxproj Normal file → Executable file
View File

@ -161,7 +161,7 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\effects\CCGrabber.cpp" /> <ClCompile Include="..\effects\CCGrabber.cpp" />
<ClCompile Include="..\effects\CCGrid.cpp" /> <ClCompile Include="..\effects\CCGrid.cpp" />
<ClCompile Include="..\extensions\CCBReader\CCBCustomClass.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\CCControl.cpp" />
<ClCompile Include="..\extensions\CCControlExtension\CCControlButton.cpp" /> <ClCompile Include="..\extensions\CCControlExtension\CCControlButton.cpp" />
<ClCompile Include="..\extensions\CCControlExtension\CCControlColourPicker.cpp" /> <ClCompile Include="..\extensions\CCControlExtension\CCControlColourPicker.cpp" />

2
cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters Normal file → Executable file
View File

@ -486,7 +486,7 @@
<ClCompile Include="..\extensions\CCBReader\CCBCustomClass.cpp"> <ClCompile Include="..\extensions\CCBReader\CCBCustomClass.cpp">
<Filter>extensions\CCBReader</Filter> <Filter>extensions\CCBReader</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\extensions\CCBReader\CCBReader.cpp"> <ClCompile Include="..\extensions\CCBReader\CCBReader_v2.cpp">
<Filter>extensions\CCBReader</Filter> <Filter>extensions\CCBReader</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>