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
| #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
| 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
| 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 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
| <?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
| // 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
| // types | |
| typedef struct lipsynth_Module lipsynth_Module; | |
| struct lipsynth_Module { | |
| // blah blah a bunch of values and pointers and stuff | |
| // the only one that I am getting confused about | |
| int module_registration; | |
| }; | |
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 "module_sine.h" | |
| typedef enum { | |
| NOTE, | |
| VOL | |
| } lipsynth_sine_params; | |
| int lipsynth_module_sine_destroy(void *self){ | |
| return 1; | |
| } | |
| void lipsynth_module_sine_update(void *self, lipsynth_context *ctx, lipsynth_AudioMemory *outputBuffer){ |
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 lipsynth_module_sine_update(void *self, lipsynth_context *ctx, lipsynth_AudioMemory *outputBuffer){ | |
| lipsynth_module_sine* module = self; | |
| // fill up the output buffer with a sine wave! | |
| for(int i=0;i<ctx->bufferLength/2;i++){ | |
| // must be called before any parameters are read | |
| if(module->_(lipsynth_Module_update_parameters)(self, ctx)){ | |
| if(module->_(lipsynth_Module_has_parameter_value)(self, ctx, NOTE)){ | |
| int noteVal = module->_(lipsynth_Module_get_parameter_value)(self, ctx, NOTE); | |
| module->freqVal = pow(2.0, (noteVal)/12.0f)*440.0f; | |
| } |