Commit Graph

322 Commits

Author SHA1 Message Date
moadib e39829269d Added <uses-feature android:glEsVersion="0x00020000" /> to AndroidManifest.xml 2013-01-21 13:03:55 +04:00
James Chen 30b2a8a882 issue #1867: Updated CCFileUtils.cpp for android. 2013-01-18 22:18:55 +08:00
James Chen bc76cf09c4 Added filename lookup support for win32. 2013-01-18 21:54:48 +08:00
James Chen 0a42829428 issue #1667: Adding file name lookup support for iOS and Android, TBD: Other platform supports. 2013-01-18 18:05:32 +08:00
folecr e3cf517f32 Assert implementation for Android
* __android_log_assert is not stable
    * Uses __android_log_print instead
2013-01-09 18:51:49 -08:00
folecr c0ecad31fe Consistent use of CCAssert
* Remove @
 * Use CCAssert instead of CC_ASSERT (number of parameters differ between the two)
2013-01-08 14:11:34 -08:00
James Chen b662d5c569 fixed #1620: Added license. Removed LocalStorage.h from cocos-ext.h. 2013-01-07 18:06:53 +08:00
James Chen 3fa771f0c4 fixed #1620: Using sqlite3 to implement sys.LocalStorage for iOS and android. 2013-01-07 17:22:06 +08:00
James Chen 760a8c1d39 fix a compilation error for android. 2013-01-03 19:56:34 +08:00
minggo df73cd12a6 fixed #1623:use file descriptor instead of file path to create media player 2012-12-24 17:20:44 +08:00
Denis Mingulov ca00d50259 CocosDenshion Android - missing sound effects with some conditions
Android SoundPool.load returns 0 if sound might not be loaded - for
example, it does not exist. Previously - 0 has been ignored and
incorrectly written to HashMap, so it was not possible to
understand on the application side that something goes wrong
(and use some additional workaround).

Use case:
1) On the game loading - preload all possible sound effects
   (to speed up their playing later, when it will be needed)
2) Game APK does not have any sound file, they are downloaded
   later in a separate thread.
3) Application tries to play sound effects as usual, when needed.

So due to this bug - as there was no any sound file exist
during the game loading - internal HashMap contains incorrect
0 as id for every effect, and there is no any sound effect during
the first application start.
2012-12-21 23:15:29 +02:00
minggo e15c0a33ae fixed #1610:skip only white character 2012-12-10 17:18:20 +08:00
minggo 0f58987ad1 Merge pull request #1740 from rtissera/gles20
[android] Cocos2dxHelper/CCFileUtils JNI fixes and improvements
2012-12-10 00:33:11 -08:00
minggo 71f61596e9 fixed #1580:request focus after keyboard closed 2012-12-10 14:08:01 +08:00
Romain TISSERAND bc0309f1a3 [android] Removed hardcoded /data/data path in CCFileUtils, make use of Context.getCacheDir() through JNI callback instead. Needed in order to get CCUserDefault working fine on Nexus 10 (Androi 4.2 multi-user environment) 2012-12-09 19:40:41 +01:00
Romain TISSERAND 4cb7506932 Added proper JNIEXPORT / JNICALL modifiers to Cocos2dxHelper JNI functions called from Java side 2012-12-09 13:44:41 +01:00
fape 320d532e15 add Hungarian language support 2012-12-05 11:31:05 +01:00
minggo a256d35a5b fix some confilcs 2012-12-05 14:01:05 +08:00
minggo 54309c56b2 change accelerometer accurate to SENSOR_DELAY_GAME 2012-11-30 14:07:01 +08:00
minggo 75fb997513 Merge pull request #1670 from rohankuruvilla/gles20
Fixing Accelerometer crash on Android
2012-11-29 22:01:16 -08:00
minggo 61b2e2b880 comment codes for FPS controlling 2012-11-30 13:55:25 +08:00
Rohan Kuruvilla a4b55b5217 Fixing Accelerometer crash on Android 2012-11-28 15:56:57 -08:00
Taro Kobayashi a37e034e61 added support for Japanese language 2012-11-28 17:53:10 +09:00
minggo 226b10a9e2 modify lua project setting 2012-11-23 10:41:41 +08:00
minggo a4a53df159 issue #1555:build ok on android 2012-11-16 14:23:14 +08:00
Denis Mingulov 83cf8aaf29 Android: Access to files from APK is boosted - 1st review update 2012-11-09 09:53:40 +02:00
Denis Mingulov 071d264cc5 Android: Access to files from APK is boosted
Open APK file just once and cache a file list information (name and
position inside archive). Also a general ZipFile helper class is
created to read multiple files from Zip archives - might be used
for another platforms if needed.

Previously it was so for each separate file access operation:
- Open zip archive, initially parse its structure (unzOpen)
- Locate the particular file there by a linear search through
  full archive (unzLocateFile).
  So if file does not exist - still an archive has to be handled
  fully, even slower than a file exists.
- Read file.
- Close zip archive

After this commit:
- Once - open zip/apk file and collect file list information
  (average consumed time - the same like a search for 2 different
  files by unzLocateFile)
- When needed - directly retrieve file position inside the archive,
  setting it up to the zip reader and reading file

ZipFile class is located in support/zip_support/ZipUtils.h and .cpp
to prevent creation of a new files and adding them to multiple
project files.
2012-11-08 13:46:53 +02:00
Rohan Kuruvilla d6753f8a2f Adding accelerometer setInterval support to Android 2012-10-29 15:08:16 +08:00
wenbin1989 62351462a8 Add kLanguageKorean to ccLanguageType and CCApplication::getCurrentLanguage() 2012-10-18 17:17:11 +08:00
wenbin1989 29a63a3b0f Fix stack overflow in CCLog 2012-10-18 14:39:56 +08:00
minggo 0a39fa8bef fixed #1507: use SoundPool.OnLoadCompleteListener to play effect if it is not preloaded 2012-10-12 17:43:43 +08:00
Ed Bartley 04527f7378 Added some flexibility to the Cocos2dxActivity. View creation can be overridden by developers that use a custom Layout and custom views. 2012-10-06 23:39:47 -04:00
Ed Bartley a9177fed6f Fix Typo.
Make mGLSurfaceView public so that subclasses can may initialize mGLSurfaceView from a custom xml layout.
2012-10-05 10:24:17 -04:00
James Chen 4a3127f41f Updated android template. Added 'cocos2dx/platform/android/java/res/.gitignore' since res folder is needed for eclipse. 2012-09-25 21:52:30 +08:00
minggo 364d7a487a Update cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java
Comment some debug codes, because it will cause auto-building fail.
2012-09-25 14:42:45 +08:00
minggo 74b9e2539b fix auto building error 2012-09-25 12:13:06 +08:00
minggo 0a1f0369e6 fixed #1481: merge Nicolas's pull request and do some bug fixes 2012-09-21 17:01:19 +08:00
Nicolas Gramlich cd4b22a503 Merge branch 'gles20-official' into patch-5 2012-09-18 10:50:15 -07:00
Donald Alan Morrison 216ebab0e1 Minor English Spelling Corrections, etc. 2012-09-15 14:19:14 -07:00
Nicolas Gramlich f03c0caaf9 Added proper JNIEXPORT/JNICALL markers to android platform jni bindings. 2012-09-13 09:34:30 -07:00
Nicolas Gramlich 4c7705171a Android JAVA refactoring. Android JNI Cleanup. 2012-09-07 17:23:04 -07:00
James Chen 06f240fa5e Moved '#include <stdint.h>' to 'platform/ios(android,linux,blackberry)/CCStdC.h' since win32 don't have a stdint.h. 2012-08-29 14:49:02 -07:00
James Chen 3d0b5bf455 fixed some warnings in java codes for android port. 2012-08-27 10:21:43 +08:00
James Chen ee3e68014b Merge branch 'gles20' of https://github.com/cocos2d/cocos2d-x into android_editbox 2012-08-24 00:16:11 +08:00
James Chen 1685e5c497 issue #1429: Used java code to implement keyboard layout. 2012-08-24 00:15:15 +08:00
James Chen 7f2c9f6fb4 issue #1429: Removed some used codes. 2012-08-23 23:09:12 +08:00
minggo 37cb691600 fix some bugs while testing 2012-08-23 18:01:28 +08:00
James Chen 06038163ca iss1429: Finished using Dialog to implement CCEditBox for android port.
Next step:
	Using Java codes to implement Cocos2dxEditBox. Don't use style.xml, color.xml and keyboard.xml.
2012-08-23 15:34:57 +08:00
James Chen a437099779 issue #1429: Use activity to implement CCEditBox for android. Next step: use dialog to implement CCEditBox. 2012-08-23 09:42:28 +08:00
James Chen bcbd161398 issue #1429: First commit CCEditBox for android port. 2012-08-22 09:47:04 +08:00
minggo 07ddd43695 issue #1437:make CCApplication::sharedApplication() return pointer 2012-08-21 15:28:43 +08:00
minggo cfdc50fb60 issue #1437:make CCEGLView::sharedOpenGLView() return pointer 2012-08-21 14:58:31 +08:00
minggo 316c484936 Merge pull request #1173 from mustime/bug1284
issue #1284: add detection for I9100 model
2012-08-16 18:39:28 -07:00
minggo bcf61cdf26 issue #1405:use enum to distinguish target 2012-08-16 10:21:15 +08:00
mustime 0933a032e9 Merge branch 'gles20' of git://github.com/cocos2d/cocos2d-x into bug1284 2012-08-14 09:41:18 +08:00
mustime 89f0508043 issue #1284: add detection for I9100 model 2012-08-13 17:14:33 +08:00
minggo cc39dc55f4 issue #1405:remove unneeded functions of CCFileUtils 2012-08-08 18:39:33 +08:00
minggo 3853611e62 issue #1405:support loading resources from directory defined by developer 2012-08-08 17:42:04 +08:00
minggo 0b2396c54b issue #1405:support three type of resolution 2012-08-01 16:56:12 +08:00
minggo 7bfc88c568 Merge pull request #1130 from mustime/bug1284
issue #1284: using OpenSL for playing effects on I9100
2012-07-26 20:31:51 -07:00
mustime bfc53e3453 issue #1284: using OpenSL for playing effects on I9100 2012-07-26 15:30:09 +08:00
James Chen 557f654cf3 Built successfully on android. 2012-07-20 17:06:00 +08:00
Ngoc Dao 14a23ced56 Fix compilation error: platform/android/CCEGLView.h:30:39: error: platform/CCPlatFormMacros.h: No such file or directory 2012-07-06 10:32:54 +09:00
James Chen c4056b1bb0 fixed #1269: Updated include search paths for win32 and android. 2012-06-19 17:22:55 +08:00
minggo 90448ec7d0 issue #1269:fix some compiling error because of including error header files 2012-06-19 16:20:46 +08:00
folecr 90a6a65404 Modify source.dir to match updated directory name 2012-06-15 09:24:10 -07:00
James Chen cc572ab8e7 fixed #1329: Moved all java files part of engine into a certain directory, then all projects refer to them. 2012-06-15 18:15:43 +08:00
James Chen 24cc0796b6 Merge branch 'cocos2dxandroidlibrary' of https://github.com/folecr/cocos2d-x into folecr_android 2012-06-15 17:47:04 +08:00
minggo 899022d107 fixed #1292:fix some bugs that caused by modify function name 2012-06-15 17:39:13 +08:00
folecr 6fc2dc5ed9 Use Java code instead of XML to define layout
* Android layout for cocos apps are very simple (full screen)
 * Avoids creation of R.java for loading the layout
 * Can package entire library in jar
 * Remove unused layout resource
2012-06-14 19:52:45 -07:00
folecr 4e5a64fd9e Minimal layout directives in XML 2012-06-14 19:52:45 -07:00
folecr b6164c7590 Create a library named cocos2dandroid
* Based on sources from HelloWorld that should be common across all cocos2d-x android projects
 * Rename, use prefix cocos2dx_default_ for items in layout
 * Project files for android library, targeted to android-8
2012-06-14 19:21:02 -07:00
minggo 9d9e2579e3 issue #1181: save render texture when comming to background 2012-06-14 18:37:57 +08:00
minggo 9321a8d025 fixed #1322: vertical alignment works ok on android 2012-06-13 18:33:44 +08:00
James Chen c95cbb1774 issue #1310: Used CCLabelAtlas instead of CCLabelBMFont to display FPS,SPF status.
Updated CCFileUtils, added some method, such as sharedFileUtils/purgeFileUtils/purgeCachedEntries.
Fixed a bug in CCDirector, made retina mode work correctly.
2012-06-11 10:59:57 +08:00
James Chen 3959fe8f4d typo fixed in CCGL.h 2012-06-01 14:48:45 +08:00
James Chen 5f5af82254 fixed #1177: Moved CCStdC.h/.cpp to relevant platform folder. 2012-05-29 15:51:13 +08:00
minggo 683c91bbfa fixed #1236: return empty string when parameter is null 2012-05-16 14:17:37 +08:00
minggo 1d18c6607a fixed #1237: correct line number output by CCAssert 2012-05-16 14:10:27 +08:00
Walzer f70855e959 fixed #1229, reduce the requirement of gles20 branch from NDK android-10 to android-8 level (official android 2.2 image, the lowest version which supports OpenGL ES 2.0), remove EGL dependency. 2012-05-05 10:06:41 +08:00
minggo 27b5fb8074 merge commit of issue 1216 2012-05-03 16:30:13 +08:00
James Chen 82439733c5 fixed #1204: Made CCEGLView::Create(on win32) as a private function. Updated ExtensionsTest.
And updated the format of source files(changed linebreak symbol to UNIX format ('\n'),replaced 'tab' with four spaces).
2012-05-03 10:12:00 +08:00
James Chen 5fc72581cb issue #1204: Removed CCApplication::initInstance. 2012-05-02 17:50:26 +08:00
Walzer 2addd06f21 fixed #1203, remove CCFileUtils::setResource & SimpleAudioEngine::setResource, these 2 methods were created for wophone. 2012-05-02 10:39:17 +08:00
James Chen 8d63e9f1bd issue #1190: Updated some files for android port. 2012-04-26 11:52:21 +08:00
James Chen 1d94ba05a0 fixed #1189: updated linebreak and tab(4 space) for all source files. 2012-04-25 18:17:04 +08:00
James Chen 0f36a89c7e issue #1188: Refactor directory. Compile successfully on android and win32(vs2008 debug). 2012-04-25 16:18:04 +08:00
James Chen 062ae1756d fixed #1177: updated project configuration for android and ios platforms. 2012-04-24 17:35:36 +08:00
James Chen 521155e9e2 issue #1177: Added some common methods for CCPoint,CCSize,CCRect. Added MutiTouchTest demo. 2012-04-23 14:30:38 +08:00
James Chen 909a759ff6 issue #1177: Updated android project configuration. 2012-04-20 17:33:28 +08:00
James Chen d1d0fd619a issue #1177: Added CCEGLViewProtocol class as CCEGLView's super class. Updated win32, android project configuration. 2012-04-20 15:23:00 +08:00
James Chen 230b8a386b issue #1176: Changed linebreak symbol to UNIX format ('\n'),replaced 'tab'
with four spaces. Also,
1. Used macro NS_CC_BEGIN instead of namespace cocos2d {, NS_CC_END instead
of }.
2. Removed some unused files.
3. Renamed the name of some folders, for example,
"test.android"-->"proj.android" .
2012-04-19 14:35:52 +08:00
James Chen 84ffaf130a delete semicolon after NS_CC_BEGIN and NS_CC_END 2012-04-19 11:56:22 +08:00
James Chen 7d7baf81a2 refactor updated... 2012-04-18 18:43:45 +08:00
minggo 86b13a64c4 CCFileUtils::fullPathFromRelativePath() works correct 2012-04-08 14:52:47 +08:00
minggo 355e27dada merge commit 928a28e37d3469fcd41aff14cb136b1415f2fc86 2012-04-08 14:16:29 +08:00
James Chen 2e8bae8ebf issue #1056: Update Android.mk. Make tests project being compiled successfully. 2012-03-21 22:49:58 +08:00
James Chen 35d93328b9 issue #1056: 1.Fixed a bug of double delete TouchDispatcher.
2. Modified the last parameter of glDrawElements. It will cause crash on some devices if the last parameter which means Indices's pointer is zero.
2012-03-21 21:53:03 +08:00
James Chen f529bcd659 issue #1056: Move some singletons to CCDirector. It is easily managed by CCDirector. 2012-03-21 17:35:20 +08:00
minggo 382e4e7eb8 issue #1056: modify code according new code after pull 2012-03-20 17:27:06 +08:00
minggo 74aaf4c6ca issue #1056:gles20 runs ok on android 2012-03-20 16:10:12 +08:00
minggo 7fc0ffbf26 fixed #737: remove view id 2012-03-12 11:00:12 +08:00
minggo 645d561276 fixed #737: remove view id 2012-03-08 12:40:27 +08:00
James Chen cb1f94df47 revert CCFileUtils::getFileData method. 2012-03-05 09:55:50 +08:00
James Chen 347a8294ac fixed #1007: Allocate one more byte of '\0' to terminate string in CCFileUtils::getFileData. 2012-03-03 12:24:02 +08:00
James Chen dfd5adb3bd fixed #994: add support for bbndk2.0 on blackberry platform. 2012-03-01 16:52:17 +08:00
minggo b0b6b85a79 fixed #946: HD image for both retina and normal 2012-02-16 10:47:16 +08:00
minggo 153d2b8192 issue #971: build cocos2dx as static lib and remove some unneeded codes 2012-02-09 15:49:14 +08:00
minggo c6da8d2fbd call correct java method 2012-01-04 10:14:46 +08:00
minggo 21f05c2d6f issue #903: fix a compiling error 2011-12-22 09:56:09 +08:00
minggo bb4b1d02bb Merge pull request #608 from GMTDev/patch-2
issue #903: Update CCTouch to include the ID/PID of the touch
2011-12-20 21:48:30 -08:00
minggo ba462e99a6 fixed #906: remove unneeded code in CCImage_android.cpp 2011-12-12 17:02:21 +08:00
GavT 3d86583818 Update cocos2dx/platform/android/jni/TouchesJni.cpp 2011-12-07 20:25:51 -08:00
minggo d48da20b0f synchrolize to master 2011-11-18 18:53:53 +08:00
minggo 5d8043ce7e issue854: remove unneeded files 2011-11-18 10:54:36 +08:00
dumganhar 8fd2917888 fixed a bug that Accelerometer value error if use HVGA resource in WVGA device 2011-11-13 00:54:05 +08:00
moadib 5feee662e7 More simple and correct way to detect language for win32 application, also added detection of all languages contained in ccLanguageType enumeration .
Added support for detect russian language.
2011-10-12 09:32:59 +04:00
minggo 762e342b4d fixed #727: invoke DeleteLocalRef() to resolve memory leak 2011-09-20 14:25:16 +08:00
minggo 018036eb28 Merge pull request #498 from minggo/iss703
fixed #703: refactor Accelerometer
2011-08-31 18:30:22 -07:00
minggo f61fde764b fixed #703: refactor Accelerometer 2011-08-31 17:14:29 +08:00
Walzer 1402350870 fixed #676, add more languages into CCApplication::getCurrentLanguage(). Android & iPhone port is done, other platforms no yet. 2011-08-31 14:20:33 +08:00
liswei ab2a6cb2bb fixed #702 tests crashs at the start on wophone device 2011-08-30 15:59:06 +08:00
minggo 92f741aa73 issue #675: remove unneeded header file 2011-08-30 09:49:55 +08:00
minggo b38105a70b issue 675: dispatch accelerometer data to one delegate 2011-08-29 18:18:39 +08:00
minggo e26eaae5e1 [android] fixed #688: support reading file other than apk 2011-08-25 11:24:31 +08:00
minggo 5087f6ddb2 [android] fixed #683: remove unneeded includes 2011-08-18 16:19:36 +08:00
minggo b4ab3f6b75 [android] fixed #683: remove unneeded includes 2011-08-18 16:18:26 +08:00
minggo 1640e48d5a [android] fixed #683: let getCurrentLanguageJNI() & getPackageNameJNI() return valid pointer 2011-08-18 16:09:49 +08:00
minggo 76da5f2e84 fixed #656: remove unneeded methods & android can let user set resource path 2011-08-04 17:19:58 +08:00
minggo 78642a39ac [android] fixed #652: refactor JniHelper::jstringtochar() 2011-08-03 10:44:39 +08:00
minggo b308effdc5 [android] fixed #631: Send \n to engine when user input nothing 2011-07-26 11:41:28 +08:00
minggo b105b6005e [android] fixed #623: refactor Cocos2dJni.cpp 2011-07-25 14:12:30 +08:00
minggo 62ea6a2d46 issue #623: create JniHelper and use it somewhere 2011-07-22 18:14:29 +08:00
minggo 0c495628ea Merge pull request #405 from minggo/iss618
invoke java code(System.exit()) to finish programe
2011-07-19 02:20:36 -07:00
Leon d2d02e0c52 fix compile error with android-ndk-r6 2011-07-19 16:54:42 +08:00
minggo 640d811809 [android] fixed #618: invoke java code(System.exit()) to finish programe 2011-07-19 16:01:22 +08:00
minggo 6c47f53b13 [Android] fixed #547: line wrap OK on Android 2011-06-29 15:45:30 +08:00
yangws 59f37ddb5d fixed #526 Wrap glScissor in CCEGLVIew::setScissorInPoints. 2011-06-27 10:55:45 +08:00
minggo 8440d6a267 [android] fixed #364: show string correct & line break ok 2011-06-24 13:55:00 +08:00
minggo 10cdd7f798 [android] fixed #364: line break ok on Android 2011-06-23 14:44:20 +08:00
minggo 1122a7c7d0 [android] use Android widget Bitmap other than skia to drawstring 2011-06-22 16:58:50 +08:00
natural-law cfee246959 fixed #323, Add an interface to get the current language. 2011-06-17 10:49:02 +08:00
liswei 1591c7edc8 fixed #512 fix warnings in /Wall flag 2011-06-10 17:51:37 +08:00
yangws 7e2d1d5c48 fixed #490 Text input on android use a different way, TextInputTest OK now. 2011-05-30 16:36:12 +08:00
minggo ff1017d86f Merge pull request #276 from minggo/iss496
[android] fixed #496 fixed #497
2011-05-18 23:18:37 -07:00
minggo 073260e0a9 [android] fixed #496 fixed #497: tests and HelloWorld work ok on Android3.0 2011-05-19 11:26:57 +08:00
minggo 822016e375 [android] fixed #495: fix a memory leak 2011-05-18 13:56:35 +08:00
Walzer 1340bbf842 [android] fix a compilation error in CCFileUtils_android.cpp, getWritablePath() method 2011-05-12 21:12:15 +08:00
minggo 91bc9a3f7a [android] fixed #488: fix memory leak 2011-05-12 18:55:32 +08:00
minggo d8f3b0c25b [android] CCUserDefault works ok on android2.2 2011-05-12 18:32:13 +08:00