This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) draw:(CCRenderer *)renderer transform:(const GLKMatrix4 *)transform | |
{ | |
// Drawing the triangle fan. Simple explanation of how a triangle fan is drawn: | |
// http://stackoverflow.com/questions/8043923/gl-triangle-fan-explanation | |
// in a triangle fan the first 3 vertices form one triangle, then each additional vertex forms another triangle | |
// thus number of triangles is number of vertices minus the initial 2 vertices for the first triangle | |
int numTriangles = _numVertices - 2; | |
CCRenderBuffer buffer = [renderer enqueueTriangles:numTriangles | |
andVertexes:_numVertices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Scrolls to the coordinate (in points) instantly. */ | |
-(void) scrollToPosition:(CGPoint)position; | |
/** Scrolls to a tile coordinate instantly. */ | |
-(void) scrollToTileCoordinate:(CGPoint)tileCoord; | |
/** Scrolls by a certain distance (in points) instantly. */ | |
-(void) scrollByPointOffset:(CGPoint)pointOffset; | |
/** Scrolls by a certain distance (in tile coordinates) instantly. */ | |
-(void) scrollByTileOffset:(CGPoint)tileOffset; | |
/** Scrolls to the coordinate (in points) with a given duration (in seconds). */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum : unsigned char | |
{ | |
KTTilemapOrientationOrthogonal, | |
KTTilemapOrientationIsometric, | |
KTTilemapOrientationHexagonal, | |
} KTTilemapOrientation; | |
/** Represents a Tilemap. The tilemap is usually created from a TMX file via the parseTMXFile method. */ | |
@interface KTTilemap : NSObject <NSXMLParserDelegate, NSCoding> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Defines the messages a delegate can implement to handle (multi) touch events. | |
Simply implement one or more of the KTTouchDelegate protocol messages and register with KTMultiTouchController. | |
To work with multiple touches iterate over multiTouchEvent.touchEvents. You can also get all touches from uiEvent: | |
NSSet* touches = [multiTouchEvent.uiEvent allTouches]; | |
*/ | |
@protocol KTMultiTouchProtocol <NSObject> | |
@optional | |
/** One or more touches began. The KTMultiTouchEvent contains an array with all active touches. */ | |
-(void) touchesBeganWithEvent:(KTMultiTouchEvent*)multiTouchEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Actions act on (influence, change properties, etc.) a specific model. The defining property of actions is that whatever | |
they're supposed to do eventually ends, which will remove the action from the model automatically. For example moving the | |
model to a specific location - upon arrival at the destination the action removes itself from the model and its memory is released. | |
Note: KoboldTouch actions are quite similar to CCAction* classes. The most notable difference is that they act on KTEntityModel | |
objects, never on views directly, to conform to the MVC programming model. | |
Caution: It is illegal to re-run the same action on the same or a different model object while the action is running. You can | |
however re-run the action after it has been stopped. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Similar to NSNumber, but allows numbers to be modified (hence: mutable). It does not inherit NSNumber, the implementation | |
is lightweight and encapsulates various classes like KTBoolNumber, KTInt32Number, KTDoubleNumber and so on each containing only | |
a single property of the given data type. This is what makes NSMutableNumber numbers mutable, they're regular properties of objects | |
encapsulating integral data types. | |
Once a concrete subclass of KTMutableNumber has been created using one of the initializers, the type of that number is set and can | |
not be changed. For example, if you assign a BOOL value to a float number, the BOOL value will be cast to float. Likewise if you | |
access the charValue property of a number whose type is float, the returned value will be cast from float to char before it is returned. | |
*/ | |
@interface KTMutableNumber : NSObject <NSCoding> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set menu options with the initializer object | |
KTTextMenu* textMenu = [KTTextMenu menuWithTextMenuItems:[NSArray arrayWithObjects:item1, item2, nil]]; | |
textMenu.fontName = @"Arial"; | |
textMenu.fontSize = 48; | |
textMenu.padding = 16; | |
// init the menu with the initializer object | |
KTMenuViewController* menuViewController = [KTMenuViewController menuControllerWithTextMenu:textMenu]; | |
[self addSubController:menuViewController]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool foo(char* p1, int* p2) | |
{ | |
// local variable declaration | |
bool bRet = false; // init all local variables here, assume everything is wrong | |
int* ptr = NULL; | |
PROFILER_START(); | |
// check input params | |
if (p1 && p2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.4.1 (229) | |
# | |
# Alignment | |
# --------- | |
## Alignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PhysicsCollisionSceneViewController.m | |
// _Feature-Demo-Template_ | |
// | |
// Created by Steffen Itterheim on 01.05.13. | |
// Copyright 2013 __MyCompanyName__. All rights reserved. | |
// | |
#import "PhysicsCollisionSceneViewController.h" |
OlderNewer