summary refs log tree commit diff stats
path: root/libs/FontLabel/FontLabelStringDrawing.m
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-09-05 12:33:06 -0400
committerStarla Insigna <starla4444@gmail.com>2011-09-05 12:33:06 -0400
commit5af6401805f65a9b5968625d565613dd83edcfc7 (patch)
tree93a4ffda8838a5f1327a81b444ce3ea4c3f83c5e /libs/FontLabel/FontLabelStringDrawing.m
parentef9cab24b9ee3e25ab00d932fbab2f2a91476950 (diff)
downloadcartcollect-5af6401805f65a9b5968625d565613dd83edcfc7.tar.gz
cartcollect-5af6401805f65a9b5968625d565613dd83edcfc7.tar.bz2
cartcollect-5af6401805f65a9b5968625d565613dd83edcfc7.zip
Added default ledges to Jump
Previously, in Jump, when the game mode was created, one static ledge would always be generated safely under the player, and then when tick was first called, it would fill in the rest of the screen with ledges. While this did use to work fine, now that the game modes transition in, the player can see the ledges being added in when the transition ends so now there are two default ledges present when the level starts.

Refs #204
Diffstat (limited to 'libs/FontLabel/FontLabelStringDrawing.m')
0 files changed, 0 insertions, 0 deletions
olor: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * cocos2d for iPhone: http://www.cocos2d-iphone.org
 *
 * Copyright (c) 2009 On-Core
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */


#import "Platforms/CCGL.h"
#import "CCGrabber.h"
#import "ccMacros.h"
#import "CCTexture2D.h"
#import "Support/OpenGL_Internal.h"

@implementation CCGrabber

-(id) init
{
	if(( self = [super init] )) {
		// generate FBO
		ccglGenFramebuffers(1, &fbo);		
	}
	return self;
}

-(void)grab:(CCTexture2D*)texture
{
	glGetIntegerv(CC_GL_FRAMEBUFFER_BINDING, &oldFBO);
	
	// bind
	ccglBindFramebuffer(CC_GL_FRAMEBUFFER, fbo);

	// associate texture with FBO
	ccglFramebufferTexture2D(CC_GL_FRAMEBUFFER, CC_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.name, 0);
	
	// check if it worked (probably worth doing :) )
	GLuint status = ccglCheckFramebufferStatus(CC_GL_FRAMEBUFFER);
	if (status != CC_GL_FRAMEBUFFER_COMPLETE)
		[NSException raise:@"Frame Grabber" format:@"Could not attach texture to framebuffer"];
	
	ccglBindFramebuffer(CC_GL_FRAMEBUFFER, oldFBO);
}

-(void)beforeRender:(CCTexture2D*)texture
{
	glGetIntegerv(CC_GL_FRAMEBUFFER_BINDING, &oldFBO);
	ccglBindFramebuffer(CC_GL_FRAMEBUFFER, fbo);

	// BUG XXX: doesn't work with RGB565.


	glClearColor(0,0,0,0);
	
	// BUG #631: To fix #631, uncomment the lines with #631
	// Warning: But it CCGrabber won't work with 2 effects at the same time
//	glClearColor(0.0f,0.0f,0.0f,1.0f);	// #631
	
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	
	
//	glColorMask(TRUE, TRUE, TRUE, FALSE);	// #631

}

-(void)afterRender:(CCTexture2D*)texture
{
 	ccglBindFramebuffer(CC_GL_FRAMEBUFFER, oldFBO);
//	glColorMask(TRUE, TRUE, TRUE, TRUE);	// #631
}

- (void) dealloc
{
	CCLOGINFO(@"cocos2d: deallocing %@", self);
	ccglDeleteFramebuffers(1, &fbo);
	[super dealloc];
}

@end