This file contains hidden or 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
template <typename T> | |
struct Scope_Delete_Handler | |
{ | |
T target; | |
Scope_Delete_Handler(T _target) :target(_target) {} | |
~Scope_Delete_Handler() { delete target; } | |
}; | |
#define Scope_Delete(x) Scope_Delete_Handler <decltype(x)> _##x##_## __LINE__(x) |
This file contains hidden or 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
#import <Cocoa/Cocoa.h> | |
@interface AppDelegate : NSObject <NSApplicationDelegate> | |
@property (assign) IBOutlet NSWindow *window; | |
@property (assign) CFMachPortRef tap; | |
@end | |
@implementation AppDelegate |
This file contains hidden or 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
#include <SDL.h> | |
int PollEvents() | |
{ | |
SDL_Event event; | |
while (SDL_PollEvent(&event)) | |
{ | |
switch (event.type) | |
{ | |
case SDL_QUIT: |
This file contains hidden or 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
--- /tmp/tmp.4049.39 2013-03-01 11:53:56.199276885 -0800 | |
+++ src/events/SDL_mouse.c 2013-03-01 11:52:47.390674778 -0800 | |
@@ -33,6 +33,8 @@ | |
/* The mouse state */ | |
static SDL_Mouse SDL_mouse; | |
+static int | |
+SDL_PrivateSendMouseMotion(SDL_Window * window, int relative, int x, int y); | |
/* Public functions */ |
This file contains hidden or 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
public <T> Bag<T> register(Class<T extends Node> klass) { | |
Bag<T> list = (Bag<T>)nodes.get(klass); | |
if(list == null) { | |
list = new Bag<T>(); | |
nodes.put(klass, list); | |
} | |
return list; | |
} |
This file contains hidden or 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
interface Component { | |
public void update(int delta); | |
public void render(); | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<jnlp | |
codebase="https://dl.dropbox.com/u/7722291/" | |
href="Frogger.jnlp"> | |
<information> | |
<title>Frogger</title> | |
<vendor>HollowSpecter</vendor> | |
<homepage href="https://github.com/hollowspecter/1GAM-Jan-5Frogger"/> | |
<description>Frogger, January 1GAM entry.</description> | |
<description kind="short">Frogger.</description> |
This file contains hidden or 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
body->SetTransform(new_position, ball.body->GetAngle()); | |
body->SetLinearVelocity(b2Vec2_zero); | |
body->ApplyLinearImpulse(new_impulse, body->GetPosition()); |
This file contains hidden or 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)keepAliveHandler:(UIBackgroundTaskIdentifier)bgIdentifier { | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ | |
NSLog(@"Runnin' in the background!"); | |
for (int i = 49; i >= 1; --i) { | |
NSLog(@"Okay, %i more!", i); | |
[NSThread sleepForTimeInterval:6]; | |
} | |
NSLog(@"Phew! Made it through!"); |
This file contains hidden or 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
static public Vector3 ParseVector3(string input) { | |
input = input.TrimStart('(').TrimEnd(')') | |
string[] components = input.Split(','); | |
Vector3 output = Vector3.zero; | |
if (components.Length > 0) { | |
try { output.x = float.Parse(components[0]); } catch (Exception e) {} | |
} | |
if (components.Length > 1) { | |
try { output.y = float.Parse(components[1]); } catch (Exception e) {} |