Added Box2D

This commit is contained in:
Julian Nießner
2018-05-06 12:43:20 +02:00
parent cb5469bb89
commit d175d433a8
351 changed files with 123545 additions and 1 deletions

View File

@@ -0,0 +1,75 @@
//
// TestEntriesViewController.m
// Box2D
//
// Box2D iPhone port by Simon Oliver - http://www.simonoliver.com - http://www.handcircus.com
//
#import "TestEntriesViewController.h"
@implementation TestEntriesViewController
@synthesize delegate=_delegate;
- (id)initWithStyle:(UITableViewStyle)style {
if (self = [super initWithStyle:style]) {
testCount = 0;
TestEntry* e = g_testEntries;
while (e->createFcn)
{
++testCount;
++e;
}
}
return self;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
#pragma mark Table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return testCount;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
TestEntry* e = g_testEntries;
e+=indexPath.row;
cell.textLabel.text = [NSString stringWithUTF8String:e->name];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[_delegate selectTest:indexPath.row];
}
- (void)dealloc {
[super dealloc];
}
@end