This file contains 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
// Everything except stb_image was made by Felipe Alfonso (@bitnenfer) | |
// | |
// This is a crappy software but it does what it needed from it. It just | |
// transform images (PNG, JPG, TGA, etc.) to DMG encoded tiles. It wont check | |
// for repeating tiles. Maybe in the future I can add that. | |
// | |
// Compile with GCC. gcc img2dmg.c -o img2dmg | |
// and it's done. | |
// | |
// Usage: |
This file contains 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
/* x64 Fast tiny pool of 64 elements that allows random allocation and freeing */ | |
/* by Felipe Alfonso - http://voitptr.io */ | |
#include <stdint.h> | |
#if _WIN32 | |
#include <intrin.h> | |
#endif | |
template<typename T> | |
struct TinyPool | |
{ | |
#if _WIN32 |
This file contains 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
/***************************************************************************** | |
** pngb.c | |
** | |
** Code for the PNG GB Converter. | |
** Currently this module contains all the code for the converter except for | |
** the PNG loading routines (We are using LodePNG for that) and the program | |
** entry point (and command line parsing), which are in main.c. | |
** | |
** Copyright (c) 2015 Elias Zacarias | |
** |
This file contains 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
// This is the WebGL code: | |
// ====================== | |
// GL function shortcuts taken from: http://xem.github.io/articles/archive.html#webgl_quest | |
for(i in g)g[i[0]+i[6]]=g[i]; | |
// `with` helps us avoid doing g.xxx() and just do xxx() | |
with(g) | |
// Time variable. |
This file contains 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
@echo off | |
cls | |
rem ================================================ | |
rem ================================================ | |
rem The project structure looks like this: | |
rem ROOT_PATH/ | |
rem PROJECT_NAME/ | |
rem code/ |
This file contains 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
var fps = { | |
startTime : 0, | |
frameNumber : 0, | |
getFPS : function() | |
{ | |
var d = Date.now(); | |
var currentTime = (d - this.startTime) / 1000; | |
var result = Math.floor(++this.frameNumber / currentTime); | |
if(currentTime > 1) | |
{ |
This file contains 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
let canvas, gl; | |
let lastTime = 0; | |
const vShaderSource = ` | |
precision mediump float; | |
attribute vec2 vtxPosition; | |
void main() | |
{ | |
gl_Position = vec4(vtxPosition, 0.0, 1.0); | |
} |
This file contains 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
// three.js rev. 70 - Last version of three.js fails to run on cocoon. | |
// pixi.js v3.0.10 | |
var canvas = document.getElementById('canvas'), | |
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'), | |
scene, camera, threeRenderer, geometry, hemiLight, dirLight, | |
material, cube, logoSprite, pixiRenderer, stage, | |
// Three.JS specific | |
setupThree = function () { | |
var d = 50; | |
scene = new THREE.Scene(); |
This file contains 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
struct soa_vector4 | |
{ | |
union alignas(16) | |
{ | |
struct | |
{ | |
float x[4]; | |
float y[4]; | |
float z[4]; | |
float w[4]; |
This file contains 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
inline static void sse_mat4_add(__m128* m0, __m128* m1, __m128* dst) | |
{ | |
dst[0] = _mm_add_ps(m0[0], m1[0]); | |
dst[1] = _mm_add_ps(m0[1], m1[1]); | |
dst[2] = _mm_add_ps(m0[2], m1[2]); | |
dst[3] = _mm_add_ps(m0[3], m1[3]); | |
} |