Commit Graph

211 Commits

Author SHA1 Message Date
James Gregory 955ba1bfd3 ifdef tango around some symbols that aren't defined in Emscripten (nor a bunch of other platforms, it seems). 2013-05-06 20:58:43 -07:00
minggo 80dfd4d493 Merge pull request #2407 from sergey-shambir/attribute_format
Added __attribute__(__format__()) for CCLog and CCString
2013-05-06 20:06:52 -07:00
minggo d89792fdc6 fixed #2073: fix memory leak in CCUserDefault 2013-04-22 16:43:05 +08:00
Sergey Shambir e5b2f300f9 Added CC_FORMAT_PRINTF(x,y) macro to warn on CCLog() format errors
Uses printf format. Enabled for GCC and clang.
2013-04-19 11:54:08 +04:00
James Chen 63ce8adfad fixed #2059: Fix complication errors on Android. 2013-04-17 17:05:39 +08:00
James Chen ddd6d9d155 fixed #2059: cc.FileUtils.getInstance().getStringFromFile(filename) doesn't return a whole string. 2013-04-17 16:08:48 +08:00
minggo a0dc39ca38 fixed #2034:use previous path to get UserDefault.xml 2013-04-10 11:39:01 +08:00
minggo ac43ff7584 Merge pull request #2325 from minggo/userdefault-hotfix
fixed #2034:make CCUserDefault compatible with previous version on Android and iOS
2013-04-08 18:34:20 -07:00
minggo d3aa718b22 fixed #2034:make CCUserDefault compatible with previous version on Android and iOS 2013-04-08 21:35:43 +08:00
James Chen 7c6cb8c8cd commit latest uthash.h utlist.h 2013-04-08 10:59:41 +08:00
Darragh Coy 7f565bb2fa Fix CCUserDefault.cpp compiling on Android.
CCUserDefault.cpp shouldn't compile on Android.
2013-03-31 22:24:10 -07:00
minggo 1d51f9a3d7 issue #1529:CCUserDefault work ok on Android 2013-03-11 16:45:20 +08:00
minggo ac888fee01 issue #1529:CCUserDefault supports default value on iOS 2013-03-11 14:45:07 +08:00
Asad ur Rehman c1a8059998 Added CCNotificationCenter::removeAllObservers
This is a helper method that removes all observers with a particular
target. It can be used in destuctors to ensure no observers trigger
callbacks on objects that no longer exist.
2013-03-10 19:34:01 +05:00
James Chen a889322a47 Fixed compilation error for MAC port. 2013-03-10 16:34:41 +08:00
minggo dd8681b18b Merge pull request #2113 from minggo/refactor-ccuserdefault
Refactor ccuserdefault
2013-03-06 23:05:50 -08:00
Sam Clegg ce247a6304 [NaCl] Fix warnings in ARM build 2013-03-06 13:02:55 -08:00
minggo 648e9a7bf1 issue #1529:use NSUserDefaults on iOS and SharedPreferences on Android to implement CCUserDefault 2013-03-06 16:36:44 +08:00
Sam Clegg 38878b084b Fix all compiler warnings produced by gcc.
This allows the linux and NaCl builds (and perhaps others)
to be compiles with -Wall and -Werror, and it makes the build
output much less noisy.
2013-03-05 17:01:00 -08:00
minggo a9fa61af34 issue #1529:CCUserDefault -> user_default 2013-03-05 14:55:26 +08:00
minggo f37b1525b4 issue #1529:use NSUserDefault to implement CCUserDefault on iOS 2013-03-05 14:53:37 +08:00
Sam Clegg 33c422d1d5 Add new port: Native Client 2013-03-02 12:15:24 -08:00
James Chen 537abaec42 fixed #1753: Android works ok now. 2013-02-27 16:57:36 +08:00
James Chen 0d70e6f92f issue #1753: Win32 works ok. 2013-02-27 15:45:23 +08:00
James Chen 473e8e6139 issue #1753: Upgrading SpiderMonkey to Firefox19.0, iOS works ok. 2013-02-27 15:16:49 +08:00
minggo 7941d70a04 fix a bug of CCUserDefault 2013-02-26 12:44:20 +08:00
James Chen 5f645cefba issue #1489: ZEXPORT -> CC_DLL for unzip.h. 2013-02-25 18:35:18 +08:00
minggo 1df0095993 fix a bug of CCUserDefault 2013-02-22 11:01:57 +08:00
James Chen ad61fa3e9b fixed #1703: fixed compilation errors for BlackBerry. 2013-02-16 11:05:30 +08:00
minggo ba8f26fed9 Merge pull request #1969 from minggo/iss1702-writablePath
modify writable path for iOS and Android
2013-02-06 22:16:46 -08:00
fape 05eb3a59f5 include missing CCPlatformMacros.h 2013-02-06 15:50:09 +01:00
fape 948732d617 marmalade tinyxml2 fixes 2013-02-06 14:49:04 +01:00
minggo 0c5bcb3f7b issue #1702:fix a typo error 2013-02-06 18:04:40 +08:00
James Chen fb9ac31d08 fixed bugs in CCUserDefault.cpp after using tinyXML2, fixed warnings in SpriteTest.cpp. 2013-02-06 17:20:54 +08:00
minggo 6e3409a30c issue #1703:move tinyxml2 to cocos2dx/support 2013-02-06 10:18:31 +08:00
martell 0e3560bcd5 final fix.. tested 2013-01-26 06:27:49 +00:00
martell 05bece9d07 added ccuserdefault tinyxml2 ver 2013-01-26 02:41:27 +00:00
James Chen d94a0cf4c7 issue #1603: fixed a warning in unzip.cpp. 2012-12-20 18:39:29 +08:00
James Chen bb6df91749 issue #1530: Exported CCUserDefault to js. 2012-11-16 15:58:18 +08:00
minggo 605771697a Merge pull request #1566 from mingulov/unzip_crc
Zip support: broken CRC check / unzCloseCurrentFile
2012-11-15 23:31:14 -08:00
Denis Mingulov 869168a884 ZipFile - speedup initialization for zip archive by 30-50%
unzip.h/.cpp - unzGoToFirstFile/unzGoToNextFile retrieves information
about the current file, so it is possible to remove redundant calls
to unzGetCurrentFileInfo and speed up general execution.

unzip.h/.cpp are modified accordingly by creation unzGoToFirstFile64
and unzGoToNextFile64 with file info (unz_file_info64) and name as
possible output parameters.

ZipFile::setFilter (it is used to create a file list at ZipFile
constructor) - redundant calls to unzGetCurrentFileInfo64 are removed,
so briefly the time required to generate a zip file list is something
like 1 average old unzLocateFile call.
2012-11-11 15:04:41 +02:00
Denis Mingulov eaed42c8bd Zip support: broken CRC check / unzCloseCurrentFile
A fix for changes at 75ae8d2201
- unzOpenCurrentFile3 has set pfile_in_zip_read_info->crc32_wait
just in case if Zip file has unknown structure / might not be
unpacked, so almost any unpacked file was considered as having
UNZ_CRCERROR.
2012-11-11 10:22:48 +02: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
James Chen 56cdb76867 fixed #1493: Updated one comment. 2012-10-22 15:52:11 +08:00
James Chen 7af2f7c5ce fixed #1493: Updated one comment. 2012-10-22 15:51:06 +08:00
James Chen 6f4e56cd92 fixed #1493: Corrected some comments for CCNotificationCenter. 2012-10-22 15:49:33 +08:00
James Chen 1c0240b5de fixed #1493: Added doxygen comments in CCNotificationCenter.h 2012-10-22 13:48:11 +08:00
micahli c69a11296e fix the potential Container iterator bug with CCNotification
revert last fix which may contain other bugs
2012-10-15 09:55:37 +08:00
micahli 7d1d46ee3f fix a bug with CCNotificationCenter that observer->performSelector(observer) may call CCNotificationCenter::removeObserver and cause CCARRAY_FOREACH(m_observers, obj) access invalid address 2012-10-13 16:44:46 +08:00