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
class Node | |
{ | |
public var ci : Array<Int>; /* channel in */ | |
public var co : Array<Int>; /* channel out */ | |
public var i : Int; /* id */ | |
public var b : Int; /* behavior */ | |
public var a : Bool; /* alive */ | |
public function new(i,a) { ci = []; co = []; this.i = i; this.b = -1; this.a = 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
import endians | |
import sdl2 | |
import sdl2.image | |
discard IMG_Init | |
proc loadImage*(filename:string):PSurface= | |
var suce = IMG_Load(cstring(filename)) |
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
type | |
Array32Part{.unchecked.} = array[0..0, float32] | |
Buffer32 = ref object | |
samples: int | |
bytes: int | |
data: ptr Array32Part | |
proc AllocBuffer32(samples : int): Buffer32 = | |
let bytes = samples * (sizeof(float32)) | |
Buffer32(samples: samples, bytes : bytes, data: cast[ptr Array32Part](alloc0(bytes))) |
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
when isMainModule: | |
import strutils | |
import common | |
import vector2 | |
import vector3 | |
import euler | |
import quaternion | |
import math3 | |
import math |
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
type Thing = ref object | |
x* : float | |
var t0 : Thing; new(t0); | |
var r0 : ref float = cast[ref float](addr(t0.x)) | |
t0.x = 10.0 | |
doAssert(r0[] == 10.0) |
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
discard """ | |
Slactuate - a rude tweening library. | |
Copyright © 2015 James W. Hofmann | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the “Software”), | |
to deal in the Software without restriction, including without limitation the | |
rights to use, copy, modify, merge, publish, distribute, sublicense, |
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
luastate.register("matchEntity", proc (state : PState):cint {.cdecl.} = | |
var i1 = (state.tointeger(-1)); state.pop(1) | |
var i0 = (state.tointeger(-1)); state.pop(1) | |
if not game.matchtile: | |
let arch0 = game.entity[game.matcha].d[0] | |
let arch1 = game.entity[game.matchb].d[0] | |
if (arch0 == i0 and arch1 == i1): | |
state.pushboolean(cint(true)) |
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
/* Urobo, a videogame engine. Strength through self-reference. | |
* By James Walter Hofmann. | |
*/ | |
/*********** | |
ENUMS | |
***********/ | |
enum AttributeType | |
{ |
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 <stdio.h> | |
#include <stdlib.h> | |
int collide(int data[25], int collision_mapping[3]) { | |
int collision = 0; | |
int i0 = 0; | |
for (i0 = 0; i0 < 25; i0++ ) | |
{ | |
collision += collision_mapping[data[i0]]; | |
} |
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
package; | |
import kha.Framebuffer; | |
import kha.Game; | |
import kha.Image; | |
import kha.Loader; | |
import kha.Configuration; | |
import kha.Scaler; | |
import kha.Color; |