diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..36de7ba --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..4c7a50f --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + EngineWrapper + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..cd9d963 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + diff --git a/Template.exe b/Template.exe new file mode 100644 index 0000000..cdda72c Binary files /dev/null and b/Template.exe differ diff --git a/assets/console_bkg.bmp b/assets/console_bkg.bmp new file mode 100644 index 0000000..d32ee4c Binary files /dev/null and b/assets/console_bkg.bmp differ diff --git a/assets/droid_sans14_font_bitmap.bmp32 b/assets/droid_sans14_font_bitmap.bmp32 new file mode 100644 index 0000000..b9f2b1f Binary files /dev/null and b/assets/droid_sans14_font_bitmap.bmp32 differ diff --git a/assets/droid_sans14_font_charmap.txt b/assets/droid_sans14_font_charmap.txt new file mode 100644 index 0000000..f17cd0b --- /dev/null +++ b/assets/droid_sans14_font_charmap.txt @@ -0,0 +1,95 @@ +32 0.00976562 0.0195312 0 0.0546875 0 0 0.0078125 +49 0.0195312 0.0195312 0.00390625 0.015625 0.0078125 0.0390625 0.015625 +50 0.0371094 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625 +51 0.0605469 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +52 0.0820312 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625 +53 0.105469 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +54 0.126953 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +55 0.148438 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +56 0.169922 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +57 0.191406 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +48 0.212891 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +97 0.234375 0.0195312 0.00195312 0.0234375 0.00976562 0.03125 0.0136719 +98 0.253906 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625 +99 0.275391 0.0195312 0.00195312 0.0234375 0.00976562 0.03125 0.0136719 +100 0.294922 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625 +101 0.316406 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625 +102 0.337891 0.0195312 0 0.0117188 0.00976562 0.0429688 0.0078125 +103 0.357422 0.0195312 0.00195312 0.0234375 0.0136719 0.0429688 0.0136719 +104 0.380859 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625 +105 0.402344 0.0195312 0 0.0117188 0.00585938 0.0429688 0.0078125 +106 0.417969 0.0195312 -0.00195312 0.0117188 0.0078125 0.0546875 0.0078125 +107 0.435547 0.0195312 0.00195312 0.0117188 0.0136719 0.0429688 0.0136719 +108 0.458984 0.0195312 0.00195312 0.0117188 0.00390625 0.0429688 0.0078125 +109 0.472656 0.0195312 0.00195312 0.0234375 0.0214844 0.03125 0.0253906 +110 0.503906 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625 +111 0.525391 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625 +112 0.546875 0.0195312 0.00195312 0.0234375 0.0117188 0.0429688 0.015625 +113 0.568359 0.0195312 0.00195312 0.0234375 0.0117188 0.0429688 0.015625 +114 0.589844 0.0195312 0.00195312 0.0234375 0.0078125 0.03125 0.00976562 +115 0.607422 0.0195312 0 0.0234375 0.0117188 0.03125 0.0136719 +116 0.628906 0.0195312 0 0.015625 0.00976562 0.0390625 0.00976562 +117 0.648438 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625 +118 0.669922 0.0195312 -0.00195312 0.0234375 0.0175781 0.03125 0.0136719 +119 0.697266 0.0195312 -0.00195312 0.0234375 0.0234375 0.03125 0.0195312 +120 0.730469 0.0195312 0 0.0234375 0.0136719 0.03125 0.0136719 +121 0.753906 0.0195312 -0.00195312 0.0234375 0.0175781 0.0429688 0.0136719 +122 0.78125 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.0136719 +65 0.802734 0.0195312 -0.00195312 0.015625 0.0214844 0.0390625 0.0175781 +66 0.833984 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.0175781 +67 0.857422 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625 +68 0.880859 0.0195312 0.00195312 0.015625 0.015625 0.0390625 0.0195312 +69 0.90625 0.0195312 0.00195312 0.015625 0.00976562 0.0390625 0.0136719 +70 0.925781 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.0136719 +71 0.947266 0.0195312 0.00195312 0.015625 0.015625 0.0390625 0.0195312 +72 0.00976562 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312 +73 0.0351562 0.09375 0 0.015625 0.00976562 0.0390625 0.00976562 +74 0.0546875 0.09375 -0.00390625 0.015625 0.00976562 0.0507812 0.00585938 +75 0.0742188 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.015625 +76 0.0996094 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.0136719 +77 0.121094 0.09375 0.00195312 0.015625 0.0195312 0.0390625 0.0234375 +78 0.150391 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312 +79 0.175781 0.09375 0.00195312 0.015625 0.0175781 0.0390625 0.0214844 +80 0.203125 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +81 0.224609 0.09375 0.00195312 0.015625 0.0175781 0.046875 0.0214844 +82 0.251953 0.09375 0.00195312 0.015625 0.0136719 0.0390625 0.015625 +83 0.275391 0.09375 0 0.015625 0.0136719 0.0390625 0.0136719 +84 0.298828 0.09375 0 0.015625 0.0136719 0.0390625 0.0136719 +85 0.322266 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312 +86 0.347656 0.09375 -0.00195312 0.015625 0.0195312 0.0390625 0.015625 +87 0.376953 0.09375 -0.00195312 0.015625 0.0292969 0.0390625 0.0253906 +88 0.416016 0.09375 -0.00195312 0.015625 0.0195312 0.0390625 0.015625 +89 0.445312 0.09375 -0.00195312 0.015625 0.0175781 0.0390625 0.0136719 +90 0.472656 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.015625 +46 0.494141 0.09375 0.00195312 0.046875 0.00390625 0.0078125 0.0078125 +44 0.507812 0.09375 0.00195312 0.046875 0.00390625 0.0117188 0.0078125 +58 0.521484 0.09375 0.00195312 0.0234375 0.00390625 0.03125 0.0078125 +59 0.535156 0.09375 0.00195312 0.0234375 0.00390625 0.0351562 0.0078125 +64 0.548828 0.09375 0.00195312 0.015625 0.0195312 0.0429688 0.0234375 +35 0.578125 0.09375 0 0.015625 0.015625 0.0390625 0.0175781 +36 0.603516 0.09375 0.00195312 0.0117188 0.0117188 0.046875 0.015625 +37 0.625 0.09375 0.00195312 0.015625 0.0195312 0.0390625 0.0234375 +94 0.654297 0.09375 0 0.015625 0.0136719 0.0234375 0.0136719 +38 0.677734 0.09375 0.00195312 0.015625 0.0175781 0.0390625 0.0195312 +42 0.705078 0.09375 0 0.0117188 0.0136719 0.0234375 0.015625 +33 0.728516 0.09375 0.00195312 0.015625 0.00390625 0.0390625 0.0078125 +63 0.742188 0.09375 0 0.015625 0.00976562 0.0390625 0.0117188 +40 0.761719 0.09375 0.00195312 0.015625 0.0078125 0.046875 0.0078125 +41 0.779297 0.09375 0 0.015625 0.00585938 0.046875 0.0078125 +91 0.794922 0.09375 0.00195312 0.015625 0.00585938 0.046875 0.0078125 +93 0.810547 0.09375 0 0.015625 0.00585938 0.046875 0.0078125 +123 0.826172 0.09375 0 0.015625 0.00976562 0.046875 0.00976562 +125 0.845703 0.09375 0 0.015625 0.00976562 0.046875 0.00976562 +60 0.865234 0.09375 0.00195312 0.0234375 0.0117188 0.0273438 0.015625 +62 0.886719 0.09375 0.00195312 0.0234375 0.0117188 0.0273438 0.015625 +95 0.908203 0.09375 0 0.0585938 0.0117188 0.00390625 0.0117188 +45 0.929688 0.09375 0.00195312 0.0390625 0.00585938 0.0078125 0.00976562 +43 0.945312 0.09375 0 0.0234375 0.0136719 0.0273438 0.015625 +61 0.00976562 0.167969 0 0.0273438 0.0136719 0.0195312 0.015625 +124 0.0332031 0.167969 0.00585938 0.0117188 0.00390625 0.0546875 0.0136719 +92 0.046875 0.167969 -0.00195312 0.015625 0.0136719 0.0390625 0.00976562 +47 0.0703125 0.167969 -0.00195312 0.015625 0.0136719 0.0390625 0.00976562 +126 0.09375 0.167969 0.00195312 0.03125 0.0117188 0.0117188 0.015625 +96 0.115234 0.167969 0.00585938 0.0117188 0.00585938 0.0078125 0.015625 +34 0.130859 0.167969 0.00195312 0.015625 0.00976562 0.015625 0.0117188 +39 0.150391 0.167969 0.00195312 0.015625 0.00390625 0.015625 0.00585938 \ No newline at end of file diff --git a/assets/fire.png b/assets/fire.png new file mode 100644 index 0000000..feafad1 Binary files /dev/null and b/assets/fire.png differ diff --git a/assets/gui_transparent.fragment b/assets/gui_transparent.fragment new file mode 100644 index 0000000..fb7c2a6 --- /dev/null +++ b/assets/gui_transparent.fragment @@ -0,0 +1,10 @@ +precision highp float; + +uniform sampler2D Texture; +varying vec2 texCoord; + +void main() +{ + vec4 texColor = texture2D(Texture,texCoord).rgba; + gl_FragColor = vec4(texColor.rgb, texColor.a); +} diff --git a/assets/gui_transparent.vertex b/assets/gui_transparent.vertex new file mode 100644 index 0000000..ad425c2 --- /dev/null +++ b/assets/gui_transparent.vertex @@ -0,0 +1,11 @@ +attribute vec3 vPosition; +attribute vec2 vTexCoord; +varying vec2 texCoord; +uniform mat4 ProjectionMatrix; + +void main() +{ + //480x320 + gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0); + texCoord = vTexCoord; +} \ No newline at end of file diff --git a/assets/ship.png b/assets/ship.png new file mode 100644 index 0000000..12a603d Binary files /dev/null and b/assets/ship.png differ diff --git a/assets/space_dn.jpg b/assets/space_dn.jpg new file mode 100644 index 0000000..e717da8 Binary files /dev/null and b/assets/space_dn.jpg differ diff --git a/assets/stone.png b/assets/stone.png new file mode 100644 index 0000000..2286742 Binary files /dev/null and b/assets/stone.png differ diff --git a/assets/textures.xml b/assets/textures.xml new file mode 100644 index 0000000..b8c9571 --- /dev/null +++ b/assets/textures.xml @@ -0,0 +1,18 @@ + + + ship.png + shipTexture + + + fire.png + fireTexture + + + stone.png + asteroidTexture + + + space_dn.jpg + backgroundTexture + + \ No newline at end of file diff --git a/default.properties b/default.properties new file mode 100644 index 0000000..94a5300 --- /dev/null +++ b/default.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 diff --git a/iOS/AppDelegate.h b/iOS/AppDelegate.h new file mode 100644 index 0000000..4237984 --- /dev/null +++ b/iOS/AppDelegate.h @@ -0,0 +1,19 @@ +// +// AppDelegate.h +// doublehitballs +// +// Created by vvv ооо on 13.07.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import + +@class ViewController; + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (strong, nonatomic) ViewController *viewController; + +@end diff --git a/iOS/AppDelegate.m b/iOS/AppDelegate.m new file mode 100644 index 0000000..1283115 --- /dev/null +++ b/iOS/AppDelegate.m @@ -0,0 +1,59 @@ +// +// AppDelegate.m +// doublehitballs +// +// Created by vvv ооо on 13.07.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "AppDelegate.h" + +#import "ViewController.h" + +@implementation AppDelegate + +@synthesize window = _window; +@synthesize viewController = _viewController; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil]; + } else { + self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil]; + } + self.window.rootViewController = self.viewController; + [self.window makeKeyAndVisible]; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/iOS/CustomGLKView.h b/iOS/CustomGLKView.h new file mode 100644 index 0000000..77acd11 --- /dev/null +++ b/iOS/CustomGLKView.h @@ -0,0 +1,13 @@ +// +// CustomGLKView.h +// doublehitballs +// +// Created by vvv ооо on 15.07.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "include/Utils/IosApi/ObjC/GLKViewTemplate.h" + +@interface CustomGLKView : GLKViewTemplate + +@end diff --git a/iOS/CustomGLKView.mm b/iOS/CustomGLKView.mm new file mode 100644 index 0000000..a7fca3c --- /dev/null +++ b/iOS/CustomGLKView.mm @@ -0,0 +1,5 @@ +#import "CustomGLKView.h" + +@implementation CustomGLKView + +@end \ No newline at end of file diff --git a/iOS/ViewController.h b/iOS/ViewController.h new file mode 100644 index 0000000..38eb6ac --- /dev/null +++ b/iOS/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// doublehitballs +// +// Created by vvv ооо on 13.07.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + + +#import "include/Utils/IosApi/ObjC/ViewControllerTemplate.h" + +@interface ViewController : ViewControllerTemplate + +@end + diff --git a/iOS/ViewController.mm b/iOS/ViewController.mm new file mode 100644 index 0000000..01d3732 --- /dev/null +++ b/iOS/ViewController.mm @@ -0,0 +1,20 @@ +#import "ViewController.h" +#import "ios_api.h" + + +@implementation ViewController + + +- (void) appInitCaller +{ + CustomAppInit(); +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return UIInterfaceOrientationIsLandscape(interfaceOrientation); +} + + + +@end \ No newline at end of file diff --git a/iOS/en.lproj/InfoPlist.strings b/iOS/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..0f167df --- /dev/null +++ b/iOS/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/iOS/en.lproj/ViewController_iPad.xib b/iOS/en.lproj/ViewController_iPad.xib new file mode 100644 index 0000000..eb81e88 --- /dev/null +++ b/iOS/en.lproj/ViewController_iPad.xib @@ -0,0 +1,133 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBProxyObject + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 274 + {{0, 20}, {768, 1004}} + + + + 3 + MQA + + 2 + + + + 2 + + IBIPadFramework + + + + + + + view + + + + 3 + + + + + + 0 + + + + + + 1 + + + + + -1 + + + File's Owner + + + -2 + + + + + + + ViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + CustomGLKView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 3 + + + + + CustomGLKView + GLKView + + IBProjectSource + ./Classes/CustomGLKView.h + + + + ViewController + GLKViewController + + IBProjectSource + ./Classes/ViewController.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + 1181 + + diff --git a/iOS/en.lproj/ViewController_iPhone.xib b/iOS/en.lproj/ViewController_iPhone.xib new file mode 100644 index 0000000..96a4a92 --- /dev/null +++ b/iOS/en.lproj/ViewController_iPhone.xib @@ -0,0 +1,111 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBProxyObject + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + {320, 460} + + + 3 + MQA + + 2 + + + NO + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + ViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + CustomGLKView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 4 + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + 1181 + + diff --git a/iOS/ios_api.cpp b/iOS/ios_api.cpp new file mode 100644 index 0000000..06649a4 --- /dev/null +++ b/iOS/ios_api.cpp @@ -0,0 +1,8 @@ +#include "include/Engine.h" +#include "main_code.h" + + +void CustomAppInit() +{ + AppInit(480, 320); +} diff --git a/iOS/ios_api.h b/iOS/ios_api.h new file mode 100644 index 0000000..c33973e --- /dev/null +++ b/iOS/ios_api.h @@ -0,0 +1,3 @@ + + +void CustomAppInit(); \ No newline at end of file diff --git a/iOS/main.m b/iOS/main.m new file mode 100644 index 0000000..f8b2c00 --- /dev/null +++ b/iOS/main.m @@ -0,0 +1,18 @@ +// +// main.m +// doublehitballs +// +// Created by vvv ооо on 13.07.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/iOS/res/Icon.png b/iOS/res/Icon.png new file mode 100644 index 0000000..b6880bf Binary files /dev/null and b/iOS/res/Icon.png differ diff --git a/iOS/res/Splash-landscape.png b/iOS/res/Splash-landscape.png new file mode 100644 index 0000000..61dbcaa Binary files /dev/null and b/iOS/res/Splash-landscape.png differ diff --git a/iOS/res/iTunesArtwork b/iOS/res/iTunesArtwork new file mode 100644 index 0000000..876e97d Binary files /dev/null and b/iOS/res/iTunesArtwork differ diff --git a/iOS/salmontemplate.xcodeproj/project.pbxproj b/iOS/salmontemplate.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3d6aa00 --- /dev/null +++ b/iOS/salmontemplate.xcodeproj/project.pbxproj @@ -0,0 +1,500 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4C49B2BE15B0991B003512CD /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C49B2BD15B0991B003512CD /* UIKit.framework */; }; + 4C49B2C015B0991B003512CD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C49B2BF15B0991B003512CD /* Foundation.framework */; }; + 4C49B2C215B0991B003512CD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C49B2C115B0991B003512CD /* CoreGraphics.framework */; }; + 4C49B2C415B0991B003512CD /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C49B2C315B0991B003512CD /* GLKit.framework */; }; + 4C49B2C615B0991B003512CD /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C49B2C515B0991B003512CD /* OpenGLES.framework */; }; + 4C49B2CC15B0991B003512CD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C49B2CA15B0991B003512CD /* InfoPlist.strings */; }; + 4C49B2CE15B0991B003512CD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C49B2CD15B0991B003512CD /* main.m */; }; + 4C49B2D215B0991B003512CD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C49B2D115B0991B003512CD /* AppDelegate.m */; }; + 4C49B2D915B0991B003512CD /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C49B2D815B0991B003512CD /* ViewController.mm */; }; + 4C49B2DC15B0991B003512CD /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C49B2DA15B0991B003512CD /* ViewController_iPhone.xib */; }; + 4C49B2DF15B0991B003512CD /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C49B2DD15B0991B003512CD /* ViewController_iPad.xib */; }; + 4C4C807515BA8F460037C6CE /* libsquirrel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C4C807415BA8F460037C6CE /* libsquirrel.a */; }; + 4C4C807715BA8F5B0037C6CE /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C4C807615BA8F5B0037C6CE /* libz.a */; }; + 4C6EB44515C3CFD300316CB6 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6EB44415C3CFD300316CB6 /* libpng.a */; }; + 4C74848615C5AD6E0056EC44 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C74848315C5AD6E0056EC44 /* Icon.png */; }; + 4C74848715C5AD6E0056EC44 /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = 4C74848415C5AD6E0056EC44 /* iTunesArtwork */; }; + 4C74848815C5AD6E0056EC44 /* Splash-landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C74848515C5AD6E0056EC44 /* Splash-landscape.png */; }; + 4C74849815C5AF7C0056EC44 /* main_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C74849615C5AF7C0056EC44 /* main_code.cpp */; }; + 4C77831315BABD68003D5142 /* libvorbis-tremor-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77831215BABD68003D5142 /* libvorbis-tremor-ios.a */; }; + 4C77831815BABE26003D5142 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77831415BABD8B003D5142 /* AudioToolbox.framework */; }; + 4C77831915BABE26003D5142 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77831515BABD8B003D5142 /* OpenAL.framework */; }; + 4C7AD44C15B1D77700A599F6 /* ios_api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7AD44B15B1D77700A599F6 /* ios_api.cpp */; }; + 4C7C584B15C31E6500CAE4F4 /* libboost.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7C584A15C31E6500CAE4F4 /* libboost.a */; }; + 4CC971AC15C57DCE00359A2B /* libSalmon Engine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C902A7815C5735700FBC901 /* libSalmon Engine.a */; }; + 4CCC0ECC15B30D6B005432FB /* CustomGLKView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4CCC0ECB15B30D6B005432FB /* CustomGLKView.mm */; }; + 4CE6A9D215B2F979006A3965 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 4CE6A9D115B2F979006A3965 /* assets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 4C902A7715C5735700FBC901 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4C8CE90215B0A0F400078175; + remoteInfo = "Salmon Engine"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 4C49B2B915B0991B003512CD /* salmontemplate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = salmontemplate.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4C49B2BD15B0991B003512CD /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 4C49B2BF15B0991B003512CD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 4C49B2C115B0991B003512CD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 4C49B2C315B0991B003512CD /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + 4C49B2C515B0991B003512CD /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 4C49B2C915B0991B003512CD /* template-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "template-Info.plist"; sourceTree = ""; }; + 4C49B2CB15B0991B003512CD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 4C49B2CD15B0991B003512CD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4C49B2CF15B0991B003512CD /* template-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "template-Prefix.pch"; sourceTree = ""; }; + 4C49B2D015B0991B003512CD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 4C49B2D115B0991B003512CD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 4C49B2D715B0991B003512CD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 4C49B2D815B0991B003512CD /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; }; + 4C49B2DB15B0991B003512CD /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = ""; }; + 4C49B2DE15B0991B003512CD /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPad.xib; sourceTree = ""; }; + 4C4C807415BA8F460037C6CE /* libsquirrel.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsquirrel.a; path = "../../libs/SQUIRREL2_1_1_sqplus/build-ios/ios-device/libsquirrel.a"; sourceTree = ""; }; + 4C4C807615BA8F5B0037C6CE /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libz.a; path = "../../libs/zlib-1.2.7/build-ios/ios-device/libz.a"; sourceTree = ""; }; + 4C6EB44415C3CFD300316CB6 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../../libs/libpng-1.5.12/build-ios/ios-simulator/libpng.a"; sourceTree = ""; }; + 4C74848315C5AD6E0056EC44 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = res/Icon.png; sourceTree = ""; }; + 4C74848415C5AD6E0056EC44 /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = file; name = iTunesArtwork; path = res/iTunesArtwork; sourceTree = ""; }; + 4C74848515C5AD6E0056EC44 /* Splash-landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Splash-landscape.png"; path = "res/Splash-landscape.png"; sourceTree = ""; }; + 4C74849615C5AF7C0056EC44 /* main_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main_code.cpp; path = ../jni/main_code.cpp; sourceTree = ""; }; + 4C74849715C5AF7C0056EC44 /* main_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = main_code.h; path = ../jni/main_code.h; sourceTree = ""; }; + 4C77831215BABD68003D5142 /* libvorbis-tremor-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libvorbis-tremor-ios.a"; path = "../../libs/vorbis-tremor-ios/build-ios/ios-device/libvorbis-tremor-ios.a"; sourceTree = ""; }; + 4C77831415BABD8B003D5142 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 4C77831515BABD8B003D5142 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + 4C7AD44B15B1D77700A599F6 /* ios_api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ios_api.cpp; sourceTree = ""; }; + 4C7C584A15C31E6500CAE4F4 /* libboost.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost.a; path = "../../libs/boost_1_47_0/build-ios/ios-simulator/libboost.a"; sourceTree = ""; }; + 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Salmon Engine.xcodeproj"; path = "../../Engine/iOS/Salmon Engine/Salmon Engine.xcodeproj"; sourceTree = ""; }; + 4CCC0ECA15B30D6A005432FB /* CustomGLKView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomGLKView.h; sourceTree = ""; }; + 4CCC0ECB15B30D6B005432FB /* CustomGLKView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CustomGLKView.mm; sourceTree = ""; }; + 4CCC0ECD15B310FB005432FB /* ios_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ios_api.h; sourceTree = ""; }; + 4CE6A9D115B2F979006A3965 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../assets; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4C49B2B615B0991B003512CD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CC971AC15C57DCE00359A2B /* libSalmon Engine.a in Frameworks */, + 4C77831815BABE26003D5142 /* AudioToolbox.framework in Frameworks */, + 4C77831915BABE26003D5142 /* OpenAL.framework in Frameworks */, + 4C49B2BE15B0991B003512CD /* UIKit.framework in Frameworks */, + 4C49B2C015B0991B003512CD /* Foundation.framework in Frameworks */, + 4C49B2C215B0991B003512CD /* CoreGraphics.framework in Frameworks */, + 4C49B2C415B0991B003512CD /* GLKit.framework in Frameworks */, + 4C49B2C615B0991B003512CD /* OpenGLES.framework in Frameworks */, + 4C4C807515BA8F460037C6CE /* libsquirrel.a in Frameworks */, + 4C4C807715BA8F5B0037C6CE /* libz.a in Frameworks */, + 4C77831315BABD68003D5142 /* libvorbis-tremor-ios.a in Frameworks */, + 4C7C584B15C31E6500CAE4F4 /* libboost.a in Frameworks */, + 4C6EB44515C3CFD300316CB6 /* libpng.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4C49B2AE15B0991B003512CD = { + isa = PBXGroup; + children = ( + 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */, + 4C7B819515C40F770024D61A /* Libs */, + 4CC1FC3415B200130025C6F7 /* Resources */, + 4C49B2C715B0991B003512CD /* Sources */, + 4C49B2BC15B0991B003512CD /* Frameworks */, + 4C49B2BA15B0991B003512CD /* Products */, + ); + sourceTree = ""; + }; + 4C49B2BA15B0991B003512CD /* Products */ = { + isa = PBXGroup; + children = ( + 4C49B2B915B0991B003512CD /* salmontemplate.app */, + ); + name = Products; + sourceTree = ""; + }; + 4C49B2BC15B0991B003512CD /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4C77831415BABD8B003D5142 /* AudioToolbox.framework */, + 4C77831515BABD8B003D5142 /* OpenAL.framework */, + 4C49B2BD15B0991B003512CD /* UIKit.framework */, + 4C49B2BF15B0991B003512CD /* Foundation.framework */, + 4C49B2C115B0991B003512CD /* CoreGraphics.framework */, + 4C49B2C315B0991B003512CD /* GLKit.framework */, + 4C49B2C515B0991B003512CD /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4C49B2C715B0991B003512CD /* Sources */ = { + isa = PBXGroup; + children = ( + 4CE6A9E315B2F9A4006A3965 /* Game */, + 4CCC0ECD15B310FB005432FB /* ios_api.h */, + 4C7AD44B15B1D77700A599F6 /* ios_api.cpp */, + 4C49B2D015B0991B003512CD /* AppDelegate.h */, + 4C49B2D115B0991B003512CD /* AppDelegate.m */, + 4C49B2D715B0991B003512CD /* ViewController.h */, + 4C49B2D815B0991B003512CD /* ViewController.mm */, + 4C49B2DA15B0991B003512CD /* ViewController_iPhone.xib */, + 4C49B2DD15B0991B003512CD /* ViewController_iPad.xib */, + 4C49B2C815B0991B003512CD /* Supporting Files */, + 4CCC0ECA15B30D6A005432FB /* CustomGLKView.h */, + 4CCC0ECB15B30D6B005432FB /* CustomGLKView.mm */, + ); + name = Sources; + sourceTree = ""; + }; + 4C49B2C815B0991B003512CD /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 4C49B2C915B0991B003512CD /* template-Info.plist */, + 4C49B2CA15B0991B003512CD /* InfoPlist.strings */, + 4C49B2CD15B0991B003512CD /* main.m */, + 4C49B2CF15B0991B003512CD /* template-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 4C7B819515C40F770024D61A /* Libs */ = { + isa = PBXGroup; + children = ( + 4C6EB44415C3CFD300316CB6 /* libpng.a */, + 4C7C584A15C31E6500CAE4F4 /* libboost.a */, + 4C77831215BABD68003D5142 /* libvorbis-tremor-ios.a */, + 4C4C807615BA8F5B0037C6CE /* libz.a */, + 4C4C807415BA8F460037C6CE /* libsquirrel.a */, + ); + name = Libs; + sourceTree = ""; + }; + 4C902A7115C5735500FBC901 /* Products */ = { + isa = PBXGroup; + children = ( + 4C902A7815C5735700FBC901 /* libSalmon Engine.a */, + ); + name = Products; + sourceTree = ""; + }; + 4CC1FC3415B200130025C6F7 /* Resources */ = { + isa = PBXGroup; + children = ( + 4C74848315C5AD6E0056EC44 /* Icon.png */, + 4C74848415C5AD6E0056EC44 /* iTunesArtwork */, + 4C74848515C5AD6E0056EC44 /* Splash-landscape.png */, + 4CE6A9D115B2F979006A3965 /* assets */, + ); + name = Resources; + sourceTree = ""; + }; + 4CE6A9E315B2F9A4006A3965 /* Game */ = { + isa = PBXGroup; + children = ( + 4C74849615C5AF7C0056EC44 /* main_code.cpp */, + 4C74849715C5AF7C0056EC44 /* main_code.h */, + ); + name = Game; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4C49B2B815B0991B003512CD /* salmontemplate */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4C49B2E215B0991B003512CD /* Build configuration list for PBXNativeTarget "salmontemplate" */; + buildPhases = ( + 4C49B2B515B0991B003512CD /* Sources */, + 4C49B2B615B0991B003512CD /* Frameworks */, + 4C49B2B715B0991B003512CD /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = salmontemplate; + productName = doublehitballs; + productReference = 4C49B2B915B0991B003512CD /* salmontemplate.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4C49B2B015B0991B003512CD /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = 4C49B2B315B0991B003512CD /* Build configuration list for PBXProject "salmontemplate" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 4C49B2AE15B0991B003512CD; + productRefGroup = 4C49B2BA15B0991B003512CD /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 4C902A7115C5735500FBC901 /* Products */; + ProjectRef = 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 4C49B2B815B0991B003512CD /* salmontemplate */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 4C902A7815C5735700FBC901 /* libSalmon Engine.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libSalmon Engine.a"; + remoteRef = 4C902A7715C5735700FBC901 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 4C49B2B715B0991B003512CD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C49B2CC15B0991B003512CD /* InfoPlist.strings in Resources */, + 4C49B2DC15B0991B003512CD /* ViewController_iPhone.xib in Resources */, + 4C49B2DF15B0991B003512CD /* ViewController_iPad.xib in Resources */, + 4CE6A9D215B2F979006A3965 /* assets in Resources */, + 4C74848615C5AD6E0056EC44 /* Icon.png in Resources */, + 4C74848715C5AD6E0056EC44 /* iTunesArtwork in Resources */, + 4C74848815C5AD6E0056EC44 /* Splash-landscape.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4C49B2B515B0991B003512CD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C49B2CE15B0991B003512CD /* main.m in Sources */, + 4C49B2D215B0991B003512CD /* AppDelegate.m in Sources */, + 4C49B2D915B0991B003512CD /* ViewController.mm in Sources */, + 4C7AD44C15B1D77700A599F6 /* ios_api.cpp in Sources */, + 4CCC0ECC15B30D6B005432FB /* CustomGLKView.mm in Sources */, + 4C74849815C5AF7C0056EC44 /* main_code.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4C49B2CA15B0991B003512CD /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 4C49B2CB15B0991B003512CD /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 4C49B2DA15B0991B003512CD /* ViewController_iPhone.xib */ = { + isa = PBXVariantGroup; + children = ( + 4C49B2DB15B0991B003512CD /* en */, + ); + name = ViewController_iPhone.xib; + sourceTree = ""; + }; + 4C49B2DD15B0991B003512CD /* ViewController_iPad.xib */ = { + isa = PBXVariantGroup; + children = ( + 4C49B2DE15B0991B003512CD /* en */, + ); + name = ViewController_iPad.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4C49B2E015B0991B003512CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4C49B2E115B0991B003512CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4C49B2E315B0991B003512CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "template-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + TARGET_IOS, + DEBUG, + "$(inherited)", + BOOST_NO_CXX11_NUMERIC_LIMITS, + ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + HEADER_SEARCH_PATHS = ( + "$(SalmonEnginePath)", + "$(LibsPath)/lpng1510", + "$(LibsPath)/sqplus/sqplus", + "$(LibsPath)/sqplus/include", + "$(LibsPath)/boost_1_52_0", + ../jni, + "$(LibsPath)/vorbis-tremor-ios/vorbis", + ); + INFOPLIST_FILE = "template-Info.plist"; + LIBRARY_SEARCH_PATHS = ""; + "LIBRARY_SEARCH_PATHS[sdk=iphoneos*]" = ( + "$(LibsPath)/lpng1510/build-ios/ios-device", + "$(LibsPath)/boost_1_52_0/build-ios/ios-device", + "$(LibsPath)/sqplus/build-ios/ios-device", + "$(LibsPath)/zlib-1.2.6/build-ios/ios-device", + "$(LibsPath)/vorbis-tremor-ios/build-ios/ios-device", + ); + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = ( + "$(LibsPath)/lpng1510/build-ios/ios-simulator", + "$(LibsPath)/sqplus/build-ios/ios-simulator", + "$(LibsPath)/boost_1_52_0/build-ios/ios-simulator", + "$(LibsPath)/zlib-1.2.6/build-ios/ios-simulator", + "$(LibsPath)/vorbis-tremor-ios/build-ios/ios-simulator", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = build; + TARGETED_DEVICE_FAMILY = 1; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 4C49B2E415B0991B003512CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "template-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + TARGET_IOS, + BOOST_NO_CXX11_NUMERIC_LIMITS, + ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + HEADER_SEARCH_PATHS = ( + "$(SalmonEnginePath)", + "$(LibsPath)/lpng1510", + "$(LibsPath)/sqplus/sqplus", + "$(LibsPath)/sqplus/include", + "$(LibsPath)/boost_1_52_0", + ../jni, + "$(LibsPath)/vorbis-tremor-ios/vorbis", + ); + INFOPLIST_FILE = "template-Info.plist"; + LIBRARY_SEARCH_PATHS = ""; + "LIBRARY_SEARCH_PATHS[sdk=iphoneos*]" = ( + "$(LibsPath)/lpng1510/build-ios/ios-device", + "$(LibsPath)/boost_1_52_0/build-ios/ios-device", + "$(LibsPath)/sqplus/build-ios/ios-device", + "$(LibsPath)/zlib-1.2.6/build-ios/ios-device", + "$(LibsPath)/vorbis-tremor-ios/build-ios/ios-device", + ); + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = ( + "$(LibsPath)/lpng1510/build-ios/ios-simulator", + "$(LibsPath)/sqplus/build-ios/ios-simulator", + "$(LibsPath)/boost_1_52_0/build-ios/ios-simulator", + "$(LibsPath)/zlib-1.2.6/build-ios/ios-simulator", + "$(LibsPath)/vorbis-tremor-ios/build-ios/ios-simulator", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = 1; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4C49B2B315B0991B003512CD /* Build configuration list for PBXProject "salmontemplate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4C49B2E015B0991B003512CD /* Debug */, + 4C49B2E115B0991B003512CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4C49B2E215B0991B003512CD /* Build configuration list for PBXNativeTarget "salmontemplate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4C49B2E315B0991B003512CD /* Debug */, + 4C49B2E415B0991B003512CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4C49B2B015B0991B003512CD /* Project object */; +} diff --git a/iOS/template-Info.plist b/iOS/template-Info.plist new file mode 100644 index 0000000..d06ba45 --- /dev/null +++ b/iOS/template-Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Salmon Universal Template + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon.png + CFBundleIdentifier + fishrungames.template + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UILaunchImageFile + Splash-landscape.png + UIPrerenderedIcon + + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iOS/template-Prefix.pch b/iOS/template-Prefix.pch new file mode 100644 index 0000000..cd479f5 --- /dev/null +++ b/iOS/template-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'doublehitballs' target in the 'doublehitballs' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/jni/Android.mk b/jni/Android.mk new file mode 100644 index 0000000..d648ff4 --- /dev/null +++ b/jni/Android.mk @@ -0,0 +1,77 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +LPATH := $(call my-dir) + +ENGINE_PATH = $(SalmonEnginePathCygwin) + +BOOST_PATH = $(LibsPathCygwin)/boost_1_47_0 + +OGG_PATH = $(LibsPathCygwin)/libogg-1.3.0 + +VORBIS_PATH = $(LibsPathCygwin)/libvorbis-1.3.2 + +SQUIRREL_PATH = $(LibsPathCygwin)/sqplus + +LIBPNG_PATH = $(LibsPathCygwin)/libpng_1.4.1_android + +ZIP_PATH = $(LibsPathCygwin)/julienr-libzip-android/jni + +#====== ENGINE AND LIBS ===================== + +include $(ENGINE_PATH)/Android_Salmon_Engine.mk + +#================= THE GAME ======================= + + +LOCAL_PATH:= $(LPATH) + +include $(CLEAR_VARS) + +LOCAL_CFLAGS := -DTARGET_ANDROID -DNOSOUND -std=gnu++11 --std=c++11 +LOCAL_STATIC_LIBRARIES := boost +LOCAL_STATIC_LIBRARIES += squirrel +LOCAL_STATIC_LIBRARIES += png_lib +LOCAL_STATIC_LIBRARIES += zip +LOCAL_SHARED_LIBRARIES := SalmonEngine +LOCAL_SHARED_LIBRARIES += gnustl_shared +LOCAL_C_INCLUDES := $(ENGINE_PATH) +LOCAL_C_INCLUDES += $(BOOST_PATH) +LOCAL_C_INCLUDES += $(VORBIS_PATH)/include +LOCAL_C_INCLUDES += $(VORBIS_PATH)/include/vorbis +LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib +LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib/books +LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib/modes +LOCAL_C_INCLUDES += $(OGG_PATH)/include +LOCAL_C_INCLUDES += $(OGG_PATH)/include/ogg +LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/include +LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/sqplus +LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/squirrel +LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/sqstdlib +LOCAL_C_INCLUDES += $(LIBPNG_PATH) +LOCAL_C_INCLUDES += $(ZIP_PATH) +LOCAL_MODULE := SalmonJniTemplate +LOCAL_SRC_FILES := main_code.cpp +LOCAL_SRC_FILES += android_api.cpp + +LOCAL_LDLIBS := -lGLESv2 +LOCAL_LDLIBS += -llog -Wl + +#debug +#LOCAL_CFLAGS += -g -ggdb -O0 +#LOCAL_LDLIBS += -g -ggdb + +include $(BUILD_SHARED_LIBRARY) diff --git a/jni/Application.mk b/jni/Application.mk new file mode 100644 index 0000000..22476ec --- /dev/null +++ b/jni/Application.mk @@ -0,0 +1,3 @@ +APP_STL := gnustl_shared +APP_CPPFLAGS += -fexceptions +APP_CPPFLAGS += -frtti diff --git a/jni/android_api.cpp b/jni/android_api.cpp new file mode 100644 index 0000000..7e723d8 --- /dev/null +++ b/jni/android_api.cpp @@ -0,0 +1,10 @@ +#include "android_api.h" + +#include "main_code.h" + + +JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height) +{ + JniInitApp(width, height, 480.f, 320.f); +} + diff --git a/jni/android_api.h b/jni/android_api.h new file mode 100644 index 0000000..c195e7f --- /dev/null +++ b/jni/android_api.h @@ -0,0 +1,25 @@ +#ifndef ANDROID_API_H_INCLUDED +#define ANDROID_API_H_INCLUDED + +#include +#include + +#include +#include +#include + +#include "boost/shared_ptr.hpp" + +#include "main_code.h" + +#include "include/Engine.h" + +using namespace SE; + + +extern "C" { + JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height); +}; + + +#endif diff --git a/jni/main_code.cpp b/jni/main_code.cpp new file mode 100644 index 0000000..0c2cb71 --- /dev/null +++ b/jni/main_code.cpp @@ -0,0 +1,567 @@ +#include "main_code.h" + +#ifdef TARGET_ANDROID +#include "android_api.h" +#endif + +#include +#include +#include +#include + +#include "include/Engine.h" + +#include "main_code.h" + +//Better move those to external config or something... +const cardinal CONST_LASER_TIMER = 200; +const int CONST_HIT_SCORE_POINTS = 100; +const float CONST_TIME_SCALE = 0.01f; + +const float CONST_PLAYER_ACCELERATION = 3.f; +const float CONST_VELOCITY_FADE = 0.95f; +const float CONST_LASER_VELOCITY = 100.f; + +const vec2 CONST_PLAYER_HALF_SIZE(30.f, 30.f); +const vec2 CONST_LASER_HALF_SIZE(10.f, 10.f); + + +const vec2 CONST_AST_POS1(40, 40); +const vec2 CONST_AST_POS2(40, 280); +const vec2 CONST_AST_POS3(440, 160); + + + +float HealthToScale(int health) +{ + return 0.5f + health * 0.3f; +} + +float HealthToHitDistance(int health) +{ + const float CONST_HIT_DISTANCE = 15.f; + + return max(CONST_HIT_DISTANCE * HealthToScale(health), 10.f); +} + +void TMyApplication::InnerInit() +{ + + *Console<<"Inner init go!\n"; + +#ifdef TARGET_ANDROID + ST::PathToResources = ""; +#endif +#ifdef TARGET_WIN32 +#ifdef NDEBUG + ST::PathToResources = "assets/"; +#else + ST::PathToResources = "../../../assets/"; +#endif +#endif +#ifdef TARGET_IOS + ST::PathToResources = "assets/"; +#endif + + RandomGenerator.seed(static_cast(std::time(0))); + + TapIsDown = false; + + ResourceManager->TexList.AddTexture(CONST_CONSOLE_TEX_NAME); + + ResourceManager->ShaderManager.AddShader("DefaultShader", "gui_transparent.vertex", "gui_transparent.fragment"); + + Renderer->PushShader("DefaultShader"); + + ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.bmp32", "droid_sans14_font_charmap.txt"); + ResourceManager->FontManager.PushFont("droid_sans14"); + + ResourceManager->TexList.Serialize(*FileToPropertyTree("textures.xml")); + + Renderer->PushProjectionMatrix(Renderer->GetScreenWidth(), Renderer->GetScreenHeight()); + + Level = 1; + Score = 0; + + InitLevel(); + + Player.RenderPair.first.SamplerMap[CONST_STRING_TEXTURE_UNIFORM] = "shipTexture"; + Player.RenderPair.second.Data = MakeDataTriangleList(Player.Pos - CONST_PLAYER_HALF_SIZE, Player.Pos + CONST_PLAYER_HALF_SIZE); + Player.RenderPair.second.RefreshBuffer(); + + BackgroundRenderPair.first.SamplerMap[CONST_STRING_TEXTURE_UNIFORM] = "backgroundTexture"; + BackgroundRenderPair.second.Data = MakeDataTriangleList(vec2(0,0), vec2(Renderer->GetScreenWidth(), Renderer->GetScreenHeight())); + BackgroundRenderPair.second.RefreshBuffer(); + + *Console<<"Inner init end!\n"; + + glDepthFunc(GL_LEQUAL); + +} + +void TMyApplication::InnerDeinit() +{ +} + + +void TMyApplication::InnerDraw() +{ + + glClearColor(0,0,0,1); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + //Draw background + TRenderParamsSetter renderParamSetter(BackgroundRenderPair.first); + + Renderer->DrawTriangleList(BackgroundRenderPair.second); + + + //Draw asteroids + BOOST_FOREACH(CAsteroidStruct& asteroid, Asteroids) + { + TRenderParamsSetter renderParamSetter(asteroid.RenderPair.first); + + Renderer->DrawTriangleList(asteroid.RenderPair.second); + } + + + //Draw player + if (GameState != GS_LOST) + { + TRenderParamsSetter renderParamSetter(Player.RenderPair.first); + Renderer->DrawTriangleList(Player.RenderPair.second); + } + + //Draw lasers + BOOST_FOREACH(CLaserStruct& laser, Lasers) + { + TRenderParamsSetter renderParamSetter(laser.RenderPair.first); + + Renderer->DrawTriangleList(laser.RenderPair.second); + } + + + //Draw texts + glBindTexture(GL_TEXTURE_2D, ResourceManager->TexList[ResourceManager->FontManager.GetCurrentFontTextureName()]); + + Renderer->DrawTriangleList(LevelScoreText); + Renderer->DrawTriangleList(LevelMessageText); + +} + + +void TMyApplication::InnerUpdate(cardinal dt) +{ + float scaledTime = CONST_TIME_SCALE * dt; + + //Update Asteroids + BOOST_FOREACH(CAsteroidStruct& asteroid, Asteroids) + { + + float difAngle = asteroid.AngularVelocity * scaledTime; + + asteroid.Angle += difAngle; + + mat3 rotationMatrix = CreateZRotationMatrix(difAngle); + + MoveDataTriangleList(asteroid.RenderPair.second.Data, -vec3(asteroid.CenterPos, 0)); + RotateDataTriangleList(asteroid.RenderPair.second.Data, rotationMatrix); + MoveDataTriangleList(asteroid.RenderPair.second.Data, vec3(asteroid.CenterPos, 0)); + + + vec2 dif = asteroid.Velocity * scaledTime; + + vec2 newCenterPos = NormalizePos(asteroid.CenterPos + dif); + + dif = newCenterPos - asteroid.CenterPos; + + asteroid.CenterPos = newCenterPos; + + MoveDataTriangleList(asteroid.RenderPair.second.Data, vec3(dif, 0)); + + asteroid.RenderPair.second.RefreshBuffer(); + } + + + + UpdatePlayerPosition(scaledTime); + + + + //Shoot laser + LaserTimer.Update(dt); + + if (LaserTimer.IsOver()) + { + LaserTimer.SetTimer(CONST_LASER_TIMER); + + if (GameState == GS_PLAY) + { + AddNewLaser(); + } + } + + //Update lasers + BOOST_FOREACH(CLaserStruct& laser, Lasers) + { + vec2 dif = CONST_LASER_VELOCITY *laser.Dir * scaledTime; + MoveDataTriangleList(laser.RenderPair.second.Data, vec3(dif, 0)); + laser.Pos += dif; + + laser.RenderPair.second.RefreshBuffer(); + } + + //Do all checks... + ProcessLaserHit(); + + ProcessPlayerCollisions(); + + ClearUnusedLasers(); + + if (Asteroids.size() == 0 && GameState == GS_PLAY) + { + GameState = GS_WON; + RefreshScoreText(); + } + + +} + + +void TMyApplication::InnerOnTapDown(vec2 p) +{ + TapIsDown = true; + LastTap = p; +} + +void TMyApplication::InnerOnTapUp(vec2 p) +{ + TapIsDown = false; + + + if (GameState == GS_LOST) + { + Level = 1; + Score = 0; + InitLevel(); + } + else if (GameState == GS_WON) + { + Level++; + InitLevel(); + } +} + +void TMyApplication::InnerOnTapUpAfterMove(vec2 p) +{ + TapIsDown = false; +} + +void TMyApplication::InnerOnMove(vec2 shift) +{ + LastTap -= shift; +} + +void TMyApplication::InitLevel() +{ + GameState = GS_PLAY; + + LaserTimer.SetTimer(CONST_LASER_TIMER); + + Asteroids.clear(); + Lasers.clear(); + + CreateRandomAsteroid(CONST_AST_POS1, Level); + CreateRandomAsteroid(CONST_AST_POS2, Level); + CreateRandomAsteroid(CONST_AST_POS3, Level); + + Player.Angle = 0; + Player.Pos = vec2(Renderer->GetScreenWidth()/2, Renderer->GetScreenHeight()/2); + + RefreshScoreText(); + +} + +CAsteroidStruct TMyApplication::CreateAsteroid(vec2 pos, vec2 dir, int health) +{ + static const float CONST_TEX_COORD_SCALE = 0.01f; + static const float CONST_ANGULAR_VELOCITY_SCALE = 0.001f; + + static const boost::random::uniform_int_distribution<> velocityDistribution(5, 10); + + static const boost::random::uniform_int_distribution<> angularVelocityDistribution(0, 10); + + static const boost::random::uniform_int_distribution<> vertexNumberDistribution(5, 10); + static const boost::random::uniform_int_distribution<> vertexShiftDistribution(20, 30); + + CAsteroidStruct result; + + result.Health = health; + + result.CenterPos = pos; + + result.Angle = 0; + + result.AngularVelocity = angularVelocityDistribution(RandomGenerator) * CONST_ANGULAR_VELOCITY_SCALE; + + result.Velocity = velocityDistribution(RandomGenerator) * dir; + + int numberOfVertices = vertexNumberDistribution(RandomGenerator); + + std::vector distArr(numberOfVertices); + + for (int i=0; i(numberOfVertices); + + vec2 shift = distArr[i % numberOfVertices] * vec2(cosf(angle), sinf(angle)); + + vec2 texCoordShift = shift * CONST_TEX_COORD_SCALE; + + result.RenderPair.second.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].push_back(vec3(pos, 0)); + result.RenderPair.second.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].push_back(vec3(pos + prevShift, 0)); + result.RenderPair.second.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].push_back(vec3(pos + shift, 0)); + + result.RenderPair.second.Data.Vec2CoordArr[CONST_STRING_TEXCOORD_ATTRIB].push_back(vec2(0.5f, 0.5f)); + result.RenderPair.second.Data.Vec2CoordArr[CONST_STRING_TEXCOORD_ATTRIB].push_back(vec2(0.5f, 0.5f) + prevTexCoordShift); + result.RenderPair.second.Data.Vec2CoordArr[CONST_STRING_TEXCOORD_ATTRIB].push_back(vec2(0.5f, 0.5f) + texCoordShift); + + prevShift = shift; + prevTexCoordShift = texCoordShift; + } + + result.RenderPair.first.SamplerMap[CONST_STRING_TEXTURE_UNIFORM] = "asteroidTexture"; + + result.RenderPair.second.RefreshBuffer(); + + return result; +} + + +void TMyApplication::CreateRandomAsteroid(vec2 pos, int health) +{ + + static const boost::random::uniform_int_distribution<> angleDistribution(0, 36); + + float randomAngle = angleDistribution(RandomGenerator) * pi / 18.f; + + Asteroids.push_back(CreateAsteroid(pos, vec2(cosf(randomAngle), sinf(randomAngle)), health)); +} + +void TMyApplication::CreateAsteroidParts(vec2 pos, int newHealth) +{ + static const boost::random::uniform_int_distribution<> CreateAsteroidParts(2, 5); + + static const boost::random::uniform_int_distribution<> angleDistribution(0, 36); + + float randomAngle = angleDistribution(RandomGenerator) * pi / 18.f; + + int number = CreateAsteroidParts(RandomGenerator); + + for (int i = 0; i < number; i++) + { + float partAngle = randomAngle + i * 2 * pi / static_cast(number); + Asteroids.push_back(CreateAsteroid(pos, vec2(cosf(partAngle), sinf(partAngle)), newHealth)); + } + +} + +vec2 TMyApplication::NormalizePos(vec2 pos) +{ + vec2 result = pos; + + while (result.v[0] < 0) + { + result.v[0] += Renderer->GetScreenWidth(); + } + + while (result.v[1] < 0) + { + result.v[1] += Renderer->GetScreenHeight(); + } + + while (result.v[0] >= Renderer->GetScreenWidth()) + { + result.v[0] -= Renderer->GetScreenWidth(); + } + + while (result.v[1] >= Renderer->GetScreenHeight()) + { + result.v[1] -= Renderer->GetScreenHeight(); + } + + return result; +} + +void TMyApplication::RefreshPlayerPos() +{ + Replace6PointsInTriangleList(Player.RenderPair.second.Data, 0, (-1) * CONST_PLAYER_HALF_SIZE, CONST_PLAYER_HALF_SIZE); + + mat3 rotationMatrix = CreateZRotationMatrix(Player.Angle); + + RotateDataTriangleList(Player.RenderPair.second.Data, rotationMatrix); + + MoveDataTriangleList(Player.RenderPair.second.Data, vec3(Player.Pos, 0)); + + Player.RenderPair.second.RefreshBuffer(); + +} + +void TMyApplication::AddNewLaser() +{ + CLaserStruct laser; + + float angle = Player.Angle; + + laser.Dir = vec2(cosf(angle), sinf(angle)); + + laser.Pos = Player.Pos; + + laser.RenderPair.second.Data = MakeDataTriangleList((-1) * CONST_LASER_HALF_SIZE, CONST_LASER_HALF_SIZE); + + mat3 rotationMatrix = CreateZRotationMatrix(angle); + + RotateDataTriangleList(laser.RenderPair.second.Data, rotationMatrix); + + MoveDataTriangleList(laser.RenderPair.second.Data, vec3(laser.Pos, 0)); + + laser.RenderPair.first.SamplerMap[CONST_STRING_TEXTURE_UNIFORM] = "fireTexture"; + + laser.RenderPair.second.RefreshBuffer(); + + Lasers.push_back(laser); +} + +void TMyApplication::UpdatePlayerPosition(float scaledTime) +{ + + if (TapIsDown) + { + + vec2 dir = Normalize(LastTap - Player.Pos); + + Player.Velocity += CONST_PLAYER_ACCELERATION * scaledTime * dir; + + Player.Angle = acosf(DotProduct(dir, vec2(1, 0))); + + if (dir.v[1] < 0) + { + Player.Angle = -Player.Angle; + } + } + + Player.Pos += Player.Velocity * scaledTime; + + + Player.Velocity *= powf(CONST_VELOCITY_FADE, clamp(scaledTime, 0.f, 1.5f)); + + Player.Pos = NormalizePos(Player.Pos); + + RefreshPlayerPos(); + +} + +void TMyApplication::ProcessLaserHit() +{ + + for (auto laserItr = Lasers.begin(); laserItr != Lasers.end(); ) + { + for (auto astItr = Asteroids.begin(); astItr != Asteroids.end(); ) + { + + float realDistance = HealthToHitDistance(astItr->Health); + + if (fabs(laserItr->Pos.v[0] - astItr->CenterPos.v[0]) < realDistance && + fabs(laserItr->Pos.v[1] - astItr->CenterPos.v[1]) < realDistance) + { + laserItr = Lasers.erase(laserItr); + + if (astItr->Health > 0) + { + CreateAsteroidParts(astItr->CenterPos, astItr->Health - 1); + } + + astItr = Asteroids.erase(astItr); + + Score += CONST_HIT_SCORE_POINTS; + RefreshScoreText(); + + break; + + } + + + if (astItr != Asteroids.end()) + { + astItr++; + } + } + + if (laserItr != Lasers.end()) + { + laserItr++; + } + } + +} + +void TMyApplication::ProcessPlayerCollisions() +{ + + for (auto astItr = Asteroids.begin(); astItr != Asteroids.end(); astItr++) + { + float realDistance = HealthToHitDistance(astItr->Health); + + if (fabs(astItr->CenterPos.v[0] - Player.Pos.v[0]) < realDistance && fabs(astItr->CenterPos.v[1] - Player.Pos.v[1]) < realDistance) + { + GameState = GS_LOST; + RefreshScoreText(); + } + } +} + +void TMyApplication::ClearUnusedLasers() +{ + for (auto itr = Lasers.begin(); itr != Lasers.end(); ) + { + if (itr->Pos.v[0] < 0 || itr->Pos.v[1] < 0 || itr->Pos.v[0] > Renderer->GetScreenWidth() || itr->Pos.v[1] > Renderer->GetScreenHeight()) + { + itr = Lasers.erase(itr); + } + + if (itr != Lasers.end()) + { + itr++; + } + } +} + + +void TMyApplication::RefreshScoreText() +{ + LevelScoreText = ResourceManager->FontManager.DrawStringToVBO(vec2(10, 20), TTextBasicAreaParams(), "Score: "+ tostr(Score)); + + if (GameState == GS_PLAY) + { + LevelMessageText = ResourceManager->FontManager.DrawStringToVBO(vec2(10, 300), TTextBasicAreaParams(), "Now playing "+ tostr(Level) + " level"); + } + else if (GameState == GS_WON) + { + LevelMessageText = ResourceManager->FontManager.DrawStringToVBO(vec2(10, 300), TTextBasicAreaParams(), "You won! Tap on screen to start next level"); + } + else if (GameState == GS_LOST) + { + LevelMessageText = ResourceManager->FontManager.DrawStringToVBO(vec2(10, 300), TTextBasicAreaParams(), "You failed! Tap on screen to restart"); + } +} \ No newline at end of file diff --git a/jni/main_code.h b/jni/main_code.h new file mode 100644 index 0000000..5fc2e23 --- /dev/null +++ b/jni/main_code.h @@ -0,0 +1,137 @@ +#ifndef MAIN_CODE_H_INCLUDED +#define MAIN_CODE_H_INCLUDED + + +#include +#include +#include + +#ifdef TARGET_ANDROID + +#include +#include +#include +#endif + +#include "boost/shared_ptr.hpp" +#include "boost/thread/thread.hpp" +#include "boost/assign.hpp" +#include "boost/bind.hpp" +#include "boost/asio.hpp" +#include "boost/signal.hpp" +#include "boost/random.hpp" + +#include "include/Engine.h" + +using namespace SE; + +struct CAsteroidStruct +{ + int Health; + float Angle; + float AngularVelocity; + vec2 CenterPos; + vec2 Velocity; + TRenderPair RenderPair; +}; + +struct CPlayer +{ + vec2 Pos; + float Angle; + vec2 Velocity; + TRenderPair RenderPair; +}; + + +struct CLaserStruct +{ + vec2 Pos; + vec2 Dir; + TRenderPair RenderPair; +}; + +enum CGameState +{ + GS_PLAY, + GS_WON, + GS_LOST +}; + +class TMyApplication : public TApplication +{ +protected: + + //Game elements + std::list Asteroids; + std::list Lasers; + CPlayer Player; + + //Minor + boost::random::mt19937 RandomGenerator; + bool TapIsDown; + vec2 LastTap; + TSimpleTimer LaserTimer; + + //Game score and state + CGameState GameState; + int Level; + int Score; + + //Static graphics + TTriangleList LevelScoreText; + TTriangleList LevelMessageText; + TRenderPair BackgroundRenderPair; + + + CAsteroidStruct CreateAsteroid(vec2 pos, vec2 dir, int health); + + void CreateRandomAsteroid(vec2 pos, int health); + + void CreateAsteroidParts(vec2 pos, int newHealth); + + vec2 NormalizePos(vec2 pos); + + void RefreshPlayerPos(); + + void AddNewLaser(); + void UpdatePlayerPosition(float scaledTime); + void ProcessLaserHit(); + void ProcessPlayerCollisions(); + void ClearUnusedLasers(); + + void RefreshScoreText(); + +public: + bool Inited; + + TMyApplication() : TApplication(), Inited(false) { } + + + virtual void InnerInit(); + + virtual void InnerDeinit(); + + virtual void InnerDraw(); + + virtual void InnerUpdate(cardinal dt); + + virtual void InnerOnTapDown(vec2 p); + + virtual void InnerOnTapUp(vec2 p); + + virtual void InnerOnTapUpAfterMove(vec2 p); + + virtual void InnerOnMove(vec2 shift); + + bool IsInited() { return Inited; } + + void InitLevel(); + + + + +}; + + +#endif diff --git a/res/drawable-hdpi/ic_menu_template.png b/res/drawable-hdpi/ic_menu_template.png new file mode 100644 index 0000000..1e28f93 Binary files /dev/null and b/res/drawable-hdpi/ic_menu_template.png differ diff --git a/res/drawable-ldpi/ic_menu_template.png b/res/drawable-ldpi/ic_menu_template.png new file mode 100644 index 0000000..6a93cf2 Binary files /dev/null and b/res/drawable-ldpi/ic_menu_template.png differ diff --git a/res/drawable-mdpi/ic_menu_template.png b/res/drawable-mdpi/ic_menu_template.png new file mode 100644 index 0000000..7c1cab2 Binary files /dev/null and b/res/drawable-mdpi/ic_menu_template.png differ diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000..33d1455 --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,4 @@ + + + AndroidJniTemplate + diff --git a/src/fishrungames/salmonjnitemplate/GLView.java b/src/fishrungames/salmonjnitemplate/GLView.java new file mode 100644 index 0000000..0536d75 --- /dev/null +++ b/src/fishrungames/salmonjnitemplate/GLView.java @@ -0,0 +1,73 @@ +package fishrungames.salmonjnitemplate; + + +import java.util.Calendar; + +import android.content.Context; +import android.opengl.GLSurfaceView; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import fishrungames.engine.GLViewAncestor; +import fishrungames.engine.EngineWrapper; + +class GLView extends GLViewAncestor +{ + static long lastTimeStamp; + static boolean gameIsInited = false; + + public GLView(Context context) + { + //Change this method? Don't forget to change method below! + super(context); + init(false, 0, 0); + } + + public GLView(Context context, boolean translucent, int depth, int stencil) + { + //Change this method? Don't forget to change method above! + super(context); + init(translucent, depth, stencil); + } + + public void init(boolean translucent, int depth, int stencil) + { + super.init(translucent, depth, stencil); + setRenderer(new Renderer()); + Calendar c = Calendar.getInstance(); + lastTimeStamp = c.getTimeInMillis(); + gameIsInited = true; + } + + private static class Renderer implements GLSurfaceView.Renderer + { + public void onDrawFrame(GL10 gl) + { + if (gameIsInited) + { + Calendar c = Calendar.getInstance(); + + long currentTimeStamp = c.getTimeInMillis(); + + EngineWrapper.Update(currentTimeStamp - lastTimeStamp); + + lastTimeStamp = currentTimeStamp; + } + } + + public void onSurfaceChanged(GL10 gl, int width, int height) + { + + + //JniWrapper.Destroy(); + + JniWrapper.Init(width,height); + } + + public void onSurfaceCreated(GL10 gl, EGLConfig config) + { + //Do nothing. + } + } +} \ No newline at end of file diff --git a/src/fishrungames/salmonjnitemplate/JniWrapper.java b/src/fishrungames/salmonjnitemplate/JniWrapper.java new file mode 100644 index 0000000..e7022b8 --- /dev/null +++ b/src/fishrungames/salmonjnitemplate/JniWrapper.java @@ -0,0 +1,12 @@ +package fishrungames.salmonjnitemplate; + +public class JniWrapper +{ + static { + System.loadLibrary("SalmonJniTemplate"); + } + + + public static native void Init(int width, int height); + +} \ No newline at end of file diff --git a/src/fishrungames/salmonjnitemplate/MainActivity.java b/src/fishrungames/salmonjnitemplate/MainActivity.java new file mode 100644 index 0000000..ca51357 --- /dev/null +++ b/src/fishrungames/salmonjnitemplate/MainActivity.java @@ -0,0 +1,93 @@ +package fishrungames.salmonjnitemplate; + +import fishrungames.engine.EngineWrapper; + +//Deprecated +//import fishrungames.androidjnitemplate.R; + +import android.app.Activity; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Bundle; + +import android.view.GestureDetector; +import android.view.KeyEvent; +import android.view.GestureDetector.SimpleOnGestureListener; +import android.view.MotionEvent; + + + +public class MainActivity extends Activity +{ + + GLView mView; + + @Override + protected void onCreate(Bundle icicle) + { + + super.onCreate(icicle); + + EngineWrapper.LoadSalmonEngineLibrary(); + + EngineWrapper.SetActivityInstance(this); + EngineWrapper.SetupEnviroment(); + + String apkFilePath = null; + ApplicationInfo appInfo = null; + PackageManager packMgmr = this.getPackageManager(); + try { + appInfo = packMgmr.getApplicationInfo("fishrungames.salmonjnitemplate", 0); + } catch (NameNotFoundException e) { + + e.printStackTrace(); + throw new RuntimeException("Unable to locate assets, aborting..."); + } + apkFilePath = appInfo.sourceDir; + + EngineWrapper.SetupApkFilePath(apkFilePath); + + mView = new GLView(getApplication()); + + setContentView(mView); + + } + + @Override + protected void onPause() + { + EngineWrapper.Destroy(); + super.onPause(); + mView.onPause(); + } + + @Override + protected void onResume() + { + //Don't write anything here! + super.onResume(); + mView.onResume(); + } + + @Override + protected void onStop() + { + //Don't write anything here! + super.onStop(); + } + + public boolean onKeyDown(int keyCode, KeyEvent event) + { + + EngineWrapper.ProcessKeyDown(keyCode, event); + return super.onKeyDown(keyCode, event); + } + + public boolean onTouchEvent(MotionEvent event) + { + EngineWrapper.ProcessTouchEvent(event); + return true; + } + +} \ No newline at end of file diff --git a/windows/SalmonTemplate/Template.sln b/windows/SalmonTemplate/Template.sln new file mode 100644 index 0000000..2f41155 --- /dev/null +++ b/windows/SalmonTemplate/Template.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Template", "Template\Template.vcxproj", "{0080A3E1-DFBF-4557-B198-E6D5D7724393}" + ProjectSection(ProjectDependencies) = postProject + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20} = {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Salmon Engine", "..\..\..\..\Engine\Salmon Engine\Salmon Engine.vcxproj", "{48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_nosound|Win32 = Debug_nosound|Win32 + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug_nosound|Win32.ActiveCfg = Debug|Win32 + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug_nosound|Win32.Build.0 = Debug|Win32 + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug|Win32.ActiveCfg = Debug|Win32 + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug|Win32.Build.0 = Debug|Win32 + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Release|Win32.ActiveCfg = Release|Win32 + {0080A3E1-DFBF-4557-B198-E6D5D7724393}.Release|Win32.Build.0 = Release|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Debug_nosound|Win32.ActiveCfg = Debug_nosound|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Debug_nosound|Win32.Build.0 = Debug_nosound|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Debug|Win32.ActiveCfg = Debug|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Debug|Win32.Build.0 = Debug|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Release|Win32.ActiveCfg = Release|Win32 + {48ADCE9F-9539-4D3A-BCFA-C2ABABAF0B20}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/windows/SalmonTemplate/Template/Template.vcxproj b/windows/SalmonTemplate/Template/Template.vcxproj new file mode 100644 index 0000000..a07d21a --- /dev/null +++ b/windows/SalmonTemplate/Template/Template.vcxproj @@ -0,0 +1,90 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {0080A3E1-DFBF-4557-B198-E6D5D7724393} + Template + + + + Application + true + NotSet + + + Application + false + true + NotSet + + + + + + + + + + + + + $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SalmonEnginePath)include + $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(SalmonEnginePath)$(Configuration) + + + $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SalmonEnginePath)include + $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(SalmonEnginePath)$(Configuration) + + + + Level3 + Disabled + ../../../jni;$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510 + TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG + 4503 + + + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;glu32.lib;Salmon Engine.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;zlib.lib;libpng15.lib;jpeg.lib;sqplusD.lib;squirrelD.lib;sqdbglibD.lib;sqstdlibD.lib;dsound.lib;dxguid.lib;%(AdditionalDependencies) + $(LibsPath)\boost_1_52_0\boost_windows\libs_engine\$(Configuration);$(LibsPath)\libogg-1.3.0\win32\VS2010\Win32\$(Configuration);$(LibsPath)\libvorbis-1.3.2\win32\VS2010\Win32\$(Configuration);$(LibsPath)\sqplus\lib;$(LibsPath)\DirectXsdk\Lib\x86;$(LibsPath)\jpeg-9\vc10\Release;$(LibsPath)\lpng1510\projects\vstudio\Debug Library + + + + + Level3 + MaxSpeed + true + true + ../../../jni;$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510 + TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG + 4503 + + + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;glu32.lib;Salmon Engine.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;zlib.lib;libpng15.lib;jpeg.lib;sqplus.lib;squirrel.lib;sqdbglib.lib;sqstdlib.lib;dsound.lib;dxguid.lib;%(AdditionalDependencies) + $(LibsPath)\boost_1_52_0\boost_windows\libs_engine\$(Configuration);$(LibsPath)\libogg-1.3.0\win32\VS2010\Win32\$(Configuration);$(LibsPath)\libvorbis-1.3.2\win32\VS2010\Win32\$(Configuration);$(LibsPath)\sqplus\lib;$(LibsPath)\DirectXsdk\Lib\x86;$(LibsPath)\jpeg-9\vc10\Release;$(LibsPath)\lpng1510\projects\vstudio\Release Library + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/SalmonTemplate/Template/main.cpp b/windows/SalmonTemplate/Template/main.cpp new file mode 100644 index 0000000..f6af5d8 --- /dev/null +++ b/windows/SalmonTemplate/Template/main.cpp @@ -0,0 +1,30 @@ +#include "main.h" + +#include "main_code.h" + +int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, + LPSTR lpszCmdLine, int nCmdShow) +{ + + int width = 480; + int height = 320; + + if (CreateEngine(width, height)) + { + + //MyApplication scope + { + TMyApplication Application; + + Application.OuterInit(width, height, width, height); + + MainLoop(&Application); + + Application.OuterDeinit(); + } + + DestroyEngine(); + } + + return 0; +} \ No newline at end of file diff --git a/windows/SalmonTemplate/Template/main.h b/windows/SalmonTemplate/Template/main.h new file mode 100644 index 0000000..9939a50 --- /dev/null +++ b/windows/SalmonTemplate/Template/main.h @@ -0,0 +1,3 @@ +#pragma once + +#include "Engine.h"