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
(module | |
;; --- Import from host: print(offset: i32) -> void | |
(import "env" "print" (func $print (param i32))) | |
;; --- Linear memory: fixed at 2 pages (128 KiB) --- | |
(memory (export "memory") 2 2) | |
;; --- Data segment: static string --- | |
(data (i32.const 16) "Hello World\00") |
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 <sys/wait.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <semaphore.h> | |
#include <string.h> | |
#include <pthread.h> | |
typedef struct { | |
int value; |
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
# 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} { |
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
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; |
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
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 |
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
# 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' |
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
/* | |
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. |
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
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/* |
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
AUTHORS | |
James S Urquhart ([email protected]) |
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
# | |
# 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 |
NewerOlder