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
| // http://www.happybearsoftware.com/implementing-a-dynamic-array.html, but with void pointers | |
| #include "lipsynth_vector.h" | |
| void lipsynth_vector_init(LipsynthVector *vector, size_t itemSize) { | |
| // initialize size and capacity | |
| vector->size = 0; | |
| vector->itemSize = itemSize; | |
| vector->capacity = VECTOR_INITIAL_CAPACITY; | |
| // allocate memory for vector->data |
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-16"?> | |
| <VNGame xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
| <Scenes> | |
| <Scene name="Main Scene"> | |
| <TextLines> | |
| <TextLine> | |
| <text>Bye</text> | |
| <linkTargetId>3</linkTargetId> | |
| </TextLine> | |
| <TextLine> |
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
| local middleclass = { | |
| _VERSION = 'middleclass v3.2.0', | |
| _DESCRIPTION = 'Object Orientation for Lua', | |
| _URL = 'https://github.com/kikito/middleclass', | |
| _LICENSE = [[ | |
| MIT LICENSE | |
| Copyright (c) 2011 Enrique García Cota | |
| Permission is hereby granted, free of charge, to any person obtaining a |
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
| requestAnimFrameSystem = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { | |
| return window.setTimeout(callback, Game.INTERVAL / 2); | |
| }; | |
| requestAnimFrame = function(callback) { | |
| return requestAnimFrameSystem(function() { | |
| var e; | |
| try { | |
| return callback(); | |
| } catch (_error) { |
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
| local Star = class('Star', Actor) | |
| function Star:init() | |
| self.position.x = random():range() | |
| self.position.y = random():range() | |
| local c = random():range() | |
| self.speed = c*0.005 | |
| self.drawing:setColor(c*1.5,c*1.5,c*1.5):addRect(0,0, 0.01*c, 0.01*c) | |
| end |
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> | |
| #include <time.h> | |
| #include <emscripten.h> | |
| #include "SDL/SDL_opengl.h" | |
| #include "nanovg.h" | |
| #define NANOVG_GLES2_IMPLEMENTATION | |
| #include "nanovg_gl.h" | |
| #include "nanovg_gl_utils.h" |
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
| if(Tools.viewTool == ViewTool.FPS){ | |
| // move the camera into the nearest sector, then set it to the correct player height | |
| // oooh boy, this is some silly shit ya gotta do to set the position properly :D | |
| // via https://github.com/MattRix/UnityDecompiled/blob/master/UnityEditor/UnityEditor/SceneViewMotion.cs#L136 | |
| float d = 0; | |
| Vector3 lastPosition = SceneView.lastActiveSceneView.camera.transform.position; | |
| Transform cameraTransform = SceneView.lastActiveSceneView.camera.transform; | |
| Sector currentSector = sectorEditor.map.sectors[0]; | |
| foreach(Sector s in sectorEditor.map.sectors){ |
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
| NSString *stringURL = @"https://dl.dropboxusercontent.com/u/43672/Test_dlopen.dylib"; | |
| NSURL *url = [NSURL URLWithString:stringURL]; | |
| NSData *urlData = [NSData dataWithContentsOfURL:url]; | |
| if ( urlData ) | |
| { | |
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentsDirectory = [paths objectAtIndex:0]; | |
| NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"Test_dlopen.dylib"]; | |
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
| -- extracted from http://dwarffortresswiki.org/index.php/Character_table | |
| -- (?:.*?\|){3}([a-z0-9]*.)(?:.*?\|){2}([0-9]*)}} extraction regex | |
| -- you need to jump through some hoops to extract the unicode code points from lua strings, but it is doable | |
| local char437hash = { | |
| [0x263A] = 1, | |
| [0x263B] = 2, | |
| [0x2665] = 3, | |
| [0x2666] = 4, | |
| [0x2663] = 5, |
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 * as m from "mglue"; | |
| import {Vector, Color, Keyboard, Random} from "mglue"; | |
| class Shot extends m.Actor | |
| { | |
| begin() | |
| { | |
| this.drawing | |
| .setColor(Color.yellow) | |
| .addRect(0.02) | |
| } |