mirror of https://github.com/axmolengine/axmol.git
Merge branch 'master' of https://github.com/cocos2d/cocos2d-x
Conflicts: extensions/Android.mk extensions/proj.win32/libExtensions.vcxproj.filters samples/Cpp/TestCpp/Android.mk samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp
This commit is contained in:
commit
3cfba7bc9a
|
@ -87,3 +87,6 @@ tools/tojs/user.cfg
|
|||
tools/tojs/userconf.ini
|
||||
# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/
|
||||
tools/jenkins_scripts/mac/android/userconf.ini
|
||||
|
||||
# CTags
|
||||
tags
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
[submodule "tools/cxx-generator"]
|
||||
path = tools/cxx-generator
|
||||
url = git://github.com/funkaster/cxx-generator.git
|
||||
[submodule "tools/bindings-generator"]
|
||||
path = tools/bindings-generator
|
||||
url = https://github.com/cocos2d/bindings-generator.git
|
||||
[submodule "scripting/javascript/bindings/generated"]
|
||||
path = scripting/javascript/bindings/generated
|
||||
url = git://github.com/folecr/cocos2dx-autogen-bindings.git
|
||||
[submodule "samples/Javascript/Shared"]
|
||||
path = samples/Javascript/Shared
|
||||
url = https://github.com/minggo/cocos2d-js-tests.git
|
||||
[submodule "external/emscripten"]
|
||||
path = external/emscripten
|
||||
url = https://github.com/kripken/emscripten.git
|
||||
[submodule "tools/cocos2d-console"]
|
||||
path = tools/cocos2d-console
|
||||
url = https://github.com/cocos2d/cocos2d-console.git
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
language: cpp
|
||||
env:
|
||||
matrix:
|
||||
- GEN_JSB=YES
|
||||
- PLATFORM=linux DEBUG=1
|
||||
- PLATFORM=nacl DEBUG=1
|
||||
- PLATFORM=android
|
||||
global:
|
||||
- secure: |-
|
||||
cHXOjAda+t2tmBVuVAiQfvhDN+unToO6hX1rc3dJeGDOk4rlQnylJacjA7o/
|
||||
enkWeHagbW2Ja4h7BxQz4h7dada8zEbIbEMK4VEHx6AWwQM+GIEqkJPv5g8k
|
||||
4P20MLpX4XyUwm/16btpnqgXlyd8Q3Zjh3Vui/5/VzwPnxUQEho=
|
||||
- secure: |-
|
||||
U/JsyiSR9q+8wX1arfciy3BdbMQaKmgt48/9tiU7P2RQJ/FR2AHGq85sNGI/
|
||||
ZUxN4JPLGALEvkFMo4NYyJDUcsdRHZX3vbp5xbSSRaBigqJIj3HDxtlPVf2m
|
||||
/W2GzcfNNX1ACO18hSWH0d2yFlF263ZmvudzQIfqTESfjGQBzwA=
|
||||
- secure: |-
|
||||
Wsngwo3jlZtvuPfr3RNhqrz/liNIhKYnlw4KYJO90gMQ9ZQKRTlMv2BMiPw/
|
||||
9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh
|
||||
X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI=
|
||||
script:
|
||||
- export NACL_SDK_ROOT=$HOME/bin/nacl_sdk/pepper_canary
|
||||
- export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin
|
||||
- export NDK_ROOT=$HOME/bin/android-ndk
|
||||
- ./tools/travis-scripts/run-script.sh
|
||||
|
||||
before_install:
|
||||
- ./tools/travis-scripts/before-install.sh
|
||||
|
179
AUTHORS
179
AUTHORS
|
@ -11,6 +11,56 @@ Developers:
|
|||
Ricardo Quesada
|
||||
Rolando Abarca
|
||||
Javascript Binding and testjs
|
||||
|
||||
carlomorgantinizynga
|
||||
CCLabelTTF supports for shadow and stroke
|
||||
|
||||
James Gregory (j4m3z0r, Zynga)
|
||||
Maintainer of Emscripten port.
|
||||
Initial Emscripten port.
|
||||
Use browser font rendering instead of FreeType.
|
||||
|
||||
DarraghCoy
|
||||
Fix a potential crash SimpleAudioEngineOpenSL::playEffect
|
||||
|
||||
silverscania
|
||||
Pass correct parameter to glPixelStorei when creating a texture
|
||||
|
||||
FlagellumDei
|
||||
Center the window correctly on windows
|
||||
|
||||
ggggamer
|
||||
fixed memory leak of preloadEffect on windows
|
||||
|
||||
CodeSnooker
|
||||
Added Method to create a CCMenuItemToggle from a CCArray with a target selector
|
||||
|
||||
wagaf-d
|
||||
Move ccpX functions to CCPoint methods and operators
|
||||
|
||||
sergey-shambir
|
||||
Added CC_DISABLE_COPY macro
|
||||
Added __attribute__(__format__()) for CCLog and CCString
|
||||
Refactoring network extension and fixing unlikely memory leaks.
|
||||
Adding PUT/DELETE methods for CCHttpRequest.
|
||||
|
||||
savdalion
|
||||
Added example for russian language in TestCpp
|
||||
Added const modifier for classes CCArray, CCObject
|
||||
|
||||
rodrigogolive
|
||||
Fix broke linux build
|
||||
|
||||
kdejongh
|
||||
Fix for spaces at the beginning of wrapped lines on Android
|
||||
|
||||
martell
|
||||
use tinyxml2 to replace libxml2
|
||||
Added Mingw-crt Support without breaking VS SDK
|
||||
|
||||
mchinen
|
||||
fix emulator issue for OpenGL ES 2.0 on Android
|
||||
Fix missing protocol method warning for iOS 6.0 addition
|
||||
|
||||
DenizPiri
|
||||
use CCLOG to implement print() function in LUA
|
||||
|
@ -28,9 +78,13 @@ Developers:
|
|||
DarraghCoy
|
||||
fix for loading custom fonts on iOS when referenced from a CCB file
|
||||
Fix CCUserDefault.cpp compiling on Android.
|
||||
Fixing CCFileUtils 'createXXXXWithContentsOfFile' path lookup issue.
|
||||
Add CCDirector::popToSceneStackLevel(int level).
|
||||
Fixing a bug that custom font can't be loaded correctly if using full path of filename on android.
|
||||
|
||||
Waiter
|
||||
fix an error that OpenSLEngine can't load resources from SD card
|
||||
add CCRemoveSelf action
|
||||
|
||||
billy1380
|
||||
make CCLens3d support concave effect.
|
||||
|
@ -78,6 +132,10 @@ Developers:
|
|||
Some improvements for CCScrollView and CCTableView.
|
||||
Touch priority can't be set to the value specified by a call to CCMenu::setTouchPriority(int).
|
||||
CCTableView crashes if a CCTableViewDelegate is not provided.
|
||||
Fixing a bug that _realOpacity isn't assigned in CCLayerColor::initWithColor.
|
||||
CCScrollView TouchPriority Fix
|
||||
Add encrypted PVR.CCZ support to ZipUtils + Tests
|
||||
Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).
|
||||
|
||||
Weeds (Andre Rudlaff)
|
||||
Used fontconfig to enhance font rendering on linux.
|
||||
|
@ -86,10 +144,16 @@ Developers:
|
|||
Fixed the size calculations for true type fonts (especially for italic fonts).
|
||||
Added a very simple greedy line break algorithmfor true type labels.
|
||||
Fixed font rendering crash for certain fonts on linux.
|
||||
Fixed potential crash in CCScheduler::removeHashElement.
|
||||
Fixed potential crash in CCSaxParser.
|
||||
Added kResolutionFixedHeight and kResolutionFixedWidth resolution policy.
|
||||
Use pthread mutex and condition variable instead of pthred semaphore to load image asynchronizely.
|
||||
Fixed crash in HttpClient request on 64Bit.
|
||||
|
||||
Nat Weiss (iphonegamekit.com)
|
||||
author of Mac port
|
||||
add TMX polygon parsing
|
||||
Properly resets the tile's Y flipping
|
||||
|
||||
XiaoLong Zhang (Chukong Inc)
|
||||
Mike McGary (Zynga)
|
||||
|
@ -105,16 +169,22 @@ Developers:
|
|||
Surith Thekkiam (folecr, Zynga)
|
||||
contribute for Android module building
|
||||
Simpler, correct handling of spritesheet sources for CCScale9Sprite.
|
||||
Clean up linked libraries for android.
|
||||
JavaScript debugger improved and bugfixed.
|
||||
|
||||
Nicolas Gramlich (nicolasgramlich, Zynga)
|
||||
fixed CCDirector to use CCLabelBMFont instead of CCLabelTTF
|
||||
added CCBReader (CCBI format)
|
||||
Added cleanup and reset methods to ScriptingCore.
|
||||
Fixed a bug in ScriptingCore::evalString not setting the outval.
|
||||
Updated .classpath of Android project to latest ADT 22 build tool compatibility.
|
||||
|
||||
Rohan Kuruvilla (rohankuruvilla, Zynga)
|
||||
Improvements to JS Bindings.
|
||||
Synchronizing CCBReader to version 5.
|
||||
Adding OpenGL Bindings to Javascript.
|
||||
Fixing a bug that nested ccb-files are not positioned correctly.
|
||||
Fixing a bug that crash when loading valid project.
|
||||
|
||||
Jianfeng Zou (NetDragon Inc)
|
||||
contributes CCListView and CCTextureWatcher.
|
||||
|
@ -218,12 +288,15 @@ Developers:
|
|||
Adding CCEditBox implementation for Mac OSX.
|
||||
|
||||
tiantian20007
|
||||
Fix crash for call runAnimation() in CCBAnimationManagerDelegate::completedAnimationSequenceNamed.
|
||||
Fixing a crash for call runAnimation() in CCBAnimationManagerDelegate::completedAnimationSequenceNamed.
|
||||
Fixing a bug that CCControl's touch priority is not set correctly; m_nDefaultTouchPriority is never used.
|
||||
Fixing a syntax error for RENDER_IN_SUBPIXEL macro.
|
||||
Implement CCDictionary::writeToFile().
|
||||
|
||||
xyhl515
|
||||
Fixed a bug that CCControlSwitch::setOn(isOn,false) doesn't work.
|
||||
Adds VS2012 Express template installing support.
|
||||
Fixing a logical error in CCDrawNode::drawPolygon.
|
||||
|
||||
DarraghCoy
|
||||
Fix for unaligned memory access crash in CCBReader::readFloat().
|
||||
|
@ -231,6 +304,8 @@ Developers:
|
|||
Sergej Tatarincev (SevInf)
|
||||
Making ScriptingCore.cpp compiled fine with C++11 on iOS.
|
||||
Using shared NodeLoaderLibrary in CCBReader bindings.
|
||||
CCEditBox iOS enchantments/bugfixes.
|
||||
Support variable cell sizes in CCTableView.
|
||||
|
||||
ThePickleMan
|
||||
Adding 'rotationIsDir' property to ParticleSystem.
|
||||
|
@ -250,12 +325,19 @@ Developers:
|
|||
Refactor linux build system and fix many warnings.
|
||||
Fixing a bug where missing packages would cause the script to exit on linux.
|
||||
Adding 'make run' target for linux projects.
|
||||
Stripping newlines from log message and fixing linux library location.
|
||||
Fixing a bug that CCPhysicsSprite was overriding only some of the getPosition methods.
|
||||
Adding a macro USE_BOX2D to check whether to enable Box2D for linux and nacl port.
|
||||
Adding Travis build support for linux and NaCl.
|
||||
Logging assert messages to the console.
|
||||
Renaming CCScriptSupport::executeAssert to CCScriptSupport::handleAssert.
|
||||
|
||||
Peter Young (young40)
|
||||
Implements setVisible() for CCEditBox
|
||||
|
||||
|
||||
csy1988525
|
||||
Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted.
|
||||
fixed a bug when button's parent is hided, the button still can responce to clicked event.
|
||||
|
||||
Asad ur Rehman (AsadR)
|
||||
Adding CCNotificationCenter::removeAllObservers(CCObject *target).
|
||||
|
@ -268,9 +350,102 @@ Developers:
|
|||
|
||||
Zecken (gelldur)
|
||||
Fixing a profiling compilation error in CCParticleBatchNode.
|
||||
Fixing linking errors for TestCPP with libcurl on linux.
|
||||
|
||||
flamingo (flaming0)
|
||||
Null pointer check in order to prevent crashes.
|
||||
Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.
|
||||
|
||||
rtissera (Romain TISSERAND)
|
||||
Adding missing JNIEXPORT / JNICALL declarations.
|
||||
Fix iOS 4.3 JPEG loading issue.
|
||||
|
||||
Yodesoft
|
||||
Improving font rendering performance for linux platform.
|
||||
Reducing function call in nativeInitBitmapDC to improve performance.
|
||||
Refactoring writable path to "<user's home>/.config/<app name>" for linux platform.
|
||||
|
||||
sjchao
|
||||
Fixing a display bug when a scrollView nested in another scrollView.
|
||||
|
||||
Éloi Rivard (azmeuk)
|
||||
Linux OpenAL support.
|
||||
|
||||
elmiro
|
||||
Correction of passed buffer size to readlink and verification of result return by readlink.
|
||||
|
||||
harikrishnar (Hari Krishna)
|
||||
Wrong logic in CCArray::initWithObjects.
|
||||
Fixing a bug that button should not get respond if its parent is invisable.
|
||||
|
||||
rogerzanoni
|
||||
Fixing a linking error that libpthread and libGL libraries need to be linked on linux.
|
||||
Fixing a compiling error of [-Werror=array-bounds] when compiling Box2dTestBed.
|
||||
|
||||
zhanghaojie
|
||||
Fixing a bug that anchorPoint property of CCScale9Sprite doesn't work in CCBReader.
|
||||
|
||||
MarkEHenderson (Mark Henderson)
|
||||
Fixing of variable initialization in SpriteBatchNode.
|
||||
|
||||
akira-cn
|
||||
Adding response for back and menu keypad event for Android.
|
||||
|
||||
lgb (Oleg)
|
||||
Fixing a compilation error for BlackBerry PlayBook.
|
||||
Comparing float number by using epsilon and absolute difference.
|
||||
|
||||
jotel (Jaroslaw Lewandowski)
|
||||
Fixing a bug that wrong type of argument signature is used in setAccelerometerIntervalJNI function.
|
||||
Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).
|
||||
|
||||
MarcelBloemendaal
|
||||
Adding secureTextEntry property to CCTextFieldTTF.
|
||||
|
||||
brawsome
|
||||
Adding new macro CCB_MEMBERVARIABLEASSIGNER_GLUE_WEAK to CCBMemberVariableAssigner.h.
|
||||
Adding CCLOG before original path is returned in CCFileUtils::fullPathForFileName to aid in debugging.
|
||||
Optmization to ccArrayGetIndexOfObject.
|
||||
|
||||
sunzhuoshi
|
||||
Adding support for javascript bytecode.
|
||||
|
||||
ptekchand (Pranav Tekchand)
|
||||
Supporting negative node scales for CCScrollView.
|
||||
|
||||
coolengineer (Hojin Choi)
|
||||
Refactoring callback selector for HttpResponse.
|
||||
|
||||
djh-
|
||||
Fixing a bug that displayed color of CCDrawNode is incorrect when VAO is disabled.
|
||||
|
||||
acai (beingstudio)
|
||||
Fix of null pointer access in CCBAnimationManager::getRunningSequenceName.
|
||||
|
||||
metalgit92
|
||||
Adding const qualification to some CCNode's getters
|
||||
|
||||
Clarinexus
|
||||
Fixing a bug that setColor and setOpacity of CCControlButton and CCScale9Sprite are broken.
|
||||
|
||||
Xander84
|
||||
Fixing a bug in CCBValue::getByteValue.
|
||||
|
||||
smshuja
|
||||
Fixing a bug that pointQueryFirst returns invalid Shape when a shape is not found in JSB.
|
||||
Fixing a bug that New PivotJoint can't access 4 parameters like in html5 version.
|
||||
|
||||
Carsten Sandtner (casarock)
|
||||
Adding XMLHttpRequest support for JSB.
|
||||
|
||||
Lee, Jae-Hong (pyrasis)
|
||||
Maintainer of tizen port.
|
||||
|
||||
lumendes
|
||||
Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.
|
||||
|
||||
sunxiaoyu
|
||||
Refactoring CCEditBox to add UITextField only when keyboard was opened, remove it when keyboard was closed.
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
|
|
84
CHANGELOG
84
CHANGELOG
|
@ -1,3 +1,87 @@
|
|||
cocos2d-2.1rc0-x-2.1.3 @May.01 2013
|
||||
[all platforms]
|
||||
Bug #1853: use SHELLOPTS instead of "-o igncr" for Android Eclipse project
|
||||
Bug #1860: fix a bug that onNodeLoaded will be called twice if ccb was added as a CCBFile
|
||||
Bug #1862: fix a bug that CCScrollView::setContainer may cause dangling pointer when NULL is passed into
|
||||
Bug #1876: fix a bug that CCScale9Sprite::setColor() & setOpacity() are broken
|
||||
Bug #1935: fix a bug that use "==" for float comparison of CCPoint and CCSize
|
||||
Bug #1937: fix a bug that CCControl's touch priority is not set correctly, m_nDefaultTouchPriority is never used
|
||||
Bug #1943: added some missing function for setting integer shader uniforms in CCGLProgram
|
||||
Bug #1999: allowing to set fontName and fontSize separately for CCEditBox
|
||||
Bug #2003: fix a potential crash in CCScheduler::removeHashElement()
|
||||
Bug #2030: fix a bug that scissor rectangle in nested CCScrollView is wrong
|
||||
Bug #2031: make CCFileUtils::createXXXXWithContentsOfFile() support relative path
|
||||
Bug #2035: fix a potential crash in CCSaxParser
|
||||
Bug #2037: fix a wrong logic in CCArray::initWithObjects()
|
||||
Bug #2040: get scale property from sub-ccb node may trigger an assert
|
||||
Bug #2054: fix a bug that anchorPoint property of CCScale9Sprite doesn't work in CCBReader
|
||||
Bug #2055: enable easy switching between Box2D and chipmunk
|
||||
Bug #2058: properly resets the tile's Y flipping
|
||||
Bug #2061: fix a bug that wrong type of argument signature is used in setAccelerometerIntervalJNI function
|
||||
Bug #2073: fix a memory leak in CCUserDefault
|
||||
Bug #2080: fix a bug that _realOpacity isn't assigned in CCLayerColor::initWithColor
|
||||
Feature #2001: add CCRemoveSelf Action
|
||||
Feature #2048: support variable cell sizes in CCTableView
|
||||
Feature #2065: adding kResolutionFixedHeight and kResolutionFixedWidth resolution policy
|
||||
Feature #2068: adding a secureTextEntry property to CCTextFieldTTF
|
||||
Feature #2069: adding new macro CCB_MEMBERVARIABLEASSIGNER_GLUE_WEAK to CCBMemberVariableAssigner.h
|
||||
Feature #2075: support spine editor
|
||||
Feature #2076: adding a method CCBReader::setResolutionScale for setting resolution scale manually
|
||||
Refactor #1592: updating UTHASH to v1.9.8
|
||||
Refactor #2042: remove libxml2
|
||||
Refactor #2097: use pthread mutex and condition variable instead of pthread semaphore to load image asynchronizely
|
||||
[android]
|
||||
Bug #1996: adding missing JNIEXPORT / JNICALL declarations
|
||||
Bug #2028: fix a bug taht application can not run correctly on Android simulator
|
||||
Bug #2045: some small fixes to CocosPlayer
|
||||
Bug #2062: fix for spaces at the beginning of wrapped lines
|
||||
Bug #2083: fix a bug that Bytecode of LuaJIT can't work on android
|
||||
Refactor #1613: not reload resources when coming from background on Android
|
||||
Refactor #1861: CocosPlayer Android update
|
||||
Refactor #1904: strip libcurl.a on x86 architecture
|
||||
Refactor #2027: reduce function call in nativeInitBitmapDC to improve performance
|
||||
Refactor #2047: clean up linked libraries for android
|
||||
[iOS]
|
||||
Bug #1863: fix a bug that CCUserDefault on iOS may not save immediately
|
||||
Feature #2096: adding Cocosplayer for iOS and bug fixes
|
||||
[linux]
|
||||
Bug #1932: fix a bug that font rendering crashed for certain fonts
|
||||
Bug #2036: correct passed buffer size to readlink
|
||||
Bug #2044: link libpthread and libGL
|
||||
Bug #2046: strip newlines from log message and fixing linux library location
|
||||
Bug #2052: fix a bug that [-Werror=array-bounds] error appears when compiling Box2dTestBed
|
||||
Feature #2032: Linux OpenAL support
|
||||
Refactor #2000: improve font rendering performance for linux platform
|
||||
Refactor #2053: set writable path to "<user's home>/.config/<app name>"
|
||||
[mac]
|
||||
Bug #2051: fix a bug that TestCpp/ExtensionsTest/CocosbuilderTest crashes under x86_64 target
|
||||
Feature #1856: adding 64bit target for Mac project
|
||||
[javascript binding]
|
||||
Bug #1855: fix a bug that std_string_to_jsval generates messy js string when passed a non-ascii UTF8 std::string
|
||||
Bug #2057: adding response for back and menu keypad event for Android
|
||||
Bug #2059: fix a bug that cc.FileUtils.getInstance().getStringFromFile(filename) doesn't return a whole string
|
||||
Bug #2071: fix a bug that cc.TMXLayer.getTiles() can't work
|
||||
Feature #1841: find a way to obfuscate javascript code on the top of JSB
|
||||
Feature #1936: adding OpenGL Bindings to Javascript
|
||||
Feature #2043: upgrading SpiderMonkey to Firefox20.0
|
||||
Feature #2060: support for cc.FileUtils.getInstance().getByteArrayFromFile(filename)
|
||||
Feature #2064: exposing cc.Node.nodeTo***Transform to JS
|
||||
Refactor #1944: subclass of cc.Sprite,cc.Layer... doesn't need cc.associateWithNative anymore
|
||||
[lua binding]
|
||||
Feature #1814: add menutest
|
||||
Feature #1941: add TileMapTest
|
||||
Feature #1942: add LayerTest
|
||||
Feature #1945: use CCLOG to implement print() function
|
||||
Feature #1993: add ParallaxTest
|
||||
Feature #1994: add ActionManagerTest
|
||||
Feature #1997: add IntervalTest
|
||||
Feature #1998: add SceneTest
|
||||
Feature #2002: add Texture2dTest, RenderTexture, ZwoptexTest, FontTest, CocosDenshionTest and EffectsAdvancedTest
|
||||
Feature #2004: add UserDefaultTest
|
||||
Feature #2005: add CurrentLanguageTest
|
||||
Refactor #1847: use luajit
|
||||
Refactor #2084: unify the method of loading lua files on all platforms
|
||||
|
||||
cocos2d-2.1rc0-x-2.1.2 @Mar.20 2013
|
||||
[all platforms]
|
||||
Bug #1529: use NSUserDefaults on iOS and SharedPreferences on Android implement CCUserDefault
|
||||
|
|
|
@ -88,24 +88,25 @@ void SimpleAudioEngineOpenSL::setEffectsVolume(float volume)
|
|||
|
||||
unsigned int SimpleAudioEngineOpenSL::playEffect(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
unsigned int soundID;
|
||||
do
|
||||
{
|
||||
soundID = s_pOpenSL->preloadEffect(pszFilePath);
|
||||
if (soundID != FILE_NOT_FOUND)
|
||||
{
|
||||
if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)
|
||||
{
|
||||
// recreate an effect player
|
||||
s_pOpenSL->recreatePlayer(pszFilePath);
|
||||
break;
|
||||
}
|
||||
s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);
|
||||
s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);
|
||||
}
|
||||
} while (0);
|
||||
s_pOpenSL->setEffectLooping(soundID, bLoop);
|
||||
return soundID;
|
||||
unsigned int soundID = s_pOpenSL->preloadEffect(pszFilePath);
|
||||
|
||||
if (soundID != FILE_NOT_FOUND)
|
||||
{
|
||||
if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)
|
||||
{
|
||||
// recreate an effect player
|
||||
s_pOpenSL->recreatePlayer(pszFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);
|
||||
s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);
|
||||
}
|
||||
|
||||
s_pOpenSL->setEffectLooping(soundID, bLoop);
|
||||
}
|
||||
|
||||
return soundID;
|
||||
}
|
||||
|
||||
void SimpleAudioEngineOpenSL::pauseEffect(unsigned int nSoundId)
|
||||
|
|
|
@ -0,0 +1,303 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 Zynga Inc.
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
// XXX: This is all just a bit of a hack. SDL uses channels as its underlying
|
||||
// abstraction, whilst CocosDenshion deals in individual effects. Consequently
|
||||
// we can't set start/stop, because to SDL, effects (chunks) are just opaque
|
||||
// blocks of data that get scheduled on channels. To workaround this, we assign
|
||||
// each sound to a channel, but since there are only 32 channels, we use the
|
||||
// modulus of the sound's address (which on Emscripten is just an incrementing
|
||||
// integer) to decide which channel.
|
||||
//
|
||||
// A more rigorous implementation would have logic to store the state of
|
||||
// channels and restore it as necessary. This should probably just be
|
||||
// considered a toy for now, but it will probably prove sufficient for many
|
||||
// use-cases. Recall also that Emscripten undoes this abstraction on the other
|
||||
// side because it is using HTML5 audio objects as its underlying primitive!
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "cocos2d.h"
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_mixer.h>
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace CocosDenshion
|
||||
{
|
||||
struct soundData {
|
||||
Mix_Chunk *chunk;
|
||||
bool isLooped;
|
||||
};
|
||||
|
||||
typedef map<string, soundData *> EffectsMap;
|
||||
EffectsMap s_effects;
|
||||
float s_effectsVolume = 1.0;
|
||||
|
||||
typedef enum {
|
||||
PLAYING,
|
||||
STOPPED,
|
||||
PAUSED,
|
||||
} playStatus;
|
||||
|
||||
struct backgroundMusicData {
|
||||
Mix_Music *music;
|
||||
};
|
||||
typedef map<string, backgroundMusicData *> BackgroundMusicsMap;
|
||||
BackgroundMusicsMap s_backgroundMusics;
|
||||
float s_backgroundVolume = 1.0;
|
||||
|
||||
static SimpleAudioEngine *s_engine = 0;
|
||||
|
||||
// Unfortunately this is just hard-coded in Emscripten's SDL
|
||||
// implementation.
|
||||
static const int NR_CHANNELS = 32;
|
||||
static void stopBackground(bool bReleaseData)
|
||||
{
|
||||
SimpleAudioEngine *engine = SimpleAudioEngine::sharedEngine();
|
||||
engine->stopBackgroundMusic();
|
||||
}
|
||||
|
||||
SimpleAudioEngine::SimpleAudioEngine()
|
||||
{
|
||||
}
|
||||
|
||||
SimpleAudioEngine::~SimpleAudioEngine()
|
||||
{
|
||||
}
|
||||
|
||||
SimpleAudioEngine* SimpleAudioEngine::sharedEngine()
|
||||
{
|
||||
if (!s_engine)
|
||||
s_engine = new SimpleAudioEngine();
|
||||
|
||||
return s_engine;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::end()
|
||||
{
|
||||
// clear all the sounds
|
||||
EffectsMap::const_iterator end = s_effects.end();
|
||||
for (EffectsMap::iterator it = s_effects.begin(); it != end; it++)
|
||||
{
|
||||
Mix_FreeChunk(it->second->chunk);
|
||||
delete it->second;
|
||||
}
|
||||
s_effects.clear();
|
||||
|
||||
// and the background too
|
||||
stopBackground(true);
|
||||
|
||||
for (BackgroundMusicsMap::iterator it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it)
|
||||
{
|
||||
Mix_FreeMusic(it->second->music);
|
||||
delete it->second;
|
||||
}
|
||||
s_backgroundMusics.clear();
|
||||
}
|
||||
|
||||
//
|
||||
// background audio
|
||||
//
|
||||
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
std::string key = std::string(pszFilePath);
|
||||
struct backgroundMusicData *musicData;
|
||||
if(!s_backgroundMusics.count(key))
|
||||
{
|
||||
musicData = new struct backgroundMusicData();
|
||||
musicData->music = Mix_LoadMUS(pszFilePath);
|
||||
s_backgroundMusics[key] = musicData;
|
||||
}
|
||||
else
|
||||
{
|
||||
musicData = s_backgroundMusics[key];
|
||||
}
|
||||
|
||||
Mix_PlayMusic(musicData->music, bLoop ? -1 : 0);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
|
||||
{
|
||||
Mix_HaltMusic();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseBackgroundMusic()
|
||||
{
|
||||
Mix_PauseMusic();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeBackgroundMusic()
|
||||
{
|
||||
Mix_ResumeMusic();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::rewindBackgroundMusic()
|
||||
{
|
||||
CCLOGWARN("Cannot rewind background in Emscripten");
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::willPlayBackgroundMusic()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::isBackgroundMusicPlaying()
|
||||
{
|
||||
return Mix_PlayingMusic();
|
||||
}
|
||||
|
||||
float SimpleAudioEngine::getBackgroundMusicVolume()
|
||||
{
|
||||
return s_backgroundVolume;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
|
||||
{
|
||||
// Ensure volume is between 0.0 and 1.0.
|
||||
volume = volume > 1.0 ? 1.0 : volume;
|
||||
volume = volume < 0.0 ? 0.0 : volume;
|
||||
|
||||
Mix_VolumeMusic(volume * MIX_MAX_VOLUME);
|
||||
s_backgroundVolume = volume;
|
||||
}
|
||||
|
||||
float SimpleAudioEngine::getEffectsVolume()
|
||||
{
|
||||
return s_effectsVolume;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setEffectsVolume(float volume)
|
||||
{
|
||||
volume = volume > 1.0 ? 1.0 : volume;
|
||||
volume = volume < 0.0 ? 0.0 : volume;
|
||||
|
||||
// Need to set volume on every channel. SDL will then read this volume
|
||||
// level and apply it back to the individual sample.
|
||||
for(int i = 0; i < NR_CHANNELS; i++)
|
||||
{
|
||||
Mix_Volume(i, volume * MIX_MAX_VOLUME);
|
||||
}
|
||||
|
||||
s_effectsVolume = volume;
|
||||
}
|
||||
|
||||
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
std::string key = std::string(pszFilePath);
|
||||
struct soundData *sound;
|
||||
if(!s_effects.count(key))
|
||||
{
|
||||
sound = new struct soundData();
|
||||
sound->chunk = Mix_LoadWAV(pszFilePath);
|
||||
sound->isLooped = bLoop;
|
||||
s_effects[key] = sound;
|
||||
}
|
||||
else
|
||||
{
|
||||
sound = s_effects[key];
|
||||
}
|
||||
// This is safe here since Emscripten is just passing back an
|
||||
// incrementing integer each time you use the Mix_LoadWAV method.
|
||||
unsigned int result = (unsigned int) sound->chunk;
|
||||
|
||||
// XXX: This is a bit of a hack, but... Choose a channel based on the
|
||||
// modulo of the # of channels. This allows us to set the volume
|
||||
// without passing around both chunk address and channel.
|
||||
Mix_PlayChannel(result % NR_CHANNELS, sound->chunk, bLoop ? -1 : 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
|
||||
{
|
||||
Mix_HaltChannel(nSoundId % NR_CHANNELS);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
|
||||
{
|
||||
std::string key = std::string(pszFilePath);
|
||||
if(!s_effects.count(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
struct soundData *sound = s_effects[key];
|
||||
|
||||
Mix_FreeChunk(sound->chunk);
|
||||
delete sound;
|
||||
s_effects.erase(key);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
|
||||
{
|
||||
Mix_Pause(nSoundId % NR_CHANNELS);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseAllEffects()
|
||||
{
|
||||
for(int i = 0; i < NR_CHANNELS; i++)
|
||||
{
|
||||
Mix_Pause(i);
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
|
||||
{
|
||||
Mix_Resume(nSoundId % NR_CHANNELS);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeAllEffects()
|
||||
{
|
||||
for(int i = 0; i < NR_CHANNELS; i++)
|
||||
{
|
||||
Mix_Resume(i);
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopAllEffects()
|
||||
{
|
||||
for(int i = 0; i < NR_CHANNELS; i++)
|
||||
{
|
||||
Mix_HaltChannel(i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,606 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
#include <AL/alut.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef DISABLE_VORBIS
|
||||
#include <vorbis/vorbisfile.h>
|
||||
#endif
|
||||
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "cocos2d.h"
|
||||
USING_NS_CC;
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace CocosDenshion
|
||||
{
|
||||
struct soundData {
|
||||
ALuint buffer;
|
||||
ALuint source;
|
||||
bool isLooped;
|
||||
};
|
||||
|
||||
typedef map<string, soundData *> EffectsMap;
|
||||
EffectsMap s_effects;
|
||||
|
||||
typedef enum {
|
||||
PLAYING,
|
||||
STOPPED,
|
||||
PAUSED,
|
||||
} playStatus;
|
||||
|
||||
static float s_volume = 1.0f;
|
||||
static float s_effectVolume = 1.0f;
|
||||
|
||||
struct backgroundMusicData {
|
||||
ALuint buffer;
|
||||
ALuint source;
|
||||
};
|
||||
typedef map<string, backgroundMusicData *> BackgroundMusicsMap;
|
||||
BackgroundMusicsMap s_backgroundMusics;
|
||||
|
||||
static ALuint s_backgroundSource = AL_NONE;
|
||||
|
||||
static SimpleAudioEngine *s_engine = 0;
|
||||
|
||||
static int checkALError(const char *funcName)
|
||||
{
|
||||
int err = alGetError();
|
||||
|
||||
if (err != AL_NO_ERROR)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case AL_INVALID_NAME:
|
||||
fprintf(stderr, "AL_INVALID_NAME in %s\n", funcName);
|
||||
break;
|
||||
|
||||
case AL_INVALID_ENUM:
|
||||
fprintf(stderr, "AL_INVALID_ENUM in %s\n", funcName);
|
||||
break;
|
||||
|
||||
case AL_INVALID_VALUE:
|
||||
fprintf(stderr, "AL_INVALID_VALUE in %s\n", funcName);
|
||||
break;
|
||||
|
||||
case AL_INVALID_OPERATION:
|
||||
fprintf(stderr, "AL_INVALID_OPERATION in %s\n", funcName);
|
||||
break;
|
||||
|
||||
case AL_OUT_OF_MEMORY:
|
||||
fprintf(stderr, "AL_OUT_OF_MEMORY in %s\n", funcName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static void stopBackground(bool bReleaseData)
|
||||
{
|
||||
alSourceStop(s_backgroundSource);
|
||||
|
||||
if (bReleaseData)
|
||||
{
|
||||
for (BackgroundMusicsMap::iterator it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it)
|
||||
{
|
||||
if (it->second->source == s_backgroundSource)
|
||||
{
|
||||
alDeleteBuffers(1, &it->second->buffer);
|
||||
checkALError("stopBackground:alDeleteBuffers");
|
||||
alDeleteSources(1, &it->second->source);
|
||||
checkALError("stopBackground:alDeleteSources");
|
||||
delete it->second;
|
||||
s_backgroundMusics.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s_backgroundSource = AL_NONE;
|
||||
}
|
||||
|
||||
static void setBackgroundVolume(float volume)
|
||||
{
|
||||
alSourcef(s_backgroundSource, AL_GAIN, volume);
|
||||
}
|
||||
|
||||
SimpleAudioEngine::SimpleAudioEngine()
|
||||
{
|
||||
alutInit(0, 0);
|
||||
checkALError("SimpleAudioEngine:alutInit");
|
||||
}
|
||||
|
||||
SimpleAudioEngine::~SimpleAudioEngine()
|
||||
{
|
||||
alutExit();
|
||||
}
|
||||
|
||||
SimpleAudioEngine* SimpleAudioEngine::sharedEngine()
|
||||
{
|
||||
if (!s_engine)
|
||||
s_engine = new SimpleAudioEngine();
|
||||
|
||||
return s_engine;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::end()
|
||||
{
|
||||
checkALError("end:init");
|
||||
|
||||
// clear all the sounds
|
||||
EffectsMap::const_iterator end = s_effects.end();
|
||||
for (EffectsMap::iterator it = s_effects.begin(); it != end; it++)
|
||||
{
|
||||
alSourceStop(it->second->source);
|
||||
checkALError("end:alSourceStop");
|
||||
alDeleteBuffers(1, &it->second->buffer);
|
||||
checkALError("end:alDeleteBuffers");
|
||||
alDeleteSources(1, &it->second->source);
|
||||
checkALError("end:alDeleteSources");
|
||||
delete it->second;
|
||||
}
|
||||
s_effects.clear();
|
||||
|
||||
// and the background too
|
||||
stopBackground(true);
|
||||
|
||||
for (BackgroundMusicsMap::iterator it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it)
|
||||
{
|
||||
alSourceStop(it->second->source);
|
||||
checkALError("end:alSourceStop");
|
||||
alDeleteBuffers(1, &it->second->buffer);
|
||||
checkALError("end:alDeleteBuffers");
|
||||
alDeleteSources(1, &it->second->source);
|
||||
checkALError("end:alDeleteSources");
|
||||
delete it->second;
|
||||
}
|
||||
s_backgroundMusics.clear();
|
||||
}
|
||||
|
||||
#ifndef DISABLE_VORBIS
|
||||
|
||||
//
|
||||
// OGG support
|
||||
//
|
||||
static bool isOGGFile(const char *pszFilePath)
|
||||
{
|
||||
FILE *file;
|
||||
OggVorbis_File ogg_file;
|
||||
int result;
|
||||
|
||||
file = fopen(pszFilePath, "rb");
|
||||
result = ov_test(file, &ogg_file, 0, 0);
|
||||
ov_clear(&ogg_file);
|
||||
|
||||
return (result == 0);
|
||||
}
|
||||
|
||||
static ALuint createBufferFromOGG(const char *pszFilePath)
|
||||
{
|
||||
ALuint buffer;
|
||||
OggVorbis_File ogg_file;
|
||||
vorbis_info* info;
|
||||
ALenum format;
|
||||
int result;
|
||||
int section;
|
||||
unsigned int size = 0;
|
||||
|
||||
if (ov_fopen(pszFilePath, &ogg_file) < 0)
|
||||
{
|
||||
ov_clear(&ogg_file);
|
||||
fprintf(stderr, "Could not open OGG file %s\n", pszFilePath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
info = ov_info(&ogg_file, -1);
|
||||
|
||||
if (info->channels == 1)
|
||||
format = AL_FORMAT_MONO16;
|
||||
else
|
||||
format = AL_FORMAT_STEREO16;
|
||||
|
||||
// size = #samples * #channels * 2 (for 16 bit)
|
||||
unsigned int data_size = ov_pcm_total(&ogg_file, -1) * info->channels * 2;
|
||||
char* data = new char[data_size];
|
||||
|
||||
while (size < data_size)
|
||||
{
|
||||
result = ov_read(&ogg_file, data + size, data_size - size, 0, 2, 1, §ion);
|
||||
if (result > 0)
|
||||
{
|
||||
size += result;
|
||||
}
|
||||
else if (result < 0)
|
||||
{
|
||||
delete [] data;
|
||||
fprintf(stderr, "OGG file problem %s\n", pszFilePath);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
delete [] data;
|
||||
fprintf(stderr, "Unable to read OGG data\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// clear al errors
|
||||
checkALError("createBufferFromOGG:init");
|
||||
|
||||
// Load audio data into a buffer.
|
||||
alGenBuffers(1, &buffer);
|
||||
|
||||
if (checkALError("createBufferFromOGG:alGenBuffers") != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "Couldn't generate a buffer for OGG file\n");
|
||||
delete [] data;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
alBufferData(buffer, format, data, data_size, info->rate);
|
||||
checkALError("createBufferFromOGG:alBufferData");
|
||||
|
||||
delete [] data;
|
||||
ov_clear(&ogg_file);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// background audio
|
||||
//
|
||||
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
|
||||
{
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
|
||||
BackgroundMusicsMap::const_iterator it = s_backgroundMusics.find(fullPath);
|
||||
if (it == s_backgroundMusics.end())
|
||||
{
|
||||
ALuint buffer = AL_NONE;
|
||||
#ifndef DISABLE_VORBIS
|
||||
if (isOGGFile(fullPath.data()))
|
||||
{
|
||||
buffer = createBufferFromOGG(fullPath.data());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
buffer = alutCreateBufferFromFile(fullPath.data());
|
||||
|
||||
|
||||
checkALError("preloadBackgroundMusic:createBuffer");
|
||||
|
||||
if (buffer == AL_NONE)
|
||||
{
|
||||
fprintf(stderr, "Error loading file: '%s'\n", fullPath.data());
|
||||
alDeleteBuffers(1, &buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
ALuint source = AL_NONE;
|
||||
alGenSources(1, &source);
|
||||
checkALError("preloadBackgroundMusic:alGenSources");
|
||||
|
||||
alSourcei(source, AL_BUFFER, buffer);
|
||||
checkALError("preloadBackgroundMusic:alSourcei");
|
||||
|
||||
backgroundMusicData* data = new backgroundMusicData();
|
||||
data->buffer = buffer;
|
||||
data->source = source;
|
||||
s_backgroundMusics.insert(BackgroundMusicsMap::value_type(fullPath, data));
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
if (s_backgroundSource != AL_NONE)
|
||||
stopBackgroundMusic(false);
|
||||
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
|
||||
BackgroundMusicsMap::const_iterator it = s_backgroundMusics.find(fullPath);
|
||||
if (it == s_backgroundMusics.end())
|
||||
{
|
||||
preloadBackgroundMusic(fullPath.c_str());
|
||||
it = s_backgroundMusics.find(fullPath);
|
||||
}
|
||||
|
||||
if (it != s_backgroundMusics.end())
|
||||
{
|
||||
s_backgroundSource = it->second->source;
|
||||
alSourcei(s_backgroundSource, AL_LOOPING, bLoop ? AL_TRUE : AL_FALSE);
|
||||
alSourcePlay(s_backgroundSource);
|
||||
checkALError("playBackgroundMusic:alSourcePlay");
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
|
||||
{
|
||||
stopBackground(bReleaseData);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseBackgroundMusic()
|
||||
{
|
||||
ALint state;
|
||||
alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PLAYING)
|
||||
alSourcePause(s_backgroundSource);
|
||||
checkALError("pauseBackgroundMusic:alSourcePause");
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeBackgroundMusic()
|
||||
{
|
||||
ALint state;
|
||||
alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PAUSED)
|
||||
alSourcePlay(s_backgroundSource);
|
||||
checkALError("resumeBackgroundMusic:alSourcePlay");
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::rewindBackgroundMusic()
|
||||
{
|
||||
alSourceRewind(s_backgroundSource);
|
||||
checkALError("rewindBackgroundMusic:alSourceRewind");
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::willPlayBackgroundMusic()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::isBackgroundMusicPlaying()
|
||||
{
|
||||
ALint play_status;
|
||||
alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &play_status);
|
||||
|
||||
return (play_status == AL_PLAYING);
|
||||
}
|
||||
|
||||
float SimpleAudioEngine::getBackgroundMusicVolume()
|
||||
{
|
||||
return s_volume;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
|
||||
{
|
||||
if (s_volume != volume && volume >= -0.0001 && volume <= 1.0001)
|
||||
{
|
||||
s_volume = volume;
|
||||
|
||||
setBackgroundVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Effect audio (using OpenAL)
|
||||
//
|
||||
float SimpleAudioEngine::getEffectsVolume()
|
||||
{
|
||||
return s_effectVolume;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setEffectsVolume(float volume)
|
||||
{
|
||||
if (volume != s_effectVolume)
|
||||
{
|
||||
EffectsMap::const_iterator end = s_effects.end();
|
||||
for (EffectsMap::const_iterator it = s_effects.begin(); it != end; it++)
|
||||
{
|
||||
alSourcef(it->second->source, AL_GAIN, volume);
|
||||
}
|
||||
|
||||
s_effectVolume = volume;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
|
||||
EffectsMap::iterator iter = s_effects.find(fullPath);
|
||||
|
||||
if (iter == s_effects.end())
|
||||
{
|
||||
preloadEffect(fullPath.c_str());
|
||||
|
||||
// let's try again
|
||||
iter = s_effects.find(fullPath);
|
||||
if (iter == s_effects.end())
|
||||
{
|
||||
fprintf(stderr, "could not find play sound %s\n", fullPath.c_str());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
checkALError("playEffect:init");
|
||||
iter->second->isLooped = bLoop;
|
||||
alSourcei(iter->second->source, AL_LOOPING, iter->second->isLooped ? AL_TRUE : AL_FALSE);
|
||||
alSourcePlay(iter->second->source);
|
||||
checkALError("playEffect:alSourcePlay");
|
||||
|
||||
return iter->second->source;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
|
||||
{
|
||||
alSourceStop(nSoundId);
|
||||
checkALError("stopEffect:alSourceStop");
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
||||
{
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
|
||||
EffectsMap::iterator iter = s_effects.find(fullPath);
|
||||
|
||||
// check if we have this already
|
||||
if (iter == s_effects.end())
|
||||
{
|
||||
ALuint buffer;
|
||||
ALuint source;
|
||||
soundData *data = new soundData;
|
||||
string path = fullPath;
|
||||
|
||||
checkALError("preloadEffect:init");
|
||||
#ifndef DISABLE_VORBIS
|
||||
if (isOGGFile(path.data()))
|
||||
{
|
||||
buffer = createBufferFromOGG(path.data());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
buffer = alutCreateBufferFromFile(path.data());
|
||||
checkALError("preloadEffect:createBufferFromFile");
|
||||
}
|
||||
|
||||
if (buffer == AL_NONE)
|
||||
{
|
||||
fprintf(stderr, "Error loading file: '%s'\n", path.data());
|
||||
alDeleteBuffers(1, &buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
alGenSources(1, &source);
|
||||
|
||||
if (checkALError("preloadEffect:alGenSources") != AL_NO_ERROR)
|
||||
{
|
||||
alDeleteBuffers(1, &buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
alSourcei(source, AL_BUFFER, buffer);
|
||||
checkALError("preloadEffect:alSourcei");
|
||||
|
||||
data->isLooped = false;
|
||||
data->buffer = buffer;
|
||||
data->source = source;
|
||||
|
||||
s_effects.insert(EffectsMap::value_type(fullPath, data));
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
|
||||
{
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
|
||||
EffectsMap::iterator iter = s_effects.find(fullPath);
|
||||
|
||||
if (iter != s_effects.end())
|
||||
{
|
||||
checkALError("unloadEffect:init");
|
||||
|
||||
alSourceStop(iter->second->source);
|
||||
checkALError("unloadEffect:alSourceStop");
|
||||
|
||||
alDeleteSources(1, &iter->second->source);
|
||||
checkALError("unloadEffect:DeletSources");
|
||||
|
||||
alDeleteBuffers(1, &iter->second->buffer);
|
||||
checkALError("unloadEffect:alDeleteBuffers");
|
||||
delete iter->second;
|
||||
|
||||
s_effects.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
|
||||
{
|
||||
ALint state;
|
||||
alGetSourcei(nSoundId, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PLAYING)
|
||||
alSourcePause(nSoundId);
|
||||
checkALError("pauseEffect:alSourcePause");
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseAllEffects()
|
||||
{
|
||||
EffectsMap::iterator iter = s_effects.begin();
|
||||
ALint state;
|
||||
while (iter != s_effects.end())
|
||||
{
|
||||
alGetSourcei(iter->second->source, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PLAYING)
|
||||
alSourcePause(iter->second->source);
|
||||
checkALError("pauseAllEffects:alSourcePause");
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
|
||||
{
|
||||
ALint state;
|
||||
alGetSourcei(nSoundId, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PAUSED)
|
||||
alSourcePlay(nSoundId);
|
||||
checkALError("resumeEffect:alSourcePlay");
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeAllEffects()
|
||||
{
|
||||
EffectsMap::iterator iter = s_effects.begin();
|
||||
ALint state;
|
||||
while (iter != s_effects.end())
|
||||
{
|
||||
alGetSourcei(iter->second->source, AL_SOURCE_STATE, &state);
|
||||
if (state == AL_PAUSED)
|
||||
alSourcePlay(iter->second->source);
|
||||
checkALError("resumeAllEffects:alSourcePlay");
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopAllEffects()
|
||||
{
|
||||
EffectsMap::iterator iter = s_effects.begin();
|
||||
|
||||
if (iter != s_effects.end())
|
||||
{
|
||||
checkALError("stopAllEffects:init");
|
||||
alSourceStop(iter->second->source);
|
||||
checkALError("stopAllEffects:alSourceStop");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -124,7 +124,7 @@
|
|||
<tool id="com.qnx.qcc.tool.compiler.2055720937" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
|
||||
<option id="com.qnx.qcc.option.compiler.shared.300244130" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.optlevel.1571383965" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1372664386" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1372664386" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.defines.413789958" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
|
||||
</option>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<option id="com.qnx.qcc.option.compiler.shared.657775440" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compile.debug.104541528" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.profile2.1160378025" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1414017107" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1414017107" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.defines.2021691363" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
|
||||
</option>
|
||||
|
@ -279,7 +279,7 @@
|
|||
<option id="com.qnx.qcc.option.compiler.shared.681217815" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compile.debug.757028752" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.coverage.751288313" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1285172306" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.1285172306" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.defines.1184848882" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
|
||||
</option>
|
||||
|
@ -433,7 +433,7 @@
|
|||
<option id="com.qnx.qcc.option.compiler.shared.1389473150" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compile.debug.2043094590" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.profile2.1074881151" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.101529550" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.101529550" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.defines.2135233180" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
|
||||
</option>
|
||||
|
@ -511,7 +511,7 @@
|
|||
<option id="com.qnx.qcc.option.compiler.shared.1502035671" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compile.debug.1133385028" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.coverage.1003392028" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.994172716" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.security.994172716" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
|
||||
<option id="com.qnx.qcc.option.compiler.defines.1430098685" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
|
||||
</option>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
TARGET = libcocosdenshion.so
|
||||
|
||||
INCLUDES += -I.. -I../include
|
||||
|
||||
SOURCES = ../emscripten/SimpleAudioEngine.cpp
|
||||
|
||||
COCOS_ROOT = ../..
|
||||
include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk
|
||||
|
||||
TARGET := $(LIB_DIR)/$(TARGET)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS)
|
||||
|
||||
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
|
|
@ -2,14 +2,30 @@ TARGET = libcocosdenshion.so
|
|||
|
||||
INCLUDES += -I.. -I../include
|
||||
|
||||
##Using OpenAL
|
||||
ifeq ($(OPENAL),1)
|
||||
SOURCES = ../linux/SimpleAudioEngineOpenAL.cpp
|
||||
SHAREDLIBS += -lopenal -lalut
|
||||
|
||||
ifneq ($(NOVORBIS),1)
|
||||
SHAREDLIBS += -logg -lvorbis -lvorbisfile
|
||||
else
|
||||
DEFINES += -DDISABLE_VORBIS
|
||||
endif
|
||||
|
||||
##Using FMOD
|
||||
else
|
||||
SOURCES = \
|
||||
../linux/SimpleAudioEngineFMOD.cpp \
|
||||
../linux/FmodAudioPlayer.cpp
|
||||
|
||||
ifeq ($(LBITS),64)
|
||||
INCLUDES += -I../third_party/fmod/lib64/api/inc
|
||||
else
|
||||
INCLUDES += -I../third_party/fmod/api/inc
|
||||
endif
|
||||
|
||||
SOURCES = ../linux/FmodAudioPlayer.cpp \
|
||||
../linux/SimpleAudioEngine.cpp \
|
||||
|
||||
endif
|
||||
|
||||
COCOS_ROOT = ../..
|
||||
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
|
||||
|
|
|
@ -0,0 +1,340 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Emulator">
|
||||
<macros>
|
||||
<stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/>
|
||||
<stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="a" artifactName="cocosdenshion" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280" name="Debug-Tizen-Emulator" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator">
|
||||
<folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280." name="/" resourcePath="">
|
||||
<toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator.2014007899" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.emulator">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1067387441" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
|
||||
<builder autoBuildTarget="all" buildPath="${workspace_loc:/cocosdenshion/Debug-Tizen-Emulator}" enableAutoBuild="true" id="org.tizen.nativecpp.target.sbi.gnu.builder.1261707379" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/>
|
||||
<tool command="i386-linux-gnueabi-ar.exe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.689316005" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.1533358351" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler">
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.1726560828" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debugging.level.1554282679" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debug.applog.1800109419" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.796499718" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-emulator-2.1.native_llvm31.i386.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1887202981" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value="../../include"/>
|
||||
<listOptionValue builtIn="false" value=""${COCOS_SRC}""/>
|
||||
<listOptionValue builtIn="false" value=""${COCOS_SRC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${COCOS_SRC}/kazmath/include""/>
|
||||
<listOptionValue builtIn="false" value=""${COCOS_SRC}/platform/tizen""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.140749819" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1250550482" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1942713160" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.preprocessor.def.67860287" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="TIZEN"/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.cpp.compiler.tizen.inputType.2085750802" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.263460224" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.819197061" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debugging.level.709891206" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debug.applog.1166511754" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/>
|
||||
<option id="sbi.gnu.c.compiler.option.1738169580" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-emulator-2.1.native_llvm31.i386.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.include.paths.821405214" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks.cpp.229730784" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.1139638882" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1131449804" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.31661523" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_DEBUG"/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.c.compiler.tizen.inputType.94264147" superClass="sbi.gnu.c.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.792552065" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.1518096171" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker">
|
||||
<option id="gnu.cpp.link.option.paths.43791296" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.181465864" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.165476943" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.517365643" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.po.compiler.254627421" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.8480881" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" moduleId="org.eclipse.cdt.core.settings" name="Debug-Tizen-Device">
|
||||
<macros>
|
||||
<stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/>
|
||||
<stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129" name="Debug-Tizen-Device" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device">
|
||||
<folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129." name="/" resourcePath="">
|
||||
<toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device.1011815399" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.debug.device">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.205106495" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
|
||||
<builder buildPath="${workspace_loc:/cocosdenshion/Debug-Tizen-Device}" id="org.tizen.nativecpp.target.sbi.gnu.builder.391616426" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/>
|
||||
<tool command="arm-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1946190238" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.806237946" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler">
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.1141078136" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debugging.level.412266760" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debug.applog.48357772" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog" value="true" valueType="boolean"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.738324429" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-device-2.1.native_llvm31.armel.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1372067183" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.1270990666" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.579636391" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.1644102691" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.preprocessor.def.1398462050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_DEBUG"/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1890676098" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.800077346" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.73052907" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debugging.level.641100997" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debug.applog.2000116514" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog" value="true" valueType="boolean"/>
|
||||
<option id="sbi.gnu.c.compiler.option.1751855743" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-device-2.1.native_llvm31.armel.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.include.paths.1641648644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks.cpp.356824867" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.843251170" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.2073478823" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1732125980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="_DEBUG"/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.c.compiler.tizen.inputType.565155338" superClass="sbi.gnu.c.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1321059471" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.517614783" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker">
|
||||
<option id="gnu.cpp.link.option.paths.316493253" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.557112687" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target arm-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../arm-linux-gnueabi-gcc-4.5/ -ccc-gcc-name arm-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -Xlinker --as-needed"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool command="arm-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1047247012" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1262361730" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1138371781" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.2045899075" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<macros>
|
||||
<stringMacro name="COCOS_ROOT" type="VALUE_PATH_ANY" value="../../.."/>
|
||||
<stringMacro name="COCOS_SRC" type="VALUE_PATH_ANY" value="${COCOS_ROOT}/cocos2dx"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.tizen.nativecpp.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecpp.buildArtefactType.staticLib" cleanCommand="rm -f" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084" name="Release" parent="org.tizen.nativecpp.config.sbi.gcc45.lib.release">
|
||||
<folderInfo id="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084." name="/" resourcePath="">
|
||||
<toolChain id="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release.1978438453" name="Tizen Native Toolchain" superClass="org.tizen.nativecpp.toolchain.sbi.gcc45.lib.release">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.216744962" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
|
||||
<builder buildPath="${workspace_loc:/cocosdenshion/Release}" id="org.tizen.nativecpp.target.sbi.gnu.builder.2102360604" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecpp.target.sbi.gnu.builder"/>
|
||||
<tool command="i386-linux-gnueabi-ar.exe" id="org.tizen.nativecpp.tool.sbi.gnu.archiver.1826014056" name="Archiver" superClass="org.tizen.nativecpp.tool.sbi.gnu.archiver"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.2111905100" name="C++ Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler">
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.1297088223" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debugging.level.459894355" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.debug.applog.849008186" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.cpp.compiler.option.debug.applog"/>
|
||||
<option id="sbi.gnu.cpp.compiler.option.74299026" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-emulator-2.1.native_llvm31.i386.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1217915212" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks.cpp.448934412" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp.1627502718" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp.138455270" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.cpp.compiler.tizen.inputType.1145329261" superClass="sbi.gnu.cpp.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool command="clang.exe" id="org.tizen.nativecpp.tool.sbi.gnu.c.compiler.19577634" name="C Compiler" superClass="org.tizen.nativecpp.tool.sbi.gnu.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1635131080" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debugging.level.220381318" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level"/>
|
||||
<option id="sbi.gnu.c.compiler.option.debug.applog.753089515" name="Enable application logging (-D_APP_LOG)" superClass="sbi.gnu.c.compiler.option.debug.applog"/>
|
||||
<option id="sbi.gnu.c.compiler.option.215142124" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="tizen-emulator-2.1.native_llvm31.i386.cpp.staticLib"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.include.paths.632347119" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks.cpp.1474026339" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.cpp" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value="osp-static"/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_inc.cpp.468493190" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.cpp" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
|
||||
<listOptionValue builtIn="false" value=""C:\tizen-sdk\library""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/osp""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.c.compiler.option.frameworks_cflags.cpp.1218800554" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu"/>
|
||||
<listOptionValue builtIn="false" value=" -fPIC"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
<inputType id="sbi.gnu.c.compiler.tizen.inputType.1344515254" superClass="sbi.gnu.c.compiler.tizen.inputType"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.59626261" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
|
||||
<tool command="clang++.exe" id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.563167499" name="C++ Linker" superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker">
|
||||
<option id="gnu.cpp.link.option.paths.618042967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
|
||||
</option>
|
||||
<option id="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp.620416347" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.cpp" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-target i386-tizen-linux-gnueabi -gcc-toolchain C:/tizen-sdk/tools/smart-build-interface/../i386-linux-gnueabi-gcc-4.5/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed"/>
|
||||
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool command="i386-linux-gnueabi-as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1990045494" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.879926948" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.po.compiler.1674758948" name="PO Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.po.compiler"/>
|
||||
<tool id="org.tizen.nativecpp.tool.sbi.edc.compiler.1792629643" name="EDC Resource Compiler" superClass="org.tizen.nativecpp.tool.sbi.edc.compiler"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="cocosdenshion.org.tizen.nativecpp.target.sbi.gcc45.lib.1874463476" name="Tizen Static Library" projectType="org.tizen.nativecpp.target.sbi.gcc45.lib"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.emulator.1855378280">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.release.2023052084">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="org.tizen.nativecpp.config.sbi.gcc45.lib.debug.device.1240851129">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.tizen.nativecommon.TizenGCCManagedMakePerProjectProfileCPP"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>cocosdenshion</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>sbi-make</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value>${workspace_loc:/cocosdenshion/Debug-Tizen-Emulator}</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
<value>clean</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.tizen.nativecpp.apichecker.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
<nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>src/OspPlayer.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/tizen/OspPlayer.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/OspPlayer.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/tizen/OspPlayer.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/SimpleAudioEngine.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/tizen/SimpleAudioEngine.cpp</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
|
@ -0,0 +1,246 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
Copyright (c) 2013 Lee, Jae-Hong
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "OspPlayer.h"
|
||||
|
||||
using namespace Tizen::Media;
|
||||
|
||||
OspPlayer::OspPlayer()
|
||||
: __pPlayer(null)
|
||||
, m_nSoundID(0)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
OspPlayer::~OspPlayer()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
result
|
||||
OspPlayer::Initialize()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
__pPlayer = new (std::nothrow) Player();
|
||||
if (__pPlayer == null)
|
||||
{
|
||||
AppLogException("pPlyaer = new (std::nothrow) Player() has failed");
|
||||
return E_FAILURE;
|
||||
}
|
||||
|
||||
r = __pPlayer->Construct(*this, null);
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Construct has failed\n");
|
||||
return E_FAILURE;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Open(const char* pFileName, unsigned int uId)
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
Close();
|
||||
|
||||
r = __pPlayer->OpenFile(pFileName);
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->OpenFile has failed\n");
|
||||
}
|
||||
|
||||
m_nSoundID = uId;
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Play(bool bLoop)
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
r = __pPlayer->SetLooping(bLoop);
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->SetLooping has failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
r = __pPlayer->Play();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Play has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Pause()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
r = __pPlayer->Pause();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Pause has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Stop()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
r = __pPlayer->Stop();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Stop has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Resume()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
if (__pPlayer->GetState() == PLAYER_STATE_PAUSED)
|
||||
{
|
||||
r = __pPlayer->Play();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Play has failed\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Rewind()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
r = __pPlayer->SeekTo(0);
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->SeekTo has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
OspPlayer::IsPlaying()
|
||||
{
|
||||
PlayerState state = __pPlayer->GetState();
|
||||
|
||||
return (state == PLAYER_STATE_PLAYING) ? true : false;
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::Close()
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
if (__pPlayer->GetState() == PLAYER_STATE_PLAYING)
|
||||
{
|
||||
r = __pPlayer->Stop();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Stop has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
r = __pPlayer->Close();
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->Close has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
OspPlayer::GetSoundID()
|
||||
{
|
||||
return m_nSoundID;
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::SetVolume(int volume)
|
||||
{
|
||||
result r = E_SUCCESS;
|
||||
|
||||
if (volume > 100 || volume < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
r = __pPlayer->SetVolume(volume);
|
||||
if (IsFailed(r))
|
||||
{
|
||||
AppLog("pPlayer->SetVolume has failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
OspPlayer::GetVolume()
|
||||
{
|
||||
return __pPlayer->GetVolume();
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerOpened(result r)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerEndOfClip(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerBuffering(int percent)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerErrorOccurred(Tizen::Media::PlayerErrorReason r)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerInterrupted(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerReleased(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerSeekCompleted(result r)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
OspPlayer::OnPlayerAudioFocusChanged(void)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
Copyright (c) 2013 Lee, Jae-Hong
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _OSP_PLAYER_H_
|
||||
#define _OSP_PLAYER_H_
|
||||
|
||||
#include <FMedia.h>
|
||||
|
||||
class OspPlayer : public Tizen::Media::IPlayerEventListener
|
||||
{
|
||||
public:
|
||||
OspPlayer();
|
||||
~OspPlayer();
|
||||
|
||||
result Initialize();
|
||||
void Open(const char* pFileName, unsigned int uId);
|
||||
void Play(bool bLoop);
|
||||
void Pause();
|
||||
void Stop();
|
||||
void Resume();
|
||||
void Rewind();
|
||||
bool IsPlaying();
|
||||
void SetVolume(int volume);
|
||||
int GetVolume();
|
||||
void Close();
|
||||
unsigned int GetSoundID();
|
||||
|
||||
protected:
|
||||
void OnPlayerOpened(result r);
|
||||
void OnPlayerEndOfClip(void);
|
||||
void OnPlayerBuffering(int percent);
|
||||
void OnPlayerErrorOccurred(Tizen::Media::PlayerErrorReason r);
|
||||
void OnPlayerInterrupted(void);
|
||||
void OnPlayerReleased(void);
|
||||
void OnPlayerSeekCompleted(result r);
|
||||
void OnPlayerAudioFocusChanged(void);
|
||||
|
||||
private:
|
||||
Tizen::Media::Player* __pPlayer;
|
||||
unsigned int m_nSoundID;
|
||||
};
|
||||
|
||||
#endif // _OSP_PLAYER_H_
|
|
@ -0,0 +1,293 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
Copyright (c) 2013 Lee, Jae-Hong
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "OspPlayer.h"
|
||||
#include "cocos2d.h"
|
||||
#include <map>
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace std;
|
||||
|
||||
namespace CocosDenshion {
|
||||
|
||||
typedef map<unsigned int, OspPlayer *> EffectList;
|
||||
typedef pair<unsigned int, OspPlayer *> Effect;
|
||||
|
||||
static std::string _FullPath(const char * szPath);
|
||||
static unsigned int _Hash(const char *key);
|
||||
|
||||
#define BREAK_IF(cond) if (cond) break;
|
||||
|
||||
static EffectList& sharedList()
|
||||
{
|
||||
static EffectList s_List;
|
||||
return s_List;
|
||||
}
|
||||
|
||||
static OspPlayer& sharedMusic()
|
||||
{
|
||||
static OspPlayer s_Music;
|
||||
return s_Music;
|
||||
}
|
||||
|
||||
SimpleAudioEngine::SimpleAudioEngine()
|
||||
{
|
||||
}
|
||||
|
||||
SimpleAudioEngine::~SimpleAudioEngine()
|
||||
{
|
||||
}
|
||||
|
||||
SimpleAudioEngine* SimpleAudioEngine::sharedEngine()
|
||||
{
|
||||
static SimpleAudioEngine s_SharedEngine;
|
||||
return &s_SharedEngine;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::end()
|
||||
{
|
||||
sharedMusic().Close();
|
||||
|
||||
EffectList::iterator p = sharedList().begin();
|
||||
while (p != sharedList().end())
|
||||
{
|
||||
delete p->second;
|
||||
p->second = NULL;
|
||||
p++;
|
||||
}
|
||||
sharedList().clear();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
if (!pszFilePath)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sharedMusic().Open(_FullPath(pszFilePath).c_str(), _Hash(pszFilePath));
|
||||
sharedMusic().Play(bLoop);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
|
||||
{
|
||||
if (bReleaseData)
|
||||
{
|
||||
sharedMusic().Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedMusic().Stop();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseBackgroundMusic()
|
||||
{
|
||||
sharedMusic().Pause();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeBackgroundMusic()
|
||||
{
|
||||
sharedMusic().Resume();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::rewindBackgroundMusic()
|
||||
{
|
||||
sharedMusic().Rewind();
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::willPlayBackgroundMusic()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SimpleAudioEngine::isBackgroundMusicPlaying()
|
||||
{
|
||||
return sharedMusic().IsPlaying();
|
||||
}
|
||||
|
||||
float SimpleAudioEngine::getBackgroundMusicVolume()
|
||||
{
|
||||
return float(sharedMusic().GetVolume()) / 100.f;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
|
||||
{
|
||||
sharedMusic().SetVolume(int(volume * 100));
|
||||
}
|
||||
|
||||
float SimpleAudioEngine::getEffectsVolume()
|
||||
{
|
||||
EffectList::iterator iter;
|
||||
iter = sharedList().begin();
|
||||
if (iter != sharedList().end())
|
||||
{
|
||||
return float(iter->second->GetVolume()) / 100.f;
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setEffectsVolume(float volume)
|
||||
{
|
||||
EffectList::iterator iter;
|
||||
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
|
||||
{
|
||||
iter->second->SetVolume(int(volume * 100));
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
unsigned int nRet = _Hash(pszFilePath);
|
||||
|
||||
preloadEffect(pszFilePath);
|
||||
|
||||
EffectList::iterator p = sharedList().find(nRet);
|
||||
if (p != sharedList().end())
|
||||
{
|
||||
p->second->Play(bLoop);
|
||||
}
|
||||
|
||||
return nRet;
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
|
||||
{
|
||||
EffectList::iterator p = sharedList().find(nSoundId);
|
||||
if (p != sharedList().end())
|
||||
{
|
||||
p->second->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
||||
{
|
||||
int nRet = 0;
|
||||
do
|
||||
{
|
||||
BREAK_IF(! pszFilePath);
|
||||
|
||||
nRet = _Hash(pszFilePath);
|
||||
|
||||
BREAK_IF(sharedList().end() != sharedList().find(nRet));
|
||||
|
||||
sharedList().insert(Effect(nRet, new (std::nothrow) OspPlayer()));
|
||||
OspPlayer * pPlayer = sharedList()[nRet];
|
||||
pPlayer->Open(_FullPath(pszFilePath).c_str(), nRet);
|
||||
|
||||
BREAK_IF(nRet == pPlayer->GetSoundID());
|
||||
|
||||
sharedList().erase(nRet);
|
||||
nRet = 0;
|
||||
}
|
||||
while (0);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
|
||||
{
|
||||
unsigned nId = _Hash(pszFilePath);
|
||||
|
||||
EffectList::iterator p = sharedList().find(nId);
|
||||
if (p != sharedList().end())
|
||||
{
|
||||
delete p->second;
|
||||
p->second = NULL;
|
||||
sharedList().erase(nId);
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
|
||||
{
|
||||
EffectList::iterator p = sharedList().find(nSoundId);
|
||||
if (p != sharedList().end())
|
||||
{
|
||||
p->second->Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseAllEffects()
|
||||
{
|
||||
EffectList::iterator iter;
|
||||
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
|
||||
{
|
||||
iter->second->Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
|
||||
{
|
||||
EffectList::iterator p = sharedList().find(nSoundId);
|
||||
if (p != sharedList().end())
|
||||
{
|
||||
p->second->Resume();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::resumeAllEffects()
|
||||
{
|
||||
EffectList::iterator iter;
|
||||
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
|
||||
{
|
||||
iter->second->Resume();
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopAllEffects()
|
||||
{
|
||||
EffectList::iterator iter;
|
||||
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
|
||||
{
|
||||
iter->second->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// static function
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::string _FullPath(const char * szPath)
|
||||
{
|
||||
return CCFileUtils::sharedFileUtils()->fullPathForFilename(szPath);
|
||||
}
|
||||
|
||||
unsigned int _Hash(const char *key)
|
||||
{
|
||||
unsigned int len = strlen(key);
|
||||
const char *end=key+len;
|
||||
unsigned int hash;
|
||||
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (unsigned int) (unsigned char) toupper(*key);
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
}
|
|
@ -74,7 +74,7 @@ void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sharedMusic().Open(_FullPath(pszFilePath).c_str(), _Hash(pszFilePath));
|
||||
sharedMusic().Play((bLoop) ? -1 : 1);
|
||||
}
|
||||
|
@ -161,6 +161,7 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
|||
|
||||
BREAK_IF(nRet == pPlayer->GetSoundID());
|
||||
|
||||
delete pPlayer;
|
||||
sharedList().erase(nRet);
|
||||
nRet = 0;
|
||||
} while (0);
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
* Need to figure out how to get correct screen resolutions consistently.
|
||||
|
||||
* Touch handler screwed up after TouchesTest? MenuTest? (TestCpp sample)
|
||||
|
||||
* TTF Font rendering is slow and seems to wrap around by a few pixels
|
||||
horizontally. Need to investigate here, but I suspect the right answer is to
|
||||
offload font rendering to an offscreen canvas and let the browser handle it.
|
||||
Potentially creates new challenges in packaging which would need to be solved
|
||||
somehow.
|
||||
|
||||
|
||||
|
||||
###
|
||||
DONE:
|
||||
###
|
||||
|
||||
* Need to switch to server-side buffers in
|
||||
- cocos2dx/draw_nodes/CCDrawingPrimitives
|
||||
|
||||
* Need to compile with -O2 -- possible -s VERBOSE=1 will give a clue?
|
||||
|
||||
* SchedulerTest crashes
|
||||
- cocos2d::CCNode::boundingBox()
|
||||
|
||||
* Parallax Test crashes
|
||||
- cocos2d::CCAtlasNode::calculateMaxItems()
|
||||
|
||||
* Particle Test crashes
|
||||
- TIFFClientOpen not a function. Looks like we need to build and link in libtiff.
|
||||
|
||||
* cocos2d::CCAtlasNode::calculateMaxItems() throwing an error; related to
|
||||
CCTextureAtlas? Preventing particle test from working.
|
||||
|
||||
* Need to switch to server-side buffers in
|
||||
- cocos2dx/draw_nodes/CCDrawNode.cpp -- Think this is fixed by undef CC_TEXTURE_ATLAS_USE_VAO?
|
||||
- cocos2dx/particle_nodes/CCParticleSystemQuad.cpp -- Think this is fixed by CC_REBIND_INDICES_BUFFER?
|
||||
- cocos2dx/textures/CCTextureAtlas.cpp -- Think this works already.
|
||||
|
||||
* Layer Test crashes
|
||||
- cocos2d::CCLabelBMFont::create(char const*, char const*, float, cocos2d::CCTextAlignment, cocos2d::CCPoint)
|
||||
|
||||
* IntervalTest crashes
|
||||
- cocos2d::CCLabelBMFont::create(char const*, char const*, float, cocos2d::CCTextAlignment, cocos2d::CCPoint)
|
||||
|
||||
* TileMap Test crashes
|
||||
- void CCNode::insertChild(CCNode* child, int z)
|
||||
|
||||
* LabelTest crashes
|
||||
- cocos2d::CCAtlasNode::calculateMaxItems()
|
||||
|
||||
* ZwoptexTest crashes.
|
||||
- ZwoptexGenericTest::onEnter()
|
||||
|
||||
* ChipmunkTest crashes:
|
||||
Aborting due to Chipmunk error: Moment of Inertia must be positive and non-zero.
|
||||
Failed condition: moment > 0.0f
|
||||
Source:../src/cpBody.c:151
|
||||
|
||||
* Add linkage to libjpeg to get RenderTexture test to work.
|
||||
|
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
PLATFORM = linux
|
||||
PLATFORM ?= linux
|
||||
|
||||
define MAKE_TARGET
|
||||
+$(MAKE) -C external/chipmunk/proj.$(PLATFORM) $@
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
PLATFORM = emscripten
|
||||
|
||||
define MAKE_TARGET
|
||||
+$(MAKE) -C external/chipmunk/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C external/Box2D/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C CocosDenshion/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C extensions/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C cocos2dx/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C scripting/lua/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C samples/Cpp/HelloCpp/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C samples/Cpp/TestCpp/proj.$(PLATFORM) $@
|
||||
+$(MAKE) -C samples/Cpp/SimpleGame/proj.$(PLATFORM) $@
|
||||
endef
|
||||
|
||||
|
||||
# Haven't yet got the lua projects working.
|
||||
# +$(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) $@
|
||||
# +$(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) $@
|
||||
|
||||
all:
|
||||
$(call MAKE_TARGET,all)
|
||||
|
||||
clean:
|
||||
$(call MAKE_TARGET,clean)
|
||||
|
||||
.PHONY: all clean
|
|
@ -1,6 +1,8 @@
|
|||
cocos2d-x
|
||||
=========
|
||||
|
||||
[![Build Status](https://travis-ci.org/cocos2d/cocos2d-x.png?branch=master)](https://travis-ci.org/cocos2d/cocos2d-x)
|
||||
|
||||
[cocos2d-x][1] is a multi-platform 2D game framework in C++, branched on
|
||||
[cocos2d-iphone][2] and licensed under MIT. The master branch on github uses
|
||||
OpenGL ES 2.0 rendering, while the old gles11 branch uses OpenGL ES 1.1
|
||||
|
@ -16,12 +18,16 @@ Supported Platforms
|
|||
http://github.com/cocos2d-x/cocos2dx-win8.
|
||||
* Bada: cocos2d-x v1.x supports Bada SDK 1.0 & 2.0. Bada support was
|
||||
deprecated since cocos2d-x v2.0.
|
||||
* BlackBerry: stable, contribued by staffs in RIM, supports Playbook & BB10.
|
||||
* BlackBerry: stable, contributed by staffs in RIM, supports Playbook & BB10.
|
||||
* Marmalade: stable since cocos2d-x v0.11.0, contributed by Marmalade's staff.
|
||||
* Native Client (NaCl): contributed by the Native Client authors.
|
||||
* Windows: stable, well tested on WinXP/Vista/Win7. Please upgrde the drive
|
||||
of your video card if you meet problems on OpenGL functions
|
||||
* Linux: support but not very stable.
|
||||
* Emscripten: Alpha-level. Most features implemented. Needs testing.
|
||||
Contributed by Zynga staff.
|
||||
* Tizen: Experimental. Essential features implemented. Needs more implementing.
|
||||
Contributed by Lee, Jae-Hong.
|
||||
|
||||
You can visit our continuous integration system http://ci.cocos2d-x.org to
|
||||
check the stability on edge version.
|
||||
|
|
|
@ -14,6 +14,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "cocos2dx\proj
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "scripting\lua\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
|
||||
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
|
||||
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
|
||||
EndProjectSection
|
||||
|
@ -30,12 +31,17 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\Cpp\TestCpp\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "samples\Lua\HelloLua\proj.win32\HelloLua.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "samples\Lua\TestLua\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
|
||||
{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}
|
||||
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
|
||||
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
|
||||
{929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116}
|
||||
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -97,9 +103,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssetsManagerTest", "sample
|
|||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
|
||||
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
|
@ -196,4 +199,7 @@ Global
|
|||
{39379840-825A-45A0-B363-C09FFEF864BD} = {68B43009-A1C1-41B2-8AF7-77278B70E897}
|
||||
{9A17D9A4-4B11-4E32-94F6-895FF4909EC5} = {68B43009-A1C1-41B2-8AF7-77278B70E897}
|
||||
EndGlobalSection
|
||||
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
|
||||
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -10,6 +10,7 @@ LOCAL_SRC_FILES := \
|
|||
CCConfiguration.cpp \
|
||||
CCScheduler.cpp \
|
||||
CCCamera.cpp \
|
||||
ccFPSImages.c \
|
||||
actions/CCAction.cpp \
|
||||
actions/CCActionCamera.cpp \
|
||||
actions/CCActionCatmullRom.cpp \
|
||||
|
@ -35,6 +36,7 @@ cocoa/CCSet.cpp \
|
|||
cocoa/CCString.cpp \
|
||||
cocoa/CCZone.cpp \
|
||||
cocoa/CCArray.cpp \
|
||||
cocoa/CCDataVisitor.cpp \
|
||||
cocos2d.cpp \
|
||||
CCDirector.cpp \
|
||||
draw_nodes/CCDrawingPrimitives.cpp \
|
||||
|
@ -121,11 +123,14 @@ support/tinyxml2/tinyxml2.cpp \
|
|||
support/zip_support/ZipUtils.cpp \
|
||||
support/zip_support/ioapi.cpp \
|
||||
support/zip_support/unzip.cpp \
|
||||
support/component/CCComponent.cpp \
|
||||
support/component/CCComponentContainer.cpp \
|
||||
text_input_node/CCIMEDispatcher.cpp \
|
||||
text_input_node/CCTextFieldTTF.cpp \
|
||||
textures/CCTexture2D.cpp \
|
||||
textures/CCTextureAtlas.cpp \
|
||||
textures/CCTextureCache.cpp \
|
||||
textures/CCTextureETC.cpp \
|
||||
textures/CCTexturePVR.cpp \
|
||||
tilemap_parallax_nodes/CCParallaxNode.cpp \
|
||||
tilemap_parallax_nodes/CCTMXLayer.cpp \
|
||||
|
@ -142,21 +147,19 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
|
|||
$(LOCAL_PATH)/kazmath/include \
|
||||
$(LOCAL_PATH)/platform/android
|
||||
|
||||
|
||||
LOCAL_EXPORT_LDLIBS := -llog\
|
||||
-lz \
|
||||
-lGLESv2
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/kazmath/include \
|
||||
$(LOCAL_PATH)/platform/android
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv2 \
|
||||
-lEGL \
|
||||
-llog \
|
||||
-lz
|
||||
|
||||
LOCAL_EXPORT_LDLIBS := -lGLESv2 \
|
||||
-llog \
|
||||
-lz
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libpng_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libxml2_static
|
||||
|
|
|
@ -27,11 +27,17 @@ THE SOFTWARE.
|
|||
#include "ccMacros.h"
|
||||
#include "ccConfig.h"
|
||||
#include <string.h>
|
||||
#include "cocoa/CCDictionary.h"
|
||||
#include "cocoa/CCInteger.h"
|
||||
#include "cocoa/CCBool.h"
|
||||
#include "cocos2d.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
||||
CCConfiguration* CCConfiguration::s_gSharedConfiguration = NULL;
|
||||
|
||||
CCConfiguration::CCConfiguration(void)
|
||||
|
@ -45,57 +51,96 @@ CCConfiguration::CCConfiguration(void)
|
|||
, m_nMaxSamplesAllowed(0)
|
||||
, m_nMaxTextureUnits(0)
|
||||
, m_pGlExtensions(NULL)
|
||||
, m_pValueDict(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
bool CCConfiguration::init(void)
|
||||
{
|
||||
CCLOG("cocos2d: GL_VENDOR: %s", glGetString(GL_VENDOR));
|
||||
CCLOG("cocos2d: GL_RENDERER: %s", glGetString(GL_RENDERER));
|
||||
CCLOG("cocos2d: GL_VERSION: %s", glGetString(GL_VERSION));
|
||||
m_pValueDict = CCDictionary::create();
|
||||
m_pValueDict->retain();
|
||||
|
||||
m_pValueDict->setObject( CCString::create( cocos2dVersion() ), "cocos2d.x.version");
|
||||
|
||||
|
||||
#if CC_ENABLE_PROFILERS
|
||||
m_pValueDict->setObject( CCBool::create(true), "cocos2d.x.compiled_with_profiler");
|
||||
#else
|
||||
m_pValueDict->setObject( CCBool::create(false), "cocos2d.x.compiled_with_profiler");
|
||||
#endif
|
||||
|
||||
#if CC_ENABLE_GL_STATE_CACHE == 0
|
||||
m_pValueDict->setObject( CCBool::create(false), "cocos2d.x.compiled_with_gl_state_cache");
|
||||
#else
|
||||
m_pValueDict->setObject( CCBool::create(true), "cocos2d.x.compiled_with_gl_state_cache");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CCConfiguration::~CCConfiguration(void)
|
||||
{
|
||||
m_pValueDict->release();
|
||||
}
|
||||
|
||||
void CCConfiguration::dumpInfo(void) const
|
||||
{
|
||||
// Dump
|
||||
CCPrettyPrinter visitor(0);
|
||||
m_pValueDict->acceptVisitor(visitor);
|
||||
|
||||
CCLOG("%s", visitor.getResult().c_str());
|
||||
|
||||
|
||||
// And Dump some warnings as well
|
||||
#if CC_ENABLE_PROFILERS
|
||||
CCLOG("cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from ccConfig.h)");
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#if CC_ENABLE_GL_STATE_CACHE == 0
|
||||
CCLOG("");
|
||||
CCLOG("cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from ccConfig.h)");
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CCConfiguration::gatherGPUInfo()
|
||||
{
|
||||
m_pValueDict->setObject( CCString::create( (const char*)glGetString(GL_VENDOR)), "gl.vendor");
|
||||
m_pValueDict->setObject( CCString::create( (const char*)glGetString(GL_RENDERER)), "gl.renderer");
|
||||
m_pValueDict->setObject( CCString::create( (const char*)glGetString(GL_VERSION)), "gl.version");
|
||||
|
||||
m_pGlExtensions = (char *)glGetString(GL_EXTENSIONS);
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_nMaxTextureSize);
|
||||
m_pValueDict->setObject( CCInteger::create((int)m_nMaxTextureSize), "gl.max_texture_size");
|
||||
|
||||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &m_nMaxTextureUnits);
|
||||
m_pValueDict->setObject( CCInteger::create((int)m_nMaxTextureUnits), "gl.max_texture_units");
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
glGetIntegerv(GL_MAX_SAMPLES_APPLE, &m_nMaxSamplesAllowed);
|
||||
m_pValueDict->setObject( CCInteger::create((int)m_nMaxSamplesAllowed), "gl.max_samples_allowed");
|
||||
#endif
|
||||
|
||||
m_bSupportsPVRTC = checkForGLExtension("GL_IMG_texture_compression_pvrtc");
|
||||
m_pValueDict->setObject( CCBool::create(m_bSupportsPVRTC), "gl.supports_PVRTC");
|
||||
|
||||
m_bSupportsNPOT = true;
|
||||
m_pValueDict->setObject( CCBool::create(m_bSupportsNPOT), "gl.supports_NPOT");
|
||||
|
||||
m_bSupportsBGRA8888 = checkForGLExtension("GL_IMG_texture_format_BGRA888");
|
||||
m_pValueDict->setObject( CCBool::create(m_bSupportsBGRA8888), "gl.supports_BGRA8888");
|
||||
|
||||
m_bSupportsDiscardFramebuffer = checkForGLExtension("GL_EXT_discard_framebuffer");
|
||||
m_pValueDict->setObject( CCBool::create(m_bSupportsDiscardFramebuffer), "gl.supports_discard_framebuffer");
|
||||
|
||||
m_bSupportsShareableVAO = checkForGLExtension("vertex_array_object");
|
||||
|
||||
CCLOG("cocos2d: GL_MAX_TEXTURE_SIZE: %d", m_nMaxTextureSize);
|
||||
CCLOG("cocos2d: GL_MAX_TEXTURE_UNITS: %d",m_nMaxTextureUnits);
|
||||
CCLOG("cocos2d: GL supports PVRTC: %s", (m_bSupportsPVRTC ? "YES" : "NO"));
|
||||
CCLOG("cocos2d: GL supports BGRA8888 textures: %s", (m_bSupportsBGRA8888 ? "YES" : "NO"));
|
||||
CCLOG("cocos2d: GL supports NPOT textures: %s", (m_bSupportsNPOT ? "YES" : "NO"));
|
||||
CCLOG("cocos2d: GL supports discard_framebuffer: %s", (m_bSupportsDiscardFramebuffer ? "YES" : "NO"));
|
||||
CCLOG("cocos2d: GL supports shareable VAO: %s", (m_bSupportsShareableVAO ? "YES" : "NO") );
|
||||
|
||||
bool CC_UNUSED bEnableProfilers = false;
|
||||
|
||||
#if CC_ENABLE_PROFILERS
|
||||
bEnableProfilers = true;
|
||||
#else
|
||||
bEnableProfilers = false;
|
||||
#endif
|
||||
CCLOG("cocos2d: compiled with Profiling Support: %s",
|
||||
bEnableProfilers ? "YES - *** Disable it when you finish profiling ***" : "NO");
|
||||
|
||||
#if CC_ENABLE_GL_STATE_CACHE == 0
|
||||
CCLOG("");
|
||||
CCLOG("cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it by editing ccConfig.h");
|
||||
printf("\n");
|
||||
#endif
|
||||
m_pValueDict->setObject( CCBool::create(m_bSupportsShareableVAO), "gl.supports_vertex_array_object");
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CCConfiguration* CCConfiguration::sharedConfiguration(void)
|
||||
|
@ -114,7 +159,7 @@ void CCConfiguration::purgeConfiguration(void)
|
|||
CC_SAFE_RELEASE_NULL(s_gSharedConfiguration);
|
||||
}
|
||||
|
||||
bool CCConfiguration::checkForGLExtension(const string &searchName)
|
||||
bool CCConfiguration::checkForGLExtension(const string &searchName) const
|
||||
{
|
||||
bool bRet = false;
|
||||
const char *kSearchName = searchName.c_str();
|
||||
|
@ -128,4 +173,161 @@ bool CCConfiguration::checkForGLExtension(const string &searchName)
|
|||
return bRet;
|
||||
}
|
||||
|
||||
//
|
||||
// getters for specific variables.
|
||||
// Mantained for backward compatiblity reasons only.
|
||||
//
|
||||
int CCConfiguration::getMaxTextureSize(void) const
|
||||
{
|
||||
return m_nMaxTextureSize;
|
||||
}
|
||||
|
||||
int CCConfiguration::getMaxModelviewStackDepth(void) const
|
||||
{
|
||||
return m_nMaxModelviewStackDepth;
|
||||
}
|
||||
|
||||
int CCConfiguration::getMaxTextureUnits(void) const
|
||||
{
|
||||
return m_nMaxTextureUnits;
|
||||
}
|
||||
|
||||
bool CCConfiguration::supportsNPOT(void) const
|
||||
{
|
||||
return m_bSupportsNPOT;
|
||||
}
|
||||
|
||||
bool CCConfiguration::supportsPVRTC(void) const
|
||||
{
|
||||
return m_bSupportsPVRTC;
|
||||
}
|
||||
|
||||
bool CCConfiguration::supportsBGRA8888(void) const
|
||||
{
|
||||
return m_bSupportsBGRA8888;
|
||||
}
|
||||
|
||||
bool CCConfiguration::supportsDiscardFramebuffer(void) const
|
||||
{
|
||||
return m_bSupportsDiscardFramebuffer;
|
||||
}
|
||||
|
||||
bool CCConfiguration::supportsShareableVAO(void) const
|
||||
{
|
||||
return m_bSupportsShareableVAO;
|
||||
}
|
||||
|
||||
//
|
||||
// generic getters for properties
|
||||
//
|
||||
const char *CCConfiguration::getCString( const char *key, const char *default_value ) const
|
||||
{
|
||||
CCObject *ret = m_pValueDict->objectForKey(key);
|
||||
if( ret ) {
|
||||
if( CCString *str=dynamic_cast<CCString*>(ret) )
|
||||
return str->getCString();
|
||||
|
||||
CCAssert(false, "Key found, but from different type");
|
||||
}
|
||||
|
||||
// XXX: Should it throw an exception ?
|
||||
return default_value;
|
||||
}
|
||||
|
||||
/** returns the value of a given key as a boolean */
|
||||
bool CCConfiguration::getBool( const char *key, bool default_value ) const
|
||||
{
|
||||
CCObject *ret = m_pValueDict->objectForKey(key);
|
||||
if( ret ) {
|
||||
if( CCBool *boolobj=dynamic_cast<CCBool*>(ret) )
|
||||
return boolobj->getValue();
|
||||
if( CCString *strobj=dynamic_cast<CCString*>(ret) )
|
||||
return strobj->boolValue();
|
||||
CCAssert(false, "Key found, but from different type");
|
||||
}
|
||||
|
||||
// XXX: Should it throw an exception ?
|
||||
return default_value;
|
||||
}
|
||||
|
||||
/** returns the value of a given key as a double */
|
||||
double CCConfiguration::getNumber( const char *key, double default_value ) const
|
||||
{
|
||||
CCObject *ret = m_pValueDict->objectForKey(key);
|
||||
if( ret ) {
|
||||
if( CCDouble *obj=dynamic_cast<CCDouble*>(ret) )
|
||||
return obj->getValue();
|
||||
|
||||
if( CCInteger *obj=dynamic_cast<CCInteger*>(ret) )
|
||||
return obj->getValue();
|
||||
|
||||
if( CCString *strobj=dynamic_cast<CCString*>(ret) )
|
||||
return strobj->doubleValue();
|
||||
|
||||
CCAssert(false, "Key found, but from different type");
|
||||
}
|
||||
|
||||
// XXX: Should it throw an exception ?
|
||||
return default_value;
|
||||
}
|
||||
|
||||
CCObject * CCConfiguration::getObject( const char *key ) const
|
||||
{
|
||||
return m_pValueDict->objectForKey(key);
|
||||
}
|
||||
|
||||
void CCConfiguration::setObject( const char *key, CCObject *value )
|
||||
{
|
||||
m_pValueDict->setObject(value, key);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// load file
|
||||
//
|
||||
void CCConfiguration::loadConfigFile( const char *filename )
|
||||
{
|
||||
CCDictionary *dict = CCDictionary::createWithContentsOfFile(filename);
|
||||
CCAssert(dict, "cannot create dictionary");
|
||||
|
||||
// search for metadata
|
||||
bool metadata_ok = false;
|
||||
CCObject *metadata = dict->objectForKey("metadata");
|
||||
if( metadata && dynamic_cast<CCDictionary*>(metadata) ) {
|
||||
CCObject *format_o = static_cast<CCDictionary*>(metadata)->objectForKey("format");
|
||||
|
||||
// XXX: cocos2d-x returns CCStrings when importing from .plist. This bug will be addressed in cocos2d-x v3.x
|
||||
if( format_o && dynamic_cast<CCString*>(format_o) ) {
|
||||
int format = static_cast<CCString*>(format_o)->intValue();
|
||||
|
||||
// Support format: 1
|
||||
if( format == 1 ) {
|
||||
metadata_ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( ! metadata_ok ) {
|
||||
CCLOG("Invalid config format for file: %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
CCObject *data = dict->objectForKey("data");
|
||||
if( !data || !dynamic_cast<CCDictionary*>(data) ) {
|
||||
CCLOG("Expected 'data' dict, but not found. Config file: %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add all keys in the existing dictionary
|
||||
CCDictionary *data_dict = static_cast<CCDictionary*>(data);
|
||||
CCDictElement* element;
|
||||
CCDICT_FOREACH(data_dict, element)
|
||||
{
|
||||
if( ! m_pValueDict->objectForKey( element->getStrKey() ) )
|
||||
m_pValueDict->setObject(element->getObject(), element->getStrKey() );
|
||||
else
|
||||
CCLOG("Key already present. Ignoring '%s'", element->getStrKey() );
|
||||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -28,10 +28,22 @@ THE SOFTWARE.
|
|||
|
||||
#include "cocoa/CCObject.h"
|
||||
#include "CCGL.h"
|
||||
#include "cocoa/CCString.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
typedef enum _ccConfigurationType {
|
||||
ConfigurationError,
|
||||
ConfigurationString,
|
||||
ConfigurationInt,
|
||||
ConfigurationDouble,
|
||||
ConfigurationBoolean
|
||||
} ccConfigurationType;
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup global
|
||||
* @{
|
||||
|
@ -45,78 +57,86 @@ class CC_DLL CCConfiguration : public CCObject
|
|||
public:
|
||||
/** returns a shared instance of CCConfiguration */
|
||||
static CCConfiguration *sharedConfiguration(void);
|
||||
|
||||
/** purge the shared instance of CCConfiguration */
|
||||
static void purgeConfiguration(void);
|
||||
public:
|
||||
|
||||
|
||||
public:
|
||||
|
||||
virtual ~CCConfiguration(void);
|
||||
|
||||
/** OpenGL Max texture size. */
|
||||
inline int getMaxTextureSize(void)
|
||||
{
|
||||
return m_nMaxTextureSize;
|
||||
}
|
||||
|
||||
int getMaxTextureSize(void) const;
|
||||
|
||||
/** OpenGL Max Modelview Stack Depth. */
|
||||
inline int getMaxModelviewStackDepth(void)
|
||||
{
|
||||
return m_nMaxModelviewStackDepth;
|
||||
}
|
||||
int getMaxModelviewStackDepth(void) const;
|
||||
|
||||
/** returns the maximum texture units
|
||||
@since v2.0.0
|
||||
*/
|
||||
inline int getMaxTextureUnits(void)
|
||||
{
|
||||
return m_nMaxTextureUnits;
|
||||
}
|
||||
int getMaxTextureUnits(void) const;
|
||||
|
||||
/** Whether or not the GPU supports NPOT (Non Power Of Two) textures.
|
||||
OpenGL ES 2.0 already supports NPOT (iOS).
|
||||
|
||||
@since v0.99.2
|
||||
*/
|
||||
inline bool supportsNPOT(void)
|
||||
{
|
||||
return m_bSupportsNPOT;
|
||||
}
|
||||
bool supportsNPOT(void) const;
|
||||
|
||||
/** Whether or not PVR Texture Compressed is supported */
|
||||
inline bool supportsPVRTC(void)
|
||||
{
|
||||
return m_bSupportsPVRTC;
|
||||
}
|
||||
bool supportsPVRTC(void) const;
|
||||
|
||||
/** Whether or not BGRA8888 textures are supported.
|
||||
@since v0.99.2
|
||||
*/
|
||||
inline bool supportsBGRA8888(void)
|
||||
{
|
||||
return m_bSupportsBGRA8888;
|
||||
}
|
||||
bool supportsBGRA8888(void) const;
|
||||
|
||||
/** Whether or not glDiscardFramebufferEXT is supported
|
||||
@since v0.99.2
|
||||
*/
|
||||
inline bool supportsDiscardFramebuffer(void)
|
||||
{
|
||||
return m_bSupportsDiscardFramebuffer;
|
||||
}
|
||||
bool supportsDiscardFramebuffer(void) const;
|
||||
|
||||
/** Whether or not shareable VAOs are supported.
|
||||
@since v2.0.0
|
||||
*/
|
||||
inline bool supportsShareableVAO(void)
|
||||
{
|
||||
return m_bSupportsShareableVAO;
|
||||
}
|
||||
bool supportsShareableVAO(void) const;
|
||||
|
||||
/** returns whether or not an OpenGL is supported */
|
||||
bool checkForGLExtension(const std::string &searchName);
|
||||
bool checkForGLExtension(const std::string &searchName) const;
|
||||
|
||||
bool init(void);
|
||||
|
||||
/** returns the value of a given key as a string.
|
||||
If the key is not found, it will return the default value */
|
||||
const char* getCString( const char *key, const char *default_value=NULL ) const;
|
||||
|
||||
/** returns the value of a given key as a boolean.
|
||||
If the key is not found, it will return the default value */
|
||||
bool getBool( const char *key, bool default_value=false ) const;
|
||||
|
||||
/** returns the value of a given key as a double.
|
||||
If the key is not found, it will return the default value */
|
||||
double getNumber( const char *key, double default_value=0.0 ) const;
|
||||
|
||||
/** returns the value of a given key as a double */
|
||||
CCObject * getObject( const char *key ) const;
|
||||
|
||||
/** sets a new key/value pair in the configuration dictionary */
|
||||
void setObject( const char *key, CCObject *value );
|
||||
|
||||
/** dumps the current configuration on the console */
|
||||
void dumpInfo(void) const;
|
||||
|
||||
/** gathers OpenGL / GPU information */
|
||||
void gatherGPUInfo( void );
|
||||
|
||||
/** Loads a config file. If the keys are already present, then they are going to be replaced. Otherwise the new keys are added. */
|
||||
void loadConfigFile( const char *filename );
|
||||
|
||||
private:
|
||||
CCConfiguration(void);
|
||||
static CCConfiguration *s_gSharedConfiguration;
|
||||
static std::string s_sConfigfile;
|
||||
|
||||
protected:
|
||||
GLint m_nMaxTextureSize;
|
||||
|
@ -129,6 +149,8 @@ protected:
|
|||
GLint m_nMaxSamplesAllowed;
|
||||
GLint m_nMaxTextureUnits;
|
||||
char * m_pGlExtensions;
|
||||
|
||||
CCDictionary *m_pValueDict;
|
||||
};
|
||||
|
||||
// end of global group
|
||||
|
|
|
@ -23,6 +23,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
// standard includes
|
||||
#include <string>
|
||||
|
||||
// cocos2d includes
|
||||
#include "CCDirector.h"
|
||||
#include "ccFPSImages.h"
|
||||
#include "draw_nodes/CCDrawingPrimitives.h"
|
||||
|
@ -56,8 +61,11 @@ THE SOFTWARE.
|
|||
#include "kazmath/kazmath.h"
|
||||
#include "kazmath/GL/matrix.h"
|
||||
#include "support/CCProfiling.h"
|
||||
#include "platform/CCImage.h"
|
||||
#include "CCEGLView.h"
|
||||
#include <string>
|
||||
#include "CCConfiguration.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Position of the FPS
|
||||
|
@ -98,9 +106,7 @@ CCDirector::CCDirector(void)
|
|||
}
|
||||
|
||||
bool CCDirector::init(void)
|
||||
{
|
||||
CCLOG("cocos2d: %s", cocos2dVersion());
|
||||
|
||||
{
|
||||
// scenes
|
||||
m_pRunningScene = NULL;
|
||||
m_pNextScene = NULL;
|
||||
|
@ -304,6 +310,11 @@ void CCDirector::setOpenGLView(CCEGLView *pobOpenGLView)
|
|||
|
||||
if (m_pobOpenGLView != pobOpenGLView)
|
||||
{
|
||||
// Configuration. Gather GPU info
|
||||
CCConfiguration *conf = CCConfiguration::sharedConfiguration();
|
||||
conf->gatherGPUInfo();
|
||||
conf->dumpInfo();
|
||||
|
||||
// EAGLView is not a CCObject
|
||||
delete m_pobOpenGLView; // [openGLView_ release]
|
||||
m_pobOpenGLView = pobOpenGLView;
|
||||
|
@ -578,33 +589,44 @@ void CCDirector::popScene(void)
|
|||
}
|
||||
|
||||
void CCDirector::popToRootScene(void)
|
||||
{
|
||||
popToSceneStackLevel(1);
|
||||
}
|
||||
|
||||
void CCDirector::popToSceneStackLevel(int level)
|
||||
{
|
||||
CCAssert(m_pRunningScene != NULL, "A running Scene is needed");
|
||||
unsigned int c = m_pobScenesStack->count();
|
||||
int c = (int)m_pobScenesStack->count();
|
||||
|
||||
if (c == 1)
|
||||
// level 0? -> end
|
||||
if (level == 0)
|
||||
{
|
||||
m_pobScenesStack->removeLastObject();
|
||||
this->end();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (c > 1)
|
||||
{
|
||||
CCScene *current = (CCScene*)m_pobScenesStack->lastObject();
|
||||
if( current->isRunning() )
|
||||
{
|
||||
current->onExitTransitionDidStart();
|
||||
current->onExit();
|
||||
}
|
||||
current->cleanup();
|
||||
|
||||
m_pobScenesStack->removeLastObject();
|
||||
c--;
|
||||
}
|
||||
m_pNextScene = (CCScene*)m_pobScenesStack->lastObject();
|
||||
m_bSendCleanupToScene = false;
|
||||
end();
|
||||
return;
|
||||
}
|
||||
|
||||
// current level or lower -> nothing
|
||||
if (level >= c)
|
||||
return;
|
||||
|
||||
// pop stack until reaching desired level
|
||||
while (c > level)
|
||||
{
|
||||
CCScene *current = (CCScene*)m_pobScenesStack->lastObject();
|
||||
|
||||
if (current->isRunning())
|
||||
{
|
||||
current->onExitTransitionDidStart();
|
||||
current->onExit();
|
||||
}
|
||||
|
||||
current->cleanup();
|
||||
m_pobScenesStack->removeLastObject();
|
||||
c--;
|
||||
}
|
||||
|
||||
m_pNextScene = (CCScene*)m_pobScenesStack->lastObject();
|
||||
m_bSendCleanupToScene = false;
|
||||
}
|
||||
|
||||
void CCDirector::end()
|
||||
|
@ -787,43 +809,75 @@ void CCDirector::calculateMPF()
|
|||
void CCDirector::getFPSImageData(unsigned char** datapointer, unsigned int* length)
|
||||
{
|
||||
// XXX fixed me if it should be used
|
||||
// *datapointer = cc_fps_images_png;
|
||||
// *length = cc_fps_images_len();
|
||||
*datapointer = cc_fps_images_png;
|
||||
*length = cc_fps_images_len();
|
||||
}
|
||||
|
||||
void CCDirector::createStatsLabel()
|
||||
{
|
||||
if( m_pFPSLabel && m_pSPFLabel )
|
||||
{
|
||||
CCTexture2D *texture = NULL;
|
||||
CCTextureCache *textureCache = CCTextureCache::sharedTextureCache();
|
||||
|
||||
if( m_pFPSLabel && m_pSPFLabel )
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(m_pFPSLabel);
|
||||
CC_SAFE_RELEASE_NULL(m_pSPFLabel);
|
||||
CC_SAFE_RELEASE_NULL(m_pDrawsLabel);
|
||||
textureCache->removeTextureForKey("cc_fps_images");
|
||||
CCFileUtils::sharedFileUtils()->purgeCachedEntries();
|
||||
}
|
||||
|
||||
int fontSize = 0;
|
||||
if (m_obWinSizeInPoints.width > m_obWinSizeInPoints.height)
|
||||
{
|
||||
fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
fontSize = (int)(m_obWinSizeInPoints.width / 320.0f * 24);
|
||||
}
|
||||
|
||||
m_pFPSLabel = CCLabelTTF::create("00.0", "Arial", fontSize);
|
||||
m_pFPSLabel->retain();
|
||||
m_pSPFLabel = CCLabelTTF::create("0.000", "Arial", fontSize);
|
||||
m_pSPFLabel->retain();
|
||||
m_pDrawsLabel = CCLabelTTF::create("000", "Arial", fontSize);
|
||||
m_pDrawsLabel->retain();
|
||||
CCTexture2DPixelFormat currentFormat = CCTexture2D::defaultAlphaPixelFormat();
|
||||
CCTexture2D::setDefaultAlphaPixelFormat(kCCTexture2DPixelFormat_RGBA4444);
|
||||
unsigned char *data = NULL;
|
||||
unsigned int data_len = 0;
|
||||
getFPSImageData(&data, &data_len);
|
||||
|
||||
CCSize contentSize = m_pDrawsLabel->getContentSize();
|
||||
m_pDrawsLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height*5/2), CC_DIRECTOR_STATS_POSITION));
|
||||
contentSize = m_pSPFLabel->getContentSize();
|
||||
m_pSPFLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height*3/2), CC_DIRECTOR_STATS_POSITION));
|
||||
contentSize = m_pFPSLabel->getContentSize();
|
||||
m_pFPSLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height/2), CC_DIRECTOR_STATS_POSITION));
|
||||
CCImage* image = new CCImage();
|
||||
bool isOK = image->initWithImageData(data, data_len);
|
||||
if (!isOK) {
|
||||
CCLOGERROR("%s", "Fails: init fps_images");
|
||||
return;
|
||||
}
|
||||
|
||||
texture = textureCache->addUIImage(image, "cc_fps_images");
|
||||
CC_SAFE_RELEASE(image);
|
||||
|
||||
/*
|
||||
We want to use an image which is stored in the file named ccFPSImage.c
|
||||
for any design resolutions and all resource resolutions.
|
||||
|
||||
To achieve this,
|
||||
|
||||
Firstly, we need to ignore 'contentScaleFactor' in 'CCAtlasNode' and 'CCLabelAtlas'.
|
||||
So I added a new method called 'setIgnoreContentScaleFactor' for 'CCAtlasNode',
|
||||
this is not exposed to game developers, it's only used for displaying FPS now.
|
||||
|
||||
Secondly, the size of this image is 480*320, to display the FPS label with correct size,
|
||||
a factor of design resolution ratio of 480x320 is also needed.
|
||||
*/
|
||||
float factor = CCEGLView::sharedOpenGLView()->getDesignResolutionSize().height / 320.0f;
|
||||
|
||||
m_pFPSLabel = new CCLabelAtlas();
|
||||
m_pFPSLabel->setIgnoreContentScaleFactor(true);
|
||||
m_pFPSLabel->initWithString("00.0", texture, 12, 32 , '.');
|
||||
m_pFPSLabel->setScale(factor);
|
||||
|
||||
m_pSPFLabel = new CCLabelAtlas();
|
||||
m_pSPFLabel->setIgnoreContentScaleFactor(true);
|
||||
m_pSPFLabel->initWithString("0.000", texture, 12, 32, '.');
|
||||
m_pSPFLabel->setScale(factor);
|
||||
|
||||
m_pDrawsLabel = new CCLabelAtlas();
|
||||
m_pDrawsLabel->setIgnoreContentScaleFactor(true);
|
||||
m_pDrawsLabel->initWithString("000", texture, 12, 32, '.');
|
||||
m_pDrawsLabel->setScale(factor);
|
||||
|
||||
CCTexture2D::setDefaultAlphaPixelFormat(currentFormat);
|
||||
|
||||
m_pDrawsLabel->setPosition(ccpAdd(ccp(0, 34*factor), CC_DIRECTOR_STATS_POSITION));
|
||||
m_pSPFLabel->setPosition(ccpAdd(ccp(0, 17*factor), CC_DIRECTOR_STATS_POSITION));
|
||||
m_pFPSLabel->setPosition(CC_DIRECTOR_STATS_POSITION);
|
||||
}
|
||||
|
||||
float CCDirector::getContentScaleFactor(void)
|
||||
|
@ -948,7 +1002,9 @@ void CCDisplayLinkDirector::startAnimation(void)
|
|||
}
|
||||
|
||||
m_bInvalid = false;
|
||||
#ifndef EMSCRIPTEN
|
||||
CCApplication::sharedApplication()->setAnimationInterval(m_dAnimationInterval);
|
||||
#endif // EMSCRIPTEN
|
||||
}
|
||||
|
||||
void CCDisplayLinkDirector::mainLoop(void)
|
||||
|
|
|
@ -34,7 +34,7 @@ THE SOFTWARE.
|
|||
#include "cocoa/CCArray.h"
|
||||
#include "CCGL.h"
|
||||
#include "kazmath/mat4.h"
|
||||
#include "label_nodes/CCLabelTTF.h"
|
||||
#include "label_nodes/CCLabelAtlas.h"
|
||||
#include "ccTypeInfo.h"
|
||||
|
||||
|
||||
|
@ -204,7 +204,7 @@ public:
|
|||
|
||||
// Scene Management
|
||||
|
||||
/**Enters the Director's main loop with the given Scene.
|
||||
/** Enters the Director's main loop with the given Scene.
|
||||
* Call it to run only your FIRST scene.
|
||||
* Don't call it if there is already a running scene.
|
||||
*
|
||||
|
@ -212,27 +212,33 @@ public:
|
|||
*/
|
||||
void runWithScene(CCScene *pScene);
|
||||
|
||||
/**Suspends the execution of the running scene, pushing it on the stack of suspended scenes.
|
||||
/** Suspends the execution of the running scene, pushing it on the stack of suspended scenes.
|
||||
* The new scene will be executed.
|
||||
* Try to avoid big stacks of pushed scenes to reduce memory allocation.
|
||||
* ONLY call it if there is a running scene.
|
||||
*/
|
||||
void pushScene(CCScene *pScene);
|
||||
|
||||
/**Pops out a scene from the queue.
|
||||
/** Pops out a scene from the queue.
|
||||
* This scene will replace the running one.
|
||||
* The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.
|
||||
* ONLY call it if there is a running scene.
|
||||
*/
|
||||
void popScene(void);
|
||||
|
||||
/**Pops out all scenes from the queue until the root scene in the queue.
|
||||
/** Pops out all scenes from the queue until the root scene in the queue.
|
||||
* This scene will replace the running one.
|
||||
* The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.
|
||||
* ONLY call it if there is a running scene.
|
||||
* Internally it will call `popToSceneStackLevel(1)`
|
||||
*/
|
||||
void popToRootScene(void);
|
||||
|
||||
/** Pops out all scenes from the queue until it reaches `level`.
|
||||
If level is 0, it will end the director.
|
||||
If level is 1, it will pop all scenes until it reaches to root scene.
|
||||
If level is <= than the current stack level, it won't do anything.
|
||||
*/
|
||||
void popToSceneStackLevel(int level);
|
||||
|
||||
/** Replaces the running scene with a new one. The running scene is terminated.
|
||||
* ONLY call it if there is a running scene.
|
||||
*/
|
||||
|
@ -329,6 +335,7 @@ public:
|
|||
/* delta time since last tick to main loop */
|
||||
CC_PROPERTY_READONLY(float, m_fDeltaTime, DeltaTime);
|
||||
|
||||
public:
|
||||
/** returns a shared instance of the director */
|
||||
static CCDirector* sharedDirector(void);
|
||||
|
||||
|
@ -360,9 +367,9 @@ protected:
|
|||
float m_fAccumDt;
|
||||
float m_fFrameRate;
|
||||
|
||||
CCLabelTTF *m_pFPSLabel;
|
||||
CCLabelTTF *m_pSPFLabel;
|
||||
CCLabelTTF *m_pDrawsLabel;
|
||||
CCLabelAtlas *m_pFPSLabel;
|
||||
CCLabelAtlas *m_pSPFLabel;
|
||||
CCLabelAtlas *m_pDrawsLabel;
|
||||
|
||||
/** Whether or not the Director is paused */
|
||||
bool m_bPaused;
|
||||
|
|
|
@ -257,11 +257,18 @@ CCScheduler::~CCScheduler(void)
|
|||
|
||||
void CCScheduler::removeHashElement(_hashSelectorEntry *pElement)
|
||||
{
|
||||
|
||||
cocos2d::CCObject *target = pElement->target;
|
||||
|
||||
ccArrayFree(pElement->timers);
|
||||
pElement->target->release();
|
||||
pElement->target = NULL;
|
||||
HASH_DEL(m_pHashForTimers, pElement);
|
||||
free(pElement);
|
||||
|
||||
// make sure the target is released after we have removed the hash element
|
||||
// otherwise we access invalid memory when the release call deletes the target
|
||||
// and the target calls removeAllSelectors() during its destructor
|
||||
target->release();
|
||||
|
||||
}
|
||||
|
||||
void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, CCObject *pTarget, float fInterval, bool bPaused)
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
public:
|
||||
/** creates the action with size and duration */
|
||||
// We can't make this create function compatible with previous version, cxx-generator will be confused since they
|
||||
// We can't make this create function compatible with previous version, bindings-generator will be confused since they
|
||||
// have the same function name and the same number of arguments. So sorry about that.
|
||||
//CC_DEPRECATED_ATTRIBUTE static CCGridAction* create(const CCSize& gridSize, float duration);
|
||||
|
||||
|
|
|
@ -188,6 +188,51 @@ CCObject* CCToggleVisibility::copyWithZone(CCZone *pZone)
|
|||
return pRet;
|
||||
}
|
||||
|
||||
//
|
||||
// Remove Self
|
||||
//
|
||||
CCRemoveSelf * CCRemoveSelf::create(bool isNeedCleanUp /*= true*/)
|
||||
{
|
||||
CCRemoveSelf *pRet = new CCRemoveSelf();
|
||||
|
||||
if (pRet && pRet->init(isNeedCleanUp)) {
|
||||
pRet->autorelease();
|
||||
}
|
||||
|
||||
return pRet;
|
||||
}
|
||||
|
||||
bool CCRemoveSelf::init(bool isNeedCleanUp) {
|
||||
m_bIsNeedCleanUp = isNeedCleanUp;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCRemoveSelf::update(float time) {
|
||||
CC_UNUSED_PARAM(time);
|
||||
m_pTarget->removeFromParentAndCleanup(m_bIsNeedCleanUp);
|
||||
}
|
||||
|
||||
CCFiniteTimeAction *CCRemoveSelf::reverse() {
|
||||
return (CCFiniteTimeAction*) (CCRemoveSelf::create(m_bIsNeedCleanUp));
|
||||
}
|
||||
|
||||
CCObject* CCRemoveSelf::copyWithZone(CCZone *pZone) {
|
||||
CCZone *pNewZone = NULL;
|
||||
CCRemoveSelf *pRet = NULL;
|
||||
|
||||
if (pZone && pZone->m_pCopyObject) {
|
||||
pRet = (CCRemoveSelf*) (pZone->m_pCopyObject);
|
||||
} else {
|
||||
pRet = new CCRemoveSelf();
|
||||
pZone = pNewZone = new CCZone(pRet);
|
||||
}
|
||||
|
||||
CCActionInstant::copyWithZone(pZone);
|
||||
pRet->init(m_bIsNeedCleanUp);
|
||||
CC_SAFE_DELETE(pNewZone);
|
||||
return pRet;
|
||||
}
|
||||
|
||||
//
|
||||
// FlipX
|
||||
//
|
||||
|
@ -398,6 +443,9 @@ CCObject * CCCallFunc::copyWithZone(CCZone *pZone) {
|
|||
CCActionInstant::copyWithZone(pZone);
|
||||
pRet->initWithTarget(m_pSelectorTarget);
|
||||
pRet->m_pCallFunc = m_pCallFunc;
|
||||
if (m_nScriptHandler > 0 ) {
|
||||
pRet->m_nScriptHandler = cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine()->reallocateScriptHandler(m_nScriptHandler);
|
||||
}
|
||||
CC_SAFE_DELETE(pNewZone);
|
||||
return pRet;
|
||||
}
|
||||
|
|
|
@ -109,6 +109,27 @@ public:
|
|||
static CCToggleVisibility * create();
|
||||
};
|
||||
|
||||
/**
|
||||
@brief Remove the node
|
||||
*/
|
||||
class CC_DLL CCRemoveSelf : public CCActionInstant
|
||||
{
|
||||
public:
|
||||
CCRemoveSelf(){}
|
||||
virtual ~CCRemoveSelf(){}
|
||||
//super methods
|
||||
virtual void update(float time);
|
||||
virtual CCFiniteTimeAction * reverse(void);
|
||||
virtual CCObject* copyWithZone(CCZone *pZone);
|
||||
public:
|
||||
/** create the action */
|
||||
static CCRemoveSelf * create(bool isNeedCleanUp = true);
|
||||
/** init the action */
|
||||
bool init(bool isNeedCleanUp);
|
||||
protected:
|
||||
bool m_bIsNeedCleanUp;
|
||||
};
|
||||
|
||||
/**
|
||||
@brief Flips the sprite horizontally
|
||||
@since v0.99.0
|
||||
|
|
|
@ -313,7 +313,7 @@ CCAction* CCActionManager::getActionByTag(unsigned int tag, CCObject *pTarget)
|
|||
}
|
||||
}
|
||||
}
|
||||
CCLOG("cocos2d : getActionByTag: Action not found");
|
||||
CCLOG("cocos2d : getActionByTag(tag = %d): Action not found", tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -52,6 +52,7 @@ CCAtlasNode::CCAtlasNode()
|
|||
, m_bIsOpacityModifyRGB(false)
|
||||
, m_uQuadsToDraw(0)
|
||||
, m_nUniformColor(0)
|
||||
, m_bIgnoreContentScaleFactor(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -120,7 +121,13 @@ bool CCAtlasNode::initWithTexture(CCTexture2D* texture, unsigned int tileWidth,
|
|||
|
||||
void CCAtlasNode::calculateMaxItems()
|
||||
{
|
||||
const CCSize& s = m_pTextureAtlas->getTexture()->getContentSize();
|
||||
CCSize s = m_pTextureAtlas->getTexture()->getContentSize();
|
||||
|
||||
if (m_bIgnoreContentScaleFactor)
|
||||
{
|
||||
s = m_pTextureAtlas->getTexture()->getContentSizeInPixels();
|
||||
}
|
||||
|
||||
m_uItemsPerColumn = (int)(s.height / m_uItemHeight);
|
||||
m_uItemsPerRow = (int)(s.width / m_uItemWidth);
|
||||
}
|
||||
|
@ -194,6 +201,11 @@ void CCAtlasNode::updateOpacityModifyRGB()
|
|||
m_bIsOpacityModifyRGB = m_pTextureAtlas->getTexture()->hasPremultipliedAlpha();
|
||||
}
|
||||
|
||||
void CCAtlasNode::setIgnoreContentScaleFactor(bool bIgnoreContentScaleFactor)
|
||||
{
|
||||
m_bIgnoreContentScaleFactor = bIgnoreContentScaleFactor;
|
||||
}
|
||||
|
||||
// CCAtlasNode - CocosNodeTexture protocol
|
||||
|
||||
ccBlendFunc CCAtlasNode::getBlendFunc()
|
||||
|
|
|
@ -75,6 +75,9 @@ protected:
|
|||
CC_PROPERTY(unsigned int, m_uQuadsToDraw, QuadsToDraw);
|
||||
// color uniform
|
||||
GLint m_nUniformColor;
|
||||
// This varible is only used for CCLabelAtlas FPS display. So plz don't modify its value.
|
||||
bool m_bIgnoreContentScaleFactor;
|
||||
|
||||
public:
|
||||
CCAtlasNode();
|
||||
virtual ~CCAtlasNode();
|
||||
|
@ -114,7 +117,9 @@ private :
|
|||
void calculateMaxItems();
|
||||
void updateBlendFunc();
|
||||
void updateOpacityModifyRGB();
|
||||
|
||||
|
||||
friend class CCDirector;
|
||||
void setIgnoreContentScaleFactor(bool bIgnoreContentScaleFactor);
|
||||
};
|
||||
|
||||
// end of base_node group
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 Zynga Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "CCGLBufferedNode.h"
|
||||
|
||||
CCGLBufferedNode::CCGLBufferedNode(void)
|
||||
{
|
||||
for(int i = 0; i < BUFFER_SLOTS; i++)
|
||||
{
|
||||
m_bufferObject[i] = 0;
|
||||
m_bufferSize[i] = 0;
|
||||
m_indexBufferObject[i] = 0;
|
||||
m_indexBufferSize[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CCGLBufferedNode::setGLBufferData(void *buf, GLuint bufSize, int slot)
|
||||
{
|
||||
// WebGL doesn't support client-side arrays, so generate a buffer and load the data first.
|
||||
if(m_bufferSize[slot] < bufSize)
|
||||
{
|
||||
if(m_bufferObject[slot])
|
||||
{
|
||||
glDeleteBuffers(1, &(m_bufferObject[slot]));
|
||||
}
|
||||
glGenBuffers(1, &(m_bufferObject[slot]));
|
||||
m_bufferSize[slot] = bufSize;
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_bufferObject[slot]);
|
||||
glBufferData(GL_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_bufferObject[slot]);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, bufSize, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void CCGLBufferedNode::setGLIndexData(void *buf, GLuint bufSize, int slot)
|
||||
{
|
||||
// WebGL doesn't support client-side arrays, so generate a buffer and load the data first.
|
||||
if(m_indexBufferSize[slot] < bufSize)
|
||||
{
|
||||
if(m_indexBufferObject[slot])
|
||||
{
|
||||
glDeleteBuffers(1, &(m_indexBufferObject[slot]));
|
||||
}
|
||||
glGenBuffers(1, &(m_indexBufferObject[slot]));
|
||||
m_indexBufferSize[slot] = bufSize;
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBufferObject[slot]);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBufferObject[slot]);
|
||||
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, bufSize, buf);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 Zynga Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef __CC_GL_BUFFERED_NODE__
|
||||
#define __CC_GL_BUFFERED_NODE__
|
||||
|
||||
#include <CCGL.h>
|
||||
|
||||
class CCGLBufferedNode
|
||||
{
|
||||
public:
|
||||
CCGLBufferedNode(void);
|
||||
|
||||
/**
|
||||
* Load the given data into this CCNode's GL Buffer. Needed for WebGL, as it does not support client-side arrays.
|
||||
*/
|
||||
void setGLBufferData(void *buf, GLuint bufSize, int slot);
|
||||
void setGLIndexData(void *buf, GLuint bufSize, int slot);
|
||||
|
||||
// We allocate 4 buffer objs per node, and index into them as slots.
|
||||
#define BUFFER_SLOTS 4
|
||||
GLuint m_bufferObject[BUFFER_SLOTS];
|
||||
GLuint m_bufferSize[BUFFER_SLOTS];
|
||||
|
||||
GLuint m_indexBufferObject[BUFFER_SLOTS];
|
||||
GLuint m_indexBufferSize[BUFFER_SLOTS];
|
||||
};
|
||||
#endif // __CC_GL_BUFFERED_NODE__
|
|
@ -38,12 +38,13 @@ THE SOFTWARE.
|
|||
#include "shaders/CCGLProgram.h"
|
||||
// externals
|
||||
#include "kazmath/GL/matrix.h"
|
||||
|
||||
#include "support/component/CCComponent.h"
|
||||
#include "support/component/CCComponentContainer.h"
|
||||
|
||||
#if CC_NODE_RENDER_SUBPIXEL
|
||||
#define RENDER_IN_SUBPIXEL
|
||||
#else
|
||||
#define RENDER_IN_SUBPIXEL (__ARGS__) (ceil(__ARGS__))
|
||||
#define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__))
|
||||
#endif
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
@ -71,7 +72,7 @@ CCNode::CCNode(void)
|
|||
, m_nZOrder(0)
|
||||
, m_pChildren(NULL)
|
||||
, m_pParent(NULL)
|
||||
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to false
|
||||
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to true
|
||||
, m_nTag(kCCNodeTagInvalid)
|
||||
// userData is always inited as nil
|
||||
, m_pUserData(NULL)
|
||||
|
@ -88,6 +89,7 @@ CCNode::CCNode(void)
|
|||
, m_bReorderChildDirty(false)
|
||||
, m_nScriptHandler(0)
|
||||
, m_nUpdateScriptHandler(0)
|
||||
, m_pComponentContainer(NULL)
|
||||
{
|
||||
// set default scheduler and actionManager
|
||||
CCDirector *director = CCDirector::sharedDirector();
|
||||
|
@ -98,6 +100,7 @@ CCNode::CCNode(void)
|
|||
|
||||
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
|
||||
m_eScriptType = pEngine != NULL ? pEngine->getScriptType() : kScriptTypeNone;
|
||||
m_pComponentContainer = new CCComponentContainer(this);
|
||||
}
|
||||
|
||||
CCNode::~CCNode(void)
|
||||
|
@ -134,6 +137,10 @@ CCNode::~CCNode(void)
|
|||
|
||||
// children
|
||||
CC_SAFE_RELEASE(m_pChildren);
|
||||
|
||||
// m_pComsContainer
|
||||
m_pComponentContainer->removeAll();
|
||||
CC_SAFE_DELETE(m_pComponentContainer);
|
||||
}
|
||||
|
||||
bool CCNode::init()
|
||||
|
@ -326,7 +333,7 @@ CCArray* CCNode::getChildren()
|
|||
return m_pChildren;
|
||||
}
|
||||
|
||||
unsigned int CCNode::getChildrenCount(void)
|
||||
unsigned int CCNode::getChildrenCount(void) const
|
||||
{
|
||||
return m_pChildren ? m_pChildren->count() : 0;
|
||||
}
|
||||
|
@ -392,7 +399,7 @@ void CCNode::setAnchorPoint(const CCPoint& point)
|
|||
}
|
||||
|
||||
/// contentSize getter
|
||||
const CCSize& CCNode::getContentSize()
|
||||
const CCSize& CCNode::getContentSize() const
|
||||
{
|
||||
return m_obContentSize;
|
||||
}
|
||||
|
@ -441,7 +448,7 @@ void CCNode::ignoreAnchorPointForPosition(bool newValue)
|
|||
}
|
||||
|
||||
/// tag getter
|
||||
int CCNode::getTag()
|
||||
int CCNode::getTag() const
|
||||
{
|
||||
return m_nTag;
|
||||
}
|
||||
|
@ -662,7 +669,7 @@ void CCNode::removeChildByTag(int tag, bool cleanup)
|
|||
|
||||
if (child == NULL)
|
||||
{
|
||||
CCLOG("cocos2d: removeChildByTag: child not found!");
|
||||
CCLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1107,6 +1114,11 @@ void CCNode::update(float fDelta)
|
|||
{
|
||||
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nUpdateScriptHandler, fDelta, this);
|
||||
}
|
||||
|
||||
if (m_pComponentContainer && !m_pComponentContainer->isEmpty())
|
||||
{
|
||||
m_pComponentContainer->visit(fDelta);
|
||||
}
|
||||
}
|
||||
|
||||
CCAffineTransform CCNode::nodeToParentTransform(void)
|
||||
|
@ -1265,6 +1277,26 @@ void CCNode::updateTransform()
|
|||
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCNode*);
|
||||
}
|
||||
|
||||
CCComponent* CCNode::getComponent(const char *pName) const
|
||||
{
|
||||
return m_pComponentContainer->get(pName);
|
||||
}
|
||||
|
||||
bool CCNode::addComponent(CCComponent *pComponent)
|
||||
{
|
||||
return m_pComponentContainer->add(pComponent);
|
||||
}
|
||||
|
||||
bool CCNode::removeComponent(const char *pName)
|
||||
{
|
||||
return m_pComponentContainer->remove(pName);
|
||||
}
|
||||
|
||||
void CCNode::removeAllComponents()
|
||||
{
|
||||
m_pComponentContainer->removeAll();
|
||||
}
|
||||
|
||||
// CCNodeRGBA
|
||||
CCNodeRGBA::CCNodeRGBA()
|
||||
: _displayedOpacity(255)
|
||||
|
|
|
@ -49,6 +49,9 @@ class CCRGBAProtocol;
|
|||
class CCLabelProtocol;
|
||||
class CCScheduler;
|
||||
class CCActionManager;
|
||||
class CCComponent;
|
||||
class CCDictionary;
|
||||
class CCComponentContainer;
|
||||
|
||||
/**
|
||||
* @addtogroup base_nodes
|
||||
|
@ -308,21 +311,21 @@ public:
|
|||
* @param x X coordinate for position
|
||||
* @param y Y coordinate for position
|
||||
*/
|
||||
void setPosition(float x, float y);
|
||||
virtual void setPosition(float x, float y);
|
||||
/**
|
||||
* Gets position in a more efficient way, returns two number instead of a CCPoint object
|
||||
*
|
||||
* @see setPosition(float, float)
|
||||
*/
|
||||
void getPosition(float* x, float* y);
|
||||
virtual void getPosition(float* x, float* y);
|
||||
/**
|
||||
* Gets/Sets x or y coordinate individually for position.
|
||||
* These methods are used in Lua and Javascript Bindings
|
||||
*/
|
||||
void setPositionX(float x);
|
||||
float getPositionX(void);
|
||||
void setPositionY(float y);
|
||||
float getPositionY(void);
|
||||
virtual void setPositionX(float x);
|
||||
virtual float getPositionX(void);
|
||||
virtual void setPositionY(float y);
|
||||
virtual float getPositionY(void);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -412,7 +415,7 @@ public:
|
|||
*
|
||||
* @return The untransformed size of the node.
|
||||
*/
|
||||
virtual const CCSize& getContentSize();
|
||||
virtual const CCSize& getContentSize() const;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -608,7 +611,7 @@ public:
|
|||
*
|
||||
* @return The amount of children.
|
||||
*/
|
||||
unsigned int getChildrenCount(void);
|
||||
unsigned int getChildrenCount(void) const;
|
||||
|
||||
/**
|
||||
* Sets the parent node
|
||||
|
@ -757,7 +760,7 @@ public:
|
|||
*
|
||||
* @return A interger that identifies the node.
|
||||
*/
|
||||
virtual int getTag();
|
||||
virtual int getTag() const;
|
||||
/**
|
||||
* Changes the tag that is used to identify the node easily.
|
||||
*
|
||||
|
@ -1298,8 +1301,32 @@ public:
|
|||
* @endcode
|
||||
*/
|
||||
void setAdditionalTransform(const CCAffineTransform& additionalTransform);
|
||||
|
||||
/// @} end of Coordinate Converters
|
||||
|
||||
/// @{
|
||||
/// @name component functions
|
||||
/**
|
||||
* gets a component by its name
|
||||
*/
|
||||
CCComponent* getComponent(const char *pName) const;
|
||||
|
||||
/**
|
||||
* adds a component
|
||||
*/
|
||||
virtual bool addComponent(CCComponent *pComponent);
|
||||
|
||||
/**
|
||||
* removes a component by its name
|
||||
*/
|
||||
virtual bool removeComponent(const char *pName);
|
||||
|
||||
/**
|
||||
* removes all components
|
||||
*/
|
||||
virtual void removeAllComponents();
|
||||
/// @} end of component functions
|
||||
|
||||
private:
|
||||
/// lazy allocs
|
||||
void childrenAlloc(void);
|
||||
|
@ -1376,6 +1403,9 @@ protected:
|
|||
int m_nScriptHandler; ///< script handler for onEnter() & onExit(), used in Javascript binding and Lua binding.
|
||||
int m_nUpdateScriptHandler; ///< script handler for update() callback per frame, which is invoked from lua & javascript.
|
||||
ccScriptType m_eScriptType; ///< type of script binding, lua or javascript
|
||||
|
||||
CCComponentContainer *m_pComponentContainer; ///< Dictionary of components
|
||||
|
||||
};
|
||||
|
||||
//#pragma mark - CCNodeRGBA
|
||||
|
|
|
@ -0,0 +1,613 @@
|
|||
/*
|
||||
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ccFPSImages.h"
|
||||
|
||||
unsigned char cc_fps_images_png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
|
||||
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20,
|
||||
0x08, 0x06, 0x00, 0x00, 0x00, 0xfd, 0xa9, 0xa6, 0xe4, 0x00, 0x00, 0x0a,
|
||||
0x43, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x70, 0x72, 0x6f,
|
||||
0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, 0x53, 0x77, 0x58,
|
||||
0x93, 0xf7, 0x16, 0x3e, 0xdf, 0xf7, 0x65, 0x0f, 0x56, 0x42, 0xd8, 0xf0,
|
||||
0xb1, 0x97, 0x6c, 0x81, 0x00, 0x22, 0x23, 0xac, 0x08, 0xc8, 0x10, 0x59,
|
||||
0xa2, 0x10, 0x92, 0x00, 0x61, 0x84, 0x10, 0x12, 0x40, 0xc5, 0x85, 0x88,
|
||||
0x0a, 0x56, 0x14, 0x15, 0x11, 0x9c, 0x48, 0x55, 0xc4, 0x82, 0xd5, 0x0a,
|
||||
0x48, 0x9d, 0x88, 0xe2, 0xa0, 0x28, 0xb8, 0x67, 0x41, 0x8a, 0x88, 0x5a,
|
||||
0x8b, 0x55, 0x5c, 0x38, 0xee, 0x1f, 0xdc, 0xa7, 0xb5, 0x7d, 0x7a, 0xef,
|
||||
0xed, 0xed, 0xfb, 0xd7, 0xfb, 0xbc, 0xe7, 0x9c, 0xe7, 0xfc, 0xce, 0x79,
|
||||
0xcf, 0x0f, 0x80, 0x11, 0x12, 0x26, 0x91, 0xe6, 0xa2, 0x6a, 0x00, 0x39,
|
||||
0x52, 0x85, 0x3c, 0x3a, 0xd8, 0x1f, 0x8f, 0x4f, 0x48, 0xc4, 0xc9, 0xbd,
|
||||
0x80, 0x02, 0x15, 0x48, 0xe0, 0x04, 0x20, 0x10, 0xe6, 0xcb, 0xc2, 0x67,
|
||||
0x05, 0xc5, 0x00, 0x00, 0xf0, 0x03, 0x79, 0x78, 0x7e, 0x74, 0xb0, 0x3f,
|
||||
0xfc, 0x01, 0xaf, 0x6f, 0x00, 0x02, 0x00, 0x70, 0xd5, 0x2e, 0x24, 0x12,
|
||||
0xc7, 0xe1, 0xff, 0x83, 0xba, 0x50, 0x26, 0x57, 0x00, 0x20, 0x91, 0x00,
|
||||
0xe0, 0x22, 0x12, 0xe7, 0x0b, 0x01, 0x90, 0x52, 0x00, 0xc8, 0x2e, 0x54,
|
||||
0xc8, 0x14, 0x00, 0xc8, 0x18, 0x00, 0xb0, 0x53, 0xb3, 0x64, 0x0a, 0x00,
|
||||
0x94, 0x00, 0x00, 0x6c, 0x79, 0x7c, 0x42, 0x22, 0x00, 0xaa, 0x0d, 0x00,
|
||||
0xec, 0xf4, 0x49, 0x3e, 0x05, 0x00, 0xd8, 0xa9, 0x93, 0xdc, 0x17, 0x00,
|
||||
0xd8, 0xa2, 0x1c, 0xa9, 0x08, 0x00, 0x8d, 0x01, 0x00, 0x99, 0x28, 0x47,
|
||||
0x24, 0x02, 0x40, 0xbb, 0x00, 0x60, 0x55, 0x81, 0x52, 0x2c, 0x02, 0xc0,
|
||||
0xc2, 0x00, 0xa0, 0xac, 0x40, 0x22, 0x2e, 0x04, 0xc0, 0xae, 0x01, 0x80,
|
||||
0x59, 0xb6, 0x32, 0x47, 0x02, 0x80, 0xbd, 0x05, 0x00, 0x76, 0x8e, 0x58,
|
||||
0x90, 0x0f, 0x40, 0x60, 0x00, 0x80, 0x99, 0x42, 0x2c, 0xcc, 0x00, 0x20,
|
||||
0x38, 0x02, 0x00, 0x43, 0x1e, 0x13, 0xcd, 0x03, 0x20, 0x4c, 0x03, 0xa0,
|
||||
0x30, 0xd2, 0xbf, 0xe0, 0xa9, 0x5f, 0x70, 0x85, 0xb8, 0x48, 0x01, 0x00,
|
||||
0xc0, 0xcb, 0x95, 0xcd, 0x97, 0x4b, 0xd2, 0x33, 0x14, 0xb8, 0x95, 0xd0,
|
||||
0x1a, 0x77, 0xf2, 0xf0, 0xe0, 0xe2, 0x21, 0xe2, 0xc2, 0x6c, 0xb1, 0x42,
|
||||
0x61, 0x17, 0x29, 0x10, 0x66, 0x09, 0xe4, 0x22, 0x9c, 0x97, 0x9b, 0x23,
|
||||
0x13, 0x48, 0xe7, 0x03, 0x4c, 0xce, 0x0c, 0x00, 0x00, 0x1a, 0xf9, 0xd1,
|
||||
0xc1, 0xfe, 0x38, 0x3f, 0x90, 0xe7, 0xe6, 0xe4, 0xe1, 0xe6, 0x66, 0xe7,
|
||||
0x6c, 0xef, 0xf4, 0xc5, 0xa2, 0xfe, 0x6b, 0xf0, 0x6f, 0x22, 0x3e, 0x21,
|
||||
0xf1, 0xdf, 0xfe, 0xbc, 0x8c, 0x02, 0x04, 0x00, 0x10, 0x4e, 0xcf, 0xef,
|
||||
0xda, 0x5f, 0xe5, 0xe5, 0xd6, 0x03, 0x70, 0xc7, 0x01, 0xb0, 0x75, 0xbf,
|
||||
0x6b, 0xa9, 0x5b, 0x00, 0xda, 0x56, 0x00, 0x68, 0xdf, 0xf9, 0x5d, 0x33,
|
||||
0xdb, 0x09, 0xa0, 0x5a, 0x0a, 0xd0, 0x7a, 0xf9, 0x8b, 0x79, 0x38, 0xfc,
|
||||
0x40, 0x1e, 0x9e, 0xa1, 0x50, 0xc8, 0x3c, 0x1d, 0x1c, 0x0a, 0x0b, 0x0b,
|
||||
0xed, 0x25, 0x62, 0xa1, 0xbd, 0x30, 0xe3, 0x8b, 0x3e, 0xff, 0x33, 0xe1,
|
||||
0x6f, 0xe0, 0x8b, 0x7e, 0xf6, 0xfc, 0x40, 0x1e, 0xfe, 0xdb, 0x7a, 0xf0,
|
||||
0x00, 0x71, 0x9a, 0x40, 0x99, 0xad, 0xc0, 0xa3, 0x83, 0xfd, 0x71, 0x61,
|
||||
0x6e, 0x76, 0xae, 0x52, 0x8e, 0xe7, 0xcb, 0x04, 0x42, 0x31, 0x6e, 0xf7,
|
||||
0xe7, 0x23, 0xfe, 0xc7, 0x85, 0x7f, 0xfd, 0x8e, 0x29, 0xd1, 0xe2, 0x34,
|
||||
0xb1, 0x5c, 0x2c, 0x15, 0x8a, 0xf1, 0x58, 0x89, 0xb8, 0x50, 0x22, 0x4d,
|
||||
0xc7, 0x79, 0xb9, 0x52, 0x91, 0x44, 0x21, 0xc9, 0x95, 0xe2, 0x12, 0xe9,
|
||||
0x7f, 0x32, 0xf1, 0x1f, 0x96, 0xfd, 0x09, 0x93, 0x77, 0x0d, 0x00, 0xac,
|
||||
0x86, 0x4f, 0xc0, 0x4e, 0xb6, 0x07, 0xb5, 0xcb, 0x6c, 0xc0, 0x7e, 0xee,
|
||||
0x01, 0x02, 0x8b, 0x0e, 0x58, 0xd2, 0x76, 0x00, 0x40, 0x7e, 0xf3, 0x2d,
|
||||
0x8c, 0x1a, 0x0b, 0x91, 0x00, 0x10, 0x67, 0x34, 0x32, 0x79, 0xf7, 0x00,
|
||||
0x00, 0x93, 0xbf, 0xf9, 0x8f, 0x40, 0x2b, 0x01, 0x00, 0xcd, 0x97, 0xa4,
|
||||
0xe3, 0x00, 0x00, 0xbc, 0xe8, 0x18, 0x5c, 0xa8, 0x94, 0x17, 0x4c, 0xc6,
|
||||
0x08, 0x00, 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x07, 0x0c, 0xc1,
|
||||
0x14, 0xac, 0xc0, 0x0e, 0x9c, 0xc1, 0x1d, 0xbc, 0xc0, 0x17, 0x02, 0x61,
|
||||
0x06, 0x44, 0x40, 0x0c, 0x24, 0xc0, 0x3c, 0x10, 0x42, 0x06, 0xe4, 0x80,
|
||||
0x1c, 0x0a, 0xa1, 0x18, 0x96, 0x41, 0x19, 0x54, 0xc0, 0x3a, 0xd8, 0x04,
|
||||
0xb5, 0xb0, 0x03, 0x1a, 0xa0, 0x11, 0x9a, 0xe1, 0x10, 0xb4, 0xc1, 0x31,
|
||||
0x38, 0x0d, 0xe7, 0xe0, 0x12, 0x5c, 0x81, 0xeb, 0x70, 0x17, 0x06, 0x60,
|
||||
0x18, 0x9e, 0xc2, 0x18, 0xbc, 0x86, 0x09, 0x04, 0x41, 0xc8, 0x08, 0x13,
|
||||
0x61, 0x21, 0x3a, 0x88, 0x11, 0x62, 0x8e, 0xd8, 0x22, 0xce, 0x08, 0x17,
|
||||
0x99, 0x8e, 0x04, 0x22, 0x61, 0x48, 0x34, 0x92, 0x80, 0xa4, 0x20, 0xe9,
|
||||
0x88, 0x14, 0x51, 0x22, 0xc5, 0xc8, 0x72, 0xa4, 0x02, 0xa9, 0x42, 0x6a,
|
||||
0x91, 0x5d, 0x48, 0x23, 0xf2, 0x2d, 0x72, 0x14, 0x39, 0x8d, 0x5c, 0x40,
|
||||
0xfa, 0x90, 0xdb, 0xc8, 0x20, 0x32, 0x8a, 0xfc, 0x8a, 0xbc, 0x47, 0x31,
|
||||
0x94, 0x81, 0xb2, 0x51, 0x03, 0xd4, 0x02, 0x75, 0x40, 0xb9, 0xa8, 0x1f,
|
||||
0x1a, 0x8a, 0xc6, 0xa0, 0x73, 0xd1, 0x74, 0x34, 0x0f, 0x5d, 0x80, 0x96,
|
||||
0xa2, 0x6b, 0xd1, 0x1a, 0xb4, 0x1e, 0x3d, 0x80, 0xb6, 0xa2, 0xa7, 0xd1,
|
||||
0x4b, 0xe8, 0x75, 0x74, 0x00, 0x7d, 0x8a, 0x8e, 0x63, 0x80, 0xd1, 0x31,
|
||||
0x0e, 0x66, 0x8c, 0xd9, 0x61, 0x5c, 0x8c, 0x87, 0x45, 0x60, 0x89, 0x58,
|
||||
0x1a, 0x26, 0xc7, 0x16, 0x63, 0xe5, 0x58, 0x35, 0x56, 0x8f, 0x35, 0x63,
|
||||
0x1d, 0x58, 0x37, 0x76, 0x15, 0x1b, 0xc0, 0x9e, 0x61, 0xef, 0x08, 0x24,
|
||||
0x02, 0x8b, 0x80, 0x13, 0xec, 0x08, 0x5e, 0x84, 0x10, 0xc2, 0x6c, 0x82,
|
||||
0x90, 0x90, 0x47, 0x58, 0x4c, 0x58, 0x43, 0xa8, 0x25, 0xec, 0x23, 0xb4,
|
||||
0x12, 0xba, 0x08, 0x57, 0x09, 0x83, 0x84, 0x31, 0xc2, 0x27, 0x22, 0x93,
|
||||
0xa8, 0x4f, 0xb4, 0x25, 0x7a, 0x12, 0xf9, 0xc4, 0x78, 0x62, 0x3a, 0xb1,
|
||||
0x90, 0x58, 0x46, 0xac, 0x26, 0xee, 0x21, 0x1e, 0x21, 0x9e, 0x25, 0x5e,
|
||||
0x27, 0x0e, 0x13, 0x5f, 0x93, 0x48, 0x24, 0x0e, 0xc9, 0x92, 0xe4, 0x4e,
|
||||
0x0a, 0x21, 0x25, 0x90, 0x32, 0x49, 0x0b, 0x49, 0x6b, 0x48, 0xdb, 0x48,
|
||||
0x2d, 0xa4, 0x53, 0xa4, 0x3e, 0xd2, 0x10, 0x69, 0x9c, 0x4c, 0x26, 0xeb,
|
||||
0x90, 0x6d, 0xc9, 0xde, 0xe4, 0x08, 0xb2, 0x80, 0xac, 0x20, 0x97, 0x91,
|
||||
0xb7, 0x90, 0x0f, 0x90, 0x4f, 0x92, 0xfb, 0xc9, 0xc3, 0xe4, 0xb7, 0x14,
|
||||
0x3a, 0xc5, 0x88, 0xe2, 0x4c, 0x09, 0xa2, 0x24, 0x52, 0xa4, 0x94, 0x12,
|
||||
0x4a, 0x35, 0x65, 0x3f, 0xe5, 0x04, 0xa5, 0x9f, 0x32, 0x42, 0x99, 0xa0,
|
||||
0xaa, 0x51, 0xcd, 0xa9, 0x9e, 0xd4, 0x08, 0xaa, 0x88, 0x3a, 0x9f, 0x5a,
|
||||
0x49, 0x6d, 0xa0, 0x76, 0x50, 0x2f, 0x53, 0x87, 0xa9, 0x13, 0x34, 0x75,
|
||||
0x9a, 0x25, 0xcd, 0x9b, 0x16, 0x43, 0xcb, 0xa4, 0x2d, 0xa3, 0xd5, 0xd0,
|
||||
0x9a, 0x69, 0x67, 0x69, 0xf7, 0x68, 0x2f, 0xe9, 0x74, 0xba, 0x09, 0xdd,
|
||||
0x83, 0x1e, 0x45, 0x97, 0xd0, 0x97, 0xd2, 0x6b, 0xe8, 0x07, 0xe9, 0xe7,
|
||||
0xe9, 0x83, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x0d, 0x83, 0xc7, 0x48, 0x62,
|
||||
0x28, 0x19, 0x6b, 0x19, 0x7b, 0x19, 0xa7, 0x18, 0xb7, 0x19, 0x2f, 0x99,
|
||||
0x4c, 0xa6, 0x05, 0xd3, 0x97, 0x99, 0xc8, 0x54, 0x30, 0xd7, 0x32, 0x1b,
|
||||
0x99, 0x67, 0x98, 0x0f, 0x98, 0x6f, 0x55, 0x58, 0x2a, 0xf6, 0x2a, 0x7c,
|
||||
0x15, 0x91, 0xca, 0x12, 0x95, 0x3a, 0x95, 0x56, 0x95, 0x7e, 0x95, 0xe7,
|
||||
0xaa, 0x54, 0x55, 0x73, 0x55, 0x3f, 0xd5, 0x79, 0xaa, 0x0b, 0x54, 0xab,
|
||||
0x55, 0x0f, 0xab, 0x5e, 0x56, 0x7d, 0xa6, 0x46, 0x55, 0xb3, 0x50, 0xe3,
|
||||
0xa9, 0x09, 0xd4, 0x16, 0xab, 0xd5, 0xa9, 0x1d, 0x55, 0xbb, 0xa9, 0x36,
|
||||
0xae, 0xce, 0x52, 0x77, 0x52, 0x8f, 0x50, 0xcf, 0x51, 0x5f, 0xa3, 0xbe,
|
||||
0x5f, 0xfd, 0x82, 0xfa, 0x63, 0x0d, 0xb2, 0x86, 0x85, 0x46, 0xa0, 0x86,
|
||||
0x48, 0xa3, 0x54, 0x63, 0xb7, 0xc6, 0x19, 0x8d, 0x21, 0x16, 0xc6, 0x32,
|
||||
0x65, 0xf1, 0x58, 0x42, 0xd6, 0x72, 0x56, 0x03, 0xeb, 0x2c, 0x6b, 0x98,
|
||||
0x4d, 0x62, 0x5b, 0xb2, 0xf9, 0xec, 0x4c, 0x76, 0x05, 0xfb, 0x1b, 0x76,
|
||||
0x2f, 0x7b, 0x4c, 0x53, 0x43, 0x73, 0xaa, 0x66, 0xac, 0x66, 0x91, 0x66,
|
||||
0x9d, 0xe6, 0x71, 0xcd, 0x01, 0x0e, 0xc6, 0xb1, 0xe0, 0xf0, 0x39, 0xd9,
|
||||
0x9c, 0x4a, 0xce, 0x21, 0xce, 0x0d, 0xce, 0x7b, 0x2d, 0x03, 0x2d, 0x3f,
|
||||
0x2d, 0xb1, 0xd6, 0x6a, 0xad, 0x66, 0xad, 0x7e, 0xad, 0x37, 0xda, 0x7a,
|
||||
0xda, 0xbe, 0xda, 0x62, 0xed, 0x72, 0xed, 0x16, 0xed, 0xeb, 0xda, 0xef,
|
||||
0x75, 0x70, 0x9d, 0x40, 0x9d, 0x2c, 0x9d, 0xf5, 0x3a, 0x6d, 0x3a, 0xf7,
|
||||
0x75, 0x09, 0xba, 0x36, 0xba, 0x51, 0xba, 0x85, 0xba, 0xdb, 0x75, 0xcf,
|
||||
0xea, 0x3e, 0xd3, 0x63, 0xeb, 0x79, 0xe9, 0x09, 0xf5, 0xca, 0xf5, 0x0e,
|
||||
0xe9, 0xdd, 0xd1, 0x47, 0xf5, 0x6d, 0xf4, 0xa3, 0xf5, 0x17, 0xea, 0xef,
|
||||
0xd6, 0xef, 0xd1, 0x1f, 0x37, 0x30, 0x34, 0x08, 0x36, 0x90, 0x19, 0x6c,
|
||||
0x31, 0x38, 0x63, 0xf0, 0xcc, 0x90, 0x63, 0xe8, 0x6b, 0x98, 0x69, 0xb8,
|
||||
0xd1, 0xf0, 0x84, 0xe1, 0xa8, 0x11, 0xcb, 0x68, 0xba, 0x91, 0xc4, 0x68,
|
||||
0xa3, 0xd1, 0x49, 0xa3, 0x27, 0xb8, 0x26, 0xee, 0x87, 0x67, 0xe3, 0x35,
|
||||
0x78, 0x17, 0x3e, 0x66, 0xac, 0x6f, 0x1c, 0x62, 0xac, 0x34, 0xde, 0x65,
|
||||
0xdc, 0x6b, 0x3c, 0x61, 0x62, 0x69, 0x32, 0xdb, 0xa4, 0xc4, 0xa4, 0xc5,
|
||||
0xe4, 0xbe, 0x29, 0xcd, 0x94, 0x6b, 0x9a, 0x66, 0xba, 0xd1, 0xb4, 0xd3,
|
||||
0x74, 0xcc, 0xcc, 0xc8, 0x2c, 0xdc, 0xac, 0xd8, 0xac, 0xc9, 0xec, 0x8e,
|
||||
0x39, 0xd5, 0x9c, 0x6b, 0x9e, 0x61, 0xbe, 0xd9, 0xbc, 0xdb, 0xfc, 0x8d,
|
||||
0x85, 0xa5, 0x45, 0x9c, 0xc5, 0x4a, 0x8b, 0x36, 0x8b, 0xc7, 0x96, 0xda,
|
||||
0x96, 0x7c, 0xcb, 0x05, 0x96, 0x4d, 0x96, 0xf7, 0xac, 0x98, 0x56, 0x3e,
|
||||
0x56, 0x79, 0x56, 0xf5, 0x56, 0xd7, 0xac, 0x49, 0xd6, 0x5c, 0xeb, 0x2c,
|
||||
0xeb, 0x6d, 0xd6, 0x57, 0x6c, 0x50, 0x1b, 0x57, 0x9b, 0x0c, 0x9b, 0x3a,
|
||||
0x9b, 0xcb, 0xb6, 0xa8, 0xad, 0x9b, 0xad, 0xc4, 0x76, 0x9b, 0x6d, 0xdf,
|
||||
0x14, 0xe2, 0x14, 0x8f, 0x29, 0xd2, 0x29, 0xf5, 0x53, 0x6e, 0xda, 0x31,
|
||||
0xec, 0xfc, 0xec, 0x0a, 0xec, 0x9a, 0xec, 0x06, 0xed, 0x39, 0xf6, 0x61,
|
||||
0xf6, 0x25, 0xf6, 0x6d, 0xf6, 0xcf, 0x1d, 0xcc, 0x1c, 0x12, 0x1d, 0xd6,
|
||||
0x3b, 0x74, 0x3b, 0x7c, 0x72, 0x74, 0x75, 0xcc, 0x76, 0x6c, 0x70, 0xbc,
|
||||
0xeb, 0xa4, 0xe1, 0x34, 0xc3, 0xa9, 0xc4, 0xa9, 0xc3, 0xe9, 0x57, 0x67,
|
||||
0x1b, 0x67, 0xa1, 0x73, 0x9d, 0xf3, 0x35, 0x17, 0xa6, 0x4b, 0x90, 0xcb,
|
||||
0x12, 0x97, 0x76, 0x97, 0x17, 0x53, 0x6d, 0xa7, 0x8a, 0xa7, 0x6e, 0x9f,
|
||||
0x7a, 0xcb, 0x95, 0xe5, 0x1a, 0xee, 0xba, 0xd2, 0xb5, 0xd3, 0xf5, 0xa3,
|
||||
0x9b, 0xbb, 0x9b, 0xdc, 0xad, 0xd9, 0x6d, 0xd4, 0xdd, 0xcc, 0x3d, 0xc5,
|
||||
0x7d, 0xab, 0xfb, 0x4d, 0x2e, 0x9b, 0x1b, 0xc9, 0x5d, 0xc3, 0x3d, 0xef,
|
||||
0x41, 0xf4, 0xf0, 0xf7, 0x58, 0xe2, 0x71, 0xcc, 0xe3, 0x9d, 0xa7, 0x9b,
|
||||
0xa7, 0xc2, 0xf3, 0x90, 0xe7, 0x2f, 0x5e, 0x76, 0x5e, 0x59, 0x5e, 0xfb,
|
||||
0xbd, 0x1e, 0x4f, 0xb3, 0x9c, 0x26, 0x9e, 0xd6, 0x30, 0x6d, 0xc8, 0xdb,
|
||||
0xc4, 0x5b, 0xe0, 0xbd, 0xcb, 0x7b, 0x60, 0x3a, 0x3e, 0x3d, 0x65, 0xfa,
|
||||
0xce, 0xe9, 0x03, 0x3e, 0xc6, 0x3e, 0x02, 0x9f, 0x7a, 0x9f, 0x87, 0xbe,
|
||||
0xa6, 0xbe, 0x22, 0xdf, 0x3d, 0xbe, 0x23, 0x7e, 0xd6, 0x7e, 0x99, 0x7e,
|
||||
0x07, 0xfc, 0x9e, 0xfb, 0x3b, 0xfa, 0xcb, 0xfd, 0x8f, 0xf8, 0xbf, 0xe1,
|
||||
0x79, 0xf2, 0x16, 0xf1, 0x4e, 0x05, 0x60, 0x01, 0xc1, 0x01, 0xe5, 0x01,
|
||||
0xbd, 0x81, 0x1a, 0x81, 0xb3, 0x03, 0x6b, 0x03, 0x1f, 0x04, 0x99, 0x04,
|
||||
0xa5, 0x07, 0x35, 0x05, 0x8d, 0x05, 0xbb, 0x06, 0x2f, 0x0c, 0x3e, 0x15,
|
||||
0x42, 0x0c, 0x09, 0x0d, 0x59, 0x1f, 0x72, 0x93, 0x6f, 0xc0, 0x17, 0xf2,
|
||||
0x1b, 0xf9, 0x63, 0x33, 0xdc, 0x67, 0x2c, 0x9a, 0xd1, 0x15, 0xca, 0x08,
|
||||
0x9d, 0x15, 0x5a, 0x1b, 0xfa, 0x30, 0xcc, 0x26, 0x4c, 0x1e, 0xd6, 0x11,
|
||||
0x8e, 0x86, 0xcf, 0x08, 0xdf, 0x10, 0x7e, 0x6f, 0xa6, 0xf9, 0x4c, 0xe9,
|
||||
0xcc, 0xb6, 0x08, 0x88, 0xe0, 0x47, 0x6c, 0x88, 0xb8, 0x1f, 0x69, 0x19,
|
||||
0x99, 0x17, 0xf9, 0x7d, 0x14, 0x29, 0x2a, 0x32, 0xaa, 0x2e, 0xea, 0x51,
|
||||
0xb4, 0x53, 0x74, 0x71, 0x74, 0xf7, 0x2c, 0xd6, 0xac, 0xe4, 0x59, 0xfb,
|
||||
0x67, 0xbd, 0x8e, 0xf1, 0x8f, 0xa9, 0x8c, 0xb9, 0x3b, 0xdb, 0x6a, 0xb6,
|
||||
0x72, 0x76, 0x67, 0xac, 0x6a, 0x6c, 0x52, 0x6c, 0x63, 0xec, 0x9b, 0xb8,
|
||||
0x80, 0xb8, 0xaa, 0xb8, 0x81, 0x78, 0x87, 0xf8, 0x45, 0xf1, 0x97, 0x12,
|
||||
0x74, 0x13, 0x24, 0x09, 0xed, 0x89, 0xe4, 0xc4, 0xd8, 0xc4, 0x3d, 0x89,
|
||||
0xe3, 0x73, 0x02, 0xe7, 0x6c, 0x9a, 0x33, 0x9c, 0xe4, 0x9a, 0x54, 0x96,
|
||||
0x74, 0x63, 0xae, 0xe5, 0xdc, 0xa2, 0xb9, 0x17, 0xe6, 0xe9, 0xce, 0xcb,
|
||||
0x9e, 0x77, 0x3c, 0x59, 0x35, 0x59, 0x90, 0x7c, 0x38, 0x85, 0x98, 0x12,
|
||||
0x97, 0xb2, 0x3f, 0xe5, 0x83, 0x20, 0x42, 0x50, 0x2f, 0x18, 0x4f, 0xe5,
|
||||
0xa7, 0x6e, 0x4d, 0x1d, 0x13, 0xf2, 0x84, 0x9b, 0x85, 0x4f, 0x45, 0xbe,
|
||||
0xa2, 0x8d, 0xa2, 0x51, 0xb1, 0xb7, 0xb8, 0x4a, 0x3c, 0x92, 0xe6, 0x9d,
|
||||
0x56, 0x95, 0xf6, 0x38, 0xdd, 0x3b, 0x7d, 0x43, 0xfa, 0x68, 0x86, 0x4f,
|
||||
0x46, 0x75, 0xc6, 0x33, 0x09, 0x4f, 0x52, 0x2b, 0x79, 0x91, 0x19, 0x92,
|
||||
0xb9, 0x23, 0xf3, 0x4d, 0x56, 0x44, 0xd6, 0xde, 0xac, 0xcf, 0xd9, 0x71,
|
||||
0xd9, 0x2d, 0x39, 0x94, 0x9c, 0x94, 0x9c, 0xa3, 0x52, 0x0d, 0x69, 0x96,
|
||||
0xb4, 0x2b, 0xd7, 0x30, 0xb7, 0x28, 0xb7, 0x4f, 0x66, 0x2b, 0x2b, 0x93,
|
||||
0x0d, 0xe4, 0x79, 0xe6, 0x6d, 0xca, 0x1b, 0x93, 0x87, 0xca, 0xf7, 0xe4,
|
||||
0x23, 0xf9, 0x73, 0xf3, 0xdb, 0x15, 0x6c, 0x85, 0x4c, 0xd1, 0xa3, 0xb4,
|
||||
0x52, 0xae, 0x50, 0x0e, 0x16, 0x4c, 0x2f, 0xa8, 0x2b, 0x78, 0x5b, 0x18,
|
||||
0x5b, 0x78, 0xb8, 0x48, 0xbd, 0x48, 0x5a, 0xd4, 0x33, 0xdf, 0x66, 0xfe,
|
||||
0xea, 0xf9, 0x23, 0x0b, 0x82, 0x16, 0x7c, 0xbd, 0x90, 0xb0, 0x50, 0xb8,
|
||||
0xb0, 0xb3, 0xd8, 0xb8, 0x78, 0x59, 0xf1, 0xe0, 0x22, 0xbf, 0x45, 0xbb,
|
||||
0x16, 0x23, 0x8b, 0x53, 0x17, 0x77, 0x2e, 0x31, 0x5d, 0x52, 0xba, 0x64,
|
||||
0x78, 0x69, 0xf0, 0xd2, 0x7d, 0xcb, 0x68, 0xcb, 0xb2, 0x96, 0xfd, 0x50,
|
||||
0xe2, 0x58, 0x52, 0x55, 0xf2, 0x6a, 0x79, 0xdc, 0xf2, 0x8e, 0x52, 0x83,
|
||||
0xd2, 0xa5, 0xa5, 0x43, 0x2b, 0x82, 0x57, 0x34, 0x95, 0xa9, 0x94, 0xc9,
|
||||
0xcb, 0x6e, 0xae, 0xf4, 0x5a, 0xb9, 0x63, 0x15, 0x61, 0x95, 0x64, 0x55,
|
||||
0xef, 0x6a, 0x97, 0xd5, 0x5b, 0x56, 0x7f, 0x2a, 0x17, 0x95, 0x5f, 0xac,
|
||||
0x70, 0xac, 0xa8, 0xae, 0xf8, 0xb0, 0x46, 0xb8, 0xe6, 0xe2, 0x57, 0x4e,
|
||||
0x5f, 0xd5, 0x7c, 0xf5, 0x79, 0x6d, 0xda, 0xda, 0xde, 0x4a, 0xb7, 0xca,
|
||||
0xed, 0xeb, 0x48, 0xeb, 0xa4, 0xeb, 0x6e, 0xac, 0xf7, 0x59, 0xbf, 0xaf,
|
||||
0x4a, 0xbd, 0x6a, 0x41, 0xd5, 0xd0, 0x86, 0xf0, 0x0d, 0xad, 0x1b, 0xf1,
|
||||
0x8d, 0xe5, 0x1b, 0x5f, 0x6d, 0x4a, 0xde, 0x74, 0xa1, 0x7a, 0x6a, 0xf5,
|
||||
0x8e, 0xcd, 0xb4, 0xcd, 0xca, 0xcd, 0x03, 0x35, 0x61, 0x35, 0xed, 0x5b,
|
||||
0xcc, 0xb6, 0xac, 0xdb, 0xf2, 0xa1, 0x36, 0xa3, 0xf6, 0x7a, 0x9d, 0x7f,
|
||||
0x5d, 0xcb, 0x56, 0xfd, 0xad, 0xab, 0xb7, 0xbe, 0xd9, 0x26, 0xda, 0xd6,
|
||||
0xbf, 0xdd, 0x77, 0x7b, 0xf3, 0x0e, 0x83, 0x1d, 0x15, 0x3b, 0xde, 0xef,
|
||||
0x94, 0xec, 0xbc, 0xb5, 0x2b, 0x78, 0x57, 0x6b, 0xbd, 0x45, 0x7d, 0xf5,
|
||||
0x6e, 0xd2, 0xee, 0x82, 0xdd, 0x8f, 0x1a, 0x62, 0x1b, 0xba, 0xbf, 0xe6,
|
||||
0x7e, 0xdd, 0xb8, 0x47, 0x77, 0x4f, 0xc5, 0x9e, 0x8f, 0x7b, 0xa5, 0x7b,
|
||||
0x07, 0xf6, 0x45, 0xef, 0xeb, 0x6a, 0x74, 0x6f, 0x6c, 0xdc, 0xaf, 0xbf,
|
||||
0xbf, 0xb2, 0x09, 0x6d, 0x52, 0x36, 0x8d, 0x1e, 0x48, 0x3a, 0x70, 0xe5,
|
||||
0x9b, 0x80, 0x6f, 0xda, 0x9b, 0xed, 0x9a, 0x77, 0xb5, 0x70, 0x5a, 0x2a,
|
||||
0x0e, 0xc2, 0x41, 0xe5, 0xc1, 0x27, 0xdf, 0xa6, 0x7c, 0x7b, 0xe3, 0x50,
|
||||
0xe8, 0xa1, 0xce, 0xc3, 0xdc, 0xc3, 0xcd, 0xdf, 0x99, 0x7f, 0xb7, 0xf5,
|
||||
0x08, 0xeb, 0x48, 0x79, 0x2b, 0xd2, 0x3a, 0xbf, 0x75, 0xac, 0x2d, 0xa3,
|
||||
0x6d, 0xa0, 0x3d, 0xa1, 0xbd, 0xef, 0xe8, 0x8c, 0xa3, 0x9d, 0x1d, 0x5e,
|
||||
0x1d, 0x47, 0xbe, 0xb7, 0xff, 0x7e, 0xef, 0x31, 0xe3, 0x63, 0x75, 0xc7,
|
||||
0x35, 0x8f, 0x57, 0x9e, 0xa0, 0x9d, 0x28, 0x3d, 0xf1, 0xf9, 0xe4, 0x82,
|
||||
0x93, 0xe3, 0xa7, 0x64, 0xa7, 0x9e, 0x9d, 0x4e, 0x3f, 0x3d, 0xd4, 0x99,
|
||||
0xdc, 0x79, 0xf7, 0x4c, 0xfc, 0x99, 0x6b, 0x5d, 0x51, 0x5d, 0xbd, 0x67,
|
||||
0x43, 0xcf, 0x9e, 0x3f, 0x17, 0x74, 0xee, 0x4c, 0xb7, 0x5f, 0xf7, 0xc9,
|
||||
0xf3, 0xde, 0xe7, 0x8f, 0x5d, 0xf0, 0xbc, 0x70, 0xf4, 0x22, 0xf7, 0x62,
|
||||
0xdb, 0x25, 0xb7, 0x4b, 0xad, 0x3d, 0xae, 0x3d, 0x47, 0x7e, 0x70, 0xfd,
|
||||
0xe1, 0x48, 0xaf, 0x5b, 0x6f, 0xeb, 0x65, 0xf7, 0xcb, 0xed, 0x57, 0x3c,
|
||||
0xae, 0x74, 0xf4, 0x4d, 0xeb, 0x3b, 0xd1, 0xef, 0xd3, 0x7f, 0xfa, 0x6a,
|
||||
0xc0, 0xd5, 0x73, 0xd7, 0xf8, 0xd7, 0x2e, 0x5d, 0x9f, 0x79, 0xbd, 0xef,
|
||||
0xc6, 0xec, 0x1b, 0xb7, 0x6e, 0x26, 0xdd, 0x1c, 0xb8, 0x25, 0xba, 0xf5,
|
||||
0xf8, 0x76, 0xf6, 0xed, 0x17, 0x77, 0x0a, 0xee, 0x4c, 0xdc, 0x5d, 0x7a,
|
||||
0x8f, 0x78, 0xaf, 0xfc, 0xbe, 0xda, 0xfd, 0xea, 0x07, 0xfa, 0x0f, 0xea,
|
||||
0x7f, 0xb4, 0xfe, 0xb1, 0x65, 0xc0, 0x6d, 0xe0, 0xf8, 0x60, 0xc0, 0x60,
|
||||
0xcf, 0xc3, 0x59, 0x0f, 0xef, 0x0e, 0x09, 0x87, 0x9e, 0xfe, 0x94, 0xff,
|
||||
0xd3, 0x87, 0xe1, 0xd2, 0x47, 0xcc, 0x47, 0xd5, 0x23, 0x46, 0x23, 0x8d,
|
||||
0x8f, 0x9d, 0x1f, 0x1f, 0x1b, 0x0d, 0x1a, 0xbd, 0xf2, 0x64, 0xce, 0x93,
|
||||
0xe1, 0xa7, 0xb2, 0xa7, 0x13, 0xcf, 0xca, 0x7e, 0x56, 0xff, 0x79, 0xeb,
|
||||
0x73, 0xab, 0xe7, 0xdf, 0xfd, 0xe2, 0xfb, 0x4b, 0xcf, 0x58, 0xfc, 0xd8,
|
||||
0xf0, 0x0b, 0xf9, 0x8b, 0xcf, 0xbf, 0xae, 0x79, 0xa9, 0xf3, 0x72, 0xef,
|
||||
0xab, 0xa9, 0xaf, 0x3a, 0xc7, 0x23, 0xc7, 0x1f, 0xbc, 0xce, 0x79, 0x3d,
|
||||
0xf1, 0xa6, 0xfc, 0xad, 0xce, 0xdb, 0x7d, 0xef, 0xb8, 0xef, 0xba, 0xdf,
|
||||
0xc7, 0xbd, 0x1f, 0x99, 0x28, 0xfc, 0x40, 0xfe, 0x50, 0xf3, 0xd1, 0xfa,
|
||||
0x63, 0xc7, 0xa7, 0xd0, 0x4f, 0xf7, 0x3e, 0xe7, 0x7c, 0xfe, 0xfc, 0x2f,
|
||||
0xf7, 0x84, 0xf3, 0xfb, 0x80, 0x39, 0x25, 0x11, 0x00, 0x00, 0x00, 0x06,
|
||||
0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd,
|
||||
0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00,
|
||||
0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00,
|
||||
0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdc, 0x02, 0x07, 0x10,
|
||||
0x2f, 0x1c, 0x54, 0x04, 0xda, 0x7f, 0x00, 0x00, 0x10, 0x67, 0x49, 0x44,
|
||||
0x41, 0x54, 0x78, 0xda, 0xed, 0x9b, 0x7b, 0x74, 0x15, 0x55, 0x96, 0xc6,
|
||||
0xbf, 0x53, 0x75, 0xef, 0xcd, 0xbd, 0x79, 0x12, 0xf2, 0x20, 0xa0, 0x04,
|
||||
0x3a, 0x22, 0x12, 0x12, 0xd3, 0xe1, 0x25, 0x32, 0x40, 0x62, 0xec, 0x81,
|
||||
0x0e, 0x68, 0x56, 0x8c, 0x01, 0x31, 0xe2, 0x20, 0x06, 0x06, 0x1c, 0x40,
|
||||
0xe3, 0x00, 0x01, 0x6d, 0x50, 0x0c, 0x59, 0x40, 0x1e, 0xca, 0x43, 0x02,
|
||||
0x33, 0xe1, 0xd1, 0x4d, 0xc0, 0x51, 0x5a, 0x43, 0x47, 0xda, 0x5e, 0x66,
|
||||
0xa1, 0x2d, 0x0b, 0x08, 0x2a, 0xd0, 0x4e, 0x46, 0x1e, 0x41, 0x60, 0x50,
|
||||
0x48, 0x20, 0x08, 0x81, 0x84, 0x57, 0x12, 0x92, 0x9b, 0x5b, 0xf5, 0xcd,
|
||||
0x1f, 0x9c, 0xd2, 0xe2, 0x7a, 0x11, 0xed, 0xf6, 0x8f, 0x11, 0xeb, 0xb7,
|
||||
0xd6, 0x5d, 0x21, 0xe1, 0xd4, 0xa9, 0xbd, 0xcf, 0xad, 0xfd, 0x9d, 0x7d,
|
||||
0xf6, 0x39, 0x05, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
|
||||
0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
|
||||
0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
|
||||
0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
|
||||
0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
|
||||
0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xfc, 0x7f, 0x43, 0xfc, 0xc4, 0x7d,
|
||||
0xa9, 0xf2, 0xa7, 0x2e, 0x3f, 0xf4, 0xd1, 0x4e, 0xf5, 0x6a, 0xa7, 0xc9,
|
||||
0x9f, 0xdf, 0x87, 0x0a, 0x40, 0x91, 0xfd, 0x69, 0x37, 0xe9, 0xd7, 0x6c,
|
||||
0x83, 0x22, 0x7f, 0xd7, 0x01, 0x78, 0x7e, 0x40, 0xdf, 0xaa, 0xa9, 0xbd,
|
||||
0xfe, 0x03, 0xec, 0x51, 0xe4, 0xe7, 0x56, 0xbe, 0x9a, 0xdb, 0x19, 0x50,
|
||||
0x7e, 0x7c, 0x5d, 0x23, 0xbc, 0xec, 0xd1, 0x6e, 0xe2, 0xaf, 0x30, 0xf5,
|
||||
0xed, 0x8b, 0x5b, 0xd9, 0x64, 0xfb, 0x11, 0xe3, 0x6f, 0xfe, 0xbe, 0x28,
|
||||
0xc7, 0x53, 0xb7, 0x42, 0xe7, 0xf6, 0x40, 0xfd, 0xa9, 0x82, 0xdf, 0x6e,
|
||||
0xb7, 0x07, 0xe8, 0xba, 0xde, 0x05, 0x40, 0x4f, 0x00, 0x54, 0x14, 0xa5,
|
||||
0x9d, 0xa4, 0x66, 0x7e, 0xf0, 0x14, 0x45, 0x09, 0x20, 0xd9, 0x19, 0x40,
|
||||
0x6f, 0x00, 0x7d, 0x01, 0x38, 0x65, 0x5b, 0x92, 0xf4, 0x19, 0xa8, 0x8a,
|
||||
0xa2, 0x38, 0x49, 0x86, 0x03, 0x88, 0x06, 0xa0, 0xda, 0xed, 0x76, 0x8f,
|
||||
0xae, 0xeb, 0x1d, 0x3e, 0xda, 0xf9, 0x91, 0x0c, 0x05, 0xd0, 0x15, 0x40,
|
||||
0x02, 0x80, 0x48, 0x00, 0x14, 0x42, 0x28, 0x37, 0x79, 0x68, 0x55, 0x21,
|
||||
0x44, 0x30, 0x00, 0xc3, 0x9e, 0xde, 0x00, 0xec, 0x00, 0x84, 0xa2, 0x28,
|
||||
0xba, 0x97, 0xed, 0xdf, 0x3a, 0x2a, 0x84, 0x1d, 0x40, 0xa8, 0xbc, 0x2e,
|
||||
0x1c, 0x80, 0x6e, 0xb7, 0xdb, 0x85, 0xb7, 0x4d, 0xaa, 0xaa, 0xfa, 0x91,
|
||||
0x0c, 0x94, 0x76, 0x74, 0x01, 0x10, 0x26, 0x3f, 0xc1, 0x00, 0xe8, 0xe7,
|
||||
0xe7, 0xa7, 0x6a, 0x9a, 0x66, 0xbe, 0xc6, 0x26, 0x84, 0x08, 0x01, 0x10,
|
||||
0x01, 0x60, 0x20, 0x80, 0xbb, 0x01, 0xe8, 0x0e, 0x87, 0x43, 0x68, 0x9a,
|
||||
0x66, 0x08, 0x01, 0x84, 0x10, 0x2a, 0x80, 0x40, 0x00, 0x9d, 0x00, 0x74,
|
||||
0x93, 0x36, 0x84, 0x99, 0x3e, 0x21, 0x00, 0x84, 0xd3, 0xe9, 0x54, 0x3c,
|
||||
0x1e, 0x8f, 0xc7, 0x24, 0x02, 0x8a, 0x10, 0x22, 0x50, 0xb6, 0xbf, 0x0b,
|
||||
0xc0, 0x3d, 0x72, 0xfc, 0x0d, 0x7f, 0xbd, 0xc7, 0x5f, 0x11, 0x42, 0x04,
|
||||
0xc9, 0xf6, 0x7d, 0x01, 0xc4, 0x1b, 0x62, 0xf6, 0x7d, 0xe3, 0x63, 0xf1,
|
||||
0xf3, 0xc2, 0xf6, 0x53, 0x09, 0x49, 0x47, 0x47, 0x47, 0xd0, 0x43, 0x0f,
|
||||
0x3d, 0xb4, 0x63, 0xe6, 0xcc, 0x99, 0x3d, 0x47, 0x8d, 0x1a, 0xb5, 0xd1,
|
||||
0xed, 0x76, 0xff, 0xeb, 0x8d, 0x71, 0x23, 0x02, 0x75, 0x5d, 0x8f, 0x4d,
|
||||
0x49, 0x49, 0x59, 0x9b, 0x9d, 0x9d, 0x7d, 0x6f, 0x97, 0x2e, 0x5d, 0x70,
|
||||
0xf2, 0xe4, 0x49, 0xcc, 0x9f, 0x3f, 0xff, 0xe3, 0x86, 0x86, 0x86, 0x09,
|
||||
0xaa, 0xaa, 0x9e, 0xd5, 0x34, 0xad, 0xd5, 0x6b, 0x26, 0xf4, 0xd3, 0x75,
|
||||
0x3d, 0x22, 0x2a, 0x2a, 0x6a, 0xf5, 0xda, 0xb5, 0x6b, 0x47, 0x95, 0x94,
|
||||
0x94, 0x7c, 0xb5, 0x6d, 0xdb, 0xb6, 0x01, 0x00, 0xae, 0x99, 0x67, 0x37,
|
||||
0x21, 0x84, 0x43, 0xd7, 0xf5, 0x30, 0x55, 0x55, 0xe7, 0x15, 0x14, 0x14,
|
||||
0x4c, 0x8b, 0x8d, 0x8d, 0x45, 0x73, 0x73, 0x33, 0x76, 0xef, 0xde, 0xdd,
|
||||
0x58, 0x52, 0x52, 0x92, 0xaf, 0x28, 0xca, 0x66, 0x5d, 0xd7, 0x9b, 0x00,
|
||||
0x18, 0x01, 0x27, 0x14, 0x45, 0x09, 0xd6, 0x75, 0xfd, 0x9f, 0x32, 0x33,
|
||||
0x33, 0x57, 0x67, 0x66, 0x66, 0x46, 0x87, 0x84, 0x84, 0xe0, 0xe4, 0xc9,
|
||||
0x93, 0x98, 0x39, 0x73, 0xe6, 0x5f, 0xdb, 0xdb, 0xdb, 0xa7, 0xda, 0x6c,
|
||||
0xb6, 0xb3, 0x1e, 0x8f, 0xa7, 0xd5, 0x3b, 0x28, 0x48, 0x86, 0x00, 0x18,
|
||||
0x53, 0x58, 0x58, 0xf8, 0x1f, 0xa1, 0xa1, 0xa1, 0xa8, 0xa8, 0xa8, 0x38,
|
||||
0x5d, 0x59, 0x59, 0x79, 0xaf, 0x97, 0x4d, 0x42, 0xd3, 0x34, 0x57, 0x42,
|
||||
0x42, 0xc2, 0xc6, 0x89, 0x13, 0x27, 0x3e, 0xe4, 0x76, 0xbb, 0x75, 0x21,
|
||||
0x04, 0xe5, 0x7d, 0x79, 0xe0, 0xc0, 0x01, 0x65, 0xd3, 0xa6, 0x4d, 0x3d,
|
||||
0xe4, 0x35, 0x1e, 0xe9, 0x6b, 0x28, 0xc9, 0x11, 0x39, 0x39, 0x39, 0x6b,
|
||||
0xd2, 0xd2, 0xd2, 0x02, 0xec, 0x76, 0x3b, 0xf6, 0xec, 0xd9, 0xc3, 0xb9,
|
||||
0x73, 0xe7, 0xbe, 0xa6, 0x28, 0xca, 0x52, 0x92, 0x17, 0x48, 0x76, 0x90,
|
||||
0x54, 0x01, 0xa4, 0xbc, 0xf2, 0xca, 0x2b, 0xef, 0xba, 0x5c, 0xae, 0x0e,
|
||||
0x92, 0xc2, 0x4b, 0x08, 0x59, 0x57, 0x57, 0x67, 0x2f, 0x29, 0x29, 0x49,
|
||||
0x04, 0x50, 0x23, 0x85, 0x4f, 0xb1, 0xd9, 0x6c, 0x21, 0x1e, 0x8f, 0x67,
|
||||
0x50, 0x7a, 0x7a, 0xfa, 0xea, 0xcc, 0xcc, 0xcc, 0xbb, 0xc2, 0xc2, 0xc2,
|
||||
0x50, 0x5f, 0x5f, 0x8f, 0x17, 0x5f, 0x7c, 0xf1, 0xe3, 0xc6, 0xc6, 0xc6,
|
||||
0x89, 0x36, 0x9b, 0xed, 0x6b, 0x8f, 0xc7, 0xd3, 0x62, 0x12, 0xeb, 0x4e,
|
||||
0xba, 0xae, 0x0f, 0xc8, 0xc8, 0xc8, 0xf8, 0xcf, 0xac, 0xac, 0xac, 0x98,
|
||||
0xa8, 0xa8, 0x28, 0x1c, 0x3e, 0x7c, 0x18, 0x33, 0x66, 0xcc, 0xd8, 0xea,
|
||||
0xf1, 0x78, 0x72, 0x54, 0x55, 0x3d, 0x6f, 0xfa, 0xbe, 0x2c, 0x7e, 0xe1,
|
||||
0x04, 0x01, 0x18, 0xbb, 0x73, 0xe7, 0x4e, 0x56, 0x55, 0x55, 0x11, 0x40,
|
||||
0x1a, 0x00, 0x97, 0xe9, 0xff, 0xed, 0x00, 0x7a, 0x0e, 0x1c, 0x38, 0xf0,
|
||||
0x6b, 0x4a, 0x76, 0xee, 0xdc, 0x69, 0xfc, 0x93, 0xbd, 0x7b, 0xf7, 0xfe,
|
||||
0x40, 0xce, 0xdc, 0x8a, 0x9c, 0x3d, 0x9d, 0xf2, 0xf7, 0x91, 0x00, 0x4a,
|
||||
0xb7, 0x6c, 0xd9, 0x42, 0x92, 0x7c, 0xee, 0xb9, 0xe7, 0xea, 0x64, 0x26,
|
||||
0xa0, 0x78, 0xa5, 0xc3, 0x61, 0x00, 0x0a, 0xcf, 0x9c, 0x39, 0x43, 0x92,
|
||||
0xac, 0xaf, 0xaf, 0x67, 0x53, 0x53, 0x13, 0x49, 0xf2, 0xa3, 0x8f, 0x3e,
|
||||
0x22, 0x80, 0x69, 0xc6, 0xcc, 0x28, 0x05, 0xc3, 0x09, 0xe0, 0xd7, 0x63,
|
||||
0xc7, 0x8e, 0xf5, 0x90, 0xe4, 0xc5, 0x8b, 0x17, 0xb9, 0x77, 0xef, 0x5e,
|
||||
0x92, 0xa4, 0xc7, 0xe3, 0x61, 0xff, 0xfe, 0xfd, 0x77, 0x03, 0x88, 0xf2,
|
||||
0xce, 0x90, 0x14, 0x45, 0xf1, 0x07, 0xd0, 0x7f, 0xce, 0x9c, 0x39, 0xed,
|
||||
0x86, 0xed, 0x73, 0xe6, 0xcc, 0x39, 0xe7, 0xc3, 0x26, 0x15, 0x40, 0x8f,
|
||||
0x59, 0xb3, 0x66, 0x9d, 0xa3, 0x0f, 0xde, 0x7a, 0xeb, 0x2d, 0x9a, 0x32,
|
||||
0x0e, 0x63, 0xfc, 0x1e, 0x5e, 0xbc, 0x78, 0x31, 0x49, 0xf2, 0xc8, 0x91,
|
||||
0x23, 0xdf, 0xd8, 0x73, 0xec, 0xd8, 0x31, 0x02, 0x98, 0x29, 0xdb, 0x40,
|
||||
0xce, 0xda, 0xd3, 0xae, 0x5d, 0xbb, 0xc6, 0x9b, 0x51, 0x5d, 0x5d, 0x4d,
|
||||
0x00, 0xa3, 0x00, 0x38, 0x0c, 0x81, 0x04, 0x10, 0x3f, 0x63, 0xc6, 0x8c,
|
||||
0x76, 0x92, 0xec, 0xe8, 0xe8, 0xe0, 0xc7, 0x1f, 0x7f, 0xfc, 0x4d, 0xfb,
|
||||
0xfb, 0xef, 0xbf, 0xff, 0x6f, 0x72, 0xbc, 0x55, 0xe9, 0xa7, 0x0b, 0xc0,
|
||||
0xc0, 0xc7, 0x1e, 0x7b, 0xcc, 0x63, 0xb4, 0x31, 0xec, 0xb9, 0x72, 0xe5,
|
||||
0x0a, 0xa3, 0xa3, 0xa3, 0xff, 0xe2, 0x6b, 0x7c, 0x2c, 0x7e, 0x99, 0x28,
|
||||
0x00, 0xba, 0x85, 0x86, 0x86, 0x6e, 0x21, 0xc9, 0x09, 0x13, 0x26, 0x9c,
|
||||
0x92, 0x29, 0xa6, 0xdd, 0xd4, 0x26, 0x10, 0xc0, 0xd4, 0x9a, 0x9a, 0x1a,
|
||||
0x92, 0x64, 0x48, 0x48, 0xc8, 0x61, 0x00, 0x73, 0x87, 0x0f, 0x1f, 0xde,
|
||||
0x40, 0x92, 0x1b, 0x37, 0x6e, 0x24, 0x80, 0xa1, 0x32, 0x30, 0x01, 0xc0,
|
||||
0x15, 0x13, 0x13, 0xb3, 0x65, 0xd7, 0xae, 0x5d, 0x6c, 0x69, 0x69, 0x21,
|
||||
0x49, 0x9d, 0x24, 0xa7, 0x4f, 0x9f, 0x7e, 0x1a, 0xc0, 0xaf, 0x7c, 0x04,
|
||||
0x5b, 0xf4, 0xbc, 0x79, 0xf3, 0xae, 0x90, 0xe4, 0x4b, 0x2f, 0xbd, 0xa4,
|
||||
0x03, 0x58, 0x0a, 0x60, 0xc3, 0xd6, 0xad, 0x5b, 0x49, 0x92, 0x4f, 0x3d,
|
||||
0xf5, 0xd4, 0x49, 0x00, 0x77, 0x98, 0xae, 0x0b, 0x04, 0xb0, 0x84, 0x24,
|
||||
0x8f, 0x1f, 0x3f, 0x4e, 0x00, 0xef, 0x00, 0xf8, 0xdd, 0xe3, 0x8f, 0x3f,
|
||||
0xde, 0x46, 0x92, 0x6f, 0xbc, 0xf1, 0x06, 0x65, 0x1a, 0xee, 0xf0, 0xba,
|
||||
0xcf, 0x9d, 0xc1, 0xc1, 0xc1, 0x5b, 0x48, 0x72, 0xfd, 0xfa, 0xf5, 0x3a,
|
||||
0x49, 0xce, 0x9a, 0x35, 0xeb, 0x3c, 0x80, 0x5e, 0x5e, 0xc1, 0x60, 0x07,
|
||||
0xd0, 0xf7, 0xd5, 0x57, 0x5f, 0x25, 0x49, 0x02, 0xf8, 0x0c, 0xc0, 0x46,
|
||||
0x21, 0xc4, 0x3a, 0x00, 0xab, 0x5c, 0x2e, 0x57, 0x81, 0x14, 0x2d, 0xa3,
|
||||
0x5e, 0xd1, 0x6d, 0xf0, 0xe0, 0xc1, 0x7b, 0x48, 0xb2, 0xa2, 0xa2, 0x82,
|
||||
0x00, 0x96, 0x01, 0xc8, 0x2f, 0x2a, 0x2a, 0x62, 0x43, 0x43, 0x03, 0xb3,
|
||||
0xb2, 0xb2, 0xbe, 0x30, 0x09, 0xaa, 0xa3, 0x53, 0xa7, 0x4e, 0xf7, 0x87,
|
||||
0x86, 0x86, 0xbe, 0x19, 0x19, 0x19, 0xf9, 0x76, 0x64, 0x64, 0xe4, 0x96,
|
||||
0x88, 0x88, 0x88, 0xbf, 0x38, 0x1c, 0x8e, 0x4f, 0x66, 0xce, 0x9c, 0xa9,
|
||||
0x91, 0x64, 0x66, 0x66, 0xe6, 0x69, 0x99, 0xb6, 0x1b, 0x19, 0x5e, 0x00,
|
||||
0x80, 0xf9, 0xcd, 0xcd, 0xcd, 0x6c, 0x6b, 0x6b, 0x23, 0x80, 0xdd, 0x00,
|
||||
0xe6, 0x24, 0x26, 0x26, 0xd6, 0x92, 0x64, 0x79, 0x79, 0x39, 0x01, 0xdc,
|
||||
0x6f, 0xf2, 0xb7, 0xb3, 0xcd, 0x66, 0x5b, 0x4b, 0x92, 0x4d, 0x4d, 0x4d,
|
||||
0x04, 0x50, 0x05, 0x60, 0x56, 0xdf, 0xbe, 0x7d, 0x4f, 0x93, 0xe4, 0xdb,
|
||||
0x6f, 0xbf, 0x4d, 0x00, 0x0f, 0x08, 0x21, 0x5c, 0xd6, 0xe3, 0x6f, 0xe1,
|
||||
0x07, 0x20, 0x3e, 0x3f, 0x3f, 0xdf, 0x2d, 0x1f, 0xf6, 0x65, 0x72, 0x1d,
|
||||
0x6b, 0x4e, 0x4d, 0x23, 0xfc, 0xfd, 0xfd, 0x37, 0x91, 0xe4, 0x9e, 0x3d,
|
||||
0x7b, 0x08, 0x60, 0xaa, 0x5c, 0x53, 0xae, 0xd2, 0x34, 0x8d, 0x8d, 0x8d,
|
||||
0x8d, 0x04, 0x30, 0xdf, 0x34, 0xcb, 0xb9, 0x62, 0x62, 0x62, 0x36, 0x94,
|
||||
0x94, 0x94, 0xe8, 0x4b, 0x96, 0x2c, 0xe9, 0xf8, 0xe4, 0x93, 0x4f, 0x34,
|
||||
0x93, 0x00, 0xc4, 0x78, 0x09, 0x80, 0x0d, 0xc0, 0x3d, 0x1b, 0x36, 0x6c,
|
||||
0x20, 0x49, 0x46, 0x45, 0x45, 0xbd, 0x0b, 0x20, 0x16, 0xc0, 0xb0, 0x29,
|
||||
0x53, 0xa6, 0x34, 0x90, 0xe4, 0x8a, 0x15, 0x2b, 0x28, 0x83, 0xd4, 0x08,
|
||||
0x08, 0x67, 0x44, 0x44, 0xc4, 0xc6, 0xb2, 0xb2, 0x32, 0x66, 0x65, 0x65,
|
||||
0x11, 0xc0, 0xbd, 0x00, 0x1e, 0x08, 0x0f, 0x0f, 0xdf, 0x4e, 0x92, 0xdb,
|
||||
0xb6, 0x6d, 0x23, 0x80, 0xdf, 0x78, 0x09, 0x40, 0x27, 0x00, 0x99, 0x95,
|
||||
0x95, 0x95, 0x5c, 0xb3, 0x66, 0x8d, 0x67, 0xf2, 0xe4, 0xc9, 0x17, 0x49,
|
||||
0x72, 0xf6, 0xec, 0xd9, 0xbe, 0x04, 0xc0, 0x09, 0x20, 0x65, 0xf3, 0xe6,
|
||||
0xcd, 0x3c, 0x70, 0xe0, 0x00, 0x01, 0x14, 0x03, 0x78, 0x06, 0x40, 0xba,
|
||||
0xbc, 0x57, 0x94, 0x49, 0xec, 0x1c, 0x00, 0xee, 0x5d, 0xb9, 0x72, 0x25,
|
||||
0x49, 0x32, 0x21, 0x21, 0xa1, 0x1a, 0xc0, 0x63, 0x00, 0xc6, 0x02, 0x98,
|
||||
0x02, 0x60, 0x06, 0x80, 0x24, 0xbb, 0xdd, 0xee, 0x6f, 0xac, 0xa5, 0x64,
|
||||
0xff, 0x21, 0xb2, 0xb6, 0x10, 0x0d, 0x60, 0x48, 0x42, 0x42, 0xc2, 0x21,
|
||||
0x92, 0x5c, 0xbe, 0x7c, 0x39, 0x01, 0xa4, 0xaa, 0xaa, 0x1a, 0x62, 0xfa,
|
||||
0x0e, 0x02, 0x00, 0x2c, 0x32, 0x8d, 0xff, 0x7c, 0x99, 0xa5, 0x55, 0x90,
|
||||
0x64, 0x65, 0x65, 0x25, 0x01, 0x3c, 0x68, 0xf2, 0x37, 0x2a, 0x23, 0x23,
|
||||
0xa3, 0x9a, 0x24, 0x57, 0xad, 0x5a, 0x45, 0x00, 0x23, 0x00, 0xf4, 0x01,
|
||||
0x30, 0xf7, 0xc8, 0x91, 0x23, 0x74, 0xbb, 0xdd, 0x04, 0x50, 0x20, 0x6d,
|
||||
0xb0, 0xf8, 0x85, 0x13, 0x0a, 0x60, 0x6e, 0x7d, 0x7d, 0x3d, 0xd7, 0xad,
|
||||
0x5b, 0x67, 0xcc, 0xe4, 0xde, 0x33, 0x43, 0xd7, 0xa4, 0xa4, 0xa4, 0x2a,
|
||||
0x92, 0xdc, 0xb4, 0x69, 0x13, 0x01, 0xa4, 0xc8, 0xe2, 0x58, 0xce, 0x89,
|
||||
0x13, 0x27, 0x48, 0x92, 0x8a, 0xa2, 0xac, 0x95, 0x05, 0x27, 0xa8, 0xaa,
|
||||
0xea, 0x90, 0x0f, 0x57, 0x2f, 0x00, 0xe9, 0xc6, 0x4c, 0x7a, 0x13, 0x01,
|
||||
0x50, 0x00, 0x84, 0xb9, 0x5c, 0xae, 0x17, 0x01, 0xbc, 0x1c, 0x1c, 0x1c,
|
||||
0x3c, 0x42, 0x16, 0xc7, 0x7e, 0xbb, 0x64, 0xc9, 0x12, 0x8d, 0x24, 0x17,
|
||||
0x2d, 0x5a, 0xd4, 0x26, 0x8b, 0x93, 0x46, 0x8a, 0xeb, 0x90, 0x01, 0xdd,
|
||||
0x03, 0xc0, 0x5d, 0x42, 0x88, 0x2c, 0x00, 0xeb, 0x0a, 0x0b, 0x0b, 0x49,
|
||||
0x92, 0x63, 0xc6, 0x8c, 0x39, 0x2f, 0x33, 0x0d, 0x9b, 0x0c, 0x3a, 0x3f,
|
||||
0x00, 0x31, 0x23, 0x46, 0x8c, 0xf8, 0x5f, 0x29, 0x72, 0x15, 0xb9, 0xb9,
|
||||
0xb9, 0x8d, 0x26, 0x01, 0xb8, 0xcb, 0xcb, 0x26, 0x7f, 0x00, 0xe3, 0xab,
|
||||
0xab, 0xab, 0x59, 0x56, 0x56, 0xd6, 0xb1, 0x60, 0xc1, 0x82, 0x8e, 0xbd,
|
||||
0x7b, 0xf7, 0xb2, 0xa2, 0xa2, 0x82, 0x83, 0x07, 0x0f, 0x3e, 0x0e, 0x20,
|
||||
0x49, 0x06, 0xa8, 0x21, 0x16, 0xe9, 0xdb, 0xb7, 0x6f, 0x37, 0xb2, 0x85,
|
||||
0xfa, 0xd2, 0xd2, 0x52, 0xbd, 0xbc, 0xbc, 0x9c, 0x05, 0x05, 0x05, 0xed,
|
||||
0x32, 0x9b, 0xe9, 0x61, 0x12, 0x0c, 0xef, 0xec, 0x2b, 0x02, 0x40, 0xde,
|
||||
0xa9, 0x53, 0xa7, 0x78, 0xf6, 0xec, 0x59, 0x02, 0x28, 0x34, 0xa7, 0xf3,
|
||||
0xa6, 0x25, 0xcf, 0x83, 0xcb, 0x97, 0x2f, 0x27, 0x49, 0x26, 0x27, 0x27,
|
||||
0x37, 0x01, 0x78, 0x7f, 0xe9, 0xd2, 0xa5, 0x6e, 0x92, 0x4c, 0x4b, 0x4b,
|
||||
0xab, 0x97, 0xe3, 0x63, 0x08, 0x64, 0xd7, 0x09, 0x13, 0x26, 0xd4, 0x90,
|
||||
0xe4, 0xeb, 0xaf, 0xbf, 0x4e, 0x00, 0xa9, 0x32, 0xa3, 0xf8, 0xdd, 0xb1,
|
||||
0x63, 0xc7, 0x48, 0x92, 0x01, 0x01, 0x01, 0x6f, 0xc8, 0x7b, 0x5b, 0xfc,
|
||||
0xc2, 0x77, 0x11, 0x7a, 0x0c, 0x19, 0x32, 0x64, 0x2f, 0x49, 0xf6, 0xeb,
|
||||
0xd7, 0x6f, 0xb7, 0x51, 0xad, 0xf7, 0x5a, 0xa3, 0xdf, 0x39, 0x66, 0xcc,
|
||||
0x98, 0xfd, 0x24, 0x59, 0x5a, 0x5a, 0x4a, 0x00, 0x83, 0x64, 0x0a, 0x9c,
|
||||
0x7d, 0xe8, 0xd0, 0x21, 0x63, 0x59, 0xb0, 0x41, 0x8a, 0x82, 0xf9, 0xe1,
|
||||
0xf6, 0x07, 0xd0, 0x6f, 0xd9, 0xb2, 0x65, 0xdf, 0x27, 0x00, 0x42, 0x55,
|
||||
0x55, 0x9b, 0x4c, 0x91, 0x43, 0x64, 0xf0, 0x27, 0x0d, 0x1d, 0x3a, 0xb4,
|
||||
0x96, 0x24, 0x75, 0x5d, 0x67, 0x58, 0x58, 0xd8, 0x66, 0x1f, 0x59, 0x89,
|
||||
0x22, 0x67, 0xbc, 0xd0, 0xe9, 0xd3, 0xa7, 0x5f, 0x31, 0xd6, 0xba, 0x79,
|
||||
0x79, 0x79, 0x04, 0xb0, 0xd2, 0x66, 0xb3, 0xdd, 0x85, 0x6f, 0xb7, 0xbf,
|
||||
0x22, 0x01, 0x2c, 0xbc, 0x7c, 0xf9, 0x32, 0x9f, 0x7d, 0xf6, 0xd9, 0x26,
|
||||
0x00, 0x8f, 0xe5, 0xe6, 0xe6, 0x5e, 0x30, 0x2d, 0x01, 0xee, 0xf1, 0x2a,
|
||||
0xa8, 0x06, 0x00, 0xc8, 0xbd, 0x74, 0xe9, 0x12, 0x49, 0xb2, 0xb6, 0xb6,
|
||||
0x96, 0x95, 0x95, 0x95, 0xdf, 0xac, 0xb9, 0xc7, 0x8f, 0x1f, 0x7f, 0x19,
|
||||
0x40, 0x6f, 0xb9, 0x36, 0x77, 0x01, 0x78, 0xea, 0xe0, 0xc1, 0x83, 0x24,
|
||||
0xa9, 0xb7, 0xb7, 0xb7, 0xf3, 0xe8, 0xd1, 0xa3, 0xac, 0xad, 0xad, 0x35,
|
||||
0xd7, 0x00, 0x16, 0xca, 0x5d, 0x07, 0xef, 0x1d, 0x09, 0x27, 0x80, 0xc4,
|
||||
0xf9, 0xf3, 0xe7, 0xbb, 0x49, 0x32, 0x3d, 0x3d, 0xbd, 0x0e, 0xc0, 0xdd,
|
||||
0x52, 0xb0, 0x6e, 0xc8, 0xd2, 0x84, 0x10, 0x09, 0x00, 0x76, 0x9c, 0x3f,
|
||||
0x7f, 0xfe, 0x86, 0x7a, 0x81, 0x0c, 0xf0, 0x65, 0x26, 0x7f, 0x01, 0x20,
|
||||
0x3c, 0x22, 0x22, 0xa2, 0x9c, 0x24, 0x1b, 0x1b, 0x1b, 0x69, 0xb3, 0xd9,
|
||||
0x3e, 0x03, 0xb0, 0xe8, 0xbe, 0xfb, 0xee, 0xfb, 0xe6, 0xe2, 0x9e, 0x3d,
|
||||
0x7b, 0x6e, 0x95, 0x19, 0x88, 0xc5, 0x2f, 0x15, 0x21, 0x84, 0x3f, 0x80,
|
||||
0xa4, 0xb2, 0xb2, 0x32, 0x9e, 0x38, 0x71, 0xc2, 0x28, 0x56, 0x75, 0xf2,
|
||||
0x6e, 0x06, 0xe0, 0xce, 0x47, 0x1f, 0x7d, 0xf4, 0x73, 0x92, 0x5c, 0xb3,
|
||||
0x66, 0x0d, 0x01, 0x0c, 0x96, 0x02, 0x30, 0xc9, 0xa8, 0x0b, 0x04, 0x05,
|
||||
0x05, 0x79, 0x0b, 0x80, 0xb1, 0x96, 0xbe, 0xf7, 0x16, 0x02, 0x00, 0x53,
|
||||
0xa1, 0x2b, 0x0a, 0xc0, 0xd3, 0xd3, 0xa7, 0x4f, 0x6f, 0x31, 0x1e, 0xd4,
|
||||
0xb8, 0xb8, 0xb8, 0xaf, 0x01, 0xf4, 0x96, 0x05, 0x3c, 0x73, 0xf0, 0xdb,
|
||||
0xe5, 0xec, 0xdb, 0x79, 0xe4, 0xc8, 0x91, 0x15, 0xb3, 0x67, 0xcf, 0xbe,
|
||||
0x68, 0xcc, 0x6e, 0xf9, 0xf9, 0xf9, 0x04, 0xf0, 0x80, 0x0c, 0x1c, 0x07,
|
||||
0x80, 0xfe, 0x0b, 0x17, 0x2e, 0xf4, 0xd4, 0xd5, 0xd5, 0x11, 0x40, 0x09,
|
||||
0x80, 0x09, 0xcf, 0x3f, 0xff, 0x7c, 0x93, 0x2c, 0x4c, 0x36, 0x01, 0xe8,
|
||||
0xe7, 0x70, 0x38, 0xcc, 0x7e, 0xfb, 0x05, 0x04, 0x04, 0x4c, 0xcb, 0xcf,
|
||||
0xcf, 0xbf, 0x94, 0x9b, 0x9b, 0xdb, 0x06, 0xe0, 0x25, 0x00, 0x53, 0x12,
|
||||
0x13, 0x13, 0xcf, 0x99, 0xd6, 0xd5, 0x2f, 0x4a, 0xa1, 0xf0, 0x07, 0x30,
|
||||
0xf1, 0xf0, 0xe1, 0xc3, 0x94, 0x82, 0x72, 0x15, 0x40, 0x11, 0x80, 0x15,
|
||||
0x6f, 0xbe, 0xf9, 0x26, 0x49, 0xf2, 0x85, 0x17, 0x5e, 0x68, 0x96, 0x33,
|
||||
0xb4, 0x77, 0xf1, 0x33, 0x02, 0xc0, 0x6a, 0xa3, 0x70, 0x08, 0x60, 0xb6,
|
||||
0x14, 0x0a, 0xef, 0xf3, 0x1d, 0x21, 0x00, 0x72, 0x8d, 0x2c, 0x63, 0xca,
|
||||
0x94, 0x29, 0x9e, 0xe4, 0xe4, 0xe4, 0xfd, 0x9b, 0x37, 0x6f, 0x36, 0xfb,
|
||||
0x3b, 0x4c, 0x0a, 0x8a, 0x21, 0xbc, 0x29, 0x79, 0x79, 0x79, 0xdf, 0x08,
|
||||
0xc5, 0xe9, 0xd3, 0xa7, 0x49, 0x92, 0x47, 0x8f, 0x1e, 0xd5, 0x49, 0xb2,
|
||||
0x5b, 0xb7, 0x6e, 0x5b, 0x2c, 0x01, 0xb8, 0x3d, 0xb1, 0xc9, 0x07, 0x20,
|
||||
0x14, 0x40, 0xa0, 0xa2, 0x28, 0x7e, 0xf0, 0x7d, 0x60, 0xc8, 0x98, 0x19,
|
||||
0x57, 0x92, 0xe4, 0xcb, 0x2f, 0xbf, 0xdc, 0x26, 0xd3, 0x44, 0x87, 0x8f,
|
||||
0xb6, 0x5d, 0x87, 0x0c, 0x19, 0xb2, 0xc3, 0x54, 0x01, 0x1f, 0x21, 0x83,
|
||||
0x75, 0x76, 0x5d, 0x5d, 0x1d, 0x49, 0x52, 0x08, 0x51, 0x2a, 0x45, 0xc1,
|
||||
0x8c, 0xe3, 0x07, 0x0a, 0x80, 0x5d, 0xa6, 0xbd, 0x0b, 0xde, 0x7b, 0xef,
|
||||
0x3d, 0x92, 0xe4, 0x17, 0x5f, 0x7c, 0xc1, 0xe8, 0xe8, 0xe8, 0xed, 0x00,
|
||||
0xe2, 0x55, 0x55, 0x0d, 0x36, 0xfb, 0xe0, 0x74, 0x3a, 0x03, 0x00, 0xfc,
|
||||
0x5a, 0xae, 0xc9, 0x87, 0xca, 0xe0, 0x1a, 0x00, 0xe0, 0x43, 0x5d, 0xd7,
|
||||
0x8d, 0x54, 0x7c, 0xa9, 0xac, 0x49, 0xb8, 0x00, 0xcc, 0x6e, 0x69, 0x69,
|
||||
0x61, 0x79, 0x79, 0xb9, 0x5e, 0x54, 0x54, 0xd4, 0x56, 0x50, 0x50, 0xe0,
|
||||
0x7e, 0xff, 0xfd, 0xf7, 0x75, 0x63, 0xfd, 0x9c, 0x9d, 0x9d, 0x4d, 0x5c,
|
||||
0xdf, 0xb7, 0x87, 0x5c, 0xc2, 0xf8, 0x4b, 0x7b, 0xe2, 0x01, 0xc4, 0x2a,
|
||||
0x8a, 0xd2, 0x43, 0xda, 0x5d, 0x74, 0xe1, 0xc2, 0x05, 0x63, 0xc9, 0x53,
|
||||
0x2a, 0xc5, 0xd2, 0x05, 0x60, 0x4c, 0x55, 0x55, 0x95, 0x71, 0xdf, 0x72,
|
||||
0x79, 0xdd, 0x80, 0xd4, 0xd4, 0xd4, 0x43, 0xa6, 0x65, 0xd3, 0x40, 0xaf,
|
||||
0x2c, 0xc3, 0x0e, 0xa0, 0x77, 0x6e, 0x6e, 0x6e, 0xb3, 0x14, 0x89, 0x56,
|
||||
0x39, 0xfe, 0x7e, 0x3e, 0xc6, 0x3f, 0x2a, 0x3d, 0x3d, 0xbd, 0xda, 0xd4,
|
||||
0xd7, 0x54, 0x00, 0xc3, 0x01, 0xac, 0xbf, 0x78, 0xf1, 0x22, 0x4d, 0xb5,
|
||||
0x9b, 0x60, 0xd9, 0xaf, 0x5d, 0x08, 0xd1, 0x15, 0xc0, 0xb8, 0x07, 0x1f,
|
||||
0x7c, 0xf0, 0x60, 0x69, 0x69, 0x29, 0x57, 0xaf, 0x5e, 0x4d, 0x87, 0xc3,
|
||||
0x71, 0xd8, 0xb0, 0x53, 0x16, 0x34, 0xc3, 0xac, 0x70, 0xf9, 0xf9, 0x57,
|
||||
0xf0, 0xbd, 0x71, 0x02, 0x98, 0xde, 0xbd, 0x7b, 0xf7, 0x95, 0x11, 0x11,
|
||||
0x11, 0xa5, 0xba, 0xae, 0x87, 0xc1, 0xf7, 0x76, 0x8f, 0x0d, 0x40, 0xd0,
|
||||
0xa4, 0x49, 0x93, 0x32, 0x01, 0xe0, 0xb5, 0xd7, 0x5e, 0xab, 0x00, 0x70,
|
||||
0x11, 0xdf, 0xee, 0xb5, 0x9b, 0xe9, 0xa8, 0xae, 0xae, 0x3e, 0x01, 0x00,
|
||||
0x71, 0x71, 0x71, 0x90, 0x0f, 0x78, 0x37, 0x00, 0x7d, 0xba, 0x77, 0xef,
|
||||
0x8e, 0xb3, 0x67, 0xcf, 0x82, 0xe4, 0x97, 0x00, 0xdc, 0x7f, 0x4f, 0x22,
|
||||
0x22, 0xab, 0xfa, 0xe9, 0x9b, 0x36, 0x6d, 0x7a, 0xe5, 0xe1, 0x87, 0x1f,
|
||||
0xc6, 0x8a, 0x15, 0x2b, 0x10, 0x1b, 0x1b, 0xbb, 0xaa, 0xae, 0xae, 0x6e,
|
||||
0x01, 0x80, 0x36, 0x4d, 0xd3, 0x84, 0xaa, 0xaa, 0x46, 0x60, 0x88, 0xb6,
|
||||
0xb6, 0x36, 0xe5, 0xe9, 0xa7, 0x9f, 0x7e, 0xef, 0xd8, 0xb1, 0x63, 0xef,
|
||||
0xe6, 0xe4, 0xe4, 0xec, 0x96, 0x82, 0xd7, 0x01, 0xe0, 0xe0, 0xf9, 0xf3,
|
||||
0xe7, 0x8d, 0x8c, 0xc2, 0x85, 0x6f, 0x4f, 0x1f, 0xb6, 0xd5, 0xd6, 0xd6,
|
||||
0x62, 0xf8, 0xf0, 0xe1, 0x62, 0xe2, 0xc4, 0x89, 0x7e, 0xd9, 0xd9, 0xd9,
|
||||
0xf6, 0x51, 0xa3, 0x46, 0x09, 0x92, 0x4c, 0x4d, 0x4d, 0x45, 0x4a, 0x4a,
|
||||
0x0a, 0x4c, 0x05, 0x4c, 0x68, 0x9a, 0xc6, 0xd4, 0xd4, 0xd4, 0xe5, 0xd3,
|
||||
0xa6, 0x4d, 0xfb, 0xd3, 0xb0, 0x61, 0xc3, 0xfe, 0xa0, 0xeb, 0xba, 0x43,
|
||||
0x8a, 0x99, 0xd3, 0xe1, 0xb8, 0xae, 0x8f, 0xba, 0xae, 0xb7, 0xe2, 0xdb,
|
||||
0x93, 0x75, 0x5f, 0xd6, 0xd4, 0xd4, 0x5c, 0x8f, 0x6a, 0xbb, 0xdd, 0x4f,
|
||||
0x8e, 0xad, 0x50, 0x14, 0x45, 0x01, 0x80, 0x96, 0x96, 0x16, 0x00, 0x68,
|
||||
0xf3, 0x21, 0x8e, 0x43, 0xc7, 0x8d, 0x1b, 0x17, 0x00, 0x00, 0xeb, 0xd7,
|
||||
0xaf, 0xff, 0x10, 0xc0, 0x15, 0x1f, 0x63, 0x28, 0x00, 0x28, 0xbd, 0x7a,
|
||||
0xf5, 0xea, 0x02, 0x00, 0x17, 0x2e, 0x5c, 0x00, 0x80, 0x5a, 0xd9, 0xf6,
|
||||
0x84, 0xe1, 0xaf, 0xd3, 0xe9, 0x0c, 0x34, 0xed, 0x4a, 0x88, 0xf0, 0xf0,
|
||||
0xf0, 0x5e, 0x00, 0xe2, 0xb6, 0x6f, 0xdf, 0xfe, 0xd1, 0xd4, 0xa9, 0x53,
|
||||
0x47, 0x4f, 0x9b, 0x36, 0xed, 0x61, 0xb7, 0xdb, 0xbd, 0xaf, 0x5f, 0xbf,
|
||||
0x7e, 0xa8, 0xad, 0xad, 0x05, 0xc9, 0x83, 0x00, 0xda, 0xad, 0x10, 0xba,
|
||||
0xfd, 0x08, 0xcf, 0xce, 0xce, 0x3e, 0x40, 0x92, 0x1f, 0x7c, 0xf0, 0x81,
|
||||
0xf7, 0xf6, 0x90, 0x99, 0x20, 0x00, 0xe3, 0x77, 0xed, 0xda, 0x65, 0xb4,
|
||||
0x7b, 0x54, 0x06, 0xa2, 0x2f, 0x02, 0x00, 0xfc, 0x8b, 0xb1, 0x97, 0x1c,
|
||||
0x13, 0x13, 0x53, 0x0b, 0x60, 0x65, 0x46, 0x46, 0xc6, 0x45, 0xd3, 0xb2,
|
||||
0x60, 0x90, 0x8f, 0xd9, 0xcb, 0x01, 0x20, 0xde, 0x94, 0x01, 0x9c, 0xc2,
|
||||
0x77, 0xb7, 0x01, 0x6d, 0x00, 0xa2, 0x8d, 0x8a, 0x7f, 0x75, 0x75, 0x35,
|
||||
0x13, 0x13, 0x13, 0xcf, 0xa4, 0xa6, 0xa6, 0xd6, 0x8c, 0x1e, 0x3d, 0xfa,
|
||||
0x7f, 0xd2, 0xd2, 0xd2, 0xf6, 0x25, 0x24, 0x24, 0x6c, 0x97, 0xa9, 0xb1,
|
||||
0x21, 0x64, 0x9d, 0xbb, 0x77, 0xef, 0xfe, 0x0e, 0x49, 0xee, 0xdf, 0xbf,
|
||||
0x9f, 0x00, 0xb6, 0x01, 0x28, 0x4c, 0x4e, 0x4e, 0xbe, 0x48, 0x92, 0x9f,
|
||||
0x7f, 0xfe, 0x39, 0x01, 0x64, 0x4b, 0x61, 0xb0, 0xfb, 0xf9, 0xf9, 0xdd,
|
||||
0x01, 0xe0, 0xdf, 0xe4, 0x12, 0x67, 0x2e, 0x80, 0x82, 0xc9, 0x93, 0x27,
|
||||
0xb7, 0x92, 0x64, 0x76, 0x76, 0x76, 0x0b, 0x80, 0x7f, 0x17, 0x42, 0x84,
|
||||
0x9b, 0x53, 0xee, 0xf8, 0xf8, 0xf8, 0xad, 0x24, 0xf9, 0xe5, 0x97, 0x5f,
|
||||
0x12, 0xc0, 0x56, 0x00, 0xaf, 0xa6, 0xa5, 0xa5, 0x5d, 0x32, 0x8d, 0xeb,
|
||||
0x68, 0x39, 0xfb, 0x2b, 0x00, 0xee, 0x48, 0x4a, 0x4a, 0xfa, 0x6f, 0x92,
|
||||
0xdc, 0xb0, 0x61, 0x03, 0x01, 0xbc, 0x0e, 0xe0, 0xad, 0x1d, 0x3b, 0x76,
|
||||
0x50, 0x16, 0xe9, 0x8e, 0x00, 0xb8, 0xd3, 0xcb, 0xef, 0x70, 0x55, 0x55,
|
||||
0xd7, 0x91, 0xe4, 0xb9, 0x73, 0xe7, 0x8c, 0xca, 0x7e, 0xa7, 0x9b, 0x8c,
|
||||
0x7f, 0x44, 0x5c, 0x5c, 0xdc, 0x87, 0x24, 0xd9, 0xd0, 0xd0, 0x40, 0x55,
|
||||
0x55, 0xf7, 0x02, 0x58, 0x14, 0x17, 0x17, 0x77, 0xc6, 0xf8, 0x9b, 0xf4,
|
||||
0xcb, 0x10, 0x01, 0x3f, 0x00, 0x79, 0x2d, 0x2d, 0x2d, 0x46, 0x61, 0x71,
|
||||
0x37, 0x80, 0x65, 0x4f, 0x3c, 0xf1, 0xc4, 0x65, 0x92, 0x5c, 0xbc, 0x78,
|
||||
0xb1, 0x2e, 0x45, 0xdc, 0x61, 0x85, 0xcb, 0xed, 0x47, 0xa7, 0x94, 0x94,
|
||||
0x94, 0x9a, 0xba, 0xba, 0x3a, 0x16, 0x17, 0x17, 0x53, 0xa6, 0xc6, 0x76,
|
||||
0x1f, 0xed, 0x22, 0x23, 0x23, 0x23, 0xff, 0x48, 0x92, 0x59, 0x59, 0x59,
|
||||
0x5f, 0x99, 0xab, 0xe6, 0x37, 0xc9, 0x16, 0xba, 0x0f, 0x1b, 0x36, 0xac,
|
||||
0xc6, 0x58, 0x53, 0x9e, 0x3a, 0x75, 0x8a, 0x24, 0xd9, 0xdc, 0xdc, 0x4c,
|
||||
0x97, 0xcb, 0x65, 0xac, 0x27, 0x7d, 0xa5, 0xf6, 0xbd, 0x4a, 0x4a, 0x4a,
|
||||
0x48, 0x92, 0x39, 0x39, 0x39, 0xa7, 0x64, 0xe6, 0xa0, 0x78, 0xb5, 0x19,
|
||||
0x66, 0xac, 0x6f, 0x7d, 0x51, 0x56, 0x56, 0x46, 0x5c, 0x3f, 0x07, 0x60,
|
||||
0x37, 0x09, 0xd2, 0x08, 0xa3, 0xea, 0x6f, 0x5e, 0xe3, 0x92, 0x64, 0x7c,
|
||||
0x7c, 0xfc, 0xdf, 0x64, 0xc0, 0xd9, 0xe4, 0x24, 0x6c, 0x14, 0x19, 0x8d,
|
||||
0x23, 0xb8, 0x7d, 0xe6, 0xcd, 0x9b, 0xd7, 0x28, 0x53, 0xef, 0xf3, 0x00,
|
||||
0x62, 0x64, 0xad, 0xc0, 0x2c, 0x78, 0xbf, 0x2d, 0x2e, 0x2e, 0xa6, 0xb7,
|
||||
0xbf, 0x9a, 0xa6, 0x11, 0xc0, 0x9f, 0xbd, 0x2a, 0xf5, 0x41, 0x00, 0x1e,
|
||||
0x5d, 0xbd, 0x7a, 0x35, 0x8d, 0xc2, 0x9b, 0x71, 0xd0, 0xe7, 0x9d, 0x77,
|
||||
0xde, 0x21, 0x80, 0xa7, 0xe4, 0xb1, 0x65, 0x33, 0x61, 0x29, 0x29, 0x29,
|
||||
0x7f, 0x35, 0x1d, 0x76, 0x4a, 0xc5, 0x8d, 0x87, 0xaf, 0xcc, 0x04, 0x02,
|
||||
0x78, 0x68, 0xe9, 0xd2, 0xa5, 0xdf, 0xb1, 0x87, 0x24, 0x63, 0x63, 0x63,
|
||||
0x4f, 0x00, 0xf8, 0x95, 0xe1, 0x83, 0x2c, 0x22, 0xf6, 0x1d, 0x37, 0x6e,
|
||||
0x9c, 0xdb, 0x68, 0x63, 0xec, 0xd6, 0x48, 0x71, 0x5c, 0x20, 0x77, 0x6c,
|
||||
0x14, 0x2b, 0x5c, 0x7e, 0xe6, 0x75, 0xbc, 0xef, 0x44, 0xaa, 0xcd, 0xe6,
|
||||
0xef, 0xf1, 0x78, 0xee, 0xc6, 0xf5, 0x93, 0x6a, 0x97, 0xfd, 0xfd, 0xfd,
|
||||
0xf7, 0xb5, 0xb6, 0xb6, 0x5e, 0xc1, 0x8d, 0x67, 0xe9, 0x05, 0x80, 0xce,
|
||||
0xcf, 0x3c, 0xf3, 0xcc, 0x85, 0x49, 0x93, 0x26, 0x61, 0xd0, 0xa0, 0x41,
|
||||
0x0b, 0x01, 0x2c, 0x07, 0x70, 0x09, 0xbe, 0x5f, 0x40, 0x11, 0x36, 0x9b,
|
||||
0x2d, 0xc0, 0xe3, 0xf1, 0xdc, 0x11, 0x15, 0x15, 0xb5, 0x72, 0xd6, 0xac,
|
||||
0x59, 0xbf, 0x09, 0x0a, 0x0a, 0x52, 0xce, 0x9d, 0x3b, 0x77, 0xad, 0xb0,
|
||||
0xb0, 0xf0, 0xbf, 0x5a, 0x5b, 0x5b, 0xf3, 0x14, 0x45, 0x69, 0xd4, 0x75,
|
||||
0xfd, 0x9a, 0x8f, 0x5d, 0x86, 0xe0, 0x01, 0x03, 0x06, 0x6c, 0x8d, 0x8f,
|
||||
0x8f, 0x0f, 0xfe, 0xea, 0xab, 0xaf, 0xf6, 0x57, 0x55, 0x55, 0x3d, 0x2b,
|
||||
0xd3, 0x57, 0xb3, 0xb8, 0xf4, 0x49, 0x49, 0x49, 0xf9, 0x63, 0xd7, 0xae,
|
||||
0x5d, 0x75, 0x5d, 0xd7, 0x55, 0xb3, 0x0d, 0xaa, 0xaa, 0xea, 0x47, 0x8f,
|
||||
0x1e, 0x6d, 0xfe, 0xec, 0xb3, 0xcf, 0x46, 0x03, 0xb8, 0x2a, 0x53, 0x6e,
|
||||
0xc5, 0x66, 0xb3, 0x85, 0x7a, 0x3c, 0x9e, 0xe4, 0xe4, 0xe4, 0xe4, 0x97,
|
||||
0x32, 0x32, 0x32, 0x12, 0x5d, 0x2e, 0x17, 0x1a, 0x1a, 0x1a, 0xda, 0x8a,
|
||||
0x8a, 0x8a, 0xfe, 0x74, 0xf5, 0xea, 0xd5, 0x57, 0x54, 0x55, 0x3d, 0x23,
|
||||
0x8f, 0xba, 0xfa, 0xf2, 0x27, 0xa8, 0x4f, 0x9f, 0x3e, 0xbf, 0x1f, 0x32,
|
||||
0x64, 0xc8, 0xdd, 0xc7, 0x8f, 0x1f, 0x3f, 0x52, 0x55, 0x55, 0x35, 0x45,
|
||||
0xf6, 0x6d, 0xb4, 0x55, 0x6d, 0x36, 0x5b, 0x27, 0xd9, 0x7f, 0xde, 0xd8,
|
||||
0xb1, 0x63, 0xe3, 0x5d, 0x2e, 0x17, 0xea, 0xea, 0xea, 0x5a, 0xf3, 0xf2,
|
||||
0xf2, 0x36, 0x02, 0x58, 0x2c, 0x84, 0xb8, 0x40, 0xd2, 0xf0, 0x57, 0x55,
|
||||
0x14, 0xa5, 0xb3, 0xae, 0xeb, 0xff, 0xfc, 0xe4, 0x93, 0x4f, 0x2e, 0x4e,
|
||||
0x4e, 0x4e, 0xee, 0xa9, 0x69, 0x1a, 0x3e, 0xfd, 0xf4, 0xd3, 0xba, 0xb2,
|
||||
0xb2, 0xb2, 0x7c, 0x45, 0x51, 0xfe, 0x2c, 0x8f, 0x32, 0x9b, 0xcf, 0xeb,
|
||||
0x07, 0x74, 0xee, 0xdc, 0x79, 0xd1, 0x23, 0x8f, 0x3c, 0x92, 0x72, 0xe8,
|
||||
0xd0, 0xa1, 0xb6, 0x7d, 0xfb, 0xf6, 0x65, 0x02, 0x38, 0x0b, 0xdf, 0x2f,
|
||||
0x3f, 0xa9, 0xaa, 0xaa, 0x86, 0x6a, 0x9a, 0x96, 0x9c, 0x96, 0x96, 0xb6,
|
||||
0x70, 0xe4, 0xc8, 0x91, 0x7d, 0xfd, 0xfd, 0xfd, 0xd1, 0xd0, 0xd0, 0xd0,
|
||||
0x51, 0x5c, 0x5c, 0xfc, 0x6e, 0x53, 0x53, 0xd3, 0xcb, 0xaa, 0xaa, 0xd6,
|
||||
0x6b, 0x9a, 0xd6, 0x2c, 0x7d, 0x50, 0x54, 0x55, 0x0d, 0xd1, 0x34, 0xad,
|
||||
0x5f, 0x52, 0x52, 0x52, 0xf1, 0xf8, 0xf1, 0xe3, 0xfb, 0x07, 0x06, 0x06,
|
||||
0xe2, 0xe0, 0xc1, 0x83, 0x57, 0x0a, 0x0a, 0x0a, 0x5e, 0x05, 0xb0, 0x5e,
|
||||
0xda, 0xef, 0xb6, 0x42, 0xe8, 0x36, 0x13, 0x00, 0xf9, 0x37, 0x9b, 0x0c,
|
||||
0x3e, 0xe3, 0x6d, 0x31, 0xef, 0x17, 0x3f, 0x84, 0xd3, 0xe9, 0x0c, 0x68,
|
||||
0x6b, 0x6b, 0x1b, 0x20, 0x67, 0x97, 0xbd, 0x42, 0x88, 0x2b, 0xb7, 0x78,
|
||||
0x20, 0x84, 0xa2, 0x28, 0x2e, 0x5d, 0xd7, 0x03, 0xe5, 0x8c, 0xe7, 0xc0,
|
||||
0xf5, 0xb3, 0xf0, 0xcd, 0x8a, 0xa2, 0x5c, 0xd5, 0x75, 0xdd, 0xd7, 0x7a,
|
||||
0x52, 0xa8, 0xaa, 0xea, 0xa7, 0x69, 0x9a, 0x5d, 0xa6, 0xa5, 0xed, 0x36,
|
||||
0x9b, 0xad, 0xdd, 0xe3, 0xf1, 0xb8, 0xbd, 0xc4, 0xc5, 0xe5, 0xf1, 0x78,
|
||||
0xec, 0xb2, 0x5f, 0xef, 0x59, 0xc9, 0x03, 0xa0, 0x59, 0x55, 0x55, 0xb7,
|
||||
0xa6, 0x69, 0xed, 0xb8, 0xf1, 0xe5, 0x98, 0x00, 0xf9, 0xc2, 0x4e, 0x90,
|
||||
0xf4, 0xd9, 0xdb, 0x1e, 0x9f, 0x6f, 0x1d, 0xaa, 0xaa, 0xea, 0xd0, 0x34,
|
||||
0xcd, 0x4f, 0xfa, 0xe0, 0xf6, 0x61, 0x93, 0x51, 0x5f, 0x09, 0x90, 0x7d,
|
||||
0x1b, 0xfd, 0xb7, 0x00, 0xb8, 0xaa, 0x28, 0x4a, 0xb3, 0x0f, 0x7f, 0x6d,
|
||||
0xa6, 0xf6, 0xc6, 0x52, 0xaa, 0x05, 0xc0, 0x55, 0x21, 0x44, 0xb3, 0xf7,
|
||||
0xcb, 0x3a, 0x42, 0x08, 0x3b, 0x49, 0xa7, 0x1c, 0x97, 0x0e, 0xe9, 0x5f,
|
||||
0x1b, 0x6e, 0xfe, 0xa6, 0xa4, 0x51, 0xdc, 0x35, 0xec, 0x51, 0x65, 0x5d,
|
||||
0xe1, 0x8a, 0xb4, 0xc7, 0xfb, 0x5a, 0x55, 0x08, 0xe1, 0x22, 0x19, 0x2c,
|
||||
0x0b, 0xc2, 0xfe, 0x00, 0x1a, 0x4c, 0xf6, 0x58, 0xc1, 0x7f, 0x9b, 0x0a,
|
||||
0xc0, 0x8f, 0x29, 0x20, 0x1a, 0xfb, 0xe4, 0xbe, 0x44, 0xe2, 0xfb, 0xee,
|
||||
0xf9, 0x43, 0x5e, 0x1b, 0xf6, 0xbe, 0x86, 0xff, 0x80, 0x2f, 0xbc, 0x85,
|
||||
0x1f, 0xca, 0x8f, 0xb4, 0xe7, 0xc7, 0x8e, 0xd3, 0x8f, 0xe9, 0x5f, 0xc1,
|
||||
0x8d, 0xaf, 0x03, 0xeb, 0x3f, 0xc1, 0xd8, 0xdc, 0xac, 0xff, 0x5b, 0xbd,
|
||||
0x5e, 0xfd, 0xf7, 0xb4, 0xb7, 0xf8, 0x19, 0xf1, 0x7f, 0x2c, 0x2e, 0x06,
|
||||
0x08, 0x9c, 0x01, 0xc9, 0x62, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
|
||||
0x44, 0xae, 0x42, 0x60, 0x82
|
||||
};
|
||||
|
||||
unsigned int cc_fps_images_len(void)
|
||||
{
|
||||
return sizeof(cc_fps_images_png);
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
5ad94003f4c67bd0d732389ccf7aa438a0956a39
|
|
@ -22,17 +22,12 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
extern unsigned char cc_fps_images_png[];
|
||||
extern unsigned char cc_fps_images_hd_png[];
|
||||
extern unsigned char cc_fps_images_ipadhd_png[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
extern unsigned char cc_fps_images_png[];
|
||||
unsigned int cc_fps_images_len(void);
|
||||
unsigned int cc_fps_images_hd_len(void);
|
||||
unsigned int cc_fps_images_ipadhd_len(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -160,27 +160,22 @@ bool CCArray::initWithObjects(CCObject* pObject, ...)
|
|||
bool bRet = false;
|
||||
do
|
||||
{
|
||||
CC_BREAK_IF(pObject != NULL);
|
||||
CC_BREAK_IF(pObject == NULL);
|
||||
|
||||
va_list args;
|
||||
va_start(args, pObject);
|
||||
|
||||
CCArray* pArray = new CCArray();
|
||||
if (pArray && pObject)
|
||||
if (pObject)
|
||||
{
|
||||
pArray->addObject(pObject);
|
||||
this->addObject(pObject);
|
||||
CCObject* i = va_arg(args, CCObject*);
|
||||
while(i)
|
||||
{
|
||||
pArray->addObject(i);
|
||||
this->addObject(i);
|
||||
i = va_arg(args, CCObject*);
|
||||
}
|
||||
bRet = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_SAFE_DELETE(pArray);
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
} while (false);
|
||||
|
@ -210,17 +205,17 @@ bool CCArray::initWithArray(CCArray* otherArray)
|
|||
return bRet;
|
||||
}
|
||||
|
||||
unsigned int CCArray::count()
|
||||
unsigned int CCArray::count() const
|
||||
{
|
||||
return data->num;
|
||||
}
|
||||
|
||||
unsigned int CCArray::capacity()
|
||||
unsigned int CCArray::capacity() const
|
||||
{
|
||||
return data->max;
|
||||
}
|
||||
|
||||
unsigned int CCArray::indexOfObject(CCObject* object)
|
||||
unsigned int CCArray::indexOfObject(CCObject* object) const
|
||||
{
|
||||
return ccArrayGetIndexOfObject(data, object);
|
||||
}
|
||||
|
@ -257,7 +252,7 @@ CCObject* CCArray::randomObject()
|
|||
return data->arr[(int)(data->num * r)];
|
||||
}
|
||||
|
||||
bool CCArray::containsObject(CCObject* object)
|
||||
bool CCArray::containsObject(CCObject* object) const
|
||||
{
|
||||
return ccArrayContainsObject(data, object);
|
||||
}
|
||||
|
@ -396,4 +391,9 @@ CCObject* CCArray::copyWithZone(CCZone* pZone)
|
|||
return pArray;
|
||||
}
|
||||
|
||||
void CCArray::acceptVisitor(CCDataVisitor &visitor)
|
||||
{
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -151,11 +151,11 @@ public:
|
|||
// Querying an Array
|
||||
|
||||
/** Returns element count of the array */
|
||||
unsigned int count();
|
||||
unsigned int count() const;
|
||||
/** Returns capacity of the array */
|
||||
unsigned int capacity();
|
||||
unsigned int capacity() const;
|
||||
/** Returns index of a certain object, return UINT_MAX if doesn't contain the object */
|
||||
unsigned int indexOfObject(CCObject* object);
|
||||
unsigned int indexOfObject(CCObject* object) const;
|
||||
/** Returns an element with a certain index */
|
||||
CCObject* objectAtIndex(unsigned int index);
|
||||
/** Returns last element */
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
/** Returns a random element */
|
||||
CCObject* randomObject();
|
||||
/** Returns a Boolean value that indicates whether object is present in array. */
|
||||
bool containsObject(CCObject* object);
|
||||
bool containsObject(CCObject* object) const;
|
||||
/** @since 1.1 */
|
||||
bool isEqualToArray(CCArray* pOtherArray);
|
||||
// Adding Objects
|
||||
|
@ -210,6 +210,9 @@ public:
|
|||
/* override functions */
|
||||
virtual CCObject* copyWithZone(CCZone* pZone);
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor);
|
||||
|
||||
public:
|
||||
ccArray* data;
|
||||
CCArray();
|
||||
|
|
|
@ -50,6 +50,10 @@ public:
|
|||
}
|
||||
return pRet;
|
||||
}
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
|
||||
|
||||
private:
|
||||
bool m_bValue;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,228 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "CCObject.h"
|
||||
#include "CCBool.h"
|
||||
#include "CCInteger.h"
|
||||
#include "CCFloat.h"
|
||||
#include "CCDouble.h"
|
||||
#include "CCString.h"
|
||||
#include "CCArray.h"
|
||||
#include "CCDictionary.h"
|
||||
#include "CCSet.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
void CCDataVisitor::visit(const CCBool *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCInteger *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCFloat *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCDouble *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCString *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCArray *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCDictionary *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
void CCDataVisitor::visit(const CCSet *value)
|
||||
{
|
||||
visitObject(value);
|
||||
}
|
||||
|
||||
// CCPrettyPrinter
|
||||
CCPrettyPrinter::CCPrettyPrinter(int indentLevel/* = 0 */)
|
||||
{
|
||||
setIndentLevel(indentLevel);
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::clear()
|
||||
{
|
||||
_result.clear();
|
||||
}
|
||||
|
||||
std::string CCPrettyPrinter::getResult()
|
||||
{
|
||||
return _result;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visitObject(const CCObject *p)
|
||||
{
|
||||
char buf[50] = {0};
|
||||
sprintf(buf, "%p", p);
|
||||
_result += buf;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCBool * p)
|
||||
{
|
||||
char buf[50] = {0};
|
||||
sprintf(buf, "%s", p->getValue() ? "true" : "false");
|
||||
_result += buf;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCInteger *p)
|
||||
{
|
||||
char buf[50] = {0};
|
||||
sprintf(buf, "%d", p->getValue());
|
||||
_result += buf;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCFloat *p)
|
||||
{
|
||||
char buf[50] = {0};
|
||||
sprintf(buf, "%f", p->getValue());
|
||||
_result += buf;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCDouble *p)
|
||||
{
|
||||
char buf[50] = {0};
|
||||
sprintf(buf, "%lf", p->getValue());
|
||||
_result += buf;
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCString *p)
|
||||
{
|
||||
_result += p->getCString();
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCArray *p)
|
||||
{
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "<array>\n";
|
||||
|
||||
setIndentLevel(_indentLevel+1);
|
||||
CCObject* obj;
|
||||
int i = 0;
|
||||
char buf[50] = {0};
|
||||
CCARRAY_FOREACH(p, obj)
|
||||
{
|
||||
if (i > 0) {
|
||||
_result += "\n";
|
||||
}
|
||||
sprintf(buf, "%s%02d: ", _indentStr.c_str(), i);
|
||||
_result += buf;
|
||||
CCPrettyPrinter v(_indentLevel);
|
||||
obj->acceptVisitor(v);
|
||||
_result += v.getResult();
|
||||
i++;
|
||||
}
|
||||
setIndentLevel(_indentLevel-1);
|
||||
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "</array>";
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCDictionary *p)
|
||||
{
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "<dict>\n";
|
||||
|
||||
setIndentLevel(_indentLevel+1);
|
||||
CCDictElement* element;
|
||||
bool bFirstElement = true;
|
||||
char buf[1000] = {0};
|
||||
CCDICT_FOREACH(p, element)
|
||||
{
|
||||
if (!bFirstElement) {
|
||||
_result += "\n";
|
||||
}
|
||||
sprintf(buf, "%s%s: ", _indentStr.c_str(),element->getStrKey());
|
||||
_result += buf;
|
||||
CCPrettyPrinter v(_indentLevel);
|
||||
element->getObject()->acceptVisitor(v);
|
||||
_result += v.getResult();
|
||||
bFirstElement = false;
|
||||
}
|
||||
setIndentLevel(_indentLevel-1);
|
||||
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "</dict>";
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::visit(const CCSet *p)
|
||||
{
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "<set>\n";
|
||||
|
||||
setIndentLevel(_indentLevel+1);
|
||||
|
||||
int i = 0;
|
||||
CCSet* tmp = const_cast<CCSet*>(p);
|
||||
CCSetIterator it = tmp->begin();
|
||||
|
||||
for (; it != tmp->end(); ++it, ++i) {
|
||||
if (i > 0) {
|
||||
_result += "\n";
|
||||
}
|
||||
_result += _indentStr.c_str();
|
||||
CCPrettyPrinter v(_indentLevel);
|
||||
(*it)->acceptVisitor(v);
|
||||
_result += v.getResult();
|
||||
}
|
||||
setIndentLevel(_indentLevel-1);
|
||||
|
||||
_result += "\n";
|
||||
_result += _indentStr;
|
||||
_result += "</set>\n";
|
||||
}
|
||||
|
||||
void CCPrettyPrinter::setIndentLevel(int indentLevel)
|
||||
{
|
||||
_indentLevel = indentLevel;
|
||||
_indentStr.clear();
|
||||
for (int i = 0; i < _indentLevel; ++i) {
|
||||
_indentStr += "\t";
|
||||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
|
@ -0,0 +1,110 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __CCDATAVISITOR_H__
|
||||
#define __CCDATAVISITOR_H__
|
||||
|
||||
#include "platform/CCPlatformMacros.h"
|
||||
#include <string>
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class CCObject;
|
||||
class CCBool;
|
||||
class CCInteger;
|
||||
class CCFloat;
|
||||
class CCDouble;
|
||||
class CCString;
|
||||
class CCArray;
|
||||
class CCDictionary;
|
||||
class CCSet;
|
||||
|
||||
/**
|
||||
* @addtogroup data_structures
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Visitor that helps to perform action that depends on polymorphic object type
|
||||
*
|
||||
* Use cases:
|
||||
* - data serialization,
|
||||
* - pretty printing of \a CCObject *
|
||||
* - safe value reading from \a CCArray, \a CCDictionary, \a CCSet
|
||||
*
|
||||
* Usage:
|
||||
* 1. subclass CCDataVisitor
|
||||
* 2. overload visit() methods for object that you need to handle
|
||||
* 3. handle other objects in \a visitObject()
|
||||
* 4. pass your visitor to \a CCObject::acceptVisitor()
|
||||
*/
|
||||
class CC_DLL CCDataVisitor
|
||||
{
|
||||
public:
|
||||
virtual ~CCDataVisitor() {}
|
||||
|
||||
/** default method, called from non-overloaded methods and for unrecognized objects */
|
||||
virtual void visitObject(const CCObject *p) = 0;
|
||||
|
||||
virtual void visit(const CCBool *p);
|
||||
virtual void visit(const CCInteger *p);
|
||||
virtual void visit(const CCFloat *p);
|
||||
virtual void visit(const CCDouble *p);
|
||||
virtual void visit(const CCString *p);
|
||||
virtual void visit(const CCArray *p);
|
||||
virtual void visit(const CCDictionary *p);
|
||||
virtual void visit(const CCSet *p);
|
||||
};
|
||||
|
||||
|
||||
class CC_DLL CCPrettyPrinter : public CCDataVisitor
|
||||
{
|
||||
public:
|
||||
CCPrettyPrinter(int indentLevel = 0);
|
||||
|
||||
virtual void clear();
|
||||
virtual std::string getResult();
|
||||
|
||||
virtual void visitObject(const CCObject *p);
|
||||
virtual void visit(const CCBool * p);
|
||||
virtual void visit(const CCInteger *p);
|
||||
virtual void visit(const CCFloat *p);
|
||||
virtual void visit(const CCDouble *p);
|
||||
virtual void visit(const CCString *p);
|
||||
virtual void visit(const CCArray *p);
|
||||
virtual void visit(const CCDictionary *p);
|
||||
virtual void visit(const CCSet *p);
|
||||
private:
|
||||
void setIndentLevel(int indentLevel);
|
||||
int _indentLevel;
|
||||
std::string _indentStr;
|
||||
std::string _result;
|
||||
};
|
||||
|
||||
// end of data_structure group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCDATAVISITOR_H__
|
|
@ -169,7 +169,7 @@ CCObject* CCDictionary::objectForKey(const std::string& key)
|
|||
return pRetObject;
|
||||
}
|
||||
|
||||
CCObject* CCDictionary::objectForKey(int key)
|
||||
CCObject* CCDictionary::objectForKey(intptr_t key)
|
||||
{
|
||||
// if dictionary wasn't initialized, return NULL directly.
|
||||
if (m_eDictType == kCCDictUnknown) return NULL;
|
||||
|
@ -179,7 +179,7 @@ CCObject* CCDictionary::objectForKey(int key)
|
|||
|
||||
CCObject* pRetObject = NULL;
|
||||
CCDictElement *pElement = NULL;
|
||||
HASH_FIND_INT(m_pElements, &key, pElement);
|
||||
HASH_FIND_PTR(m_pElements, &key, pElement);
|
||||
if (pElement != NULL)
|
||||
{
|
||||
pRetObject = pElement->m_pObject;
|
||||
|
@ -197,7 +197,7 @@ const CCString* CCDictionary::valueForKey(const std::string& key)
|
|||
return pStr;
|
||||
}
|
||||
|
||||
const CCString* CCDictionary::valueForKey(int key)
|
||||
const CCString* CCDictionary::valueForKey(intptr_t key)
|
||||
{
|
||||
CCString* pStr = dynamic_cast<CCString*>(objectForKey(key));
|
||||
if (pStr == NULL)
|
||||
|
@ -233,7 +233,7 @@ void CCDictionary::setObject(CCObject* pObject, const std::string& key)
|
|||
}
|
||||
}
|
||||
|
||||
void CCDictionary::setObject(CCObject* pObject, int key)
|
||||
void CCDictionary::setObject(CCObject* pObject, intptr_t key)
|
||||
{
|
||||
CCAssert(pObject != NULL, "Invalid Argument!");
|
||||
if (m_eDictType == kCCDictUnknown)
|
||||
|
@ -244,7 +244,7 @@ void CCDictionary::setObject(CCObject* pObject, int key)
|
|||
CCAssert(m_eDictType == kCCDictInt, "this dictionary doesn't use integer as key.");
|
||||
|
||||
CCDictElement *pElement = NULL;
|
||||
HASH_FIND_INT(m_pElements, &key, pElement);
|
||||
HASH_FIND_PTR(m_pElements, &key, pElement);
|
||||
if (pElement == NULL)
|
||||
{
|
||||
setObjectUnSafe(pObject, key);
|
||||
|
@ -274,7 +274,7 @@ void CCDictionary::removeObjectForKey(const std::string& key)
|
|||
removeObjectForElememt(pElement);
|
||||
}
|
||||
|
||||
void CCDictionary::removeObjectForKey(int key)
|
||||
void CCDictionary::removeObjectForKey(intptr_t key)
|
||||
{
|
||||
if (m_eDictType == kCCDictUnknown)
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ void CCDictionary::removeObjectForKey(int key)
|
|||
|
||||
CCAssert(m_eDictType == kCCDictInt, "this dictionary doesn't use integer as its key");
|
||||
CCDictElement *pElement = NULL;
|
||||
HASH_FIND_INT(m_pElements, &key, pElement);
|
||||
HASH_FIND_PTR(m_pElements, &key, pElement);
|
||||
removeObjectForElememt(pElement);
|
||||
}
|
||||
|
||||
|
@ -294,11 +294,11 @@ void CCDictionary::setObjectUnSafe(CCObject* pObject, const std::string& key)
|
|||
HASH_ADD_STR(m_pElements, m_szKey, pElement);
|
||||
}
|
||||
|
||||
void CCDictionary::setObjectUnSafe(CCObject* pObject, const int key)
|
||||
void CCDictionary::setObjectUnSafe(CCObject* pObject, const intptr_t key)
|
||||
{
|
||||
pObject->retain();
|
||||
CCDictElement* pElement = new CCDictElement(key, pObject);
|
||||
HASH_ADD_INT(m_pElements, m_iKey, pElement);
|
||||
HASH_ADD_PTR(m_pElements, m_iKey, pElement);
|
||||
}
|
||||
|
||||
void CCDictionary::removeObjectsForKeys(CCArray* pKeyArray)
|
||||
|
@ -408,6 +408,11 @@ CCDictionary* CCDictionary::createWithContentsOfFileThreadSafe(const char *pFile
|
|||
return CCFileUtils::sharedFileUtils()->createCCDictionaryWithContentsOfFile(pFileName);
|
||||
}
|
||||
|
||||
void CCDictionary::acceptVisitor(CCDataVisitor &visitor)
|
||||
{
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
CCDictionary* CCDictionary::createWithContentsOfFile(const char *pFileName)
|
||||
{
|
||||
CCDictionary* pRet = createWithContentsOfFileThreadSafe(pFileName);
|
||||
|
@ -415,4 +420,10 @@ CCDictionary* CCDictionary::createWithContentsOfFile(const char *pFileName)
|
|||
return pRet;
|
||||
}
|
||||
|
||||
bool CCDictionary::writeToFile(const char *fullPath)
|
||||
{
|
||||
return CCFileUtils::sharedFileUtils()->writeToFile(this, fullPath);
|
||||
}
|
||||
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -139,6 +139,7 @@ public:
|
|||
*/
|
||||
#define CCDICT_FOREACH(__dict__, __el__) \
|
||||
CCDictElement* pTmp##__dict__##__el__ = NULL; \
|
||||
if (__dict__) \
|
||||
HASH_ITER(hh, (__dict__)->m_pElements, __el__, pTmp##__dict__##__el__)
|
||||
|
||||
|
||||
|
@ -218,7 +219,7 @@ public:
|
|||
* // Do something about pStr2
|
||||
* }
|
||||
* @endcode
|
||||
* @see objectForKey(int)
|
||||
* @see objectForKey(intptr_t)
|
||||
*/
|
||||
CCObject* objectForKey(const std::string& key);
|
||||
|
||||
|
@ -230,7 +231,7 @@ public:
|
|||
* @return The object matches the key.
|
||||
* @see objectForKey(const std::string&)
|
||||
*/
|
||||
CCObject* objectForKey(int key);
|
||||
CCObject* objectForKey(intptr_t key);
|
||||
|
||||
/** Get the value according to the specified string key.
|
||||
*
|
||||
|
@ -238,7 +239,7 @@ public:
|
|||
* @param key The string key for searching
|
||||
* @return An instance of CCString.
|
||||
* It will return an empty string if the objects aren't CCString pointer or the key wasn't found.
|
||||
* @see valueForKey(int)
|
||||
* @see valueForKey(intptr_t)
|
||||
*/
|
||||
const CCString* valueForKey(const std::string& key);
|
||||
|
||||
|
@ -248,9 +249,9 @@ public:
|
|||
* @param key The string key for searching.
|
||||
* @return An instance of CCString.
|
||||
* It will return an empty string if the objects aren't CCString pointer or the key wasn't found.
|
||||
* @see valueForKey(int)
|
||||
* @see valueForKey(intptr_t)
|
||||
*/
|
||||
const CCString* valueForKey(int key);
|
||||
const CCString* valueForKey(intptr_t key);
|
||||
|
||||
/** Insert an object to dictionary, and match it with the specified string key.
|
||||
*
|
||||
|
@ -261,7 +262,7 @@ public:
|
|||
*
|
||||
* @param pObject The Object to be inserted.
|
||||
* @param key The string key for searching.
|
||||
* @see setObject(CCObject*, int)
|
||||
* @see setObject(CCObject*, intptr_t)
|
||||
*/
|
||||
void setObject(CCObject* pObject, const std::string& key);
|
||||
|
||||
|
@ -275,13 +276,13 @@ public:
|
|||
* @param key The string key for searching.
|
||||
* @see setObject(CCObject*, const std::string&)
|
||||
*/
|
||||
void setObject(CCObject* pObject, int key);
|
||||
void setObject(CCObject* pObject, intptr_t key);
|
||||
|
||||
/**
|
||||
* Remove an object by the specified string key.
|
||||
*
|
||||
* @param key The string key for searching.
|
||||
* @see removeObjectForKey(int), removeObjectsForKeys(CCArray*),
|
||||
* @see removeObjectForKey(intptr_t), removeObjectsForKeys(CCArray*),
|
||||
* removeObjectForElememt(CCDictElement*), removeAllObjects().
|
||||
*/
|
||||
void removeObjectForKey(const std::string& key);
|
||||
|
@ -293,13 +294,13 @@ public:
|
|||
* @see removeObjectForKey(const std::string&), removeObjectsForKeys(CCArray*),
|
||||
* removeObjectForElememt(CCDictElement*), removeAllObjects().
|
||||
*/
|
||||
void removeObjectForKey(int key);
|
||||
void removeObjectForKey(intptr_t key);
|
||||
|
||||
/**
|
||||
* Remove objects by an array of keys.
|
||||
*
|
||||
* @param pKeyArray The array contains keys to be removed.
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(int),
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),
|
||||
* removeObjectForElememt(CCDictElement*), removeAllObjects().
|
||||
*/
|
||||
void removeObjectsForKeys(CCArray* pKeyArray);
|
||||
|
@ -308,7 +309,7 @@ public:
|
|||
* Remove an object by an element.
|
||||
*
|
||||
* @param pElement The element need to be removed.
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(int),
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),
|
||||
* removeObjectsForKeys(CCArray*), removeAllObjects().
|
||||
*/
|
||||
void removeObjectForElememt(CCDictElement* pElement);
|
||||
|
@ -316,7 +317,7 @@ public:
|
|||
/**
|
||||
* Remove all objects in the dictionary.
|
||||
*
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(int),
|
||||
* @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),
|
||||
* removeObjectsForKeys(CCArray*), removeObjectForElememt(CCDictElement*).
|
||||
*/
|
||||
void removeAllObjects();
|
||||
|
@ -334,7 +335,7 @@ public:
|
|||
* Return a random object in the dictionary.
|
||||
*
|
||||
* @return The random object.
|
||||
* @see objectForKey(int), objectForKey(const std::string&)
|
||||
* @see objectForKey(intptr_t), objectForKey(const std::string&)
|
||||
*/
|
||||
CCObject* randomObject();
|
||||
|
||||
|
@ -361,7 +362,14 @@ public:
|
|||
* @see create(), createWithDictionary(CCDictionary*), createWithContentsOfFileThreadSafe(const char*).
|
||||
*/
|
||||
static CCDictionary* createWithContentsOfFile(const char *pFileName);
|
||||
|
||||
|
||||
/**
|
||||
* Write a dictionary to a plist file.
|
||||
* @param fullPath The full path of the plist file. You can get writeable path by getWritablePath()
|
||||
* @return true if successed, false if failed
|
||||
*/
|
||||
bool writeToFile(const char *fullPath);
|
||||
|
||||
/**
|
||||
* Create a dictionary with a plist file.
|
||||
*
|
||||
|
@ -375,12 +383,15 @@ public:
|
|||
*/
|
||||
static CCDictionary* createWithContentsOfFileThreadSafe(const char *pFileName);
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor);
|
||||
|
||||
private:
|
||||
/**
|
||||
* For internal usage, invoked by setObject.
|
||||
*/
|
||||
void setObjectUnSafe(CCObject* pObject, const std::string& key);
|
||||
void setObjectUnSafe(CCObject* pObject, const int key);
|
||||
void setObjectUnSafe(CCObject* pObject, const intptr_t key);
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -50,6 +50,10 @@ public:
|
|||
}
|
||||
return pRet;
|
||||
}
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
|
||||
|
||||
private:
|
||||
double m_dValue;
|
||||
};
|
||||
|
|
|
@ -50,6 +50,10 @@ public:
|
|||
}
|
||||
return pRet;
|
||||
}
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
|
||||
|
||||
private:
|
||||
float m_fValue;
|
||||
};
|
||||
|
|
|
@ -28,19 +28,20 @@ THE SOFTWARE.
|
|||
// implementation of CCPoint
|
||||
NS_CC_BEGIN
|
||||
|
||||
CCPoint::CCPoint(void)
|
||||
CCPoint::CCPoint(void) : x(0), y(0)
|
||||
{
|
||||
setPoint(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
CCPoint::CCPoint(float x, float y)
|
||||
CCPoint::CCPoint(float x, float y) : x(x), y(y)
|
||||
{
|
||||
setPoint(x, y);
|
||||
}
|
||||
|
||||
CCPoint::CCPoint(const CCPoint& other)
|
||||
CCPoint::CCPoint(const CCPoint& other) : x(other.x), y(other.y)
|
||||
{
|
||||
}
|
||||
|
||||
CCPoint::CCPoint(const CCSize& size) : x(size.width), y(size.height)
|
||||
{
|
||||
setPoint(other.x, other.y);
|
||||
}
|
||||
|
||||
CCPoint& CCPoint::operator= (const CCPoint& other)
|
||||
|
@ -49,6 +50,38 @@ CCPoint& CCPoint::operator= (const CCPoint& other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
CCPoint& CCPoint::operator= (const CCSize& size)
|
||||
{
|
||||
setPoint(size.width, size.height);
|
||||
return *this;
|
||||
}
|
||||
|
||||
CCPoint CCPoint::operator+(const CCPoint& right) const
|
||||
{
|
||||
return CCPoint(this->x + right.x, this->y + right.y);
|
||||
}
|
||||
|
||||
CCPoint CCPoint::operator-(const CCPoint& right) const
|
||||
{
|
||||
return CCPoint(this->x - right.x, this->y - right.y);
|
||||
}
|
||||
|
||||
CCPoint CCPoint::operator-() const
|
||||
{
|
||||
return CCPoint(-x, -y);
|
||||
}
|
||||
|
||||
CCPoint CCPoint::operator*(float a) const
|
||||
{
|
||||
return CCPoint(this->x * a, this->y * a);
|
||||
}
|
||||
|
||||
CCPoint CCPoint::operator/(float a) const
|
||||
{
|
||||
CCAssert(a, "CCPoint division by 0.");
|
||||
return CCPoint(this->x / a, this->y / a);
|
||||
}
|
||||
|
||||
void CCPoint::setPoint(float x, float y)
|
||||
{
|
||||
this->x = x;
|
||||
|
@ -57,24 +90,48 @@ void CCPoint::setPoint(float x, float y)
|
|||
|
||||
bool CCPoint::equals(const CCPoint& target) const
|
||||
{
|
||||
return ((x == target.x) && (y == target.y));
|
||||
return (fabs(this->x - target.x) < FLT_EPSILON)
|
||||
&& (fabs(this->y - target.y) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
bool CCPoint::fuzzyEquals(const CCPoint& b, float var) const
|
||||
{
|
||||
if(x - var <= b.x && b.x <= x + var)
|
||||
if(y - var <= b.y && b.y <= y + var)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
float CCPoint::getAngle(const CCPoint& other) const
|
||||
{
|
||||
CCPoint a2 = normalize();
|
||||
CCPoint b2 = other.normalize();
|
||||
float angle = atan2f(a2.cross(b2), a2.dot(b2));
|
||||
if( fabs(angle) < FLT_EPSILON ) return 0.f;
|
||||
return angle;
|
||||
}
|
||||
|
||||
CCPoint CCPoint::rotateByAngle(const CCPoint& pivot, float angle) const
|
||||
{
|
||||
return pivot + (*this - pivot).rotate(CCPoint::forAngle(angle));
|
||||
}
|
||||
|
||||
// implementation of CCSize
|
||||
|
||||
CCSize::CCSize(void)
|
||||
CCSize::CCSize(void) : width(0), height(0)
|
||||
{
|
||||
setSize(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
CCSize::CCSize(float width, float height)
|
||||
CCSize::CCSize(float width, float height) : width(width), height(height)
|
||||
{
|
||||
setSize(width, height);
|
||||
}
|
||||
|
||||
CCSize::CCSize(const CCSize& other)
|
||||
CCSize::CCSize(const CCSize& other) : width(other.width), height(other.height)
|
||||
{
|
||||
}
|
||||
|
||||
CCSize::CCSize(const CCPoint& point) : width(point.x), height(point.y)
|
||||
{
|
||||
setSize(other.width, other.height);
|
||||
}
|
||||
|
||||
CCSize& CCSize::operator= (const CCSize& other)
|
||||
|
@ -83,6 +140,33 @@ CCSize& CCSize::operator= (const CCSize& other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
CCSize& CCSize::operator= (const CCPoint& point)
|
||||
{
|
||||
setSize(point.x, point.y);
|
||||
return *this;
|
||||
}
|
||||
|
||||
CCSize CCSize::operator+(const CCSize& right) const
|
||||
{
|
||||
return CCSize(this->width + right.width, this->height + right.height);
|
||||
}
|
||||
|
||||
CCSize CCSize::operator-(const CCSize& right) const
|
||||
{
|
||||
return CCSize(this->width - right.width, this->height - right.height);
|
||||
}
|
||||
|
||||
CCSize CCSize::operator*(float a) const
|
||||
{
|
||||
return CCSize(this->width * a, this->height * a);
|
||||
}
|
||||
|
||||
CCSize CCSize::operator/(float a) const
|
||||
{
|
||||
CCAssert(a, "CCSize division by 0.");
|
||||
return CCSize(this->width / a, this->height / a);
|
||||
}
|
||||
|
||||
void CCSize::setSize(float width, float height)
|
||||
{
|
||||
this->width = width;
|
||||
|
@ -91,7 +175,8 @@ void CCSize::setSize(float width, float height)
|
|||
|
||||
bool CCSize::equals(const CCSize& target) const
|
||||
{
|
||||
return ((width == target.width) && (height == target.height));
|
||||
return (fabs(this->width - target.width) < FLT_EPSILON)
|
||||
&& (fabs(this->height - target.height) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
// implementation of CCRect
|
||||
|
|
|
@ -27,6 +27,7 @@ THE SOFTWARE.
|
|||
|
||||
#include "platform/CCPlatformMacros.h"
|
||||
#include "CCObject.h"
|
||||
#include <math.h>
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -35,6 +36,9 @@ NS_CC_BEGIN
|
|||
* @{
|
||||
*/
|
||||
|
||||
// for CCPoint assignement operator and copy constructor
|
||||
class CC_DLL CCSize;
|
||||
|
||||
class CC_DLL CCPoint
|
||||
{
|
||||
public:
|
||||
|
@ -45,9 +49,158 @@ public:
|
|||
CCPoint();
|
||||
CCPoint(float x, float y);
|
||||
CCPoint(const CCPoint& other);
|
||||
CCPoint(const CCSize& size);
|
||||
CCPoint& operator= (const CCPoint& other);
|
||||
CCPoint& operator= (const CCSize& size);
|
||||
CCPoint operator+(const CCPoint& right) const;
|
||||
CCPoint operator-(const CCPoint& right) const;
|
||||
CCPoint operator-() const;
|
||||
CCPoint operator*(float a) const;
|
||||
CCPoint operator/(float a) const;
|
||||
void setPoint(float x, float y);
|
||||
bool equals(const CCPoint& target) const;
|
||||
|
||||
/** @returns if points have fuzzy equality which means equal with some degree of variance.
|
||||
@since v2.1.4
|
||||
*/
|
||||
bool fuzzyEquals(const CCPoint& target, float variance) const;
|
||||
|
||||
/** Calculates distance between point an origin
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float getLength() const {
|
||||
return sqrtf(x*x + y*y);
|
||||
};
|
||||
|
||||
/** Calculates the square length of a CCPoint (not calling sqrt() )
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float getLengthSq() const {
|
||||
return dot(*this); //x*x + y*y;
|
||||
};
|
||||
|
||||
/** Calculates the square distance between two points (not calling sqrt() )
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float getDistanceSq(const CCPoint& other) const {
|
||||
return (*this - other).getLengthSq();
|
||||
};
|
||||
|
||||
/** Calculates the distance between two points
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float getDistance(const CCPoint& other) const {
|
||||
return (*this - other).getLength();
|
||||
};
|
||||
|
||||
/** @returns the angle in radians between this vector and the x axis
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float getAngle() const {
|
||||
return atan2f(y, x);
|
||||
};
|
||||
|
||||
/** @returns the angle in radians between two vector directions
|
||||
@since v2.1.4
|
||||
*/
|
||||
float getAngle(const CCPoint& other) const;
|
||||
|
||||
/** Calculates dot product of two points.
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float dot(const CCPoint& other) const {
|
||||
return x*other.x + y*other.y;
|
||||
};
|
||||
|
||||
/** Calculates cross product of two points.
|
||||
@return float
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline float cross(const CCPoint& other) const {
|
||||
return x*other.y - y*other.x;
|
||||
};
|
||||
|
||||
/** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0
|
||||
@return CCPoint
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint getPerp() const {
|
||||
return CCPoint(-y, x);
|
||||
};
|
||||
|
||||
/** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0
|
||||
@return CCPoint
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint getRPerp() const {
|
||||
return CCPoint(y, -x);
|
||||
};
|
||||
|
||||
/** Calculates the projection of this over other.
|
||||
@return CCPoint
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint project(const CCPoint& other) const {
|
||||
return other * (dot(other)/other.dot(other));
|
||||
};
|
||||
|
||||
/** Complex multiplication of two points ("rotates" two points).
|
||||
@return CCPoint vector with an angle of this.getAngle() + other.getAngle(),
|
||||
and a length of this.getLength() * other.getLength().
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint rotate(const CCPoint& other) const {
|
||||
return CCPoint(x*other.x - y*other.y, x*other.y + y*other.x);
|
||||
};
|
||||
|
||||
/** Unrotates two points.
|
||||
@return CCPoint vector with an angle of this.getAngle() - other.getAngle(),
|
||||
and a length of this.getLength() * other.getLength().
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint unrotate(const CCPoint& other) const {
|
||||
return CCPoint(x*other.x + y*other.y, y*other.x - x*other.y);
|
||||
};
|
||||
|
||||
/** Returns point multiplied to a length of 1.
|
||||
* If the point is 0, it returns (1, 0)
|
||||
@return CCPoint
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint normalize() const {
|
||||
float length = getLength();
|
||||
if(length == 0.) return CCPoint(1.f, 0);
|
||||
return *this / getLength();
|
||||
};
|
||||
|
||||
/** Linear Interpolation between two points a and b
|
||||
@returns
|
||||
alpha == 0 ? a
|
||||
alpha == 1 ? b
|
||||
otherwise a value between a..b
|
||||
@since v2.1.4
|
||||
*/
|
||||
inline CCPoint lerp(const CCPoint& other, float alpha) const {
|
||||
return *this * (1.f - alpha) + other * alpha;
|
||||
};
|
||||
|
||||
/** Rotates a point counter clockwise by the angle around a pivot
|
||||
@param pivot is the pivot, naturally
|
||||
@param angle is the angle of rotation ccw in radians
|
||||
@returns the rotated point
|
||||
@since v2.1.4
|
||||
*/
|
||||
CCPoint rotateByAngle(const CCPoint& pivot, float angle) const;
|
||||
|
||||
static inline CCPoint forAngle(const float a)
|
||||
{
|
||||
return CCPoint(cosf(a), sinf(a));
|
||||
}
|
||||
};
|
||||
|
||||
class CC_DLL CCSize
|
||||
|
@ -60,7 +213,13 @@ public:
|
|||
CCSize();
|
||||
CCSize(float width, float height);
|
||||
CCSize(const CCSize& other);
|
||||
CCSize(const CCPoint& point);
|
||||
CCSize& operator= (const CCSize& other);
|
||||
CCSize& operator= (const CCPoint& point);
|
||||
CCSize operator+(const CCSize& right) const;
|
||||
CCSize operator-(const CCSize& right) const;
|
||||
CCSize operator*(float a) const;
|
||||
CCSize operator/(float a) const;
|
||||
void setSize(float width, float height);
|
||||
bool equals(const CCSize& target) const;
|
||||
};
|
||||
|
@ -72,10 +231,10 @@ public:
|
|||
CCSize size;
|
||||
|
||||
public:
|
||||
CCRect();
|
||||
CCRect();
|
||||
CCRect(float x, float y, float width, float height);
|
||||
CCRect(const CCRect& other);
|
||||
CCRect& operator= (const CCRect& other);
|
||||
CCRect& operator= (const CCRect& other);
|
||||
void setRect(float x, float y, float width, float height);
|
||||
float getMinX() const; /// return the leftmost x-value of current rect
|
||||
float getMidX() const; /// return the midpoint x-value of current rect
|
||||
|
|
|
@ -23,6 +23,10 @@ public:
|
|||
pRet->autorelease();
|
||||
return pRet;
|
||||
}
|
||||
|
||||
/* override functions */
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
|
||||
|
||||
private:
|
||||
int m_nValue;
|
||||
};
|
||||
|
|
|
@ -100,12 +100,12 @@ CCObject* CCObject::autorelease(void)
|
|||
return this;
|
||||
}
|
||||
|
||||
bool CCObject::isSingleReference(void)
|
||||
bool CCObject::isSingleReference(void) const
|
||||
{
|
||||
return m_uReference == 1;
|
||||
}
|
||||
|
||||
unsigned int CCObject::retainCount(void)
|
||||
unsigned int CCObject::retainCount(void) const
|
||||
{
|
||||
return m_uReference;
|
||||
}
|
||||
|
@ -115,4 +115,9 @@ bool CCObject::isEqual(const CCObject *pObject)
|
|||
return this == pObject;
|
||||
}
|
||||
|
||||
void CCObject::acceptVisitor(CCDataVisitor &visitor)
|
||||
{
|
||||
visitor.visitObject(this);
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -25,7 +25,11 @@ THE SOFTWARE.
|
|||
#ifndef __CCOBJECT_H__
|
||||
#define __CCOBJECT_H__
|
||||
|
||||
#include "platform/CCPlatformMacros.h"
|
||||
#include "CCDataVisitor.h"
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <GLES2/gl2.h>
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -65,10 +69,12 @@ public:
|
|||
void retain(void);
|
||||
CCObject* autorelease(void);
|
||||
CCObject* copy(void);
|
||||
bool isSingleReference(void);
|
||||
unsigned int retainCount(void);
|
||||
bool isSingleReference(void) const;
|
||||
unsigned int retainCount(void) const;
|
||||
virtual bool isEqual(const CCObject* pObject);
|
||||
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor);
|
||||
|
||||
virtual void update(float dt) {CC_UNUSED_PARAM(dt);};
|
||||
|
||||
friend class CCAutoreleasePool;
|
||||
|
|
|
@ -56,6 +56,11 @@ CCSet::~CCSet(void)
|
|||
CC_SAFE_DELETE(m_pSet);
|
||||
}
|
||||
|
||||
void CCSet::acceptVisitor(CCDataVisitor &visitor)
|
||||
{
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
CCSet * CCSet::create()
|
||||
{
|
||||
CCSet * pRet = new CCSet();
|
||||
|
|
|
@ -90,6 +90,8 @@ public:
|
|||
*/
|
||||
CCObject* anyObject();
|
||||
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor);
|
||||
|
||||
private:
|
||||
std::set<CCObject *> *m_pSet;
|
||||
};
|
||||
|
|
|
@ -200,4 +200,9 @@ CCString* CCString::createWithContentsOfFile(const char* pszFileName)
|
|||
return pRet;
|
||||
}
|
||||
|
||||
void CCString::acceptVisitor(CCDataVisitor &visitor)
|
||||
{
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
CCString& operator= (const CCString& other);
|
||||
|
||||
/** init a string with format, it's similar with the c function 'sprintf' */
|
||||
bool initWithFormat(const char* format, ...);
|
||||
bool initWithFormat(const char* format, ...) CC_FORMAT_PRINTF(2, 3);
|
||||
|
||||
/** convert to int value */
|
||||
int intValue() const;
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
* @return A CCString pointer which is an autorelease object pointer,
|
||||
* it means that you needn't do a release operation unless you retain it.
|
||||
*/
|
||||
static CCString* createWithFormat(const char* format, ...);
|
||||
static CCString* createWithFormat(const char* format, ...) CC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
/** create a string with binary data
|
||||
* @return A CCString pointer which is an autorelease object pointer,
|
||||
|
@ -109,6 +109,8 @@ public:
|
|||
*/
|
||||
static CCString* createWithContentsOfFile(const char* pszFileName);
|
||||
|
||||
virtual void acceptVisitor(CCDataVisitor &visitor);
|
||||
|
||||
private:
|
||||
|
||||
/** only for internal use */
|
||||
|
|
|
@ -30,7 +30,7 @@ NS_CC_BEGIN
|
|||
|
||||
const char* cocos2dVersion()
|
||||
{
|
||||
return "cocos2d-2.1rc0-x-2.1.2";
|
||||
return "2.1rc0-x-2.1.4";
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -201,7 +201,7 @@ void CCDrawNode::render()
|
|||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, vertices));
|
||||
|
||||
// color
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, colors));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, colors));
|
||||
|
||||
// texcood
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, texCoords));
|
||||
|
@ -338,7 +338,7 @@ void CCDrawNode::drawPolygon(CCPoint *verts, unsigned int count, const ccColor4F
|
|||
extrude[i] = tmp;
|
||||
}
|
||||
|
||||
bool outline = (fillColor.a > 0.0 && borderWidth > 0.0);
|
||||
bool outline = (borderColor.a > 0.0 && borderWidth > 0.0);
|
||||
|
||||
unsigned int triangle_count = 3*count - 2;
|
||||
unsigned int vertex_count = 3*triangle_count;
|
||||
|
|
|
@ -60,6 +60,33 @@ static ccColor4F s_tColor = {1.0f,1.0f,1.0f,1.0f};
|
|||
static int s_nPointSizeLocation = -1;
|
||||
static GLfloat s_fPointSize = 1.0f;
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
static GLuint s_bufferObject = 0;
|
||||
static GLuint s_bufferSize = 0;
|
||||
|
||||
static void setGLBufferData(void *buf, GLuint bufSize)
|
||||
{
|
||||
if(s_bufferSize < bufSize)
|
||||
{
|
||||
if(s_bufferObject)
|
||||
{
|
||||
glDeleteBuffers(1, &s_bufferObject);
|
||||
}
|
||||
glGenBuffers(1, &s_bufferObject);
|
||||
s_bufferSize = bufSize;
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, s_bufferObject);
|
||||
glBufferData(GL_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, s_bufferObject);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, bufSize, buf);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
static void lazy_init( void )
|
||||
{
|
||||
if( ! s_bInitialized ) {
|
||||
|
@ -106,7 +133,12 @@ void ccDrawPoint( const CCPoint& point )
|
|||
s_pShader->setUniformLocationWith4fv(s_nColorLocation, (GLfloat*) &s_tColor.r, 1);
|
||||
s_pShader->setUniformLocationWith1f(s_nPointSizeLocation, s_fPointSize);
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(&p, 8);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, &p);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
glDrawArrays(GL_POINTS, 0, 1);
|
||||
|
||||
|
@ -129,7 +161,12 @@ void ccDrawPoints( const CCPoint *points, unsigned int numberOfPoints )
|
|||
// iPhone and 32-bit machines optimization
|
||||
if( sizeof(CCPoint) == sizeof(ccVertex2F) )
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData((void*) points, numberOfPoints * sizeof(CCPoint));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, points);
|
||||
#endif // EMSCRIPTEN
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -138,7 +175,14 @@ void ccDrawPoints( const CCPoint *points, unsigned int numberOfPoints )
|
|||
newPoints[i].x = points[i].x;
|
||||
newPoints[i].y = points[i].y;
|
||||
}
|
||||
#ifdef EMSCRIPTEN
|
||||
// Suspect Emscripten won't be emitting 64-bit code for a while yet,
|
||||
// but want to make sure this continues to work even if they do.
|
||||
setGLBufferData(newPoints, numberOfPoints * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, newPoints);
|
||||
#endif // EMSCRIPTEN
|
||||
}
|
||||
|
||||
glDrawArrays(GL_POINTS, 0, (GLsizei) numberOfPoints);
|
||||
|
@ -163,7 +207,12 @@ void ccDrawLine( const CCPoint& origin, const CCPoint& destination )
|
|||
s_pShader->setUniformLocationWith4fv(s_nColorLocation, (GLfloat*) &s_tColor.r, 1);
|
||||
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(vertices, 16);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||
#endif // EMSCRIPTEN
|
||||
glDrawArrays(GL_LINES, 0, 2);
|
||||
|
||||
CC_INCREMENT_GL_DRAWS(1);
|
||||
|
@ -202,7 +251,12 @@ void ccDrawPoly( const CCPoint *poli, unsigned int numberOfPoints, bool closePol
|
|||
// iPhone and 32-bit machines optimization
|
||||
if( sizeof(CCPoint) == sizeof(ccVertex2F) )
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData((void*) poli, numberOfPoints * sizeof(CCPoint));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, poli);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
if( closePolygon )
|
||||
glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) numberOfPoints);
|
||||
|
@ -218,7 +272,12 @@ void ccDrawPoly( const CCPoint *poli, unsigned int numberOfPoints, bool closePol
|
|||
newPoli[i].x = poli[i].x;
|
||||
newPoli[i].y = poli[i].y;
|
||||
}
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(newPoli, numberOfPoints * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, newPoli);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
if( closePolygon )
|
||||
glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) numberOfPoints);
|
||||
|
@ -247,7 +306,12 @@ void ccDrawSolidPoly( const CCPoint *poli, unsigned int numberOfPoints, ccColor4
|
|||
// iPhone and 32-bit machines optimization
|
||||
if( sizeof(CCPoint) == sizeof(ccVertex2F) )
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData((void*) poli, numberOfPoints * sizeof(CCPoint));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, poli);
|
||||
#endif // EMSCRIPTEN
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -256,7 +320,12 @@ void ccDrawSolidPoly( const CCPoint *poli, unsigned int numberOfPoints, ccColor4
|
|||
{
|
||||
newPoli[i] = vertex2( poli[i].x, poli[i].y );
|
||||
}
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(newPoli, numberOfPoints * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, newPoli);
|
||||
#endif // EMSCRIPTEN
|
||||
}
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) numberOfPoints);
|
||||
|
@ -296,7 +365,12 @@ void ccDrawCircle( const CCPoint& center, float radius, float angle, unsigned in
|
|||
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(vertices, sizeof(GLfloat)*2*(segments+2));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||
#endif // EMSCRIPTEN
|
||||
glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments+additionalSegment);
|
||||
|
||||
free( vertices );
|
||||
|
@ -331,7 +405,12 @@ void ccDrawQuadBezier(const CCPoint& origin, const CCPoint& control, const CCPoi
|
|||
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(vertices, (segments + 1) * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||
#endif // EMSCRIPTEN
|
||||
glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);
|
||||
CC_SAFE_DELETE_ARRAY(vertices);
|
||||
|
||||
|
@ -383,7 +462,12 @@ void ccDrawCardinalSpline( CCPointArray *config, float tension, unsigned int se
|
|||
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(vertices, (segments + 1) * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||
#endif // EMSCRIPTEN
|
||||
glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);
|
||||
|
||||
CC_SAFE_DELETE_ARRAY(vertices);
|
||||
|
@ -412,7 +496,12 @@ void ccDrawCubicBezier(const CCPoint& origin, const CCPoint& control1, const CCP
|
|||
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(vertices, (segments + 1) * sizeof(ccVertex2F));
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||
#endif // EMSCRIPTEN
|
||||
glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);
|
||||
CC_SAFE_DELETE_ARRAY(vertices);
|
||||
|
||||
|
|
|
@ -182,12 +182,12 @@ void CCGridBase::set2DProjection()
|
|||
|
||||
CCSize size = director->getWinSizeInPixels();
|
||||
|
||||
glViewport(0, 0, (GLsizei)(size.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(size.height * CC_CONTENT_SCALE_FACTOR()) );
|
||||
glViewport(0, 0, (GLsizei)(size.width), (GLsizei)(size.height) );
|
||||
kmGLMatrixMode(KM_GL_PROJECTION);
|
||||
kmGLLoadIdentity();
|
||||
|
||||
kmMat4 orthoMatrix;
|
||||
kmMat4OrthographicProjection(&orthoMatrix, 0, size.width * CC_CONTENT_SCALE_FACTOR(), 0, size.height * CC_CONTENT_SCALE_FACTOR(), -1, 1);
|
||||
kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1, 1);
|
||||
kmGLMultMatrix( &orthoMatrix );
|
||||
|
||||
kmGLMatrixMode(KM_GL_MODELVIEW);
|
||||
|
@ -323,7 +323,21 @@ void CCGrid3D::blit(void)
|
|||
//
|
||||
// Attributes
|
||||
//
|
||||
#ifdef EMSCRIPTEN
|
||||
// Size calculations from calculateVertexPoints().
|
||||
unsigned int numOfPoints = (m_sGridSize.width+1) * (m_sGridSize.height+1);
|
||||
|
||||
// position
|
||||
setGLBufferData(m_pVertices, numOfPoints * sizeof(ccVertex3F), 0);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
// texCoords
|
||||
setGLBufferData(m_pTexCoordinates, numOfPoints * sizeof(ccVertex2F), 1);
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
setGLIndexData(m_pIndices, n * 12, 0);
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, 0);
|
||||
#else
|
||||
// position
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, m_pVertices);
|
||||
|
||||
|
@ -331,6 +345,7 @@ void CCGrid3D::blit(void)
|
|||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, m_pTexCoordinates);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, m_pIndices);
|
||||
#endif // EMSCRIPTEN
|
||||
CC_INCREMENT_GL_DRAWS(1);
|
||||
}
|
||||
|
||||
|
@ -524,6 +539,20 @@ void CCTiledGrid3D::blit(void)
|
|||
// Attributes
|
||||
//
|
||||
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords );
|
||||
#ifdef EMSCRIPTEN
|
||||
int numQuads = m_sGridSize.width * m_sGridSize.height;
|
||||
|
||||
// position
|
||||
setGLBufferData(m_pVertices, (numQuads*4*sizeof(ccVertex3F)), 0);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
// texCoords
|
||||
setGLBufferData(m_pTexCoordinates, (numQuads*4*sizeof(ccVertex2F)), 1);
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
setGLIndexData(m_pIndices, n * 12, 0);
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, 0);
|
||||
#else
|
||||
// position
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, m_pVertices);
|
||||
|
||||
|
@ -531,6 +560,8 @@ void CCTiledGrid3D::blit(void)
|
|||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, m_pTexCoordinates);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)n*6, GL_UNSIGNED_SHORT, m_pIndices);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
|
||||
CC_INCREMENT_GL_DRAWS(1);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ THE SOFTWARE.
|
|||
#include "textures/CCTexture2D.h"
|
||||
#include "CCDirector.h"
|
||||
#include "kazmath/mat4.h"
|
||||
#ifdef EMSCRIPTEN
|
||||
#include "base_nodes/CCGLBufferedNode.h"
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -105,6 +108,9 @@ protected:
|
|||
CCGrid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z
|
||||
*/
|
||||
class CC_DLL CCGrid3D : public CCGridBase
|
||||
#ifdef EMSCRIPTEN
|
||||
, public CCGLBufferedNode
|
||||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
CCGrid3D();
|
||||
|
@ -139,6 +145,9 @@ protected:
|
|||
the tiles can be separated from the grid.
|
||||
*/
|
||||
class CC_DLL CCTiledGrid3D : public CCGridBase
|
||||
#ifdef EMSCRIPTEN
|
||||
, public CCGLBufferedNode
|
||||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
CCTiledGrid3D();
|
||||
|
|
|
@ -36,12 +36,14 @@ THE SOFTWARE.
|
|||
|
||||
#ifndef CCAssert
|
||||
#if COCOS2D_DEBUG > 0
|
||||
extern void CC_DLL cc_assert_script_compatible(bool cond, const char *msg);
|
||||
#define CCAssert(cond, msg) \
|
||||
{ \
|
||||
cc_assert_script_compatible(!!(cond), (msg)); \
|
||||
CC_ASSERT(cond); \
|
||||
}
|
||||
extern bool CC_DLL cc_assert_script_compatible(const char *msg);
|
||||
#define CCAssert(cond, msg) do { \
|
||||
if (!(cond)) { \
|
||||
if (!cc_assert_script_compatible(msg) && strlen(msg)) \
|
||||
cocos2d::CCLog("Assert failed: %s", msg); \
|
||||
CC_ASSERT(cond); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define CCAssert(cond, msg)
|
||||
#endif
|
||||
|
|
|
@ -27,9 +27,11 @@ THE SOFTWARE.
|
|||
#ifndef __CCTYPES_H__
|
||||
#define __CCTYPES_H__
|
||||
|
||||
#include <string>
|
||||
#include "cocoa/CCGeometry.h"
|
||||
#include "CCGL.h"
|
||||
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/** RGB color composed of bytes 3 bytes
|
||||
|
@ -49,6 +51,14 @@ ccc3(const GLubyte r, const GLubyte g, const GLubyte b)
|
|||
ccColor3B c = {r, g, b};
|
||||
return c;
|
||||
}
|
||||
|
||||
/** returns true if both ccColor3B are equal. Otherwise it returns false.
|
||||
*/
|
||||
static inline bool ccc3BEqual(const ccColor3B &col1, const ccColor3B &col2)
|
||||
{
|
||||
return col1.r == col2.r && col1.g == col2.g && col1.b == col2.b;
|
||||
}
|
||||
|
||||
//ccColor3B predefined colors
|
||||
//! White color (255,255,255)
|
||||
static const ccColor3B ccWHITE={255,255,255};
|
||||
|
@ -350,6 +360,78 @@ typedef struct
|
|||
CCSize size;
|
||||
} ccAnimationFrameData;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
types used for defining fonts properties (i.e. font name, size, stroke or shadow)
|
||||
*/
|
||||
|
||||
// shadow attributes
|
||||
typedef struct _ccFontShadow
|
||||
{
|
||||
public:
|
||||
|
||||
// shadow is not enabled by default
|
||||
_ccFontShadow(): m_shadowEnabled(false) {}
|
||||
|
||||
// true if shadow enabled
|
||||
bool m_shadowEnabled;
|
||||
// shadow x and y offset
|
||||
CCSize m_shadowOffset;
|
||||
// shadow blurrines
|
||||
float m_shadowBlur;
|
||||
// shadow opacity
|
||||
float m_shadowOpacity;
|
||||
|
||||
} ccFontShadow;
|
||||
|
||||
// stroke attributes
|
||||
typedef struct _ccFontStroke
|
||||
{
|
||||
public:
|
||||
|
||||
// stroke is disabled by default
|
||||
_ccFontStroke(): m_strokeEnabled(false) {}
|
||||
|
||||
// true if stroke enabled
|
||||
bool m_strokeEnabled;
|
||||
// stroke color
|
||||
ccColor3B m_strokeColor;
|
||||
// stroke size
|
||||
float m_strokeSize;
|
||||
|
||||
} ccFontStroke;
|
||||
|
||||
// font attributes
|
||||
typedef struct _ccFontDefinition
|
||||
{
|
||||
public:
|
||||
|
||||
_ccFontDefinition(): m_alignment(kCCTextAlignmentCenter),
|
||||
m_vertAlignment(kCCVerticalTextAlignmentTop),
|
||||
m_fontFillColor(ccWHITE)
|
||||
{ m_dimensions = CCSizeMake(0,0); }
|
||||
|
||||
// font name
|
||||
std::string m_fontName;
|
||||
// font size
|
||||
int m_fontSize;
|
||||
// horizontal alignment
|
||||
CCTextAlignment m_alignment;
|
||||
// vertical alignment
|
||||
CCVerticalTextAlignment m_vertAlignment;
|
||||
// renering box
|
||||
CCSize m_dimensions;
|
||||
// font color
|
||||
ccColor3B m_fontFillColor;
|
||||
// font shadow
|
||||
ccFontShadow m_shadow;
|
||||
// font stroke
|
||||
ccFontStroke m_stroke;
|
||||
|
||||
} ccFontDefinition;
|
||||
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif //__CCTYPES_H__
|
||||
|
|
|
@ -199,6 +199,22 @@ THE SOFTWARE.
|
|||
#include "platform/nacl/CCStdC.h"
|
||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
|
||||
#include "platform/emscripten/CCAccelerometer.h"
|
||||
#include "platform/emscripten/CCApplication.h"
|
||||
#include "platform/emscripten/CCEGLView.h"
|
||||
#include "platform/emscripten/CCGL.h"
|
||||
#include "platform/emscripten/CCStdC.h"
|
||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)
|
||||
#include "platform/tizen/CCAccelerometer.h"
|
||||
#include "platform/tizen/CCApplication.h"
|
||||
#include "platform/tizen/CCEGLView.h"
|
||||
#include "platform/tizen/CCGL.h"
|
||||
#include "platform/tizen/CCStdC.h"
|
||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN
|
||||
|
||||
// script_support
|
||||
#include "script_support/CCScriptSupport.h"
|
||||
|
||||
|
@ -256,6 +272,10 @@ THE SOFTWARE.
|
|||
#include "CCDirector.h"
|
||||
#include "CCScheduler.h"
|
||||
|
||||
// component
|
||||
#include "support/component/CCComponent.h"
|
||||
#include "support/component/CCComponentContainer.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
CC_DLL const char* cocos2dVersion();
|
||||
|
|
|
@ -116,8 +116,6 @@ void CCLabelAtlas::updateAtlasValues()
|
|||
{
|
||||
unsigned int n = m_sString.length();
|
||||
|
||||
ccV3F_C4B_T2F_Quad quad;
|
||||
|
||||
const unsigned char *s = (unsigned char*)m_sString.c_str();
|
||||
|
||||
CCTexture2D *texture = m_pTextureAtlas->getTexture();
|
||||
|
@ -125,8 +123,16 @@ void CCLabelAtlas::updateAtlasValues()
|
|||
float textureHigh = (float) texture->getPixelsHigh();
|
||||
float itemWidthInPixels = m_uItemWidth * CC_CONTENT_SCALE_FACTOR();
|
||||
float itemHeightInPixels = m_uItemHeight * CC_CONTENT_SCALE_FACTOR();
|
||||
if (m_bIgnoreContentScaleFactor)
|
||||
{
|
||||
itemWidthInPixels = m_uItemWidth;
|
||||
itemHeightInPixels = m_uItemHeight;
|
||||
}
|
||||
|
||||
CCAssert( n <= m_pTextureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
|
||||
ccV3F_C4B_T2F_Quad* quads = m_pTextureAtlas->getQuads();
|
||||
for(unsigned int i = 0; i < n; i++) {
|
||||
|
||||
unsigned char a = s[i] - m_uMapStartChar;
|
||||
float row = (float) (a % m_uItemsPerRow);
|
||||
float col = (float) (a / m_uItemsPerRow);
|
||||
|
@ -144,34 +150,39 @@ void CCLabelAtlas::updateAtlasValues()
|
|||
float bottom = top + itemHeightInPixels / textureHigh;
|
||||
#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
|
||||
|
||||
quad.tl.texCoords.u = left;
|
||||
quad.tl.texCoords.v = top;
|
||||
quad.tr.texCoords.u = right;
|
||||
quad.tr.texCoords.v = top;
|
||||
quad.bl.texCoords.u = left;
|
||||
quad.bl.texCoords.v = bottom;
|
||||
quad.br.texCoords.u = right;
|
||||
quad.br.texCoords.v = bottom;
|
||||
quads[i].tl.texCoords.u = left;
|
||||
quads[i].tl.texCoords.v = top;
|
||||
quads[i].tr.texCoords.u = right;
|
||||
quads[i].tr.texCoords.v = top;
|
||||
quads[i].bl.texCoords.u = left;
|
||||
quads[i].bl.texCoords.v = bottom;
|
||||
quads[i].br.texCoords.u = right;
|
||||
quads[i].br.texCoords.v = bottom;
|
||||
|
||||
quad.bl.vertices.x = (float) (i * m_uItemWidth);
|
||||
quad.bl.vertices.y = 0;
|
||||
quad.bl.vertices.z = 0.0f;
|
||||
quad.br.vertices.x = (float)(i * m_uItemWidth + m_uItemWidth);
|
||||
quad.br.vertices.y = 0;
|
||||
quad.br.vertices.z = 0.0f;
|
||||
quad.tl.vertices.x = (float)(i * m_uItemWidth);
|
||||
quad.tl.vertices.y = (float)(m_uItemHeight);
|
||||
quad.tl.vertices.z = 0.0f;
|
||||
quad.tr.vertices.x = (float)(i * m_uItemWidth + m_uItemWidth);
|
||||
quad.tr.vertices.y = (float)(m_uItemHeight);
|
||||
quad.tr.vertices.z = 0.0f;
|
||||
|
||||
quads[i].bl.vertices.x = (float) (i * m_uItemWidth);
|
||||
quads[i].bl.vertices.y = 0;
|
||||
quads[i].bl.vertices.z = 0.0f;
|
||||
quads[i].br.vertices.x = (float)(i * m_uItemWidth + m_uItemWidth);
|
||||
quads[i].br.vertices.y = 0;
|
||||
quads[i].br.vertices.z = 0.0f;
|
||||
quads[i].tl.vertices.x = (float)(i * m_uItemWidth);
|
||||
quads[i].tl.vertices.y = (float)(m_uItemHeight);
|
||||
quads[i].tl.vertices.z = 0.0f;
|
||||
quads[i].tr.vertices.x = (float)(i * m_uItemWidth + m_uItemWidth);
|
||||
quads[i].tr.vertices.y = (float)(m_uItemHeight);
|
||||
quads[i].tr.vertices.z = 0.0f;
|
||||
ccColor4B c = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity };
|
||||
quad.tl.colors = c;
|
||||
quad.tr.colors = c;
|
||||
quad.bl.colors = c;
|
||||
quad.br.colors = c;
|
||||
m_pTextureAtlas->updateQuad(&quad, i);
|
||||
quads[i].tl.colors = c;
|
||||
quads[i].tr.colors = c;
|
||||
quads[i].bl.colors = c;
|
||||
quads[i].br.colors = c;
|
||||
}
|
||||
if (n > 0 ){
|
||||
m_pTextureAtlas->setDirty(true);
|
||||
unsigned int totalQuads = m_pTextureAtlas->getTotalQuads();
|
||||
if (n > totalQuads) {
|
||||
m_pTextureAtlas->increaseTotalQuadsWith(n - totalQuads);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ http://www.angelcode.com/products/bmfont/ (Free, Windows only)
|
|||
|
||||
using namespace std;
|
||||
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
// The return value needs to be deleted by CC_SAFE_DELETE_ARRAY.
|
||||
|
@ -153,8 +152,8 @@ CCBMFontConfiguration::~CCBMFontConfiguration()
|
|||
const char* CCBMFontConfiguration::description(void)
|
||||
{
|
||||
return CCString::createWithFormat(
|
||||
"<CCBMFontConfiguration = %08X | Glphys:%d Kernings:%d | Image = %s>",
|
||||
this,
|
||||
"<CCBMFontConfiguration = " CC_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>",
|
||||
(size_t)this,
|
||||
HASH_COUNT(m_pFontDefDictionary),
|
||||
HASH_COUNT(m_pKerningDictionary),
|
||||
m_sAtlasName.c_str()
|
||||
|
|
|
@ -45,6 +45,9 @@ CCLabelTTF::CCLabelTTF()
|
|||
, m_pFontName(NULL)
|
||||
, m_fFontSize(0.0)
|
||||
, m_string("")
|
||||
, m_shadowEnabled(false)
|
||||
, m_strokeEnabled(false)
|
||||
, m_textFillColor(ccWHITE)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -120,10 +123,10 @@ bool CCLabelTTF::initWithString(const char *string, const char *fontName, float
|
|||
this->setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(SHADER_PROGRAM));
|
||||
|
||||
m_tDimensions = CCSizeMake(dimensions.width, dimensions.height);
|
||||
m_hAlignment = hAlignment;
|
||||
m_vAlignment = vAlignment;
|
||||
m_pFontName = new std::string(fontName);
|
||||
m_fFontSize = fontSize;
|
||||
m_hAlignment = hAlignment;
|
||||
m_vAlignment = vAlignment;
|
||||
m_pFontName = new std::string(fontName);
|
||||
m_fFontSize = fontSize;
|
||||
|
||||
this->setString(string);
|
||||
|
||||
|
@ -133,6 +136,29 @@ bool CCLabelTTF::initWithString(const char *string, const char *fontName, float
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CCLabelTTF::initWithStringAndTextDefinition(const char *string, ccFontDefinition &textDefinition)
|
||||
{
|
||||
if (CCSprite::init())
|
||||
{
|
||||
// shader program
|
||||
this->setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(SHADER_PROGRAM));
|
||||
|
||||
// prepare everythin needed to render the label
|
||||
_updateWithTextDefinition(textDefinition, false);
|
||||
|
||||
// set the string
|
||||
this->setString(string);
|
||||
|
||||
//
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CCLabelTTF::setString(const char *string)
|
||||
{
|
||||
CCAssert(string != NULL, "Invalid string");
|
||||
|
@ -255,30 +281,275 @@ void CCLabelTTF::setFontName(const char *fontName)
|
|||
bool CCLabelTTF::updateTexture()
|
||||
{
|
||||
CCTexture2D *tex;
|
||||
|
||||
// let system compute label's width or height when its value is 0
|
||||
// refer to cocos2d-x issue #1430
|
||||
tex = new CCTexture2D();
|
||||
if (!tex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
tex->initWithString( m_string.c_str(),
|
||||
m_pFontName->c_str(),
|
||||
m_fFontSize * CC_CONTENT_SCALE_FACTOR(),
|
||||
CC_SIZE_POINTS_TO_PIXELS(m_tDimensions),
|
||||
m_hAlignment,
|
||||
m_vAlignment);
|
||||
|
||||
if (!tex)
|
||||
return false;
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
ccFontDefinition texDef = _prepareTextDefinition(true);
|
||||
tex->initWithString( m_string.c_str(), &texDef );
|
||||
|
||||
#else
|
||||
|
||||
tex->initWithString( m_string.c_str(),
|
||||
m_pFontName->c_str(),
|
||||
m_fFontSize * CC_CONTENT_SCALE_FACTOR(),
|
||||
CC_SIZE_POINTS_TO_PIXELS(m_tDimensions),
|
||||
m_hAlignment,
|
||||
m_vAlignment);
|
||||
|
||||
#endif
|
||||
|
||||
// set the texture
|
||||
this->setTexture(tex);
|
||||
// release it
|
||||
tex->release();
|
||||
|
||||
CCRect rect = CCRectZero;
|
||||
rect.size = m_pobTexture->getContentSize();
|
||||
|
||||
// set the size in the sprite
|
||||
CCRect rect =CCRectZero;
|
||||
rect.size = m_pobTexture->getContentSize();
|
||||
this->setTextureRect(rect);
|
||||
|
||||
|
||||
//ok
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCLabelTTF::enableShadow(const CCSize &shadowOffset, float shadowOpacity, float shadowBlur, bool updateTexture)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
bool valueChanged = false;
|
||||
|
||||
if (false == m_shadowEnabled)
|
||||
{
|
||||
m_shadowEnabled = true;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if ( (m_shadowOffset.width != shadowOffset.width) || (m_shadowOffset.height!=shadowOffset.height) )
|
||||
{
|
||||
m_shadowOffset.width = shadowOffset.width;
|
||||
m_shadowOffset.height = shadowOffset.height;
|
||||
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if (m_shadowOpacity != shadowOpacity )
|
||||
{
|
||||
m_shadowOpacity = shadowOpacity;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if (m_shadowBlur != shadowBlur)
|
||||
{
|
||||
m_shadowBlur = shadowBlur;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
|
||||
if ( valueChanged && updateTexture )
|
||||
{
|
||||
this->updateTexture();
|
||||
}
|
||||
|
||||
#else
|
||||
CCAssert(false, "Currently only supported on iOS and Android!");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CCLabelTTF::disableShadow(bool updateTexture)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
if (m_shadowEnabled)
|
||||
{
|
||||
m_shadowEnabled = false;
|
||||
|
||||
if (updateTexture)
|
||||
this->updateTexture();
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
CCAssert(false, "Currently only supported on iOS and Android!");
|
||||
#endif
|
||||
}
|
||||
|
||||
void CCLabelTTF::enableStroke(const ccColor3B &strokeColor, float strokeSize, bool updateTexture)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
bool valueChanged = false;
|
||||
|
||||
if(m_strokeEnabled == false)
|
||||
{
|
||||
m_strokeEnabled = true;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if ( (m_strokeColor.r != strokeColor.r) || (m_strokeColor.g != strokeColor.g) || (m_strokeColor.b != strokeColor.b) )
|
||||
{
|
||||
m_strokeColor = strokeColor;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if (m_strokeSize!=strokeSize)
|
||||
{
|
||||
m_strokeSize = strokeSize;
|
||||
valueChanged = true;
|
||||
}
|
||||
|
||||
if ( valueChanged && updateTexture )
|
||||
{
|
||||
this->updateTexture();
|
||||
}
|
||||
|
||||
#else
|
||||
CCAssert(false, "Currently only supported on iOS and Android!");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CCLabelTTF::disableStroke(bool updateTexture)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
if (m_strokeEnabled)
|
||||
{
|
||||
m_strokeEnabled = false;
|
||||
|
||||
if (updateTexture)
|
||||
this->updateTexture();
|
||||
}
|
||||
|
||||
#else
|
||||
CCAssert(false, "Currently only supported on iOS and Android!");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CCLabelTTF::setFontFillColor(const ccColor3B &tintColor, bool updateTexture)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
if (m_textFillColor.r != tintColor.r || m_textFillColor.g != tintColor.g || m_textFillColor.b != tintColor.b)
|
||||
{
|
||||
m_textFillColor = tintColor;
|
||||
|
||||
if (updateTexture)
|
||||
this->updateTexture();
|
||||
}
|
||||
#else
|
||||
CCAssert(false, "Currently only supported on iOS and Android!");
|
||||
#endif
|
||||
}
|
||||
|
||||
void CCLabelTTF::setTextDefinition(ccFontDefinition *theDefinition)
|
||||
{
|
||||
if (theDefinition)
|
||||
{
|
||||
_updateWithTextDefinition(*theDefinition, true);
|
||||
}
|
||||
}
|
||||
|
||||
ccFontDefinition *CCLabelTTF::getTextDefinition()
|
||||
{
|
||||
ccFontDefinition *tempDefinition = new ccFontDefinition;
|
||||
*tempDefinition = _prepareTextDefinition(false);
|
||||
return tempDefinition;
|
||||
}
|
||||
|
||||
void CCLabelTTF::_updateWithTextDefinition(ccFontDefinition & textDefinition, bool mustUpdateTexture)
|
||||
{
|
||||
m_tDimensions = CCSizeMake(textDefinition.m_dimensions.width, textDefinition.m_dimensions.height);
|
||||
m_hAlignment = textDefinition.m_alignment;
|
||||
m_vAlignment = textDefinition.m_vertAlignment;
|
||||
|
||||
m_pFontName = new std::string(textDefinition.m_fontName);
|
||||
m_fFontSize = textDefinition.m_fontSize;
|
||||
|
||||
|
||||
// shadow
|
||||
if ( textDefinition.m_shadow.m_shadowEnabled )
|
||||
{
|
||||
enableShadow(textDefinition.m_shadow.m_shadowOffset, textDefinition.m_shadow.m_shadowOpacity, textDefinition.m_shadow.m_shadowBlur, false);
|
||||
}
|
||||
|
||||
// stroke
|
||||
if ( textDefinition.m_stroke.m_strokeEnabled )
|
||||
{
|
||||
enableStroke(textDefinition.m_stroke.m_strokeColor, textDefinition.m_stroke.m_strokeSize, false);
|
||||
}
|
||||
|
||||
// fill color
|
||||
setFontFillColor(textDefinition.m_fontFillColor, false);
|
||||
|
||||
if (mustUpdateTexture)
|
||||
updateTexture();
|
||||
}
|
||||
|
||||
ccFontDefinition CCLabelTTF::_prepareTextDefinition(bool adjustForResolution)
|
||||
{
|
||||
ccFontDefinition texDef;
|
||||
|
||||
if (adjustForResolution)
|
||||
texDef.m_fontSize = m_fFontSize * CC_CONTENT_SCALE_FACTOR();
|
||||
else
|
||||
texDef.m_fontSize = m_fFontSize;
|
||||
|
||||
texDef.m_fontName = *m_pFontName;
|
||||
texDef.m_alignment = m_hAlignment;
|
||||
texDef.m_vertAlignment = m_vAlignment;
|
||||
|
||||
|
||||
if (adjustForResolution)
|
||||
texDef.m_dimensions = CC_SIZE_POINTS_TO_PIXELS(m_tDimensions);
|
||||
else
|
||||
texDef.m_dimensions = m_tDimensions;
|
||||
|
||||
|
||||
// stroke
|
||||
if ( m_strokeEnabled )
|
||||
{
|
||||
texDef.m_stroke.m_strokeEnabled = true;
|
||||
texDef.m_stroke.m_strokeColor = m_strokeColor;
|
||||
|
||||
if (adjustForResolution)
|
||||
texDef.m_stroke.m_strokeSize = m_strokeSize * CC_CONTENT_SCALE_FACTOR();
|
||||
else
|
||||
texDef.m_stroke.m_strokeSize = m_strokeSize;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
texDef.m_stroke.m_strokeEnabled = false;
|
||||
}
|
||||
|
||||
|
||||
// shadow
|
||||
if ( m_shadowEnabled )
|
||||
{
|
||||
texDef.m_shadow.m_shadowEnabled = true;
|
||||
texDef.m_shadow.m_shadowBlur = m_shadowBlur;
|
||||
texDef.m_shadow.m_shadowOpacity = m_shadowOpacity;
|
||||
|
||||
if (adjustForResolution)
|
||||
texDef.m_shadow.m_shadowOffset = CC_SIZE_POINTS_TO_PIXELS(m_shadowOffset);
|
||||
else
|
||||
texDef.m_shadow.m_shadowOffset = m_shadowOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
texDef.m_shadow.m_shadowEnabled = false;
|
||||
}
|
||||
|
||||
// text tint
|
||||
texDef.m_fontFillColor = m_textFillColor;
|
||||
|
||||
return texDef;
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -37,6 +37,8 @@ NS_CC_BEGIN
|
|||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @brief CCLabelTTF is a subclass of CCTextureNode that knows how to render text labels
|
||||
*
|
||||
* All features from CCTextureNode are valid in CCLabelTTF
|
||||
|
@ -80,6 +82,34 @@ public:
|
|||
const CCSize& dimensions, CCTextAlignment hAlignment,
|
||||
CCVerticalTextAlignment vAlignment);
|
||||
|
||||
/** initializes the CCLabelTTF with a font name, alignment, dimension and font size */
|
||||
bool initWithStringAndTextDefinition(const char *string, ccFontDefinition &textDefinition);
|
||||
|
||||
/** set the text definition used by this label */
|
||||
void setTextDefinition(ccFontDefinition *theDefinition);
|
||||
|
||||
/** get the text definition used by this label */
|
||||
ccFontDefinition * getTextDefinition();
|
||||
|
||||
|
||||
|
||||
/** enable or disable shadow for the label */
|
||||
void enableShadow(const CCSize &shadowOffset, float shadowOpacity, float shadowBlur, bool mustUpdateTexture = true);
|
||||
|
||||
/** disable shadow rendering */
|
||||
void disableShadow(bool mustUpdateTexture = true);
|
||||
|
||||
/** enable or disable stroke */
|
||||
void enableStroke(const ccColor3B &strokeColor, float strokeSize, bool mustUpdateTexture = true);
|
||||
|
||||
/** disable stroke */
|
||||
void disableStroke(bool mustUpdateTexture = true);
|
||||
|
||||
/** set text tinting */
|
||||
void setFontFillColor(const ccColor3B &tintColor, bool mustUpdateTexture = true);
|
||||
|
||||
|
||||
|
||||
/** initializes the CCLabelTTF */
|
||||
bool init();
|
||||
|
||||
|
@ -107,10 +137,15 @@ public:
|
|||
|
||||
const char* getFontName();
|
||||
void setFontName(const char *fontName);
|
||||
|
||||
|
||||
private:
|
||||
bool updateTexture();
|
||||
protected:
|
||||
|
||||
/** set the text definition for this label */
|
||||
void _updateWithTextDefinition(ccFontDefinition & textDefinition, bool mustUpdateTexture = true);
|
||||
ccFontDefinition _prepareTextDefinition(bool adjustForResolution = false);
|
||||
|
||||
/** Dimensions of the label in Points */
|
||||
CCSize m_tDimensions;
|
||||
/** The alignment of the label */
|
||||
|
@ -121,8 +156,25 @@ protected:
|
|||
std::string * m_pFontName;
|
||||
/** Font size of the label */
|
||||
float m_fFontSize;
|
||||
|
||||
/** label's string */
|
||||
std::string m_string;
|
||||
|
||||
/** font shadow */
|
||||
bool m_shadowEnabled;
|
||||
CCSize m_shadowOffset;
|
||||
float m_shadowOpacity;
|
||||
float m_shadowBlur;
|
||||
|
||||
|
||||
/** font stroke */
|
||||
bool m_strokeEnabled;
|
||||
ccColor3B m_strokeColor;
|
||||
float m_strokeSize;
|
||||
|
||||
/** font tint */
|
||||
ccColor3B m_textFillColor;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ void CCLayer::unregisterScriptKeypadHandler(void)
|
|||
|
||||
void CCLayer::keyBackClicked(void)
|
||||
{
|
||||
if (m_pScriptKeypadHandlerEntry)
|
||||
if (m_pScriptKeypadHandlerEntry || m_eScriptType == kScriptTypeJavascript)
|
||||
{
|
||||
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeLayerKeypadEvent(this, kTypeBackClicked);
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ bool CCLayerColor::initWithColor(const ccColor4B& color, GLfloat w, GLfloat h)
|
|||
_displayedColor.r = _realColor.r = color.r;
|
||||
_displayedColor.g = _realColor.g = color.g;
|
||||
_displayedColor.b = _realColor.b = color.b;
|
||||
_displayedOpacity = color.a;
|
||||
_displayedOpacity = _realOpacity = color.a;
|
||||
|
||||
for (size_t i = 0; i<sizeof(m_pSquareVertices) / sizeof( m_pSquareVertices[0]); i++ )
|
||||
{
|
||||
|
@ -778,8 +778,16 @@ void CCLayerColor::draw()
|
|||
//
|
||||
// Attributes
|
||||
//
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData(m_pSquareVertices, 4 * sizeof(ccVertex2F), 0);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
setGLBufferData(m_pSquareColors, 4 * sizeof(ccColor4F), 1);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, m_pSquareVertices);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_FLOAT, GL_FALSE, 0, m_pSquareColors);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
ccGLBlendFunc( m_tBlendFunc.src, m_tBlendFunc.dst );
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@ THE SOFTWARE.
|
|||
#include "platform/CCAccelerometerDelegate.h"
|
||||
#include "keypad_dispatcher/CCKeypadDelegate.h"
|
||||
#include "cocoa/CCArray.h"
|
||||
#ifdef EMSCRIPTEN
|
||||
#include "base_nodes/CCGLBufferedNode.h"
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -217,6 +220,9 @@ All features from CCLayer are valid, plus the following new features:
|
|||
- RGB colors
|
||||
*/
|
||||
class CC_DLL CCLayerColor : public CCLayerRGBA, public CCBlendProtocol
|
||||
#ifdef EMSCRIPTEN
|
||||
, public CCGLBufferedNode
|
||||
#endif // EMSCRIPTEN
|
||||
{
|
||||
protected:
|
||||
ccVertex2F m_pSquareVertices[4];
|
||||
|
|
|
@ -714,6 +714,24 @@ CCArray* CCMenuItemToggle::getSubItems()
|
|||
return m_pSubItems;
|
||||
}
|
||||
|
||||
CCMenuItemToggle * CCMenuItemToggle::createWithTarget(CCObject* target, SEL_MenuHandler selector, CCArray* menuItems)
|
||||
{
|
||||
CCMenuItemToggle *pRet = new CCMenuItemToggle();
|
||||
pRet->CCMenuItem::initWithTarget(target, selector);
|
||||
pRet->m_pSubItems = CCArray::create();
|
||||
pRet->m_pSubItems->retain();
|
||||
|
||||
for (unsigned int z=0; z < menuItems->count(); z++)
|
||||
{
|
||||
CCMenuItem* menuItem = (CCMenuItem*)menuItems->objectAtIndex(z);
|
||||
pRet->m_pSubItems->addObject(menuItem);
|
||||
}
|
||||
|
||||
pRet->m_uSelectedIndex = UINT_MAX;
|
||||
pRet->setSelectedIndex(0);
|
||||
return pRet;
|
||||
}
|
||||
|
||||
CCMenuItemToggle * CCMenuItemToggle::createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
|
|
@ -322,6 +322,9 @@ public:
|
|||
, m_pSubItems(NULL)
|
||||
{}
|
||||
virtual ~CCMenuItemToggle();
|
||||
|
||||
/** creates a menu item from a CCArray with a target selector */
|
||||
static CCMenuItemToggle * createWithTarget(CCObject* target, SEL_MenuHandler selector, CCArray* menuItems);
|
||||
|
||||
/** creates a menu item from a list of items with a target/selector */
|
||||
static CCMenuItemToggle* createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...);
|
||||
|
|
|
@ -177,9 +177,9 @@ void CCClippingNode::visit()
|
|||
static bool once = true;
|
||||
if (once)
|
||||
{
|
||||
char warning[200];
|
||||
snprintf(warning, 50, "Nesting more than %d stencils is not supported. Everything will be drawn without stencil for this node and its childs.", g_sStencilBits);
|
||||
CCLOG(warning);
|
||||
char warning[200] = {0};
|
||||
snprintf(warning, sizeof(warning), "Nesting more than %d stencils is not supported. Everything will be drawn without stencil for this node and its childs.", g_sStencilBits);
|
||||
CCLOG("%s", warning);
|
||||
|
||||
once = false;
|
||||
}
|
||||
|
|
|
@ -337,9 +337,21 @@ void CCMotionStreak::draw()
|
|||
|
||||
ccGLBindTexture2D( m_pTexture->getName() );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
// Size calculations from ::initWithFade
|
||||
setGLBufferData(m_pVertices, (sizeof(ccVertex2F) * m_uMaxPoints * 2), 0);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
setGLBufferData(m_pTexCoords, (sizeof(ccTex2F) * m_uMaxPoints * 2), 1);
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
setGLBufferData(m_pColorPointer, (sizeof(GLubyte) * m_uMaxPoints * 2 * 4), 2);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0);
|
||||
#else
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, m_pVertices);
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, m_pTexCoords);
|
||||
glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, m_pColorPointer);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)m_uNuPoints*2);
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ THE SOFTWARE.
|
|||
#include "textures/CCTexture2D.h"
|
||||
#include "ccTypes.h"
|
||||
#include "base_nodes/CCNode.h"
|
||||
#ifdef EMSCRIPTEN
|
||||
#include "base_nodes/CCGLBufferedNode.h"
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -41,6 +44,9 @@ NS_CC_BEGIN
|
|||
Creates a trailing path.
|
||||
*/
|
||||
class CC_DLL CCMotionStreak : public CCNodeRGBA, public CCTextureProtocol
|
||||
#ifdef EMSCRIPTEN
|
||||
, public CCGLBufferedNode
|
||||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
CCMotionStreak();
|
||||
|
|
|
@ -499,9 +499,22 @@ void CCProgressTimer::draw(void)
|
|||
|
||||
ccGLBindTexture2D( m_pSprite->getTexture()->getName() );
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
setGLBufferData((void*) m_pVertexData, (m_nVertexDataCount * sizeof(ccV2F_C4B_T2F)), 0);
|
||||
|
||||
int offset = 0;
|
||||
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||
|
||||
offset += sizeof(ccVertex2F);
|
||||
glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||
|
||||
offset += sizeof(ccColor4B);
|
||||
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||
#else
|
||||
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]) , &m_pVertexData[0].vertices);
|
||||
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]), &m_pVertexData[0].texCoords);
|
||||
glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(m_pVertexData[0]), &m_pVertexData[0].colors);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
if(m_eType == kCCProgressTimerTypeRadial)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,9 @@ THE SOFTWARE.
|
|||
#define __MISC_NODE_CCPROGRESS_TIMER_H__
|
||||
|
||||
#include "sprite_nodes/CCSprite.h"
|
||||
#ifdef EMSCRIPTEN
|
||||
#include "base_nodes/CCGLBufferedNode.h"
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -51,6 +54,9 @@ typedef enum {
|
|||
@since v0.99.1
|
||||
*/
|
||||
class CC_DLL CCProgressTimer : public CCNodeRGBA
|
||||
#ifdef EMSCRIPTEN
|
||||
, public CCGLBufferedNode
|
||||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
CCProgressTimer();
|
||||
|
|
|
@ -13,6 +13,8 @@ enum TargetPlatform
|
|||
kTargetIpad,
|
||||
kTargetBlackBerry,
|
||||
kTargetNaCl,
|
||||
kTargetEmscripten,
|
||||
kTargetTizen
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,7 +40,7 @@ static const int kMaxLogLen = 16*1024;
|
|||
/**
|
||||
@brief Output Debug message.
|
||||
*/
|
||||
void CC_DLL CCLog(const char * pszFormat, ...);
|
||||
void CC_DLL CCLog(const char * pszFormat, ...) CC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
/**
|
||||
* lua can not deal with ...
|
||||
|
|
|
@ -79,6 +79,16 @@ void CCEGLViewProtocol::setDesignResolutionSize(float width, float height, Resol
|
|||
m_fScaleX = m_fScaleY = MIN(m_fScaleX, m_fScaleY);
|
||||
}
|
||||
|
||||
if ( resolutionPolicy == kResolutionFixedHeight) {
|
||||
m_fScaleX = m_fScaleY;
|
||||
m_obDesignResolutionSize.width = ceilf(m_obScreenSize.width/m_fScaleX);
|
||||
}
|
||||
|
||||
if ( resolutionPolicy == kResolutionFixedWidth) {
|
||||
m_fScaleY = m_fScaleX;
|
||||
m_obDesignResolutionSize.height = ceilf(m_obScreenSize.height/m_fScaleY);
|
||||
}
|
||||
|
||||
// calculate the rect of viewport
|
||||
float viewPortW = m_obDesignResolutionSize.width * m_fScaleX;
|
||||
float viewPortH = m_obDesignResolutionSize.height * m_fScaleY;
|
||||
|
@ -154,17 +164,33 @@ void CCEGLViewProtocol::setScissorInPoints(float x , float y , float w , float h
|
|||
(GLsizei)(h * m_fScaleY));
|
||||
}
|
||||
|
||||
void CCEGLViewProtocol::setViewName(const char* pszViewName)
|
||||
{
|
||||
if (pszViewName != NULL && strlen(pszViewName) > 0)
|
||||
{
|
||||
strncpy(m_szViewName, pszViewName, sizeof(m_szViewName));
|
||||
}
|
||||
}
|
||||
|
||||
const char* CCEGLViewProtocol::getViewName()
|
||||
{
|
||||
return m_szViewName;
|
||||
bool CCEGLViewProtocol::isScissorEnabled()
|
||||
{
|
||||
return glIsEnabled(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
CCRect CCEGLViewProtocol::getScissorRect()
|
||||
{
|
||||
GLfloat params[4];
|
||||
glGetFloatv(GL_SCISSOR_BOX, params);
|
||||
float x = (params[0] - m_obViewPortRect.origin.x) / m_fScaleX;
|
||||
float y = (params[1] - m_obViewPortRect.origin.y) / m_fScaleY;
|
||||
float w = params[2] / m_fScaleX;
|
||||
float h = params[3] / m_fScaleY;
|
||||
return CCRectMake(x, y, w, h);
|
||||
}
|
||||
|
||||
void CCEGLViewProtocol::setViewName(const char* pszViewName)
|
||||
{
|
||||
if (pszViewName != NULL && strlen(pszViewName) > 0)
|
||||
{
|
||||
strncpy(m_szViewName, pszViewName, sizeof(m_szViewName));
|
||||
}
|
||||
}
|
||||
|
||||
const char* CCEGLViewProtocol::getViewName()
|
||||
{
|
||||
return m_szViewName;
|
||||
}
|
||||
|
||||
void CCEGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float ys[])
|
||||
|
|
|
@ -14,6 +14,16 @@ enum ResolutionPolicy
|
|||
// The entire application is visible in the specified area without distortion while maintaining the original
|
||||
// aspect ratio of the application. Borders can appear on two sides of the application.
|
||||
kResolutionShowAll,
|
||||
// The application takes the height of the design resolution size and modifies the width of the internal
|
||||
// canvas so that it fits the aspect ratio of the device
|
||||
// no distortion will occur however you must make sure your application works on different
|
||||
// aspect ratios
|
||||
kResolutionFixedHeight,
|
||||
// The application takes the width of the design resolution size and modifies the height of the internal
|
||||
// canvas so that it fits the aspect ratio of the device
|
||||
// no distortion will occur however you must make sure your application works on different
|
||||
// aspect ratios
|
||||
kResolutionFixedWidth,
|
||||
|
||||
kResolutionUnKnown,
|
||||
};
|
||||
|
@ -98,6 +108,16 @@ public:
|
|||
*/
|
||||
virtual void setScissorInPoints(float x , float y , float w , float h);
|
||||
|
||||
/**
|
||||
* Get whether GL_SCISSOR_TEST is enable
|
||||
*/
|
||||
virtual bool isScissorEnabled();
|
||||
|
||||
/**
|
||||
* Get the current scissor rectangle
|
||||
*/
|
||||
virtual CCRect getScissorRect();
|
||||
|
||||
virtual void setViewName(const char* pszViewName);
|
||||
|
||||
const char* getViewName();
|
||||
|
|
|
@ -27,6 +27,7 @@ THE SOFTWARE.
|
|||
#include "cocoa/CCDictionary.h"
|
||||
#include "cocoa/CCString.h"
|
||||
#include "CCSAXParser.h"
|
||||
#include "support/tinyxml2/tinyxml2.h"
|
||||
#include "support/zip_support/unzip.h"
|
||||
#include <stack>
|
||||
|
||||
|
@ -333,21 +334,141 @@ public:
|
|||
|
||||
CCDictionary* CCFileUtils::createCCDictionaryWithContentsOfFile(const std::string& filename)
|
||||
{
|
||||
std::string fullPath = fullPathForFilename(filename.c_str());
|
||||
CCDictMaker tMaker;
|
||||
return tMaker.dictionaryWithContentsOfFile(filename.c_str());
|
||||
return tMaker.dictionaryWithContentsOfFile(fullPath.c_str());
|
||||
}
|
||||
|
||||
CCArray* CCFileUtils::createCCArrayWithContentsOfFile(const std::string& filename)
|
||||
{
|
||||
std::string fullPath = fullPathForFilename(filename.c_str());
|
||||
CCDictMaker tMaker;
|
||||
return tMaker.arrayWithContentsOfFile(filename.c_str());
|
||||
return tMaker.arrayWithContentsOfFile(fullPath.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
* forward statement
|
||||
*/
|
||||
static tinyxml2::XMLElement* generateElementForArray(cocos2d::CCArray *array, tinyxml2::XMLDocument *pDoc);
|
||||
static tinyxml2::XMLElement* generateElementForDict(cocos2d::CCDictionary *dict, tinyxml2::XMLDocument *pDoc);
|
||||
|
||||
/*
|
||||
* Use tinyxml2 to write plist files
|
||||
*/
|
||||
bool CCFileUtils::writeToFile(cocos2d::CCDictionary *dict, const std::string &fullPath)
|
||||
{
|
||||
//CCLOG("tinyxml2 CCDictionary %d writeToFile %s", dict->m_uID, fullPath.c_str());
|
||||
tinyxml2::XMLDocument *pDoc = new tinyxml2::XMLDocument();
|
||||
if (NULL == pDoc)
|
||||
return false;
|
||||
|
||||
tinyxml2::XMLDeclaration *pDeclaration = pDoc->NewDeclaration("xml version=\"1.0\" encoding=\"UTF-8\"");
|
||||
if (NULL == pDeclaration)
|
||||
{
|
||||
delete pDoc;
|
||||
return false;
|
||||
}
|
||||
|
||||
pDoc->LinkEndChild(pDeclaration);
|
||||
tinyxml2::XMLElement *docType = pDoc->NewElement("!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"");
|
||||
pDoc->LinkEndChild(docType);
|
||||
|
||||
tinyxml2::XMLElement *pRootEle = pDoc->NewElement("plist");
|
||||
pRootEle->SetAttribute("version", "1.0");
|
||||
if (NULL == pRootEle)
|
||||
{
|
||||
delete pDoc;
|
||||
return false;
|
||||
}
|
||||
pDoc->LinkEndChild(pRootEle);
|
||||
|
||||
tinyxml2::XMLElement *innerDict = generateElementForDict(dict, pDoc);
|
||||
if (NULL == innerDict )
|
||||
{
|
||||
delete pDoc;
|
||||
return false;
|
||||
}
|
||||
pRootEle->LinkEndChild(innerDict);
|
||||
|
||||
bool bRet = tinyxml2::XML_SUCCESS == pDoc->SaveFile(fullPath.c_str());
|
||||
|
||||
delete pDoc;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate tinyxml2::XMLElement for CCObject through a tinyxml2::XMLDocument
|
||||
*/
|
||||
static tinyxml2::XMLElement* generateElementForObject(cocos2d::CCObject *object, tinyxml2::XMLDocument *pDoc)
|
||||
{
|
||||
// object is CCString
|
||||
if (CCString *str = dynamic_cast<CCString *>(object))
|
||||
{
|
||||
tinyxml2::XMLElement* node = pDoc->NewElement("string");
|
||||
tinyxml2::XMLText* content = pDoc->NewText(str->getCString());
|
||||
node->LinkEndChild(content);
|
||||
return node;
|
||||
}
|
||||
|
||||
// object is CCArray
|
||||
if (CCArray *array = dynamic_cast<CCArray *>(object))
|
||||
return generateElementForArray(array, pDoc);
|
||||
|
||||
// object is CCDictionary
|
||||
if (CCDictionary *innerDict = dynamic_cast<CCDictionary *>(object))
|
||||
return generateElementForDict(innerDict, pDoc);
|
||||
|
||||
CCLOG("This type cannot appear in property list");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate tinyxml2::XMLElement for CCDictionary through a tinyxml2::XMLDocument
|
||||
*/
|
||||
static tinyxml2::XMLElement* generateElementForDict(cocos2d::CCDictionary *dict, tinyxml2::XMLDocument *pDoc)
|
||||
{
|
||||
tinyxml2::XMLElement* rootNode = pDoc->NewElement("dict");
|
||||
|
||||
CCDictElement *dictElement = NULL;
|
||||
CCDICT_FOREACH(dict, dictElement)
|
||||
{
|
||||
tinyxml2::XMLElement* tmpNode = pDoc->NewElement("key");
|
||||
rootNode->LinkEndChild(tmpNode);
|
||||
tinyxml2::XMLText* content = pDoc->NewText(dictElement->getStrKey());
|
||||
tmpNode->LinkEndChild(content);
|
||||
|
||||
CCObject *object = dictElement->getObject();
|
||||
tinyxml2::XMLElement *element = generateElementForObject(object, pDoc);
|
||||
if (element)
|
||||
rootNode->LinkEndChild(element);
|
||||
}
|
||||
return rootNode;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate tinyxml2::XMLElement for CCArray through a tinyxml2::XMLDocument
|
||||
*/
|
||||
static tinyxml2::XMLElement* generateElementForArray(cocos2d::CCArray *array, tinyxml2::XMLDocument *pDoc)
|
||||
{
|
||||
tinyxml2::XMLElement* rootNode = pDoc->NewElement("array");
|
||||
|
||||
CCObject *object = NULL;
|
||||
CCARRAY_FOREACH(array, object)
|
||||
{
|
||||
tinyxml2::XMLElement *element = generateElementForObject(object, pDoc);
|
||||
if (element)
|
||||
rootNode->LinkEndChild(element);
|
||||
}
|
||||
return rootNode;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
NS_CC_BEGIN
|
||||
|
||||
/* The subclass CCFileUtilsIOS and CCFileUtilsMac should override these two method. */
|
||||
CCDictionary* CCFileUtils::createCCDictionaryWithContentsOfFile(const std::string& filename) {return NULL;}
|
||||
bool CCFileUtils::writeToFile(cocos2d::CCDictionary *dict, const std::string &fullPath) {return NULL;}
|
||||
CCArray* CCFileUtils::createCCArrayWithContentsOfFile(const std::string& filename) {return NULL;}
|
||||
|
||||
#endif /* (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) */
|
||||
|
@ -407,7 +528,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
|
|||
std::string msg = "Get data from file(";
|
||||
msg.append(pszFileName).append(") failed!");
|
||||
|
||||
CCLOG(msg.c_str());
|
||||
CCLOG("%s", msg.c_str());
|
||||
}
|
||||
return pBuffer;
|
||||
}
|
||||
|
@ -534,6 +655,8 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
|||
}
|
||||
}
|
||||
|
||||
//CCLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", pszFileName);
|
||||
|
||||
// The file wasn't found, return the file name passed in.
|
||||
return pszFileName;
|
||||
}
|
||||
|
|
|
@ -346,6 +346,12 @@ protected:
|
|||
*/
|
||||
virtual CCDictionary* createCCDictionaryWithContentsOfFile(const std::string& filename);
|
||||
|
||||
/**
|
||||
* Write a dictionary to a plist file.
|
||||
* @note This method is used internally.
|
||||
*/
|
||||
virtual bool writeToFile(CCDictionary *dict, const std::string& fullPath);
|
||||
|
||||
/**
|
||||
* Creates an array by the contents of a file.
|
||||
* @note This method is used internally.
|
||||
|
|
|
@ -112,12 +112,42 @@ public:
|
|||
ETextAlign eAlignMask = kAlignCenter,
|
||||
const char * pFontName = 0,
|
||||
int nSize = 0);
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
|
||||
bool initWithStringShadowStroke(
|
||||
const char * pText,
|
||||
int nWidth = 0,
|
||||
int nHeight = 0,
|
||||
ETextAlign eAlignMask = kAlignCenter,
|
||||
const char * pFontName = 0,
|
||||
int nSize = 0,
|
||||
float textTintR = 1,
|
||||
float textTintG = 1,
|
||||
float textTintB = 1,
|
||||
bool shadow = false,
|
||||
float shadowOffsetX = 0.0,
|
||||
float shadowOffsetY = 0.0,
|
||||
float shadowOpacity = 0.0,
|
||||
float shadowBlur = 0.0,
|
||||
bool stroke = false,
|
||||
float strokeR = 1,
|
||||
float strokeG = 1,
|
||||
float strokeB = 1,
|
||||
float strokeSize = 1
|
||||
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
unsigned char * getData() { return m_pData; }
|
||||
int getDataLen() { return m_nWidth * m_nHeight; }
|
||||
int getDataLen() { return m_nWidth * m_nHeight; }
|
||||
|
||||
|
||||
bool hasAlpha() { return m_bHasAlpha; }
|
||||
bool isPremultipliedAlpha() { return m_bPreMulti; }
|
||||
|
||||
bool hasAlpha() { return m_bHasAlpha; }
|
||||
bool isPremultipliedAlpha() { return m_bPreMulti; }
|
||||
|
||||
/**
|
||||
@brief Save CCImage data to the specified file, with specified format.
|
||||
|
@ -136,7 +166,7 @@ protected:
|
|||
bool _initWithTiffData(void *pData, int nDataLen);
|
||||
bool _initWithWebpData(void *pData, int nDataLen);
|
||||
// @warning kFmtRawData only support RGBA8888
|
||||
bool _initWithRawData(void *pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent);
|
||||
bool _initWithRawData(void *pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent, bool bPreMulti);
|
||||
|
||||
bool _saveImageToPNG(const char *pszFilePath, bool bIsToRGB = true);
|
||||
bool _saveImageToJPG(const char *pszFilePath);
|
||||
|
@ -145,6 +175,7 @@ protected:
|
|||
bool m_bHasAlpha;
|
||||
bool m_bPreMulti;
|
||||
|
||||
|
||||
private:
|
||||
// noncopyable
|
||||
CCImage(const CCImage& rImg);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "platform/CCImage.h"
|
||||
#include "textures/CCTexture2D.h"
|
||||
#ifdef __native_client__
|
||||
#if defined(__native_client__) || defined(EMSCRIPTEN)
|
||||
// TODO(sbc): I'm pretty sure all platforms should be including
|
||||
// webph headers in this way.
|
||||
#include "webp/decode.h"
|
||||
|
|
|
@ -36,6 +36,11 @@ THE SOFTWARE.
|
|||
#include <string>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_image.h>
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
// premultiply alpha, or the effect will wrong when want to use other pixel format in CCTexture2D,
|
||||
|
@ -93,6 +98,27 @@ CCImage::~CCImage()
|
|||
bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/)
|
||||
{
|
||||
bool bRet = false;
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
// Emscripten includes a re-implementation of SDL that uses HTML5 canvas
|
||||
// operations underneath. Consequently, loading images via IMG_Load (an SDL
|
||||
// API) will be a lot faster than running libpng et al as compiled with
|
||||
// Emscripten.
|
||||
SDL_Surface *iSurf = IMG_Load(strPath);
|
||||
|
||||
int size = 4 * (iSurf->w * iSurf->h);
|
||||
bRet = _initWithRawData((void*)iSurf->pixels, size, iSurf->w, iSurf->h, 8, true);
|
||||
|
||||
unsigned int *tmp = (unsigned int *)m_pData;
|
||||
int nrPixels = iSurf->w * iSurf->h;
|
||||
for(int i = 0; i < nrPixels; i++)
|
||||
{
|
||||
unsigned char *p = m_pData + i * 4;
|
||||
tmp[i] = CC_RGB_PREMULTIPLY_ALPHA( p[0], p[1], p[2], p[3] );
|
||||
}
|
||||
|
||||
SDL_FreeSurface(iSurf);
|
||||
#else
|
||||
unsigned long nSize = 0;
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(strPath);
|
||||
unsigned char* pBuffer = CCFileUtils::sharedFileUtils()->getFileData(fullPath.c_str(), "rb", &nSize);
|
||||
|
@ -101,6 +127,8 @@ bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = e
|
|||
bRet = initWithImageData(pBuffer, nSize, eImgFmt);
|
||||
}
|
||||
CC_SAFE_DELETE_ARRAY(pBuffer);
|
||||
#endif // EMSCRIPTEN
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
@ -151,7 +179,7 @@ bool CCImage::initWithImageData(void * pData,
|
|||
}
|
||||
else if (kFmtRawData == eFmt)
|
||||
{
|
||||
bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent);
|
||||
bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent, false);
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -288,7 +316,12 @@ bool CCImage::_initWithJpgData(void * data, int nSize)
|
|||
jpeg_mem_src( &cinfo, (unsigned char *) data, nSize );
|
||||
|
||||
/* reading the image header which contains image information */
|
||||
#if (JPEG_LIB_VERSION >= 90)
|
||||
// libjpeg 0.9 adds stricter types.
|
||||
jpeg_read_header( &cinfo, TRUE );
|
||||
#else
|
||||
jpeg_read_header( &cinfo, true );
|
||||
#endif
|
||||
|
||||
// we only support RGB or grayscale
|
||||
if (cinfo.jpeg_color_space != JCS_RGB)
|
||||
|
@ -647,7 +680,7 @@ bool CCImage::_initWithTiffData(void* pData, int nDataLen)
|
|||
return bRet;
|
||||
}
|
||||
|
||||
bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent)
|
||||
bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent, bool bPreMulti)
|
||||
{
|
||||
bool bRet = false;
|
||||
do
|
||||
|
@ -658,6 +691,7 @@ bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeig
|
|||
m_nHeight = (short)nHeight;
|
||||
m_nWidth = (short)nWidth;
|
||||
m_bHasAlpha = true;
|
||||
m_bPreMulti = bPreMulti;
|
||||
|
||||
// only RGBA8888 supported
|
||||
int nBytesPerComponent = 4;
|
||||
|
@ -668,6 +702,7 @@ bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeig
|
|||
|
||||
bRet = true;
|
||||
} while (0);
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ Config of cocos2d-x project, per target platform.
|
|||
#define CC_PLATFORM_BLACKBERRY 7
|
||||
#define CC_PLATFORM_MAC 8
|
||||
#define CC_PLATFORM_NACL 9
|
||||
#define CC_PLATFORM_EMSCRIPTEN 10
|
||||
#define CC_PLATFORM_TIZEN 11
|
||||
|
||||
// Determine target platform by compile environment macro.
|
||||
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
|
||||
|
@ -102,6 +104,17 @@ Config of cocos2d-x project, per target platform.
|
|||
#define CC_TARGET_PLATFORM CC_PLATFORM_NACL
|
||||
#endif
|
||||
|
||||
// Emscripten
|
||||
#if defined(EMSCRIPTEN)
|
||||
#undef CC_TARGET_PLATFORM
|
||||
#define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN
|
||||
#endif
|
||||
|
||||
// tizen
|
||||
#if defined(TIZEN)
|
||||
#undef CC_TARGET_PLATFORM
|
||||
#define CC_TARGET_PLATFORM CC_PLATFORM_TIZEN
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// post configure
|
||||
|
|
|
@ -76,17 +76,17 @@ CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \
|
|||
|
||||
/** @def CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
Enable it if you want to cache the texture data.
|
||||
Basically,it's only enabled in android
|
||||
Basically, it's only enabled for Emscripten.
|
||||
|
||||
It's new in cocos2d-x since v0.99.5
|
||||
*/
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
|
||||
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
|
||||
#else
|
||||
#define CC_ENABLE_CACHE_TEXTURE_DATA 0
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
|
||||
/* Application will crash in glDrawElements function on some win32 computers and some android devices.
|
||||
Indices should be bound again while drawing to avoid this bug.
|
||||
*/
|
||||
|
@ -233,6 +233,19 @@ public: virtual void set##funName(varType var) \
|
|||
#define LUALOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#endif // Lua engine debug
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \
|
||||
|| (defined(__clang__) && (__clang_major__ >= 3))
|
||||
#define CC_DISABLE_COPY(Class) \
|
||||
private: \
|
||||
Class(const Class &) = delete; \
|
||||
Class &operator =(const Class &) = delete;
|
||||
#else
|
||||
#define CC_DISABLE_COPY(Class) \
|
||||
private: \
|
||||
Class(const Class &); \
|
||||
Class &operator =(const Class &);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute__((deprecated))
|
||||
*/
|
||||
|
@ -244,6 +257,27 @@ public: virtual void set##funName(varType var) \
|
|||
#define CC_DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compiler support __attribute__((format))
|
||||
* formatPos - 1-based position of format string argument
|
||||
* argPos - 1-based position of first format-dependent argument
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos)))
|
||||
#elif defined(__has_attribute)
|
||||
#if __has_attribute(format)
|
||||
#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos)))
|
||||
#endif // __has_attribute(format)
|
||||
#else
|
||||
#define CC_FORMAT_PRINTF(formatPos, argPos)
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define CC_FORMAT_PRINTF_SIZE_T "%08lX"
|
||||
#else
|
||||
#define CC_FORMAT_PRINTF_SIZE_T "%08zX"
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define CC_UNUSED __attribute__ ((unused))
|
||||
#else
|
||||
|
|
|
@ -105,7 +105,7 @@ bool CCSAXParser::init(const char *pszEncoding)
|
|||
bool CCSAXParser::parse(const char* pXMLData, unsigned int uDataLength)
|
||||
{
|
||||
tinyxml2::XMLDocument tinyDoc;
|
||||
tinyDoc.Parse(pXMLData);
|
||||
tinyDoc.Parse(pXMLData, uDataLength);
|
||||
XmlSaxHander printer;
|
||||
printer.setCCSAXParserImp(this);
|
||||
|
||||
|
|
|
@ -62,6 +62,11 @@ bool CCFileUtilsAndroid::init()
|
|||
|
||||
bool CCFileUtilsAndroid::isFileExist(const std::string& strFilePath)
|
||||
{
|
||||
if (0 == strFilePath.length())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bFound = false;
|
||||
|
||||
// Check whether file exists in apk.
|
||||
|
|
|
@ -28,18 +28,22 @@ THE SOFTWARE.
|
|||
#include "platform/CCImageCommon_cpp.h"
|
||||
#include "platform/CCPlatformMacros.h"
|
||||
#include "platform/CCImage.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "jni/JniHelper.h"
|
||||
|
||||
#include <android/log.h>
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
|
||||
// prototype
|
||||
void swapAlphaChannel(unsigned int *pImageMemory, unsigned int numPixels);
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class BitmapDC
|
||||
{
|
||||
public:
|
||||
|
||||
BitmapDC()
|
||||
: m_pData(NULL)
|
||||
, m_nWidth(0)
|
||||
|
@ -55,37 +59,74 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool getBitmapFromJavaShadowStroke( const char *text,
|
||||
int nWidth,
|
||||
int nHeight,
|
||||
CCImage::ETextAlign eAlignMask,
|
||||
const char * pFontName,
|
||||
float fontSize,
|
||||
float textTintR = 1.0,
|
||||
float textTintG = 1.0,
|
||||
float textTintB = 1.0,
|
||||
bool shadow = false,
|
||||
float shadowDeltaX = 0.0,
|
||||
float shadowDeltaY = 0.0,
|
||||
float shadowBlur = 0.0,
|
||||
float shadowIntensity = 0.0,
|
||||
bool stroke = false,
|
||||
float strokeColorR = 0.0,
|
||||
float strokeColorG = 0.0,
|
||||
float strokeColorB = 0.0,
|
||||
float strokeSize = 0.0 )
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxBitmap", "createTextBitmapShadowStroke",
|
||||
"(Ljava/lang/String;Ljava/lang/String;IFFFIIIZFFFZFFFF)V"))
|
||||
{
|
||||
CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Do a full lookup for the font path using CCFileUtils in case the given font name is a relative path to a font file asset,
|
||||
// or the path has been mapped to a different location in the app package:
|
||||
std::string fullPathOrFontName = CCFileUtils::sharedFileUtils()->fullPathForFilename(pFontName);
|
||||
|
||||
// If the path name returned includes the 'assets' dir then that needs to be removed, because the android.content.Context
|
||||
// requires this portion of the path to be omitted for assets inside the app package.
|
||||
if (fullPathOrFontName.find("assets/") == 0)
|
||||
{
|
||||
fullPathOrFontName = fullPathOrFontName.substr(strlen("assets/")); // Chop out the 'assets/' portion of the path.
|
||||
}
|
||||
|
||||
/**create bitmap
|
||||
* this method call Cococs2dx.createBitmap()(java code) to create the bitmap, the java code
|
||||
* will call Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC() to init the width, height
|
||||
* and data.
|
||||
* use this approach to decrease the jni call number
|
||||
*/
|
||||
jstring jstrText = methodInfo.env->NewStringUTF(text);
|
||||
jstring jstrFont = methodInfo.env->NewStringUTF(fullPathOrFontName.c_str());
|
||||
|
||||
methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, jstrText,
|
||||
jstrFont, (int)fontSize, textTintR, textTintG, textTintB, eAlignMask, nWidth, nHeight, shadow, shadowDeltaX, -shadowDeltaY, shadowBlur, stroke, strokeColorR, strokeColorG, strokeColorB, strokeSize);
|
||||
|
||||
methodInfo.env->DeleteLocalRef(jstrText);
|
||||
methodInfo.env->DeleteLocalRef(jstrFont);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool getBitmapFromJava(const char *text, int nWidth, int nHeight, CCImage::ETextAlign eAlignMask, const char * pFontName, float fontSize)
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxBitmap", "createTextBitmap",
|
||||
"(Ljava/lang/String;Ljava/lang/String;IIII)V"))
|
||||
{
|
||||
CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**create bitmap
|
||||
* this method call Cococs2dx.createBitmap()(java code) to create the bitmap, the java code
|
||||
* will call Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC() to init the width, height
|
||||
* and data.
|
||||
* use this approach to decrease the jni call number
|
||||
*/
|
||||
jstring jstrText = methodInfo.env->NewStringUTF(text);
|
||||
jstring jstrFont = methodInfo.env->NewStringUTF(pFontName);
|
||||
|
||||
methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, jstrText,
|
||||
jstrFont, (int)fontSize, eAlignMask, nWidth, nHeight);
|
||||
|
||||
methodInfo.env->DeleteLocalRef(jstrText);
|
||||
methodInfo.env->DeleteLocalRef(jstrFont);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
|
||||
return true;
|
||||
return getBitmapFromJavaShadowStroke( text, nWidth, nHeight, eAlignMask, pFontName, fontSize );
|
||||
}
|
||||
|
||||
// ARGB -> RGBA
|
||||
unsigned int swapAlpha(unsigned int value)
|
||||
inline unsigned int swapAlpha(unsigned int value)
|
||||
{
|
||||
return ((value << 8 & 0xffffff00) | (value >> 24 & 0x000000ff));
|
||||
}
|
||||
|
@ -137,31 +178,102 @@ bool CCImage::initWithString(
|
|||
return bRet;
|
||||
}
|
||||
|
||||
bool CCImage::initWithStringShadowStroke(
|
||||
const char * pText,
|
||||
int nWidth ,
|
||||
int nHeight ,
|
||||
ETextAlign eAlignMask ,
|
||||
const char * pFontName ,
|
||||
int nSize ,
|
||||
float textTintR,
|
||||
float textTintG,
|
||||
float textTintB,
|
||||
bool shadow,
|
||||
float shadowOffsetX,
|
||||
float shadowOffsetY,
|
||||
float shadowOpacity,
|
||||
float shadowBlur,
|
||||
bool stroke,
|
||||
float strokeR,
|
||||
float strokeG,
|
||||
float strokeB,
|
||||
float strokeSize)
|
||||
{
|
||||
bool bRet = false;
|
||||
do
|
||||
{
|
||||
CC_BREAK_IF(! pText);
|
||||
|
||||
BitmapDC &dc = sharedBitmapDC();
|
||||
|
||||
|
||||
CC_BREAK_IF(! dc.getBitmapFromJavaShadowStroke(pText, nWidth, nHeight, eAlignMask, pFontName,
|
||||
nSize, textTintR, textTintG, textTintB, shadow,
|
||||
shadowOffsetX, shadowOffsetY, shadowBlur, shadowOpacity,
|
||||
stroke, strokeR, strokeG, strokeB, strokeSize ));
|
||||
|
||||
|
||||
// assign the dc.m_pData to m_pData in order to save time
|
||||
m_pData = dc.m_pData;
|
||||
|
||||
CC_BREAK_IF(! m_pData);
|
||||
|
||||
m_nWidth = (short)dc.m_nWidth;
|
||||
m_nHeight = (short)dc.m_nHeight;
|
||||
m_bHasAlpha = true;
|
||||
m_bPreMulti = true;
|
||||
m_nBitsPerComponent = 8;
|
||||
|
||||
// swap the alpha channel (ARGB to RGBA)
|
||||
swapAlphaChannel((unsigned int *)m_pData, (m_nWidth * m_nHeight) );
|
||||
|
||||
// ok
|
||||
bRet = true;
|
||||
|
||||
} while (0);
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
// swap the alpha channel in an 32 bit image (from ARGB to RGBA)
|
||||
void swapAlphaChannel(unsigned int *pImageMemory, unsigned int numPixels)
|
||||
{
|
||||
for(int c = 0; c < numPixels; ++c, ++pImageMemory)
|
||||
{
|
||||
// copy the current pixel
|
||||
unsigned int currenPixel = (*pImageMemory);
|
||||
// swap channels and store back
|
||||
char *pSource = (char *) ¤Pixel;
|
||||
*pImageMemory = (pSource[0] << 24) | (pSource[3]<<16) | (pSource[2]<<8) | pSource[1];
|
||||
}
|
||||
}
|
||||
|
||||
// this method is called by Cocos2dxBitmap
|
||||
extern "C"
|
||||
{
|
||||
/**
|
||||
* this method is called by java code to init width, height and pixels data
|
||||
*/
|
||||
void Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC(JNIEnv* env, jobject thiz, int width, int height, jbyteArray pixels)
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC(JNIEnv* env, jobject thiz, int width, int height, jbyteArray pixels)
|
||||
{
|
||||
int size = width * height * 4;
|
||||
cocos2d::sharedBitmapDC().m_nWidth = width;
|
||||
cocos2d::sharedBitmapDC().m_nHeight = height;
|
||||
cocos2d::sharedBitmapDC().m_pData = new unsigned char[size];
|
||||
env->GetByteArrayRegion(pixels, 0, size, (jbyte*)cocos2d::sharedBitmapDC().m_pData);
|
||||
cocos2d::BitmapDC& bitmapDC = cocos2d::sharedBitmapDC();
|
||||
bitmapDC.m_nWidth = width;
|
||||
bitmapDC.m_nHeight = height;
|
||||
bitmapDC.m_pData = new unsigned char[size];
|
||||
env->GetByteArrayRegion(pixels, 0, size, (jbyte*)bitmapDC.m_pData);
|
||||
|
||||
// swap data
|
||||
unsigned int *tempPtr = (unsigned int*)cocos2d::sharedBitmapDC().m_pData;
|
||||
unsigned int *tempPtr = (unsigned int*)bitmapDC.m_pData;
|
||||
unsigned int tempdata = 0;
|
||||
for (int i = 0; i < height; ++i)
|
||||
{
|
||||
for (int j = 0; j < width; ++j)
|
||||
{
|
||||
tempdata = *tempPtr;
|
||||
*tempPtr++ = cocos2d::sharedBitmapDC().swapAlpha(tempdata);
|
||||
*tempPtr++ = bitmapDC.swapAlpha(tempdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
android.library=true
|
||||
# Project target.
|
||||
target=android-8
|
||||
target=android-17
|
||||
|
|
|
@ -27,9 +27,11 @@ import org.cocos2dx.lib.Cocos2dxHelper.Cocos2dxHelperListener;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.view.ViewGroup;
|
||||
import android.util.Log;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelperListener {
|
||||
|
@ -139,6 +141,10 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
// ...add to FrameLayout
|
||||
framelayout.addView(this.mGLSurfaceView);
|
||||
|
||||
// Switch to supported OpenGL (ARGB888) mode on emulator
|
||||
if (isAndroidEmulator())
|
||||
this.mGLSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0);
|
||||
|
||||
this.mGLSurfaceView.setCocos2dxRenderer(new Cocos2dxRenderer());
|
||||
this.mGLSurfaceView.setCocos2dxEditText(edittext);
|
||||
|
||||
|
@ -150,6 +156,19 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
return new Cocos2dxGLSurfaceView(this);
|
||||
}
|
||||
|
||||
private final static boolean isAndroidEmulator() {
|
||||
String model = Build.MODEL;
|
||||
Log.d(TAG, "model=" + model);
|
||||
String product = Build.PRODUCT;
|
||||
Log.d(TAG, "product=" + product);
|
||||
boolean isEmulator = false;
|
||||
if (product != null) {
|
||||
isEmulator = product.equals("sdk") || product.contains("_sdk") || product.contains("sdk_");
|
||||
}
|
||||
Log.d(TAG, "isEmulator=" + isEmulator);
|
||||
return isEmulator;
|
||||
}
|
||||
|
||||
// ===========================================================
|
||||
// Inner and Anonymous Classes
|
||||
// ===========================================================
|
||||
|
|
|
@ -80,7 +80,8 @@ public class Cocos2dxBitmap {
|
|||
// Methods
|
||||
// ===========================================================
|
||||
|
||||
private static native void nativeInitBitmapDC(final int pWidth, final int pHeight, final byte[] pPixels);
|
||||
private static native void nativeInitBitmapDC(final int pWidth,
|
||||
final int pHeight, final byte[] pPixels);
|
||||
|
||||
/**
|
||||
* @param pWidth
|
||||
|
@ -88,47 +89,124 @@ public class Cocos2dxBitmap {
|
|||
* @param pHeight
|
||||
* the height to draw, it can be 0
|
||||
*/
|
||||
public static void createTextBitmap(String pString, final String pFontName, final int pFontSize, final int pAlignment, final int pWidth, final int pHeight) {
|
||||
public static void createTextBitmap(String pString, final String pFontName,
|
||||
final int pFontSize, final int pAlignment, final int pWidth,
|
||||
final int pHeight) {
|
||||
|
||||
//
|
||||
createTextBitmapShadowStroke( pString, pFontName, pFontSize, 1.0f, 1.0f, 1.0f, // text font and color
|
||||
pAlignment, pWidth, pHeight, // alignment and size
|
||||
false, 0.0f, 0.0f, 0.0f, // no shadow
|
||||
false, 1.0f, 1.0f, 1.0f, 1.0f); // no stroke
|
||||
|
||||
}
|
||||
|
||||
public static void createTextBitmapShadowStroke(String pString, final String pFontName, final int pFontSize,
|
||||
final float fontTintR, final float fontTintG, final float fontTintB,
|
||||
final int pAlignment, final int pWidth, final int pHeight, final boolean shadow,
|
||||
final float shadowDX, final float shadowDY, final float shadowBlur, final boolean stroke,
|
||||
final float strokeR, final float strokeG, final float strokeB, final float strokeSize) {
|
||||
|
||||
|
||||
final int horizontalAlignment = pAlignment & 0x0F;
|
||||
final int verticalAlignment = (pAlignment >> 4) & 0x0F;
|
||||
final int verticalAlignment = (pAlignment >> 4) & 0x0F;
|
||||
|
||||
pString = Cocos2dxBitmap.refactorString(pString);
|
||||
final Paint paint = Cocos2dxBitmap.newPaint(pFontName, pFontSize, horizontalAlignment);
|
||||
|
||||
// set the paint color
|
||||
paint.setARGB(255, (int)(255.0 * fontTintR), (int)(255.0 * fontTintG), (int)(255.0 * fontTintB));
|
||||
|
||||
final TextProperty textProperty = Cocos2dxBitmap.computeTextProperty(pString, pWidth, pHeight, paint);
|
||||
final int bitmapTotalHeight = (pHeight == 0 ? textProperty.mTotalHeight: pHeight);
|
||||
|
||||
// padding needed when using shadows (not used otherwise)
|
||||
float bitmapPaddingX = 0.0f;
|
||||
float bitmapPaddingY = 0.0f;
|
||||
float renderTextDeltaX = 0.0f;
|
||||
float renderTextDeltaY = 0.0f;
|
||||
|
||||
if ( shadow ) {
|
||||
|
||||
final int bitmapTotalHeight = (pHeight == 0 ? textProperty.mTotalHeight : pHeight);
|
||||
|
||||
final Bitmap bitmap = Bitmap.createBitmap(textProperty.mMaxWidth, bitmapTotalHeight, Bitmap.Config.ARGB_8888);
|
||||
int shadowColor = 0xff7d7d7d;
|
||||
paint.setShadowLayer(shadowBlur, shadowDX, shadowDY, shadowColor);
|
||||
|
||||
bitmapPaddingX = Math.abs(shadowDX);
|
||||
bitmapPaddingY = Math.abs(shadowDY);
|
||||
|
||||
if ( shadowDX < 0.0 )
|
||||
{
|
||||
renderTextDeltaX = bitmapPaddingX;
|
||||
}
|
||||
|
||||
if ( shadowDY < 0.0 )
|
||||
{
|
||||
renderTextDeltaY = bitmapPaddingY;
|
||||
}
|
||||
}
|
||||
|
||||
final Bitmap bitmap = Bitmap.createBitmap(textProperty.mMaxWidth + (int)bitmapPaddingX,
|
||||
bitmapTotalHeight + (int)bitmapPaddingY, Bitmap.Config.ARGB_8888);
|
||||
|
||||
final Canvas canvas = new Canvas(bitmap);
|
||||
|
||||
/* Draw string. */
|
||||
final FontMetricsInt fontMetricsInt = paint.getFontMetricsInt();
|
||||
|
||||
int x = 0;
|
||||
int y = Cocos2dxBitmap.computeY(fontMetricsInt, pHeight, textProperty.mTotalHeight, verticalAlignment);
|
||||
|
||||
final String[] lines = textProperty.mLines;
|
||||
|
||||
for (final String line : lines) {
|
||||
|
||||
x = Cocos2dxBitmap.computeX(line, textProperty.mMaxWidth, horizontalAlignment);
|
||||
canvas.drawText(line, x, y, paint);
|
||||
canvas.drawText(line, x + renderTextDeltaX, y + renderTextDeltaY, paint);
|
||||
y += textProperty.mHeightPerLine;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// draw again with stroke on if needed
|
||||
if ( stroke ) {
|
||||
|
||||
final Paint paintStroke = Cocos2dxBitmap.newPaint(pFontName, pFontSize, horizontalAlignment);
|
||||
paintStroke.setStyle(Paint.Style.STROKE);
|
||||
paintStroke.setStrokeWidth(strokeSize * 0.5f);
|
||||
paintStroke.setARGB(255, (int)strokeR * 255, (int)strokeG * 255, (int)strokeB * 255);
|
||||
|
||||
x = 0;
|
||||
y = Cocos2dxBitmap.computeY(fontMetricsInt, pHeight, textProperty.mTotalHeight, verticalAlignment);
|
||||
final String[] lines2 = textProperty.mLines;
|
||||
|
||||
for (final String line : lines2) {
|
||||
|
||||
x = Cocos2dxBitmap.computeX(line, textProperty.mMaxWidth, horizontalAlignment);
|
||||
canvas.drawText(line, x + renderTextDeltaX, y + renderTextDeltaY, paintStroke);
|
||||
y += textProperty.mHeightPerLine;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Cocos2dxBitmap.initNativeObject(bitmap);
|
||||
}
|
||||
|
||||
private static Paint newPaint(final String pFontName, final int pFontSize, final int pHorizontalAlignment) {
|
||||
private static Paint newPaint(final String pFontName, final int pFontSize,
|
||||
final int pHorizontalAlignment) {
|
||||
final Paint paint = new Paint();
|
||||
paint.setColor(Color.WHITE);
|
||||
paint.setTextSize(pFontSize);
|
||||
paint.setTextSize(pFontSize);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
/* Set type face for paint, now it support .ttf file. */
|
||||
if (pFontName.endsWith(".ttf")) {
|
||||
try {
|
||||
final Typeface typeFace = Cocos2dxTypefaces.get(Cocos2dxBitmap.sContext, pFontName);
|
||||
final Typeface typeFace = Cocos2dxTypefaces.get(
|
||||
Cocos2dxBitmap.sContext, pFontName);
|
||||
paint.setTypeface(typeFace);
|
||||
} catch (final Exception e) {
|
||||
Log.e("Cocos2dxBitmap", "error to create ttf type face: " + pFontName);
|
||||
Log.e("Cocos2dxBitmap", "error to create ttf type face: "
|
||||
+ pFontName);
|
||||
|
||||
/* The file may not find, use system font. */
|
||||
paint.setTypeface(Typeface.create(pFontName, Typeface.NORMAL));
|
||||
|
@ -138,27 +216,29 @@ public class Cocos2dxBitmap {
|
|||
}
|
||||
|
||||
switch (pHorizontalAlignment) {
|
||||
case HORIZONTALALIGN_CENTER:
|
||||
paint.setTextAlign(Align.CENTER);
|
||||
break;
|
||||
case HORIZONTALALIGN_RIGHT:
|
||||
paint.setTextAlign(Align.RIGHT);
|
||||
break;
|
||||
case HORIZONTALALIGN_LEFT:
|
||||
default:
|
||||
paint.setTextAlign(Align.LEFT);
|
||||
break;
|
||||
case HORIZONTALALIGN_CENTER:
|
||||
paint.setTextAlign(Align.CENTER);
|
||||
break;
|
||||
case HORIZONTALALIGN_RIGHT:
|
||||
paint.setTextAlign(Align.RIGHT);
|
||||
break;
|
||||
case HORIZONTALALIGN_LEFT:
|
||||
default:
|
||||
paint.setTextAlign(Align.LEFT);
|
||||
break;
|
||||
}
|
||||
|
||||
return paint;
|
||||
}
|
||||
|
||||
private static TextProperty computeTextProperty(final String pString, final int pWidth, final int pHeight, final Paint pPaint) {
|
||||
|
||||
private static TextProperty computeTextProperty(final String pString,
|
||||
final int pWidth, final int pHeight, final Paint pPaint) {
|
||||
final FontMetricsInt fm = pPaint.getFontMetricsInt();
|
||||
final int h = (int) Math.ceil(fm.bottom - fm.top);
|
||||
int maxContentWidth = 0;
|
||||
|
||||
final String[] lines = Cocos2dxBitmap.splitString(pString, pWidth, pHeight, pPaint);
|
||||
final String[] lines = Cocos2dxBitmap.splitString(pString, pWidth,
|
||||
pHeight, pPaint);
|
||||
|
||||
if (pWidth != 0) {
|
||||
maxContentWidth = pWidth;
|
||||
|
@ -166,7 +246,8 @@ public class Cocos2dxBitmap {
|
|||
/* Compute the max width. */
|
||||
int temp = 0;
|
||||
for (final String line : lines) {
|
||||
temp = (int) FloatMath.ceil(pPaint.measureText(line, 0, line.length()));
|
||||
temp = (int) FloatMath.ceil(pPaint.measureText(line, 0,
|
||||
line.length()));
|
||||
if (temp > maxContentWidth) {
|
||||
maxContentWidth = temp;
|
||||
}
|
||||
|
@ -176,40 +257,44 @@ public class Cocos2dxBitmap {
|
|||
return new TextProperty(maxContentWidth, h, lines);
|
||||
}
|
||||
|
||||
private static int computeX(final String pText, final int pMaxWidth, final int pHorizontalAlignment) {
|
||||
private static int computeX(final String pText, final int pMaxWidth,
|
||||
final int pHorizontalAlignment) {
|
||||
int ret = 0;
|
||||
|
||||
switch (pHorizontalAlignment) {
|
||||
case HORIZONTALALIGN_CENTER:
|
||||
ret = pMaxWidth / 2;
|
||||
break;
|
||||
case HORIZONTALALIGN_RIGHT:
|
||||
ret = pMaxWidth;
|
||||
break;
|
||||
case HORIZONTALALIGN_LEFT:
|
||||
default:
|
||||
break;
|
||||
case HORIZONTALALIGN_CENTER:
|
||||
ret = pMaxWidth / 2;
|
||||
break;
|
||||
case HORIZONTALALIGN_RIGHT:
|
||||
ret = pMaxWidth;
|
||||
break;
|
||||
case HORIZONTALALIGN_LEFT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static int computeY(final FontMetricsInt pFontMetricsInt, final int pConstrainHeight, final int pTotalHeight, final int pVerticalAlignment) {
|
||||
private static int computeY(final FontMetricsInt pFontMetricsInt,
|
||||
final int pConstrainHeight, final int pTotalHeight,
|
||||
final int pVerticalAlignment) {
|
||||
int y = -pFontMetricsInt.top;
|
||||
|
||||
if (pConstrainHeight > pTotalHeight) {
|
||||
switch (pVerticalAlignment) {
|
||||
case VERTICALALIGN_TOP:
|
||||
y = -pFontMetricsInt.top;
|
||||
break;
|
||||
case VERTICALALIGN_CENTER:
|
||||
y = -pFontMetricsInt.top + (pConstrainHeight - pTotalHeight) / 2;
|
||||
break;
|
||||
case VERTICALALIGN_BOTTOM:
|
||||
y = -pFontMetricsInt.top + (pConstrainHeight - pTotalHeight);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case VERTICALALIGN_TOP:
|
||||
y = -pFontMetricsInt.top;
|
||||
break;
|
||||
case VERTICALALIGN_CENTER:
|
||||
y = -pFontMetricsInt.top + (pConstrainHeight - pTotalHeight)
|
||||
/ 2;
|
||||
break;
|
||||
case VERTICALALIGN_BOTTOM:
|
||||
y = -pFontMetricsInt.top + (pConstrainHeight - pTotalHeight);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,9 +302,11 @@ public class Cocos2dxBitmap {
|
|||
}
|
||||
|
||||
/*
|
||||
* If maxWidth or maxHeight is not 0, split the string to fix the maxWidth and maxHeight.
|
||||
* If maxWidth or maxHeight is not 0, split the string to fix the maxWidth
|
||||
* and maxHeight.
|
||||
*/
|
||||
private static String[] splitString(final String pString, final int pMaxWidth, final int pMaxHeight, final Paint pPaint) {
|
||||
private static String[] splitString(final String pString,
|
||||
final int pMaxWidth, final int pMaxHeight, final Paint pPaint) {
|
||||
final String[] lines = pString.split("\\n");
|
||||
String[] ret = null;
|
||||
final FontMetricsInt fm = pPaint.getFontMetricsInt();
|
||||
|
@ -229,10 +316,15 @@ public class Cocos2dxBitmap {
|
|||
if (pMaxWidth != 0) {
|
||||
final LinkedList<String> strList = new LinkedList<String>();
|
||||
for (final String line : lines) {
|
||||
/* The width of line is exceed maxWidth, should divide it into two or more lines. */
|
||||
final int lineWidth = (int) FloatMath.ceil(pPaint.measureText(line));
|
||||
/*
|
||||
* The width of line is exceed maxWidth, should divide it into
|
||||
* two or more lines.
|
||||
*/
|
||||
final int lineWidth = (int) FloatMath.ceil(pPaint
|
||||
.measureText(line));
|
||||
if (lineWidth > pMaxWidth) {
|
||||
strList.addAll(Cocos2dxBitmap.divideStringWithMaxWidth(line, pMaxWidth, pPaint));
|
||||
strList.addAll(Cocos2dxBitmap.divideStringWithMaxWidth(
|
||||
line, pMaxWidth, pPaint));
|
||||
} else {
|
||||
strList.add(line);
|
||||
}
|
||||
|
@ -267,7 +359,8 @@ public class Cocos2dxBitmap {
|
|||
return ret;
|
||||
}
|
||||
|
||||
private static LinkedList<String> divideStringWithMaxWidth(final String pString, final int pMaxWidth, final Paint pPaint) {
|
||||
private static LinkedList<String> divideStringWithMaxWidth(
|
||||
final String pString, final int pMaxWidth, final Paint pPaint) {
|
||||
final int charLength = pString.length();
|
||||
int start = 0;
|
||||
int tempWidth = 0;
|
||||
|
@ -275,14 +368,16 @@ public class Cocos2dxBitmap {
|
|||
|
||||
/* Break a String into String[] by the width & should wrap the word. */
|
||||
for (int i = 1; i <= charLength; ++i) {
|
||||
tempWidth = (int) FloatMath.ceil(pPaint.measureText(pString, start, i));
|
||||
tempWidth = (int) FloatMath.ceil(pPaint.measureText(pString, start,
|
||||
i));
|
||||
if (tempWidth >= pMaxWidth) {
|
||||
final int lastIndexOfSpace = pString.substring(0, i).lastIndexOf(" ");
|
||||
final int lastIndexOfSpace = pString.substring(0, i)
|
||||
.lastIndexOf(" ");
|
||||
|
||||
if (lastIndexOfSpace != -1 && lastIndexOfSpace > start) {
|
||||
/* Should wrap the word. */
|
||||
strList.add(pString.substring(start, lastIndexOfSpace));
|
||||
i = lastIndexOfSpace;
|
||||
i = lastIndexOfSpace + 1; // skip space
|
||||
} else {
|
||||
/* Should not exceed the width. */
|
||||
if (tempWidth > pMaxWidth) {
|
||||
|
@ -295,7 +390,7 @@ public class Cocos2dxBitmap {
|
|||
}
|
||||
|
||||
/* Remove spaces at the beginning of a new line. */
|
||||
while (pString.indexOf(i) == ' ') {
|
||||
while (pString.charAt(i) == ' ') {
|
||||
++i;
|
||||
}
|
||||
|
||||
|
@ -318,7 +413,8 @@ public class Cocos2dxBitmap {
|
|||
}
|
||||
|
||||
/*
|
||||
* If the font of "\n" is "" or "\n", insert " " in front of it. For example: "\nabc" -> " \nabc" "\nabc\n\n" -> " \nabc\n \n".
|
||||
* If the font of "\n" is "" or "\n", insert " " in front of it. For
|
||||
* example: "\nabc" -> " \nabc" "\nabc\n\n" -> " \nabc\n \n".
|
||||
*/
|
||||
final StringBuilder strBuilder = new StringBuilder(pString);
|
||||
int start = 0;
|
||||
|
@ -347,12 +443,14 @@ public class Cocos2dxBitmap {
|
|||
return;
|
||||
}
|
||||
|
||||
Cocos2dxBitmap.nativeInitBitmapDC(pBitmap.getWidth(), pBitmap.getHeight(), pixels);
|
||||
Cocos2dxBitmap.nativeInitBitmapDC(pBitmap.getWidth(),
|
||||
pBitmap.getHeight(), pixels);
|
||||
}
|
||||
|
||||
private static byte[] getPixels(final Bitmap pBitmap) {
|
||||
if (pBitmap != null) {
|
||||
final byte[] pixels = new byte[pBitmap.getWidth() * pBitmap.getHeight() * 4];
|
||||
final byte[] pixels = new byte[pBitmap.getWidth()
|
||||
* pBitmap.getHeight() * 4];
|
||||
final ByteBuffer buf = ByteBuffer.wrap(pixels);
|
||||
buf.order(ByteOrder.nativeOrder());
|
||||
pBitmap.copyPixelsToBuffer(buf);
|
||||
|
@ -386,7 +484,8 @@ public class Cocos2dxBitmap {
|
|||
return incr_text_size;
|
||||
}
|
||||
|
||||
private static String getStringWithEllipsis(String pString, float width, float fontSize) {
|
||||
private static String getStringWithEllipsis(String pString, float width,
|
||||
float fontSize) {
|
||||
if (TextUtils.isEmpty(pString)) {
|
||||
return "";
|
||||
}
|
||||
|
@ -395,7 +494,8 @@ public class Cocos2dxBitmap {
|
|||
paint.setTypeface(Typeface.DEFAULT);
|
||||
paint.setTextSize(fontSize);
|
||||
|
||||
return TextUtils.ellipsize(pString, paint, width, TextUtils.TruncateAt.END).toString();
|
||||
return TextUtils.ellipsize(pString, paint, width,
|
||||
TextUtils.TruncateAt.END).toString();
|
||||
}
|
||||
|
||||
// ===========================================================
|
||||
|
@ -410,7 +510,8 @@ public class Cocos2dxBitmap {
|
|||
private final int mHeightPerLine;
|
||||
private final String[] mLines;
|
||||
|
||||
TextProperty(final int pMaxWidth, final int pHeightPerLine, final String[] pLines) {
|
||||
TextProperty(final int pMaxWidth, final int pHeightPerLine,
|
||||
final String[] pLines) {
|
||||
this.mMaxWidth = pMaxWidth;
|
||||
this.mHeightPerLine = pHeightPerLine;
|
||||
this.mTotalHeight = pHeightPerLine * pLines.length;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue