Skip to content

Instantly share code, notes, and snippets.

diff -r edf0303cbcb5 src/noggit/mpq/archive.cpp
--- a/src/noggit/mpq/archive.cpp Tue Jan 17 23:22:44 2012 +0100
+++ b/src/noggit/mpq/archive.cpp Sun Nov 02 16:35:29 2014 -0800
@@ -51,10 +51,10 @@
if (SFileOpenFileEx (_archive_handle, "(listfile)", 0, &file_handle))
{
- const size_t filesize (SFileGetFileSize (file_handle));
+ const size_t filesize (SFileGetFileSize (file_handle, 0));
@jrsa
jrsa / fm5.ck
Created October 28, 2015 06:49
fun int[][] genPitches(int setCount, int setLength, int pitchRange)
{
int result[setCount][setLength];
for(0 => int i; i < setCount; i++)
for(0 => int j; j < setLength; j++)
(0, pitchRange) => Math.random2 => result[i][j];
return result;
}
80 => int bpm;
loading chugin 'chugl.chug'
error loading chugin 'chugl.chug', skipping
error from chuck_dl: 'dlopen(/usr/local/lib/chuck/chugl.chug, 2): Library not loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
Referenced from: /usr/local/lib/chuck/chugl.chug
Reason: Incompatible library version: chugl.chug requires version 64.0.0 or later, but ApplicationServices provides version 1.0.0'
kernel vec4 fisheye(sampler img, float signcurvature, float lensradius)
{
// no constants/defines?
float EPSILON = 0.000011;
float otherConst = 1.4427;
float curvature = abs(signcurvature);
float extent = lensradius;
float optics = extent / log2(curvature * extent + 1.0) / otherConst;
/*
A Core Image kernel routine that computes a multiply effect.
The code looks up the source pixel in the sampler and then multiplies it by the value passed to the routine.
*/
kernel vec4 basicSharp(sampler image, float width)
{
vec2 center = sample(image, samplerCoord(image));
// width = 1.0 /width;
diff --git a/chugl_mac.mm b/chugl_mac.mm
index 5cd32a1..1fb4612 100644
--- a/chugl_mac.mm
+++ b/chugl_mac.mm
@@ -28,7 +28,8 @@
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <OpenGL/OpenGL.h>
-#import <CoreGraphics/CoreGraphics.h>
+//#import <CoreGraphics/CoreGraphics.h>
diff --git a/src/chuck_emit.cpp b/src/chuck_emit.cpp
index 7024c51..0e35cff 100644
--- a/src/chuck_emit.cpp
+++ b/src/chuck_emit.cpp
@@ -4494,7 +4494,7 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp )
// handle need this
emit->code->need_this = exp->ck_func->is_member;
// name it
- emit->code->name = "spork~exp";
+ emit->code->name = exp->ck_func->name;
kernel vec4 basicBlur(sampler image, float width)
{
// get coordinates of the current pixel
vec2 center = samplerCoord(image);
// sum the current pixel and 4 pixels around it
vec4 result = sample(image, center);
result += sample(image, samplerTransform(image, samplerCoord(image) + vec2(-width, -width)));
result += sample(image, samplerTransform(image, samplerCoord(image) + vec2( width, -width)));
result += sample(image, samplerTransform(image, samplerCoord(image) + vec2( width, width)));
// chuck patch that takes in x, y from processing and
// uses them as complex frequency bins to be fed into
// an inverse fourier transform
IFFT ifft => dac;
0.25 => ifft.gain;
512 => int size;
size / 2 => int arraySize;
complex s[ arraySize ];
@jrsa
jrsa / wotlk.cy.js
Last active May 26, 2023 07:44
snippets of cycript code for messing with wow's rendering (client version 3.3.5a / build 12340)
// here i am getting a pointer to the games camera, starting from
// s_currentWorldFrame which has a known address in the games memory.
// that static variable points to an instance of CGWorldFrame, which
// houses a lot of the rendering stuff, including the camera. the
// camera, among other things, has a variable for the field of view
// which is what ends up at *fovptr.
var s_currentWorldFrame = @encode(int*)(0xEEEA8C) // static pointer to active world frame
var m_camera = 32280; //offset of cgcamera pointer in worldframe object
var m_fov = 64; // offset of fov (field of view) value in cgcamera object (just a floating point number)