Skip to content

Instantly share code, notes, and snippets.

Sgeo

Block or report user

Report or block Sgeo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Sgeo
Sgeo / SOs.json
Created Oct 18, 2019
X_ITE SharedObjects
View SOs.json
[
{
"name": "5000 EXP Trophy",
"id": "5000exp",
"url": "/dbobjects/5000/5000exp.wrl",
"position": {"x": 0.0, "y": 1.75, "z": 0.0},
"rotation": {"x": 0.0, "y": 1.0, "z": 0.0, "angle": 0.0}
}
]
View fixgray.js
// This code is NOT spec compliant: An RGB texture can be mistaken for an intensity texture if all its pixels happen to be gray.
// I suspect this will not particularly affect a lot of textures, but it is a possibility
// This also needs to check all URLs rather than the first, preferably the same way X3DOM does if possible
// Also better error handling
function fixGray(imageTexture) {
var url = imageTexture.getFieldValue("url")[0];
var img = new Image();
@Sgeo
Sgeo / DNA.cpp
Created Aug 9, 2019
Source code for Langton's loops CA in MCell
View DNA.cpp
/* DNA.cpp
*
* This automata was designed by Christopher G. Langton at the University
* of Michigan, and is described in his article "Self-Reproduction in
* Cellular Automata", published in the book "Cellular Automata" in 1984.
*
* As described in the above article, this automata is "realistic" and
* "non-trivial", in the following ways:
*
* The reproduction is not simply due to the particular rules used in
View novfx1.c
#include <stdio.h>
#include <stdarg.h>
#include <dos.h>
#include <i86.h>
#include <conio.h>
#include "vfx1.h"
extern unsigned _psp;
unsigned __far *psp_pointer;
unsigned _get_memsize();
@Sgeo
Sgeo / CONVERT.C
Created Jun 20, 2019
Part of convert.c in the i-Glasses SDK. Note that "raw" should be called "cooked". An emulator needs to reverse this math.
View CONVERT.C
void rawToEulerInt(long rawMagneticX,long rawMagneticY,long rawMagneticZ,
long rawGravimetricX,long rawGravimetricY,
long * eulerYaw,long * eulerPitch,long * eulerRoll) {
vec3 rotMagnetic;
vec2 linGravimetric;
vec2 normRotMag;
sinCos pitch,roll;
#ifdef USE_FILTERS
if (!madeFilters) {
View vp_circuits.py
def prim(name, default, actions):
action_string = ", ".join(actions)
if default:
animate_string = ", animate me . 1 1 0"
else:
animate_string = ""
print("create name %s%s; adone %s" % (name, animate_string, action_string))
def action_prim_mem(name, value):
action_string = "animate %s . 1 1 %s" % (name, ("0" if value else "2147483647"))
@Sgeo
Sgeo / SDL_keycode.h
Last active Oct 1, 2018
vice32.js .. modifications off VICE 3.2 branch.
View SDL_keycode.h
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@Sgeo
Sgeo / library_sdl.js
Last active Sep 16, 2018
Custom library_sdl.js to fix SDL1 keycodes. Possible issues.
View library_sdl.js
//"use strict";
// See browser tests for examples (tests/runner.py, search for sdl_). Run with
// python tests/runner.py browser
// Notes:
// SDL_VIDEORESIZE: This is sent when the canvas is resized. Note that the user
// cannot manually do so, so this is only sent when the
// program manually resizes it (emscripten_set_canvas_size
// or otherwise).
View vice.patch
Index: configure.proto
===================================================================
--- configure.proto (revision 35456)
+++ configure.proto (working copy)
@@ -2847,89 +2847,6 @@
fi
dnl check for opengl libs.
- AC_MSG_CHECKING(whether we can use the GL library)
-
View working_scoped_take_mut_lifetimes.rs
use std::marker::PhantomData;
use std::cell::Cell;
struct Scope<'s> {
num: Cell<usize>,
phantom: PhantomData<Cell<&'s mut ()>>,
//ms: Vec<&'s mut i32>, <-- useful trick for understanding lifetimes
}
impl<'s> Scope<'s> {
You can’t perform that action at this time.