Skip to content

Instantly share code, notes, and snippets.

James Urquhart jamesu

Block or report user

Report or block jamesu

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
@jamesu
jamesu / decrypt_onverse.rb
Last active Feb 1, 2019
Decrypt Onverse script files
View decrypt_onverse.rb
# Decrypts and prints a rudimentary decompilation of onverse script files
# Usage: ruby decrypt_onverse.rb in.cs
#
require 'json'
$is_encrypted = true
def decrypt_data(size, data)
if !$is_encrypted
return data
View Tribes 1 Model Formats.txt
Tribes 1 Model Formats
----------------------
Tribes 1 uses file formats which are similar to file formats used in the Torque Game Engine, with the major difference being more use of tags and versioned objects serialized by class name (working on the same basic principle of class instantiation in torques' console system). Also a lot more emphasis on paletted textures.
Currently this document only covers enough to render .dts shapes present in Tribes 1. For tribes 2 file formats, your best bet is to check out the earlier torque code.
We'll refer to each field as [type] [name or tag value]. If successive fields need to be at a specific offset indicated by a field, that will be noted with "@nameOffset:" where appropriate. In addition if there is a list of typed data, it will be listed as "type[size]:" followed by the fields of that type.
@jamesu
jamesu / TorqueVisRules.natvis
Created Apr 3, 2018
Torque3D vis rules for Visual Studio
View TorqueVisRules.natvis
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="Vector&lt;*&gt;">
<DisplayString>{{ size={mElementCount} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">mElementCount</Item>
<Item Name="[capacity]" ExcludeView="simple">mArraySize</Item>
<ArrayItems>
<Size>mElementCount</Size>
<ValuePointer>mArray</ValuePointer>
View cryptokitty_gen.rb
# Script to generate cryptokitty images using assets from:
# https://github.com/BytesForBites/cryptokitty-designer
# NOTE: requires imagemagick built with --with-librsvg
require 'rubygems'
require 'rmagick'
require 'digest'
class KittyGen
View cat_avatar.rb
require 'rubygems'
require 'rmagick'
require 'digest'
def build_cat(seed=nil)
srand(Digest::MD5.hexdigest(seed.to_s)[0...6].to_i(16)) if !seed.nil?
# throw the dice for body parts
parts = [
['body', rand(15)+1],
@jamesu
jamesu / torque_net_connection
Created Dec 5, 2016
Example connection class for Torque2D/Torque3D network code
View torque_net_connection
// Example connection class for Torque2D/Torque3D network code
class ExampleNetConnection : public NetConnection
{
public:
typedef NetConnection Parent;
static const U32 CurrentProtocolVersion;
static const U32 MinRequiredProtocolVersion;
/// Configuration
View test_pbms_client.rb
#-----------------------------------------------------------------------------
# Test PBMS master client
# ( use with https://github.com/jamesu/PushButton-Master-Server )
#
# Copyright (C) 2016 James S Urquhart.
#
# 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, and/or
@jamesu
jamesu / premake5.lua
Last active Jan 16, 2019
Torque3D premake build file. Generates a suitable project for T3D with premake.
View premake5.lua
-- premake5.lua
-- Project file creator for T3D
-- Usage: premake5 <toolchain>
-- (C)2016-2019 James S Urquhart. Feel free to use wherever.
--
-- Instructions:
-- * Copy Templates/Full to a folder in "My Projects"
-- * Change PROJECT_NAME to match this folder name
-- * Change WORKSPACE_NAME to your desired workspace name
@jamesu
jamesu / openvr.cs
Created Jun 14, 2016
Current openvr base code for Torque3D
View openvr.cs
// Only load these functions if an Oculus VR device is present
if(!isFunction(OpenVRIsCompiledIn))
return;
$Video::VREnabled = false;
function setupOpenVRActionMaps()
{
new ActionMap(VRCanvasMap);
@jamesu
jamesu / kaboom.cpp
Created May 2, 2016
A casual exploration of potential hash conflicts
View kaboom.cpp
// Don't ask
#include "core/crc.h"
struct GFXSamplerStateDesc2
{
GFXTextureAddressMode addressModeU;
GFXTextureAddressMode addressModeV;
GFXTextureAddressMode addressModeW;
You can’t perform that action at this time.