Skip to content

Instantly share code, notes, and snippets.

@mrwonko
mrwonko / Jedi Academy and mods.game
Created May 3, 2012 19:32
GTK Radiant Jedi Academy settings
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<game
name="Jedi Knight Jedi Academy"
enginepath_win32="D:/Modding/JKA/GameData"
gametools_win32="D:/Modding/JKA/GameData/ZeroRadiant"
engine_win32="jasp.exe"
mp_engine_win32="jamp.exe"
basegame="base"
shaderpath="shaders"
default_scale="0.25"
@mrwonko
mrwonko / dxdiag.txt
Created May 9, 2012 22:25
Result of DxDiag on my PC
------------------
System Information
------------------
Time of this report: 5/10/2012, 00:20:57
Machine name: WILLI-SEVEN
Operating System: Windows 7 Professional 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.120305-1505)
Language: German (Regional Setting: German)
System Manufacturer: Gigabyte Technology Co., Ltd.
System Model: EP35-DS3
BIOS: Award Modular BIOS v6.00PG
@mrwonko
mrwonko / ScrnSrt.asm
Created May 15, 2012 10:47
Assembler Project 05 - sorting the screen buffer
DOSSEG
.MODEL MEDIUM ; 1x Data, Nx Code
.STACK
; Exportierte Symbole
PUBLIC Sortiere
PUBLIC Save
PUBLIC Restore
@mrwonko
mrwonko / layout_main.lua
Created May 25, 2012 09:22
Draft of my UI definitions
-- main menu layout:
-- title on top, buttons below
local margin = width * 0.05
local titleHeight = 100
local menuWidth = 400
Layout
{
name = "main",
@mrwonko
mrwonko / template.cpp
Created May 25, 2012 19:49
function pointer template
template<const std::vector<std::string> (*function)(const std::string&)> luabind::object StringVectorAsTable(const std::string& argument, lua_State* L)
{
luabind::object result = luabind::newtable(L);
std::vector<std::string> vec = function(argument);
std::vector<std::string>::iterator end = vec.end();
unsigned int index = 0;
for(std::vector<std::string>::iterator it = vec.begin(); it != end; ++it)
{
result[++index] = *it;
}
@mrwonko
mrwonko / wizualize.cpp
Created June 27, 2012 14:44
FH-Wedel Programmierwettbewerb 2012 - creating TGAs based on program output
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
void printUsage()
{
std::cout<<"Usage: echo [data] | yourProgram | wizualize <width (= height)> <output directory>"<<std::endl;
}
@mrwonko
mrwonko / gla_range.py
Last active November 22, 2023 16:03
Jedi Knight 2/3 .gla animation subrange extruder
#! /usr/bin/python
GLA_IDENT = b"2LGA"
GLA_VERSION = 6
import struct
class MdxaHeader:
def __init__( self ):
@mrwonko
mrwonko / gla_convert.py
Created July 12, 2012 22:53
Raven Software Ghoul 2 Animation retargetting script
#! /usr/bin/python
import struct
####
#### Matrix Math
####
# N-Dimensional vector with operators == and * (dot product)
class Vector:
@mrwonko
mrwonko / errorhandling.lua
Created July 31, 2012 13:07
some lua error catching examples
local success, message = pcall(error, "this is an error")
if not success then
print("Caught error:", message)
end
local success, message = xpcall(
error,
function(err)
return debug.traceback(err, 3)
end,
@mrwonko
mrwonko / luaCountHook.lua
Created July 31, 2012 13:23
a lua hook that's called every 1000 instructions
local function hook(event)
assert(event == "count")
local info = debug.getinfo(2, "Sl") -- get source file related info (S) and current line (l)
error("Code took to long (over 1000 instructions), aborted at file \"" .. info.short_src .. "\" line " .. info.currentline)
end
debug.sethook(hook, "", 1000) -- "" = when to call this hook, if any of "every line", "every function call" or "every function return", 1000 = call every 1000 instructions
local i = 0
while true do
print(i)