Commit Graph

1638 Commits

Author SHA1 Message Date
James Gregory 0c8f7dd608 Enable texture caching with emscripten. 2013-05-06 21:23:06 -07:00
James Gregory de9df010c3 Enable texture cache on Emscripten. Not sure yet if this is the best balance, since we're both short on memory *and* compute time. 2013-05-06 21:17:22 -07:00
James Gregory 735280572a Add libtiff build -- build with straight emconfigure, emmake, with a troublesome assert removed (assert(sizeof(uint64) == 8)). 2013-05-06 21:00:39 -07:00
James Gregory 82c6f68593 Set orientation to 0 for Emscripten, thus avoiding a segfault. 2013-05-06 21:00:38 -07:00
James Gregory 5b8494199e Rebuild libfreetype without references to my home dir in it. 2013-05-06 20:59:50 -07:00
James Gregory 3077190e29 Add note on origin of libxml binary. 2013-05-06 20:59:49 -07:00
James Gregory 9d775d136b Add libxml2 build for Emscripten. 2013-05-06 20:59:49 -07:00
James Gregory 5295202081 Add freetype2 headers that match the .a we're using. 2013-05-06 20:59:47 -07:00
James Gregory 5138fb66fd Add pre-build dependencies for Emscripten libpng, libz. 2013-05-06 20:59:47 -07:00
James Gregory 7d563a818a Hack: use 800x500 resolution for window for emscripten so that mouse roughly lines up. 2013-05-06 20:59:47 -07:00
James Gregory 19c6a50d50 Enable texture caching with emscripten. 2013-05-06 20:59:46 -07:00
James Gregory edcd0f12e4 Add platform files for Emscripten. 2013-05-06 20:58:46 -07:00
James Gregory 1d307d676d Remove freetype source and add libfreetype.a as built by the Emscripten test-suite.
Revert "Add freetype 2.4.11 to repo"

This reverts commit 418906d2612b59ead6826d8395b69168bdff0ca4.
2013-05-06 20:58:45 -07:00
James Gregory 4f56f93269 Add #defines for Emscripten platform 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 d395d26e1d Merge pull request #2417 from sergey-shambir/disable_copy
Added CC_DISABLE_COPY macro
2013-05-06 03:02:48 -07:00
Romain Tisserand d2690d8942 Fix iOS 4.3 JPEG loading (darken picture, alpha issue) 2013-05-04 19:14:23 +02:00
minggo 1a0db3749e Merge pull request #2496 from mchinen/mchinensedit
Fix missing protocol method warning for iOS 6.0 addition
2013-05-04 08:55:07 -07:00
Michael Chinen d47759cc32 EAGLView.mm: fix indent 2013-05-03 19:46:58 +09:00
Michael Chinen be2f20e213 Fix missing protocol method warning for iOS 6.0 addition 2013-05-01 00:35:17 +09:00
tiantian 2ba5035e5a Make sure XMLDocument is deleted; Code clean up; Add test; 2013-04-28 00:36:37 +08:00
James Chen d1afe6cfa6 Fixing a bug in CCFileUtilsIOS::isFileExist(). 2013-04-25 22:02:20 +08:00
James Chen 93a8b60111 If file path is an empty string, return false directly in CCFileUtils::isFileExist. 2013-04-25 21:51:13 +08:00
Andrew Goulding 3c6bb725e7 Added additional CCLOG to CCFileUtils::fullPathForFilename
There's currently no way to be sure, from a calling function, that
fullPathForFilename has returned an invalid file path, which makes it
difficult to quickly track down missing, or incorrect file paths. Added
a CCLOG before the original string is returned to make debugging
missing or incorrect file paths easier.
2013-04-23 06:24:12 +10:00
Sergey Shambir 41f5538ff4 Added CC_DISABLE_COPY macro 2013-04-20 15:13:19 +04:00
Sergey Shambir 3ae98978d4 Added CC_FORMAT_PRINTF to CCString
Added for CCString::initWithFormat() and CCString::createWithFormat().
Fixed warnings.
2013-04-19 14:00:16 +04: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 612a8a309f Merge pull request #2193 from Weeds/feature-screen-dimensions
fixed #2065: Adding kResolutionFixedHeight and kResolutionFixedWidth resolution policy.
2013-04-18 00:31:13 -07:00
minggo 724402750b Merge pull request #2390 from scoyo/master
Fix for spaces at the beginning of wrapped lines
2013-04-17 19:10:19 -07:00
Jaroslaw Lewandowski 20e102bc46 Fixed setAccelerometerInterval signature in setAccelerometerIntervalJNI function. 2013-04-18 01:27:33 +01:00
Kristiaan De Jongh 81e4178a42 fix for spaces when wrapping 2013-04-17 13:09:48 +02: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 78d3c7f048 fixed #1613:not reload resources on Android platform after return from background 2013-04-17 15:34:57 +08:00
James Chen e07d11d1e2 Merge pull request #2381 from lgb/blackberry-compile-fix
fix compilation error in cocos2dx for BlackBerry PlayBook
2013-04-16 22:00:08 -07:00
Oleg Baluk af71b881df fix wrong buffer name 2013-04-17 01:59:23 +04:00
tianTian 9a04eee8d1 do it atomically; 2013-04-16 12:38:53 +08:00
tianTian 91ddfe7382 Add support for CCDictionary contains CCArray; 2013-04-16 12:34:09 +08:00
tianTian b7f0b2a8e0 Use CCLOG instead of CCLog; 2013-04-13 18:20:17 +08:00
tianTian 96359950cf Implement CCDictionary::writeToFile();
Use NSDictionay to do the job for iOS and Mac, and using tinyxml2 for other platform;
2013-04-13 16:55:24 +08:00
yodesoft 5952597c1a Set writable path to XDG_CONFIG_HOME if it exists. 2013-04-11 09:20:25 +08:00
yodesoft cda864b597 Read app name from /proc/self/exe 2013-04-11 08:58:48 +08:00
yodesoft db5df829fb Restore codes of init m_strDefaultResRootPath 2013-04-10 18:39:01 +08:00
yodesoft 85c932112f Merge remote-tracking branch 'upstream/master' 2013-04-10 17:54:50 +08:00
James Chen 32406efec2 Merge branch 'newlines_in_cclog' of https://github.com/sbc100/cocos2d-x into sbc100-newlines_in_cclog
Conflicts:
	cocos2dx/proj.linux/cocos2dx.mk
2013-04-10 14:17:23 +08:00
yodesoft e193dbc4cf Linux: Set writable path to "<user's home>/.config/<app name>" 2013-04-10 11:45:55 +08:00
yodesoft d03b95ca46 Merge remote-tracking branch 'upstream/master'
Conflicts:
	cocos2dx/platform/linux/CCFileUtilsLinux.cpp
2013-04-10 11:16:04 +08:00
yodesoft ba591b0980 Linux: Set writable path to "<user's home>/.config/<app name>" 2013-04-10 10:55:50 +08:00
minggo df888eef65 fixed #2042: remove libxml2 2013-04-10 09:56:31 +08:00
minggo 5d2c67ee8a fixed #1904:strip libcurl.a on x86 architecture 2013-04-10 09:40:44 +08:00
minggo 3c8b26813e delete libxml2 2013-04-10 09:39:48 +08:00
elMiro 0f6e2daf31 Correction of passed buffer size to readlink and verification of result return by readlink. 2013-04-09 00:25:31 +02:00
James Chen 5e2f1e0bd6 Merge pull request #2272 from Weeds/saxparser-fix
fixed #2035: fixed potential crash in CCSaxParser
2013-04-08 07:49:36 -07:00
James Chen 401b3dca4d Merge pull request #2282 from DarraghCoy/ccfileutils_create_with_contents_of_file_fix
fixed #2031: Fix CCFileUtils 'createXXXXWithContentsOfFile' path lookup issue.
2013-04-08 02:33:23 -07:00
James Chen d3eed7fd1f Merge pull request #2279 from sjchao/master
fixed #2030: Fixing a display bug when a scrollView nested in another scrollView. The parent's scissor rect need to be considered, when setting the scissor rect in the subScrollView.
2013-04-07 23:55:55 -07:00
James Chen 7a45e1ddd1 Merge pull request #2322 from dumganhar/iss1592-update-uthash
fixed #1592: Updating uthash to v1.9.8.
2013-04-07 23:31:31 -07:00
James Chen 831dfb6ade Merge remote-tracking branch 'origin/iss1592-update-uthash' into iss1592-update-uthash 2013-04-08 11:56:10 +08:00
James Chen 2c3427dcee issue #1592: Fixing complication errors for windows port. 2013-04-08 11:56:04 +08:00
minggo ad68b3d5ed Merge pull request #2288 from mchinen/master
Android: fix emulator for OpenGL ES 2.0
2013-04-07 19:08:00 -07:00
yodesoft 4d5dff6172 Reduce function call in nativeInitBitmapDC to improve performance. 2013-04-07 17:17:19 +08:00
James Chen 038720a1b2 Merge pull request #2290 from Yodesoft/master
fixed #2000: Improve font rendering performance for linux platform.
2013-04-03 18:59:37 -07:00
Romain Tisserand 15d4e75cdb JNI fixes, added missing JNIEXPORT / JNICALL declarations
This is needed if compiling with custom visibility settings (example :
-fvisibility=hidden)
2013-04-02 22:15:12 +02:00
yodesoft fa9339916d Improve font rendering performance 2013-04-02 10:16:51 +08:00
Michael Chinen 6f5173f448 android:Add emulator detection and config change to allow running OpenGL ES 2.0 projects in the emulator
Code taken from forum post by Romain TISSERAND
http://www.cocos2d-x.org/boards/6/topics/12563?r=25446#message-25446
2013-04-01 20:41:33 +09:00
Michael Chinen 227d2cf60b Add emulator detection hack to allow running OpenGL ES 2.0 projects in the emulator 2013-03-31 20:47:43 +09:00
Darragh Coy d0f8aaad9e Fix CCFileUtils 'createXXXXWithContentsOfFile' path lookup issue
When calling 'CCFileUtils::createCCDictionaryWithContentsOfFile' and 'CCFileUtils::createCCArrayWithContentsOfFile' on iOS/OSX these functions call upon 'CCFileUtils::fullPathForFilename' to resolve the path given into a full path which can be used with system file IO functions. This matches the convention found throughout the cocos2dx library and is expected behaviour. However, on Android and other platforms it appears calling 'CCFileUtils::createCCDictionaryWithContentsOfFile' or 'CCFileUtils:: createCCArrayWithContentsOfFile' does not do the same resolution using 'CCFileUtils::fullPathForFilename' - resulting in file paths which are correctly specified (and which worked on iOS/OSX) to fail to load on these platforms.

Fix this issue by performing a lookup/resolve of the file path using 'CCFileUtils::fullPathForFilename' before doing the low level loading work itself. This brings the behaviour of other platforms in line with iOS and OSX.
2013-03-29 22:51:25 -07:00
sjchao cd3a2be720 change comment type 2013-03-29 17:21:29 +08:00
sjchao 4690a45f3e change a method name
change method name from isScissorEnable() to isScissorEnabled() in
class CCEGLViewProtocal
2013-03-29 17:19:47 +08:00
sjchao 18c43e29b2 change method name from getIsScissorEnable() to isScissorEnable() 2013-03-29 15:32:30 +08:00
chao 253ebe49e4 add getIsScissorEnable() and getScissorRect() for CCEGLViewProtocal 2013-03-29 01:28:26 +08:00
Andre Rudlaff 5372363365 fixed potential crash in CCSaxParser
The character array which given to CCSAXParser::parse() may not be NULL
terminated.
Therefore we must also add the size of the data array to the parameter list
of the tinyxml2::XMLDocument::parse() call
2013-03-28 01:07:54 +01:00
Andre Rudlaff 89f08bb441 [Linux] fixed font rendering crash for certain fonts
face->size->metrics->ascender seems to be unreliable for some fonts,
additionally the freetype documentation says that it may be used
differently for different fonts.
Therefore it may happen that the ascender of a font face is less then
the glyphs bounding box resulting in accessing invalid memory.

The fix is to use the bbox attribute instead of the ascender
2013-03-28 00:54:11 +01:00
billy1380 cdfe693583 - changed cocos2d mac project to support universal build and x86
- fixed issues associated with that
2013-03-23 16:04:51 +00:00
minggo 71659f4aa9 Merge pull request #2247 from hailongiPhone/master
release && set nil
2013-03-22 04:09:47 -07:00
minggo 1538c72581 Merge pull request #2197 from dumganhar/ios-default-font
[iOS] Using system font by `[UIFont systemFontOfSize]` when font name wasn't found.
2013-03-22 00:10:09 -07:00
hailong 2ea447dbfd Update CCDirectorCaller.mm
First destroy CCDirector instance with  cocos2d::CCDirector::sharedDirector()->end() 

Then create new CCDirector instance with
cocos2d::CCApplication::sharedApplication()->run();

APP will crash at 
CCApplication::setAnimationInterval

[[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];
2013-03-22 15:02:46 +08:00
minggo 949700ca1a issue #1848:use CCConfiguration::supportsPVRTC() to determine if the device support powertc format 2013-03-21 15:50:41 +08:00
James Chen e2e9bc8ce0 Fixing memoryleaks. 2013-03-21 09:00:55 +08:00
minggo 9afc6729dc fix build error caused by libcurl on android x86 2013-03-20 11:53:19 +08:00
James Chen ac509f70db [iOS] Using system font by `[UIFont systemFontOfSize]` when font name wasn't found. 2013-03-19 13:11:33 +08:00
Andre Rudlaff 865a730ef5 added kResolutionFixedHeight and kResolutionFixedWidth resolution policy
These new resolution policies will either ignore the width or height of the
specified design resolution size, but scale the ignored dimension, so it
matches the aspect ratio of the device.

Example:
A device with 854x480 pixels and a design resolution size set to 480x320
and the kResolutionFixedHeight policy, will create an internal canvas of
the size of 570x320px
If the device original size is 800x480 its internal size will be
534x320px
The height for both examples stays the same, the width is adjusted to match
the aspect ratio

Benefits:
- no distortions
- full canvas is usable, the visibility origin is 0/0
- I can use getWinSize() to place objects which is more intuitive
- for objects that should be placed at 0/0 I can use CGPointZero or 0/0 instead
  of the VisibilityRect methods, which is more readable
- using this method projects from the 1.x branch are probably much easier to
  port

Disadvantages:
- it is the developers responsibility to create the game code so that it
  supports multiple aspect ratios
2013-03-18 20:06:01 +01:00
Sam Clegg 04c1a863a0 Remove tailing newlines from CCLog messaages.
Some CCLog message contained trailing newlines which
made the logs hard to read on many platforms.  The solution
here is to stip trailing newlines on those platforms, and also
to remove the newlines from the existing log messages.
2013-03-16 09:01:21 -07:00
Andre Rudlaff a1602a992b fontcache map is now static, as we do not need external linkage for it. 2013-03-15 17:54:24 +01:00
Andre Rudlaff d3ecb09c9b Merge branch 'master' into feature-linux-fontcache 2013-03-15 08:54:15 +01:00
Andre Rudlaff e8ee3a9b83 [Linux] fixed font rendering artifacts, added simple line break
This patch fixed the size calculations for true type fonts (especially for
italic fonts)
Additinally a very simple greedy line break algorithm has been added for
true type labels.
2013-03-15 00:24:25 +01:00
Andre Rudlaff 67ad11dbee [Linux] add cache for font family -> font path mapping
As FcFontMach is quite an expensive call the results of getFontFile() are
now cached in an std::map if either a ttf file is packed with the app or
if a font file has been found by using fontconfig
2013-03-13 00:11:35 +01:00
minggo 1d51f9a3d7 issue #1529:CCUserDefault work ok on Android 2013-03-11 16:45:20 +08:00
James Chen 2c7b178d7f fixed #1812: Minor fix. 2013-03-08 16:00:14 +08:00
James Chen aa53211f86 fixed #1812: A warning of getStringWithEllipsisJni function when compiling it with clang. 2013-03-08 15:56:17 +08:00
minggo dd8681b18b Merge pull request #2113 from minggo/refactor-ccuserdefault
Refactor ccuserdefault
2013-03-06 23:05:50 -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
minggo 7969224bf3 Merge pull request #2106 from waiter/master
Update unload effect function (android normal)
2013-03-05 22:45:10 -08:00
minggo 43dff78f4b Merge pull request #2102 from DarraghCoy/ios_custom_font_loading_fix
Fix for loading custom fonts on iOS when referenced from a CCB file
2013-03-05 22:42:13 -08:00
waiter e2119e1323 Merge pull request #1 from cocos2d/master
update cocos2d/cocos2d-x
2013-03-05 18:43:21 -08:00
waiter 7699c83bd8 update Cocos2dxSound.java for unload effect
when unload effect, sounID maybe null so the app will creash because of NPE.
2013-03-06 09:21:49 +08:00
Sam Clegg 4d0aa01c4b Fix all gcc warnings in NaCl build. 2013-03-05 17:01:40 -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
Darragh Coy f84a4e2e08 Code review changes for pull request #2102
We should only load the 'MarkerFelt-Wide' fallback font in 'CCImage.mm, _initWithString()' if the user is attempting to load a custom font, not when the user is attempting to load a system font. If the user is trying to load a system font then give back the default system font instead.
2013-03-04 22:24:28 -08:00
Darragh Coy df3c449b4f Fix for loading custom fonts on iOS when referenced from a CocosBuilder CCB file
Fix up how fonts are loaded in Cocos2dx for iOS to work transparently with custom font filenames/paths such as 'MyCustomFont.ttf' or 'fonts/MyCustomFont.ttf'. Referring to fonts by these paths would be OK on Android but can't be used on iOS since fonts must be referred to by family name on iOS; we must use 'MyCustomFont' when referring to that particular font in both examples on iOS. Hence add the code to strip out the folder path and extension on iOS so that the font path 'MyCustomFont.ttf' and 'fonts/MyCustomFont.ttf' can be used transparently across all platforms. This is required especially in the case where we have custom fonts being referenced from CCB files, since CCB files store the font names with the .ttf extension included.
2013-03-04 15:32:24 -08:00
minggo 96c5be91e3 Merge pull request #2076 from sbc100/cocos_nacl
Native Client port
2013-03-03 18:24:04 -08:00
James Chen 71589e68ee fixed #1760: Redefinition of cpufeatures module. 2013-03-04 10:08:02 +08:00