Skip to content

Commit 87ef166

Browse files
committed
Merge branch 'develop-v3' of https://github.com/cocos2d/cocos2d-iphone into develop-v3
Former-commit-id: ce9c249
2 parents 7a67339 + b580f49 commit 87ef166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+806
-208
lines changed

AUTHORS

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ People and companies, who have contributed, in alphabetical order.
2424
* Apportable (http://www.apportable.com)
2525
Making it all happen
2626

27+
* Christian Enevoldsen
28+
Improved scroll view class
29+
2730
* Dominik Hadl
2831
Templates, scripts and other ninja stuff
2932

@@ -43,15 +46,18 @@ People and companies, who have contributed, in alphabetical order.
4346
CCPhysics
4447
Being the unstopable force
4548
An incredible number of contributions and suggestions
49+
3.1 render core
4650

4751
* Viktor Lidholt
4852
All UI classes
4953
Coordination and planning
5054
Sprite Builder integration
5155
Countless other contributions
5256

53-
Thanks to Wangsheng, Shintaro Kaneko, frranck and Yannick Loriot, for various minor contributions.
54-
Also thanks to those who contributed on git, and took part in the discussions (Ben-G mentioned, but no-one forgotten) even if their suggestions didn't make it to release.
57+
Thanks to Wangsheng, Shintaro Kaneko, frranck and Yannick Loriot, Magician, masanorythm, Jogn Vu for various minor contributions.
58+
Also thanks to all those who contributed on git, helped us testing, and took part in the discussions even if their suggestions didn't make it to release.
59+
60+
Special thanks to Ben-G from makegameswith.us, for making several outstanding V3 tutorials
5561

5662
cocos2d for iPhone 2.1 authors
5763
------------------------------

CHANGELOG.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ca561deefc0ea7927449584e141b54564d3f4571
1+
6e1cd46977a7946e62267dbe763d39393441b18a

RELEASE TODO.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
To release a new version, please check the following steps.
2+
3+
1)
4+
Update the file VERSION with latest version number.
5+
Add no CR/LF or any other formatting to the file.
6+
7+
2)
8+
Update install.sh
9+
Edit the line
10+
COCOS2D_VER="Cocos2D-v3.x.x”
11+
with the correct version number
12+
13+
3)
14+
Update cocos2d.m, with the correct version number
15+
16+
4)
17+
Add any new authors to the AUTHORS file
18+
19+
5)
20+
Add major changes and additions to the file RELEASE_NOTES
21+
22+
6)
23+
Tag the release, with the according version number
24+
25+
7)
26+
Currently two set of files are made available to the users, upon release
27+
a) A DMG, automating the install process
28+
b) a ZIP, allowing for manual install
29+
30+
Note:
31+
The file change log should be updated when git is merged.

RELEASE_NOTES

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
===== cocos2d for iPhone 2.1.0 Release Notes =====
1+
===== cocos2d for iPhone 3.0.0 Release Notes =====
22

3-
Please, see the online document:
4-
https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-v2.1-release-notes
3+
FIX Invalid time intervals for scheduled timers
4+
FIX Updated installer
5+
NEW Full support for 64 bit
6+
FIX Retina control
7+
FIX Adjustments to layouts
8+
FIX Changes to Z behaviour
9+
FIX Font sizing fixes
10+
NEW Sine actions
11+
FIX Portraid / landscape fixes
12+
NEW Improved scroll view
13+
NEW Betetr versioning
14+
NEW Better and more in depth tests
15+
NEW A lot of preparations for 3.1

cocos2d-ui-tests/tests/CCRendererTest.m

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,56 @@
44
@interface CCRendererTest : TestBase @end
55
@implementation CCRendererTest
66

7+
-(void)renderTextureHelper:(CCNode *)stage size:(CGSize)size
8+
{
9+
CCColor *color = [CCColor colorWithRed:0.0 green:0.0 blue:0.5 alpha:0.5];
10+
CCNode *node = [CCNodeColor nodeWithColor:color width:128 height:128];
11+
[stage addChild:node];
12+
13+
CCNodeColor *colorNode = [CCNodeColor nodeWithColor:[CCColor greenColor] width:32 height:32];
14+
colorNode.anchorPoint = ccp(0.5, 0.5);
15+
colorNode.position = ccp(size.width, 0);
16+
[colorNode runAction:[CCActionRepeatForever actionWithAction:[CCActionSequence actions:
17+
[CCActionMoveTo actionWithDuration:1.0 position:ccp(0, size.height)],
18+
[CCActionMoveTo actionWithDuration:1.0 position:ccp(size.width, 0)],
19+
nil
20+
]]];
21+
[node addChild:colorNode];
22+
23+
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Sprites/bird.png"];
24+
sprite.opacity = 0.5;
25+
[sprite runAction:[CCActionRepeatForever actionWithAction:[CCActionSequence actions:
26+
[CCActionMoveTo actionWithDuration:1.0 position:ccp(size.width, size.height)],
27+
[CCActionMoveTo actionWithDuration:1.0 position:ccp(0, 0)],
28+
nil
29+
]]];
30+
[node addChild:sprite];
31+
}
32+
33+
-(void)setupRenderTextureTest
34+
{
35+
self.subTitle = @"Testing CCRenderTexture.";
36+
37+
CGSize size = CGSizeMake(128, 128);
38+
39+
CCNode *stage = [CCNode node];
40+
stage.contentSize = size;
41+
stage.anchorPoint = ccp(0.5, 0.5);
42+
stage.positionType = CCPositionTypeNormalized;
43+
stage.position = ccp(0.25, 0.5);
44+
[self.contentNode addChild:stage];
45+
46+
[self renderTextureHelper:stage size:size];
47+
48+
CCRenderTexture *renderTexture = [CCRenderTexture renderTextureWithWidth:size.width height:size.height pixelFormat:CCTexturePixelFormat_RGBA8888];
49+
renderTexture.positionType = CCPositionTypeNormalized;
50+
renderTexture.position = ccp(0.75, 0.5);
51+
[self.contentNode addChild:renderTexture];
52+
53+
[self renderTextureHelper:renderTexture size:size];
54+
renderTexture.autoDraw = YES;
55+
}
56+
757
- (void)setupMotionStreakNodeTest
858
{
959
self.subTitle = @"Testing CCMotionStreak";

cocos2d/CCDirector.m

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,29 @@ -(CGSize)viewSizeInPixels
444444
return _winSizeInPixels;
445445
}
446446

447+
-(CGRect)viewportRect
448+
{
449+
// TODO It's _possible_ that a user will use a non-axis aligned projection. Weird, but possible.
450+
kmMat4 projection;
451+
kmGLGetMatrix(KM_GL_PROJECTION, &projection);
452+
453+
kmMat4 projectionInv;
454+
kmMat4Inverse(&projectionInv, &projection);
455+
456+
// Calculate z=0 using -> transform*[0, 0, 0, 1]/w
457+
kmScalar zClip = projection.mat[14]/projection.mat[15];
458+
459+
// Bottom left and top right coordinates of viewport in clip coords.
460+
kmVec3 clipBL = {-1.0, -1.0, zClip};
461+
kmVec3 clipTR = { 1.0, 1.0, zClip};
462+
463+
kmVec3 glBL, glTR;
464+
kmVec3TransformCoord(&glBL, &clipBL, &projectionInv);
465+
kmVec3TransformCoord(&glTR, &clipTR, &projectionInv);
466+
467+
return CGRectMake(glBL.x, glBL.y, glTR.x - glBL.x, glTR.y - glBL.y);
468+
}
469+
447470
-(CGSize)designSize
448471
{
449472
// Return the viewSize unless designSize has been set.

cocos2d/CCDirector_Private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
*/
4747
@property (nonatomic,readwrite,strong) CCActionManager *actionManager;
4848

49+
/// Rect of the visible screen area in GL coordinates.
50+
@property(nonatomic, readonly) CGRect viewportRect;
51+
4952
/* Sets the glViewport*/
5053
-(void) setViewport;
5154

cocos2d/CCTransition.m

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ - (id)initWithDuration:(NSTimeInterval)duration
112112
_outgoingOverIncoming = NO;
113113

114114
// find out where the outgoing scene will end (if it is a transition with movement)
115-
CGSize size = [CCDirector sharedDirector].designSize;
115+
CGSize size = [CCDirector sharedDirector].viewportRect.size;
116116
switch (direction) {
117117
case CCTransitionDirectionDown: _outgoingDestination = CGPointMake(0, -size.height); break;
118118
case CCTransitionDirectionLeft: _outgoingDestination = CGPointMake(-size.width, 0); break;
@@ -188,21 +188,25 @@ - (void)startTransition:(CCScene *)scene
188188

189189
// create render textures
190190
// get viewport size
191-
CGSize size = [CCDirector sharedDirector].designSize;
191+
CGRect rect = [CCDirector sharedDirector].viewportRect;
192+
193+
// Make sure we aren't rounding down.
194+
rect.size.width = ceil(rect.size.width);
195+
rect.size.height = ceil(rect.size.height);
192196

193197
// create texture for outgoing scene
194-
_outgoingTexture = [CCRenderTexture renderTextureWithWidth:size.width / _outgoingDownScale
195-
height:size.height / _outgoingDownScale
198+
_outgoingTexture = [CCRenderTexture renderTextureWithWidth:rect.size.width / _outgoingDownScale
199+
height:rect.size.height / _outgoingDownScale
196200
pixelFormat:_transitionPixelFormat];
197-
_outgoingTexture.position = CGPointMake(size.width * 0.5f, size.height * 0.5f);
201+
_outgoingTexture.position = CGPointMake(rect.size.width * 0.5f + rect.origin.x, rect.size.height * 0.5f + rect.origin.y);
198202
_outgoingTexture.scale = _outgoingDownScale;
199203
[self addChild:_outgoingTexture z:_outgoingOverIncoming];
200204

201205
// create texture for incoming scene
202-
_incomingTexture = [CCRenderTexture renderTextureWithWidth:size.width / _incomingDownScale
203-
height:size.height / _incomingDownScale
206+
_incomingTexture = [CCRenderTexture renderTextureWithWidth:rect.size.width / _incomingDownScale
207+
height:rect.size.height / _incomingDownScale
204208
pixelFormat:_transitionPixelFormat];
205-
_incomingTexture.position = CGPointMake(size.width * 0.5f, size.height * 0.5f);
209+
_incomingTexture.position = CGPointMake(rect.size.width * 0.5f + rect.origin.x, rect.size.height * 0.5f + rect.origin.y);
206210
_incomingTexture.scale = _incomingDownScale;
207211
[self addChild:_incomingTexture];
208212

cocos2d/cocos2d.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#import <Foundation/Foundation.h>
2929
#import "cocos2d.h"
30-
const char *cocos2d_version = "cocos2d-iphone version 3.0.alpha";
30+
const char *cocos2d_version = "Cocos2D-iPhone version 3.0.0";
3131

3232
NSString *cocos2dVersion()
3333
{

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Variables setup
1414
# ----------------------------------------------------
1515
SCRIPT_VER="v0.9.5"
16-
COCOS2D_VER="Cocos2D-v3.0.0.RC.2"
16+
COCOS2D_VER="Cocos2D-v3.0.0"
1717
COCOS2D_DST_DIR="cocos2d v3.x"
1818
SCRIPT_DIR="$(dirname $0)"
1919

0 commit comments

Comments
 (0)