Skip to content

Commit

Permalink
Fixed issue #918. 2d projection + HighRes works OK
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Jul 9, 2010
1 parent 5383b1f commit 9850878
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Expand Up @@ -299,6 +299,8 @@ People/companies who were/are contributing code to cocos2d for iPhone (alphabeti
XCode only displays the libz dependency just once
added userData property in CocosNode
migrated all cocos2d code and all test to using the CC namespace
* sakamoto.kazuki:
2d projection works OK with HighRes. patch.
* samkass:
install_template.sh suports custom directory. patch.
install-template can be installed in user directory. patch.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,5 +1,6 @@
version 0.99.4 - xx-Jul-2010
. [FIX] CocosDenshion: fixed memory leak weak reallocing buffers (issue #919)
. [FIX] Director: 2d projection + HighRes works OK (issue #918)
. [FIX] EAGLView: removed unused 'delegate_' ivar
. [FIX] EAGLView: it is possible to resize the view (issue #914)
. [FIX] GLES-Render: solid objects' colors synced with box2d repository
Expand Down
3 changes: 2 additions & 1 deletion cocos2d/CCDirector.m
Expand Up @@ -328,9 +328,10 @@ -(void) setProjection:(ccDirectorProjection)projection
CGSize size = surfaceSize_;
switch (projection) {
case kCCDirectorProjection2D:
glViewport(0, 0, size.width, size.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(0, size.width, 0, size.height, -1000, 1000);
glOrthof(0, size.width, 0, size.height, -1024, 1024);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
break;
Expand Down
5 changes: 4 additions & 1 deletion tests/SpriteTest.m
Expand Up @@ -3091,7 +3091,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

// attach the openglView to the director
[director setOpenGLView:glView];


// 2D projection
// [director setProjection:kCCDirectorProjection2D];

// To use High-Res un comment the following line
// [director setContentScaleFactor:2];

Expand Down

0 comments on commit 9850878

Please sign in to comment.