Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <unistd.h>
#include <semaphore.h>
#include <string.h>
#include <pthread.h>
typedef struct {
int value;
# HexFiend script to parse ThinkTanks .ter files
section "Header" {
# Read the version (int32)
set version [int8 version]
set gridShift 8
set lmShift 9
# If version > 3, parse additional fields
if {$version > 3} {
template <typename V, int S, int T>
class TableLookup {
public:
TableLookup(DataChunker* chunker) : mTables((S+(T-1)) / T, nullptr), mChunker(chunker), mNumEntries(0) {}
bool insert(U32 address, const V& value);
bool lookup(U32 address, V& value) const;
struct CommonUniforms {
projMat: mat4x4<f32>,
viewMat: mat4x4<f32>,
modelMat: mat4x4<f32>,
params1: vec4<f32>, // viewportScale.xy, lineWidth
params2: vec4<f32>, // alphaTestF, squareSize, hmX, hmY
lightPos: vec4<f32>,
lightColor: vec4<f32>,
sq01Tex : array<vec4<f32>, 16> // texcoord split over 2 vec4's
# tribes_extract_grid.rb
#
# Extracts tribes terrain data from ted volumes.
# Metadata will be outputted in JSON format.
#
# Copyright (C) 2024 James S Urquhart.
# Also makes use of LZH huffman decode tables and general decode logic.
#
require 'optparse'
/*
ZonedPortalObject
Implementation of a zoned portal object for TGE 1.4.2
Set "targetName" to the name of the target object used as the basis of the
view through the portal.
The view will oriented along the objects +y axis.
@jamesu
jamesu / Dockerfile
Created February 19, 2024 23:15
Generic build env
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y build-essential cmake libsdl2-dev libsdl2-mixer-dev libogg-dev libopenal-dev
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
@jamesu
jamesu / STB Font Prototype Code
Last active January 22, 2024 13:42
SDF Font Code prototype
AUTHORS
James S Urquhart ([email protected])
#
# Simple script - Print out pseudo-code for glTexGen* states
#
# Author: James Urquhart, [email protected]
#
# Put your code in the doCode at the end of the file.
#
require 'json'
GL_TEXTURE_2D = 1

Critiques of MatrixNode

  • Feels a little too heavy for a "node" class. My generic in-head idea is to provide a lightweight abstraction over existing stuff in order to compliment it
  • Doesn't seem to allow for scaling ranges which some animations use, though may be impractical to implement anyway

NodeTransforms:

  • Feels hard to read - why do we need links etc?
  • NodeTransforms::NodeTransforms constructors - whats itterative do?